WordPress / performance

Performance plugin from the WordPress Performance Group, which is a collection of standalone performance modules.

Home Page:https://wordpress.org/plugins/performance-lab/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Indicate plugins in list table which are installed by Performance Lab

westonruter opened this issue · comments

Feature Description

Currently when a user activates a feature on the Performance screen, this installs a plugin. The user doesn't know this, however. When they go to their plugins list table and see additional plugins unexpectedly, it's possible they could get alarmed. In #1046 we discussed some possibilities for improving the way that plugins are bundled together under the Performance Lab brand, with one possibility being to add a "Performance Lab" prefix to each plugin. This seems to not be moving forward, however. But here's an alternative: what if as part of the plugin row meta there is a "From Performance Lab" bit that is added like as follows:

image

Clicking on "Performance Lab" could take the user to the Performance screen. This plugin row meta could be added by the Performance Lab plugin when it is active (cf. #1052 which dynamically prefixes feature plugin names with "PL" when the Performance Lab plugin is active).

Since none of the plugin assets (#1136) are displayed on the plugin list table, having this additional metadata may be helpful. Granted, it does currently say "By WordPress Performance Team", but that is not an explicit connection to the Performance Lab plugin.

I really like this idea. I also wonder if we could change the link used for the WordPress Performance Team to point to a page that promotes Performance Lab more, rather than just the homepage of the main page for the team, which we don't really use.

I see now you tried that in #1052 as well.

To me it feels a bit redundant to have both "By WordPress Performance Team | From Performance Lab" in there back to back. Maybe change the order like in that POC?

Also, instead of prefixing the plugin name like in #1052, what about adding a suffix?

Screenshot 2024-05-17 at 09 32 13

Oh, a suffix is a good idea too. However, it would have to end up being bold like the rest of the plugin name.

If the way we do it is:

function perflab_add_pl_suffix_to_standalone_plugins( array $plugins ): array {
	$name_suffix = ' ' . __( '(Performance Lab)', 'performance-lab' );
	foreach ( array_keys( $plugins ) as $plugin_basename ) {
		if ( in_array( strtok( $plugin_basename, '/' ), perflab_get_standalone_plugins(), true ) ) {
			$plugins[ $plugin_basename ]['Name'] .= $name_suffix;
		}
	}
	return $plugins;
}
add_filter( 'all_plugins', 'perflab_add_pl_suffix_to_standalone_plugins' );

The plugin name is printed like so:

echo "<td class='plugin-title column-primary'><strong>$plugin_name</strong>";

Otherwise we could use JavaScript to inject the suffix, but that would not be as ideal.

Ah, I thought we could add some HTML in there, but it turns out it's stripped :(

@swissspidy

To me it feels a bit redundant to have both "By WordPress Performance Team | From Performance Lab" in there back to back. Maybe change the order like in that POC?

I do agree with this observation, but don't know what you were referring to when you said:

Maybe change the order like in that POC?

Knowing now that we can make the "By WordPress Performance Team" link to whatever we want, perhaps we can just consolidate to one link and make sure we're sending folks to a higher value page.

@joemcgill I think maybe he means put "(Performance Lab)" after the plugin name rather than prefixing the plugin name with "Performance Lab:"

I meant more like „By Performance Team | View details | Performance Lab“, but that‘s also easy to miss

@westonruter @swissspidy I would be happy to help here and get this into the plugin(s).
We will need to build a mechanism (if it doesn't exist) that easily applies to all sub-modules of the main PL plugin.

Thanks, any help is always appreciated! First we have to decide what we want to do.

What about the plugins ordering, it would be good for all the module plugins to be under Performance Lab plugin. We could indeed also customize the ordering, but wouldn't it be easier to prefix module plugin names with "Performance Lab: {plugin name}"?

It does look like prefixing with Performance Lab: was the consensus after looking through all the comments mentioning "prefix" on #1046.

If we prefix, I think the "Auto-sizes for Lazy-loaded Images" plugin name (currently our longest) will need to be shortened (maybe Lazy Image Auto-Sizes?). Here's how it appears in the "Learn More" lightbox in the admin:

image

Plugin list table:

image

image

image

If we prefix, I think the "Auto-sizes for Lazy-loaded Images" plugin name (currently our longest) will need to be shortened

I'm planning to update the name when we include the other sizes calculation improvements in the plugin anyway.

It does look like prefixing with Performance Lab: was the consensus after looking through all the comments mentioning "prefix" on #1046.

If the main issue is that folks get confused about the PL plugin auto installing other plugins, perhaps a mitigation would be to have the PL automatically prefixing the "sub" plugins in the WP admin by injecting the "Performance Lab:" prefix befire the plugins name. With that said it may be a bit confusing that the folder names are not prefixed and that if PL plugin is deactivated, suddenly all "sub" plugins are not prefixed anymore.

Side note: are we perhaps overthinking/overengineering something which is mid-low priority 🤔

@ThierryA I did explore dynamically-prefixing the plugin names with "Performance Lab:" in #1052 but this didn't seem to be the right direction per #1046 (comment).

Anyway, a static prefix works for me 😄

And on the Performance screen, the prefix can be stripped out when listing out the features.

Side note: are we perhaps overthinking/overengineering something which is mid-low priority 🤔

I think that may be the case. I think it's great to be able to show that all of these plugins are related by the fact that they're all made by the WordPress Performance Team, but I don't really think it's a major priority that these show up as a group in the plugin list table. If we do feel like it should be obvious that each of these are part of the Performance Lab program by looking at the name of the plugin, then we should probably just make "Performance Lab" part of the name of each plugin directly.

I also worry that we're starting to get into a bit of a circular semantic conversation about what we mean when we say "Performance Lab," since that term can now refer to the group of plugins we build in this mono-repo, or specifically to the "Performance Lab plugin," which itself is a plugin that we maintain within this mono-repo.

Has adopting the design language from the Plugin Dependencies feature already been discussed and discarded?

A standard Note: This plugin was installed by... that's below the plugin meta, similar in style to the new Note: this plugin cannot be activated or deactivated..., would provide a straightforward solve without worrying about prefixes, slug lengths, metadata density, or over/underengineering

@justlevine That's a very good idea. I've opened #1265 to implement this.