533 lines
28 KiB
PHP
533 lines
28 KiB
PHP
<?php
|
|
/**
|
|
* Settings Page Template
|
|
*
|
|
* @package Igny8Bridge
|
|
*/
|
|
|
|
// Prevent direct access
|
|
if (!defined('ABSPATH')) {
|
|
exit;
|
|
}
|
|
|
|
// Get current settings
|
|
$email = get_option('igny8_email', '');
|
|
$site_id = get_option('igny8_site_id', '');
|
|
$access_token = function_exists('igny8_get_secure_option') ? igny8_get_secure_option('igny8_access_token') : get_option('igny8_access_token');
|
|
$is_connected = !empty($access_token);
|
|
$date_format = get_option('date_format');
|
|
$time_format = get_option('time_format');
|
|
$now = current_time('timestamp');
|
|
$token_issued = intval(get_option('igny8_access_token_issued', 0));
|
|
$token_age_text = $token_issued ? sprintf(__('%s ago', 'igny8-bridge'), human_time_diff($token_issued, $now)) : __('Not generated yet', 'igny8-bridge');
|
|
$token_issued_formatted = $token_issued ? date_i18n($date_format . ' ' . $time_format, $token_issued) : __('—', 'igny8-bridge');
|
|
$last_health_check = intval(get_option('igny8_last_api_health_check', 0));
|
|
$last_health_check_formatted = $last_health_check ? date_i18n($date_format . ' ' . $time_format, $last_health_check) : __('Never', 'igny8-bridge');
|
|
$last_site_sync = intval(get_option('igny8_last_site_sync', 0));
|
|
$last_site_sync_formatted = $last_site_sync ? date_i18n($date_format . ' ' . $time_format, $last_site_sync) : __('Never', 'igny8-bridge');
|
|
$last_taxonomy_sync = intval(get_option('igny8_last_taxonomy_sync', 0));
|
|
$last_taxonomy_sync_formatted = $last_taxonomy_sync ? date_i18n($date_format . ' ' . $time_format, $last_taxonomy_sync) : __('Never', 'igny8-bridge');
|
|
$last_keyword_sync = intval(get_option('igny8_last_keyword_sync', 0));
|
|
$last_keyword_sync_formatted = $last_keyword_sync ? date_i18n($date_format . ' ' . $time_format, $last_keyword_sync) : __('Never', 'igny8-bridge');
|
|
$last_writer_sync = intval(get_option('igny8_last_writer_sync', 0));
|
|
$last_writer_sync_formatted = $last_writer_sync ? date_i18n($date_format . ' ' . $time_format, $last_writer_sync) : __('Never', 'igny8-bridge');
|
|
$last_full_site_scan = intval(get_option('igny8_last_full_site_scan', 0));
|
|
$last_full_site_scan_formatted = $last_full_site_scan ? date_i18n($date_format . ' ' . $time_format, $last_full_site_scan) : __('Never', 'igny8-bridge');
|
|
$last_semantic_map = intval(get_option('igny8_last_semantic_map', 0));
|
|
$last_semantic_map_formatted = $last_semantic_map ? date_i18n($date_format . ' ' . $time_format, $last_semantic_map) : __('Never', 'igny8-bridge');
|
|
$semantic_summary = get_option('igny8_last_semantic_map_summary', array());
|
|
$next_site_sync = wp_next_scheduled('igny8_sync_site_data');
|
|
$next_site_sync_formatted = $next_site_sync ? date_i18n($date_format . ' ' . $time_format, $next_site_sync) : __('Not scheduled', 'igny8-bridge');
|
|
$available_post_types = igny8_get_supported_post_types();
|
|
$enabled_post_types = igny8_get_enabled_post_types();
|
|
$control_mode = igny8_get_control_mode();
|
|
$woocommerce_enabled = (int) get_option('igny8_enable_woocommerce', class_exists('WooCommerce') ? 1 : 0);
|
|
$woocommerce_detected = class_exists('WooCommerce');
|
|
$available_modules = igny8_get_available_modules();
|
|
$enabled_modules = igny8_get_enabled_modules();
|
|
$connection_enabled = igny8_is_connection_enabled();
|
|
$webhook_secret = igny8_get_webhook_secret();
|
|
$webhook_url = rest_url('igny8/v1/event');
|
|
$link_queue = get_option('igny8_link_queue', array());
|
|
$pending_links = array_filter($link_queue, function($item) {
|
|
return $item['status'] === 'pending';
|
|
});
|
|
$webhook_logs = igny8_get_webhook_logs(array('limit' => 10));
|
|
|
|
?>
|
|
|
|
<div class="wrap">
|
|
<h1><?php echo esc_html(get_admin_page_title()); ?></h1>
|
|
|
|
<?php settings_errors('igny8_settings'); ?>
|
|
|
|
<div class="igny8-settings-container">
|
|
<div class="igny8-settings-card">
|
|
<h2><?php _e('API Connection', 'igny8-bridge'); ?></h2>
|
|
|
|
<form method="post" action="">
|
|
<?php wp_nonce_field('igny8_settings_nonce'); ?>
|
|
|
|
<table class="form-table">
|
|
<tr>
|
|
<th scope="row">
|
|
<label for="igny8_email"><?php _e('Email', 'igny8-bridge'); ?></label>
|
|
</th>
|
|
<td>
|
|
<input
|
|
type="email"
|
|
id="igny8_email"
|
|
name="igny8_email"
|
|
value="<?php echo esc_attr($email); ?>"
|
|
class="regular-text"
|
|
required
|
|
/>
|
|
<p class="description">
|
|
<?php _e('Your IGNY8 account email address.', 'igny8-bridge'); ?>
|
|
</p>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<th scope="row">
|
|
<label for="igny8_password"><?php _e('Password', 'igny8-bridge'); ?></label>
|
|
</th>
|
|
<td>
|
|
<input
|
|
type="password"
|
|
id="igny8_password"
|
|
name="igny8_password"
|
|
class="regular-text"
|
|
required
|
|
/>
|
|
<p class="description">
|
|
<?php _e('Your IGNY8 account password.', 'igny8-bridge'); ?>
|
|
</p>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
|
|
<?php submit_button(__('Connect to IGNY8', 'igny8-bridge'), 'primary', 'igny8_connect'); ?>
|
|
</form>
|
|
</div>
|
|
|
|
<?php if ($is_connected) : ?>
|
|
<div class="igny8-settings-card">
|
|
<h2><?php _e('Connection Status', 'igny8-bridge'); ?></h2>
|
|
|
|
<form method="post" action="options.php">
|
|
<?php settings_fields('igny8_bridge_connection'); ?>
|
|
|
|
<table class="form-table">
|
|
<tr>
|
|
<th scope="row"><?php _e('Connection Status', 'igny8-bridge'); ?></th>
|
|
<td>
|
|
<?php if ($connection_enabled) : ?>
|
|
<span class="igny8-status-connected">
|
|
<?php _e('Connected & Active', 'igny8-bridge'); ?>
|
|
</span>
|
|
<?php else : ?>
|
|
<span class="igny8-status-disconnected">
|
|
<?php _e('Connected but Disabled', 'igny8-bridge'); ?>
|
|
</span>
|
|
<?php endif; ?>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<th scope="row">
|
|
<label for="igny8_connection_enabled"><?php _e('Enable Sync Operations', 'igny8-bridge'); ?></label>
|
|
</th>
|
|
<td>
|
|
<label>
|
|
<input
|
|
type="checkbox"
|
|
id="igny8_connection_enabled"
|
|
name="igny8_connection_enabled"
|
|
value="1"
|
|
<?php checked($connection_enabled, 1); ?>
|
|
/>
|
|
<?php _e('Allow sending and receiving data from IGNY8 SaaS', 'igny8-bridge'); ?>
|
|
</label>
|
|
<p class="description">
|
|
<?php _e('When disabled, all sync operations are stopped but your credentials and settings are preserved.', 'igny8-bridge'); ?>
|
|
</p>
|
|
</td>
|
|
</tr>
|
|
<?php if ($email) : ?>
|
|
<tr>
|
|
<th scope="row"><?php _e('Email', 'igny8-bridge'); ?></th>
|
|
<td><?php echo esc_html($email); ?></td>
|
|
</tr>
|
|
<?php endif; ?>
|
|
<?php if ($site_id) : ?>
|
|
<tr>
|
|
<th scope="row"><?php _e('Site ID', 'igny8-bridge'); ?></th>
|
|
<td><?php echo esc_html($site_id); ?></td>
|
|
</tr>
|
|
<?php endif; ?>
|
|
</table>
|
|
|
|
<?php submit_button(__('Save Connection Settings', 'igny8-bridge')); ?>
|
|
</form>
|
|
|
|
<p>
|
|
<button type="button" id="igny8-test-connection" class="button" <?php disabled(!$connection_enabled); ?>>
|
|
<?php _e('Test Connection', 'igny8-bridge'); ?>
|
|
</button>
|
|
<span id="igny8-test-result" class="igny8-test-result"></span>
|
|
</p>
|
|
</div>
|
|
<div class="igny8-settings-card">
|
|
<h2><?php _e('Diagnostics', 'igny8-bridge'); ?></h2>
|
|
<div class="igny8-diagnostics-grid">
|
|
<div class="igny8-diagnostic-item">
|
|
<div class="igny8-diagnostic-label"><?php _e('Access Token Age', 'igny8-bridge'); ?></div>
|
|
<div class="igny8-diagnostic-value"><?php echo esc_html($token_age_text); ?></div>
|
|
<p class="description">
|
|
<?php echo esc_html($token_issued_formatted); ?>
|
|
</p>
|
|
</div>
|
|
<div class="igny8-diagnostic-item">
|
|
<div class="igny8-diagnostic-label"><?php _e('Last API Health Check', 'igny8-bridge'); ?></div>
|
|
<div class="igny8-diagnostic-value"><?php echo esc_html($last_health_check_formatted); ?></div>
|
|
<p class="description">
|
|
<?php _e('Updated when tests succeed', 'igny8-bridge'); ?>
|
|
</p>
|
|
</div>
|
|
<div class="igny8-diagnostic-item">
|
|
<div class="igny8-diagnostic-label"><?php _e('Last Site Data Sync', 'igny8-bridge'); ?></div>
|
|
<div class="igny8-diagnostic-value"><?php echo esc_html($last_site_sync_formatted); ?></div>
|
|
<p class="description">
|
|
<?php _e('Triggered automatically after setup', 'igny8-bridge'); ?>
|
|
</p>
|
|
</div>
|
|
<div class="igny8-diagnostic-item">
|
|
<div class="igny8-diagnostic-label"><?php _e('Last Full Site Scan', 'igny8-bridge'); ?></div>
|
|
<div class="igny8-diagnostic-value"><?php echo esc_html($last_full_site_scan_formatted); ?></div>
|
|
<p class="description">
|
|
<?php _e('Runs weekly or when requested manually', 'igny8-bridge'); ?>
|
|
</p>
|
|
</div>
|
|
<div class="igny8-diagnostic-item">
|
|
<div class="igny8-diagnostic-label"><?php _e('Last Semantic Map', 'igny8-bridge'); ?></div>
|
|
<div class="igny8-diagnostic-value"><?php echo esc_html($last_semantic_map_formatted); ?></div>
|
|
<p class="description">
|
|
<?php
|
|
if (!empty($semantic_summary)) {
|
|
printf(
|
|
/* translators: %1$d: sectors count, %2$d: keywords count */
|
|
esc_html__('Sectors: %1$d · Keywords: %2$d', 'igny8-bridge'),
|
|
intval($semantic_summary['sectors'] ?? 0),
|
|
intval($semantic_summary['keywords'] ?? 0)
|
|
);
|
|
} else {
|
|
_e('Planner semantic map generated after full scan', 'igny8-bridge');
|
|
}
|
|
?>
|
|
</p>
|
|
</div>
|
|
<div class="igny8-diagnostic-item">
|
|
<div class="igny8-diagnostic-label"><?php _e('Last Taxonomy Sync', 'igny8-bridge'); ?></div>
|
|
<div class="igny8-diagnostic-value"><?php echo esc_html($last_taxonomy_sync_formatted); ?></div>
|
|
<p class="description">
|
|
<?php _e('Sectors & clusters imported from Planner', 'igny8-bridge'); ?>
|
|
</p>
|
|
</div>
|
|
<div class="igny8-diagnostic-item">
|
|
<div class="igny8-diagnostic-label"><?php _e('Last Keyword Sync', 'igny8-bridge'); ?></div>
|
|
<div class="igny8-diagnostic-value"><?php echo esc_html($last_keyword_sync_formatted); ?></div>
|
|
<p class="description">
|
|
<?php _e('Planner keywords cached to WordPress posts', 'igny8-bridge'); ?>
|
|
</p>
|
|
</div>
|
|
<div class="igny8-diagnostic-item">
|
|
<div class="igny8-diagnostic-label"><?php _e('Last Writer Sync', 'igny8-bridge'); ?></div>
|
|
<div class="igny8-diagnostic-value"><?php echo esc_html($last_writer_sync_formatted); ?></div>
|
|
<p class="description">
|
|
<?php _e('New IGNY8 tasks imported automatically', 'igny8-bridge'); ?>
|
|
</p>
|
|
</div>
|
|
<div class="igny8-diagnostic-item">
|
|
<div class="igny8-diagnostic-label"><?php _e('Next Scheduled Site Scan', 'igny8-bridge'); ?></div>
|
|
<div class="igny8-diagnostic-value"><?php echo esc_html($next_site_sync_formatted); ?></div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<?php else : ?>
|
|
<div class="igny8-settings-card">
|
|
<h2><?php _e('Connection Status', 'igny8-bridge'); ?></h2>
|
|
<p>
|
|
<span class="igny8-status-disconnected">
|
|
<?php _e('Not Connected', 'igny8-bridge'); ?>
|
|
</span>
|
|
</p>
|
|
<p class="description">
|
|
<?php _e('Enter your IGNY8 credentials above and click "Connect to IGNY8" to establish a connection.', 'igny8-bridge'); ?>
|
|
</p>
|
|
</div>
|
|
<?php endif; ?>
|
|
|
|
<div class="igny8-settings-card">
|
|
<h2><?php _e('Automation Settings', 'igny8-bridge'); ?></h2>
|
|
|
|
<form method="post" action="options.php">
|
|
<?php settings_fields('igny8_bridge_controls'); ?>
|
|
|
|
<table class="form-table">
|
|
<tr>
|
|
<th scope="row"><?php _e('Post Types to Sync', 'igny8-bridge'); ?></th>
|
|
<td>
|
|
<?php foreach ($available_post_types as $slug => $label) : ?>
|
|
<label>
|
|
<input
|
|
type="checkbox"
|
|
name="igny8_enabled_post_types[]"
|
|
value="<?php echo esc_attr($slug); ?>"
|
|
<?php checked(in_array($slug, $enabled_post_types, true)); ?>
|
|
/>
|
|
<?php echo esc_html($label); ?>
|
|
</label>
|
|
<br />
|
|
<?php endforeach; ?>
|
|
<p class="description">
|
|
<?php _e('Select the content types IGNY8 should manage automatically.', 'igny8-bridge'); ?>
|
|
</p>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<th scope="row"><?php _e('IGNY8 Modules', 'igny8-bridge'); ?></th>
|
|
<td>
|
|
<?php foreach ($available_modules as $module_key => $module_label) : ?>
|
|
<label>
|
|
<input
|
|
type="checkbox"
|
|
name="igny8_enabled_modules[]"
|
|
value="<?php echo esc_attr($module_key); ?>"
|
|
<?php checked(in_array($module_key, $enabled_modules, true)); ?>
|
|
/>
|
|
<?php echo esc_html($module_label); ?>
|
|
</label>
|
|
<br />
|
|
<?php endforeach; ?>
|
|
<p class="description">
|
|
<?php _e('Disable modules temporarily if a feature is not ready in the SaaS app.', 'igny8-bridge'); ?>
|
|
</p>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<th scope="row"><?php _e('Control Mode', 'igny8-bridge'); ?></th>
|
|
<td>
|
|
<label>
|
|
<input
|
|
type="radio"
|
|
name="igny8_control_mode"
|
|
value="mirror"
|
|
<?php checked($control_mode, 'mirror'); ?>
|
|
/>
|
|
<strong><?php _e('Mirror', 'igny8-bridge'); ?></strong>
|
|
<span class="description"><?php _e('IGNY8 is the source of truth; WordPress reflects changes only.', 'igny8-bridge'); ?></span>
|
|
</label>
|
|
<br />
|
|
<label>
|
|
<input
|
|
type="radio"
|
|
name="igny8_control_mode"
|
|
value="hybrid"
|
|
<?php checked($control_mode, 'hybrid'); ?>
|
|
/>
|
|
<strong><?php _e('Hybrid', 'igny8-bridge'); ?></strong>
|
|
<span class="description"><?php _e('Allow editors to update content in WordPress and sync back to IGNY8.', 'igny8-bridge'); ?></span>
|
|
</label>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<th scope="row"><?php _e('WooCommerce Data', 'igny8-bridge'); ?></th>
|
|
<td>
|
|
<label>
|
|
<input
|
|
type="checkbox"
|
|
name="igny8_enable_woocommerce"
|
|
value="1"
|
|
<?php checked($woocommerce_enabled, 1); ?>
|
|
<?php disabled(!$woocommerce_detected); ?>
|
|
/>
|
|
<?php _e('Include products, categories, and inventory during site scans.', 'igny8-bridge'); ?>
|
|
</label>
|
|
<?php if (!$woocommerce_detected) : ?>
|
|
<p class="description">
|
|
<?php _e('WooCommerce is not active on this site. Enable the plugin to sync product data.', 'igny8-bridge'); ?>
|
|
</p>
|
|
<?php endif; ?>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
|
|
<?php submit_button(__('Save Automation Settings', 'igny8-bridge')); ?>
|
|
</form>
|
|
|
|
<p class="description">
|
|
<?php _e('Once these settings are saved, the bridge schedules automatic jobs that keep IGNY8 in sync without manual actions.', 'igny8-bridge'); ?>
|
|
</p>
|
|
</div>
|
|
|
|
<?php if ($is_connected) : ?>
|
|
<div class="igny8-settings-card">
|
|
<h2><?php _e('Webhook Configuration', 'igny8-bridge'); ?></h2>
|
|
|
|
<table class="form-table">
|
|
<tr>
|
|
<th scope="row"><?php _e('Webhook URL', 'igny8-bridge'); ?></th>
|
|
<td>
|
|
<code><?php echo esc_html($webhook_url); ?></code>
|
|
<button type="button" class="button button-small" onclick="navigator.clipboard.writeText('<?php echo esc_js($webhook_url); ?>'); alert('<?php _e('Webhook URL copied to clipboard', 'igny8-bridge'); ?>');">
|
|
<?php _e('Copy', 'igny8-bridge'); ?>
|
|
</button>
|
|
<p class="description">
|
|
<?php _e('Configure this URL in your IGNY8 SaaS app settings.', 'igny8-bridge'); ?>
|
|
</p>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<th scope="row"><?php _e('Webhook Secret', 'igny8-bridge'); ?></th>
|
|
<td>
|
|
<code style="word-break: break-all;"><?php echo esc_html($webhook_secret); ?></code>
|
|
<button type="button" class="button button-small" onclick="navigator.clipboard.writeText('<?php echo esc_js($webhook_secret); ?>'); alert('<?php _e('Secret copied to clipboard', 'igny8-bridge'); ?>');">
|
|
<?php _e('Copy', 'igny8-bridge'); ?>
|
|
</button>
|
|
<form method="post" action="" style="display: inline-block; margin-left: 10px;">
|
|
<?php wp_nonce_field('igny8_regenerate_secret'); ?>
|
|
<button type="submit" name="igny8_regenerate_secret" class="button button-small" onclick="return confirm('<?php _e('Are you sure? You will need to update the secret in IGNY8 SaaS app.', 'igny8-bridge'); ?>');">
|
|
<?php _e('Regenerate', 'igny8-bridge'); ?>
|
|
</button>
|
|
</form>
|
|
<p class="description">
|
|
<?php _e('Use this secret to verify webhook requests in IGNY8 SaaS app. Keep it secure.', 'igny8-bridge'); ?>
|
|
</p>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
|
|
<div class="igny8-settings-card">
|
|
<h2><?php _e('Link Queue', 'igny8-bridge'); ?></h2>
|
|
|
|
<?php if (!empty($pending_links)) : ?>
|
|
<p>
|
|
<strong><?php echo count($pending_links); ?></strong> <?php _e('link(s) pending insertion', 'igny8-bridge'); ?>
|
|
</p>
|
|
<table class="wp-list-table widefat fixed striped">
|
|
<thead>
|
|
<tr>
|
|
<th><?php _e('Post ID', 'igny8-bridge'); ?></th>
|
|
<th><?php _e('Anchor', 'igny8-bridge'); ?></th>
|
|
<th><?php _e('Target URL', 'igny8-bridge'); ?></th>
|
|
<th><?php _e('Status', 'igny8-bridge'); ?></th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<?php foreach (array_slice($pending_links, 0, 10) as $link) : ?>
|
|
<tr>
|
|
<td><?php echo esc_html($link['post_id']); ?></td>
|
|
<td><?php echo esc_html($link['anchor']); ?></td>
|
|
<td><code><?php echo esc_html($link['target_url']); ?></code></td>
|
|
<td><?php echo esc_html($link['status']); ?></td>
|
|
</tr>
|
|
<?php endforeach; ?>
|
|
</tbody>
|
|
</table>
|
|
<?php else : ?>
|
|
<p><?php _e('No pending links in queue.', 'igny8-bridge'); ?></p>
|
|
<?php endif; ?>
|
|
</div>
|
|
|
|
<div class="igny8-settings-card">
|
|
<h2><?php _e('Recent Webhook Activity', 'igny8-bridge'); ?></h2>
|
|
|
|
<?php if (!empty($webhook_logs)) : ?>
|
|
<table class="wp-list-table widefat fixed striped">
|
|
<thead>
|
|
<tr>
|
|
<th><?php _e('Event', 'igny8-bridge'); ?></th>
|
|
<th><?php _e('Status', 'igny8-bridge'); ?></th>
|
|
<th><?php _e('Time', 'igny8-bridge'); ?></th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<?php foreach ($webhook_logs as $log) : ?>
|
|
<tr>
|
|
<td><?php echo esc_html($log['event']); ?></td>
|
|
<td>
|
|
<span class="igny8-status-badge igny8-status-<?php echo esc_attr(strtolower($log['status'])); ?>">
|
|
<?php echo esc_html($log['status']); ?>
|
|
</span>
|
|
</td>
|
|
<td><?php echo esc_html(date_i18n(get_option('date_format') . ' ' . get_option('time_format'), strtotime($log['received_at']))); ?></td>
|
|
</tr>
|
|
<?php endforeach; ?>
|
|
</tbody>
|
|
</table>
|
|
<?php else : ?>
|
|
<p><?php _e('No webhook activity yet.', 'igny8-bridge'); ?></p>
|
|
<?php endif; ?>
|
|
</div>
|
|
<?php endif; ?>
|
|
|
|
<div class="igny8-settings-card">
|
|
<h2><?php _e('About', 'igny8-bridge'); ?></h2>
|
|
<p>
|
|
<?php _e('The IGNY8 WordPress Bridge plugin connects your WordPress site to the IGNY8 API, enabling two-way synchronization of posts, taxonomies, and site data.', 'igny8-bridge'); ?>
|
|
</p>
|
|
<p>
|
|
<strong><?php _e('Version:', 'igny8-bridge'); ?></strong> <?php echo esc_html(IGNY8_BRIDGE_VERSION); ?>
|
|
</p>
|
|
</div>
|
|
|
|
<?php if ($is_connected) : ?>
|
|
<div class="igny8-settings-card">
|
|
<h2><?php _e('Sync Operations', 'igny8-bridge'); ?></h2>
|
|
|
|
<?php if (!$connection_enabled) : ?>
|
|
<div class="notice notice-warning inline">
|
|
<p>
|
|
<strong><?php _e('Connection Disabled', 'igny8-bridge'); ?></strong><br />
|
|
<?php _e('Sync operations are currently disabled. Enable "Enable Sync Operations" above to use these features.', 'igny8-bridge'); ?>
|
|
</p>
|
|
</div>
|
|
<?php endif; ?>
|
|
|
|
<div class="igny8-sync-actions">
|
|
<button type="button" id="igny8-sync-posts" class="button button-secondary" <?php disabled(!$connection_enabled); ?>>
|
|
<?php _e('Sync Posts to IGNY8', 'igny8-bridge'); ?>
|
|
</button>
|
|
<button type="button" id="igny8-sync-taxonomies" class="button button-secondary" <?php disabled(!$connection_enabled); ?>>
|
|
<?php _e('Sync Taxonomies', 'igny8-bridge'); ?>
|
|
</button>
|
|
<button type="button" id="igny8-sync-from-igny8" class="button button-secondary" <?php disabled(!$connection_enabled); ?>>
|
|
<?php _e('Sync from IGNY8', 'igny8-bridge'); ?>
|
|
</button>
|
|
<button type="button" id="igny8-collect-site-data" class="button button-primary" <?php disabled(!$connection_enabled); ?>>
|
|
<?php _e('Collect & Send Site Data', 'igny8-bridge'); ?>
|
|
</button>
|
|
</div>
|
|
|
|
<div id="igny8-sync-status" class="igny8-sync-status"></div>
|
|
</div>
|
|
|
|
<div class="igny8-settings-card">
|
|
<h2><?php _e('Sync Statistics', 'igny8-bridge'); ?></h2>
|
|
|
|
<div class="igny8-stats-grid">
|
|
<div class="igny8-stat-item">
|
|
<div class="igny8-stat-label"><?php _e('Synced Posts', 'igny8-bridge'); ?></div>
|
|
<div class="igny8-stat-value" id="igny8-stat-posts">-</div>
|
|
</div>
|
|
<div class="igny8-stat-item">
|
|
<div class="igny8-stat-label"><?php _e('Last Sync', 'igny8-bridge'); ?></div>
|
|
<div class="igny8-stat-value" id="igny8-stat-last-sync">-</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<?php endif; ?>
|
|
</div>
|
|
</div>
|
|
|