Plugin Directory

Changeset 3382225


Ignore:
Timestamp:
10/21/2025 10:55:02 PM (4 months ago)
Author:
creatorseo
Message:

1.3.3

  • Help and additional UI improvements
Location:
faq-magic/trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • faq-magic/trunk/class.faq-magic.php

    r3379641 r3382225  
    8383            add_action('wp_enqueue_scripts', array($this, 'faqm_enqueue_main'));
    8484            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');
    95105                // Disable Yoast's JSON-LD schema output
    96106                //add_filter( 'wpseo_json_ld_output', '__return_false' );
  • faq-magic/trunk/css/faq-magic-admin.css

    r3379641 r3382225  
    105105
    106106/* AI Suggest button */
    107 .faqm-ai-btn {
    108     background-color: #fff298 !important;
    109     border-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;
    111111    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);
    116117    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
    125151
    126152/* ----- Options / Settings Table Format ----- */
     
    463489}
    464490
    465 /* ---------- AI emoji prefix ---------- */
    466 .faqm-ai-btn::before {
    467     content: "🤖 ";
    468 }
    469 
    470491/* ---------- Advice for FAQs ---------- */
    471 #faqm_advice {
     492.faqm_advice {
    472493    display: inline-flex;
    473494    align-items: center;
     
    478499    background: none; /* remove background highlight */
    479500    border: none;     /* remove border */
    480     margin-left: 10px;
     501    margin: 10px 5px 0 0;
    481502    padding: 0;
    482503}
    483504
    484 #faqm_advice::before {
     505.faqm_advice::before {
    485506    content: "i";
    486507    display: inline-flex;
     
    491512    font-size: 12px;
    492513    color: #1F95DE;
    493     border: 1.5px solid #1F95DE;
     514    border: 1px solid #1F95DE;
    494515    border-radius: 50%;
    495516    width: 16px;
  • faq-magic/trunk/faq-magic.php

    r3379641 r3382225  
    55 * Plugin URI:  http://www.hub5050.com/faq-magic/
    66 * Description: Webpage JSON-LD and FAQ plugin for AI bot compatibility
    7  * Version:     1.3.2
     7 * Version:     1.3.3
    88 * Author:      Clinton [Hub5050.com]
    99 * Author URI:  http://www.hub5050.com
  • faq-magic/trunk/inc/faq-magic-metabox.php

    r3379641 r3382225  
    6161                <input type="hidden" id="faqm_language" name="faqm_language" value="'.esc_attr($language).'" />
    6262                </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>';
    6564            if ( $aiBtn ) {
    66                 $out .= '&nbsp; <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 .= '&nbsp; <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 -->';
    6871            $out .= '</p>';
    6972        $out .= '</div> <!-- faqm-pageform -->';
     
    7477            $out .= '<p><label>Question: <input type="text" id="faqm_question" class="widefat" /></label></p>';
    7578            $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>';
    7780            if ( $aiBtn ) {
    78                 $out .= '&nbsp; <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 .= '&nbsp; <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 -->';
    8391            $out .= '</p>';
    84            
    8592            // --- Existing FAQs ---
    8693            $out .= '<div id="faqm_faq_list">';
     
    159166    $out = '<div class="faqm_qandas">';
    160167    $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>';
    162168    // === if not a member ===>
    163169    if ($member){
    164170        if ($post_edit){
     171            $out .= '<h3>Proposed FAQs [AI Generated]</h3>';
    165172            $out .= '<h4>Generate a list of FAQs using AI</h4>';
    166173            $out .= '<p>Press the AI Suggest button to generate a list of AI generated Questions and Answers.</p>';
     
    173180            $out .= '<p><button type="button" class="button" id="faqm_ai_qanda_2">Generate FAQs</button></p>';
    174181        } 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&amp;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&amp;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
     214function 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>';
    175234            $out .= '<h4>Premium Member</h4>';
    176235            $out .= '<p>Generate a list of FAQs using AI</p>';
     
    185244        }
    186245    } else {
     246        $out .= '<h3>Proposed FAQs [AI Generated]</h3>';
    187247        $out .= '<h4>Upgrade for AI-Powered Insights</h4>';
    188248        $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  
    33    $(document).ready(function() {
    44        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) {
    79                $btn.prop('disabled', true)
    810                    .addClass('faqm-disabled')
     
    150152            console.log('SECURITY CODE',currentCode); //=================
    151153            // --- 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;
    153156
    154157            if (!needsRefresh) {
  • faq-magic/trunk/readme.txt

    r3379641 r3382225  
    44Requires at least: 5.1
    55Tested up to: 6.8
    6 Stable tag: 1.3.2
     6Stable tag: 1.3.3
    77Requires PHP: 7.4
    88License: GPLv2 or later
     
    127127
    128128== Changelog ==
     129= 1.3.3 =
     130* Help and additional UI improvements
     131
    129132= 1.3.2 =
    130133* UI Improvements
Note: See TracChangeset for help on using the changeset viewer.