Improve notice positioning and appearance (v1.6.8)

This commit is contained in:
2025-04-12 14:52:35 +01:00
parent 10f6783cdb
commit 515336aa2b
6 changed files with 34 additions and 9 deletions

View File

@ -120,6 +120,13 @@ The plugin works by:
## Changelog ## Changelog
### 1.6.8
* Fixed notice positioning to appear directly below WordPress error messages
* Improved notice width to match WordPress error messages
* Updated explanatory text for better clarity
* Fixed issue with notices not appearing in some cases
* Improved JavaScript detection of WordPress error messages
### 1.6.7 ### 1.6.7
* Fixed duplicate notices issue by removing PHP-generated notice * Fixed duplicate notices issue by removing PHP-generated notice
* Simplified notice system to only show one notice below WordPress error * Simplified notice system to only show one notice below WordPress error

View File

@ -5,6 +5,9 @@
margin: 5px 0 15px; margin: 5px 0 15px;
font-size: 14px; font-size: 14px;
position: relative; position: relative;
width: 100%;
box-sizing: border-box;
max-width: none;
} }
.prc-notice h3 { .prc-notice h3 {
margin-top: 0; margin-top: 0;

View File

@ -15,10 +15,12 @@
// Find all error notifications about missing plugins // Find all error notifications about missing plugins
noticeContainers.forEach(function(notice) { noticeContainers.forEach(function(notice) {
if (notice.textContent.includes('Plugin file does not exist') || if ((notice.textContent.includes('Plugin file does not exist') ||
notice.textContent.includes('has been deactivated due to an error')) { notice.textContent.includes('has been deactivated due to an error')) &&
notice.classList.contains('error')) {
// We'll use the last matching notice as our target // We'll use the last matching notice as our target
targetNotice = notice; targetNotice = notice;
console.log('Found WordPress error notice:', notice.textContent);
} }
}); });
@ -43,12 +45,18 @@
ourNotice.innerHTML = '<h3 style="margin-top:0;color:#826200;">Fix Plugin Does Not Exist Notices ☝️</h3>' + ourNotice.innerHTML = '<h3 style="margin-top:0;color:#826200;">Fix Plugin Does Not Exist Notices ☝️</h3>' +
'<p>To remove these notices, scroll down to each plugin .php showing "<strong style="color:red">(' + pluginMissingText + ')</strong>", and click "<strong>' + removeNoticeText + '</strong>".</p>' + '<p>To remove these notices, scroll down to each plugin .php showing "<strong style="color:red">(' + pluginMissingText + ')</strong>", and click "<strong>' + removeNoticeText + '</strong>".</p>' +
'<p>This safely removes the missing active plugin reference from your database, using the standard WordPress function to update your active plugin options table with only the correct remaining installed and active plugins.</p>' + '<p>This safely removes the missing active plugin reference from your database.</p>' +
'<p>We\'re using the standard WordPress function to update your active plugin options table — to leave only the correct remaining plugins installed and active.</p>' +
'<p><a href="#" id="prc-scroll-to-plugin" style="font-weight:bold;text-decoration:underline;color:#826200;">' + clickToScrollText + '</a></p>'; '<p><a href="#" id="prc-scroll-to-plugin" style="font-weight:bold;text-decoration:underline;color:#826200;">' + clickToScrollText + '</a></p>';
// Insert our notice right after the error // Insert our notice right after the error
targetNotice.parentNode.insertBefore(ourNotice, targetNotice.nextSibling); targetNotice.parentNode.insertBefore(ourNotice, targetNotice.nextSibling);
// Make sure our notice has the same width as the WordPress error notice
ourNotice.style.width = targetNotice.offsetWidth + 'px';
ourNotice.style.maxWidth = '100%';
ourNotice.style.boxSizing = 'border-box';
// Mark that we've added our notice // Mark that we've added our notice
noticeAdded = true; noticeAdded = true;

View File

@ -13,7 +13,7 @@
* Plugin Name: Fix 'Plugin file does not exist.' Notices * Plugin Name: Fix 'Plugin file does not exist.' Notices
* Plugin URI: https://wordpress.org/plugins/fix-plugin-does-not-exist-notices/ * Plugin URI: https://wordpress.org/plugins/fix-plugin-does-not-exist-notices/
* Description: Adds missing plugins to the plugins list with a "Remove Reference" link so you can permanently clean up invalid plugin entries and remove error notices. * Description: Adds missing plugins to the plugins list with a "Remove Reference" link so you can permanently clean up invalid plugin entries and remove error notices.
* Version: 1.6.7 * Version: 1.6.8
* Author: Marcus Quinn * Author: Marcus Quinn
* Author URI: https://www.wpallstars.com * Author URI: https://www.wpallstars.com
* License: GPL-2.0+ * License: GPL-2.0+
@ -48,7 +48,7 @@ if ( ! defined( 'ABSPATH' ) ) {
} }
// Define plugin constants // Define plugin constants
define( 'FPDEN_VERSION', '1.6.7' ); define( 'FPDEN_VERSION', '1.6.8' );
define( 'FPDEN_PLUGIN_DIR', plugin_dir_path( __FILE__ ) ); define( 'FPDEN_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
define( 'FPDEN_PLUGIN_URL', plugin_dir_url( __FILE__ ) ); define( 'FPDEN_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
define( 'FPDEN_PLUGIN_FILE', __FILE__ ); define( 'FPDEN_PLUGIN_FILE', __FILE__ );

View File

@ -2,7 +2,7 @@
# This file is distributed under the GPL-2.0+. # This file is distributed under the GPL-2.0+.
msgid "" msgid ""
msgstr "" msgstr ""
"Project-Id-Version: Fix 'Plugin file does not exist.' Notices 1.6.7\n" "Project-Id-Version: Fix 'Plugin file does not exist.' Notices 1.6.8\n"
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/fix-plugin-does-not-exist-notices\n" "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/fix-plugin-does-not-exist-notices\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"

View File

@ -5,7 +5,7 @@ Tags: plugins, missing plugins, cleanup, error fix, admin tools, plugin file doe
Requires at least: 5.0 Requires at least: 5.0
Tested up to: 6.4 Tested up to: 6.4
Requires PHP: 7.0 Requires PHP: 7.0
Stable tag: 1.6.7 Stable tag: 1.6.8
License: GPL-2.0+ License: GPL-2.0+
License URI: https://www.gnu.org/licenses/gpl-2.0.html License URI: https://www.gnu.org/licenses/gpl-2.0.html
@ -89,6 +89,13 @@ Although this plugin consumes minimal disk space, and doesn't run unless you are
== Changelog == == Changelog ==
= 1.6.8 =
* Fixed notice positioning to appear directly below WordPress error messages
* Improved notice width to match WordPress error messages
* Updated explanatory text for better clarity
* Fixed issue with notices not appearing in some cases
* Improved JavaScript detection of WordPress error messages
= 1.6.7 = = 1.6.7 =
* Fixed duplicate notices issue by removing PHP-generated notice * Fixed duplicate notices issue by removing PHP-generated notice
* Simplified notice system to only show one notice below WordPress error * Simplified notice system to only show one notice below WordPress error
@ -220,8 +227,8 @@ Although this plugin consumes minimal disk space, and doesn't run unless you are
== Upgrade Notice == == Upgrade Notice ==
= 1.6.7 = = 1.6.8 =
Fixed duplicate notices issue and improved performance with optimized plugin detection! Improved notice positioning and appearance, with better explanatory text and more reliable error detection!
= 1.6.3 = = 1.6.3 =
Fixed Git Updater repository URLs and updated organization naming for consistent branding across all platforms! Fixed Git Updater repository URLs and updated organization naming for consistent branding across all platforms!