From be2c190eca52ccf95491e57744547ae7c0e9b8f4 Mon Sep 17 00:00:00 2001 From: "IGNY8 VPS (Salman)" Date: Sat, 10 Jan 2026 06:48:16 +0000 Subject: [PATCH] revert to last healthy --- .../source/igny8-wp-bridge/igny8-bridge.php | 4 +- .../includes/template-functions.php | 35 ++-- .../igny8-wp-bridge/sync/igny8-to-wp.php | 22 -- .../assets/css/igny8-content-template.css | 192 +++++++----------- .../parts/igny8-content-sections.php | 65 ++---- .../templates/parts/igny8-featured-image.php | 16 +- .../templates/parts/igny8-header.php | 47 ++--- .../templates/single-igny8-content.php | 3 +- 8 files changed, 142 insertions(+), 242 deletions(-) diff --git a/plugins/wordpress/source/igny8-wp-bridge/igny8-bridge.php b/plugins/wordpress/source/igny8-wp-bridge/igny8-bridge.php index e0316681..de71df86 100644 --- a/plugins/wordpress/source/igny8-wp-bridge/igny8-bridge.php +++ b/plugins/wordpress/source/igny8-wp-bridge/igny8-bridge.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.2.7 + * Version: 1.2.9 * 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.2.7'); +define('IGNY8_BRIDGE_VERSION', '1.2.9'); define('IGNY8_BRIDGE_PLUGIN_DIR', plugin_dir_path(__FILE__)); define('IGNY8_BRIDGE_PLUGIN_URL', plugin_dir_url(__FILE__)); define('IGNY8_BRIDGE_PLUGIN_FILE', __FILE__); diff --git a/plugins/wordpress/source/igny8-wp-bridge/includes/template-functions.php b/plugins/wordpress/source/igny8-wp-bridge/includes/template-functions.php index bdf01851..42d27c62 100644 --- a/plugins/wordpress/source/igny8-wp-bridge/includes/template-functions.php +++ b/plugins/wordpress/source/igny8-wp-bridge/includes/template-functions.php @@ -208,8 +208,6 @@ function igny8_parse_keywords($keywords) { * @return array Array of badges with 'text' and 'type' keys */ function igny8_get_section_badges($heading, $post_id) { - static $used_keywords = []; - $badges = []; $heading_lower = strtolower($heading); @@ -219,44 +217,39 @@ function igny8_get_section_badges($heading, $post_id) { $primary_kw = get_post_meta($post_id, '_igny8_primary_keyword', true); $secondary_kws = get_post_meta($post_id, '_igny8_secondary_keywords', true); - // Priority 1: Primary keyword (if not used) - if ($primary_kw && !in_array(strtolower($primary_kw), $used_keywords) && stripos($heading_lower, strtolower($primary_kw)) !== false) { + // Priority 1: Primary keyword + if ($primary_kw && stripos($heading_lower, strtolower($primary_kw)) !== false) { $badges[] = ['text' => $primary_kw, 'type' => 'primary']; - $used_keywords[] = strtolower($primary_kw); - return $badges; // Return only 1 badge } - // Priority 2: Tags (if not used) - if ($tags && !is_wp_error($tags)) { + // Priority 2: Tags + if ($tags && !is_wp_error($tags) && count($badges) < 2) { foreach ($tags as $tag) { - if (!in_array(strtolower($tag->name), $used_keywords) && stripos($heading_lower, strtolower($tag->name)) !== false) { + if (stripos($heading_lower, strtolower($tag->name)) !== false) { $badges[] = ['text' => $tag->name, 'type' => 'tag']; - $used_keywords[] = strtolower($tag->name); - return $badges; // Return only 1 badge + if (count($badges) >= 2) break; } } } - // Priority 3: Categories (if not used) - if ($categories && !is_wp_error($categories)) { + // Priority 3: Categories + if ($categories && !is_wp_error($categories) && count($badges) < 2) { foreach ($categories as $cat) { - if (!in_array(strtolower($cat->name), $used_keywords) && stripos($heading_lower, strtolower($cat->name)) !== false) { + if (stripos($heading_lower, strtolower($cat->name)) !== false) { $badges[] = ['text' => $cat->name, 'type' => 'category']; - $used_keywords[] = strtolower($cat->name); - return $badges; // Return only 1 badge + if (count($badges) >= 2) break; } } } - // Priority 4: Secondary keywords (if not used) - if ($secondary_kws) { + // Priority 4: Secondary keywords + if ($secondary_kws && count($badges) < 2) { $kw_array = is_array($secondary_kws) ? $secondary_kws : explode(',', $secondary_kws); foreach ($kw_array as $kw) { $kw = trim($kw); - if (!empty($kw) && !in_array(strtolower($kw), $used_keywords) && stripos($heading_lower, strtolower($kw)) !== false) { + if (!empty($kw) && stripos($heading_lower, strtolower($kw)) !== false) { $badges[] = ['text' => $kw, 'type' => 'keyword']; - $used_keywords[] = strtolower($kw); - return $badges; // Return only 1 badge + if (count($badges) >= 2) break; } } } diff --git a/plugins/wordpress/source/igny8-wp-bridge/sync/igny8-to-wp.php b/plugins/wordpress/source/igny8-wp-bridge/sync/igny8-to-wp.php index c2ab1d2c..1a5a0ef5 100644 --- a/plugins/wordpress/source/igny8-wp-bridge/sync/igny8-to-wp.php +++ b/plugins/wordpress/source/igny8-wp-bridge/sync/igny8-to-wp.php @@ -854,7 +854,6 @@ function igny8_set_featured_image($post_id, $image_data) { */ function igny8_set_image_gallery($post_id, $gallery_images) { $attachment_ids = array(); - $imported_images = array(); // For _igny8_imported_images meta with full metadata // Limit to 5 images $gallery_images = array_slice($gallery_images, 0, 5); @@ -876,19 +875,6 @@ function igny8_set_image_gallery($post_id, $gallery_images) { if ($attachment_id) { $attachment_ids[] = $attachment_id; - - // Build complete image metadata for template - $position = is_array($image_data) ? ($image_data['position'] ?? 0) : 0; - $caption = is_array($image_data) ? ($image_data['caption'] ?? '') : ''; // Use caption instead of prompt - $is_featured = is_array($image_data) ? ($image_data['is_featured'] ?? false) : false; - - $imported_images[] = array( - 'position' => intval($position), - 'attachment_id' => $attachment_id, - 'url' => wp_get_attachment_url($attachment_id), - 'prompt' => $caption, // Store caption in prompt field for template compatibility - 'is_featured' => $is_featured - ); } } @@ -901,14 +887,6 @@ function igny8_set_image_gallery($post_id, $gallery_images) { update_post_meta($post_id, '_gallery_images', $attachment_ids); // Generic } - // Store complete image metadata for IGNY8 template - if (!empty($imported_images)) { - update_post_meta($post_id, '_igny8_imported_images', $imported_images); - - $log_prefix = "[" . get_option('igny8_site_id', 'N/A') . "-" . parse_url(site_url(), PHP_URL_HOST) . "]"; - Igny8_Logger::info("{$log_prefix} ✅ Saved _igny8_imported_images meta with " . count($imported_images) . " images (positions: " . implode(', ', array_column($imported_images, 'position')) . ")"); - } - return $attachment_ids; } diff --git a/plugins/wordpress/source/igny8-wp-bridge/templates/assets/css/igny8-content-template.css b/plugins/wordpress/source/igny8-wp-bridge/templates/assets/css/igny8-content-template.css index b7c8aaab..5bdbb9b1 100644 --- a/plugins/wordpress/source/igny8-wp-bridge/templates/assets/css/igny8-content-template.css +++ b/plugins/wordpress/source/igny8-wp-bridge/templates/assets/css/igny8-content-template.css @@ -144,48 +144,6 @@ font-size: 0.875rem; } -.igny8-meta-link { - color: inherit; - text-decoration: none; - transition: opacity 0.2s ease; -} - -.igny8-meta-link:hover { - opacity: 0.7; - text-decoration: underline; -} - -.igny8-category-badge, -.igny8-tag-badge { - display: inline-block; - padding: 0.25rem 0.75rem; - border-radius: var(--igny8-border-radius-xs); - font-size: 0.75rem; - font-weight: 600; - text-decoration: none; - transition: transform 0.2s ease, box-shadow 0.2s ease; -} - -.igny8-category-badge { - background: rgba(59, 130, 246, 0.15); - color: rgba(29, 78, 216, 1); -} - -.igny8-category-badge:hover { - transform: translateY(-1px); - box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3); -} - -.igny8-tag-badge { - background: rgba(139, 92, 246, 0.15); - color: rgba(109, 40, 217, 1); -} - -.igny8-tag-badge:hover { - transform: translateY(-1px); - box-shadow: 0 2px 8px rgba(139, 92, 246, 0.3); -} - .igny8-meta-icon { font-size: 1rem; line-height: 1; @@ -277,24 +235,29 @@ /* === Featured Image === */ .igny8-featured-image-block { - margin-bottom: var(--igny8-spacing); -} - -.igny8-image-card { - display: inline-block; - width: auto; - max-width: 100%; - border: 2px solid rgba(0, 0, 0, 0.12); - border-radius: var(--igny8-border-radius-md); - overflow: hidden; background: var(--wp--preset--color--base, #ffffff); + border: 2px solid rgba(0, 0, 0, 0.12); + border-radius: var(--igny8-border-radius); + overflow: hidden; + margin-bottom: var(--igny8-spacing); box-shadow: 0 4px 20px -4px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(0, 0, 0, 0.05); } -.igny8-image-card img { - display: block; +.igny8-featured-header { + padding: 2rem 2rem 1rem; +} + +.igny8-featured-label { + font-size: 0.75rem; + font-weight: 600; + text-transform: uppercase; + letter-spacing: 0.2em; + opacity: 0.6; +} + +.igny8-featured-image-wrapper { + position: relative; width: 100%; - height: auto; } .igny8-featured-image { @@ -305,6 +268,28 @@ margin: 0 auto; } +.igny8-image-prompt { + padding: 1.5rem 2rem; + border-top: 1px solid rgba(0, 0, 0, 0.08); + background: rgba(0, 0, 0, 0.02); +} + +.igny8-prompt-label { + font-size: 0.75rem; + font-weight: 600; + text-transform: uppercase; + letter-spacing: 0.15em; + opacity: 0.5; + margin: 0 0 0.75rem 0; +} + +.igny8-prompt-text { + font-size: 0.875rem; + line-height: 1.6; + margin: 0; + white-space: pre-wrap; +} + /* === Content Body === */ .igny8-content-body { display: flex; @@ -333,34 +318,6 @@ padding: 2rem; } -.igny8-intro-layout { - display: grid; - grid-template-columns: 1fr 2fr; - gap: 2rem; - align-items: start; -} - -.igny8-intro-toc { - position: sticky; - top: 2rem; -} - -.igny8-intro-content { - font-size: 1.0625rem; - line-height: 1.85; - color: inherit; -} - -@media (max-width: 968px) { - .igny8-intro-layout { - grid-template-columns: 1fr; - } - - .igny8-intro-toc { - position: static; - } -} - .igny8-section-label { font-size: 0.7rem; font-weight: 700; @@ -412,14 +369,18 @@ } .igny8-section-content { - display: block; - position: relative; + display: grid; + gap: 2.5rem; } -.igny8-section-content::after { - content: ""; - display: table; - clear: both; +.igny8-section-content.igny8-has-image { + grid-template-columns: 1fr; +} + +@media (min-width: 1024px) { + .igny8-section-content.igny8-has-image { + grid-template-columns: 3fr 2fr; + } } /* === Prose Styles === */ @@ -459,8 +420,6 @@ .igny8-prose li { margin-bottom: 0.6rem; - clear: both; - max-width: 100%; } .igny8-prose a { @@ -532,27 +491,12 @@ margin: 3rem 0; } -/* =margin: 0; -} - -.igny8-image-figure.igny8-image-card { - display: inline-block; - width: auto; - max-width: 100%; +/* === In-Article Images === */ +.igny8-image-figure { border: 2px solid rgba(0, 0, 0, 0.12); border-radius: var(--igny8-border-radius-md); overflow: hidden; background: var(--wp--preset--color--base, #ffffff); - box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1); -} - -.igny8-image-square-right, -.igny8-image-square-left { - border: 2px solid rgba(0, 0, 0, 0.12); - border-radius: var(--igny8-border-radius-md); - overflow: hidden; - background: var(--wp--preset--color--base, #ffffff) hidden; - background: var(--wp--preset--color--base, #ffffff); margin: 0; box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1); } @@ -577,19 +521,17 @@ /* Square image - Right aligned */ .igny8-image-square-right { - width: 48%; - max-width: 48%; + max-width: 50%; float: right; - margin-left: 4%; + margin-left: 2rem; margin-bottom: 2rem; } /* Square image - Left aligned */ .igny8-image-square-left { - width: 48%; - max-width: 48%; + max-width: 50%; float: left; - margin-right: 4%; + margin-right: 2rem; margin-bottom: 2rem; } @@ -604,12 +546,24 @@ /* Widget placeholder */ .igny8-widget-placeholder { - clear: botrem; - border-top: 1px solid rgba(0, 0, 0, 0.08); + clear: both; + min-height: 200px; + padding: 1.5rem; + margin-top: 1rem; background: rgba(0, 0, 0, 0.02); - font-size: 0.875rem; - line-height: 1.6; - color: rgba(0, 0, 0, 0.7) + border: 1px dashed rgba(0, 0, 0, 0.1); + border-radius: var(--igny8-border-radius-sm); + display: none; +} + +.igny8-widget-placeholder.igny8-widgets-enabled { + display: block; +} + +.igny8-image-caption { + padding: 1.25rem; + border-top: 1px solid rgba(0, 0, 0, 0.08); +} .igny8-caption-label { font-size: 0.7rem; diff --git a/plugins/wordpress/source/igny8-wp-bridge/templates/parts/igny8-content-sections.php b/plugins/wordpress/source/igny8-wp-bridge/templates/parts/igny8-content-sections.php index 766e2da2..6dab9c5e 100644 --- a/plugins/wordpress/source/igny8-wp-bridge/templates/parts/igny8-content-sections.php +++ b/plugins/wordpress/source/igny8-wp-bridge/templates/parts/igny8-content-sections.php @@ -33,37 +33,11 @@ $reuse_pattern = [1, 0, 3, 2]; // Featured, Square1, Landscape2, Square2
- = $min_headings; - ?> +
-
- - - -
- -
+ +
+
@@ -78,13 +52,15 @@ $reuse_pattern = [1, 0, 3, 2]; // Featured, Square1, Landscape2, Square2
+ if (!empty($badges)): ?>
- - - + $badge): ?> + + + +

