performance icon indicating copy to clipboard operation
performance copied to clipboard

Add settings links to Performance features screen

Open westonruter opened this issue 10 months ago • 2 comments

Feature Description

Certain plugins have settings (e.g. Modern Image Formats and Speculative Loading). However, discovery of how to access these plugins' settings is not facilitated on the Performance features screen:

image

Just as we've added plugin row action links for these plugins (#1131, #1036), we should facilitate discovery on the Performance screen as well.

westonruter avatar Apr 15 '24 17:04 westonruter

Yes complety agree, i was searching for settings so many times for each plugins...

benoitfouc avatar Apr 16 '24 13:04 benoitfouc

The settings link can be discovered (as of https://github.com/WordPress/performance/pull/1145 and #1146) by manually applying the plugin_action_links_{slug} filter, at least for webp-uploads and speculation-rules. For example:

$links = apply_filters( "plugin_action_links_{$plugin_main_file}", array() );
$settings_link = $links['settings'] ?? null;

Reminder: The plugin main file (e.g. speculation-rules/load.php) is not the same as the slug (e.g. speculation-rules).

Related: If we do go with Ajax-activation of plugins in https://github.com/WordPress/performance/issues/1139 then the settings link as provided by the standalong plugin may not be known before the plugin is activated. As such, another Ajax request may be needed to fetch the settings links unless we hard-code them in the Performance Lab plugin.

westonruter avatar Apr 17 '24 00:04 westonruter

I would like to work on this.

ashwinparthasarathi avatar May 07 '24 19:05 ashwinparthasarathi