Changeset 2874671
- Timestamp:
- 03/04/2023 12:05:55 PM (3 years ago)
- Location:
- wpblast
- Files:
-
- 10 edited
- 1 copied
-
tags/1.8.6 (copied) (copied from wpblast/trunk)
-
tags/1.8.6/changelog.txt (modified) (1 diff)
-
tags/1.8.6/plugin.php (modified) (2 diffs)
-
tags/1.8.6/readme.txt (modified) (2 diffs)
-
tags/1.8.6/src/Smartfire/Wordpress/WPBlast/PageRender.php (modified) (13 diffs)
-
tags/1.8.6/src/Smartfire/Wordpress/WPBlast/Settings.php (modified) (6 diffs)
-
trunk/changelog.txt (modified) (1 diff)
-
trunk/plugin.php (modified) (2 diffs)
-
trunk/readme.txt (modified) (2 diffs)
-
trunk/src/Smartfire/Wordpress/WPBlast/PageRender.php (modified) (13 diffs)
-
trunk/src/Smartfire/Wordpress/WPBlast/Settings.php (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
wpblast/tags/1.8.6/changelog.txt
r2852021 r2874671 1 1 == Changelog == 2 = 1.8.6 = 3 Release Date: March 4th, 2023 4 5 - Add ability to inject or not css in wpblast cache 6 2 7 = 1.8.5 = 3 8 Release Date: December 13th, 2022 -
wpblast/tags/1.8.6/plugin.php
r2852021 r2874671 5 5 * Plugin URI: https://www.wp-blast.com 6 6 * Description: Improve your Wordpress SEO and performance by using dynamic rendering. Prerender your website and generate an easy-to-crawl website. 7 * Version: 1.8. 57 * Version: 1.8.6 8 8 * Requires at least: 4.9 9 9 * Requires PHP: 5.6 … … 20 20 21 21 define('WPBLAST_DB_VERSION', '1.2.1'); // This is used to upgrade database scheme or force cleanup caches and new crawl 22 define('WPBLAST_PLUGIN_VERSION', '1.8. 5');22 define('WPBLAST_PLUGIN_VERSION', '1.8.6'); 23 23 24 24 require 'globals.php'; -
wpblast/tags/1.8.6/readme.txt
r2852021 r2874671 5 5 Tested up to: 6.1 6 6 Requires PHP: 5.6 7 Stable tag: 1.8. 57 Stable tag: 1.8.6 8 8 License: Apache 2.0 9 9 License URI: http://www.apache.org/licenses/LICENSE-2.0 … … 82 82 83 83 == Changelog == 84 = 1.8. 5=85 Release Date: December 13th, 202284 = 1.8.6 = 85 Release Date: March 4th, 2023 86 86 87 - Improve performance on large websites 88 - Improve advanced-cache updates for nitropack and wp rocket 89 - Improve mu-plugins updates for nitropack 87 - Add ability to inject or not css in wpblast cache -
wpblast/tags/1.8.6/src/Smartfire/Wordpress/WPBlast/PageRender.php
r2852021 r2874671 17 17 private $withScroll = true; 18 18 private $withImages = true; 19 20 public function __construct($settings, $static = true, $withScroll = true, $withImages = true) 19 private $injectCss = false; 20 21 public function __construct($settings, $static = true, $withScroll = true, $withImages = true, $injectCss = false) 21 22 { 22 23 $this->static = $static; 23 24 $this->withScroll = $withScroll; 24 25 $this->withImages = $withImages; 26 $this->injectCss = $injectCss; 25 27 $this->settings = $settings; 26 28 } … … 147 149 } 148 150 151 if ($this->settings->shouldInjectCss()) { 152 $this->injectCss = true; 153 } else { 154 $this->injectCss = false; 155 } 156 149 157 $allow = apply_filters('wpblast_render_should_render', true, [ 150 158 'static' => $this->static, … … 152 160 'withScroll' => $this->withScroll, 153 161 'withImages' => $this->withImages, 162 'injectCss' => $this->injectCss, 154 163 ]); 155 164 … … 170 179 { 171 180 try { 172 return $this->renderFor($this->get_current_page_url(), $page, $this->static, $this->withScroll, $this->withImages );181 return $this->renderFor($this->get_current_page_url(), $page, $this->static, $this->withScroll, $this->withImages, $this->injectCss); 173 182 } catch (\Throwable $e) { 174 183 header('HTTP/1.1 500 Internal Server Error'); … … 182 191 } 183 192 184 public function hashKey($body, $static, $userId, $url, $withScroll, $withImages )193 public function hashKey($body, $static, $userId, $url, $withScroll, $withImages, $injectCss) 185 194 { 186 195 global $wp; … … 202 211 'withScroll' => $withScroll, 203 212 'withImages' => $withImages, 213 'injectCss' => $injectCss, 204 214 'current_user_id' => $userId, 205 215 'posts' => $posts, … … 295 305 * This is executed after wp has shutdown 296 306 */ 297 public function renderFor($url, $body, $static, $withScroll, $withImages )307 public function renderFor($url, $body, $static, $withScroll, $withImages, $injectCss) 298 308 { 299 309 try { 300 310 $userId = get_current_user_id(); 301 $hashCompute = $this->hashKey($body, $static, $userId, $url, $withScroll, $withImages );311 $hashCompute = $this->hashKey($body, $static, $userId, $url, $withScroll, $withImages, $injectCss); 302 312 $hash = $hashCompute['hash']; 303 313 $isValidForceGeneration = $this->isValidForceGeneration($hashCompute, $body); … … 356 366 } 357 367 if (isset($_GET[self::WPBLAST_CRAWLER]) && (!$isValidForceGeneration || ($isValidForceGeneration && !$isInGracePeriod))) { 358 $hashComputeUser = $this->hashKey($body, $static, 0, $url, $withScroll, $withImages );368 $hashComputeUser = $this->hashKey($body, $static, 0, $url, $withScroll, $withImages, $injectCss); 359 369 $hashUser = $hashComputeUser['hash']; 360 370 $cachedUser = $this->getCacheItem($hashUser); … … 376 386 return $cached; 377 387 } 378 $content = $this->blast($url, $body, $static, $withScroll, $withImages, $ hash);379 380 $expire = $this->getExpiration($static, $withScroll, $withImages, $ url, $body, $hash, $content);388 $content = $this->blast($url, $body, $static, $withScroll, $withImages, $injectCss, $hash); 389 390 $expire = $this->getExpiration($static, $withScroll, $withImages, $injectCss, $url, $body, $hash, $content); 381 391 if ($expire === 0) { 382 392 $expire = 1; // Disable default no expiration feature of wordpress by setting 0 … … 457 467 } 458 468 459 public function blast($url, $body, $static, $withScroll, $withImages, $ hash)469 public function blast($url, $body, $static, $withScroll, $withImages, $injectCss, $hash) 460 470 { 461 471 $array_merge = array_merge( … … 483 493 'withScroll' => $withScroll, 484 494 'withImages' => $withImages, 495 'injectCss' => $injectCss, 485 496 'hash' => $hash, 486 497 'plans' => $plans, // this is not used for plan check but only to flag a loose of sync of database … … 531 542 * @return mixed|void 532 543 */ 533 private function getExpiration($static, $withScroll, $withImages, $ url, $body, $hash, $content)544 private function getExpiration($static, $withScroll, $withImages, $injectCss, $url, $body, $hash, $content) 534 545 { 535 546 return apply_filters( … … 543 554 'withScroll' => $withScroll, 544 555 'withImages' => $withImages, 556 'injectCss' => $injectCss, 545 557 ], 546 558 $content -
wpblast/tags/1.8.6/src/Smartfire/Wordpress/WPBlast/Settings.php
r2852021 r2874671 16 16 const PLUGIN_CACHE_PREFIX = 'wpblast_plugin'; 17 17 const WPBLAST_SITEMAP_TABLE = 'wpblast_sitemap'; 18 const WPBLAST_UA_PLUGIN = 'WP-BLAST-Bot-Plugin 1.8. 5';18 const WPBLAST_UA_PLUGIN = 'WP-BLAST-Bot-Plugin 1.8.6'; 19 19 20 20 private $menu_name = 'wpblast'; … … 46 46 private $withImages = true; 47 47 private $withScroll = true; 48 private $injectCss = false; 48 49 private $rootPluginFile = __DIR__ . '/../../../../plugin.php'; 49 50 private $account; … … 123 124 'withImages', 124 125 'withScroll', 126 'injectCss', 125 127 ]; 126 128 $needPurgeCache = false; … … 309 311 $this->withImages = $this->api->get_option('withImages', 'wpblast_crawler', $this->withImages ? 'on' : '') === 'on'; 310 312 $this->withScroll = $this->api->get_option('withScroll', 'wpblast_crawler', $this->withScroll ? 'on' : '') === 'on'; 313 $this->injectCss = $this->api->get_option('injectCss', 'wpblast_crawler', $this->injectCss ? 'on' : '') === 'on'; 311 314 $this->crawlerRegexp = $this->api->get_option('regex', 'wpblast_crawler', $this->crawlerRegexp); 312 315 $this->crawlerUserRegexp = $this->api->get_option('user_regex', 'wpblast_crawler', $this->crawlerUserRegexp); … … 1304 1307 'type' => 'checkbox', 1305 1308 'default' => $this->withScroll ? 'on' : '', 1309 ], 1310 [ 1311 'name' => 'injectCss', 1312 'label' => __('CSS injection', 'wpblast'), 1313 'desc' => '<br/>' . __('WP Blast will inject css stylesheets inside your wpblast cache. If you have a few number of css, this could get you a better score. If you have big css stylesheets, this could impact your score negatively. Also, if enable, the space needed for cache in your database will be higher. Please use with caution. Default: disable.', 'wpblast'), 1314 'type' => 'checkbox', 1315 'default' => $this->injectCss ? 'on' : '', 1306 1316 ], 1307 1317 [ … … 1986 1996 } 1987 1997 1998 public function shouldInjectCss() 1999 { 2000 return $this->injectCss; 2001 } 2002 1988 2003 public function isWithImages() 1989 2004 { -
wpblast/trunk/changelog.txt
r2852021 r2874671 1 1 == Changelog == 2 = 1.8.6 = 3 Release Date: March 4th, 2023 4 5 - Add ability to inject or not css in wpblast cache 6 2 7 = 1.8.5 = 3 8 Release Date: December 13th, 2022 -
wpblast/trunk/plugin.php
r2852021 r2874671 5 5 * Plugin URI: https://www.wp-blast.com 6 6 * Description: Improve your Wordpress SEO and performance by using dynamic rendering. Prerender your website and generate an easy-to-crawl website. 7 * Version: 1.8. 57 * Version: 1.8.6 8 8 * Requires at least: 4.9 9 9 * Requires PHP: 5.6 … … 20 20 21 21 define('WPBLAST_DB_VERSION', '1.2.1'); // This is used to upgrade database scheme or force cleanup caches and new crawl 22 define('WPBLAST_PLUGIN_VERSION', '1.8. 5');22 define('WPBLAST_PLUGIN_VERSION', '1.8.6'); 23 23 24 24 require 'globals.php'; -
wpblast/trunk/readme.txt
r2852021 r2874671 5 5 Tested up to: 6.1 6 6 Requires PHP: 5.6 7 Stable tag: 1.8. 57 Stable tag: 1.8.6 8 8 License: Apache 2.0 9 9 License URI: http://www.apache.org/licenses/LICENSE-2.0 … … 82 82 83 83 == Changelog == 84 = 1.8. 5=85 Release Date: December 13th, 202284 = 1.8.6 = 85 Release Date: March 4th, 2023 86 86 87 - Improve performance on large websites 88 - Improve advanced-cache updates for nitropack and wp rocket 89 - Improve mu-plugins updates for nitropack 87 - Add ability to inject or not css in wpblast cache -
wpblast/trunk/src/Smartfire/Wordpress/WPBlast/PageRender.php
r2852021 r2874671 17 17 private $withScroll = true; 18 18 private $withImages = true; 19 20 public function __construct($settings, $static = true, $withScroll = true, $withImages = true) 19 private $injectCss = false; 20 21 public function __construct($settings, $static = true, $withScroll = true, $withImages = true, $injectCss = false) 21 22 { 22 23 $this->static = $static; 23 24 $this->withScroll = $withScroll; 24 25 $this->withImages = $withImages; 26 $this->injectCss = $injectCss; 25 27 $this->settings = $settings; 26 28 } … … 147 149 } 148 150 151 if ($this->settings->shouldInjectCss()) { 152 $this->injectCss = true; 153 } else { 154 $this->injectCss = false; 155 } 156 149 157 $allow = apply_filters('wpblast_render_should_render', true, [ 150 158 'static' => $this->static, … … 152 160 'withScroll' => $this->withScroll, 153 161 'withImages' => $this->withImages, 162 'injectCss' => $this->injectCss, 154 163 ]); 155 164 … … 170 179 { 171 180 try { 172 return $this->renderFor($this->get_current_page_url(), $page, $this->static, $this->withScroll, $this->withImages );181 return $this->renderFor($this->get_current_page_url(), $page, $this->static, $this->withScroll, $this->withImages, $this->injectCss); 173 182 } catch (\Throwable $e) { 174 183 header('HTTP/1.1 500 Internal Server Error'); … … 182 191 } 183 192 184 public function hashKey($body, $static, $userId, $url, $withScroll, $withImages )193 public function hashKey($body, $static, $userId, $url, $withScroll, $withImages, $injectCss) 185 194 { 186 195 global $wp; … … 202 211 'withScroll' => $withScroll, 203 212 'withImages' => $withImages, 213 'injectCss' => $injectCss, 204 214 'current_user_id' => $userId, 205 215 'posts' => $posts, … … 295 305 * This is executed after wp has shutdown 296 306 */ 297 public function renderFor($url, $body, $static, $withScroll, $withImages )307 public function renderFor($url, $body, $static, $withScroll, $withImages, $injectCss) 298 308 { 299 309 try { 300 310 $userId = get_current_user_id(); 301 $hashCompute = $this->hashKey($body, $static, $userId, $url, $withScroll, $withImages );311 $hashCompute = $this->hashKey($body, $static, $userId, $url, $withScroll, $withImages, $injectCss); 302 312 $hash = $hashCompute['hash']; 303 313 $isValidForceGeneration = $this->isValidForceGeneration($hashCompute, $body); … … 356 366 } 357 367 if (isset($_GET[self::WPBLAST_CRAWLER]) && (!$isValidForceGeneration || ($isValidForceGeneration && !$isInGracePeriod))) { 358 $hashComputeUser = $this->hashKey($body, $static, 0, $url, $withScroll, $withImages );368 $hashComputeUser = $this->hashKey($body, $static, 0, $url, $withScroll, $withImages, $injectCss); 359 369 $hashUser = $hashComputeUser['hash']; 360 370 $cachedUser = $this->getCacheItem($hashUser); … … 376 386 return $cached; 377 387 } 378 $content = $this->blast($url, $body, $static, $withScroll, $withImages, $ hash);379 380 $expire = $this->getExpiration($static, $withScroll, $withImages, $ url, $body, $hash, $content);388 $content = $this->blast($url, $body, $static, $withScroll, $withImages, $injectCss, $hash); 389 390 $expire = $this->getExpiration($static, $withScroll, $withImages, $injectCss, $url, $body, $hash, $content); 381 391 if ($expire === 0) { 382 392 $expire = 1; // Disable default no expiration feature of wordpress by setting 0 … … 457 467 } 458 468 459 public function blast($url, $body, $static, $withScroll, $withImages, $ hash)469 public function blast($url, $body, $static, $withScroll, $withImages, $injectCss, $hash) 460 470 { 461 471 $array_merge = array_merge( … … 483 493 'withScroll' => $withScroll, 484 494 'withImages' => $withImages, 495 'injectCss' => $injectCss, 485 496 'hash' => $hash, 486 497 'plans' => $plans, // this is not used for plan check but only to flag a loose of sync of database … … 531 542 * @return mixed|void 532 543 */ 533 private function getExpiration($static, $withScroll, $withImages, $ url, $body, $hash, $content)544 private function getExpiration($static, $withScroll, $withImages, $injectCss, $url, $body, $hash, $content) 534 545 { 535 546 return apply_filters( … … 543 554 'withScroll' => $withScroll, 544 555 'withImages' => $withImages, 556 'injectCss' => $injectCss, 545 557 ], 546 558 $content -
wpblast/trunk/src/Smartfire/Wordpress/WPBlast/Settings.php
r2852021 r2874671 16 16 const PLUGIN_CACHE_PREFIX = 'wpblast_plugin'; 17 17 const WPBLAST_SITEMAP_TABLE = 'wpblast_sitemap'; 18 const WPBLAST_UA_PLUGIN = 'WP-BLAST-Bot-Plugin 1.8. 5';18 const WPBLAST_UA_PLUGIN = 'WP-BLAST-Bot-Plugin 1.8.6'; 19 19 20 20 private $menu_name = 'wpblast'; … … 46 46 private $withImages = true; 47 47 private $withScroll = true; 48 private $injectCss = false; 48 49 private $rootPluginFile = __DIR__ . '/../../../../plugin.php'; 49 50 private $account; … … 123 124 'withImages', 124 125 'withScroll', 126 'injectCss', 125 127 ]; 126 128 $needPurgeCache = false; … … 309 311 $this->withImages = $this->api->get_option('withImages', 'wpblast_crawler', $this->withImages ? 'on' : '') === 'on'; 310 312 $this->withScroll = $this->api->get_option('withScroll', 'wpblast_crawler', $this->withScroll ? 'on' : '') === 'on'; 313 $this->injectCss = $this->api->get_option('injectCss', 'wpblast_crawler', $this->injectCss ? 'on' : '') === 'on'; 311 314 $this->crawlerRegexp = $this->api->get_option('regex', 'wpblast_crawler', $this->crawlerRegexp); 312 315 $this->crawlerUserRegexp = $this->api->get_option('user_regex', 'wpblast_crawler', $this->crawlerUserRegexp); … … 1304 1307 'type' => 'checkbox', 1305 1308 'default' => $this->withScroll ? 'on' : '', 1309 ], 1310 [ 1311 'name' => 'injectCss', 1312 'label' => __('CSS injection', 'wpblast'), 1313 'desc' => '<br/>' . __('WP Blast will inject css stylesheets inside your wpblast cache. If you have a few number of css, this could get you a better score. If you have big css stylesheets, this could impact your score negatively. Also, if enable, the space needed for cache in your database will be higher. Please use with caution. Default: disable.', 'wpblast'), 1314 'type' => 'checkbox', 1315 'default' => $this->injectCss ? 'on' : '', 1306 1316 ], 1307 1317 [ … … 1986 1996 } 1987 1997 1998 public function shouldInjectCss() 1999 { 2000 return $this->injectCss; 2001 } 2002 1988 2003 public function isWithImages() 1989 2004 {
Note: See TracChangeset
for help on using the changeset viewer.