Plugin Directory

Changeset 3359166


Ignore:
Timestamp:
09/10/2025 12:06:22 PM (5 months ago)
Author:
cifi
Message:
  • Update - Add the Llms.txt feature to configure rules for AI crawlers
Location:
squirrly-seo/tags/12.4.13
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • squirrly-seo/tags/12.4.13/classes/helpers/Tools.php

    r3278710 r3359166  
    341341            'sq_robots_permission' => array(),
    342342
     343            //LLMS
     344            'sq_auto_llms' => 0,
     345            'sq_llms_permission' => array(),
     346
    343347            //Metas
    344348            'sq_use' => 1,
     
    861865                $options['sq_auto_amp'] = 0;
    862866                $options['sq_auto_robots'] = 0;
     867                $options['sq_auto_llms'] = 0;
    863868                $options['sq_auto_facebook'] = 0;
    864869                $options['sq_sla_social_fetch'] = 0;
     
    885890                $options['sq_auto_amp'] = 1;
    886891                $options['sq_auto_robots'] = 1;
     892                $options['sq_auto_llms'] = 1;
    887893                $options['sq_auto_facebook'] = 1;
    888894                $options['sq_sla_social_fetch'] = 1;
  • squirrly-seo/tags/12.4.13/controllers/Frontend.php

    r3200921 r3359166  
    9595                    SQ_Classes_ObjController::getClass( 'SQ_Models_Services_Robots' );
    9696                    apply_filters( 'sq_robots', false );
     97                    exit();
     98                }
     99            }
     100
     101            //show the robots rules
     102            if ( SQ_Classes_Helpers_Tools::getOption( 'sq_auto_llms' ) == 1 ) {
     103                if ( $basename == "llms.txt" ) {
     104                    SQ_Classes_ObjController::getClass( 'SQ_Models_Services_Llms' );
     105                    apply_filters( 'sq_llms', false );
    97106                    exit();
    98107                }
  • squirrly-seo/tags/12.4.13/core/BlockFeatures.php

    r3257898 r3359166  
    847847            ), //Robots.txt File
    848848            array(
     849                'title'       => "Llms.txt File",
     850                'description' => "Control how AI search engines and language model crawlers can access and use your website’s content.",
     851                'category'    => "Miscellaneous Features",
     852                'mainfeature' => false,
     853                'option'      => 'sq_auto_llms',
     854                'active'      => SQ_Classes_Helpers_Tools::getOption( 'sq_auto_llms' ),
     855                'optional'    => true,
     856                'connection'  => false,
     857                'logo'        => 'fasq-brands fa-android',
     858                'link'        => SQ_Classes_Helpers_Tools::getAdminUrl( 'sq_seosettings', 'tweaks#tab=llms' ),
     859                'details'     => false,
     860                'show'        => true,
     861            ), //Llms.txt File
     862            array(
    849863                'title'       => "Favicon Site Icon",
    850864                'description' => "Add your <strong>website icon</strong> in the browser tabs and on other devices like <strong>iPhone, iPad and Android phones</strong>.",
  • squirrly-seo/tags/12.4.13/models/Menu.php

    r3253890 r3359166  
    647647                'capability' => 'sq_manage_settings',
    648648                'icon'       => 'fa-solid fa-map',
    649                 'show'       => ( SQ_Classes_Helpers_Tools::getOption( 'sq_auto_sitemap' ) || SQ_Classes_Helpers_Tools::getOption( 'sq_auto_links' ) || SQ_Classes_Helpers_Tools::getOption( 'sq_auto_robots' ) || SQ_Classes_Helpers_Tools::getOption( 'sq_auto_favicon' ) || SQ_Classes_Helpers_Tools::getOption( 'sq_seoexpert' ) ),
     649                'show'       => ( SQ_Classes_Helpers_Tools::getOption( 'sq_auto_sitemap' ) || SQ_Classes_Helpers_Tools::getOption( 'sq_auto_links' ) || SQ_Classes_Helpers_Tools::getOption( 'sq_auto_robots' ) || SQ_Classes_Helpers_Tools::getOption( 'sq_auto_llms' ) || SQ_Classes_Helpers_Tools::getOption( 'sq_auto_favicon' ) || SQ_Classes_Helpers_Tools::getOption( 'sq_seoexpert' ) ),
    650650                'tabs'       => array(
    651651                    array(
     
    663663                        'tab'   => 'robots',
    664664                        'show'  => SQ_Classes_Helpers_Tools::getOption( 'sq_auto_robots' ),
     665                    ),
     666                    array(
     667                        'title' => esc_html__( "LLMs File", 'hide-my-wp' ),
     668                        'tab'   => 'llms',
     669                        'show'  => SQ_Classes_Helpers_Tools::getOption( 'sq_auto_llms' ),
    665670                    ),
    666671                    array(
  • squirrly-seo/tags/12.4.13/models/Settings.php

    r3234096 r3359166  
    5858        }
    5959
     60        //Save custom llms
     61        if ( SQ_Classes_Helpers_Tools::getIsset( 'llms_permission' ) ) {
     62            $llms = SQ_Classes_Helpers_Tools::getValue( 'llms_permission', '', true );
     63            $llms = explode( PHP_EOL, $llms );
     64            $llms = str_replace( "\r", "", $llms );
     65
     66            if ( ! empty( $llms ) ) {
     67
     68                if ( file_exists( ABSPATH . "/" . 'llms.txt' ) ) {
     69                    @rename( ABSPATH . "/" . 'llms.txt', ABSPATH . "/" . 'llms_ren' . time() . '.txt' );
     70                }
     71
     72                SQ_Classes_Helpers_Tools::saveOptions('sq_llms_permission', $llms);
     73            }
     74        }
     75
    6076        /* if there is an icon to upload */
    6177        if ( SQ_Classes_Helpers_Tools::getOption( 'sq_auto_favicon' ) ) {
  • squirrly-seo/tags/12.4.13/readme.txt

    r3359108 r3359166  
    252252== Changelog ==
    253253= 12.4.13 =
     254* Update - Add the Llms.txt feature to configure rules for AI crawlers
    254255* Fix - Sitemap cache directory creation issue on multilingual sites
    255256* Fix - Daily progress and optimization in Rankings
  • squirrly-seo/tags/12.4.13/view/Onboarding/Step2.php

    r3257898 r3359166  
    224224                            </h3>
    225225
     226                            <h3 class="card-title mt-4">
     227                                <span class="checker col-12 row m-0 p-0">
     228                                    <span class="col-12 m-0 p-0 sq-switch sq-switch-sm">
     229                                        <span class=""><?php echo esc_html__( "Llms.txt", 'squirrly-seo' ); ?></span>
     230                                        <input type="hidden" name="sq_auto_llms" value="0"/>
     231                                        <input type="checkbox" id="sq_auto_llms" name="sq_auto_llms" class="sq-switch" <?php echo( SQ_Classes_Helpers_Tools::getOption( 'sq_auto_llms' ) ? 'checked="checked"' : '' ) ?> value="1"/>
     232                                        <label for="sq_auto_llms" class="ml-2 mt-1"></label>
     233                                    </span>
     234                                    <span class="col-12 row m-0 p-0 sq_auto_llms">
     235                                        <span class="small text-black-50"><?php echo esc_html__( "Control how AI search engines and language model crawlers can access and use your website’s content.", 'squirrly-seo' ); ?></span>
     236                                    </span>
     237                                </span>
     238                            </h3>
     239
    226240
    227241                            <h3 class="card-title mt-4">
  • squirrly-seo/tags/12.4.13/view/SeoSettings/Tweaks.php

    r3219626 r3359166  
    499499                                            <?php echo esc_html__( "A robots.txt file tells search engine crawlers which pages or files the crawler can or can't request from your site.", 'squirrly-seo' ); ?>
    500500                                        </div>
     501                                        <div class="small text-black-50 my-1 pr-3"><?php echo '<a href="'.esc_url( home_url('robots.txt')).'" target="_blank">'.esc_url( home_url('robots.txt')).'</a>' ?></div>
    501502                                    </div>
    502503
     
    505506                                            <?php echo esc_html__( "Edit the Robots.txt data", 'squirrly-seo' ); ?>:
    506507                                            <a href="https://howto12.squirrly.co/kb/robots-txt-settings/#default_robots" target="_blank"><i class="fa-solid fa-question-circle m-0 px-2" style="display: inline;"></i></a>
    507                                             <div class="small text-black-50 my-1 pr-3"><?php echo sprintf( esc_html__( "Does not physically create the robots.txt file. The best option for Multisites.", 'squirrly-seo' ), '<a href="https://developers.facebook.com/apps/" target="_blank"><strong>', '</strong></a>' ); ?></div>
     508                                            <div class="small text-black-50 my-1 pr-3"><?php echo sprintf( esc_html__( "Does not physically create the robots.txt file. The best option for WP Multisite.", 'squirrly-seo' ), '<a href="https://developers.facebook.com/apps/" target="_blank"><strong>', '</strong></a>' ); ?></div>
    508509                                        </div>
    509510
    510511                                        <div class="col-8 p-0 m-0 form-group">
    511512                                            <?php
    512                                                 $robots            = '';
    513513                                                $robots_permission = SQ_Classes_Helpers_Tools::getOption( 'sq_robots_permission' );
    514514
    515515                                                if ( ! empty( $robots_permission ) ) {
    516516                                                    $robots_permission = implode( PHP_EOL, (array) $robots_permission );
     517                                                } else {
     518                                                    $robots_permission = '';
    517519                                                }
    518520                                            ?>
     
    525527
    526528                                        <?php do_action( 'sq_tweaks_robots_after' ); ?>
     529
     530                                        <div class="col-12 m-0 p-0 mt-5">
     531                                            <button type="submit" class="btn btn-primary btn-lg m-0 p-0 py-2 px-4 rounded-0"><?php echo esc_html__( "Save Settings", 'squirrly-seo' ); ?></button>
     532                                        </div>
     533
     534                                    </div>
     535
     536                                </div>
     537                                <div id="llms" class="col-12 py-0 px-4 m-0 tab-panel">
     538                                    <div class="col-12 m-0 p-0 my-2">
     539                                        <h3 class="card-title"><?php echo esc_html__( "LLMs File", 'squirrly-seo' ); ?>
     540                                            <a href="https://howto12.squirrly.co/kb/llms-txt-settings/" target="_blank"><i class="fa-solid fa-question-circle m-0 p-0"></i></a>
     541                                        </h3>
     542                                        <div class="col-12 small m-0 p-0">
     543                                            <?php echo esc_html__( "Enable and configure rules for AI crawlers and language models, controlling how your site’s content can be accessed and used by AI search engines.", 'squirrly-seo' ); ?>
     544                                        </div>
     545                                        <div class="small text-black-50 my-1 pr-3"><?php echo '<a href="'.esc_url( home_url('llms.txt')).'" target="_blank">'.esc_url( home_url('llms.txt')).'</a>' ?></div>
     546                                    </div>
     547
     548                                    <div class="col-12 row m-0 p-0 my-5">
     549                                        <div class="col-4 p-0 pr-3 font-weight-bold">
     550                                            <?php echo esc_html__( "Edit the Llms.txt data", 'squirrly-seo' ); ?>:
     551                                            <a href="https://howto12.squirrly.co/kb/llms-txt-settings/#default" target="_blank"><i class="fa-solid fa-question-circle m-0 px-2" style="display: inline;"></i></a>
     552                                            <div class="small text-black-50 my-1 pr-3"><?php echo sprintf( esc_html__( "Does not physically create the llms.txt file. The best option for WP Multisite.", 'squirrly-seo' ), '<a href="https://developers.facebook.com/apps/" target="_blank"><strong>', '</strong></a>' ); ?></div>
     553                                        </div>
     554
     555                                        <div class="col-8 p-0 m-0 form-group">
     556                                            <?php
     557                                                $llms_permission = SQ_Classes_Helpers_Tools::getOption( 'sq_llms_permission' );
     558
     559                                                if ( ! empty( $llms_permission ) ) {
     560                                                    $llms_permission = implode( PHP_EOL, (array) $llms_permission );
     561                                                } else{
     562                                                    $llms_permission = '';
     563                                                }
     564                                            ?>
     565                                            <textarea class="form-control" name="llms_permission" rows="10"><?php echo $llms_permission ?></textarea>
     566
     567                                            <div class="col-12 py-3 px-0 text-danger">
     568                                                <?php echo esc_html__( "Edit the Llms.txt only if you know what you're doing. Adding wrong rules in LLMs can lead to SEO ranking errors or block AI indexing.", 'squirrly-seo' ); ?>
     569                                            </div>
     570                                        </div>
     571
     572                                        <?php do_action( 'sq_tweaks_llms_after' ); ?>
    527573
    528574                                        <div class="col-12 m-0 p-0 mt-5">
Note: See TracChangeset for help on using the changeset viewer.