Making WordPress.org

Opened 6 weeks ago

Last modified 6 weeks ago

#8447 new feature request

Themes & Plugins API: Expose closure, suspension, and outdated metadata for Core consumption

Reported by: mralidoosti Owned by:
Priority: high Milestone:
Component: API Keywords:
Cc:

Description (last modified by mralidoosti)

Currently, when plugins or themes are closed, removed, suspended, or no longer maintained in the WordPress repository, the API either returns generic 404 / 'not found' errors (for suspended themes) or lacks machine-readable flags in standard API representations (such as whether a theme is delisted or outdated).

To enable WordPress Core (and site health/monitoring tools) to provide meaningful status feedback to site administrators regarding closed or outdated dependencies, this patch enhances the Plugin and Theme Info APIs as follows:

  1. Theme API (Themes_API):
    • Queries suspended themes (post_status = 'suspend') instead of a generic 404 miss, returning error => 'closed', closed => true, status => 'suspend', is_suspended => true, closed_date, and reason.
    • In fill_theme(), includes closed, status, is_suspended, is_outdated, and outdated_notice (triggered when a theme has not received updates in over 2 years).
    • Updates themes/info/1.0/index.php to prevent caching closed themes as not_found in theme_information_error.
    • Adds cache purge hooks on suspend_repopackage and publish_repopackage.
  1. Plugin API (Plugin & Plugins_Info_API_Request):
    • Enhances plugin_info() with status, is_outdated, outdated_notice, and is_security when closed or disabled.
    • Adds closed => false, is_outdated, and status => 'publish' to plugin_info_data() for active plugins.
    • Registers the new fields in Plugins_Info_API_Request::$fields and default field mappings so they are not stripped during field filtering.
    • Adds closure metadata attachment in plugin-update-helpers.php (alter_update()).

PR : ​https://github.com/WordPress/wordpress.org/pull/1004

Attachments (1)

closed-outdated-theme-plugin-api.diff​ (15.7 KB ) - added by mralidoosti 6 weeks ago.

Download all attachments as: .zip

Change History (2)

#1 @mralidoosti
6 weeks ago

  • Description modified (diff)
Note: See TracTickets for help on using tickets.