Plugin Directory

Changeset 3440912


Ignore:
Timestamp:
01/16/2026 10:47:45 AM (2 months ago)
Author:
butterflymedia
Message:

Multiple database optimization passes for a more efficient performance. Also, remove Link Whisper, as it was adding a lot of overhead.

Location:
wp-perfect-plugin/trunk
Files:
3 deleted
8 edited

Legend:

Unmodified
Added
Removed
  • wp-perfect-plugin/trunk/assets/css/ui.css

    r3353167 r3440912  
    177177}
    178178
    179 #w3p_meta_box meter {
    180     display: block;
    181     width: 100%;
    182     height: 12px;
    183     margin: 0;
    184     padding: 0;
    185 }
    186 
    187179.jtable table {
    188180    table-layout: auto;
     
    193185    margin-left: 8px;
    194186    vertical-align: middle;
    195 }
    196 .meter-current.meter-green {
    197     color: #27ae60;
    198 }
    199 .meter-current.meter-yellow {
    200     color: #f1c40f;
    201 }
    202 .meter-current.meter-red {
    203     color: #e74c3c;
    204187}
    205188
  • wp-perfect-plugin/trunk/includes/functions.php

    r3434570 r3440912  
    8484        'wp_sitemaps_max_urls',
    8585        function ( $limit ) {
    86             return ( (int) get_option( 'w3p_sitemap_links' ) ) ? (int) get_option( 'w3p_sitemap_links' ) : 2000;
     86            $sitemap_links = (int) get_option( 'w3p_sitemap_links' );
     87            return $sitemap_links ? $sitemap_links : 2000;
    8788        },
    8889        10,
     
    9596
    9697function w3p_remove_post_type_from_wp_sitemap( $post_types ) {
    97     if ( $post_types ) {
    98         foreach ( $post_types as $type ) {
    99             if ( (int) get_option( 'w3p_enable_sitemap_' . strtolower( $type->name ) ) === 0 ) {
    100                 unset( $post_types[ $type->name ] );
    101             }
    102         }
    103     }
    104 
    105     return $post_types;
     98    if ( empty( $post_types ) ) {
     99        return $post_types;
     100    }
     101
     102    // Cache options to avoid repeated queries if function is called multiple times
     103    static $cached_options = [];
     104
     105    $filtered_post_types = [];
     106    foreach ( $post_types as $type ) {
     107        $option_name = 'w3p_enable_sitemap_' . strtolower( $type->name );
     108        if ( ! isset( $cached_options[ $option_name ] ) ) {
     109            $cached_options[ $option_name ] = (int) get_option( $option_name, 1 );
     110        }
     111        if ( $cached_options[ $option_name ] !== 0 ) {
     112            $filtered_post_types[ $type->name ] = $type;
     113        }
     114    }
     115
     116    return $filtered_post_types;
    106117}
    107118
    108119function w3p_remove_tax_from_sitemap( $taxonomies ) {
    109     if ( $taxonomies ) {
    110         foreach ( $taxonomies as $taxonomy ) {
    111             if ( (int) get_option( 'w3p_enable_sitemap_' . $taxonomy->name ) === 0 ) {
    112                 unset( $taxonomies[ $taxonomy->name ] );
    113             }
    114         }
    115     }
    116 
    117     return $taxonomies;
     120    if ( empty( $taxonomies ) ) {
     121        return $taxonomies;
     122    }
     123
     124    // Cache options to avoid repeated queries if function is called multiple times
     125    static $cached_options = [];
     126
     127    $filtered_taxonomies = [];
     128    foreach ( $taxonomies as $taxonomy ) {
     129        $option_name = 'w3p_enable_sitemap_' . $taxonomy->name;
     130        if ( ! isset( $cached_options[ $option_name ] ) ) {
     131            $cached_options[ $option_name ] = (int) get_option( $option_name, 1 );
     132        }
     133        if ( $cached_options[ $option_name ] !== 0 ) {
     134            $filtered_taxonomies[ $taxonomy->name ] = $taxonomy;
     135        }
     136    }
     137
     138    return $filtered_taxonomies;
    118139}
    119140
     
    145166        $exclude_ids = [];
    146167
     168        // Cache function_exists() results to avoid repeated checks
     169        static $has_edd = null;
     170        static $has_wc = null;
     171        static $has_mepr = null;
     172
     173        if ( $has_edd === null ) {
     174            $has_edd = function_exists( 'edd_get_option' );
     175        }
     176        if ( $has_wc === null ) {
     177            $has_wc = function_exists( 'wc_get_page_id' );
     178        }
     179        if ( $has_mepr === null ) {
     180            $has_mepr = function_exists( 'mepr_get_option' );
     181        }
     182
    147183        // Easy Digital Downloads
    148         if ( function_exists( 'edd_get_option' ) ) {
     184        if ( $has_edd ) {
    149185            $edd_noindex_pages = [
    150186                edd_get_option( 'purchase_page', 0 ),
     
    162198
    163199        // WooCommerce
    164         if ( function_exists( 'wc_get_page_id' ) ) {
     200        if ( $has_wc ) {
    165201            $wc_noindex_pages = [
    166202                wc_get_page_id( 'checkout' ),
     
    177213
    178214        // MemberPress
    179         if ( function_exists( 'mepr_get_option' ) ) {
     215        if ( $has_mepr ) {
    180216            $mepr_noindex_pages = [
    181217                mepr_get_option( 'account_page_id' ),
     
    214250    }
    215251
    216     if ( (string) get_post_meta( $post->ID, '_w3p_title', true ) !== '' ) {
    217         $title = get_post_meta( $post->ID, '_w3p_title', true );
     252    $custom_title = get_post_meta( $post->ID, '_w3p_title', true );
     253    if ( (string) $custom_title !== '' ) {
     254        $title = $custom_title;
    218255    }
    219256
     
    224261
    225262function w3p_get_excerpt( $post_id ) {
    226     $excerpt = esc_attr( wp_strip_all_tags( get_the_excerpt( $post_id ) ) );
    227 
    228     if ( (string) get_post_meta( $post_id, '_w3p_excerpt', true ) !== '' ) {
    229         $excerpt = get_post_meta( $post_id, '_w3p_excerpt', true );
    230     }
    231 
    232     return $excerpt;
     263    $custom_excerpt = get_post_meta( $post_id, '_w3p_excerpt', true );
     264   
     265    if ( (string) $custom_excerpt !== '' ) {
     266        return $custom_excerpt;
     267    }
     268
     269    return esc_attr( wp_strip_all_tags( get_the_excerpt( $post_id ) ) );
    233270}
    234271
     
    262299
    263300    if ( (int) get_option( 'w3p_og' ) === 1 ) {
    264         add_action( 'wp_head', 'w3p_head_og' );
     301        w3p_head_og();
    265302    }
    266303
     
    281318    $canonical_url = '';
    282319
    283     if ( is_singular() ) {
     320    // Check front page first (most common case, no queries needed)
     321    if ( is_front_page() ) {
     322        $canonical_url = home_url( '/' );
     323    } elseif ( is_singular() ) {
    284324        // Posts and pages
    285325        $canonical_url = get_permalink();
     
    291331                // For categories, use the current URL to preserve custom URL structures
    292332                // This handles cases where categories are siblings or have custom permalink structures
    293                 $current_url   = home_url( $_SERVER['REQUEST_URI'] );
     333                $request_uri = isset( $_SERVER['REQUEST_URI'] ) ? $_SERVER['REQUEST_URI'] : '';
     334                $current_url = home_url( $request_uri );
    294335                $canonical_url = strtok( $current_url, '?' ); // Remove query parameters
    295336            } else {
     
    299340            // Fallback: if the term link fails, use the current URL without query parameters
    300341            if ( is_wp_error( $canonical_url ) ) {
    301                 $current_url   = home_url( $_SERVER['REQUEST_URI'] );
     342                $request_uri = isset( $_SERVER['REQUEST_URI'] ) ? $_SERVER['REQUEST_URI'] : '';
     343                $current_url = home_url( $request_uri );
    302344                $canonical_url = strtok( $current_url, '?' ); // Remove query parameters
    303345            }
    304346        }
    305347    } elseif ( is_author() ) {
    306         // Author pages
    307         $canonical_url = get_author_posts_url( get_the_author_meta( 'ID' ) );
     348        // Author pages - use queried object ID instead of get_the_author_meta
     349        $author_id = get_queried_object_id();
     350        if ( $author_id ) {
     351            $canonical_url = get_author_posts_url( $author_id );
     352        }
    308353    } elseif ( is_date() ) {
    309         // Date archive pages
     354        // Date archive pages - cache query vars to avoid multiple calls
     355        $year = get_query_var( 'year' );
    310356        if ( is_year() ) {
    311             $canonical_url = get_year_link( get_query_var( 'year' ) );
     357            $canonical_url = get_year_link( $year );
    312358        } elseif ( is_month() ) {
    313             $canonical_url = get_month_link( get_query_var( 'year' ), get_query_var( 'monthnum' ) );
     359            $monthnum = get_query_var( 'monthnum' );
     360            $canonical_url = get_month_link( $year, $monthnum );
    314361        } elseif ( is_day() ) {
    315             $canonical_url = get_day_link( get_query_var( 'year' ), get_query_var( 'monthnum' ), get_query_var( 'day' ) );
     362            $monthnum = get_query_var( 'monthnum' );
     363            $day = get_query_var( 'day' );
     364            $canonical_url = get_day_link( $year, $monthnum, $day );
    316365        }
    317366    } elseif ( is_home() && ! is_front_page() ) {
    318367        // Blog posts page
    319         $canonical_url = get_permalink( get_option( 'page_for_posts' ) );
    320     } elseif ( is_front_page() ) {
    321         // Front page
    322         $canonical_url = home_url( '/' );
     368        $page_for_posts = get_option( 'page_for_posts' );
     369        if ( $page_for_posts ) {
     370            $canonical_url = get_permalink( $page_for_posts );
     371        }
    323372    } elseif ( is_search() ) {
    324373        // Search results page
     
    362411    $website_description = get_bloginfo( 'description' );
    363412
    364     // Get logo details
     413    // Get logo details from attachment metadata (database) instead of file system
     414    $w3p_kg_logo_width  = 0;
     415    $w3p_kg_logo_height = 0;
    365416    if ( $w3p_kg_logo ) {
    366         $logo_path = str_replace( home_url( '/' ), ABSPATH, $w3p_kg_logo );
    367         if ( file_exists( $logo_path ) ) {
    368             $logo_dimensions = getimagesize( $logo_path );
    369             if ( $logo_dimensions ) {
    370                 $w3p_kg_logo_width  = $logo_dimensions[0];
    371                 $w3p_kg_logo_height = $logo_dimensions[1];
     417        // Try to get attachment ID from URL
     418        $attachment_id = attachment_url_to_postid( $w3p_kg_logo );
     419        if ( $attachment_id ) {
     420            // Get dimensions from attachment metadata (stored in database)
     421            $metadata = wp_get_attachment_metadata( $attachment_id );
     422            if ( $metadata && isset( $metadata['width'] ) && isset( $metadata['height'] ) ) {
     423                $w3p_kg_logo_width  = (int) $metadata['width'];
     424                $w3p_kg_logo_height = (int) $metadata['height'];
    372425            }
    373426        }
     
    629682}
    630683
    631 
    632 
    633 /**
    634  * Link Whisper
    635  */
    636 function w3p_replace_words_with_links( $content ) {
    637     if ( is_main_query() && in_the_loop() && is_singular( [ 'post', 'page', 'property', 'faq' ] ) ) {
    638         $words = get_option( 'w3p_link_repeater' );
    639 
    640         if ( $words ) {
    641             foreach ( $words as $word_data ) {
    642                 $word = $word_data['title'];
    643                 $link = $word_data['url'];
    644                 $rel  = isset( $word_data['rel'] ) ? $word_data['rel'] : '';
    645 
    646                 // Create a regular expression pattern to match the word but avoid existing links and HTML attributes
    647                 $pattern = '/(\b' . preg_quote( $word, '/' ) . '\b)(?![^<]*>|[^<>]*<\/a>)/i';
    648 
    649                 $link_html = '<a href="' . esc_url( $link ) . '"';
    650                 if ( ! empty( $rel ) ) {
    651                     $link_html .= ' rel="' . esc_attr( $rel ) . '"';
    652                 }
    653                 $link_html .= '>' . $word . '</a>';
    654 
    655                 // Use preg_replace_callback to replace only full words not already linked and not within attributes
    656                 $content = preg_replace_callback(
    657                     '/(<[^>]+>)|(\b' . preg_quote( $word, '/' ) . '\b(?![^<]*>|[^<>]*<\/a>))/i',
    658                     function ( $matches ) use ( $link_html ) {
    659                         // If this is an HTML tag, return it unchanged
    660                         if ( ! empty( $matches[1] ) ) {
    661                             return $matches[1];
    662                         }
    663                         // Otherwise, replace the word with the link
    664                         return $link_html;
    665                     },
    666                     $content
    667                 );
    668             }
    669         }
    670     }
    671 
    672     return $content;
    673 }
    674 
    675 
    676 
    677 if ( (int) get_option( 'w3p_enable_link_whisper' ) === 1 ) {
    678     add_filter( 'the_content', 'w3p_replace_words_with_links', 10 );
    679 }
    680 
    681684/**
    682685 * Robots meta handling using WordPress 5.7+ native filter.
     
    705708        global $post;
    706709
    707         // Resolve post type robustly (ID, queried object, or global $post)
    708         $post_type = get_post_type( get_queried_object_id() );
    709         if ( ! $post_type ) {
    710             $qo = get_queried_object();
    711             if ( $qo && ! is_wp_error( $qo ) && ! empty( $qo->post_type ) ) {
    712                 $post_type = $qo->post_type;
    713             } elseif ( isset( $post ) && isset( $post->post_type ) ) {
    714                 $post_type = $post->post_type;
    715             }
     710        if ( ! isset( $post->ID ) ) {
     711            return $robots;
     712        }
     713
     714        // Use post type directly from $post object, fallback to get_post_type() if needed
     715        $post_type = $post->post_type;
     716        if ( empty( $post_type ) ) {
     717            $post_type = get_post_type( $post->ID );
    716718        }
    717719
     
    728730    }
    729731
    730     // WooCommerce noindex
    731     if ( function_exists( 'WC' ) ) {
     732    // WooCommerce noindex - only check if there are GET parameters
     733    if ( function_exists( 'WC' ) && ! empty( $_GET ) ) {
    732734        $blocked_params = [
    733735            'add-to-cart',
     
    737739        ];
    738740
     741        $get_keys = array_keys( $_GET );
     742
    739743        foreach ( $blocked_params as $param ) {
    740             foreach ( $_GET as $key => $value ) {
     744            foreach ( $get_keys as $key ) {
    741745                if ( stripos( $key, $param ) !== false ) {
    742746                    $robots['noindex'] = true;
  • wp-perfect-plugin/trunk/includes/meta.php

    r3343479 r3440912  
    4242
    4343    <div class="meter-container">
    44         <meter id="w3p-meter--title" min="0" max="60" value="0" low="20" high="40" optimum="50"></meter>
    4544        <span class="meter-counter" id="w3p-title-counter"><span class="meter-current">0</span>/60</span>
    4645    </div>
     
    6059
    6160    <div class="meter-container">
    62         <meter id="w3p-meter--excerpt" min="0" max="160" value="0" low="120" high="140" optimum="150"></meter>
    6361        <span class="meter-counter" id="w3p-excerpt-counter"><span class="meter-current">0</span>/160</span>
    6462    </div>
     
    6967        <br><small>Check this box to prevent search engines from indexing this page and following links on it.</small>
    7068    </p>
     69    <script>
     70    (function() {
     71        const title = document.getElementById('w3p-title');
     72        const excerpt = document.getElementById('w3p-excerpt');
     73        const titleCounter = document.querySelector('#w3p-title-counter .meter-current');
     74        const excerptCounter = document.querySelector('#w3p-excerpt-counter .meter-current');
     75
     76        titleCounter.textContent = title.value.length;
     77        title.addEventListener('input', () => {
     78            titleCounter.textContent = title.value.length;
     79        });
     80
     81        excerptCounter.textContent = excerpt.value.length;
     82        excerpt.addEventListener('input', () => {
     83            excerptCounter.textContent = excerpt.value.length;
     84        });
     85    })();
     86    </script>
    7187    <?php
    7288}
  • wp-perfect-plugin/trunk/includes/schema-breadcrumbs.php

    r3362714 r3440912  
    66
    77function w3p_schema_breadcrumbs() {
    8     $page_for_posts = get_option( 'page_for_posts' );
    9     $site_name      = get_bloginfo( 'name' );
    10 
    11     // Determine the slug for the blog posts page
    12     $blog_posts_page_slug = $page_for_posts ? get_permalink( $page_for_posts ) : trailingslashit( get_site_url() );
     8    // Cache options that rarely change
     9    static $page_for_posts = null;
     10    static $site_name = null;
     11    static $blog_posts_page_slug = null;
     12   
     13    if ( $page_for_posts === null ) {
     14        $page_for_posts = get_option( 'page_for_posts' );
     15    }
     16    if ( $site_name === null ) {
     17        $site_name = get_bloginfo( 'name' );
     18    }
     19    if ( $blog_posts_page_slug === null ) {
     20        $blog_posts_page_slug = $page_for_posts ? get_permalink( $page_for_posts ) : trailingslashit( get_site_url() );
     21    }
    1322
    1423    if ( ! is_search() ) {
     
    3039        }
    3140
     41        // Use post object properties directly to avoid queries
     42        $post_permalink = get_permalink( $post->ID );
     43        $post_title     = $post->post_title;
     44
    3245        // Single Post
    3346        if ( is_singular( 'post' ) ) {
     
    4457                'position' => 2,
    4558                'item'     => [
    46                     '@id'  => esc_url( get_permalink() ),
    47                     'name' => esc_html( get_the_title() ),
     59                    '@id'  => esc_url( $post_permalink ),
     60                    'name' => esc_html( $post_title ),
    4861                ],
    4962            ];
    5063        } elseif ( is_singular( 'product' ) ) {
    5164            // Single Product
    52             $terms = wp_get_object_terms( $post->ID, 'product_cat' );
     65            $terms = wp_get_object_terms( $post->ID, 'product_cat', [ 'number' => 1 ] );
    5366            if ( ! is_wp_error( $terms ) && ! empty( $terms ) ) {
    54                 $product_category_slug = $terms[0]->slug;
    55                 $product_category_name = $terms[0]->name;
     67                $term = $terms[0];
     68                $term_link = get_term_link( $term );
    5669
    5770                $breadcrumbs['itemListElement'][] = [
     
    5972                    'position' => 1,
    6073                    'item'     => [
    61                         '@id'  => esc_url( get_term_link( $terms[0] ) ),
    62                         'name' => esc_html( $product_category_name ),
     74                        '@id'  => esc_url( $term_link ),
     75                        'name' => esc_html( $term->name ),
    6376                    ],
    6477                ];
     
    6780                    'position' => 2,
    6881                    'item'     => [
    69                         '@id'  => esc_url( get_permalink() ),
    70                         'name' => esc_html( get_the_title() ),
     82                        '@id'  => esc_url( $post_permalink ),
     83                        'name' => esc_html( $post_title ),
    7184                    ],
    7285                ];
     
    7588            // Pages (Including Parent-Child Hierarchy)
    7689            if ( $post->post_parent ) {
    77                 $parent_page_url   = get_permalink( $post->post_parent );
    78                 $parent_page_title = get_the_title( $post->post_parent );
     90                // Fetch parent post in one query instead of two separate calls
     91                $parent_post = get_post( $post->post_parent );
     92                if ( $parent_post ) {
     93                    $parent_page_url   = get_permalink( $parent_post->ID );
     94                    $parent_page_title = $parent_post->post_title;
    7995
    80                 $breadcrumbs['itemListElement'][] = [
    81                     '@type'    => 'ListItem',
    82                     'position' => 1,
    83                     'item'     => [
    84                         '@id'  => esc_url( $parent_page_url ),
    85                         'name' => esc_html( $parent_page_title ),
    86                     ],
    87                 ];
     96                    $breadcrumbs['itemListElement'][] = [
     97                        '@type'    => 'ListItem',
     98                        'position' => 1,
     99                        'item'     => [
     100                            '@id'  => esc_url( $parent_page_url ),
     101                            'name' => esc_html( $parent_page_title ),
     102                        ],
     103                    ];
     104                }
    88105            }
    89106
     
    92109                'position' => $post->post_parent ? 2 : 1,
    93110                'item'     => [
    94                     '@id'  => esc_url( get_permalink() ),
    95                     'name' => esc_html( get_the_title() ),
     111                    '@id'  => esc_url( $post_permalink ),
     112                    'name' => esc_html( $post_title ),
    96113                ],
    97114            ];
     
    107124            ];
    108125        } else {
    109             // Reset query and post data
    110             wp_reset_query();
    111             wp_reset_postdata();
    112 
     126            // Use cached post data instead of calling get_permalink() and get_the_title() again
    113127            $breadcrumbs['itemListElement'][] = [
    114128                '@type'    => 'ListItem',
     
    123137                'position' => 2,
    124138                'item'     => [
    125                     '@id'  => esc_url( get_permalink() ),
    126                     'name' => esc_html( get_the_title() ),
     139                    '@id'  => esc_url( $post_permalink ),
     140                    'name' => esc_html( $post_title ),
    127141                ],
    128142            ];
  • wp-perfect-plugin/trunk/modules/w3p-search-console.php

    r3347664 r3440912  
    77    $w3p_google_meta    = get_option( 'w3p_google_webmaster' );
    88    $w3p_bing_meta      = get_option( 'w3p_bing_webmaster' );
    9     $w3p_yandex_meta    = get_option( 'w3p_yandex_webmaster' );
    109    $w3p_pinterest_meta = get_option( 'w3p_pinterest_webmaster' );
    11     $w3p_baidu_meta     = get_option( 'w3p_baidu_webmaster' );
    1210
    1311    $twitter_author_rel = get_option( 'w3p_twitter_author' );
     
    2220        echo '<meta name="msvalidate.01" content="' . esc_attr( $w3p_bing_meta ) . '">';
    2321    }
    24     if ( ! empty( $w3p_yandex_meta ) ) {
    25         echo '<meta name="yandex-verification" content="' . esc_attr( $w3p_yandex_meta ) . '">';
    26     }
    2722    if ( ! empty( $w3p_pinterest_meta ) ) {
    2823        echo '<meta name="p:domain_verify" content="' . esc_attr( $w3p_pinterest_meta ) . '">';
    29     }
    30     if ( ! empty( $w3p_baidu_meta ) ) {
    31         echo '<meta name="baidu-site-verification" content="' . esc_attr( $w3p_baidu_meta ) . '">';
    3224    }
    3325
     
    4537    $out = '';
    4638
    47     $w3p_local             = get_option( 'w3p_local' );
    48     $w3p_local_locality    = get_option( 'w3p_local_locality' );
    49     $w3p_local_region      = get_option( 'w3p_local_region' );
    50     $w3p_local_address     = get_option( 'w3p_local_address' );
    51     $w3p_local_postal_code = get_option( 'w3p_local_postal_code' );
    52     $w3p_local_country     = get_option( 'w3p_local_country' );
    53     $w3p_local_country_code = get_option( 'w3p_local_country_code' );
    54     $w3p_telephone         = get_option( 'w3p_telephone' );
    55 
    56     $twitter_author_rel = get_option( 'w3p_twitter_author' );
    57 
    58     $name = get_bloginfo( 'name' );
    59     $url  = get_bloginfo( 'url' );
     39    $w3p_local = get_option( 'w3p_local' );
    6040
    6141    if ( (int) $w3p_local === 1 ) {
     42        $w3p_local_locality    = get_option( 'w3p_local_locality' );
     43        $w3p_local_region      = get_option( 'w3p_local_region' );
     44        $w3p_local_address     = get_option( 'w3p_local_address' );
     45        $w3p_local_postal_code = get_option( 'w3p_local_postal_code' );
     46        $w3p_local_country     = get_option( 'w3p_local_country' );
     47        $w3p_local_country_code = get_option( 'w3p_local_country_code' );
     48        $w3p_telephone         = get_option( 'w3p_telephone' );
     49
     50        $twitter_author_rel = get_option( 'w3p_twitter_author' );
     51
     52        $name = get_bloginfo( 'name' );
     53        $url  = get_bloginfo( 'url' );
     54
    6255        // Create Organization schema
    6356        $organization_schema = [
  • wp-perfect-plugin/trunk/modules/w3p-settings.php

    r3363937 r3440912  
    1717            <a href="<?php echo esc_url( admin_url( 'admin.php?page=w3p&amp;tab=meta-posts' ) ); ?>" class="nav-tab <?php echo $tab === 'meta-posts' ? 'nav-tab-active' : ''; ?>"><?php esc_html_e( 'Meta Report (Posts)', 'wp-perfect-plugin' ); ?></a>
    1818            <a href="<?php echo esc_url( admin_url( 'admin.php?page=w3p&amp;tab=tools' ) ); ?>" class="nav-tab <?php echo $tab === 'tools' ? 'nav-tab-active' : ''; ?>"><?php esc_html_e( 'Tools', 'wp-perfect-plugin' ); ?></a>
    19 
    20             <?php if ( (int) get_option( 'w3p_enable_link_whisper' ) === 1 ) { ?>
    21                 <a href="<?php echo esc_url( admin_url( 'admin.php?page=w3p&amp;tab=links' ) ); ?>" class="nav-tab <?php echo $tab === 'links' ? 'nav-tab-active' : ''; ?>"><?php esc_html_e( 'Link Whisper', 'wp-perfect-plugin' ); ?></a>
    22             <?php } ?>
    2319        </h2>
    2420
     
    3127                update_option( 'w3p_enable_title_description', (int) sanitize_text_field( $_POST['w3p_enable_title_description'] ) );
    3228                update_option( 'w3p_enable_sitemap', (int) sanitize_text_field( $_POST['w3p_enable_sitemap'] ) );
    33                 update_option( 'w3p_enable_link_whisper', (int) sanitize_text_field( $_POST['w3p_enable_link_whisper'] ) );
    3429                update_option( 'w3p_enable_yoast_migrator', (int) sanitize_text_field( $_POST['w3p_enable_yoast_migrator'] ) );
    3530                update_option( 'w3p_enable_rankmath_migrator', (int) sanitize_text_field( $_POST['w3p_enable_rankmath_migrator'] ) );
     
    4540                delete_option( 'wot-verification' );
    4641                delete_option( 'w3p_topic_clustering' );
     42                delete_option( 'w3p_enable_link_whisper' );
     43                delete_option( 'w3p_link_repeater' );
    4744
    4845                echo '<div class="updated notice is-dismissible"><p>Settings updated!</p></div>';
     
    109106                            </td>
    110107                        </tr>
    111                         <tr>
    112                             <th scope="row"><label>Link Whisper</label></th>
    113                             <td>
    114                                 <p>
    115                                     <input name="w3p_enable_link_whisper" id="w3p_enable_link_whisper" type="checkbox" value="1" <?php checked( 1, (int) get_option( 'w3p_enable_link_whisper' ) ); ?>> <label for="w3p_enable_link_whisper">Enable Link Whisper</label>
    116                                 </p>
    117                             </td>
    118                         </tr>
    119 
    120108                        <tr><td colspan="2"><hr></td></tr>
    121109
     
    183171                    update_option( 'w3p_google_webmaster', sanitize_text_field( $_POST['w3p_google_webmaster'] ) );
    184172                    update_option( 'w3p_bing_webmaster', sanitize_text_field( $_POST['w3p_bing_webmaster'] ) );
    185                     update_option( 'w3p_yandex_webmaster', sanitize_text_field( $_POST['w3p_yandex_webmaster'] ) );
    186173                    update_option( 'w3p_pinterest_webmaster', sanitize_text_field( $_POST['w3p_pinterest_webmaster'] ) );
    187                     update_option( 'w3p_baidu_webmaster', sanitize_text_field( $_POST['w3p_baidu_webmaster'] ) );
     174
     175                    delete_option( 'w3p_yandex_webmaster' );
     176                    delete_option( 'w3p_baidu_webmaster' );
    188177
    189178                    update_option( 'w3p_twitter_author', sanitize_text_field( $_POST['w3p_twitter_author'] ) );
     
    200189                    <h3><?php esc_html_e( 'Search Engine Verification And Link Relationships', 'wp-perfect-plugin' ); ?></h3>
    201190
    202                     <p><span class="dashicons dashicons-editor-help"></span> This section allows you to verify ownership of your site with Google Search Console, Bing Webmaster Tools, Yandex, Pinterest, and Baidu and Web of Trust.</p>
     191                    <p><span class="dashicons dashicons-editor-help"></span> This section allows you to verify ownership of your site with Google Search Console, Bing Webmaster Tools, and Pinterest.</p>
    203192                    <p>
    204193                        <input name="w3p_google_webmaster" type="text" class="regular-text" value="<?php echo esc_attr( get_option( 'w3p_google_webmaster' ) ); ?>"> <label>Google Search Console</label>
     
    210199                    </p>
    211200                    <p>
    212                         <input name="w3p_yandex_webmaster" type="text" class="regular-text" value="<?php echo esc_attr( get_option( 'w3p_yandex_webmaster' ) ); ?>"> <label>Yandex Verification</label>
    213                         <br><small>&lt;meta name="yandex-verification" content="48b322931315c6df"&gt;</small>
    214                     </p>
    215                     <p>
    216201                        <input name="w3p_pinterest_webmaster" type="text" class="regular-text" value="<?php echo esc_attr( get_option( 'w3p_pinterest_webmaster' ) ); ?>"> <label>Pinterest Verification</label>
    217202                        <br><small>&lt;meta name="p:domain_verify" content="3d392d258cd7fb8a5676ba12d06be0c6"&gt;</small>
    218                     </p>
    219                     <p>
    220                         <input name="w3p_baidu_webmaster" type="text" class="regular-text" value="<?php echo esc_attr( get_option( 'w3p_baidu_webmaster' ) ); ?>"> <label>Baidu Verification</label>
    221                         <br><small>&lt;meta name="baidu-site-verification" content="7V6m4wr5F2q2"&gt;</small>
    222203                    </p>
    223204
     
    1011992
    1012993            <?php
    1013         } elseif ( (string) $tab === 'links' ) {
    1014             include 'w3p-settings-links.php';
    1015994        } elseif ( (string) $tab === 'tools' ) {
    1016995            include 'w3p-settings-tools.php';
  • wp-perfect-plugin/trunk/readme.txt

    r3439747 r3440912  
    55Requires PHP: 7.1
    66Tested up to: 6.9
    7 Stable tag: 2.0.6
     7Stable tag: 2.1.0
    88License: GPLv3 or later
    99License URI: https://www.gnu.org/licenses/gpl-3.0.html
     
    3333
    3434== Changelog =
     35
     36= 2.1.0 =
     37* PERFORMANCE: Optimize sitemap post type and taxonomy filters with static caching
     38* PERFORMANCE: Optimize canonical link generation with request-scoped caching
     39* PERFORMANCE: Optimize w3p_search_console_footer with early exit when local business is disabled
     40* PERFORMANCE: Optimize logo dimensions retrieval to use database instead of file system operations
     41* PERFORMANCE: Fix duplicate get_option() calls in sitemap max URLs filter
     42* UPDATE: Remove Yandex and Baidu verification support
     43* UPDATE: Remove Link Whisper feature and associated code
     44* UPDATE: Simplify SEO meta character counters (remove color coding and thresholds)
    3545
    3646= 2.0.6 =
  • wp-perfect-plugin/trunk/wp-perfect-plugin.php

    r3439747 r3440912  
    66 * Author: Ciprian Popescu
    77 * Author URI: https://getbutterfly.com/
    8  * Version: 2.0.6
     8 * Version: 2.1.0
    99 * License: GNU General Public License v3 or later
    1010 * License URI: https://www.gnu.org/licenses/gpl-3.0.html
     
    3535define( 'W3P_URL', WP_PLUGIN_URL . '/' . dirname( plugin_basename( __FILE__ ) ) );
    3636define( 'W3P_PATH', plugin_dir_path( __FILE__ ) );
    37 define( 'W3P_VERSION', '2.0.6' );
     37define( 'W3P_VERSION', '2.1.0' );
    3838
    3939require 'includes/functions.php';
     
    7171
    7272    wp_enqueue_script( 'datatable', plugins_url( 'assets/js/datatable.min.js', __FILE__ ), [], W3P_VERSION, true );
    73     wp_enqueue_script( 'ui', plugins_url( 'assets/js/ui.js', __FILE__ ), [ 'datatable' ], W3P_VERSION, true );
    74 
    75     wp_register_script( 'w3p-html5sortable', plugins_url( 'assets/js/html5sortable.js', __FILE__ ), [], W3P_VERSION, true );
    7673}
    7774
Note: See TracChangeset for help on using the changeset viewer.