Changeset 3382225
- Timestamp:
- 10/21/2025 10:55:02 PM (4 months ago)
- Location:
- faq-magic/trunk
- Files:
-
- 6 edited
-
class.faq-magic.php (modified) (1 diff)
-
css/faq-magic-admin.css (modified) (4 diffs)
-
faq-magic.php (modified) (1 diff)
-
inc/faq-magic-metabox.php (modified) (5 diffs)
-
js/faq-magic-admin.js (modified) (2 diffs)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
faq-magic/trunk/class.faq-magic.php
r3379641 r3382225 83 83 add_action('wp_enqueue_scripts', array($this, 'faqm_enqueue_main')); 84 84 if ($this->get_switch('unset_schema_dups', 0)){ 85 if ( defined( 'WPSEO_VERSION' ) ) { 86 add_filter( 'wpseo_schema_graph_pieces', function( $pieces, $context ) { 87 // Remove duplicate WebPage schema to prevent GSC error 88 return array_filter( $pieces, function( $piece ) { 89 return ! ( 90 $piece instanceof \Yoast\WP\SEO\Generators\Schema\WebPage 91 ); 92 }); 93 }, 11, 2 ); 94 } 85 add_action('plugins_loaded', function() { 86 if ( class_exists( '\Yoast\WP\SEO\Generators\Schema\WebPage' ) ) { 87 add_filter('wpseo_schema_graph_pieces', function( $pieces, $context ) { 88 foreach ( $pieces as $key => $piece ) { 89 if ( 90 is_a( $piece, '\Yoast\WP\SEO\Generators\Schema\WebPage' ) || 91 is_a( $piece, '\Yoast\WP\SEO\Generators\Schema\WebSite' ) || 92 is_a( $piece, '\Yoast\WP\SEO\Generators\Schema\FAQ' ) 93 ) { 94 unset( $pieces[$key] ); 95 } 96 } 97 return $pieces; 98 }, 20, 2 ); 99 100 // Optional: remove Yoast output comments 101 add_filter('wpseo_debug_markers', '__return_false'); 102 } 103 }, 20); // priority 20 ensures Yoast has initialized 104 add_filter('wpseo_debug_markers', '__return_false'); 95 105 // Disable Yoast's JSON-LD schema output 96 106 //add_filter( 'wpseo_json_ld_output', '__return_false' ); -
faq-magic/trunk/css/faq-magic-admin.css
r3379641 r3382225 105 105 106 106 /* AI Suggest button */ 107 .faqm-ai-btn { 108 background-color: #fff298 !important; 109 b order-color: #222 !important;110 border: none;107 #faqm_ai_suggest.faqm-ai-btn, 108 #faqm_ai_qanda.faqm-ai-btn { 109 background: linear-gradient(180deg, #ffcd38 0%, #f9b233 100%); 110 border: 1px solid #c48f00; 111 111 color: #222 !important; 112 font-weight: 600; 113 padding: 6px 16px; 114 border-radius: 4px; 115 cursor: pointer; 112 font-weight: 700; 113 padding: 7px 18px; 114 border-radius: 6px; 115 cursor: pointer; 116 box-shadow: 0 3px 5px rgba(0, 0, 0, 0.2); 116 117 transition: all 0.2s ease-in-out; 117 box-shadow: 0 2px 4px rgba(0,0,0,0.15); 118 } 119 120 .faqm-ai-btn:hover { 121 background-color: #ffec69 !important; /* darker yellow hover */ 122 color: #000 !important; 123 transform: translateY(-1px); 124 } 118 text-shadow: 0 1px 0 rgba(255, 255, 255, 0.4); 119 } 120 121 #faqm_ai_suggest.faqm-ai-btn:hover, 122 #faqm_ai_qanda.faqm-ai-btn:hover { 123 background: linear-gradient(180deg, #ffd95c 0%, #f5a623 100%); 124 border-color: #a87500; 125 color: #111 !important; 126 transform: translateY(-1px) scale(1.03); 127 box-shadow: 0 4px 7px rgba(0, 0, 0, 0.25); 128 } 129 130 #faqm_ai_suggest.faqm-ai-btn:active, 131 #faqm_ai_qanda.faqm-ai-btn:active { 132 background: linear-gradient(180deg, #f5b400 0%, #e59d00 100%); 133 transform: translateY(1px) scale(0.98); 134 box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2); 135 } 136 137 #faqm_ai_suggest.faqm-ai-btn:disabled, 138 #faqm_ai_qanda.faqm-ai-btn:disabled { 139 background: #ccc !important; 140 border-color: #999 !important; 141 color: #666 !important; 142 box-shadow: none; 143 cursor: not-allowed; 144 opacity: 0.7; 145 } 146 147 .faqm-ai-btn::before { 148 content: "🤖 "; 149 } 150 125 151 126 152 /* ----- Options / Settings Table Format ----- */ … … 463 489 } 464 490 465 /* ---------- AI emoji prefix ---------- */466 .faqm-ai-btn::before {467 content: "🤖 ";468 }469 470 491 /* ---------- Advice for FAQs ---------- */ 471 #faqm_advice {492 .faqm_advice { 472 493 display: inline-flex; 473 494 align-items: center; … … 478 499 background: none; /* remove background highlight */ 479 500 border: none; /* remove border */ 480 margin -left: 10px;501 margin: 10px 5px 0 0; 481 502 padding: 0; 482 503 } 483 504 484 #faqm_advice::before {505 .faqm_advice::before { 485 506 content: "i"; 486 507 display: inline-flex; … … 491 512 font-size: 12px; 492 513 color: #1F95DE; 493 border: 1 .5px solid #1F95DE;514 border: 1px solid #1F95DE; 494 515 border-radius: 50%; 495 516 width: 16px; -
faq-magic/trunk/faq-magic.php
r3379641 r3382225 5 5 * Plugin URI: http://www.hub5050.com/faq-magic/ 6 6 * Description: Webpage JSON-LD and FAQ plugin for AI bot compatibility 7 * Version: 1.3. 27 * Version: 1.3.3 8 8 * Author: Clinton [Hub5050.com] 9 9 * Author URI: http://www.hub5050.com -
faq-magic/trunk/inc/faq-magic-metabox.php
r3379641 r3382225 61 61 <input type="hidden" id="faqm_language" name="faqm_language" value="'.esc_attr($language).'" /> 62 62 </label></p>'; 63 $out .= '<p><button type="button" class="button button-primary" id="faqm_generate_btn">Submit</button>'; 64 // New AI Suggest button 63 $out .= '<p>'; 65 64 if ( $aiBtn ) { 66 $out .= ' <button type="button" id="faqm_ai_suggest" class="button faqm-ai-btn">AI Suggest Description</button>'; 67 } 65 $out .= '<button type="button" id="faqm_ai_suggest" class="button faqm-ai-btn">AI Suggest Description</button>'; 66 } 67 $out .= ' <button type="button" class="button button-primary" id="faqm_generate_btn">Submit</button>'; 68 $out .= '<br /><span class="faqm_advice">'; 69 $out .= 'Enter a title and description OR let AI suggest these — then submit.'; 70 $out .= '</span> <!-- faqm_advice -->'; 68 71 $out .= '</p>'; 69 72 $out .= '</div> <!-- faqm-pageform -->'; … … 74 77 $out .= '<p><label>Question: <input type="text" id="faqm_question" class="widefat" /></label></p>'; 75 78 $out .= '<p><label>Answer:<br><textarea id="faqm_answer" rows="3" class="widefat"></textarea></label></p>'; 76 $out .= '<p> <button type="button" class="button" id="faqm_add_faq">+ Add FAQ</button>';79 $out .= '<p>'; 77 80 if ( $aiBtn ) { 78 $out .= ' <button type="button" id="faqm_ai_qanda" class="button faqm-ai-btn">AI Suggest FAQs</button> '; 79 } 80 $out .= '<span id="faqm_advice">'; 81 if (!empty($faqs)) { $out .= 'Click on any FAQ to edit the content'; } 82 $out .= '</span> '; 81 $out .= '<button type="button" id="faqm_ai_qanda" class="button faqm-ai-btn">AI Suggest FAQs</button> '; 82 } 83 $out .= ' <button type="button" class="button" id="faqm_add_faq">+ Add FAQ</button> '; 84 $out .= '<br /><span class="faqm_advice">'; 85 if (!empty($faqs)) { 86 $out .= 'Add a new FAQ OR click on any FAQ to edit the content.'; 87 } else { 88 $out .= 'Enter or select a FAQ, to edit — then submit.'; 89 } 90 $out .= '</span> <!-- faqm_advice -->'; 83 91 $out .= '</p>'; 84 85 92 // --- Existing FAQs --- 86 93 $out .= '<div id="faqm_faq_list">'; … … 159 166 $out = '<div class="faqm_qandas">'; 160 167 $out .= '<div class="faqm-logo-wrap"><img src="' . esc_url($img_url) . '" alt="FAQ Magic Logo" class="faqm-logo"></div>'; 161 $out .= '<h3>Proposed FAQs [AI Generated]</h3>';162 168 // === if not a member ===> 163 169 if ($member){ 164 170 if ($post_edit){ 171 $out .= '<h3>Proposed FAQs [AI Generated]</h3>'; 165 172 $out .= '<h4>Generate a list of FAQs using AI</h4>'; 166 173 $out .= '<p>Press the AI Suggest button to generate a list of AI generated Questions and Answers.</p>'; … … 173 180 $out .= '<p><button type="button" class="button" id="faqm_ai_qanda_2">Generate FAQs</button></p>'; 174 181 } else { 182 $out .= '<h3>Get Started</h3>'; 183 $out .= '<h4>Premium Member</h4>'; 184 $out .= '<p>Generate a list of FAQs using AI</p>'; 185 $out .= '<ul class="faqm-list">'; 186 $out .= '<li>✅ Select a Page, Post, or Product in edit.</li>'; 187 $out .= '<li>✅ Navigate to the FAQ Magic section.</li>'; 188 $out .= '<li>✅ Use AI to update your description for AI.</li>'; 189 $out .= '<li>✅ Submit.</li>'; 190 $out .= '<li>✅ Click on FAQ Tab.</li>'; 191 $out .= '<li>✅ Use AI to suggest a list of potential FAQs.</li>'; 192 $out .= '<li>✅ Select the FAQ you want to use by clicking \'Use This\' button.</li>'; 193 $out .= '<li>✅ Refine / Edit the content</li>'; 194 $out .= '<li>✅ Press \'Add FAQ\'</li>'; 195 $out .= '</ul>'; 196 $out .= '<p>Place short code [faq_magic] to display Q&As on any page, post or product</p>'; 197 } 198 } else { 199 $out .= '<h3>Generate Smart FAQs in Seconds</h3>'; 200 $out .= '<h4>Need AI to create relevant questions and answers for your pages, posts, or products?</h4>'; 201 $out .= '<p>Let our <b>smart FAQ generator</b> do the heavy lifting for you. Automatically generate <b>AI-optimised Q&As</b> formatted for Google and AI search.</p>'; 202 $out .= '<ul class="faqm-list">'; 203 $out .= '<li>✅ Save time — Instantly generate FAQs relevant to your content</li>'; 204 $out .= '<li>✅ Boost visibility — Use SEO and AI Search friendly schema that ranks</li>'; 205 $out .= '<li>✅ See what AI finds relevant — Discover how AI and search engines interpret your content</li>'; 206 $out .= '</ul>'; 207 $out .= '<p><button type="button" class="button" id="faqm_join_premium">Join Premium</button></p>'; 208 } 209 $out .= '</div> <!-- .faqm_qandas -->'; 210 return $out; 211 } 212 213 214 function zzfaqm_premium_faqs($post_edit=true){ 215 $member = (int) get_transient('faqm_member_status'); 216 $img_url = plugin_dir_url(FAQM_ROOT) . 'img/Ribbon-Logo-64.png'; 217 $out = '<div class="faqm_qandas">'; 218 $out .= '<div class="faqm-logo-wrap"><img src="' . esc_url($img_url) . '" alt="FAQ Magic Logo" class="faqm-logo"></div>'; 219 // === if not a member ===> 220 if ($member){ 221 if ($post_edit){ 222 $out .= '<h3>Proposed FAQs [AI Generated]</h3>'; 223 $out .= '<h4>Generate a list of FAQs using AI</h4>'; 224 $out .= '<p>Press the AI Suggest button to generate a list of AI generated Questions and Answers.</p>'; 225 $out .= '<ul class="faqm-list">'; 226 $out .= '<li>✅ Smart Q&A generation from your content</li>'; 227 $out .= '<li>✅ Smart Q&A generation for your topic</li>'; 228 $out .= '<li>✅ Select and copy to the form</li>'; 229 $out .= '<li>✅ Add to your content</li>'; 230 $out .= '</ul>'; 231 $out .= '<p><button type="button" class="button" id="faqm_ai_qanda_2">Generate FAQs</button></p>'; 232 } else { 233 $out .= '<h3>Proposed FAQs [AI Generated]</h3>'; 175 234 $out .= '<h4>Premium Member</h4>'; 176 235 $out .= '<p>Generate a list of FAQs using AI</p>'; … … 185 244 } 186 245 } else { 246 $out .= '<h3>Proposed FAQs [AI Generated]</h3>'; 187 247 $out .= '<h4>Upgrade for AI-Powered Insights</h4>'; 188 248 $out .= '<p>Generate intelligent FAQ suggestions automatically using advanced AI — save time, boost visibility, and improve your site’s performance.</p>'; -
faq-magic/trunk/js/faq-magic-admin.js
r3379641 r3382225 3 3 $(document).ready(function() { 4 4 const $btn = $('#faqm_ai_qanda'); 5 if ($btn.length) { 6 if (typeof faqm_ajax !== 'undefined' && parseInt(faqm_ajax.member) !== 1) { 5 if ($btn.length && typeof faqm_ajax !== 'undefined'){ 6 let member = Number(faqm_ajax.member || 0); 7 console.log('MEMBER', member) 8 if (!member) { 7 9 $btn.prop('disabled', true) 8 10 .addClass('faqm-disabled') … … 150 152 console.log('SECURITY CODE',currentCode); //================= 151 153 // --- Determine if we need to refresh (no valid code or last check > 1 day) --- 152 const needsRefresh = !/^[A-Za-z0-9]{5}$/.test(currentCode) || (now - lastCheck > oneDay); 154 const needsRefresh = !/^[A-Za-z0-9]{5}$/.test(currentCode) || ((now - lastCheck) > oneDay); 155 //const needsRefresh = 1; 153 156 154 157 if (!needsRefresh) { -
faq-magic/trunk/readme.txt
r3379641 r3382225 4 4 Requires at least: 5.1 5 5 Tested up to: 6.8 6 Stable tag: 1.3. 26 Stable tag: 1.3.3 7 7 Requires PHP: 7.4 8 8 License: GPLv2 or later … … 127 127 128 128 == Changelog == 129 = 1.3.3 = 130 * Help and additional UI improvements 131 129 132 = 1.3.2 = 130 133 * UI Improvements
Note: See TracChangeset
for help on using the changeset viewer.