=== PLU Redux ===
Contributors: boogah
Donate link: http://paypal.me/boogah
Tags: plugins, site health, security
Requires at least: 6.0
Tested up to: 7.0
Stable tag: 3.0.1
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Displays the "Last Updated" date and "Tested up to" version for your plugins. Supports WordPress.org and Git Updater plugins.

== Description ==

PLU Redux displays the "Last Updated" date and "Tested up to" version for all of your installed plugins. If a plugin hasn't been updated in over two years - or hasn't been tested with a recent WordPress version - you'll get a warning emoji next to the relevant field.

Version 3.0 adds full support for plugins managed by [Git Updater](https://git-updater.com/). GitHub, GitLab, Bitbucket, Gitea, and Gist are all supported.

== Installation ==

1. Upload the plugin files to the `/wp-content/plugins/plu-redux` directory via SFTP, or install the plugin through the WordPress plugins screen directly.
2. Activate the plugin through the 'Plugins' screen in WordPress.
3. That's it! The plugin will automatically display last updated dates and tested versions for your installed plugins.

== Usage ==

Once activated, head over to your Plugins screen. You'll see "Last Updated" and "Tested up to" info in the metadata row for each plugin. Warning emojis appear when a plugin hasn't been updated in over two years or its "Tested up to" version is significantly behind your current WordPress version.

For the Site Health checks, navigate to Tools → Site Health in your WordPress dashboard.

== Git Updater Support ==

PLU Redux automatically detects plugins using [Git Updater](https://git-updater.com/) headers and queries the appropriate hosting API for last updated info.

Supported platforms:

* GitHub (`GitHub Plugin URI`) - checks releases first, falls back to last commit
* GitLab (`GitLab Plugin URI`) - uses `last_activity_at`
* Bitbucket (`Bitbucket Plugin URI`) - uses `updated_on`
* Gitea (`Gitea Plugin URI`) - self-hosted; requires a full URL in the header
* Gist (`Gist Plugin URI`) - uses gist `updated_at`

PLU Redux also respects the `Primary Branch` header. When there's no release, it falls back to the last commit on the specified branch.

Note: "Tested up to" is only available for WordPress.org plugins. Git-hosted plugins will only show "Last updated."

== Site Health Check ==

PLU Redux adds two checks to Tools → Site Health:

* **Outdated plugins** - Lists any plugins not updated in 2+ years (critical status).
* **Untested plugins** - Lists plugins not tested with a recent WordPress version (recommended status).

== WP-CLI Command ==

PLU Redux includes a WP-CLI command: `wp plu list`

This outputs a table of your installed plugins with their last updated dates and tested versions. Plugins needing attention are flagged with an arrow (`<-`). A `-` in the "Tested Up To" column means the plugin isn't in the WordPress.org directory.

== Frequently Asked Questions ==

= How does the plugin determine if a plugin hasn't been updated in over two years? =

The plugin checks the WordPress.org API (or the appropriate git hosting API for Git Updater plugins) and caches the results in a transient for 24 hours. If the last updated date is older than two years, a warning emoji (⚠️) is displayed next to the "Last Updated" date.

= How does the "Tested up to" check work? =

Same API call. If a plugin's "Tested up to" version is a full major version behind - or more than one minor version behind on the same major - you'll see a warning emoji.

= Why don't my Git Updater plugins show "Tested up to"? =

Git hosting APIs don't have that information. Only WordPress.org tracks "Tested up to" versions. For git-hosted plugins, PLU Redux shows the last updated date only.

= Can I customize the warning emoji or the text that's displayed? =

Nope. Decisions, not options!

= Does the plugin work with premium or private plugins? =

Only if they use Git Updater headers pointing to a public repository. Private repos or plugins with no Git Updater headers won't show any info.

== Changelog ==

= 3.0.1 =

* Fixed short description exceeding the 150-character limit for the WordPress.org plugin directory.

= 3.0.0 =

* New: Git Updater support - plugins with `GitHub Plugin URI`, `GitLab Plugin URI`, `Bitbucket Plugin URI`, `Gitea Plugin URI`, or `Gist Plugin URI` headers now show last updated dates from their respective APIs.
* New: Added "Tested up to" version display in plugin metadata.
* New: Added Site Health check for plugins not tested with recent WordPress versions.
* New: WP-CLI command now shows "Tested up to" column.
* Git Updater plugin cache includes ±1 hour jitter to spread out API requests.
* Respects `Primary Branch` header when falling back from releases to branch commits.
* Security: Replaced `serialize()`/`unserialize()` with JSON API (v1.2) to prevent potential object injection vulnerabilities.
* Security: Added proper output escaping with `esc_html()` and `esc_attr__()`.
* Security: Added `is_wp_error()` check and input sanitization on API requests.
* Refactored caching to store both `last_updated` and `tested` fields.
* Added text domain (`plu-redux`) to all translatable strings for proper i18n support.
* Added uninstall hook to clean up transients when the plugin is deleted.
* Updated code to follow WordPress Coding Standards.
* Replaced magic number `86400` with `DAY_IN_SECONDS` constant.
* Added PHPDoc blocks to all functions.
* Fixed HTTP to HTTPS for wordpress.org links.

= 2.2.3 =

* Added `aria-label` to warning emoji to improve accessibility. 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.
* Also cleaned up some wonky formatting. 😅

= 2.2.0 =

* Added a Site Health check that lists any outdated plugins.

= 2.1.1 =

* Fixed bug that would prevent plugin from being installable when WP-CLI is not available.
* Added Git Updater header.

= 2.1.0 =

* Added a WP-CLI command.

= 2.0.0 =

* Brought code up to date.
* Added feature where a warning emoji is displayed next to plugins that have not been updated in over two years.

= 1.0.2 =

* See [Plugin Last Updated](https://wordpress.org/plugins/plugin-last-updated/) WordPress Plugin Directory listing for previous changelog entries.
