PLugin versioning fixes

This commit is contained in:
IGNY8 VPS (Salman)
2026-01-09 23:36:03 +00:00
parent 4343f62140
commit 0ea3a30909
7 changed files with 441 additions and 115 deletions

View File

@@ -3,7 +3,7 @@
* Plugin Name: IGNY8 WordPress Bridge
* Plugin URI: https://igny8.com/igny8-wp-bridge
* Description: Lightweight bridge plugin that connects WordPress to IGNY8 API for one-way content publishing.
* Version: 1.1.1
* Version: 1.1.2
* Author: IGNY8
* Author URI: https://igny8.com/
* License: GPL v2 or later
@@ -167,6 +167,44 @@ class Igny8Bridge {
if (!get_option('igny8_default_post_status')) {
add_option('igny8_default_post_status', 'draft');
}
// Register installation with IGNY8 API
$this->register_installation();
}
/**
* Register this plugin installation with IGNY8 API
*/
private function register_installation() {
// Get API key and site ID
$api_key = get_option('igny8_api_key');
$site_id = get_option('igny8_site_id');
// Skip if not configured yet
if (empty($api_key) || empty($site_id)) {
return;
}
// Register installation
$response = wp_remote_post(
'https://api.igny8.com/api/plugins/igny8-wp-bridge/register-installation/',
array(
'headers' => array(
'Authorization' => 'Bearer ' . $api_key,
'Content-Type' => 'application/json',
),
'body' => wp_json_encode(array(
'site_id' => intval($site_id),
'version' => IGNY8_BRIDGE_VERSION,
)),
'timeout' => 15,
)
);
// Log result (don't fail activation if this fails)
if (is_wp_error($response)) {
error_log('IGNY8 Bridge: Failed to register installation - ' . $response->get_error_message());
}
}
/**