wp plugin v 1.5.1
This commit is contained in:
@@ -304,6 +304,18 @@
|
||||
margin-right: 8px;
|
||||
}
|
||||
|
||||
/* Small button variant */
|
||||
.igny8-btn-sm {
|
||||
padding: 6px 12px;
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
.igny8-btn-sm svg {
|
||||
width: 14px;
|
||||
height: 14px;
|
||||
margin-right: 6px;
|
||||
}
|
||||
|
||||
/* ===================================================================
|
||||
STATUS INDICATORS
|
||||
=================================================================== */
|
||||
|
||||
@@ -54,33 +54,24 @@ class Igny8Admin {
|
||||
__('IGNY8', 'igny8-bridge'),
|
||||
__('IGNY8', 'igny8-bridge'),
|
||||
'manage_options',
|
||||
'igny8-dashboard',
|
||||
'igny8-connection',
|
||||
array($this, 'render_page'),
|
||||
'dashicons-cloud-saved',
|
||||
58
|
||||
);
|
||||
|
||||
// Add submenu pages
|
||||
// Add submenu pages - Dashboard is the main page (connection.php)
|
||||
add_submenu_page(
|
||||
'igny8-dashboard',
|
||||
'igny8-connection',
|
||||
__('Dashboard', 'igny8-bridge'),
|
||||
__('Dashboard', 'igny8-bridge'),
|
||||
'manage_options',
|
||||
'igny8-dashboard',
|
||||
array($this, 'render_page')
|
||||
);
|
||||
|
||||
add_submenu_page(
|
||||
'igny8-dashboard',
|
||||
__('Connection', 'igny8-bridge'),
|
||||
__('Connection', 'igny8-bridge'),
|
||||
'manage_options',
|
||||
'igny8-connection',
|
||||
array($this, 'render_page')
|
||||
);
|
||||
|
||||
add_submenu_page(
|
||||
'igny8-dashboard',
|
||||
'igny8-connection',
|
||||
__('Settings', 'igny8-bridge'),
|
||||
__('Settings', 'igny8-bridge'),
|
||||
'manage_options',
|
||||
@@ -89,16 +80,7 @@ class Igny8Admin {
|
||||
);
|
||||
|
||||
add_submenu_page(
|
||||
'igny8-dashboard',
|
||||
__('Sync', 'igny8-bridge'),
|
||||
__('Sync', 'igny8-bridge'),
|
||||
'manage_options',
|
||||
'igny8-sync',
|
||||
array($this, 'render_page')
|
||||
);
|
||||
|
||||
add_submenu_page(
|
||||
'igny8-dashboard',
|
||||
'igny8-connection',
|
||||
__('Data', 'igny8-bridge'),
|
||||
__('Data', 'igny8-bridge'),
|
||||
'manage_options',
|
||||
@@ -107,7 +89,7 @@ class Igny8Admin {
|
||||
);
|
||||
|
||||
add_submenu_page(
|
||||
'igny8-dashboard',
|
||||
'igny8-connection',
|
||||
__('Logs', 'igny8-bridge'),
|
||||
__('Logs', 'igny8-bridge'),
|
||||
'manage_options',
|
||||
@@ -283,7 +265,7 @@ class Igny8Admin {
|
||||
}
|
||||
|
||||
// Determine which page to render
|
||||
$page = isset($_GET['page']) ? sanitize_text_field($_GET['page']) : 'igny8-dashboard';
|
||||
$page = isset($_GET['page']) ? sanitize_text_field($_GET['page']) : 'igny8-connection';
|
||||
|
||||
// Add wrapper class for modern design
|
||||
echo '<div class="igny8-admin-page">';
|
||||
@@ -292,17 +274,13 @@ class Igny8Admin {
|
||||
$template_file = '';
|
||||
switch ($page) {
|
||||
case 'igny8-dashboard':
|
||||
$template_file = IGNY8_BRIDGE_PLUGIN_DIR . 'admin/pages/dashboard.php';
|
||||
break;
|
||||
case 'igny8-connection':
|
||||
// Dashboard is now the connection page
|
||||
$template_file = IGNY8_BRIDGE_PLUGIN_DIR . 'admin/pages/connection.php';
|
||||
break;
|
||||
case 'igny8-settings':
|
||||
$template_file = IGNY8_BRIDGE_PLUGIN_DIR . 'admin/pages/settings.php';
|
||||
break;
|
||||
case 'igny8-sync':
|
||||
$template_file = IGNY8_BRIDGE_PLUGIN_DIR . 'admin/pages/sync.php';
|
||||
break;
|
||||
case 'igny8-data':
|
||||
$template_file = IGNY8_BRIDGE_PLUGIN_DIR . 'admin/pages/data.php';
|
||||
break;
|
||||
@@ -310,7 +288,7 @@ class Igny8Admin {
|
||||
$template_file = IGNY8_BRIDGE_PLUGIN_DIR . 'admin/pages/logs.php';
|
||||
break;
|
||||
default:
|
||||
$template_file = IGNY8_BRIDGE_PLUGIN_DIR . 'admin/pages/dashboard.php';
|
||||
$template_file = IGNY8_BRIDGE_PLUGIN_DIR . 'admin/pages/connection.php';
|
||||
}
|
||||
|
||||
// If the template file doesn't exist, fall back to the old settings page
|
||||
|
||||
@@ -47,9 +47,9 @@ $is_connected = !empty($api_key);
|
||||
<a href="<?php echo esc_url(admin_url('admin.php?page=igny8-connection')); ?>"
|
||||
class="<?php echo ($current_page === 'igny8-connection' || $current_page === 'igny8-dashboard') ? 'active' : ''; ?>">
|
||||
<svg fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13.828 10.172a4 4 0 00-5.656 0l-4 4a4 4 0 105.656 5.656l1.102-1.101m-.758-4.899a4 4 0 005.656 0l4-4a4 4 0 00-5.656-5.656l-1.1 1.1"/>
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M3 12l2-2m0 0l7-7 7 7M5 10v10a1 1 0 001 1h3m10-11l2 2m-2-2v10a1 1 0 01-1 1h-3m-6 0a1 1 0 001-1v-4a1 1 0 011-1h2a1 1 0 011 1v4a1 1 0 001 1m-6 0h6"/>
|
||||
</svg>
|
||||
<?php _e('Connection', 'igny8-bridge'); ?>
|
||||
<?php _e('Dashboard', 'igny8-bridge'); ?>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
@@ -64,16 +64,6 @@ $is_connected = !empty($api_key);
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="<?php echo esc_url(admin_url('admin.php?page=igny8-sync')); ?>"
|
||||
class="<?php echo ($current_page === 'igny8-sync') ? 'active' : ''; ?>">
|
||||
<svg fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"/>
|
||||
</svg>
|
||||
<?php _e('Sync', 'igny8-bridge'); ?>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="<?php echo esc_url(admin_url('admin.php?page=igny8-data')); ?>"
|
||||
class="<?php echo ($current_page === 'igny8-data') ? 'active' : ''; ?>">
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
<?php
|
||||
/**
|
||||
* Connection Page
|
||||
* Dashboard Page (formerly Connection)
|
||||
* Main plugin dashboard with connection status and content stats
|
||||
*
|
||||
* @package Igny8Bridge
|
||||
*/
|
||||
@@ -17,23 +18,37 @@ include IGNY8_BRIDGE_PLUGIN_DIR . 'admin/layout-header.php';
|
||||
$api_key = function_exists('igny8_get_secure_option') ? igny8_get_secure_option('igny8_api_key') : get_option('igny8_api_key');
|
||||
$site_id = get_option('igny8_site_id', '');
|
||||
$is_connected = !empty($api_key);
|
||||
$date_format = get_option('date_format');
|
||||
$time_format = get_option('time_format');
|
||||
$now = current_time('timestamp');
|
||||
$last_communication = intval(get_option('igny8_last_communication', 0));
|
||||
$last_communication_text = $last_communication ? sprintf(__('%s ago', 'igny8-bridge'), human_time_diff($last_communication, $now)) : __('Never', 'igny8-bridge');
|
||||
$last_communication_formatted = $last_communication ? date_i18n($date_format . ' ' . $time_format, $last_communication) : __('—', 'igny8-bridge');
|
||||
|
||||
// Get content stats (from sync page)
|
||||
global $wpdb;
|
||||
$igny8_content_count = $wpdb->get_var("SELECT COUNT(*) FROM {$wpdb->postmeta} WHERE meta_key = '_igny8_content_id'");
|
||||
$igny8_content_count = $igny8_content_count ?: 0;
|
||||
|
||||
// Get IGNY8 taxonomy term counts
|
||||
$clusters_count = 0;
|
||||
$sectors_count = 0;
|
||||
if (taxonomy_exists('igny8_clusters')) {
|
||||
$clusters_count = wp_count_terms(array('taxonomy' => 'igny8_clusters', 'hide_empty' => false));
|
||||
if (is_wp_error($clusters_count)) $clusters_count = 0;
|
||||
}
|
||||
if (taxonomy_exists('igny8_sectors')) {
|
||||
$sectors_count = wp_count_terms(array('taxonomy' => 'igny8_sectors', 'hide_empty' => false));
|
||||
if (is_wp_error($sectors_count)) $sectors_count = 0;
|
||||
}
|
||||
|
||||
// Check for one-time success notification
|
||||
$show_success = isset($_GET['connected']) && $_GET['connected'] === '1';
|
||||
?>
|
||||
|
||||
<div class="igny8-page-header">
|
||||
<div style="display: flex; justify-content: space-between; align-items: flex-start;">
|
||||
<div>
|
||||
<h1><?php _e('Connection', 'igny8-bridge'); ?></h1>
|
||||
<p><?php _e('Manage your IGNY8 API connection and authentication', 'igny8-bridge'); ?></p>
|
||||
<h1><?php _e('Dashboard', 'igny8-bridge'); ?></h1>
|
||||
<p><?php _e('Manage your IGNY8 connection and monitor content', 'igny8-bridge'); ?></p>
|
||||
</div>
|
||||
<div style="text-align: right; font-size: 13px; color: rgba(255,255,255,0.85);">
|
||||
<span style="display: block;">Plugin v<?php echo esc_html(IGNY8_BRIDGE_VERSION); ?></span>
|
||||
<span style="display: block; opacity: 0.7;">PHP <?php echo esc_html(PHP_VERSION); ?></span>
|
||||
<div style="text-align: right; font-size: 14px; color: rgba(255,255,255,0.9);">
|
||||
<span style="display: block; font-weight: 500;">Plugin v<?php echo esc_html(IGNY8_BRIDGE_VERSION); ?></span>
|
||||
<span style="display: block; opacity: 0.75; font-size: 13px;">PHP <?php echo esc_html(PHP_VERSION); ?></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -88,80 +103,45 @@ $last_communication_formatted = $last_communication ? date_i18n($date_format . '
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<!-- Quick Actions Row -->
|
||||
<div class="igny8-grid igny8-grid-3">
|
||||
<!-- How to Connect Card -->
|
||||
<div class="igny8-card">
|
||||
<div class="igny8-card-header">
|
||||
<h2>
|
||||
<svg fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"/>
|
||||
</svg>
|
||||
<?php _e('How to Connect', 'igny8-bridge'); ?>
|
||||
</h2>
|
||||
</div>
|
||||
<ol style="padding-left: 20px; line-height: 1.7; font-size: 14px;">
|
||||
<li><?php _e('Log in to your IGNY8 account', 'igny8-bridge'); ?></li>
|
||||
<li><?php _e('Navigate to Settings → Integrations', 'igny8-bridge'); ?></li>
|
||||
<li><?php _e('Find WordPress in the integrations list', 'igny8-bridge'); ?></li>
|
||||
<li><?php _e('Click "Add Site" to generate a new API key', 'igny8-bridge'); ?></li>
|
||||
<li><?php _e('Copy the API key and paste it above', 'igny8-bridge'); ?></li>
|
||||
<li><?php _e('Click "Connect to IGNY8"', 'igny8-bridge'); ?></li>
|
||||
</ol>
|
||||
</div>
|
||||
|
||||
<!-- Settings Card -->
|
||||
<div class="igny8-card">
|
||||
<div class="igny8-card-header">
|
||||
<h2>
|
||||
<svg fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z"/>
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 12a3 3 0 11-6 0 3 3 0 016 0z"/>
|
||||
</svg>
|
||||
<?php _e('Settings', 'igny8-bridge'); ?>
|
||||
</h2>
|
||||
</div>
|
||||
<p style="font-size: 14px; color: var(--igny8-text-dim); margin-bottom: 16px;">
|
||||
<?php _e('Configure post types and taxonomies to sync', 'igny8-bridge'); ?>
|
||||
</p>
|
||||
<a href="<?php echo esc_url(admin_url('admin.php?page=igny8-settings')); ?>" class="igny8-btn igny8-btn-secondary">
|
||||
<?php _e('Configure Settings', 'igny8-bridge'); ?>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<!-- View Logs Card -->
|
||||
<div class="igny8-card">
|
||||
<div class="igny8-card-header">
|
||||
<h2>
|
||||
<svg fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"/>
|
||||
</svg>
|
||||
<?php _e('View Logs', 'igny8-bridge'); ?>
|
||||
</h2>
|
||||
</div>
|
||||
<p style="font-size: 14px; color: var(--igny8-text-dim); margin-bottom: 16px;">
|
||||
<?php _e('Review sync history and troubleshoot issues', 'igny8-bridge'); ?>
|
||||
</p>
|
||||
<a href="<?php echo esc_url(admin_url('admin.php?page=igny8-logs')); ?>" class="igny8-btn igny8-btn-secondary">
|
||||
<?php _e('View Logs', 'igny8-bridge'); ?>
|
||||
</a>
|
||||
<!-- How to Connect Card -->
|
||||
<div class="igny8-card">
|
||||
<div class="igny8-card-header">
|
||||
<h2>
|
||||
<svg fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"/>
|
||||
</svg>
|
||||
<?php _e('How to Connect', 'igny8-bridge'); ?>
|
||||
</h2>
|
||||
</div>
|
||||
<ol style="padding-left: 20px; line-height: 1.8; font-size: 14px;">
|
||||
<li><?php _e('Log in to your IGNY8 account', 'igny8-bridge'); ?></li>
|
||||
<li><?php _e('Navigate to Settings → Integrations', 'igny8-bridge'); ?></li>
|
||||
<li><?php _e('Find WordPress in the integrations list', 'igny8-bridge'); ?></li>
|
||||
<li><?php _e('Click "Add Site" to generate a new API key', 'igny8-bridge'); ?></li>
|
||||
<li><?php _e('Copy the API key and paste it above', 'igny8-bridge'); ?></li>
|
||||
<li><?php _e('Click "Connect to IGNY8"', 'igny8-bridge'); ?></li>
|
||||
</ol>
|
||||
</div>
|
||||
|
||||
<?php else: ?>
|
||||
<!-- Connected - Show Connection Details -->
|
||||
<div class="igny8-alert igny8-alert-success">
|
||||
<!-- Connected State -->
|
||||
|
||||
<?php if ($show_success): ?>
|
||||
<!-- One-time Success Notification -->
|
||||
<div class="igny8-alert igny8-alert-success" style="margin-bottom: 24px;">
|
||||
<svg fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"/>
|
||||
</svg>
|
||||
<div>
|
||||
<strong><?php _e('Connected Successfully', 'igny8-bridge'); ?></strong>
|
||||
<p><?php _e('Your WordPress site is connected to IGNY8 and ready to sync content.', 'igny8-bridge'); ?></p>
|
||||
<p><?php _e('Your WordPress site is ready to publish content from IGNY8.', 'igny8-bridge'); ?></p>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<!-- Main Dashboard Grid -->
|
||||
<div class="igny8-grid igny8-grid-2">
|
||||
<!-- Connection Status -->
|
||||
<!-- Connection Status Card (Left Half) -->
|
||||
<div class="igny8-card">
|
||||
<div class="igny8-card-header">
|
||||
<h2>
|
||||
@@ -177,58 +157,72 @@ $last_communication_formatted = $last_communication ? date_i18n($date_format . '
|
||||
<?php _e('Connected & Active', 'igny8-bridge'); ?>
|
||||
</div>
|
||||
|
||||
<div class="igny8-form-group">
|
||||
<label><?php _e('Site ID', 'igny8-bridge'); ?></label>
|
||||
<code style="display: block; padding: 10px; background: var(--igny8-surface); border-radius: var(--igny8-radius-base);">
|
||||
<!-- Site ID -->
|
||||
<div class="igny8-form-group" style="margin-bottom: 16px;">
|
||||
<label style="font-size: 13px; color: var(--igny8-text-dim);"><?php _e('Site ID', 'igny8-bridge'); ?></label>
|
||||
<code style="display: block; padding: 8px 12px; background: var(--igny8-surface); border-radius: var(--igny8-radius-base); font-size: 14px;">
|
||||
<?php echo esc_html($site_id ?: __('Not set', 'igny8-bridge')); ?>
|
||||
</code>
|
||||
</div>
|
||||
|
||||
<!-- API Key (Masked) -->
|
||||
<div class="igny8-form-group" style="margin-bottom: 20px;">
|
||||
<label style="font-size: 13px; color: var(--igny8-text-dim);"><?php _e('API Key', 'igny8-bridge'); ?></label>
|
||||
<div style="padding: 8px 12px; background: var(--igny8-surface); border: 1px solid var(--igny8-stroke); border-radius: var(--igny8-radius-base); font-family: monospace; font-size: 13px;">
|
||||
<?php echo esc_html(substr($api_key, 0, 7) . '••••••••••' . substr($api_key, -6)); ?>
|
||||
<span style="color: var(--igny8-success); font-weight: 600; margin-left: 8px;">✓ Verified</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Disconnect Section -->
|
||||
<div style="padding-top: 16px; border-top: 1px solid var(--igny8-stroke);">
|
||||
<form method="post" action="" style="display: flex; align-items: center; gap: 12px;">
|
||||
<?php wp_nonce_field('igny8_revoke_api_key'); ?>
|
||||
<button type="submit" name="igny8_revoke_api_key" class="igny8-btn igny8-btn-danger igny8-btn-sm"
|
||||
onclick="return confirm('<?php _e('Are you sure you want to disconnect? This will stop all syncing with IGNY8.', 'igny8-bridge'); ?>');">
|
||||
<svg fill="none" stroke="currentColor" viewBox="0 0 24 24" style="width: 16px; height: 16px;">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M18.364 18.364A9 9 0 005.636 5.636m12.728 12.728A9 9 0 015.636 5.636m12.728 12.728L5.636 5.636"/>
|
||||
</svg>
|
||||
<?php _e('Disconnect', 'igny8-bridge'); ?>
|
||||
</button>
|
||||
<span style="font-size: 12px; color: var(--igny8-text-dim);">
|
||||
<?php _e('Your content will remain, but no new updates will sync.', 'igny8-bridge'); ?>
|
||||
</span>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- API Key Details -->
|
||||
<!-- Content Stats Card (Right Half) -->
|
||||
<div class="igny8-card">
|
||||
<div class="igny8-card-header">
|
||||
<h2>
|
||||
<svg fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 7a2 2 0 012 2m4 0a6 6 0 01-7.743 5.743L11 17H9v2H7v2H4a1 1 0 01-1-1v-2.586a1 1 0 01.293-.707l5.964-5.964A6 6 0 1121 9z"/>
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 19v-6a2 2 0 00-2-2H5a2 2 0 00-2 2v6a2 2 0 002 2h2a2 2 0 002-2zm0 0V9a2 2 0 012-2h2a2 2 0 012 2v10m-6 0a2 2 0 002 2h2a2 2 0 002-2m0 0V5a2 2 0 012-2h2a2 2 0 012 2v14a2 2 0 01-2 2h-2a2 2 0 01-2-2z"/>
|
||||
</svg>
|
||||
<?php _e('API Key', 'igny8-bridge'); ?>
|
||||
<?php _e('Content Stats', 'igny8-bridge'); ?>
|
||||
</h2>
|
||||
</div>
|
||||
|
||||
<div class="igny8-form-group">
|
||||
<label><?php _e('Active API Key', 'igny8-bridge'); ?></label>
|
||||
<div style="padding: 10px 12px; background: var(--igny8-surface); border: 1px solid var(--igny8-stroke); border-radius: var(--igny8-radius-base); font-family: monospace;">
|
||||
<?php echo esc_html(substr($api_key, 0, 7) . '••••••••••••' . substr($api_key, -7)); ?>
|
||||
<span style="color: var(--igny8-success); font-weight: 600; margin-left: 12px;">✓ Verified</span>
|
||||
<!-- Vertically Stacked Stats -->
|
||||
<div style="display: flex; flex-direction: column; gap: 12px;">
|
||||
<div style="padding: 16px; background: var(--igny8-surface); border-radius: var(--igny8-radius-base); display: flex; justify-content: space-between; align-items: center;">
|
||||
<span style="font-size: 14px; color: var(--igny8-text);"><?php _e('Published Posts', 'igny8-bridge'); ?></span>
|
||||
<span style="font-size: 24px; font-weight: 700; color: var(--igny8-primary);"><?php echo esc_html($igny8_content_count); ?></span>
|
||||
</div>
|
||||
<div style="padding: 16px; background: var(--igny8-surface); border-radius: var(--igny8-radius-base); display: flex; justify-content: space-between; align-items: center;">
|
||||
<span style="font-size: 14px; color: var(--igny8-text);"><?php _e('IGNY8 Clusters', 'igny8-bridge'); ?></span>
|
||||
<span style="font-size: 24px; font-weight: 700; color: var(--igny8-primary);"><?php echo esc_html($clusters_count); ?></span>
|
||||
</div>
|
||||
<div style="padding: 16px; background: var(--igny8-surface); border-radius: var(--igny8-radius-base); display: flex; justify-content: space-between; align-items: center;">
|
||||
<span style="font-size: 14px; color: var(--igny8-text);"><?php _e('IGNY8 Sectors', 'igny8-bridge'); ?></span>
|
||||
<span style="font-size: 24px; font-weight: 700; color: var(--igny8-primary);"><?php echo esc_html($sectors_count); ?></span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php if ($token_issued): ?>
|
||||
<div class="igny8-form-group">
|
||||
<label><?php _e('Token Issued', 'igny8-bridge'); ?></label>
|
||||
<p style="margin: 0; font-size: 14px;">
|
||||
<?php echo esc_html($token_age_text); ?>
|
||||
<span style="color: var(--igny8-text-dim); display: block; font-size: 13px; margin-top: 4px;">
|
||||
<?php echo esc_html($token_issued_formatted); ?>
|
||||
</span>
|
||||
</p>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ($last_health_check): ?>
|
||||
<div class="igny8-form-group">
|
||||
<label><?php _e('Last Health Check', 'igny8-bridge'); ?></label>
|
||||
<p style="margin: 0; font-size: 14px;">
|
||||
<?php echo esc_html($last_health_check_formatted); ?>
|
||||
</p>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Quick Actions Row -->
|
||||
<div class="igny8-grid igny8-grid-3">
|
||||
<div class="igny8-grid igny8-grid-3" style="margin-top: 24px;">
|
||||
<!-- How to Publish Card -->
|
||||
<div class="igny8-card">
|
||||
<div class="igny8-card-header">
|
||||
@@ -239,7 +233,7 @@ $last_communication_formatted = $last_communication ? date_i18n($date_format . '
|
||||
<?php _e('Publishing Content', 'igny8-bridge'); ?>
|
||||
</h2>
|
||||
</div>
|
||||
<ol style="padding-left: 20px; line-height: 1.7; font-size: 14px;">
|
||||
<ol style="padding-left: 20px; line-height: 1.8; font-size: 14px; margin: 0;">
|
||||
<li><?php _e('Create content in IGNY8 app', 'igny8-bridge'); ?></li>
|
||||
<li><?php _e('Review and approve content', 'igny8-bridge'); ?></li>
|
||||
<li><?php _e('Click "Publish to WordPress"', 'igny8-bridge'); ?></li>
|
||||
@@ -259,7 +253,7 @@ $last_communication_formatted = $last_communication ? date_i18n($date_format . '
|
||||
</h2>
|
||||
</div>
|
||||
<p style="font-size: 14px; color: var(--igny8-text-dim); margin-bottom: 16px;">
|
||||
<?php _e('Configure post types and taxonomies to sync', 'igny8-bridge'); ?>
|
||||
<?php _e('Configure post types and taxonomies', 'igny8-bridge'); ?>
|
||||
</p>
|
||||
<a href="<?php echo esc_url(admin_url('admin.php?page=igny8-settings')); ?>" class="igny8-btn igny8-btn-secondary">
|
||||
<?php _e('Configure Settings', 'igny8-bridge'); ?>
|
||||
@@ -277,40 +271,13 @@ $last_communication_formatted = $last_communication ? date_i18n($date_format . '
|
||||
</h2>
|
||||
</div>
|
||||
<p style="font-size: 14px; color: var(--igny8-text-dim); margin-bottom: 16px;">
|
||||
<?php _e('Review sync history and troubleshoot issues', 'igny8-bridge'); ?>
|
||||
<?php _e('Review sync history and troubleshoot', 'igny8-bridge'); ?>
|
||||
</p>
|
||||
<a href="<?php echo esc_url(admin_url('admin.php?page=igny8-logs')); ?>" class="igny8-btn igny8-btn-secondary">
|
||||
<?php _e('View Logs', 'igny8-bridge'); ?>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Disconnect Section -->
|
||||
<div class="igny8-card">
|
||||
<div class="igny8-card-header">
|
||||
<h2>
|
||||
<svg fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"/>
|
||||
</svg>
|
||||
<?php _e('Danger Zone', 'igny8-bridge'); ?>
|
||||
</h2>
|
||||
</div>
|
||||
|
||||
<p style="margin-bottom: 16px; color: var(--igny8-text-dim);">
|
||||
<?php _e('Disconnecting will stop all syncing with IGNY8. Your content in WordPress will remain unchanged, but no new updates will be received from IGNY8.', 'igny8-bridge'); ?>
|
||||
</p>
|
||||
|
||||
<form method="post" action="">
|
||||
<?php wp_nonce_field('igny8_revoke_api_key'); ?>
|
||||
<button type="submit" name="igny8_revoke_api_key" class="igny8-btn igny8-btn-danger"
|
||||
onclick="return confirm('<?php _e('Are you sure you want to disconnect? This will stop all syncing with IGNY8.', 'igny8-bridge'); ?>');">
|
||||
<svg fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M18.364 18.364A9 9 0 005.636 5.636m12.728 12.728A9 9 0 015.636 5.636m12.728 12.728L5.636 5.636"/>
|
||||
</svg>
|
||||
<?php _e('Disconnect from IGNY8', 'igny8-bridge'); ?>
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
|
||||
@@ -1,276 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* Controls Page
|
||||
*
|
||||
* @package Igny8Bridge
|
||||
*/
|
||||
|
||||
// Prevent direct access
|
||||
if (!defined('ABSPATH')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
// Include layout header
|
||||
include IGNY8_BRIDGE_PLUGIN_DIR . 'admin/layout-header.php';
|
||||
|
||||
// Get settings
|
||||
$available_post_types = igny8_get_supported_post_types();
|
||||
$enabled_post_types = igny8_get_enabled_post_types();
|
||||
$available_taxonomies = igny8_get_supported_taxonomies();
|
||||
$enabled_taxonomies = igny8_get_enabled_taxonomies();
|
||||
$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();
|
||||
$default_post_status = get_option('igny8_default_post_status', 'draft');
|
||||
?>
|
||||
|
||||
<div class="igny8-page-header">
|
||||
<h1><?php _e('Controls', 'igny8-bridge'); ?></h1>
|
||||
<p><?php _e('Configure which content types to sync and how IGNY8 manages your content', 'igny8-bridge'); ?></p>
|
||||
</div>
|
||||
|
||||
<form method="post" action="options.php">
|
||||
<?php settings_fields('igny8_bridge_controls'); ?>
|
||||
|
||||
<div class="igny8-grid igny8-grid-2">
|
||||
<!-- Post Types -->
|
||||
<div class="igny8-card">
|
||||
<div class="igny8-card-header">
|
||||
<h2>
|
||||
<svg fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"/>
|
||||
</svg>
|
||||
<?php _e('Post Types to Sync', 'igny8-bridge'); ?>
|
||||
</h2>
|
||||
</div>
|
||||
|
||||
<?php foreach ($available_post_types as $slug => $label) : ?>
|
||||
<div class="igny8-form-group" style="margin-bottom: 12px;">
|
||||
<label style="display: flex; align-items: center; cursor: pointer;">
|
||||
<input
|
||||
type="checkbox"
|
||||
name="igny8_enabled_post_types[]"
|
||||
value="<?php echo esc_attr($slug); ?>"
|
||||
<?php checked(in_array($slug, $enabled_post_types, true)); ?>
|
||||
style="margin-right: 8px;"
|
||||
/>
|
||||
<?php echo esc_html($label); ?>
|
||||
</label>
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
|
||||
<p class="igny8-form-help">
|
||||
<?php _e('Select the content types IGNY8 should manage automatically.', 'igny8-bridge'); ?>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<!-- Taxonomies -->
|
||||
<div class="igny8-card">
|
||||
<div class="igny8-card-header">
|
||||
<h2>
|
||||
<svg fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M7 7h.01M7 3h5c.512 0 1.024.195 1.414.586l7 7a2 2 0 010 2.828l-7 7a2 2 0 01-2.828 0l-7-7A1.994 1.994 0 013 12V7a4 4 0 014-4z"/>
|
||||
</svg>
|
||||
<?php _e('Taxonomies to Sync', 'igny8-bridge'); ?>
|
||||
</h2>
|
||||
</div>
|
||||
|
||||
<?php foreach ($available_taxonomies as $slug => $label) : ?>
|
||||
<div class="igny8-form-group" style="margin-bottom: 12px;">
|
||||
<label style="display: flex; align-items: center; cursor: pointer;">
|
||||
<input
|
||||
type="checkbox"
|
||||
name="igny8_enabled_taxonomies[]"
|
||||
value="<?php echo esc_attr($slug); ?>"
|
||||
<?php checked(in_array($slug, $enabled_taxonomies, true)); ?>
|
||||
style="margin-right: 8px;"
|
||||
/>
|
||||
<?php echo esc_html($label); ?>
|
||||
</label>
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
|
||||
<p class="igny8-form-help">
|
||||
<?php _e('Select which taxonomies to sync with IGNY8.', 'igny8-bridge'); ?>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Control Mode -->
|
||||
<div class="igny8-card">
|
||||
<div class="igny8-card-header">
|
||||
<h2>
|
||||
<svg fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 6V4m0 2a2 2 0 100 4m0-4a2 2 0 110 4m-6 8a2 2 0 100-4m0 4a2 2 0 110-4m0 4v2m0-6V4m6 6v10m6-2a2 2 0 100-4m0 4a2 2 0 110-4m0 4v2m0-6V4"/>
|
||||
</svg>
|
||||
<?php _e('Control Mode', 'igny8-bridge'); ?>
|
||||
</h2>
|
||||
</div>
|
||||
|
||||
<div style="display: grid; gap: 16px;">
|
||||
<label style="display: flex; align-items: flex-start; cursor: pointer; padding: 16px; border: 2px solid var(--igny8-stroke); border-radius: var(--igny8-radius-base); transition: all 0.2s;"
|
||||
class="<?php echo $control_mode === 'mirror' ? 'igny8-control-mode-selected' : ''; ?>">
|
||||
<input
|
||||
type="radio"
|
||||
name="igny8_control_mode"
|
||||
value="mirror"
|
||||
<?php checked($control_mode, 'mirror'); ?>
|
||||
style="margin-right: 12px; margin-top: 4px;"
|
||||
/>
|
||||
<div>
|
||||
<strong style="font-size: 16px; display: block; margin-bottom: 4px;">
|
||||
<?php _e('Mirror Mode', 'igny8-bridge'); ?>
|
||||
</strong>
|
||||
<span style="color: var(--igny8-text-dim); font-size: 14px;">
|
||||
<?php _e('IGNY8 is the source of truth; WordPress reflects changes only. Content is read-only in WordPress.', 'igny8-bridge'); ?>
|
||||
</span>
|
||||
</div>
|
||||
</label>
|
||||
|
||||
<label style="display: flex; align-items: flex-start; cursor: pointer; padding: 16px; border: 2px solid var(--igny8-stroke); border-radius: var(--igny8-radius-base); transition: all 0.2s;"
|
||||
class="<?php echo $control_mode === 'hybrid' ? 'igny8-control-mode-selected' : ''; ?>">
|
||||
<input
|
||||
type="radio"
|
||||
name="igny8_control_mode"
|
||||
value="hybrid"
|
||||
<?php checked($control_mode, 'hybrid'); ?>
|
||||
style="margin-right: 12px; margin-top: 4px;"
|
||||
/>
|
||||
<div>
|
||||
<strong style="font-size: 16px; display: block; margin-bottom: 4px;">
|
||||
<?php _e('Hybrid Mode', 'igny8-bridge'); ?>
|
||||
</strong>
|
||||
<span style="color: var(--igny8-text-dim); font-size: 14px;">
|
||||
<?php _e('Allow editors to update content in WordPress and sync changes back to IGNY8. Two-way synchronization.', 'igny8-bridge'); ?>
|
||||
</span>
|
||||
</div>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="igny8-grid igny8-grid-2">
|
||||
<!-- Modules -->
|
||||
<div class="igny8-card">
|
||||
<div class="igny8-card-header">
|
||||
<h2>
|
||||
<svg fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 11H5m14 0a2 2 0 012 2v6a2 2 0 01-2 2H5a2 2 0 01-2-2v-6a2 2 0 012-2m14 0V9a2 2 0 00-2-2M5 11V9a2 2 0 012-2m0 0V5a2 2 0 012-2h6a2 2 0 012 2v2M7 7h10"/>
|
||||
</svg>
|
||||
<?php _e('IGNY8 Modules', 'igny8-bridge'); ?>
|
||||
</h2>
|
||||
</div>
|
||||
|
||||
<?php foreach ($available_modules as $module_key => $module_label) : ?>
|
||||
<div class="igny8-form-group" style="margin-bottom: 12px;">
|
||||
<label style="display: flex; align-items: center; cursor: pointer;">
|
||||
<input
|
||||
type="checkbox"
|
||||
name="igny8_enabled_modules[]"
|
||||
value="<?php echo esc_attr($module_key); ?>"
|
||||
<?php checked(in_array($module_key, $enabled_modules, true)); ?>
|
||||
style="margin-right: 8px;"
|
||||
/>
|
||||
<?php echo esc_html($module_label); ?>
|
||||
</label>
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
|
||||
<p class="igny8-form-help">
|
||||
<?php _e('Disable modules temporarily if a feature is not ready in the SaaS app.', 'igny8-bridge'); ?>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<!-- Default Post Status -->
|
||||
<div class="igny8-card">
|
||||
<div class="igny8-card-header">
|
||||
<h2>
|
||||
<svg fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"/>
|
||||
</svg>
|
||||
<?php _e('Default Post Status', 'igny8-bridge'); ?>
|
||||
</h2>
|
||||
</div>
|
||||
|
||||
<div style="display: grid; gap: 12px; margin-bottom: 16px;">
|
||||
<label style="display: flex; align-items: flex-start; cursor: pointer;">
|
||||
<input
|
||||
type="radio"
|
||||
name="igny8_default_post_status"
|
||||
value="draft"
|
||||
<?php checked($default_post_status, 'draft'); ?>
|
||||
style="margin-right: 8px; margin-top: 4px;"
|
||||
/>
|
||||
<div>
|
||||
<strong><?php _e('Draft', 'igny8-bridge'); ?></strong>
|
||||
<span style="display: block; color: var(--igny8-text-dim); font-size: 13px;">
|
||||
<?php _e('Save content as draft for review before publishing.', 'igny8-bridge'); ?>
|
||||
</span>
|
||||
</div>
|
||||
</label>
|
||||
|
||||
<label style="display: flex; align-items: flex-start; cursor: pointer;">
|
||||
<input
|
||||
type="radio"
|
||||
name="igny8_default_post_status"
|
||||
value="publish"
|
||||
<?php checked($default_post_status, 'publish'); ?>
|
||||
style="margin-right: 8px; margin-top: 4px;"
|
||||
/>
|
||||
<div>
|
||||
<strong><?php _e('Publish', 'igny8-bridge'); ?></strong>
|
||||
<span style="display: block; color: var(--igny8-text-dim); font-size: 13px;">
|
||||
<?php _e('Publish content immediately when received from IGNY8.', 'igny8-bridge'); ?>
|
||||
</span>
|
||||
</div>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<p class="igny8-form-help">
|
||||
<?php _e('Choose whether content published from IGNY8 should be saved as draft or published immediately in WordPress.', 'igny8-bridge'); ?>
|
||||
</p>
|
||||
|
||||
<?php if ($woocommerce_detected): ?>
|
||||
<div style="margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--igny8-stroke);">
|
||||
<label style="display: flex; align-items: center; cursor: pointer;">
|
||||
<input
|
||||
type="checkbox"
|
||||
name="igny8_enable_woocommerce"
|
||||
value="1"
|
||||
<?php checked($woocommerce_enabled, 1); ?>
|
||||
style="margin-right: 8px;"
|
||||
/>
|
||||
<strong><?php _e('Sync WooCommerce products and categories', 'igny8-bridge'); ?></strong>
|
||||
</label>
|
||||
</div>
|
||||
<?php else: ?>
|
||||
<div class="igny8-alert igny8-alert-warning" style="margin-top: 20px;">
|
||||
<svg fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"/>
|
||||
</svg>
|
||||
<span><?php _e('WooCommerce is not installed. Install WooCommerce to sync products.', 'igny8-bridge'); ?></span>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<button type="submit" class="igny8-btn igny8-btn-primary">
|
||||
<svg fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 13l4 4L19 7"/>
|
||||
</svg>
|
||||
<?php _e('Save Controls', 'igny8-bridge'); ?>
|
||||
</button>
|
||||
</form>
|
||||
|
||||
<style>
|
||||
.igny8-control-mode-selected {
|
||||
border-color: var(--igny8-primary) !important;
|
||||
background: var(--igny8-primary-subtle) !important;
|
||||
}
|
||||
</style>
|
||||
|
||||
<?php
|
||||
// Include layout footer
|
||||
include IGNY8_BRIDGE_PLUGIN_DIR . 'admin/layout-footer.php';
|
||||
?>
|
||||
@@ -1,15 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* Dashboard Page - Redirects to Connection Page
|
||||
*
|
||||
* @package Igny8Bridge
|
||||
*/
|
||||
|
||||
// Prevent direct access
|
||||
if (!defined('ABSPATH')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
// Redirect to connection page (Dashboard is now merged with Connection)
|
||||
wp_redirect(admin_url('admin.php?page=igny8-connection'));
|
||||
exit;
|
||||
@@ -24,8 +24,16 @@ $processed_count = $total_links - $pending_count;
|
||||
?>
|
||||
|
||||
<div class="igny8-page-header">
|
||||
<h1><?php _e('Data', 'igny8-bridge'); ?></h1>
|
||||
<p><?php _e('View synced data, queues, and content status', 'igny8-bridge'); ?></p>
|
||||
<div style="display: flex; justify-content: space-between; align-items: flex-start;">
|
||||
<div>
|
||||
<h1><?php _e('Data', 'igny8-bridge'); ?></h1>
|
||||
<p><?php _e('View synced data, queues, and content status', 'igny8-bridge'); ?></p>
|
||||
</div>
|
||||
<div style="text-align: right; font-size: 14px; color: rgba(255,255,255,0.9);">
|
||||
<span style="display: block; font-weight: 500;">Plugin v<?php echo esc_html(IGNY8_BRIDGE_VERSION); ?></span>
|
||||
<span style="display: block; opacity: 0.75; font-size: 13px;">PHP <?php echo esc_html(PHP_VERSION); ?></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Statistics -->
|
||||
|
||||
@@ -18,8 +18,16 @@ $webhook_logs = igny8_get_webhook_logs(array('limit' => 20));
|
||||
?>
|
||||
|
||||
<div class="igny8-page-header">
|
||||
<h1><?php _e('Logs', 'igny8-bridge'); ?></h1>
|
||||
<p><?php _e('Review webhook activity and troubleshoot sync issues', 'igny8-bridge'); ?></p>
|
||||
<div style="display: flex; justify-content: space-between; align-items: flex-start;">
|
||||
<div>
|
||||
<h1><?php _e('Logs', 'igny8-bridge'); ?></h1>
|
||||
<p><?php _e('Review webhook activity and troubleshoot sync issues', 'igny8-bridge'); ?></p>
|
||||
</div>
|
||||
<div style="text-align: right; font-size: 14px; color: rgba(255,255,255,0.9);">
|
||||
<span style="display: block; font-weight: 500;">Plugin v<?php echo esc_html(IGNY8_BRIDGE_VERSION); ?></span>
|
||||
<span style="display: block; opacity: 0.75; font-size: 13px;">PHP <?php echo esc_html(PHP_VERSION); ?></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php if (!empty($webhook_logs)): ?>
|
||||
|
||||
@@ -34,8 +34,16 @@ foreach ($all_post_types as $pt) {
|
||||
?>
|
||||
|
||||
<div class="igny8-page-header">
|
||||
<h1><?php _e('Settings', 'igny8-bridge'); ?></h1>
|
||||
<p><?php _e('Configure post types, taxonomies, and sync settings', 'igny8-bridge'); ?></p>
|
||||
<div style="display: flex; justify-content: space-between; align-items: flex-start;">
|
||||
<div>
|
||||
<h1><?php _e('Settings', 'igny8-bridge'); ?></h1>
|
||||
<p><?php _e('Configure post types, taxonomies, and sync settings', 'igny8-bridge'); ?></p>
|
||||
</div>
|
||||
<div style="text-align: right; font-size: 14px; color: rgba(255,255,255,0.9);">
|
||||
<span style="display: block; font-weight: 500;">Plugin v<?php echo esc_html(IGNY8_BRIDGE_VERSION); ?></span>
|
||||
<span style="display: block; opacity: 0.75; font-size: 13px;">PHP <?php echo esc_html(PHP_VERSION); ?></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<form method="post" action="options.php" id="igny8-settings-form">
|
||||
|
||||
@@ -1,169 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* Sync Page
|
||||
*
|
||||
* @package Igny8Bridge
|
||||
*/
|
||||
|
||||
// Prevent direct access
|
||||
if (!defined('ABSPATH')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
// Include layout header
|
||||
include IGNY8_BRIDGE_PLUGIN_DIR . 'admin/layout-header.php';
|
||||
|
||||
// Get sync settings
|
||||
$connection_enabled = igny8_is_connection_enabled();
|
||||
$last_site_sync = intval(get_option('igny8_last_site_sync', 0));
|
||||
$last_taxonomy_sync = intval(get_option('igny8_last_taxonomy_sync', 0));
|
||||
$last_keyword_sync = intval(get_option('igny8_last_keyword_sync', 0));
|
||||
$last_writer_sync = intval(get_option('igny8_last_writer_sync', 0));
|
||||
$next_site_sync = wp_next_scheduled('igny8_sync_site_data');
|
||||
$date_format = get_option('date_format');
|
||||
$time_format = get_option('time_format');
|
||||
|
||||
$last_site_sync_formatted = $last_site_sync ? date_i18n($date_format . ' ' . $time_format, $last_site_sync) : __('Never', 'igny8-bridge');
|
||||
$last_taxonomy_sync_formatted = $last_taxonomy_sync ? date_i18n($date_format . ' ' . $time_format, $last_taxonomy_sync) : __('Never', 'igny8-bridge');
|
||||
$last_keyword_sync_formatted = $last_keyword_sync ? date_i18n($date_format . ' ' . $time_format, $last_keyword_sync) : __('Never', 'igny8-bridge');
|
||||
$last_writer_sync_formatted = $last_writer_sync ? date_i18n($date_format . ' ' . $time_format, $last_writer_sync) : __('Never', 'igny8-bridge');
|
||||
$next_site_sync_formatted = $next_site_sync ? date_i18n($date_format . ' ' . $time_format, $next_site_sync) : __('Not scheduled', 'igny8-bridge');
|
||||
?>
|
||||
|
||||
<div class="igny8-page-header">
|
||||
<h1><?php _e('Sync', 'igny8-bridge'); ?></h1>
|
||||
<p><?php _e('Configure automatic sync and monitor synchronization status', 'igny8-bridge'); ?></p>
|
||||
</div>
|
||||
|
||||
<form method="post" action="options.php">
|
||||
<?php settings_fields('igny8_bridge_connection'); ?>
|
||||
|
||||
<!-- Connection Enable/Disable -->
|
||||
<div class="igny8-card">
|
||||
<div class="igny8-card-header">
|
||||
<h2>
|
||||
<svg fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M8 7h12m0 0l-4-4m4 4l-4 4m0 6H4m0 0l4 4m-4-4l4-4"/>
|
||||
</svg>
|
||||
<?php _e('Sync Status', 'igny8-bridge'); ?>
|
||||
</h2>
|
||||
</div>
|
||||
|
||||
<label style="display: flex; align-items: center; cursor: pointer; padding: 16px; background: var(--igny8-surface); border-radius: var(--igny8-radius-base);">
|
||||
<input
|
||||
type="checkbox"
|
||||
name="igny8_connection_enabled"
|
||||
value="1"
|
||||
<?php checked($connection_enabled, 1); ?>
|
||||
style="margin-right: 12px;"
|
||||
/>
|
||||
<div>
|
||||
<strong style="font-size: 16px; display: block; margin-bottom: 4px;">
|
||||
<?php _e('Enable IGNY8 Sync', 'igny8-bridge'); ?>
|
||||
</strong>
|
||||
<span style="color: var(--igny8-text-dim); font-size: 14px;">
|
||||
<?php _e('Allow IGNY8 to sync content to this WordPress site. Disable this to pause syncing temporarily.', 'igny8-bridge'); ?>
|
||||
</span>
|
||||
</div>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<button type="submit" class="igny8-btn igny8-btn-primary">
|
||||
<svg fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 13l4 4L19 7"/>
|
||||
</svg>
|
||||
<?php _e('Save Sync Settings', 'igny8-bridge'); ?>
|
||||
</button>
|
||||
</form>
|
||||
|
||||
<!-- Sync History -->
|
||||
<div class="igny8-card">
|
||||
<div class="igny8-card-header">
|
||||
<h2>
|
||||
<svg fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"/>
|
||||
</svg>
|
||||
<?php _e('Sync History', 'igny8-bridge'); ?>
|
||||
</h2>
|
||||
</div>
|
||||
|
||||
<table class="igny8-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><?php _e('Sync Type', 'igny8-bridge'); ?></th>
|
||||
<th><?php _e('Last Sync', 'igny8-bridge'); ?></th>
|
||||
<th><?php _e('Status', 'igny8-bridge'); ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td><strong><?php _e('Site Data', 'igny8-bridge'); ?></strong></td>
|
||||
<td><?php echo esc_html($last_site_sync_formatted); ?></td>
|
||||
<td>
|
||||
<?php if ($last_site_sync): ?>
|
||||
<span class="igny8-status igny8-status-connected">✓ <?php _e('Synced', 'igny8-bridge'); ?></span>
|
||||
<?php else: ?>
|
||||
<span class="igny8-status igny8-status-disconnected">— <?php _e('Never', 'igny8-bridge'); ?></span>
|
||||
<?php endif; ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><strong><?php _e('Taxonomies', 'igny8-bridge'); ?></strong></td>
|
||||
<td><?php echo esc_html($last_taxonomy_sync_formatted); ?></td>
|
||||
<td>
|
||||
<?php if ($last_taxonomy_sync): ?>
|
||||
<span class="igny8-status igny8-status-connected">✓ <?php _e('Synced', 'igny8-bridge'); ?></span>
|
||||
<?php else: ?>
|
||||
<span class="igny8-status igny8-status-disconnected">— <?php _e('Never', 'igny8-bridge'); ?></span>
|
||||
<?php endif; ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><strong><?php _e('Keywords', 'igny8-bridge'); ?></strong></td>
|
||||
<td><?php echo esc_html($last_keyword_sync_formatted); ?></td>
|
||||
<td>
|
||||
<?php if ($last_keyword_sync): ?>
|
||||
<span class="igny8-status igny8-status-connected">✓ <?php _e('Synced', 'igny8-bridge'); ?></span>
|
||||
<?php else: ?>
|
||||
<span class="igny8-status igny8-status-disconnected">— <?php _e('Never', 'igny8-bridge'); ?></span>
|
||||
<?php endif; ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><strong><?php _e('Writers', 'igny8-bridge'); ?></strong></td>
|
||||
<td><?php echo esc_html($last_writer_sync_formatted); ?></td>
|
||||
<td>
|
||||
<?php if ($last_writer_sync): ?>
|
||||
<span class="igny8-status igny8-status-connected">✓ <?php _e('Synced', 'igny8-bridge'); ?></span>
|
||||
<?php else: ?>
|
||||
<span class="igny8-status igny8-status-disconnected">— <?php _e('Never', 'igny8-bridge'); ?></span>
|
||||
<?php endif; ?>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<!-- Next Scheduled Sync -->
|
||||
<div class="igny8-card">
|
||||
<div class="igny8-card-header">
|
||||
<h2>
|
||||
<svg fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z"/>
|
||||
</svg>
|
||||
<?php _e('Scheduled Syncs', 'igny8-bridge'); ?>
|
||||
</h2>
|
||||
</div>
|
||||
|
||||
<div class="igny8-form-group">
|
||||
<label><?php _e('Next Site Data Sync', 'igny8-bridge'); ?></label>
|
||||
<p style="margin: 0; font-size: 15px; font-weight: 600;">
|
||||
<?php echo esc_html($next_site_sync_formatted); ?>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
// Include layout footer
|
||||
include IGNY8_BRIDGE_PLUGIN_DIR . 'admin/layout-footer.php';
|
||||
?>
|
||||
@@ -1,163 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* Sync Page (Simplified)
|
||||
* Shows connection status and last sync info
|
||||
*
|
||||
* @package Igny8Bridge
|
||||
*/
|
||||
|
||||
// Prevent direct access
|
||||
if (!defined('ABSPATH')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
// Include layout header
|
||||
include IGNY8_BRIDGE_PLUGIN_DIR . 'admin/layout-header.php';
|
||||
|
||||
// Get sync settings
|
||||
$connection_enabled = igny8_is_connection_enabled();
|
||||
$last_site_sync = intval(get_option('igny8_last_site_sync', 0));
|
||||
$last_taxonomy_sync = intval(get_option('igny8_last_taxonomy_sync', 0));
|
||||
$date_format = get_option('date_format');
|
||||
$time_format = get_option('time_format');
|
||||
|
||||
$last_site_sync_formatted = $last_site_sync ? date_i18n($date_format . ' ' . $time_format, $last_site_sync) : __('Never', 'igny8-bridge');
|
||||
$last_taxonomy_sync_formatted = $last_taxonomy_sync ? date_i18n($date_format . ' ' . $time_format, $last_taxonomy_sync) : __('Never', 'igny8-bridge');
|
||||
|
||||
// Get published content stats
|
||||
global $wpdb;
|
||||
$igny8_content_count = $wpdb->get_var("SELECT COUNT(*) FROM {$wpdb->postmeta} WHERE meta_key = '_igny8_content_id'");
|
||||
$igny8_content_count = $igny8_content_count ?: 0;
|
||||
|
||||
// Get IGNY8 taxonomy term counts
|
||||
$clusters_count = 0;
|
||||
$sectors_count = 0;
|
||||
if (taxonomy_exists('igny8_clusters')) {
|
||||
$clusters_count = wp_count_terms(array('taxonomy' => 'igny8_clusters', 'hide_empty' => false));
|
||||
if (is_wp_error($clusters_count)) $clusters_count = 0;
|
||||
}
|
||||
if (taxonomy_exists('igny8_sectors')) {
|
||||
$sectors_count = wp_count_terms(array('taxonomy' => 'igny8_sectors', 'hide_empty' => false));
|
||||
if (is_wp_error($sectors_count)) $sectors_count = 0;
|
||||
}
|
||||
?>
|
||||
|
||||
<div class="igny8-page-header">
|
||||
<h1><?php _e('Sync Status', 'igny8-bridge'); ?></h1>
|
||||
<p><?php _e('Monitor synchronization status between IGNY8 and WordPress', 'igny8-bridge'); ?></p>
|
||||
</div>
|
||||
|
||||
<!-- Connection Status Card -->
|
||||
<div class="igny8-card" style="margin-bottom: 24px;">
|
||||
<div class="igny8-card-header">
|
||||
<h2>
|
||||
<svg fill="none" stroke="currentColor" viewBox="0 0 24 24" style="width: 20px; height: 20px;">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M8 7h12m0 0l-4-4m4 4l-4 4m0 6H4m0 0l4 4m-4-4l4-4"/>
|
||||
</svg>
|
||||
<?php _e('Connection Status', 'igny8-bridge'); ?>
|
||||
</h2>
|
||||
</div>
|
||||
|
||||
<div style="display: flex; align-items: center; gap: 16px; padding: 20px; background: var(--igny8-surface); border-radius: var(--igny8-radius-base);">
|
||||
<?php if ($connection_enabled): ?>
|
||||
<div style="width: 48px; height: 48px; background: var(--igny8-success-bg); border-radius: 50%; display: flex; align-items: center; justify-content: center;">
|
||||
<svg fill="none" stroke="var(--igny8-success)" viewBox="0 0 24 24" style="width: 24px; height: 24px;">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 13l4 4L19 7"/>
|
||||
</svg>
|
||||
</div>
|
||||
<div>
|
||||
<strong style="font-size: 18px; display: block; color: var(--igny8-success);">
|
||||
<?php _e('Connected', 'igny8-bridge'); ?>
|
||||
</strong>
|
||||
<span style="color: var(--igny8-text-dim); font-size: 14px;">
|
||||
<?php _e('IGNY8 sync is active and receiving content', 'igny8-bridge'); ?>
|
||||
</span>
|
||||
</div>
|
||||
<?php else: ?>
|
||||
<div style="width: 48px; height: 48px; background: var(--igny8-error-bg); border-radius: 50%; display: flex; align-items: center; justify-content: center;">
|
||||
<svg fill="none" stroke="var(--igny8-error)" viewBox="0 0 24 24" style="width: 24px; height: 24px;">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12"/>
|
||||
</svg>
|
||||
</div>
|
||||
<div>
|
||||
<strong style="font-size: 18px; display: block; color: var(--igny8-error);">
|
||||
<?php _e('Disconnected', 'igny8-bridge'); ?>
|
||||
</strong>
|
||||
<span style="color: var(--igny8-text-dim); font-size: 14px;">
|
||||
<?php _e('IGNY8 sync is paused', 'igny8-bridge'); ?>
|
||||
</span>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Content Stats -->
|
||||
<div class="igny8-card" style="margin-bottom: 24px;">
|
||||
<div class="igny8-card-header">
|
||||
<h2>
|
||||
<svg fill="none" stroke="currentColor" viewBox="0 0 24 24" style="width: 20px; height: 20px;">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 19v-6a2 2 0 00-2-2H5a2 2 0 00-2 2v6a2 2 0 002 2h2a2 2 0 002-2zm0 0V9a2 2 0 012-2h2a2 2 0 012 2v10m-6 0a2 2 0 002 2h2a2 2 0 002-2m0 0V5a2 2 0 012-2h2a2 2 0 012 2v14a2 2 0 01-2 2h-2a2 2 0 01-2-2z"/>
|
||||
</svg>
|
||||
<?php _e('IGNY8 Content Stats', 'igny8-bridge'); ?>
|
||||
</h2>
|
||||
</div>
|
||||
|
||||
<div class="igny8-grid igny8-grid-3" style="gap: 16px;">
|
||||
<div style="padding: 20px; background: var(--igny8-surface); border-radius: var(--igny8-radius-base); text-align: center;">
|
||||
<div style="font-size: 32px; font-weight: 700; color: var(--igny8-primary);"><?php echo esc_html($igny8_content_count); ?></div>
|
||||
<div style="font-size: 14px; color: var(--igny8-text-dim);"><?php _e('Published Posts', 'igny8-bridge'); ?></div>
|
||||
</div>
|
||||
<div style="padding: 20px; background: var(--igny8-surface); border-radius: var(--igny8-radius-base); text-align: center;">
|
||||
<div style="font-size: 32px; font-weight: 700; color: var(--igny8-primary);"><?php echo esc_html($clusters_count); ?></div>
|
||||
<div style="font-size: 14px; color: var(--igny8-text-dim);"><?php _e('IGNY8 Clusters', 'igny8-bridge'); ?></div>
|
||||
</div>
|
||||
<div style="padding: 20px; background: var(--igny8-surface); border-radius: var(--igny8-radius-base); text-align: center;">
|
||||
<div style="font-size: 32px; font-weight: 700; color: var(--igny8-primary);"><?php echo esc_html($sectors_count); ?></div>
|
||||
<div style="font-size: 14px; color: var(--igny8-text-dim);"><?php _e('IGNY8 Sectors', 'igny8-bridge'); ?></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Last Sync Info -->
|
||||
<div class="igny8-card">
|
||||
<div class="igny8-card-header">
|
||||
<h2>
|
||||
<svg fill="none" stroke="currentColor" viewBox="0 0 24 24" style="width: 20px; height: 20px;">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"/>
|
||||
</svg>
|
||||
<?php _e('Last Updated', 'igny8-bridge'); ?>
|
||||
</h2>
|
||||
</div>
|
||||
|
||||
<div class="igny8-grid igny8-grid-2" style="gap: 16px;">
|
||||
<div style="padding: 16px; border: 1px solid var(--igny8-stroke); border-radius: var(--igny8-radius-base);">
|
||||
<div style="font-weight: 600; margin-bottom: 4px;"><?php _e('Site Metadata', 'igny8-bridge'); ?></div>
|
||||
<div style="font-size: 14px; color: var(--igny8-text-dim);">
|
||||
<?php if ($last_site_sync): ?>
|
||||
<span style="color: var(--igny8-success);">✓</span> <?php echo esc_html($last_site_sync_formatted); ?>
|
||||
<?php else: ?>
|
||||
<span style="color: var(--igny8-text-dim);">—</span> <?php _e('Never synced', 'igny8-bridge'); ?>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
<div style="padding: 16px; border: 1px solid var(--igny8-stroke); border-radius: var(--igny8-radius-base);">
|
||||
<div style="font-weight: 600; margin-bottom: 4px;"><?php _e('Taxonomies', 'igny8-bridge'); ?></div>
|
||||
<div style="font-size: 14px; color: var(--igny8-text-dim);">
|
||||
<?php if ($last_taxonomy_sync): ?>
|
||||
<span style="color: var(--igny8-success);">✓</span> <?php echo esc_html($last_taxonomy_sync_formatted); ?>
|
||||
<?php else: ?>
|
||||
<span style="color: var(--igny8-text-dim);">—</span> <?php _e('Never synced', 'igny8-bridge'); ?>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<p style="margin-top: 16px; font-size: 13px; color: var(--igny8-text-dim);">
|
||||
<?php _e('Sync happens automatically when content is published from IGNY8.', 'igny8-bridge'); ?>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
// Include layout footer
|
||||
include IGNY8_BRIDGE_PLUGIN_DIR . 'admin/layout-footer.php';
|
||||
?>
|
||||
@@ -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.5
|
||||
* Version: 1.5.1
|
||||
* Author: IGNY8
|
||||
* Author URI: https://igny8.com/
|
||||
* License: GPL v2 or later
|
||||
@@ -22,7 +22,7 @@ if (!defined('ABSPATH')) {
|
||||
}
|
||||
|
||||
// Define plugin constants
|
||||
define('IGNY8_BRIDGE_VERSION', '1.5');
|
||||
define('IGNY8_BRIDGE_VERSION', '1.5.1');
|
||||
define('IGNY8_BRIDGE_PLUGIN_DIR', plugin_dir_path(__FILE__));
|
||||
define('IGNY8_BRIDGE_PLUGIN_URL', plugin_dir_url(__FILE__));
|
||||
define('IGNY8_BRIDGE_PLUGIN_FILE', __FILE__);
|
||||
|
||||
Reference in New Issue
Block a user