-
Notifications
You must be signed in to change notification settings - Fork 8
API Calls made by WordPress
Chuck Adams edited this page Oct 19, 2024
·
1 revision
- 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.
- 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.
- 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.
- 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.
- Endpoint:
- Plugins: https://api.wordpress.org/plugins/info/1.2/
- Themes: https://api.wordpress.org/themes/info/1.2/
- Purpose: Fetches and filters the list of available plugins/themes from WordPress.org repositories.
- Triggers:
- When searching for new plugins or themes from the WordPress dashboard.
- Request Type: POST
- Data Sent: Search query, filters like popularity, compatibility, etc.
- Caller:
- install_themes_upload(), install_plugins_upload() – These functions handle searching for and retrieving plugin or theme data from WordPress.org.
- 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.
- 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.