Fix missing View details link for invalid plugins

This commit is contained in:
2025-04-13 01:44:44 +01:00
parent df9bd9d43e
commit eb496a79c0

View File

@ -142,6 +142,11 @@ class Fix_Plugin_Does_Not_Exist_Notices {
foreach ( $invalid_plugins as $plugin_path ) { foreach ( $invalid_plugins as $plugin_path ) {
if ( ! isset( $plugins[ $plugin_path ] ) ) { if ( ! isset( $plugins[ $plugin_path ] ) ) {
$plugin_name = basename( $plugin_path ); $plugin_name = basename( $plugin_path );
$plugin_slug = dirname( $plugin_path );
if ( '.' === $plugin_slug ) {
$plugin_slug = basename( $plugin_path, '.php' );
}
$plugins[ $plugin_path ] = array( $plugins[ $plugin_path ] = array(
'Name' => $plugin_name . ' <span class="error">(File Missing)</span>', 'Name' => $plugin_name . ' <span class="error">(File Missing)</span>',
/* translators: %s: Path to wp-content/plugins */ /* translators: %s: Path to wp-content/plugins */
@ -150,11 +155,14 @@ class Fix_Plugin_Does_Not_Exist_Notices {
'<code>/wp-content/plugins/</code>' '<code>/wp-content/plugins/</code>'
), ),
'Version' => FPDEN_VERSION, // Use our plugin version instead of 'N/A' 'Version' => FPDEN_VERSION, // Use our plugin version instead of 'N/A'
'Author' => '', 'Author' => 'Marcus Quinn & WP ALLSTARS',
'PluginURI' => '', 'PluginURI' => 'https://www.wpallstars.com',
'AuthorURI' => '', 'AuthorURI' => 'https://www.wpallstars.com',
'Title' => $plugin_name . ' (' . __( 'Missing', 'wp-fix-plugin-does-not-exist-notices' ) . ')', 'Title' => $plugin_name . ' (' . __( 'Missing', 'wp-fix-plugin-does-not-exist-notices' ) . ')',
'AuthorName' => '', 'AuthorName' => 'Marcus Quinn & WP ALLSTARS',
// Add fields needed for the "View details" link
'slug' => $plugin_slug,
'plugin' => $plugin_path,
); );
} }
} }