Plugin Directory

Changeset 3023447


Ignore:
Timestamp:
01/18/2024 11:25:13 AM (2 years ago)
Author:
servebolt
Message:

Update to version 3.5.26 from GitHub

Location:
servebolt-optimizer
Files:
4 added
20 edited
1 copied

Legend:

Unmodified
Added
Removed
  • servebolt-optimizer/tags/3.5.26/Readme.txt

    r3003163 r3023447  
    66Tested up to: 6.4.1
    77Requires PHP: 7.3
    8 Stable tag: 3.5.25
     8Stable tag: 3.5.26
    99License: GPLv3 or later
    1010License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    9898
    9999== Changelog ==
    100 = 3.5.25 =
     100
     101= 3.5.26 =
     102* added filter 'sb_optimizer_cach_tags_fine_grain_control' that when set to false will use a single tag for all HTML and RSS
     103* converted cachetags from a human readable format to a machine readable format to reduce header size
     104* added new branding logo
     105* forcing a cache purge all on update of this version of the plugin to move sites to the to new CacheTags schema
     106
     107= 3.5.25 =
    101108* Allows for NextGen servers to be supported for reading Servebolt Environment files and obtaining the site id from the path.
    102109* Using hook set_object_terms, so that it checks if default_category is used on first save of a post, and if its is being replace with newer terms on first publish.
  • servebolt-optimizer/tags/3.5.26/assets/dist/images/servebolt-logo.svg

    r2556378 r3023447  
    1 <svg viewBox="0 0 962 265" xmlns="http://www.w3.org/2000/svg"><defs><linearGradient id="a" x1="50.007%" x2="50.007%" y2="99.999%"><stop stop-color="#FE6F5E" offset="0"/><stop stop-color="#FE7C4F" offset=".13"/><stop stop-color="#FF9534" offset=".44"/><stop stop-color="#FFA523" offset=".7"/><stop stop-color="#FFAA1D" offset=".9"/></linearGradient><linearGradient id="b" x1="49.995%" x2="49.995%" y1="100%" y2="-.001%"><stop stop-color="#FE6F5E" offset="0"/><stop stop-color="#FE7C4F" offset=".13"/><stop stop-color="#FF9534" offset=".44"/><stop stop-color="#FFA523" offset=".7"/><stop stop-color="#FFAA1D" offset=".9"/></linearGradient></defs><g fill="none"><path d="M238 116.86c29 8.33 45.64 18.49 45.64 40.48 0 23-17 40.31-47.8 40.31-24.66 0-43.31-12-51-30.65l23.32-12c5 11.32 15.32 18.15 28.48 18.15 11.66 0 19.82-5.83 19.82-13.82 0-7.66-5.66-11.16-24.65-16.82-14-4.17-24.82-8.83-31.82-15.83a33.228 33.228 0 01-10-24.15c0-23.32 20.82-39.31 45.47-39.31 21.82 0 38.31 10.33 45.81 28.15L259 103.54c-4.33-10.49-13.49-16-24.65-16-10.83 0-17.33 5.66-17.33 13.32-.02 8.14 6.98 12.01 20.98 16zm80.48 41.48c1.66 11.16 11.16 17.49 22 17.49 7.49 0 15.82-4 19.82-10.66l18.82 12.32c-7.5 13.5-20.32 20.16-38.31 20.16-27 0-48.81-19-48.81-46.64 0-25.65 21.49-46.47 47.14-46.47 26.49 0 44.31 18.15 44.31 44.47a86.57 86.57 0 01-.33 9.33h-64.64zm39-17.16c-.49-6.49-6-15.49-19-15.49-11.66 0-18.33 9.66-19.33 15.49h38.33zM449.9 132a35.74 35.74 0 00-6.16-.5c-17.82 0-24.15 11.83-24.15 26.49v37.64h-26V106.7h25.81v13.66h.17c3.5-7.66 12.66-14.66 25.15-14.66a20.54 20.54 0 015.16.67l.02 25.63zm52.39 34l22-59.3h27.48l-36.48 89H488.8l-36-88.95h27.5zm74.63-7.66c1.66 11.16 11.16 17.49 22 17.49 7.5 0 15.83-4 19.83-10.66l18.82 12.32c-7.5 13.5-20.32 20.16-38.31 20.16-27 0-48.81-19-48.81-46.64 0-25.65 21.49-46.47 47.14-46.47 26.49 0 44.31 18.15 44.31 44.47a86.57 86.57 0 01-.33 9.33h-64.65zm39-17.16c-.51-6.49-6-15.49-19-15.49-11.66 0-18.33 9.66-19.33 15.49h38.33zm62.28-23.82C687 106 699.85 105 705.18 105c26.15 0 42.31 23.48 42.31 46 0 23.15-17.16 46.3-43 46.3-5.83 0-18.49-1.16-27-12.32h-.33v10.66h-25.28V60.06h26v57.3h.32zm21 56.47c12.16 0 22-9.33 22-22.82 0-13.33-9.83-22.49-22.15-22.49-12 0-21.82 9.16-21.82 22.49-.03 13.49 9.77 22.82 21.95 22.82h.02zm104.93-69.12c26.81 0 48.3 19.65 48.3 46.13 0 26.82-21.82 46.81-48.64 46.81-27 0-48.47-19.49-48.47-46.31 0-26.48 21.82-46.63 48.81-46.63zm-.13 69.12c12.16 0 21.82-9.33 21.82-22.82 0-13.33-9.83-22.65-22-22.65S782 137.68 782 151c0 13.5 9.8 22.83 22 22.83zm57.76 21.82V59.9h26.15v135.75zm98.95-.5a40.402 40.402 0 01-12.16 1.67c-23.66 0-35.32-13.16-35.32-33.48v-34.15h-16V106.7h16.33V78.89h25.65v27.81h22v22.49h-22v31c0 10.49 5.66 14.16 15.49 14.16a29.81 29.81 0 006-.67l.01 21.47z" fill="#252B30"/><path d="M133 91.56c20.736 26.087 18.606 63.579-4.95 87.15l-77.44 77.45c-11.349 11.349-29.751 11.349-41.1 0s-11.349-29.751 0-41.1L133 91.56z" fill="url(#a)" transform="translate(-1)"/><path d="M153.86 8.51a29.06 29.06 0 010 41.1l-123.5 123.5c-20.722-26.1-18.571-63.592 5-87.15l77.41-77.45c11.348-11.344 29.742-11.344 41.09 0z" fill="url(#b)" transform="translate(-1)"/></g></svg>
     1<svg xmlns="http://www.w3.org/2000/svg" viewBox="2.82 0 169.18 30"><defs><radialGradient id="a" gradientUnits="userSpaceOnUse" cx="74.975" cy="74.975" fx="74.975" fy="74.975" r="60.917" gradientTransform="scale(.19977 .2)"><stop offset="0"/><stop offset=".5"/><stop offset="1" stop-opacity="0"/></radialGradient></defs><path d="M48.063 18.602a4.141 4.141 0 001.48 2.937c.898.742 2.059 1.102 3.496 1.102 1.258 0 2.277-.262 3.035-.82a2.58 2.58 0 001.16-2.262 2.1 2.1 0 00-.64-1.637A4.093 4.093 0 0054.875 17c-.996-.281-2.035-.5-3.055-.68-1.18-.199-2.316-.5-3.437-.922a5.271 5.271 0 01-2.317-1.757c-.597-.782-.898-1.82-.898-3.102a5.59 5.59 0 01.918-3.16 6.107 6.107 0 012.598-2.16 9.837 9.837 0 017.75.062 6.844 6.844 0 012.738 2.258 6.112 6.112 0 011.078 3.3h-3.336a3.682 3.682 0 00-1.379-2.558c-.797-.64-1.816-.98-3.055-.98-1.199 0-2.16.258-2.878.777-.7.5-1.118 1.32-1.079 2.203-.02.598.2 1.18.641 1.598a4.036 4.036 0 001.695.883c.7.199 1.72.418 3.04.636 1.175.204 2.335.5 3.433.942.922.36 1.738.96 2.36 1.738.597.762.917 1.781.917 3.043.02 1.16-.32 2.3-.98 3.258a6.702 6.702 0 01-2.695 2.262 8.934 8.934 0 01-3.934.8 9.903 9.903 0 01-4.297-.882 6.908 6.908 0 01-2.894-2.457 6.62 6.62 0 01-1.082-3.602zm15.484-4.864a6.388 6.388 0 012.598-2.699 7.462 7.462 0 013.812-.96c1.34-.02 2.66.28 3.836.882 1.102.578 2 1.437 2.617 2.5.66 1.16 1 2.46.98 3.8 0 .4-.038.798-.081 1.2H65.965v.18c.078 1.32.496 2.359 1.238 3.12.738.759 1.738 1.137 2.977 1.137.879.043 1.738-.218 2.476-.699a3.189 3.189 0 001.317-1.96h3.175a6.104 6.104 0 01-2.214 3.78c-1.2.981-2.72 1.481-4.516 1.481a8.351 8.351 0 01-4.094-.96 6.724 6.724 0 01-2.699-2.7 8.356 8.356 0 01-.957-4.04c-.082-1.402.238-2.8.879-4.062m10.605 2.403a3.887 3.887 0 00-1.297-2.582 4.142 4.142 0 00-2.777-.918 4.056 4.056 0 00-2.695.96 3.705 3.705 0 00-1.301 2.54zm14.067-5.903v2.98H86.8c-1.32 0-2.258.423-2.86 1.282-.578.86-.879 1.941-.879 3.262v7.558h-3.175V10.238h2.816l.36 2.262c.421-.68.98-1.262 1.68-1.66.679-.399 1.597-.602 2.757-.602zm.996 0h3.418l4.156 11.66 4.094-11.66h3.355L98.684 25.32h-3.875zm16.422 3.5a6.41 6.41 0 012.597-2.699 7.476 7.476 0 013.817-.96 8.186 8.186 0 013.836.882 6.554 6.554 0 012.617 2.5c.656 1.16.996 2.46.976 3.8 0 .4-.039.798-.078 1.2h-11.347v.18c.078 1.32.5 2.359 1.238 3.12.738.759 1.738 1.137 2.977 1.137.878.043 1.738-.218 2.476-.699.68-.46 1.14-1.16 1.32-1.96h3.176a6.127 6.127 0 01-2.219 3.78c-1.199.981-2.714 1.481-4.515 1.481a8.351 8.351 0 01-4.094-.96 6.69 6.69 0 01-2.695-2.7 8.36 8.36 0 01-.961-4.04 8.209 8.209 0 01.879-4.062m10.61 2.403a3.909 3.909 0 00-1.302-2.582 4.142 4.142 0 00-2.777-.918 4.056 4.056 0 00-2.695.96 3.7 3.7 0 00-1.297 2.54zM133.723 11a6.484 6.484 0 012.539 2.66 8.93 8.93 0 01.918 4.121c.02 1.399-.278 2.778-.918 4.02-.578 1.12-1.438 2.078-2.54 2.719-1.117.66-2.374 1-3.675.98-.996.02-1.996-.2-2.914-.64-.801-.4-1.48-1-2-1.72l-.38 2.18H122V4.7h3.176v7.78c1.199-1.601 2.816-2.421 4.87-2.421 1.282-.02 2.56.3 3.677.941m-1.016 10.422c.816-.942 1.219-2.14 1.219-3.64 0-1.481-.403-2.68-1.219-3.602-1.621-1.758-4.375-1.88-6.133-.239-.082.079-.16.16-.242.239-.797.922-1.2 2.12-1.2 3.601 0 1.5.403 2.7 1.2 3.66a3.969 3.969 0 003.176 1.418c1.238 0 2.398-.52 3.199-1.437m10.125 3.118a6.62 6.62 0 01-2.695-2.7 8.335 8.335 0 01-.957-4.059 8.227 8.227 0 01.957-4.02 6.7 6.7 0 012.695-2.722 8.752 8.752 0 018.031 0 6.806 6.806 0 012.7 2.723 8.314 8.314 0 01.957 4.02 8.54 8.54 0 01-.958 4.058 6.724 6.724 0 01-2.699 2.7 8.87 8.87 0 01-8.031 0m7.234-3.142c.817-.937 1.22-2.136 1.22-3.597 0-1.48-.403-2.68-1.22-3.602a4.393 4.393 0 00-6.214-.219c-.079.079-.137.141-.22.22-.8.94-1.198 2.14-1.198 3.6 0 1.481.398 2.68 1.199 3.598a4.39 4.39 0 006.215.223c.078-.082.136-.16.218-.223m6.95-16.698h3.18v20.62h-3.18zm7.793 8.34h-2.618v-2.802h2.618V6.04h3.214v4.223h3.618v2.797h-3.618v7.863c0 .578.122 1 .36 1.258.242.242.64.36 1.199.36H172v2.8h-3.055c-1.441 0-2.48-.34-3.136-1-.66-.66-.98-1.7-.98-3.102zm0 0"/><path d="M27.148 15c0 6.727-5.445 12.18-12.164 12.18-6.722 0-12.168-5.453-12.168-12.18 0-6.727 5.446-12.18 12.168-12.18 6.72 0 12.164 5.453 12.164 12.18zm0 0" fill="url(#a)"/><path d="M14.984 0c8.27 0 14.98 6.719 14.98 15 0 8.281-6.71 15-14.98 15zm0 0"/></svg>
  • servebolt-optimizer/tags/3.5.26/languages/servebolt-optimizer.pot

    r2957331 r3023447  
    1 # Copyright (C) 2023 Servebolt
     1# Copyright (C) 2024 Servebolt
    22# This file is distributed under the GPLv3 or later.
    33msgid ""
    44msgstr ""
    5 "Project-Id-Version: Servebolt Optimizer 3.5.23\n"
     5"Project-Id-Version: Servebolt Optimizer 3.5.25\n"
    66"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/servebolt-optimizer\n"
    77"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
     
    1010"Content-Type: text/plain; charset=UTF-8\n"
    1111"Content-Transfer-Encoding: 8bit\n"
    12 "POT-Creation-Date: 2023-08-23T13:29:29+02:00\n"
     12"POT-Creation-Date: 2024-01-17T17:30:51+01:00\n"
    1313"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
    14 "X-Generator: WP-CLI 2.5.0\n"
     14"X-Generator: WP-CLI 2.7.1\n"
    1515"X-Domain: servebolt-wp\n"
    1616
     
    11551155msgstr ""
    11561156
    1157 #: src/Servebolt/Helpers/Helpers.php:1195
    1158 #: src/Servebolt/Helpers/Helpers.php:1207
     1157#: src/Servebolt/Helpers/Helpers.php:1220
     1158#: src/Servebolt/Helpers/Helpers.php:1232
    11591159#: src/Servebolt/Views/accelerated-domains/image-resize/image-size-index-list.php:12
    11601160msgid "Delete"
    11611161msgstr ""
    11621162
    1163 #: src/Servebolt/Helpers/Helpers.php:1196
     1163#: src/Servebolt/Helpers/Helpers.php:1221
    11641164msgid "View"
    11651165msgstr ""
    11661166
    1167 #: src/Servebolt/Helpers/Helpers.php:1198
     1167#: src/Servebolt/Helpers/Helpers.php:1223
    11681168msgid "Edit"
    11691169msgstr ""
    11701170
    1171 #: src/Servebolt/Helpers/Helpers.php:1205
     1171#: src/Servebolt/Helpers/Helpers.php:1230
    11721172msgid "Post does not exist."
    11731173msgstr ""
     
    19831983msgstr ""
    19841984
    1985 #: src/Servebolt/Views/dashboard/dashboard.php:7
     1985#: src/Servebolt/Views/dashboard/dashboard.php:9
    19861986msgid "Performance Tools"
    19871987msgstr ""
  • servebolt-optimizer/tags/3.5.26/servebolt-optimizer.php

    r3003163 r3023447  
    22/*
    33Plugin Name: Servebolt Optimizer
    4 Version: 3.5.25
     4Version: 3.5.26
    55Author: Servebolt
    66Author URI: https://servebolt.com
     
    2828 * @since 3.5.11
    2929 */
    30 define('SERVEBOLT_PLUGIN_DB_VERSION', 100);
     30define('SERVEBOLT_PLUGIN_DB_VERSION', 101);
    3131
    3232// Abort and display WP admin notice if PHP version is less than constant SERVEBOLT_PLUGIN_MINIMUM_PHP_VERSION
  • servebolt-optimizer/tags/3.5.26/src/Servebolt/CacheTags/AddCacheTagsHeaders.php

    r2907014 r3023447  
    4545    use Multiton;
    4646
    47     // /**
    48     //  * Drivers that require the site to be hosted at Servebolt.
    49     //  *
    50     //  * @var string[]
    51     //  */
    52     // private static $serveboltOnlyDrivers = ['acd', 'serveboltcdn'];
    53 
    54     // /**
    55     //  * Valid drivers.
    56     //  *
    57     //  * @var string[]
    58     //  */
    59     // private static $validDrivers = ['cloudflare', 'acd', 'serveboltcdn'];
    60 
    6147    /**
    6248     * CachePurge constructor.
     
    6551    public function __construct(?int $blogId = null)
    6652    {   
    67        
     53
    6854        $this->driver = self::getSelectedCachePurgeDriver($blogId);
    6955
     
    7359            add_filter('sb_optimizer_can_purge_term_cache', '__return_false');
    7460        }
    75        
     61
    7662        if (
    7763            is_admin()
     
    8369        ) return;
    8470
    85        
    86        
    8771        if(in_array($this->driver, CanUseCacheTags::allowedDrivers())) {
    8872            // Get the correct hook based on version of WordPress, pre 6.1 wp, post send_headers.
    8973            add_action(getCondtionalHookPreHeaders(), [$this,'addCacheTagsHeaders']);
    9074        }
    91        
    9275    }
    9376
    9477    /**
    95      *
    96      *
     78     * Works out what cache tage headers are needed in the header CacheTag for the current location.
    9779     */
    9880    public function addCacheTagsHeaders()
    9981    {
    100         $this->setPrefixAndSuffixForTags();   
    101         if($this->driver != 'serveboltcdn') {
     82        $this->setPrefixAndSuffixForTags();
     83        // Filter allows customer to use reduced instruction set for CacheTags.
     84        // If filter returns false, an Accelerated Domains customer will use the Servebolt CDN cache tags.
     85        if($this->driver != 'serveboltcdn' && apply_filters('sb_optimizer_cach_tags_fine_grain_control', true) ) {
    10286            $this->addAuthorTag();
    10387            $this->addTaxonomyTermIDTag();
     
    126110                $tags = implode(',', $this->headers);
    127111                header('Cache-Tag: ' . $tags );
     112
    128113                if($this->driver == 'acd') {
    129114                    header('x-acd-Cache-Tag: ' . $tags);
     
    135120        }
    136121    }
    137 
    138    
     122 
    139123}
  • servebolt-optimizer/tags/3.5.26/src/Servebolt/CacheTags/CacheTagsBase.php

    r2907017 r3023447  
    22namespace Servebolt\Optimizer\CacheTags;
    33
    4 use function \Servebolt\Optimizer\Helpers\getDomainNameOfWebSite;
     4use Servebolt\Optimizer\Api\Servebolt\Servebolt;
     5// use function \Servebolt\Optimizer\Helpers\getDomainNameOfWebSite;
    56use function Servebolt\Optimizer\Helpers\isHostedAtServebolt;
    67use function Servebolt\Optimizer\Helpers\smartGetOption;
    78class CacheTagsBase {
     9    /**
     10     * Class constants are used to convert labels (const names) into numbers.
     11     * This way they human readable in the code, but machine readable as a cachetag
     12     *
     13     * These are grouped
     14     * 0x = global
     15     * 1x = post type
     16     * 2x = taxonomy
     17     * 3x = feeds
     18     * 4x = woocommerce
     19     *
     20     */
     21
     22    // Global
     23    const HOME = 00;
     24    const HTML = 01;
     25    const SEARCH = 02;
     26    const SITEMAP = 03; // Not currently used
     27
     28    // Post Type
     29    const POST_TYPE = 10;
     30    const AUTHOR = 11;
     31    const DATE = 12;
     32    const MONTH = 13;
     33    const YEAR = 14;
     34
     35    // Taxonomy
     36    const TERM_ID = 20;
     37    const TAXONOMY_ID = 21; // not currently used.
     38
     39    // Feeds
     40    const FEEDS = 30;
     41    const COMMENT_FEED = 31;
     42
     43    // WooCommerce
     44    const WOOCOMMERCE = 40;
     45    const WOOCOMMERCE_SHOP = 41;
     46    const WOOCOMMERCE_CATEGORY = 42;
     47    const WOOCOMMERCE_TAG = 43;
     48    const WOOCOMMERCE_PRODUCT = 44;
     49    const WOOCOMMERCE_PRODUCT_ID = 45;
     50
    851    /**
    952     * Drivers that require the site to be hosted at Servebolt.
     
    82125    protected function setDomain()
    83126    {
    84         $this->domain = str_replace('.','',getDomainNameOfWebSite());
     127        $env = Servebolt::getInstance();
     128        $this->domain = $env->getEnvironmentId();
     129        // remove domain name in favor of env id.
     130        // $this->domain = str_replace('.','',getDomainNameOfWebSite());
    85131    }
    86132
     
    99145    {
    100146        if(is_post_type_archive()) {
    101             $this->add('posttype-'.get_queried_object()->name );
     147            $this->add(self::POST_TYPE.'-'.get_queried_object()->name );
    102148        }
    103149        if(is_singular()) {
    104             $this->add('posttype-'.get_post_type());
     150            $this->add(self::POST_TYPE.'-'.get_post_type());
    105151        }
    106152    }
     
    111157    protected function addHTMLTag() : void
    112158    {
    113         $this->add('html');
     159        $this->add(self::HTML);
    114160    }
    115161    /**
     
    119165    {
    120166        if(is_search()) {
    121             $this->add('search');
     167            $this->add(self::SEARCH);
    122168        }
    123169    }
     
    131177    {
    132178        if(is_category() || is_tag() || is_tax() ) {           
    133             $this->add('term-'. get_queried_object_id());
     179            $this->add(self::TERM_ID . '-'. get_queried_object_id());
    134180            // TODO: decide how much effort to put into RSS
    135181            // $this->add('term-feed-'.get_queried_object_id());
     
    143189                $ids = wp_get_post_terms(get_queried_object()->ID, $tax->name, ['fields' => 'ids']);
    144190                // ignore empty taxonomies or ignore error and continue;
    145                 if(count($ids) == 0 || is_wp_error($ids)) continue;
    146                 // loop all ids and add them
     191                if( is_wp_error($ids) || count($ids) == 0 ) continue;
     192
    147193                foreach($ids as $id) {
    148                     $this->add('term-'.$id);
    149                     // TODO: decide how much effort to put into RSS
    150                     //$this->add('term-feed-'.$id);
     194                    $this->add(self::TERM_ID . '-'.$id);
    151195                }
    152196            }           
     
    164208       
    165209        if(is_author()){
    166             $this->add('author-' . get_the_author_meta('ID') );
     210            $this->add( self::AUTHOR . '-' . get_the_author_meta('ID') );
    167211        }
    168212
    169213        if(is_singular()){
    170             $this->add('author-' . get_post_field('post_author', get_queried_object()->ID ) );
     214            if(class_exists( 'woocommerce' ) && is_product()) return;
     215
     216            $this->add( self::AUTHOR . '-' . get_post_field('post_author', get_queried_object()->ID ) );
    171217        }
    172218
     
    184230    {
    185231        if(is_date()) {
    186             $this->add('date-'.get_query_var('day') .'-'. get_query_var('monthnum') .'-'. get_query_var('year'));
    187             $this->add('year-'.  get_query_var('year'));
    188             $this->add('month-'. get_query_var('monthnum'));
     232            $this->add(self::DATE .'-' .get_query_var('day') .'-'. get_query_var('monthnum') .'-'. get_query_var('year'));
     233            $this->add(self::YEAR .'-'.  get_query_var('year'));
     234            $this->add(self::MONTH .'-'. get_query_var('monthnum'));
    189235        }
    190236
    191237        if(is_singular() && !is_home() && !is_front_page()) {
    192             $this->add('date-'.get_the_date('d-n-Y'));
    193             $this->add('year-'.  get_the_date('Y'));
    194             $this->add('month-'. get_the_date('n'));
     238            if(is_page() || (class_exists( 'woocommerce' ) && is_product() ) ) return;
     239            $this->add(self::DATE .'-' .get_the_date('d-n-Y'));
     240            $this->add(self::YEAR .'-'.  get_the_date('Y'));
     241            $this->add(self::MONTH .'-'. get_the_date('n'));
    195242        }
    196243    }
     
    209256    {
    210257        if(is_feed() && !is_singular()) {
    211             $this->add('feeds');
     258            $this->add(self::FEEDS);
    212259        }
    213260       
    214261        if(is_feed() && is_singular()) {
    215             $this->add('comment-feed' . get_queried_object()->ID);
     262            $this->add(self::COMMENT_FEED. '-' . get_queried_object()->ID);
    216263        }
    217264    }
     
    225272    protected function addSitemapTag() : void
    226273    {
    227         $this->add('sitemap');
     274        $this->add(self::SITEMAP);
    228275    }
    229276
     
    235282    {
    236283        if(is_home()||is_front_page()) {
    237             $this->add('home');
     284            $this->add(self::HOME);
    238285        }
    239286    }
     
    250297        // woocommerce
    251298        if(is_woocommerce()) {
    252             $this->add('woocommerce');
     299            $this->add(self::WOOCOMMERCE);
    253300        }
    254301        // is the main shop page, normally /shop
    255302        // woocommerce-shop
    256303        if(is_shop()) {
    257             $this->add('woocommerce-shop');
     304            $this->add(self::WOOCOMMERCE_SHOP);
    258305        }
    259306        // is a product category archive page of woocommerce
    260307        // woocommerce-category
    261308        if(is_product_category()){
    262             $this->add('woocommerce-category');
     309            $this->add(self::WOOCOMMERCE_CATEGORY);
    263310        }
    264311        // is a product tag archive page of woocommerce
    265312        // woocommerce-tag
    266313        if(is_product_tag()){
    267             $this->add('woocommerce-tag');
     314            $this->add(self::WOOCOMMERCE_TAG);
    268315        }
    269316        // is a product page of woocommerce
    270317        // woocommerce-product
    271318        if(is_product()){
    272             $this->add('woocommerce-product');
    273             $this->add('woocommerce-productid-'.get_the_ID());
     319            $this->add(self::WOOCOMMERCE_PRODUCT);
     320            $this->add(self::WOOCOMMERCE_PRODUCT_ID.'-'.get_the_ID());
    274321        }       
    275322    }
  • servebolt-optimizer/tags/3.5.26/src/Servebolt/CacheTags/GetCacheTagsHeadersForLocation.php

    r3003163 r3023447  
    3939        if($this->objectType == 'term') {
    4040            $this->setPrefixAndSuffixForTags();
    41             $this->add('term-'.$this->objectId);
     41            $this->add(self::TERM_ID . '-'.$this->objectId);
    4242            return;
    4343        }
     
    6262    }
    6363
     64    /**
     65     * Works out what cache tage headers are needed for the purge of the current location
     66     */
    6467    protected function getTagHeaders() : void
    6568    {
    6669        $this->setPrefixAndSuffixForTags();
    67         if($this->driver != 'serveboltcdn') {
     70        // Filter allows customer to use reduced instruction set for CacheTags.
     71        // If filter returns false, an Accelerated Domains customer will use the Servebolt CDN cache tags.
     72        if($this->driver != 'serveboltcdn' && apply_filters('sb_optimizer_cach_tags_fine_grain_control', true) ) {
    6873            $this->addAuthorTag();
    6974            $this->addHomeTag();
     
    8590    protected function addHTMLTag() : void
    8691    {
    87         $this->add('html');
     92        $this->add(self::HTML);
    8893    }
    8994
     
    9398    protected function addSearch() : void
    9499    {
    95         $this->add('search');
     100        $this->add(self::SEARCH);
    96101    }
    97102    /**
     
    100105    protected function addHomeTag() : void
    101106    {
    102         $this->add('home');
     107        $this->add(self::HOME);
    103108    }
    104109
     
    108113    protected function addRssTag() : void
    109114    {
    110         $this->add('comment-feed' . get_the_ID());
    111         $this->add('feeds');
     115        $this->add(self::COMMENT_FEED.'-'. get_the_ID());
     116        $this->add(self::FEEDS);
    112117    }
    113118
     
    117122    protected function addPostTypeTag(): void
    118123    {
    119         $this->add('posttype-'.get_post_type());
     124        $this->add(self::POST_TYPE . '-'.get_post_type());
    120125    }
    121126
     
    125130    protected function addDateTag(): void
    126131    {
    127         $this->add('date-'. get_the_date('d-n-Y'));
    128         $this->add('year-'. get_the_date('Y'));
    129         $this->add('month-'.get_the_date('n'));
     132        $this->add(self::DATE . '-'. get_the_date('d-n-Y'));
     133        $this->add(self::YEAR . '-'. get_the_date('Y'));
     134        $this->add(self::MONTH . '-'.get_the_date('n'));
    130135    }
    131136
     
    144149            // loop all ids and add them
    145150            foreach($ids as $id) {
    146                 $this->add('term-'.$id);
     151                $this->add(self::TERM_ID . '-' .$id);
    147152                // Option to later split feeds by tag id i.e. /tags/tagname/feed
    148153                // $this->add('term-feed-'.$id);
     
    159164    protected function addAuthorTag() : void
    160165    {
    161         $this->add('author-' . get_post_field('post_author', get_the_ID() ) );
     166        $this->add(self::AUTHOR . '-' . get_post_field('post_author', get_the_ID() ) );
    162167    }
    163168
     
    170175        if ( !class_exists( 'woocommerce' ) ) return;
    171176        // Add the shop homepage.
    172         $this->add('woocommerce-shop');
     177        $this->add(self::WOOCOMMERCE_SHOP);
    173178        /**
    174179         * clear the product cache so that all of its versions are removed
     
    180185         */
    181186        if(function_exists('is_product') && is_product()) {
    182             $this->add('woocommerce-productid-'.get_the_ID());
     187            $this->add(self::WOOCOMMERCE_PRODUCT_ID . '-'.get_the_ID());
    183188        }
    184189    }
  • servebolt-optimizer/tags/3.5.26/src/Servebolt/Utils/WPConfigTransformer.php

    r3003163 r3023447  
    8686        }
    8787
    88         error_log('wp_configs from function Exists :' . print_r($this->wp_configs, true));
    8988        return isset( $this->wp_configs[ $type ][ $name ] );
    9089    }
  • servebolt-optimizer/tags/3.5.26/src/Servebolt/Views/dashboard/dashboard.php

    r2684493 r3023447  
    22<?php use function Servebolt\Optimizer\Helpers\isHostedAtServebolt; ?>
    33<?php use function Servebolt\Optimizer\Helpers\view; ?>
     4<?php $image_path = trailingslashit(SERVEBOLT_PLUGIN_DIR_URL) . 'assets/dist/images/'; ?>
    45
    56<div class="wrap sb-content">
    6     <div class="sb-logo"></div>
     7    <img srcset="<?php echo $image_path ?>servebolt-logo.svg, <?php echo $image_path ?>servebolt-logo-retina.svg 2x" src="<?php echo $image_path ?>servebolt-logo.svg" alt="Servebolt logo" width="340px" height="60px">
     8    <!-- <div class="sb-logo"></div> -->
    79    <h1 class="heading"><?php _e('Performance Tools', 'servebolt-wp'); ?></h1>
    810
  • servebolt-optimizer/tags/3.5.26/vendor/composer/installed.php

    r3003163 r3023447  
    22    'root' => array(
    33        'name' => 'servebolt/servebolt-wp-optimize-plugin',
    4         'pretty_version' => '3.5.25',
    5         'version' => '3.5.25.0',
    6         'reference' => '988741b9cea3bd420ab654ceebe13375c8e627db',
     4        'pretty_version' => '3.5.26',
     5        'version' => '3.5.26.0',
     6        'reference' => 'a5cb70738657e2a5362bebd56903e7b947f1c369',
    77        'type' => 'wordpress-plugin',
    88        'install_path' => __DIR__ . '/../../',
     
    132132        ),
    133133        'servebolt/servebolt-wp-optimize-plugin' => array(
    134             'pretty_version' => '3.5.25',
    135             'version' => '3.5.25.0',
    136             'reference' => '988741b9cea3bd420ab654ceebe13375c8e627db',
     134            'pretty_version' => '3.5.26',
     135            'version' => '3.5.26.0',
     136            'reference' => 'a5cb70738657e2a5362bebd56903e7b947f1c369',
    137137            'type' => 'wordpress-plugin',
    138138            'install_path' => __DIR__ . '/../../',
  • servebolt-optimizer/trunk/Readme.txt

    r3003163 r3023447  
    66Tested up to: 6.4.1
    77Requires PHP: 7.3
    8 Stable tag: 3.5.25
     8Stable tag: 3.5.26
    99License: GPLv3 or later
    1010License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    9898
    9999== Changelog ==
    100 = 3.5.25 =
     100
     101= 3.5.26 =
     102* added filter 'sb_optimizer_cach_tags_fine_grain_control' that when set to false will use a single tag for all HTML and RSS
     103* converted cachetags from a human readable format to a machine readable format to reduce header size
     104* added new branding logo
     105* forcing a cache purge all on update of this version of the plugin to move sites to the to new CacheTags schema
     106
     107= 3.5.25 =
    101108* Allows for NextGen servers to be supported for reading Servebolt Environment files and obtaining the site id from the path.
    102109* Using hook set_object_terms, so that it checks if default_category is used on first save of a post, and if its is being replace with newer terms on first publish.
  • servebolt-optimizer/trunk/assets/dist/images/servebolt-logo.svg

    r2556378 r3023447  
    1 <svg viewBox="0 0 962 265" xmlns="http://www.w3.org/2000/svg"><defs><linearGradient id="a" x1="50.007%" x2="50.007%" y2="99.999%"><stop stop-color="#FE6F5E" offset="0"/><stop stop-color="#FE7C4F" offset=".13"/><stop stop-color="#FF9534" offset=".44"/><stop stop-color="#FFA523" offset=".7"/><stop stop-color="#FFAA1D" offset=".9"/></linearGradient><linearGradient id="b" x1="49.995%" x2="49.995%" y1="100%" y2="-.001%"><stop stop-color="#FE6F5E" offset="0"/><stop stop-color="#FE7C4F" offset=".13"/><stop stop-color="#FF9534" offset=".44"/><stop stop-color="#FFA523" offset=".7"/><stop stop-color="#FFAA1D" offset=".9"/></linearGradient></defs><g fill="none"><path d="M238 116.86c29 8.33 45.64 18.49 45.64 40.48 0 23-17 40.31-47.8 40.31-24.66 0-43.31-12-51-30.65l23.32-12c5 11.32 15.32 18.15 28.48 18.15 11.66 0 19.82-5.83 19.82-13.82 0-7.66-5.66-11.16-24.65-16.82-14-4.17-24.82-8.83-31.82-15.83a33.228 33.228 0 01-10-24.15c0-23.32 20.82-39.31 45.47-39.31 21.82 0 38.31 10.33 45.81 28.15L259 103.54c-4.33-10.49-13.49-16-24.65-16-10.83 0-17.33 5.66-17.33 13.32-.02 8.14 6.98 12.01 20.98 16zm80.48 41.48c1.66 11.16 11.16 17.49 22 17.49 7.49 0 15.82-4 19.82-10.66l18.82 12.32c-7.5 13.5-20.32 20.16-38.31 20.16-27 0-48.81-19-48.81-46.64 0-25.65 21.49-46.47 47.14-46.47 26.49 0 44.31 18.15 44.31 44.47a86.57 86.57 0 01-.33 9.33h-64.64zm39-17.16c-.49-6.49-6-15.49-19-15.49-11.66 0-18.33 9.66-19.33 15.49h38.33zM449.9 132a35.74 35.74 0 00-6.16-.5c-17.82 0-24.15 11.83-24.15 26.49v37.64h-26V106.7h25.81v13.66h.17c3.5-7.66 12.66-14.66 25.15-14.66a20.54 20.54 0 015.16.67l.02 25.63zm52.39 34l22-59.3h27.48l-36.48 89H488.8l-36-88.95h27.5zm74.63-7.66c1.66 11.16 11.16 17.49 22 17.49 7.5 0 15.83-4 19.83-10.66l18.82 12.32c-7.5 13.5-20.32 20.16-38.31 20.16-27 0-48.81-19-48.81-46.64 0-25.65 21.49-46.47 47.14-46.47 26.49 0 44.31 18.15 44.31 44.47a86.57 86.57 0 01-.33 9.33h-64.65zm39-17.16c-.51-6.49-6-15.49-19-15.49-11.66 0-18.33 9.66-19.33 15.49h38.33zm62.28-23.82C687 106 699.85 105 705.18 105c26.15 0 42.31 23.48 42.31 46 0 23.15-17.16 46.3-43 46.3-5.83 0-18.49-1.16-27-12.32h-.33v10.66h-25.28V60.06h26v57.3h.32zm21 56.47c12.16 0 22-9.33 22-22.82 0-13.33-9.83-22.49-22.15-22.49-12 0-21.82 9.16-21.82 22.49-.03 13.49 9.77 22.82 21.95 22.82h.02zm104.93-69.12c26.81 0 48.3 19.65 48.3 46.13 0 26.82-21.82 46.81-48.64 46.81-27 0-48.47-19.49-48.47-46.31 0-26.48 21.82-46.63 48.81-46.63zm-.13 69.12c12.16 0 21.82-9.33 21.82-22.82 0-13.33-9.83-22.65-22-22.65S782 137.68 782 151c0 13.5 9.8 22.83 22 22.83zm57.76 21.82V59.9h26.15v135.75zm98.95-.5a40.402 40.402 0 01-12.16 1.67c-23.66 0-35.32-13.16-35.32-33.48v-34.15h-16V106.7h16.33V78.89h25.65v27.81h22v22.49h-22v31c0 10.49 5.66 14.16 15.49 14.16a29.81 29.81 0 006-.67l.01 21.47z" fill="#252B30"/><path d="M133 91.56c20.736 26.087 18.606 63.579-4.95 87.15l-77.44 77.45c-11.349 11.349-29.751 11.349-41.1 0s-11.349-29.751 0-41.1L133 91.56z" fill="url(#a)" transform="translate(-1)"/><path d="M153.86 8.51a29.06 29.06 0 010 41.1l-123.5 123.5c-20.722-26.1-18.571-63.592 5-87.15l77.41-77.45c11.348-11.344 29.742-11.344 41.09 0z" fill="url(#b)" transform="translate(-1)"/></g></svg>
     1<svg xmlns="http://www.w3.org/2000/svg" viewBox="2.82 0 169.18 30"><defs><radialGradient id="a" gradientUnits="userSpaceOnUse" cx="74.975" cy="74.975" fx="74.975" fy="74.975" r="60.917" gradientTransform="scale(.19977 .2)"><stop offset="0"/><stop offset=".5"/><stop offset="1" stop-opacity="0"/></radialGradient></defs><path d="M48.063 18.602a4.141 4.141 0 001.48 2.937c.898.742 2.059 1.102 3.496 1.102 1.258 0 2.277-.262 3.035-.82a2.58 2.58 0 001.16-2.262 2.1 2.1 0 00-.64-1.637A4.093 4.093 0 0054.875 17c-.996-.281-2.035-.5-3.055-.68-1.18-.199-2.316-.5-3.437-.922a5.271 5.271 0 01-2.317-1.757c-.597-.782-.898-1.82-.898-3.102a5.59 5.59 0 01.918-3.16 6.107 6.107 0 012.598-2.16 9.837 9.837 0 017.75.062 6.844 6.844 0 012.738 2.258 6.112 6.112 0 011.078 3.3h-3.336a3.682 3.682 0 00-1.379-2.558c-.797-.64-1.816-.98-3.055-.98-1.199 0-2.16.258-2.878.777-.7.5-1.118 1.32-1.079 2.203-.02.598.2 1.18.641 1.598a4.036 4.036 0 001.695.883c.7.199 1.72.418 3.04.636 1.175.204 2.335.5 3.433.942.922.36 1.738.96 2.36 1.738.597.762.917 1.781.917 3.043.02 1.16-.32 2.3-.98 3.258a6.702 6.702 0 01-2.695 2.262 8.934 8.934 0 01-3.934.8 9.903 9.903 0 01-4.297-.882 6.908 6.908 0 01-2.894-2.457 6.62 6.62 0 01-1.082-3.602zm15.484-4.864a6.388 6.388 0 012.598-2.699 7.462 7.462 0 013.812-.96c1.34-.02 2.66.28 3.836.882 1.102.578 2 1.437 2.617 2.5.66 1.16 1 2.46.98 3.8 0 .4-.038.798-.081 1.2H65.965v.18c.078 1.32.496 2.359 1.238 3.12.738.759 1.738 1.137 2.977 1.137.879.043 1.738-.218 2.476-.699a3.189 3.189 0 001.317-1.96h3.175a6.104 6.104 0 01-2.214 3.78c-1.2.981-2.72 1.481-4.516 1.481a8.351 8.351 0 01-4.094-.96 6.724 6.724 0 01-2.699-2.7 8.356 8.356 0 01-.957-4.04c-.082-1.402.238-2.8.879-4.062m10.605 2.403a3.887 3.887 0 00-1.297-2.582 4.142 4.142 0 00-2.777-.918 4.056 4.056 0 00-2.695.96 3.705 3.705 0 00-1.301 2.54zm14.067-5.903v2.98H86.8c-1.32 0-2.258.423-2.86 1.282-.578.86-.879 1.941-.879 3.262v7.558h-3.175V10.238h2.816l.36 2.262c.421-.68.98-1.262 1.68-1.66.679-.399 1.597-.602 2.757-.602zm.996 0h3.418l4.156 11.66 4.094-11.66h3.355L98.684 25.32h-3.875zm16.422 3.5a6.41 6.41 0 012.597-2.699 7.476 7.476 0 013.817-.96 8.186 8.186 0 013.836.882 6.554 6.554 0 012.617 2.5c.656 1.16.996 2.46.976 3.8 0 .4-.039.798-.078 1.2h-11.347v.18c.078 1.32.5 2.359 1.238 3.12.738.759 1.738 1.137 2.977 1.137.878.043 1.738-.218 2.476-.699.68-.46 1.14-1.16 1.32-1.96h3.176a6.127 6.127 0 01-2.219 3.78c-1.199.981-2.714 1.481-4.515 1.481a8.351 8.351 0 01-4.094-.96 6.69 6.69 0 01-2.695-2.7 8.36 8.36 0 01-.961-4.04 8.209 8.209 0 01.879-4.062m10.61 2.403a3.909 3.909 0 00-1.302-2.582 4.142 4.142 0 00-2.777-.918 4.056 4.056 0 00-2.695.96 3.7 3.7 0 00-1.297 2.54zM133.723 11a6.484 6.484 0 012.539 2.66 8.93 8.93 0 01.918 4.121c.02 1.399-.278 2.778-.918 4.02-.578 1.12-1.438 2.078-2.54 2.719-1.117.66-2.374 1-3.675.98-.996.02-1.996-.2-2.914-.64-.801-.4-1.48-1-2-1.72l-.38 2.18H122V4.7h3.176v7.78c1.199-1.601 2.816-2.421 4.87-2.421 1.282-.02 2.56.3 3.677.941m-1.016 10.422c.816-.942 1.219-2.14 1.219-3.64 0-1.481-.403-2.68-1.219-3.602-1.621-1.758-4.375-1.88-6.133-.239-.082.079-.16.16-.242.239-.797.922-1.2 2.12-1.2 3.601 0 1.5.403 2.7 1.2 3.66a3.969 3.969 0 003.176 1.418c1.238 0 2.398-.52 3.199-1.437m10.125 3.118a6.62 6.62 0 01-2.695-2.7 8.335 8.335 0 01-.957-4.059 8.227 8.227 0 01.957-4.02 6.7 6.7 0 012.695-2.722 8.752 8.752 0 018.031 0 6.806 6.806 0 012.7 2.723 8.314 8.314 0 01.957 4.02 8.54 8.54 0 01-.958 4.058 6.724 6.724 0 01-2.699 2.7 8.87 8.87 0 01-8.031 0m7.234-3.142c.817-.937 1.22-2.136 1.22-3.597 0-1.48-.403-2.68-1.22-3.602a4.393 4.393 0 00-6.214-.219c-.079.079-.137.141-.22.22-.8.94-1.198 2.14-1.198 3.6 0 1.481.398 2.68 1.199 3.598a4.39 4.39 0 006.215.223c.078-.082.136-.16.218-.223m6.95-16.698h3.18v20.62h-3.18zm7.793 8.34h-2.618v-2.802h2.618V6.04h3.214v4.223h3.618v2.797h-3.618v7.863c0 .578.122 1 .36 1.258.242.242.64.36 1.199.36H172v2.8h-3.055c-1.441 0-2.48-.34-3.136-1-.66-.66-.98-1.7-.98-3.102zm0 0"/><path d="M27.148 15c0 6.727-5.445 12.18-12.164 12.18-6.722 0-12.168-5.453-12.168-12.18 0-6.727 5.446-12.18 12.168-12.18 6.72 0 12.164 5.453 12.164 12.18zm0 0" fill="url(#a)"/><path d="M14.984 0c8.27 0 14.98 6.719 14.98 15 0 8.281-6.71 15-14.98 15zm0 0"/></svg>
  • servebolt-optimizer/trunk/languages/servebolt-optimizer.pot

    r2957331 r3023447  
    1 # Copyright (C) 2023 Servebolt
     1# Copyright (C) 2024 Servebolt
    22# This file is distributed under the GPLv3 or later.
    33msgid ""
    44msgstr ""
    5 "Project-Id-Version: Servebolt Optimizer 3.5.23\n"
     5"Project-Id-Version: Servebolt Optimizer 3.5.25\n"
    66"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/servebolt-optimizer\n"
    77"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
     
    1010"Content-Type: text/plain; charset=UTF-8\n"
    1111"Content-Transfer-Encoding: 8bit\n"
    12 "POT-Creation-Date: 2023-08-23T13:29:29+02:00\n"
     12"POT-Creation-Date: 2024-01-17T17:30:51+01:00\n"
    1313"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
    14 "X-Generator: WP-CLI 2.5.0\n"
     14"X-Generator: WP-CLI 2.7.1\n"
    1515"X-Domain: servebolt-wp\n"
    1616
     
    11551155msgstr ""
    11561156
    1157 #: src/Servebolt/Helpers/Helpers.php:1195
    1158 #: src/Servebolt/Helpers/Helpers.php:1207
     1157#: src/Servebolt/Helpers/Helpers.php:1220
     1158#: src/Servebolt/Helpers/Helpers.php:1232
    11591159#: src/Servebolt/Views/accelerated-domains/image-resize/image-size-index-list.php:12
    11601160msgid "Delete"
    11611161msgstr ""
    11621162
    1163 #: src/Servebolt/Helpers/Helpers.php:1196
     1163#: src/Servebolt/Helpers/Helpers.php:1221
    11641164msgid "View"
    11651165msgstr ""
    11661166
    1167 #: src/Servebolt/Helpers/Helpers.php:1198
     1167#: src/Servebolt/Helpers/Helpers.php:1223
    11681168msgid "Edit"
    11691169msgstr ""
    11701170
    1171 #: src/Servebolt/Helpers/Helpers.php:1205
     1171#: src/Servebolt/Helpers/Helpers.php:1230
    11721172msgid "Post does not exist."
    11731173msgstr ""
     
    19831983msgstr ""
    19841984
    1985 #: src/Servebolt/Views/dashboard/dashboard.php:7
     1985#: src/Servebolt/Views/dashboard/dashboard.php:9
    19861986msgid "Performance Tools"
    19871987msgstr ""
  • servebolt-optimizer/trunk/servebolt-optimizer.php

    r3003163 r3023447  
    22/*
    33Plugin Name: Servebolt Optimizer
    4 Version: 3.5.25
     4Version: 3.5.26
    55Author: Servebolt
    66Author URI: https://servebolt.com
     
    2828 * @since 3.5.11
    2929 */
    30 define('SERVEBOLT_PLUGIN_DB_VERSION', 100);
     30define('SERVEBOLT_PLUGIN_DB_VERSION', 101);
    3131
    3232// Abort and display WP admin notice if PHP version is less than constant SERVEBOLT_PLUGIN_MINIMUM_PHP_VERSION
  • servebolt-optimizer/trunk/src/Servebolt/CacheTags/AddCacheTagsHeaders.php

    r2907014 r3023447  
    4545    use Multiton;
    4646
    47     // /**
    48     //  * Drivers that require the site to be hosted at Servebolt.
    49     //  *
    50     //  * @var string[]
    51     //  */
    52     // private static $serveboltOnlyDrivers = ['acd', 'serveboltcdn'];
    53 
    54     // /**
    55     //  * Valid drivers.
    56     //  *
    57     //  * @var string[]
    58     //  */
    59     // private static $validDrivers = ['cloudflare', 'acd', 'serveboltcdn'];
    60 
    6147    /**
    6248     * CachePurge constructor.
     
    6551    public function __construct(?int $blogId = null)
    6652    {   
    67        
     53
    6854        $this->driver = self::getSelectedCachePurgeDriver($blogId);
    6955
     
    7359            add_filter('sb_optimizer_can_purge_term_cache', '__return_false');
    7460        }
    75        
     61
    7662        if (
    7763            is_admin()
     
    8369        ) return;
    8470
    85        
    86        
    8771        if(in_array($this->driver, CanUseCacheTags::allowedDrivers())) {
    8872            // Get the correct hook based on version of WordPress, pre 6.1 wp, post send_headers.
    8973            add_action(getCondtionalHookPreHeaders(), [$this,'addCacheTagsHeaders']);
    9074        }
    91        
    9275    }
    9376
    9477    /**
    95      *
    96      *
     78     * Works out what cache tage headers are needed in the header CacheTag for the current location.
    9779     */
    9880    public function addCacheTagsHeaders()
    9981    {
    100         $this->setPrefixAndSuffixForTags();   
    101         if($this->driver != 'serveboltcdn') {
     82        $this->setPrefixAndSuffixForTags();
     83        // Filter allows customer to use reduced instruction set for CacheTags.
     84        // If filter returns false, an Accelerated Domains customer will use the Servebolt CDN cache tags.
     85        if($this->driver != 'serveboltcdn' && apply_filters('sb_optimizer_cach_tags_fine_grain_control', true) ) {
    10286            $this->addAuthorTag();
    10387            $this->addTaxonomyTermIDTag();
     
    126110                $tags = implode(',', $this->headers);
    127111                header('Cache-Tag: ' . $tags );
     112
    128113                if($this->driver == 'acd') {
    129114                    header('x-acd-Cache-Tag: ' . $tags);
     
    135120        }
    136121    }
    137 
    138    
     122 
    139123}
  • servebolt-optimizer/trunk/src/Servebolt/CacheTags/CacheTagsBase.php

    r2907017 r3023447  
    22namespace Servebolt\Optimizer\CacheTags;
    33
    4 use function \Servebolt\Optimizer\Helpers\getDomainNameOfWebSite;
     4use Servebolt\Optimizer\Api\Servebolt\Servebolt;
     5// use function \Servebolt\Optimizer\Helpers\getDomainNameOfWebSite;
    56use function Servebolt\Optimizer\Helpers\isHostedAtServebolt;
    67use function Servebolt\Optimizer\Helpers\smartGetOption;
    78class CacheTagsBase {
     9    /**
     10     * Class constants are used to convert labels (const names) into numbers.
     11     * This way they human readable in the code, but machine readable as a cachetag
     12     *
     13     * These are grouped
     14     * 0x = global
     15     * 1x = post type
     16     * 2x = taxonomy
     17     * 3x = feeds
     18     * 4x = woocommerce
     19     *
     20     */
     21
     22    // Global
     23    const HOME = 00;
     24    const HTML = 01;
     25    const SEARCH = 02;
     26    const SITEMAP = 03; // Not currently used
     27
     28    // Post Type
     29    const POST_TYPE = 10;
     30    const AUTHOR = 11;
     31    const DATE = 12;
     32    const MONTH = 13;
     33    const YEAR = 14;
     34
     35    // Taxonomy
     36    const TERM_ID = 20;
     37    const TAXONOMY_ID = 21; // not currently used.
     38
     39    // Feeds
     40    const FEEDS = 30;
     41    const COMMENT_FEED = 31;
     42
     43    // WooCommerce
     44    const WOOCOMMERCE = 40;
     45    const WOOCOMMERCE_SHOP = 41;
     46    const WOOCOMMERCE_CATEGORY = 42;
     47    const WOOCOMMERCE_TAG = 43;
     48    const WOOCOMMERCE_PRODUCT = 44;
     49    const WOOCOMMERCE_PRODUCT_ID = 45;
     50
    851    /**
    952     * Drivers that require the site to be hosted at Servebolt.
     
    82125    protected function setDomain()
    83126    {
    84         $this->domain = str_replace('.','',getDomainNameOfWebSite());
     127        $env = Servebolt::getInstance();
     128        $this->domain = $env->getEnvironmentId();
     129        // remove domain name in favor of env id.
     130        // $this->domain = str_replace('.','',getDomainNameOfWebSite());
    85131    }
    86132
     
    99145    {
    100146        if(is_post_type_archive()) {
    101             $this->add('posttype-'.get_queried_object()->name );
     147            $this->add(self::POST_TYPE.'-'.get_queried_object()->name );
    102148        }
    103149        if(is_singular()) {
    104             $this->add('posttype-'.get_post_type());
     150            $this->add(self::POST_TYPE.'-'.get_post_type());
    105151        }
    106152    }
     
    111157    protected function addHTMLTag() : void
    112158    {
    113         $this->add('html');
     159        $this->add(self::HTML);
    114160    }
    115161    /**
     
    119165    {
    120166        if(is_search()) {
    121             $this->add('search');
     167            $this->add(self::SEARCH);
    122168        }
    123169    }
     
    131177    {
    132178        if(is_category() || is_tag() || is_tax() ) {           
    133             $this->add('term-'. get_queried_object_id());
     179            $this->add(self::TERM_ID . '-'. get_queried_object_id());
    134180            // TODO: decide how much effort to put into RSS
    135181            // $this->add('term-feed-'.get_queried_object_id());
     
    143189                $ids = wp_get_post_terms(get_queried_object()->ID, $tax->name, ['fields' => 'ids']);
    144190                // ignore empty taxonomies or ignore error and continue;
    145                 if(count($ids) == 0 || is_wp_error($ids)) continue;
    146                 // loop all ids and add them
     191                if( is_wp_error($ids) || count($ids) == 0 ) continue;
     192
    147193                foreach($ids as $id) {
    148                     $this->add('term-'.$id);
    149                     // TODO: decide how much effort to put into RSS
    150                     //$this->add('term-feed-'.$id);
     194                    $this->add(self::TERM_ID . '-'.$id);
    151195                }
    152196            }           
     
    164208       
    165209        if(is_author()){
    166             $this->add('author-' . get_the_author_meta('ID') );
     210            $this->add( self::AUTHOR . '-' . get_the_author_meta('ID') );
    167211        }
    168212
    169213        if(is_singular()){
    170             $this->add('author-' . get_post_field('post_author', get_queried_object()->ID ) );
     214            if(class_exists( 'woocommerce' ) && is_product()) return;
     215
     216            $this->add( self::AUTHOR . '-' . get_post_field('post_author', get_queried_object()->ID ) );
    171217        }
    172218
     
    184230    {
    185231        if(is_date()) {
    186             $this->add('date-'.get_query_var('day') .'-'. get_query_var('monthnum') .'-'. get_query_var('year'));
    187             $this->add('year-'.  get_query_var('year'));
    188             $this->add('month-'. get_query_var('monthnum'));
     232            $this->add(self::DATE .'-' .get_query_var('day') .'-'. get_query_var('monthnum') .'-'. get_query_var('year'));
     233            $this->add(self::YEAR .'-'.  get_query_var('year'));
     234            $this->add(self::MONTH .'-'. get_query_var('monthnum'));
    189235        }
    190236
    191237        if(is_singular() && !is_home() && !is_front_page()) {
    192             $this->add('date-'.get_the_date('d-n-Y'));
    193             $this->add('year-'.  get_the_date('Y'));
    194             $this->add('month-'. get_the_date('n'));
     238            if(is_page() || (class_exists( 'woocommerce' ) && is_product() ) ) return;
     239            $this->add(self::DATE .'-' .get_the_date('d-n-Y'));
     240            $this->add(self::YEAR .'-'.  get_the_date('Y'));
     241            $this->add(self::MONTH .'-'. get_the_date('n'));
    195242        }
    196243    }
     
    209256    {
    210257        if(is_feed() && !is_singular()) {
    211             $this->add('feeds');
     258            $this->add(self::FEEDS);
    212259        }
    213260       
    214261        if(is_feed() && is_singular()) {
    215             $this->add('comment-feed' . get_queried_object()->ID);
     262            $this->add(self::COMMENT_FEED. '-' . get_queried_object()->ID);
    216263        }
    217264    }
     
    225272    protected function addSitemapTag() : void
    226273    {
    227         $this->add('sitemap');
     274        $this->add(self::SITEMAP);
    228275    }
    229276
     
    235282    {
    236283        if(is_home()||is_front_page()) {
    237             $this->add('home');
     284            $this->add(self::HOME);
    238285        }
    239286    }
     
    250297        // woocommerce
    251298        if(is_woocommerce()) {
    252             $this->add('woocommerce');
     299            $this->add(self::WOOCOMMERCE);
    253300        }
    254301        // is the main shop page, normally /shop
    255302        // woocommerce-shop
    256303        if(is_shop()) {
    257             $this->add('woocommerce-shop');
     304            $this->add(self::WOOCOMMERCE_SHOP);
    258305        }
    259306        // is a product category archive page of woocommerce
    260307        // woocommerce-category
    261308        if(is_product_category()){
    262             $this->add('woocommerce-category');
     309            $this->add(self::WOOCOMMERCE_CATEGORY);
    263310        }
    264311        // is a product tag archive page of woocommerce
    265312        // woocommerce-tag
    266313        if(is_product_tag()){
    267             $this->add('woocommerce-tag');
     314            $this->add(self::WOOCOMMERCE_TAG);
    268315        }
    269316        // is a product page of woocommerce
    270317        // woocommerce-product
    271318        if(is_product()){
    272             $this->add('woocommerce-product');
    273             $this->add('woocommerce-productid-'.get_the_ID());
     319            $this->add(self::WOOCOMMERCE_PRODUCT);
     320            $this->add(self::WOOCOMMERCE_PRODUCT_ID.'-'.get_the_ID());
    274321        }       
    275322    }
  • servebolt-optimizer/trunk/src/Servebolt/CacheTags/GetCacheTagsHeadersForLocation.php

    r3003163 r3023447  
    3939        if($this->objectType == 'term') {
    4040            $this->setPrefixAndSuffixForTags();
    41             $this->add('term-'.$this->objectId);
     41            $this->add(self::TERM_ID . '-'.$this->objectId);
    4242            return;
    4343        }
     
    6262    }
    6363
     64    /**
     65     * Works out what cache tage headers are needed for the purge of the current location
     66     */
    6467    protected function getTagHeaders() : void
    6568    {
    6669        $this->setPrefixAndSuffixForTags();
    67         if($this->driver != 'serveboltcdn') {
     70        // Filter allows customer to use reduced instruction set for CacheTags.
     71        // If filter returns false, an Accelerated Domains customer will use the Servebolt CDN cache tags.
     72        if($this->driver != 'serveboltcdn' && apply_filters('sb_optimizer_cach_tags_fine_grain_control', true) ) {
    6873            $this->addAuthorTag();
    6974            $this->addHomeTag();
     
    8590    protected function addHTMLTag() : void
    8691    {
    87         $this->add('html');
     92        $this->add(self::HTML);
    8893    }
    8994
     
    9398    protected function addSearch() : void
    9499    {
    95         $this->add('search');
     100        $this->add(self::SEARCH);
    96101    }
    97102    /**
     
    100105    protected function addHomeTag() : void
    101106    {
    102         $this->add('home');
     107        $this->add(self::HOME);
    103108    }
    104109
     
    108113    protected function addRssTag() : void
    109114    {
    110         $this->add('comment-feed' . get_the_ID());
    111         $this->add('feeds');
     115        $this->add(self::COMMENT_FEED.'-'. get_the_ID());
     116        $this->add(self::FEEDS);
    112117    }
    113118
     
    117122    protected function addPostTypeTag(): void
    118123    {
    119         $this->add('posttype-'.get_post_type());
     124        $this->add(self::POST_TYPE . '-'.get_post_type());
    120125    }
    121126
     
    125130    protected function addDateTag(): void
    126131    {
    127         $this->add('date-'. get_the_date('d-n-Y'));
    128         $this->add('year-'. get_the_date('Y'));
    129         $this->add('month-'.get_the_date('n'));
     132        $this->add(self::DATE . '-'. get_the_date('d-n-Y'));
     133        $this->add(self::YEAR . '-'. get_the_date('Y'));
     134        $this->add(self::MONTH . '-'.get_the_date('n'));
    130135    }
    131136
     
    144149            // loop all ids and add them
    145150            foreach($ids as $id) {
    146                 $this->add('term-'.$id);
     151                $this->add(self::TERM_ID . '-' .$id);
    147152                // Option to later split feeds by tag id i.e. /tags/tagname/feed
    148153                // $this->add('term-feed-'.$id);
     
    159164    protected function addAuthorTag() : void
    160165    {
    161         $this->add('author-' . get_post_field('post_author', get_the_ID() ) );
     166        $this->add(self::AUTHOR . '-' . get_post_field('post_author', get_the_ID() ) );
    162167    }
    163168
     
    170175        if ( !class_exists( 'woocommerce' ) ) return;
    171176        // Add the shop homepage.
    172         $this->add('woocommerce-shop');
     177        $this->add(self::WOOCOMMERCE_SHOP);
    173178        /**
    174179         * clear the product cache so that all of its versions are removed
     
    180185         */
    181186        if(function_exists('is_product') && is_product()) {
    182             $this->add('woocommerce-productid-'.get_the_ID());
     187            $this->add(self::WOOCOMMERCE_PRODUCT_ID . '-'.get_the_ID());
    183188        }
    184189    }
  • servebolt-optimizer/trunk/src/Servebolt/Utils/WPConfigTransformer.php

    r3003163 r3023447  
    8686        }
    8787
    88         error_log('wp_configs from function Exists :' . print_r($this->wp_configs, true));
    8988        return isset( $this->wp_configs[ $type ][ $name ] );
    9089    }
  • servebolt-optimizer/trunk/src/Servebolt/Views/dashboard/dashboard.php

    r2684493 r3023447  
    22<?php use function Servebolt\Optimizer\Helpers\isHostedAtServebolt; ?>
    33<?php use function Servebolt\Optimizer\Helpers\view; ?>
     4<?php $image_path = trailingslashit(SERVEBOLT_PLUGIN_DIR_URL) . 'assets/dist/images/'; ?>
    45
    56<div class="wrap sb-content">
    6     <div class="sb-logo"></div>
     7    <img srcset="<?php echo $image_path ?>servebolt-logo.svg, <?php echo $image_path ?>servebolt-logo-retina.svg 2x" src="<?php echo $image_path ?>servebolt-logo.svg" alt="Servebolt logo" width="340px" height="60px">
     8    <!-- <div class="sb-logo"></div> -->
    79    <h1 class="heading"><?php _e('Performance Tools', 'servebolt-wp'); ?></h1>
    810
  • servebolt-optimizer/trunk/vendor/composer/installed.php

    r3003163 r3023447  
    22    'root' => array(
    33        'name' => 'servebolt/servebolt-wp-optimize-plugin',
    4         'pretty_version' => '3.5.25',
    5         'version' => '3.5.25.0',
    6         'reference' => '988741b9cea3bd420ab654ceebe13375c8e627db',
     4        'pretty_version' => '3.5.26',
     5        'version' => '3.5.26.0',
     6        'reference' => 'a5cb70738657e2a5362bebd56903e7b947f1c369',
    77        'type' => 'wordpress-plugin',
    88        'install_path' => __DIR__ . '/../../',
     
    132132        ),
    133133        'servebolt/servebolt-wp-optimize-plugin' => array(
    134             'pretty_version' => '3.5.25',
    135             'version' => '3.5.25.0',
    136             'reference' => '988741b9cea3bd420ab654ceebe13375c8e627db',
     134            'pretty_version' => '3.5.26',
     135            'version' => '3.5.26.0',
     136            'reference' => 'a5cb70738657e2a5362bebd56903e7b947f1c369',
    137137            'type' => 'wordpress-plugin',
    138138            'install_path' => __DIR__ . '/../../',
Note: See TracChangeset for help on using the changeset viewer.