Compare commits

..

No commits in common. "main" and "2.2.1" have entirely different histories.
main ... 2.2.1

2 changed files with 6 additions and 27 deletions

View File

@ -1,4 +1,4 @@
# PLU Redux
# Plugin Last Updated Redux
Displays a "Last Updated" date for all of your plugins installed by way of the WordPress Plugin Directory.
@ -10,19 +10,7 @@ On plugins that have not been updated in over two years, a warning emoji is disp
2. Activate the plugin through the 'Plugins' screen in WordPress.
3. That's it! The plugin will automatically display the last updated date for installed plugins available in the WordPress Plugin Directory.
## Usage
Once activated, the plugin will automatically display the last updated date for each plugin in your site's list of installed plugins.
For the Site Health check, navigate to "Tools → Site Health" in your WordPress dashboard.
## Site Health Check
The custom Site Health check will list any installed plugins that have not been updated in 2 years.
* If it finds any such plugins, it will return a "critical" status with the names of the old plugins.
* If it doesn't find any, it will return a "good" status, indicating that all installed plugins have been updated within the last 2 years.
Sure, here's an example section that you can add to the `README.md` file to document the new WP-CLI command:
## WP-CLI Command
@ -64,15 +52,6 @@ Sadly, no. PLU Redux only works with plugins that are available in the WordPress
## Changelog
### 2.2.3
* Added `aria-label` to warning emoji to improve accessability. Special thanks to Dale Reardon for letting me know about this!
### 2.2.2
* Making an attempt to meet WP Plugin Directory requirements.
* Added some documentation around the site health check to the README.
### 2.2.1
* Plugin now uses site's preferred date format.

View File

@ -9,14 +9,14 @@
* been updated in over two years, a warning emoji is displayed
* next to the "Last Updated" datestamp.
*
* @package PLU Redux
* @package Plugin Last Updated Redux
* @author Jason Cosper <boogah@gmail.com>
* @license https://www.gnu.org/licenses/gpl-2.0.txt GPL-2.0+
* @link https://github.com/boogah/plu-redux
*
* @wordpress-plugin
* Plugin Name: PLU Redux
* Version: 2.2.3
* Plugin Name: Plugin Last Updated Redux
* Version: 2.2.1
* Requires at least: 6.0
* Requires PHP: 7.4
* Author: Jason Cosper
@ -59,7 +59,7 @@ function plu_redux_plugin_meta( $plugin_meta, $plugin_file ) {
$two_years_ago = strtotime('-2 years'); // get a Unix timestamp for 2 years ago
$last_updated_timestamp = strtotime($last_updated); // get a Unix timestamp for the last updated date
$is_old = $last_updated_timestamp < $two_years_ago; // check if the last updated date is older than 2 years
$warning = $is_old ? '<span role="img" aria-label="warning">⚠️</span> ' : ''; // if the last updated date is older than 2 years, add a warning symbol
$warning = $is_old ? '⚠️ ' : ''; // if the last updated date is older than 2 years, add a warning symbol
$plugin_meta['last_updated'] = $warning . 'Last Updated: ' . date_i18n( get_option( 'date_format' ), strtotime($last_updated)); // add the last updated date to the plugin meta array
}