Compare commits

...

2 Commits

Author SHA1 Message Date
db662096e4 Add prominent notification next to WordPress error messages (v1.3.2)
Some checks failed
ci/woodpecker/push/woodpecker Pipeline is pending
Build Release / Build and Create Release (push) Has been cancelled
ci/woodpecker/tag/woodpecker Pipeline failed
2025-04-10 00:26:32 +01:00
d6b89887fc Add instructional notification for users (v1.3.1)
Some checks failed
ci/woodpecker/push/woodpecker Pipeline is pending
Build Release / Build and Create Release (push) Has been cancelled
ci/woodpecker/tag/woodpecker Pipeline failed
2025-04-10 00:15:16 +01:00
4 changed files with 82 additions and 3 deletions

View File

@ -2,6 +2,18 @@
All notable changes to this project will be documented in this file. All notable changes to this project will be documented in this file.
## [1.3.2] - 2023-10-05
### Added
- Prominent notification that appears directly below WordPress error messages
- Visual styling to help users connect error message with solution
- Direction arrows and highlighted text to improve user guidance
## [1.3.1] - 2023-10-05
### Added
- Instructional notification explaining how to use the plugin
- Step-by-step guidance for removing plugin references
- Clear visual indicators for missing plugins
## [1.3.0] - 2023-10-05 ## [1.3.0] - 2023-10-05
### Changed ### Changed
- Complete redesign for maximum compatibility with all WordPress themes - Complete redesign for maximum compatibility with all WordPress themes

View File

@ -1,7 +1,7 @@
# Plugin Reference Cleaner # Plugin Reference Cleaner
Author: Marcus Quinn Author: Marcus Quinn
Author URI: https://www.wpallstars.com Author URI: https://www.wpallstars.com
Version: 1.3.0 Version: 1.3.2
License: GPL-2.0+ License: GPL-2.0+
## Description ## Description
@ -47,6 +47,16 @@ If you don't have this notification perpetually showing on your /wp-admin/plugin
## Changelog ## Changelog
### 1.3.2
* Added prominent notification directly below WordPress error messages
* Improved user guidance with visual cues to connect error and solution
* Added eye-catching styling to help users understand how to fix errors
### 1.3.1
* Added instructional notification explaining how to use the plugin
* Improved user guidance with step-by-step instructions
* Enhanced visual identification of missing plugins
### 1.3.0 ### 1.3.0
* Complete redesign for maximum compatibility with all WordPress themes * Complete redesign for maximum compatibility with all WordPress themes
* Now adds missing plugins directly to the plugins list table * Now adds missing plugins directly to the plugins list table

View File

@ -2,7 +2,7 @@
/* /*
* Plugin Name: Plugin Reference Cleaner * Plugin Name: Plugin Reference Cleaner
* Description: Adds a "Remove Reference" button to plugin deactivation error notices, allowing users to clean up invalid plugin entries. * Description: Adds a "Remove Reference" button to plugin deactivation error notices, allowing users to clean up invalid plugin entries.
* Version: 1.3.0 * Version: 1.3.2
* 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+
@ -150,6 +150,53 @@ class Plugin_Reference_Cleaner {
return; return;
} }
// Get invalid plugins
$invalid_plugins = $this->get_invalid_plugins();
// Create a highlighted notice immediately after WordPress error messages
if (!empty($invalid_plugins)) {
// Add a notice specifically targeting the WordPress error notification
add_action('admin_print_footer_scripts', function() use ($invalid_plugins) {
?>
<script type="text/javascript">
document.addEventListener('DOMContentLoaded', function() {
// Find all error notifications about missing plugins
var errorNotices = document.querySelectorAll('.notice-error, .error, .updated.error');
errorNotices.forEach(function(notice) {
if (notice.textContent.includes('Plugin file does not exist')) {
// Create our custom notice
var ourNotice = document.createElement('div');
ourNotice.className = 'notice notice-warning';
ourNotice.style.borderLeft = '4px solid #ffba00';
ourNotice.style.backgroundColor = '#fff8e5';
ourNotice.style.padding = '10px 12px';
ourNotice.style.margin = '5px 0 15px';
ourNotice.style.fontSize = '14px';
// Add content
ourNotice.innerHTML = '<h3 style="margin-top:0;color:#826200;">👉 Plugin Reference Cleaner Can Fix This</h3>' +
'<p>To remove the above error notification, scroll down to find the plugin marked with "<strong style="color:red">(File Missing)</strong>" and click its "<strong>Remove Reference</strong>" link.</p>' +
'<p>This will permanently remove the missing plugin reference from your database.</p>';
// Insert our notice right after the error
notice.parentNode.insertBefore(ourNotice, notice.nextSibling);
}
});
});
</script>
<?php
});
// Also display our standard info notice with more details
echo '<div class="notice notice-info is-dismissible">';
echo '<h3>Plugin Reference Cleaner</h3>';
echo '<p><strong>Missing plugin files detected:</strong> The plugins listed below with <span style="color:red;">(File Missing)</span> tag no longer exist but are still referenced in your database.</p>';
echo '<p><strong>How to fix:</strong> Click the "Remove Reference" link next to each missing plugin to safely remove it from your active plugins list.</p>';
echo '<p>This will clean up your database and remove the error notifications.</p>';
echo '</div>';
}
// Show success message // Show success message
if (isset($_GET['reference_removed']) && $_GET['reference_removed'] === '1') { if (isset($_GET['reference_removed']) && $_GET['reference_removed'] === '1') {
echo '<div class="notice notice-success is-dismissible"><p>Plugin reference removed successfully.</p></div>'; echo '<div class="notice notice-success is-dismissible"><p>Plugin reference removed successfully.</p></div>';

View File

@ -1,7 +1,7 @@
=== Plugin Reference Cleaner === === Plugin Reference Cleaner ===
Author: Marcus Quinn Author: Marcus Quinn
Author URI: https://www.wpallstars.com Author URI: https://www.wpallstars.com
Version: 1.3.0 Version: 1.3.2
License: GPL-2.0+ License: GPL-2.0+
== Description == == Description ==
@ -47,6 +47,16 @@ If you don't have this notification perpetually showing on your /wp-admin/plugin
== Changelog == == Changelog ==
= 1.3.2 =
* Added prominent notification directly below WordPress error messages
* Improved user guidance with visual cues to connect error and solution
* Added eye-catching styling to help users understand how to fix errors
= 1.3.1 =
* Added instructional notification explaining how to use the plugin
* Improved user guidance with step-by-step instructions
* Enhanced visual identification of missing plugins
= 1.3.0 = = 1.3.0 =
* Complete redesign for maximum compatibility with all WordPress themes * Complete redesign for maximum compatibility with all WordPress themes
* Now adds missing plugins directly to the plugins list table * Now adds missing plugins directly to the plugins list table