File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed
plugins/optimization-detective Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -236,11 +236,19 @@ function od_render_extensions_action_link( $links ) {
236236 */
237237function od_check_installed_extensions (): array {
238238 $ installed_plugins = get_plugins ();
239+ $ installed_extensions = array ();
240+
241+ foreach ( $ installed_plugins as $ plugin_slug => $ plugin_data ) {
242+ if ( isset ( $ plugin_data ['RequiresPlugins ' ] ) && 'optimization-detective ' === $ plugin_data ['RequiresPlugins ' ] ) {
243+ $ installed_extensions [] = $ plugin_slug ;
244+ }
245+ }
246+
247+ // Check for plugins without Requires Plugins header but known to be extensions.
239248 $ extensions = array (
240- 'image-prioritizer/load.php ' ,
241249 'embed-optimizer/load.php ' ,
242250 );
243- $ installed_extensions = array_intersect ( $ extensions , array_keys ( $ installed_plugins ) );
251+ $ installed_extensions = array_merge ( $ installed_extensions , array_intersect ( $ extensions , array_keys ( $ installed_plugins ) ) );
244252
245253 return $ installed_extensions ;
246254}
You can’t perform that action at this time.
0 commit comments