Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow selecting individual themes or plugins to scan. #67

Open
octalmage opened this issue Sep 26, 2016 · 8 comments
Open

Allow selecting individual themes or plugins to scan. #67

octalmage opened this issue Sep 26, 2016 · 8 comments

Comments

@octalmage
Copy link

Idea from WordPress.org:

https://wordpress.org/support/topic/checking-a-single-plugintheme/

@Pross
Copy link

Pross commented Sep 26, 2016

Something like this?
screen shot 2016-09-26 at 21 29 55

@davidwolfpaw
Copy link

I was about to open the same ticket. Instead I'll bump this one back up!

Certain plugins I know are OK to skip, not necessarily because they have no issues, but because I know that they will be too large to scan anyway, while taking plenty of time to get to the point of realizing that. Many of those plugins are ones that I would generally trust to remain compatible thanks to the large teams and regular updates they receive.

A few examples on some sites that I've scanned that get skipped for being too large: Gravity Forms, iThemes Security Pro, Jetpack, SearchWP, The Events Calendar, Yoast SEO. These are all ones that I'd generally assume to be compatible before assuming that they'd be incompatible.

If I could select some plugins to skip scanning, the scans would run faster and use fewer resources of the server to run.

@ScottDeLuzio
Copy link

+1 for this feature also. I've found myself installing a plugin, not knowing whether or not it is compatible with a PHP version. It would be nice to scan just that one plugin on a staging site before installing. I don't need to scan the whole site since I've already done that.

@Julix91
Copy link

Julix91 commented Feb 4, 2020

Main reason I'd like to do this is also to skip the ones that are too big, since I heard about that in the reviews...

Shouldn't there be a check on size of the plugin before starting? Is the timeout a readable value? If so couldn't it estimate (size of plugin times pessimistic processing speed times timeout = success or failure estimate). Guess that's a different ticket, but I'm sure it also already exists somewhere.

Also some kind of progress indicator would be nice, though I understand that 99% of progress indicators are lying and just exist to make people feel better... I'm not sure I'm suggesting that. It could be size of the plugin that's been checked vs total size of plugin - if that makes sense... I do understand that might further add to the overhead perhaps... could add a skip button for when it gets stuck?

I guess many plugins and themes are already compatible now so the urgency of the plugin is somewhat less - but theoretically there could always be a PHP 9 at some point right, and a lot of links point at this plugin as the best tool for php compat testing.

Edit: Went out for lunch, came back, still loading...

Screen Shot 2020-02-04 at 1 14 28 PM

Can't tell if it's actually making progress or stuck somehow. It's a large and popular plugin that I trust to be compatible... I'd like to skip it.


I guess an option would be to just disable it temporarily.
Disable all plugins except the ones I actually want to test.

That's inconvenient but already possible - so I guess I shall just look for the conditional that checks for that and see if it's extendible somehow.

@Julix91
Copy link

Julix91 commented Feb 4, 2020

Okay just tested disabling all except one at a time - and that did work... but I like having some plugins hanging around in disabled state (cause I don't actually use them most of the time, just want to be able to add and remove when I do need them briefly) - so with this solution I have to remember which ones were active before etc. to restore that state after everything was tested. Not great.

I like what @Pross was suggesting for testing specific ones.

I like @davidwolfpaw 's input for having a list of skippable plugins... user editable of course.

I'll play with the code a little and see if it's something I could help with.

@Julix91
Copy link

Julix91 commented Feb 4, 2020

Using the normal bulk features in plugin screen would also be nice (i.e. select the ones you want and then check just those)

@Julix91
Copy link

Julix91 commented Feb 4, 2020

In case I don't follow through and actually make a PR and someone else wants to:

In the src folder the wpephpcompat.php file has the conditional to skip plugins when "only active" is "yes".

Could create a skip list (i.e. comma separated list [can commas be in plugin names? if so needs to be separated by something else) that gets turned into an array and similar to the lines above if the current plugin is in the list skip...

That's where

Screen Shot 2020-02-04 at 1 47 56 PM

Of course, would need to add the option for storing the list somewhere on the plugin screen - same as where the is active only check gets added.

@Julix91
Copy link

Julix91 commented Feb 4, 2020

Added a skip_list (see PR #258 ) - but I didn't add the same functionality to the command-line version as I had seen someone suggest in a review... - would be nice to get some responses, see if this is a problem relevant for other people still.

I'm not really sure how to go about implementing @Pross 's suggestion - but I have seen some plugins do that kind of thing before, adding options like that... though I'm not sure I've seen one plugin ad an option like that to all other plugins (only their own or post types)...

This function here adds the link / scan call to action to the plugin:

public function filter_plugin_links( $links ) {
		if ( current_user_can( WPEPHPCOMPAT_CAPABILITY ) ) {
			$url = add_query_arg( 'page', WPEPHPCOMPAT_ADMIN_PAGE_SLUG, admin_url( 'tools.php' ) );
			array_unshift( $links, '<a href="' . esc_url( $url ) . '">' . esc_html__( 'Start Scan', 'php-compatibility-checker' ) . '</a>' );
		}
		return $links;
	}

It's called here:

Screen Shot 2020-02-04 at 3 20 17 PM

That means it seems that to add a link like suggested above we'd at least need to loop through all active plugins to add a filter like that... not sure if timing might be an issue with that - wouldn't want to overwrite any plugin actions which the other plugins had added to themselves...

And that's only part of the problem - this is effectively just a link.
We could easily list out all the plugins on the check plugins page, or make a new one, but then it still needs to call the functionality... and so far I don't see functionality for checking just one plugin anywhere in the code, it's just in that loop.

Wonder if that's why it hadn't been implemented earlier, because some refactoring might be in order to do that properly... hm.

On the other hand if we go through the loop and run a conditional to check each if it is the one with the name that matches the one we're looking for and only then checks it's effectively what we want - so just tagging on the functionality wouldn't be much of an issue probably.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants