Changeset 2830275
- Timestamp:
- 12/07/2022 09:06:14 PM (3 years ago)
- Location:
- wpblast
- Files:
-
- 8 added
- 2 deleted
- 16 edited
- 1 copied
-
tags/1.8.4 (copied) (copied from wpblast/trunk)
-
tags/1.8.4/changelog.txt (modified) (1 diff)
-
tags/1.8.4/inc/mu-plugins-functions.php (added)
-
tags/1.8.4/inc/third-party/advanced-cache.php (modified) (2 diffs)
-
tags/1.8.4/inc/third-party/index.php (modified) (1 diff)
-
tags/1.8.4/inc/third-party/nitropack (added)
-
tags/1.8.4/inc/third-party/nitropack/nitropack-functions.php (added)
-
tags/1.8.4/inc/third-party/wp-fastest-cache/wp-fastest-cache-functions.php (modified) (1 diff)
-
tags/1.8.4/inc/third-party/wp-rocket/wp-rocket-functions.php (modified) (2 diffs)
-
tags/1.8.4/plugin.php (modified) (3 diffs)
-
tags/1.8.4/readme.txt (modified) (2 diffs)
-
tags/1.8.4/src/Smartfire/Wordpress/WPBlast/AdvancedCache.php (deleted)
-
tags/1.8.4/src/Smartfire/Wordpress/WPBlast/Bootstrap.php (added)
-
tags/1.8.4/src/Smartfire/Wordpress/WPBlast/Settings.php (modified) (6 diffs)
-
trunk/changelog.txt (modified) (1 diff)
-
trunk/inc/mu-plugins-functions.php (added)
-
trunk/inc/third-party/advanced-cache.php (modified) (2 diffs)
-
trunk/inc/third-party/index.php (modified) (1 diff)
-
trunk/inc/third-party/nitropack (added)
-
trunk/inc/third-party/nitropack/nitropack-functions.php (added)
-
trunk/inc/third-party/wp-fastest-cache/wp-fastest-cache-functions.php (modified) (1 diff)
-
trunk/inc/third-party/wp-rocket/wp-rocket-functions.php (modified) (2 diffs)
-
trunk/plugin.php (modified) (3 diffs)
-
trunk/readme.txt (modified) (2 diffs)
-
trunk/src/Smartfire/Wordpress/WPBlast/AdvancedCache.php (deleted)
-
trunk/src/Smartfire/Wordpress/WPBlast/Bootstrap.php (added)
-
trunk/src/Smartfire/Wordpress/WPBlast/Settings.php (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
wpblast/tags/1.8.4/changelog.txt
r2816699 r2830275 1 1 == Changelog == 2 = 1.8.4 = 3 Release Date: December 7th, 2022 4 5 - Improve WP Rocket crawler management 6 - Improve Nitropack compatibility 7 - Fix error that could happened in crawler detection 8 2 9 = 1.8.3 = 3 10 Release Date: November 11th, 2022 -
wpblast/tags/1.8.4/inc/third-party/advanced-cache.php
r2807419 r2830275 1 1 <?php 2 2 3 use Smartfire\Wordpress\WPBlast\ AdvancedCache;3 use Smartfire\Wordpress\WPBlast\Bootstrap; 4 4 5 5 defined('ABSPATH') || exit; … … 7 7 require_once __DIR__ . '/../../globals.php'; 8 8 9 if (AdvancedCache::skip_advanced_cache()) { 9 if (!defined('WPBLAST_ADVANCED_CACHE')) { 10 define('WPBLAST_ADVANCED_CACHE', true); 11 } 12 13 if (Bootstrap::should_blast()) { 10 14 define('WPBLAST_SKIP_ADVANCED_CACHE', true); 11 15 } -
wpblast/tags/1.8.4/inc/third-party/index.php
r2816699 r2830275 8 8 require_once 'wp-super-cache/wp-super-cache-functions.php'; 9 9 require_once 'wp-fastest-cache/wp-fastest-cache-functions.php'; 10 require_once 'nitropack/nitropack-functions.php'; -
wpblast/tags/1.8.4/inc/third-party/wp-fastest-cache/wp-fastest-cache-functions.php
r2816699 r2830275 20 20 { 21 21 // Clear all the page cache to avoid having plugin serve static cache files 22 do_action( "wpfc_clear_all_cache");23 do_action( "wpfc_clear_all_site_cache");22 do_action('wpfc_clear_all_cache'); 23 do_action('wpfc_clear_all_site_cache'); 24 24 } 25 25 -
wpblast/tags/1.8.4/inc/third-party/wp-rocket/wp-rocket-functions.php
r2807381 r2830275 42 42 { 43 43 $wpblastCrawlers = apply_filters('wpblast_crawlers_list', []); 44 $wpblastCrawlers = array_map(function ($value) { 45 if (isset($value['pattern'])) { 46 if (strpos($value['pattern'], '^') !== 0) { 47 return '.*' . $value['pattern']; 48 } else { 49 return $value['pattern']; 50 } 51 } else { 52 return ''; 53 } 54 }, $wpblastCrawlers); 55 $wpblastCrawlers = array_filter($wpblastCrawlers, function ($value) { 56 return $value !== ''; 57 }); 44 58 return array_merge($ua, $wpblastCrawlers); 45 59 } … … 64 78 add_action('wpblast_deactivate', function () { 65 79 remove_filter('rocket_advanced_cache_file', 'wpblast_rocket_advanced_cache_file'); 80 remove_filter('rocket_cache_reject_ua', 'wpblast_rocket_user_agent_reject'); 66 81 wpblast_rocket_refresh(); 67 82 }); -
wpblast/tags/1.8.4/plugin.php
r2816699 r2830275 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. 37 * Version: 1.8.4 8 8 * Requires at least: 4.9 9 9 * Requires PHP: 5.6 … … 19 19 use Smartfire\Wordpress\WPBlast\Settings; 20 20 21 define('WPBLAST_DB_VERSION', '1.2.0'); 22 define('WPBLAST_PLUGIN_VERSION', '1.8.4'); 23 21 24 require_once 'globals.php'; 22 25 … … 24 27 require_once 'inc/roles-functions.php'; 25 28 require_once 'inc/rest-functions.php'; 29 require_once 'inc/mu-plugins-functions.php'; 26 30 require_once 'inc/third-party/index.php'; 27 28 define('WPBLAST_DB_VERSION', '1.2.0');29 define('WPBLAST_PLUGIN_VERSION', '1.8.3');30 31 31 32 add_action('admin_init', [new LinkPrerender($smartfire_wpblast_settings), 'adminInit']); -
wpblast/tags/1.8.4/readme.txt
r2816699 r2830275 5 5 Tested up to: 6.1 6 6 Requires PHP: 5.6 7 Stable tag: 1.8. 37 Stable tag: 1.8.4 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. 3=85 Release Date: November 11th, 202284 = 1.8.4 = 85 Release Date: December 7th, 2022 86 86 87 Fix bug that could happened with plugin WP Fastest Cache 87 - Improve WP Rocket crawler management 88 - Improve Nitropack compatibility 89 - Fix error that could happened in crawler detection -
wpblast/tags/1.8.4/src/Smartfire/Wordpress/WPBlast/Settings.php
r2816699 r2830275 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. 3';18 const WPBLAST_UA_PLUGIN = 'WP-BLAST-Bot-Plugin 1.8.4'; 19 19 20 20 private $menu_name = 'wpblast'; … … 30 30 private $crawlerRegexp = self::CRAWLER_DEFAULT_VALUE; 31 31 private $crawlerAutoRegexp; 32 private $crawlerListAuto; 32 33 private $crawlerCacheGen = 'WP-BLAST-Bot-CacheGen'; 33 34 private $crawlerUserRegexp = '(^.+@smartfire\\.pro$)'; … … 215 216 216 217 add_filter('wpblast_crawlers_list', function ($ua) { 217 array_push($ua, $this->getCrawlerCacheGen()); 218 array_push($ua, [ 219 'pattern' => $this->getCrawlerCacheGen(), 220 'type' => 'regexp', 221 ]); 218 222 $crawlerUserDefined = $this->getCrawlerRegexp(); 219 223 if ($crawlerUserDefined !== '') { 220 $crawlerUserDefinedArray = explode('|', $crawlerUserDefined); 221 foreach ($crawlerUserDefinedArray as $c) { 222 array_push($ua, $c); 223 } 224 } 225 $crawlerAuto = $this->getCrawlerAutoRegexp(); 226 if ($crawlerAuto !== '') { 227 $crawlerAutoArray = explode('|', $crawlerAuto); 228 foreach ($crawlerAutoArray as $c) { 229 array_push($ua, $c); 224 array_push($ua, [ 225 'pattern' => $crawlerUserDefined, 226 'type' => 'regexp', 227 ]); 228 } 229 $crawlerAuto = $this->getCrawlerListAuto(); 230 if (is_array($crawlerAuto) && count($crawlerAuto) > 0) { 231 foreach ($crawlerAuto as $c) { 232 if (isset($c['pattern']) && $c['pattern'] !== '') { 233 array_push($ua, [ 234 'pattern' => $c['pattern'], 235 'type' => 'regexp', 236 ]); 237 } 230 238 } 231 239 } … … 368 376 if (isset($res) && $res !== '') { 369 377 $res = json_decode($res, true); 370 if (isset($res['crawler Regexp']) && $res['crawlerRegexp'] !== '') {371 set_transient(self::PLUGIN_CACHE_PREFIX . '_autoregexp', $res['crawler Regexp'], $this->cacheCrawlerList);378 if (isset($res['crawlers']) && $res['crawlers'] !== '') { 379 set_transient(self::PLUGIN_CACHE_PREFIX . '_autoregexp', $res['crawlers'], $this->cacheCrawlerList); 372 380 373 381 do_action('wpblast_updated_crawler_list', $this->cacheCrawlerList, $this); 374 382 375 return $res['crawler Regexp'];383 return $res['crawlers']; 376 384 } else if (isset($res['error']) && isset($res['error']['type']) && $res['error']['type'] === 'not-found') { 377 385 set_transient(self::PLUGIN_CACHE_PREFIX . '_autoregexp', '', $this->cacheCrawlerList); … … 1775 1783 * @return string 1776 1784 */ 1785 public function getCrawlerListAuto($forceUpdate = false) 1786 { 1787 // update crawler list if needed 1788 if (!isset($this->crawlerListAuto) || $forceUpdate) { 1789 if ($forceUpdate) { 1790 $crawlerList = $this->updateCrawlerList(true); 1791 } else { 1792 $crawlerList = $this->updateCrawlerList(); 1793 } 1794 if (isset($crawlerList) && is_array($crawlerList)) { 1795 $this->crawlerListAuto = $crawlerList; 1796 } else { 1797 return ''; // in case of error 1798 } 1799 } 1800 return $this->crawlerListAuto; 1801 } 1802 1803 /** 1804 * @return string 1805 */ 1777 1806 public function getCrawlerAutoRegexp($forceUpdate = false) 1778 1807 { … … 1784 1813 $crawlerList = $this->updateCrawlerList(); 1785 1814 } 1786 if (isset($crawlerList)) { 1787 $this->crawlerAutoRegexp = $crawlerList; 1815 if (isset($crawlerList) && is_array($crawlerList)) { 1816 // Create a regexp from the list of crawlers regexp 1817 $arrayRegexpCrawlerList = array_map(function ($value) { 1818 return isset($value['pattern']) && $value['pattern'] !== '' ? $value['pattern'] : ''; 1819 }, $crawlerList); 1820 $arrayRegexpCrawlerList = array_filter($arrayRegexpCrawlerList, function ($value) { 1821 return $value !== ''; 1822 }); 1823 $this->crawlerAutoRegexp = implode('|', $arrayRegexpCrawlerList); 1788 1824 } else { 1789 1825 return ''; // in case of error -
wpblast/trunk/changelog.txt
r2816699 r2830275 1 1 == Changelog == 2 = 1.8.4 = 3 Release Date: December 7th, 2022 4 5 - Improve WP Rocket crawler management 6 - Improve Nitropack compatibility 7 - Fix error that could happened in crawler detection 8 2 9 = 1.8.3 = 3 10 Release Date: November 11th, 2022 -
wpblast/trunk/inc/third-party/advanced-cache.php
r2807419 r2830275 1 1 <?php 2 2 3 use Smartfire\Wordpress\WPBlast\ AdvancedCache;3 use Smartfire\Wordpress\WPBlast\Bootstrap; 4 4 5 5 defined('ABSPATH') || exit; … … 7 7 require_once __DIR__ . '/../../globals.php'; 8 8 9 if (AdvancedCache::skip_advanced_cache()) { 9 if (!defined('WPBLAST_ADVANCED_CACHE')) { 10 define('WPBLAST_ADVANCED_CACHE', true); 11 } 12 13 if (Bootstrap::should_blast()) { 10 14 define('WPBLAST_SKIP_ADVANCED_CACHE', true); 11 15 } -
wpblast/trunk/inc/third-party/index.php
r2816699 r2830275 8 8 require_once 'wp-super-cache/wp-super-cache-functions.php'; 9 9 require_once 'wp-fastest-cache/wp-fastest-cache-functions.php'; 10 require_once 'nitropack/nitropack-functions.php'; -
wpblast/trunk/inc/third-party/wp-fastest-cache/wp-fastest-cache-functions.php
r2816699 r2830275 20 20 { 21 21 // Clear all the page cache to avoid having plugin serve static cache files 22 do_action( "wpfc_clear_all_cache");23 do_action( "wpfc_clear_all_site_cache");22 do_action('wpfc_clear_all_cache'); 23 do_action('wpfc_clear_all_site_cache'); 24 24 } 25 25 -
wpblast/trunk/inc/third-party/wp-rocket/wp-rocket-functions.php
r2807381 r2830275 42 42 { 43 43 $wpblastCrawlers = apply_filters('wpblast_crawlers_list', []); 44 $wpblastCrawlers = array_map(function ($value) { 45 if (isset($value['pattern'])) { 46 if (strpos($value['pattern'], '^') !== 0) { 47 return '.*' . $value['pattern']; 48 } else { 49 return $value['pattern']; 50 } 51 } else { 52 return ''; 53 } 54 }, $wpblastCrawlers); 55 $wpblastCrawlers = array_filter($wpblastCrawlers, function ($value) { 56 return $value !== ''; 57 }); 44 58 return array_merge($ua, $wpblastCrawlers); 45 59 } … … 64 78 add_action('wpblast_deactivate', function () { 65 79 remove_filter('rocket_advanced_cache_file', 'wpblast_rocket_advanced_cache_file'); 80 remove_filter('rocket_cache_reject_ua', 'wpblast_rocket_user_agent_reject'); 66 81 wpblast_rocket_refresh(); 67 82 }); -
wpblast/trunk/plugin.php
r2816699 r2830275 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. 37 * Version: 1.8.4 8 8 * Requires at least: 4.9 9 9 * Requires PHP: 5.6 … … 19 19 use Smartfire\Wordpress\WPBlast\Settings; 20 20 21 define('WPBLAST_DB_VERSION', '1.2.0'); 22 define('WPBLAST_PLUGIN_VERSION', '1.8.4'); 23 21 24 require_once 'globals.php'; 22 25 … … 24 27 require_once 'inc/roles-functions.php'; 25 28 require_once 'inc/rest-functions.php'; 29 require_once 'inc/mu-plugins-functions.php'; 26 30 require_once 'inc/third-party/index.php'; 27 28 define('WPBLAST_DB_VERSION', '1.2.0');29 define('WPBLAST_PLUGIN_VERSION', '1.8.3');30 31 31 32 add_action('admin_init', [new LinkPrerender($smartfire_wpblast_settings), 'adminInit']); -
wpblast/trunk/readme.txt
r2816699 r2830275 5 5 Tested up to: 6.1 6 6 Requires PHP: 5.6 7 Stable tag: 1.8. 37 Stable tag: 1.8.4 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. 3=85 Release Date: November 11th, 202284 = 1.8.4 = 85 Release Date: December 7th, 2022 86 86 87 Fix bug that could happened with plugin WP Fastest Cache 87 - Improve WP Rocket crawler management 88 - Improve Nitropack compatibility 89 - Fix error that could happened in crawler detection -
wpblast/trunk/src/Smartfire/Wordpress/WPBlast/Settings.php
r2816699 r2830275 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. 3';18 const WPBLAST_UA_PLUGIN = 'WP-BLAST-Bot-Plugin 1.8.4'; 19 19 20 20 private $menu_name = 'wpblast'; … … 30 30 private $crawlerRegexp = self::CRAWLER_DEFAULT_VALUE; 31 31 private $crawlerAutoRegexp; 32 private $crawlerListAuto; 32 33 private $crawlerCacheGen = 'WP-BLAST-Bot-CacheGen'; 33 34 private $crawlerUserRegexp = '(^.+@smartfire\\.pro$)'; … … 215 216 216 217 add_filter('wpblast_crawlers_list', function ($ua) { 217 array_push($ua, $this->getCrawlerCacheGen()); 218 array_push($ua, [ 219 'pattern' => $this->getCrawlerCacheGen(), 220 'type' => 'regexp', 221 ]); 218 222 $crawlerUserDefined = $this->getCrawlerRegexp(); 219 223 if ($crawlerUserDefined !== '') { 220 $crawlerUserDefinedArray = explode('|', $crawlerUserDefined); 221 foreach ($crawlerUserDefinedArray as $c) { 222 array_push($ua, $c); 223 } 224 } 225 $crawlerAuto = $this->getCrawlerAutoRegexp(); 226 if ($crawlerAuto !== '') { 227 $crawlerAutoArray = explode('|', $crawlerAuto); 228 foreach ($crawlerAutoArray as $c) { 229 array_push($ua, $c); 224 array_push($ua, [ 225 'pattern' => $crawlerUserDefined, 226 'type' => 'regexp', 227 ]); 228 } 229 $crawlerAuto = $this->getCrawlerListAuto(); 230 if (is_array($crawlerAuto) && count($crawlerAuto) > 0) { 231 foreach ($crawlerAuto as $c) { 232 if (isset($c['pattern']) && $c['pattern'] !== '') { 233 array_push($ua, [ 234 'pattern' => $c['pattern'], 235 'type' => 'regexp', 236 ]); 237 } 230 238 } 231 239 } … … 368 376 if (isset($res) && $res !== '') { 369 377 $res = json_decode($res, true); 370 if (isset($res['crawler Regexp']) && $res['crawlerRegexp'] !== '') {371 set_transient(self::PLUGIN_CACHE_PREFIX . '_autoregexp', $res['crawler Regexp'], $this->cacheCrawlerList);378 if (isset($res['crawlers']) && $res['crawlers'] !== '') { 379 set_transient(self::PLUGIN_CACHE_PREFIX . '_autoregexp', $res['crawlers'], $this->cacheCrawlerList); 372 380 373 381 do_action('wpblast_updated_crawler_list', $this->cacheCrawlerList, $this); 374 382 375 return $res['crawler Regexp'];383 return $res['crawlers']; 376 384 } else if (isset($res['error']) && isset($res['error']['type']) && $res['error']['type'] === 'not-found') { 377 385 set_transient(self::PLUGIN_CACHE_PREFIX . '_autoregexp', '', $this->cacheCrawlerList); … … 1775 1783 * @return string 1776 1784 */ 1785 public function getCrawlerListAuto($forceUpdate = false) 1786 { 1787 // update crawler list if needed 1788 if (!isset($this->crawlerListAuto) || $forceUpdate) { 1789 if ($forceUpdate) { 1790 $crawlerList = $this->updateCrawlerList(true); 1791 } else { 1792 $crawlerList = $this->updateCrawlerList(); 1793 } 1794 if (isset($crawlerList) && is_array($crawlerList)) { 1795 $this->crawlerListAuto = $crawlerList; 1796 } else { 1797 return ''; // in case of error 1798 } 1799 } 1800 return $this->crawlerListAuto; 1801 } 1802 1803 /** 1804 * @return string 1805 */ 1777 1806 public function getCrawlerAutoRegexp($forceUpdate = false) 1778 1807 { … … 1784 1813 $crawlerList = $this->updateCrawlerList(); 1785 1814 } 1786 if (isset($crawlerList)) { 1787 $this->crawlerAutoRegexp = $crawlerList; 1815 if (isset($crawlerList) && is_array($crawlerList)) { 1816 // Create a regexp from the list of crawlers regexp 1817 $arrayRegexpCrawlerList = array_map(function ($value) { 1818 return isset($value['pattern']) && $value['pattern'] !== '' ? $value['pattern'] : ''; 1819 }, $crawlerList); 1820 $arrayRegexpCrawlerList = array_filter($arrayRegexpCrawlerList, function ($value) { 1821 return $value !== ''; 1822 }); 1823 $this->crawlerAutoRegexp = implode('|', $arrayRegexpCrawlerList); 1788 1824 } else { 1789 1825 return ''; // in case of error
Note: See TracChangeset
for help on using the changeset viewer.