Introduction
This document provides information about the WordPress update API endpoints for Elyssa AI. You can use these endpoints to implement automatic updates for this WordPress plugin in your custom update system.
Available Endpoints
- Version/Update Check: https://get.codefabrica.net/wp/elyssa-ai/update?action=check_update
- Plugin Information: https://get.codefabrica.net/wp/elyssa-ai/info?action=plugin_information
- Latest Version Info: https://get.codefabrica.net/wp/elyssa-ai/latest
Update Check API
The Update Check API provides basic information needed to determine if an update is available.
This endpoint responds to the action=check_update
parameter.
Example Request
GET https://get.codefabrica.net/wp/elyssa-ai/update?action=check_update
Example Response
{
"version": "2.4",
"tested": "6.8",
"requires": "6.*",
"requires_php": "8.0",
"url": "https://get.codefabrica.net/wp/elyssa-ai",
"package": "https://get.codefabrica.net/wp/elyssa-ai/download/2.4"
}
Response Fields
- version: The current version of the plugin (higher than the installed version if an update is available)
- tested: The highest WordPress version the plugin has been tested with
- requires: The minimum WordPress version required to run the plugin
- requires_php: The minimum PHP version required to run the plugin
- url: URL to the plugin's homepage or changelog
- package: Direct download URL for the plugin ZIP package
Plugin Information API
The Plugin Information API provides detailed information about the plugin for display in the WordPress updates interface.
This endpoint responds to the action=plugin_information
parameter.
Example Request
GET https://get.codefabrica.net/wp/elyssa-ai/info?action=plugin_information
Example Response
{
"name": "Elyssa AI",
"slug": "elyssa-ai",
"version": "2.4",
"author": "codefabrica",
"author_profile": "https://codefabrica.net",
"requires": "6.*",
"tested": "6.8",
"requires_php": "8.0",
"compatibility": {},
"rating": 100,
"num_ratings": 0,
"support_threads": 0,
"support_threads_resolved": 0,
"downloaded": 32,
"last_updated": "2025-05-09",
"added": "2025-04-16",
"homepage": "https://get.codefabrica.net/wp/elyssa-ai",
"sections": {
"description": "Plugin description...",
"installation": "Installation instructions...",
"changelog": "Version history and changes..."
},
"banners": {
"high": "https://codefabrica-downloads.s3.amazonaws.com/images/elyssa-ai/banner_large.jpg",
"low": "https://codefabrica-downloads.s3.amazonaws.com/images/elyssa-ai/banner_small.jpg"
},
"icons": {
"2x": "https://codefabrica-downloads.s3.amazonaws.com/images/elyssa-ai/icon_large.jpg",
"1x": "https://codefabrica-downloads.s3.amazonaws.com/images/elyssa-ai/icon_small.jpg"
},
"download_link": "https://get.codefabrica.net/wp/elyssa-ai/download/2.4"
}
Response Fields
The response includes all the fields from the Update Check API plus the following:
- name: The human-readable name of the plugin
- slug: The plugin's slug
- author: HTML link to the plugin author
- author_profile: URL to the author's profile
- downloaded: Number of times the plugin has been downloaded
- last_updated: Date when the plugin was last updated
- added: Date when the plugin was first added
- homepage: URL to the plugin's homepage
- sections: Contains detailed HTML-formatted information for different tabs in the WordPress update dialog
- banners: Contains URLs to banner images (high: 1544x500, low: 772x250) used in WordPress update screens
- icons: Contains URLs to plugin icons (2x: 256x256, 1x: 128x128) used in WordPress update screens
- download_link: Direct download URL for the plugin package
Latest Version Info API
The Latest Version Info API provides a simplified JSON response with information about the latest version of the plugin. This is useful for custom update checkers or third-party integrations.
Example Request
GET https://get.codefabrica.net/wp/elyssa-ai/latest
Example Response
{
"success": true,
"data": {
"plugin": "Elyssa AI",
"version": "2.4",
"requires_wp": "6.*",
"tested_wp": "6.8",
"requires_php": "8.0",
"download_url": "https://get.codefabrica.net/wp/elyssa-ai/download/2.4",
"last_updated": "2025-05-09",
"homepage": "https://get.codefabrica.net/wp/elyssa-ai",
"images": {
"banner_large": "https://codefabrica-downloads.s3.amazonaws.com/images/elyssa-ai/banner_large.jpg",
"banner_small": "https://codefabrica-downloads.s3.amazonaws.com/images/elyssa-ai/banner_small.jpg",
"icon_large": "https://codefabrica-downloads.s3.amazonaws.com/images/elyssa-ai/icon_large.jpg",
"icon_small": "https://codefabrica-downloads.s3.amazonaws.com/images/elyssa-ai/icon_small.jpg"
}
}
}
Response Fields
- success: Boolean indicating whether the request was successful
- data.plugin: The human-readable name of the plugin
- data.version: The current version of the plugin
- data.requires_wp: The minimum WordPress version required to run the plugin
- data.tested_wp: The highest WordPress version the plugin has been tested with
- data.requires_php: The minimum PHP version required to run the plugin
- data.download_url: Direct download URL for the plugin ZIP package
- data.last_updated: Date when the plugin was last updated
- data.homepage: URL to the plugin's homepage
- data.images: Contains URLs to banner and icon images in various sizes
Integration Guide
To integrate this update server with your WordPress plugin, you can use the following code in your plugin's main file:
// Add this to your plugin's main file
function elyssa_ai_check_for_updates($transient) {
if (empty($transient->checked)) {
return $transient;
}
// Plugin data
$plugin_slug = 'elyssa-ai';
$plugin_file = $plugin_slug . '/' . $plugin_slug . '.php';
$plugin_version = $transient->checked[$plugin_file];
// Update server URL
$update_api_url = 'https://get.codefabrica.net/wp/elyssa-ai/update?action=check_update';
// Get update data
$response = wp_remote_get($update_api_url);
if (!is_wp_error($response) && wp_remote_retrieve_response_code($response) === 200) {
$update_data = json_decode(wp_remote_retrieve_body($response));
// Check if a newer version exists
if (isset($update_data->version) && version_compare($plugin_version, $update_data->version, '<')) {
// Create the response object
$obj = new stdClass();
$obj->slug = $plugin_slug;
$obj->plugin = $plugin_file;
$obj->new_version = $update_data->version;
$obj->tested = $update_data->tested;
$obj->package = $update_data->package;
$obj->url = $update_data->url;
$transient->response[$plugin_file] = $obj;
}
}
return $transient;
}
add_filter('pre_set_site_transient_update_plugins', 'elyssa_ai_check_for_updates');
// Plugin information for update details
function elyssa_ai_plugin_information($result, $action, $args) {
// Check if this is our plugin
if ($action !== 'plugin_information' || !isset($args->slug) || $args->slug !== 'elyssa-ai') {
return $result;
}
// Get plugin information
$api_url = 'https://get.codefabrica.net/wp/elyssa-ai/info?action=plugin_information';
$response = wp_remote_get($api_url);
if (!is_wp_error($response) && wp_remote_retrieve_response_code($response) === 200) {
$plugin_info = json_decode(wp_remote_retrieve_body($response));
return $plugin_info;
}
return $result;
}
add_filter('plugins_api', 'elyssa_ai_plugin_information', 10, 3);
Copy this code into your main plugin file, replacing elyssa-ai
with your actual plugin slug if needed.
This code will check for updates whenever WordPress checks for plugin updates and display the update information when available.
Important Notes
- Make sure your plugin's main file has the correct version in the plugin header comment.
- The plugin slug in the code should match the directory name of your plugin.
- The plugin file path should be the relative path from the plugins directory to your main plugin file.
- The update server will only offer updates when the version on the server is higher than the installed version.