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 = '
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.
' + ''; // 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