Changeset 3023447
- Timestamp:
- 01/18/2024 11:25:13 AM (2 years ago)
- Location:
- servebolt-optimizer
- Files:
-
- 4 added
- 20 edited
- 1 copied
-
tags/3.5.26 (copied) (copied from servebolt-optimizer/trunk)
-
tags/3.5.26/Readme.txt (modified) (2 diffs)
-
tags/3.5.26/assets/dist/images/servebolt-logo-retina.svg (added)
-
tags/3.5.26/assets/dist/images/servebolt-logo.svg (modified) (1 diff)
-
tags/3.5.26/languages/servebolt-optimizer.pot (modified) (4 diffs)
-
tags/3.5.26/servebolt-optimizer.php (modified) (2 diffs)
-
tags/3.5.26/src/Servebolt/CacheTags/AddCacheTagsHeaders.php (modified) (6 diffs)
-
tags/3.5.26/src/Servebolt/CacheTags/CacheTagsBase.php (modified) (13 diffs)
-
tags/3.5.26/src/Servebolt/CacheTags/GetCacheTagsHeadersForLocation.php (modified) (12 diffs)
-
tags/3.5.26/src/Servebolt/Utils/DatabaseMigration/Migrations/6_ForceCachePurge.php (added)
-
tags/3.5.26/src/Servebolt/Utils/WPConfigTransformer.php (modified) (1 diff)
-
tags/3.5.26/src/Servebolt/Views/dashboard/dashboard.php (modified) (1 diff)
-
tags/3.5.26/vendor/composer/installed.php (modified) (2 diffs)
-
trunk/Readme.txt (modified) (2 diffs)
-
trunk/assets/dist/images/servebolt-logo-retina.svg (added)
-
trunk/assets/dist/images/servebolt-logo.svg (modified) (1 diff)
-
trunk/languages/servebolt-optimizer.pot (modified) (4 diffs)
-
trunk/servebolt-optimizer.php (modified) (2 diffs)
-
trunk/src/Servebolt/CacheTags/AddCacheTagsHeaders.php (modified) (6 diffs)
-
trunk/src/Servebolt/CacheTags/CacheTagsBase.php (modified) (13 diffs)
-
trunk/src/Servebolt/CacheTags/GetCacheTagsHeadersForLocation.php (modified) (12 diffs)
-
trunk/src/Servebolt/Utils/DatabaseMigration/Migrations/6_ForceCachePurge.php (added)
-
trunk/src/Servebolt/Utils/WPConfigTransformer.php (modified) (1 diff)
-
trunk/src/Servebolt/Views/dashboard/dashboard.php (modified) (1 diff)
-
trunk/vendor/composer/installed.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
servebolt-optimizer/tags/3.5.26/Readme.txt
r3003163 r3023447 6 6 Tested up to: 6.4.1 7 7 Requires PHP: 7.3 8 Stable tag: 3.5.2 58 Stable tag: 3.5.26 9 9 License: GPLv3 or later 10 10 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 98 98 99 99 == 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 = 101 108 * Allows for NextGen servers to be supported for reading Servebolt Environment files and obtaining the site id from the path. 102 109 * 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) 202 3Servebolt1 # Copyright (C) 2024 Servebolt 2 2 # This file is distributed under the GPLv3 or later. 3 3 msgid "" 4 4 msgstr "" 5 "Project-Id-Version: Servebolt Optimizer 3.5.2 3\n"5 "Project-Id-Version: Servebolt Optimizer 3.5.25\n" 6 6 "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/servebolt-optimizer\n" 7 7 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" … … 10 10 "Content-Type: text/plain; charset=UTF-8\n" 11 11 "Content-Transfer-Encoding: 8bit\n" 12 "POT-Creation-Date: 202 3-08-23T13:29:29+02:00\n"12 "POT-Creation-Date: 2024-01-17T17:30:51+01:00\n" 13 13 "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" 15 15 "X-Domain: servebolt-wp\n" 16 16 … … 1155 1155 msgstr "" 1156 1156 1157 #: src/Servebolt/Helpers/Helpers.php:1 1951158 #: src/Servebolt/Helpers/Helpers.php:12 071157 #: src/Servebolt/Helpers/Helpers.php:1220 1158 #: src/Servebolt/Helpers/Helpers.php:1232 1159 1159 #: src/Servebolt/Views/accelerated-domains/image-resize/image-size-index-list.php:12 1160 1160 msgid "Delete" 1161 1161 msgstr "" 1162 1162 1163 #: src/Servebolt/Helpers/Helpers.php:1 1961163 #: src/Servebolt/Helpers/Helpers.php:1221 1164 1164 msgid "View" 1165 1165 msgstr "" 1166 1166 1167 #: src/Servebolt/Helpers/Helpers.php:1 1981167 #: src/Servebolt/Helpers/Helpers.php:1223 1168 1168 msgid "Edit" 1169 1169 msgstr "" 1170 1170 1171 #: src/Servebolt/Helpers/Helpers.php:12 051171 #: src/Servebolt/Helpers/Helpers.php:1230 1172 1172 msgid "Post does not exist." 1173 1173 msgstr "" … … 1983 1983 msgstr "" 1984 1984 1985 #: src/Servebolt/Views/dashboard/dashboard.php: 71985 #: src/Servebolt/Views/dashboard/dashboard.php:9 1986 1986 msgid "Performance Tools" 1987 1987 msgstr "" -
servebolt-optimizer/tags/3.5.26/servebolt-optimizer.php
r3003163 r3023447 2 2 /* 3 3 Plugin Name: Servebolt Optimizer 4 Version: 3.5.2 54 Version: 3.5.26 5 5 Author: Servebolt 6 6 Author URI: https://servebolt.com … … 28 28 * @since 3.5.11 29 29 */ 30 define('SERVEBOLT_PLUGIN_DB_VERSION', 10 0);30 define('SERVEBOLT_PLUGIN_DB_VERSION', 101); 31 31 32 32 // 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 45 45 use Multiton; 46 46 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 61 47 /** 62 48 * CachePurge constructor. … … 65 51 public function __construct(?int $blogId = null) 66 52 { 67 53 68 54 $this->driver = self::getSelectedCachePurgeDriver($blogId); 69 55 … … 73 59 add_filter('sb_optimizer_can_purge_term_cache', '__return_false'); 74 60 } 75 61 76 62 if ( 77 63 is_admin() … … 83 69 ) return; 84 70 85 86 87 71 if(in_array($this->driver, CanUseCacheTags::allowedDrivers())) { 88 72 // Get the correct hook based on version of WordPress, pre 6.1 wp, post send_headers. 89 73 add_action(getCondtionalHookPreHeaders(), [$this,'addCacheTagsHeaders']); 90 74 } 91 92 75 } 93 76 94 77 /** 95 * 96 * 78 * Works out what cache tage headers are needed in the header CacheTag for the current location. 97 79 */ 98 80 public function addCacheTagsHeaders() 99 81 { 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) ) { 102 86 $this->addAuthorTag(); 103 87 $this->addTaxonomyTermIDTag(); … … 126 110 $tags = implode(',', $this->headers); 127 111 header('Cache-Tag: ' . $tags ); 112 128 113 if($this->driver == 'acd') { 129 114 header('x-acd-Cache-Tag: ' . $tags); … … 135 120 } 136 121 } 137 138 122 139 123 } -
servebolt-optimizer/tags/3.5.26/src/Servebolt/CacheTags/CacheTagsBase.php
r2907017 r3023447 2 2 namespace Servebolt\Optimizer\CacheTags; 3 3 4 use function \Servebolt\Optimizer\Helpers\getDomainNameOfWebSite; 4 use Servebolt\Optimizer\Api\Servebolt\Servebolt; 5 // use function \Servebolt\Optimizer\Helpers\getDomainNameOfWebSite; 5 6 use function Servebolt\Optimizer\Helpers\isHostedAtServebolt; 6 7 use function Servebolt\Optimizer\Helpers\smartGetOption; 7 8 class 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 8 51 /** 9 52 * Drivers that require the site to be hosted at Servebolt. … … 82 125 protected function setDomain() 83 126 { 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()); 85 131 } 86 132 … … 99 145 { 100 146 if(is_post_type_archive()) { 101 $this->add( 'posttype-'.get_queried_object()->name );147 $this->add(self::POST_TYPE.'-'.get_queried_object()->name ); 102 148 } 103 149 if(is_singular()) { 104 $this->add( 'posttype-'.get_post_type());150 $this->add(self::POST_TYPE.'-'.get_post_type()); 105 151 } 106 152 } … … 111 157 protected function addHTMLTag() : void 112 158 { 113 $this->add( 'html');159 $this->add(self::HTML); 114 160 } 115 161 /** … … 119 165 { 120 166 if(is_search()) { 121 $this->add( 'search');167 $this->add(self::SEARCH); 122 168 } 123 169 } … … 131 177 { 132 178 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()); 134 180 // TODO: decide how much effort to put into RSS 135 181 // $this->add('term-feed-'.get_queried_object_id()); … … 143 189 $ids = wp_get_post_terms(get_queried_object()->ID, $tax->name, ['fields' => 'ids']); 144 190 // 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 147 193 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); 151 195 } 152 196 } … … 164 208 165 209 if(is_author()){ 166 $this->add( 'author-' . get_the_author_meta('ID') );210 $this->add( self::AUTHOR . '-' . get_the_author_meta('ID') ); 167 211 } 168 212 169 213 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 ) ); 171 217 } 172 218 … … 184 230 { 185 231 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')); 189 235 } 190 236 191 237 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')); 195 242 } 196 243 } … … 209 256 { 210 257 if(is_feed() && !is_singular()) { 211 $this->add( 'feeds');258 $this->add(self::FEEDS); 212 259 } 213 260 214 261 if(is_feed() && is_singular()) { 215 $this->add( 'comment-feed' . get_queried_object()->ID);262 $this->add(self::COMMENT_FEED. '-' . get_queried_object()->ID); 216 263 } 217 264 } … … 225 272 protected function addSitemapTag() : void 226 273 { 227 $this->add( 'sitemap');274 $this->add(self::SITEMAP); 228 275 } 229 276 … … 235 282 { 236 283 if(is_home()||is_front_page()) { 237 $this->add( 'home');284 $this->add(self::HOME); 238 285 } 239 286 } … … 250 297 // woocommerce 251 298 if(is_woocommerce()) { 252 $this->add( 'woocommerce');299 $this->add(self::WOOCOMMERCE); 253 300 } 254 301 // is the main shop page, normally /shop 255 302 // woocommerce-shop 256 303 if(is_shop()) { 257 $this->add( 'woocommerce-shop');304 $this->add(self::WOOCOMMERCE_SHOP); 258 305 } 259 306 // is a product category archive page of woocommerce 260 307 // woocommerce-category 261 308 if(is_product_category()){ 262 $this->add( 'woocommerce-category');309 $this->add(self::WOOCOMMERCE_CATEGORY); 263 310 } 264 311 // is a product tag archive page of woocommerce 265 312 // woocommerce-tag 266 313 if(is_product_tag()){ 267 $this->add( 'woocommerce-tag');314 $this->add(self::WOOCOMMERCE_TAG); 268 315 } 269 316 // is a product page of woocommerce 270 317 // woocommerce-product 271 318 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()); 274 321 } 275 322 } -
servebolt-optimizer/tags/3.5.26/src/Servebolt/CacheTags/GetCacheTagsHeadersForLocation.php
r3003163 r3023447 39 39 if($this->objectType == 'term') { 40 40 $this->setPrefixAndSuffixForTags(); 41 $this->add( 'term-'.$this->objectId);41 $this->add(self::TERM_ID . '-'.$this->objectId); 42 42 return; 43 43 } … … 62 62 } 63 63 64 /** 65 * Works out what cache tage headers are needed for the purge of the current location 66 */ 64 67 protected function getTagHeaders() : void 65 68 { 66 69 $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) ) { 68 73 $this->addAuthorTag(); 69 74 $this->addHomeTag(); … … 85 90 protected function addHTMLTag() : void 86 91 { 87 $this->add( 'html');92 $this->add(self::HTML); 88 93 } 89 94 … … 93 98 protected function addSearch() : void 94 99 { 95 $this->add( 'search');100 $this->add(self::SEARCH); 96 101 } 97 102 /** … … 100 105 protected function addHomeTag() : void 101 106 { 102 $this->add( 'home');107 $this->add(self::HOME); 103 108 } 104 109 … … 108 113 protected function addRssTag() : void 109 114 { 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); 112 117 } 113 118 … … 117 122 protected function addPostTypeTag(): void 118 123 { 119 $this->add( 'posttype-'.get_post_type());124 $this->add(self::POST_TYPE . '-'.get_post_type()); 120 125 } 121 126 … … 125 130 protected function addDateTag(): void 126 131 { 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')); 130 135 } 131 136 … … 144 149 // loop all ids and add them 145 150 foreach($ids as $id) { 146 $this->add( 'term-'.$id);151 $this->add(self::TERM_ID . '-' .$id); 147 152 // Option to later split feeds by tag id i.e. /tags/tagname/feed 148 153 // $this->add('term-feed-'.$id); … … 159 164 protected function addAuthorTag() : void 160 165 { 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() ) ); 162 167 } 163 168 … … 170 175 if ( !class_exists( 'woocommerce' ) ) return; 171 176 // Add the shop homepage. 172 $this->add( 'woocommerce-shop');177 $this->add(self::WOOCOMMERCE_SHOP); 173 178 /** 174 179 * clear the product cache so that all of its versions are removed … … 180 185 */ 181 186 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()); 183 188 } 184 189 } -
servebolt-optimizer/tags/3.5.26/src/Servebolt/Utils/WPConfigTransformer.php
r3003163 r3023447 86 86 } 87 87 88 error_log('wp_configs from function Exists :' . print_r($this->wp_configs, true));89 88 return isset( $this->wp_configs[ $type ][ $name ] ); 90 89 } -
servebolt-optimizer/tags/3.5.26/src/Servebolt/Views/dashboard/dashboard.php
r2684493 r3023447 2 2 <?php use function Servebolt\Optimizer\Helpers\isHostedAtServebolt; ?> 3 3 <?php use function Servebolt\Optimizer\Helpers\view; ?> 4 <?php $image_path = trailingslashit(SERVEBOLT_PLUGIN_DIR_URL) . 'assets/dist/images/'; ?> 4 5 5 6 <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> --> 7 9 <h1 class="heading"><?php _e('Performance Tools', 'servebolt-wp'); ?></h1> 8 10 -
servebolt-optimizer/tags/3.5.26/vendor/composer/installed.php
r3003163 r3023447 2 2 'root' => array( 3 3 'name' => 'servebolt/servebolt-wp-optimize-plugin', 4 'pretty_version' => '3.5.2 5',5 'version' => '3.5.2 5.0',6 'reference' => ' 988741b9cea3bd420ab654ceebe13375c8e627db',4 'pretty_version' => '3.5.26', 5 'version' => '3.5.26.0', 6 'reference' => 'a5cb70738657e2a5362bebd56903e7b947f1c369', 7 7 'type' => 'wordpress-plugin', 8 8 'install_path' => __DIR__ . '/../../', … … 132 132 ), 133 133 'servebolt/servebolt-wp-optimize-plugin' => array( 134 'pretty_version' => '3.5.2 5',135 'version' => '3.5.2 5.0',136 'reference' => ' 988741b9cea3bd420ab654ceebe13375c8e627db',134 'pretty_version' => '3.5.26', 135 'version' => '3.5.26.0', 136 'reference' => 'a5cb70738657e2a5362bebd56903e7b947f1c369', 137 137 'type' => 'wordpress-plugin', 138 138 'install_path' => __DIR__ . '/../../', -
servebolt-optimizer/trunk/Readme.txt
r3003163 r3023447 6 6 Tested up to: 6.4.1 7 7 Requires PHP: 7.3 8 Stable tag: 3.5.2 58 Stable tag: 3.5.26 9 9 License: GPLv3 or later 10 10 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 98 98 99 99 == 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 = 101 108 * Allows for NextGen servers to be supported for reading Servebolt Environment files and obtaining the site id from the path. 102 109 * 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) 202 3Servebolt1 # Copyright (C) 2024 Servebolt 2 2 # This file is distributed under the GPLv3 or later. 3 3 msgid "" 4 4 msgstr "" 5 "Project-Id-Version: Servebolt Optimizer 3.5.2 3\n"5 "Project-Id-Version: Servebolt Optimizer 3.5.25\n" 6 6 "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/servebolt-optimizer\n" 7 7 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" … … 10 10 "Content-Type: text/plain; charset=UTF-8\n" 11 11 "Content-Transfer-Encoding: 8bit\n" 12 "POT-Creation-Date: 202 3-08-23T13:29:29+02:00\n"12 "POT-Creation-Date: 2024-01-17T17:30:51+01:00\n" 13 13 "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" 15 15 "X-Domain: servebolt-wp\n" 16 16 … … 1155 1155 msgstr "" 1156 1156 1157 #: src/Servebolt/Helpers/Helpers.php:1 1951158 #: src/Servebolt/Helpers/Helpers.php:12 071157 #: src/Servebolt/Helpers/Helpers.php:1220 1158 #: src/Servebolt/Helpers/Helpers.php:1232 1159 1159 #: src/Servebolt/Views/accelerated-domains/image-resize/image-size-index-list.php:12 1160 1160 msgid "Delete" 1161 1161 msgstr "" 1162 1162 1163 #: src/Servebolt/Helpers/Helpers.php:1 1961163 #: src/Servebolt/Helpers/Helpers.php:1221 1164 1164 msgid "View" 1165 1165 msgstr "" 1166 1166 1167 #: src/Servebolt/Helpers/Helpers.php:1 1981167 #: src/Servebolt/Helpers/Helpers.php:1223 1168 1168 msgid "Edit" 1169 1169 msgstr "" 1170 1170 1171 #: src/Servebolt/Helpers/Helpers.php:12 051171 #: src/Servebolt/Helpers/Helpers.php:1230 1172 1172 msgid "Post does not exist." 1173 1173 msgstr "" … … 1983 1983 msgstr "" 1984 1984 1985 #: src/Servebolt/Views/dashboard/dashboard.php: 71985 #: src/Servebolt/Views/dashboard/dashboard.php:9 1986 1986 msgid "Performance Tools" 1987 1987 msgstr "" -
servebolt-optimizer/trunk/servebolt-optimizer.php
r3003163 r3023447 2 2 /* 3 3 Plugin Name: Servebolt Optimizer 4 Version: 3.5.2 54 Version: 3.5.26 5 5 Author: Servebolt 6 6 Author URI: https://servebolt.com … … 28 28 * @since 3.5.11 29 29 */ 30 define('SERVEBOLT_PLUGIN_DB_VERSION', 10 0);30 define('SERVEBOLT_PLUGIN_DB_VERSION', 101); 31 31 32 32 // 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 45 45 use Multiton; 46 46 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 61 47 /** 62 48 * CachePurge constructor. … … 65 51 public function __construct(?int $blogId = null) 66 52 { 67 53 68 54 $this->driver = self::getSelectedCachePurgeDriver($blogId); 69 55 … … 73 59 add_filter('sb_optimizer_can_purge_term_cache', '__return_false'); 74 60 } 75 61 76 62 if ( 77 63 is_admin() … … 83 69 ) return; 84 70 85 86 87 71 if(in_array($this->driver, CanUseCacheTags::allowedDrivers())) { 88 72 // Get the correct hook based on version of WordPress, pre 6.1 wp, post send_headers. 89 73 add_action(getCondtionalHookPreHeaders(), [$this,'addCacheTagsHeaders']); 90 74 } 91 92 75 } 93 76 94 77 /** 95 * 96 * 78 * Works out what cache tage headers are needed in the header CacheTag for the current location. 97 79 */ 98 80 public function addCacheTagsHeaders() 99 81 { 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) ) { 102 86 $this->addAuthorTag(); 103 87 $this->addTaxonomyTermIDTag(); … … 126 110 $tags = implode(',', $this->headers); 127 111 header('Cache-Tag: ' . $tags ); 112 128 113 if($this->driver == 'acd') { 129 114 header('x-acd-Cache-Tag: ' . $tags); … … 135 120 } 136 121 } 137 138 122 139 123 } -
servebolt-optimizer/trunk/src/Servebolt/CacheTags/CacheTagsBase.php
r2907017 r3023447 2 2 namespace Servebolt\Optimizer\CacheTags; 3 3 4 use function \Servebolt\Optimizer\Helpers\getDomainNameOfWebSite; 4 use Servebolt\Optimizer\Api\Servebolt\Servebolt; 5 // use function \Servebolt\Optimizer\Helpers\getDomainNameOfWebSite; 5 6 use function Servebolt\Optimizer\Helpers\isHostedAtServebolt; 6 7 use function Servebolt\Optimizer\Helpers\smartGetOption; 7 8 class 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 8 51 /** 9 52 * Drivers that require the site to be hosted at Servebolt. … … 82 125 protected function setDomain() 83 126 { 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()); 85 131 } 86 132 … … 99 145 { 100 146 if(is_post_type_archive()) { 101 $this->add( 'posttype-'.get_queried_object()->name );147 $this->add(self::POST_TYPE.'-'.get_queried_object()->name ); 102 148 } 103 149 if(is_singular()) { 104 $this->add( 'posttype-'.get_post_type());150 $this->add(self::POST_TYPE.'-'.get_post_type()); 105 151 } 106 152 } … … 111 157 protected function addHTMLTag() : void 112 158 { 113 $this->add( 'html');159 $this->add(self::HTML); 114 160 } 115 161 /** … … 119 165 { 120 166 if(is_search()) { 121 $this->add( 'search');167 $this->add(self::SEARCH); 122 168 } 123 169 } … … 131 177 { 132 178 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()); 134 180 // TODO: decide how much effort to put into RSS 135 181 // $this->add('term-feed-'.get_queried_object_id()); … … 143 189 $ids = wp_get_post_terms(get_queried_object()->ID, $tax->name, ['fields' => 'ids']); 144 190 // 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 147 193 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); 151 195 } 152 196 } … … 164 208 165 209 if(is_author()){ 166 $this->add( 'author-' . get_the_author_meta('ID') );210 $this->add( self::AUTHOR . '-' . get_the_author_meta('ID') ); 167 211 } 168 212 169 213 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 ) ); 171 217 } 172 218 … … 184 230 { 185 231 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')); 189 235 } 190 236 191 237 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')); 195 242 } 196 243 } … … 209 256 { 210 257 if(is_feed() && !is_singular()) { 211 $this->add( 'feeds');258 $this->add(self::FEEDS); 212 259 } 213 260 214 261 if(is_feed() && is_singular()) { 215 $this->add( 'comment-feed' . get_queried_object()->ID);262 $this->add(self::COMMENT_FEED. '-' . get_queried_object()->ID); 216 263 } 217 264 } … … 225 272 protected function addSitemapTag() : void 226 273 { 227 $this->add( 'sitemap');274 $this->add(self::SITEMAP); 228 275 } 229 276 … … 235 282 { 236 283 if(is_home()||is_front_page()) { 237 $this->add( 'home');284 $this->add(self::HOME); 238 285 } 239 286 } … … 250 297 // woocommerce 251 298 if(is_woocommerce()) { 252 $this->add( 'woocommerce');299 $this->add(self::WOOCOMMERCE); 253 300 } 254 301 // is the main shop page, normally /shop 255 302 // woocommerce-shop 256 303 if(is_shop()) { 257 $this->add( 'woocommerce-shop');304 $this->add(self::WOOCOMMERCE_SHOP); 258 305 } 259 306 // is a product category archive page of woocommerce 260 307 // woocommerce-category 261 308 if(is_product_category()){ 262 $this->add( 'woocommerce-category');309 $this->add(self::WOOCOMMERCE_CATEGORY); 263 310 } 264 311 // is a product tag archive page of woocommerce 265 312 // woocommerce-tag 266 313 if(is_product_tag()){ 267 $this->add( 'woocommerce-tag');314 $this->add(self::WOOCOMMERCE_TAG); 268 315 } 269 316 // is a product page of woocommerce 270 317 // woocommerce-product 271 318 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()); 274 321 } 275 322 } -
servebolt-optimizer/trunk/src/Servebolt/CacheTags/GetCacheTagsHeadersForLocation.php
r3003163 r3023447 39 39 if($this->objectType == 'term') { 40 40 $this->setPrefixAndSuffixForTags(); 41 $this->add( 'term-'.$this->objectId);41 $this->add(self::TERM_ID . '-'.$this->objectId); 42 42 return; 43 43 } … … 62 62 } 63 63 64 /** 65 * Works out what cache tage headers are needed for the purge of the current location 66 */ 64 67 protected function getTagHeaders() : void 65 68 { 66 69 $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) ) { 68 73 $this->addAuthorTag(); 69 74 $this->addHomeTag(); … … 85 90 protected function addHTMLTag() : void 86 91 { 87 $this->add( 'html');92 $this->add(self::HTML); 88 93 } 89 94 … … 93 98 protected function addSearch() : void 94 99 { 95 $this->add( 'search');100 $this->add(self::SEARCH); 96 101 } 97 102 /** … … 100 105 protected function addHomeTag() : void 101 106 { 102 $this->add( 'home');107 $this->add(self::HOME); 103 108 } 104 109 … … 108 113 protected function addRssTag() : void 109 114 { 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); 112 117 } 113 118 … … 117 122 protected function addPostTypeTag(): void 118 123 { 119 $this->add( 'posttype-'.get_post_type());124 $this->add(self::POST_TYPE . '-'.get_post_type()); 120 125 } 121 126 … … 125 130 protected function addDateTag(): void 126 131 { 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')); 130 135 } 131 136 … … 144 149 // loop all ids and add them 145 150 foreach($ids as $id) { 146 $this->add( 'term-'.$id);151 $this->add(self::TERM_ID . '-' .$id); 147 152 // Option to later split feeds by tag id i.e. /tags/tagname/feed 148 153 // $this->add('term-feed-'.$id); … … 159 164 protected function addAuthorTag() : void 160 165 { 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() ) ); 162 167 } 163 168 … … 170 175 if ( !class_exists( 'woocommerce' ) ) return; 171 176 // Add the shop homepage. 172 $this->add( 'woocommerce-shop');177 $this->add(self::WOOCOMMERCE_SHOP); 173 178 /** 174 179 * clear the product cache so that all of its versions are removed … … 180 185 */ 181 186 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()); 183 188 } 184 189 } -
servebolt-optimizer/trunk/src/Servebolt/Utils/WPConfigTransformer.php
r3003163 r3023447 86 86 } 87 87 88 error_log('wp_configs from function Exists :' . print_r($this->wp_configs, true));89 88 return isset( $this->wp_configs[ $type ][ $name ] ); 90 89 } -
servebolt-optimizer/trunk/src/Servebolt/Views/dashboard/dashboard.php
r2684493 r3023447 2 2 <?php use function Servebolt\Optimizer\Helpers\isHostedAtServebolt; ?> 3 3 <?php use function Servebolt\Optimizer\Helpers\view; ?> 4 <?php $image_path = trailingslashit(SERVEBOLT_PLUGIN_DIR_URL) . 'assets/dist/images/'; ?> 4 5 5 6 <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> --> 7 9 <h1 class="heading"><?php _e('Performance Tools', 'servebolt-wp'); ?></h1> 8 10 -
servebolt-optimizer/trunk/vendor/composer/installed.php
r3003163 r3023447 2 2 'root' => array( 3 3 'name' => 'servebolt/servebolt-wp-optimize-plugin', 4 'pretty_version' => '3.5.2 5',5 'version' => '3.5.2 5.0',6 'reference' => ' 988741b9cea3bd420ab654ceebe13375c8e627db',4 'pretty_version' => '3.5.26', 5 'version' => '3.5.26.0', 6 'reference' => 'a5cb70738657e2a5362bebd56903e7b947f1c369', 7 7 'type' => 'wordpress-plugin', 8 8 'install_path' => __DIR__ . '/../../', … … 132 132 ), 133 133 'servebolt/servebolt-wp-optimize-plugin' => array( 134 'pretty_version' => '3.5.2 5',135 'version' => '3.5.2 5.0',136 'reference' => ' 988741b9cea3bd420ab654ceebe13375c8e627db',134 'pretty_version' => '3.5.26', 135 'version' => '3.5.26.0', 136 'reference' => 'a5cb70738657e2a5362bebd56903e7b947f1c369', 137 137 'type' => 'wordpress-plugin', 138 138 'install_path' => __DIR__ . '/../../',
Note: See TracChangeset
for help on using the changeset viewer.