From 515336aa2be9d0ced54fb4ff2ec993c43023f28f Mon Sep 17 00:00:00 2001 From: Marcus Quinn <6428977+marcusquinn@users.noreply.github.com> Date: Sat, 12 Apr 2025 14:52:35 +0100 Subject: [PATCH] Improve notice positioning and appearance (v1.6.8) --- README.md | 7 +++++++ assets/css/admin-styles.css | 3 +++ assets/js/admin-scripts.js | 14 +++++++++++--- fix-plugin-does-not-exist-notices.php | 4 ++-- languages/fix-plugin-does-not-exist-notices.pot | 2 +- readme.txt | 13 ++++++++++--- 6 files changed, 34 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index b582c61..cf97fbf 100644 --- a/README.md +++ b/README.md @@ -120,6 +120,13 @@ The plugin works by: ## 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 * Fixed duplicate notices issue by removing PHP-generated notice * Simplified notice system to only show one notice below WordPress error diff --git a/assets/css/admin-styles.css b/assets/css/admin-styles.css index 89442a5..ebdb8b4 100644 --- a/assets/css/admin-styles.css +++ b/assets/css/admin-styles.css @@ -5,6 +5,9 @@ margin: 5px 0 15px; font-size: 14px; position: relative; + width: 100%; + box-sizing: border-box; + max-width: none; } .prc-notice h3 { margin-top: 0; diff --git a/assets/js/admin-scripts.js b/assets/js/admin-scripts.js index 1b2c553..c891b54 100644 --- a/assets/js/admin-scripts.js +++ b/assets/js/admin-scripts.js @@ -15,10 +15,12 @@ // Find all error notifications about missing plugins noticeContainers.forEach(function(notice) { - if (notice.textContent.includes('Plugin file does not exist') || - notice.textContent.includes('has been deactivated due to an error')) { + if ((notice.textContent.includes('Plugin file does not exist') || + notice.textContent.includes('has been deactivated due to an error')) && + notice.classList.contains('error')) { // We'll use the last matching notice as our target targetNotice = notice; + console.log('Found WordPress error notice:', notice.textContent); } }); @@ -43,12 +45,18 @@ ourNotice.innerHTML = '

Fix Plugin Does Not Exist Notices ☝️

' + '

To remove these notices, scroll down to each plugin .php showing "(' + pluginMissingText + ')", and click "' + removeNoticeText + '".

' + - '

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.

' + + '

This safely removes the missing active plugin reference from your database.

' + + '

We\'re using the standard WordPress function to update your active plugin options table — to leave only the correct remaining plugins installed and active.

' + '

' + clickToScrollText + '

'; // Insert our notice right after the error 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 noticeAdded = true; diff --git a/fix-plugin-does-not-exist-notices.php b/fix-plugin-does-not-exist-notices.php index 185fe60..9060c1f 100644 --- a/fix-plugin-does-not-exist-notices.php +++ b/fix-plugin-does-not-exist-notices.php @@ -13,7 +13,7 @@ * Plugin Name: Fix 'Plugin file 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. - * Version: 1.6.7 + * Version: 1.6.8 * Author: Marcus Quinn * Author URI: https://www.wpallstars.com * License: GPL-2.0+ @@ -48,7 +48,7 @@ if ( ! defined( 'ABSPATH' ) ) { } // 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_URL', plugin_dir_url( __FILE__ ) ); define( 'FPDEN_PLUGIN_FILE', __FILE__ ); diff --git a/languages/fix-plugin-does-not-exist-notices.pot b/languages/fix-plugin-does-not-exist-notices.pot index 27b22be..bc6e1aa 100644 --- a/languages/fix-plugin-does-not-exist-notices.pot +++ b/languages/fix-plugin-does-not-exist-notices.pot @@ -2,7 +2,7 @@ # This file is distributed under the GPL-2.0+. msgid "" 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" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/readme.txt b/readme.txt index 5b2ebb8..a5b7097 100644 --- a/readme.txt +++ b/readme.txt @@ -5,7 +5,7 @@ Tags: plugins, missing plugins, cleanup, error fix, admin tools, plugin file doe Requires at least: 5.0 Tested up to: 6.4 Requires PHP: 7.0 -Stable tag: 1.6.7 +Stable tag: 1.6.8 License: GPL-2.0+ 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 == += 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 = * Fixed duplicate notices issue by removing PHP-generated notice * 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 == -= 1.6.7 = -Fixed duplicate notices issue and improved performance with optimized plugin detection! += 1.6.8 = +Improved notice positioning and appearance, with better explanatory text and more reliable error detection! = 1.6.3 = Fixed Git Updater repository URLs and updated organization naming for consistent branding across all platforms!