@@ -152,14 +128,15 @@ $reuse_pattern = [1, 0, 3, 2]; // Featured, Square1, Landscape2, Square2 } ?>
-
+
<?php echo esc_attr($section['heading']); ?>
- +

Visual Direction

+

@@ -184,16 +161,11 @@ $reuse_pattern = [1, 0, 3, 2]; // Featured, Square1, Landscape2, Square2 loading="lazy">
- +

Visual Direction

+

-
@@ -212,14 +184,15 @@ $reuse_pattern = [1, 0, 3, 2]; // Featured, Square1, Landscape2, Square2 } ?>
-
+
<?php echo esc_attr($section['heading']); ?>
- +

Visual Direction

+

diff --git a/plugins/wordpress/source/igny8-wp-bridge/templates/parts/igny8-featured-image.php b/plugins/wordpress/source/igny8-wp-bridge/templates/parts/igny8-featured-image.php index 3fd9b7c0..42d0bd44 100644 --- a/plugins/wordpress/source/igny8-wp-bridge/templates/parts/igny8-featured-image.php +++ b/plugins/wordpress/source/igny8-wp-bridge/templates/parts/igny8-featured-image.php @@ -20,10 +20,22 @@ if (!$image_url) { ?> + + +
+

AI Image Prompt

+

+
+
diff --git a/plugins/wordpress/source/igny8-wp-bridge/templates/parts/igny8-header.php b/plugins/wordpress/source/igny8-wp-bridge/templates/parts/igny8-header.php index 9a33be7d..285fd42c 100644 --- a/plugins/wordpress/source/igny8-wp-bridge/templates/parts/igny8-header.php +++ b/plugins/wordpress/source/igny8-wp-bridge/templates/parts/igny8-header.php @@ -16,9 +16,20 @@ $status_class = igny8_get_status_class($status); ?>
- + + + +

+ + +
@@ -53,21 +64,13 @@ $status_class = igny8_get_status_class($status);
- +
Topic: - - - - - +
@@ -79,18 +82,8 @@ $status_class = igny8_get_status_class($status); Categories:
- Child) - $cat_hierarchy = []; - $current_cat = $cat; - while ($current_cat) { - array_unshift($cat_hierarchy, $current_cat); - $current_cat = ($current_cat->parent > 0) ? get_category($current_cat->parent) : null; - } - $hierarchy_text = implode(' > ', array_map(function($c) { return $c->name; }, $cat_hierarchy)); - ?> - + + name); ?>
@@ -104,12 +97,8 @@ $status_class = igny8_get_status_class($status); Tags:
- - name); ?> + + name); ?>
diff --git a/plugins/wordpress/source/igny8-wp-bridge/templates/single-igny8-content.php b/plugins/wordpress/source/igny8-wp-bridge/templates/single-igny8-content.php index 33ff6b5b..9c86df36 100644 --- a/plugins/wordpress/source/igny8-wp-bridge/templates/single-igny8-content.php +++ b/plugins/wordpress/source/igny8-wp-bridge/templates/single-igny8-content.php @@ -80,7 +80,8 @@ if (defined('WP_DEBUG') && WP_DEBUG) { include plugin_dir_path(__FILE__) . 'parts/igny8-featured-image.php'; } - // NOTE: Table of Contents is now rendered inside section 1 (see igny8-content-sections.php) + // Table of Contents + include plugin_dir_path(__FILE__) . 'parts/igny8-table-of-contents.php'; // Content sections include plugin_dir_path(__FILE__) . 'parts/igny8-content-sections.php';