1 API Calls made by WordPress
Chuck Adams edited this page 2024-10-19 12:28:26 -06:00
This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

API Calls made by WordPress

Update Checks (Themes, Plugins, Core)

  • Endpoint: https://api.wordpress.org/core/version-check/
  • Purpose: WordPress checks for core, theme, and plugin updates by sending requests to the WordPress.org API.
  • Triggers:
  • When an admin visits the “Dashboard” → “Updates” page.
  • During scheduled background update checks (typically every 12 hours).
  • Request Type: POST
  • Data Sent: WordPress version, list of installed plugins, list of installed themes, site URL, PHP version, etc.
  • Caller:
  • wp_version_check() Called via the WordPress Cron system (wp-cron.php), or manually when an admin checks updates.
  • wp_update_plugins() Plugin update check.
  • wp_update_themes() Theme update check. Th
  • ese functions are usually called by wp-cron scheduled tasks (wp_schedule_event()), or manually through the admin interface.

Plugin Installation and Updates

  • Endpoint: https://api.wordpress.org/plugins/info/1.0/
  • Purpose: Fetches plugin details such as descriptions, reviews, and installation metadata.
  • Triggers:
  • When an admin searches for plugins in the “Plugins” → “Add New” page.
  • When WordPress checks for plugin updates.
  • Request Type: GET
  • Data Sent: Plugin slug, locale, WordPress version.
  • Caller:
  • plugins_api() This function makes the API request to WordPress.org when searching for plugins or checking plugin details.
  • wp_update_plugins() Calls WordPress.org to check for plugin updates during background or manual update checks.

Theme Installation and Updates

  • Endpoint: https://api.wordpress.org/themes/info/1.0/
  • Purpose: Fetches theme details from the WordPress theme repository.
  • Triggers:
  • When an admin searches for themes in the “Appearance” → “Themes” → “Add New” page.
  • During theme update checks.
  • Request Type: GET
  • Data Sent: Theme slug, locale, WordPress version.
  • Caller:
  • themes_api() Called when searching for themes or fetching details about a theme from WordPress.org.
  • wp_update_themes() Triggered for theme update checks.

Translation Updates

  • Endpoint: https://api.wordpress.org/translations/core/1.0/
  • Purpose: Fetches available translation packages for core, plugins, and themes.
  • Triggers:
  • During scheduled update checks or when an admin manually checks for updates.
  • Request Type: GET
  • Data Sent: WordPress version, language settings, list of installed plugins and themes.
  • Caller:
  • wp_get_translation_updates() Called when checking for translation updates for WordPress core, plugins, or themes.

Browse and Search Plugins/Themes

Health Check

  • Endpoint: https://api.wordpress.org/core/checksums/1.0/
  • Purpose: Verifies the integrity of core WordPress files.
  • Triggers:
  • When the site admin runs a site health check via “Tools” → “Site Health”.
  • Request Type: GET
  • Data Sent: WordPress version, locale.
  • Caller:
  • wp_get_core_checksums() Part of the Site Health tool that compares local WordPress core files against checksums from WordPress.org.

Jetpack and Other Plugins

  • Some plugins like Jetpack or Akismet communicate with WordPress.org APIs or Automattic servers.
  • Jetpack connects to Automattic servers for site stats, backups, and other services. Additional Hooks and Callers
  • pre_http_request and http_api_debug hooks: These hooks allow developers to filter or inspect HTTP requests made by WordPress, including those to WordPress.org.
  • wp_remote_get() and wp_remote_post(): These are the lower-level functions WordPress uses to make all HTTP requests, including the ones to WordPress.org. Many of the API calls listed above ultimately use these functions to send the actual request.