Plugin Directory

Changeset 2830275


Ignore:
Timestamp:
12/07/2022 09:06:14 PM (3 years ago)
Author:
wpblast
Message:

Release 1.8.4

Location:
wpblast
Files:
8 added
2 deleted
16 edited
1 copied

Legend:

Unmodified
Added
Removed
  • wpblast/tags/1.8.4/changelog.txt

    r2816699 r2830275  
    11== Changelog ==
     2= 1.8.4 =
     3Release 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
    29= 1.8.3 =
    310Release Date: November 11th, 2022
  • wpblast/tags/1.8.4/inc/third-party/advanced-cache.php

    r2807419 r2830275  
    11<?php
    22
    3 use Smartfire\Wordpress\WPBlast\AdvancedCache;
     3use Smartfire\Wordpress\WPBlast\Bootstrap;
    44
    55defined('ABSPATH') || exit;
     
    77require_once __DIR__ . '/../../globals.php';
    88
    9 if (AdvancedCache::skip_advanced_cache()) {
     9if (!defined('WPBLAST_ADVANCED_CACHE')) {
     10    define('WPBLAST_ADVANCED_CACHE', true);
     11}
     12
     13if (Bootstrap::should_blast()) {
    1014    define('WPBLAST_SKIP_ADVANCED_CACHE', true);
    1115}
  • wpblast/tags/1.8.4/inc/third-party/index.php

    r2816699 r2830275  
    88require_once 'wp-super-cache/wp-super-cache-functions.php';
    99require_once 'wp-fastest-cache/wp-fastest-cache-functions.php';
     10require_once 'nitropack/nitropack-functions.php';
  • wpblast/tags/1.8.4/inc/third-party/wp-fastest-cache/wp-fastest-cache-functions.php

    r2816699 r2830275  
    2020    {
    2121        // 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');
    2424    }
    2525
  • wpblast/tags/1.8.4/inc/third-party/wp-rocket/wp-rocket-functions.php

    r2807381 r2830275  
    4242    {
    4343        $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        });
    4458        return array_merge($ua, $wpblastCrawlers);
    4559    }
     
    6478    add_action('wpblast_deactivate', function () {
    6579        remove_filter('rocket_advanced_cache_file', 'wpblast_rocket_advanced_cache_file');
     80        remove_filter('rocket_cache_reject_ua', 'wpblast_rocket_user_agent_reject');
    6681        wpblast_rocket_refresh();
    6782    });
  • wpblast/tags/1.8.4/plugin.php

    r2816699 r2830275  
    55 * Plugin URI: https://www.wp-blast.com
    66 * 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.3
     7 * Version: 1.8.4
    88 * Requires at least: 4.9
    99 * Requires PHP: 5.6
     
    1919use Smartfire\Wordpress\WPBlast\Settings;
    2020
     21define('WPBLAST_DB_VERSION', '1.2.0');
     22define('WPBLAST_PLUGIN_VERSION', '1.8.4');
     23
    2124require_once 'globals.php';
    2225
     
    2427require_once 'inc/roles-functions.php';
    2528require_once 'inc/rest-functions.php';
     29require_once 'inc/mu-plugins-functions.php';
    2630require_once 'inc/third-party/index.php';
    27 
    28 define('WPBLAST_DB_VERSION', '1.2.0');
    29 define('WPBLAST_PLUGIN_VERSION', '1.8.3');
    3031
    3132add_action('admin_init', [new LinkPrerender($smartfire_wpblast_settings), 'adminInit']);
  • wpblast/tags/1.8.4/readme.txt

    r2816699 r2830275  
    55Tested up to: 6.1
    66Requires PHP: 5.6
    7 Stable tag: 1.8.3
     7Stable tag: 1.8.4
    88License: Apache 2.0
    99License URI: http://www.apache.org/licenses/LICENSE-2.0
     
    8282
    8383== Changelog ==
    84 = 1.8.3 =
    85 Release Date: November 11th, 2022
     84= 1.8.4 =
     85Release Date: December 7th, 2022
    8686
    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  
    1616    const PLUGIN_CACHE_PREFIX = 'wpblast_plugin';
    1717    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';
    1919
    2020    private $menu_name = 'wpblast';
     
    3030    private $crawlerRegexp = self::CRAWLER_DEFAULT_VALUE;
    3131    private $crawlerAutoRegexp;
     32    private $crawlerListAuto;
    3233    private $crawlerCacheGen = 'WP-BLAST-Bot-CacheGen';
    3334    private $crawlerUserRegexp = '(^.+@smartfire\\.pro$)';
     
    215216
    216217        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            ]);
    218222            $crawlerUserDefined = $this->getCrawlerRegexp();
    219223            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                    }
    230238                }
    231239            }
     
    368376            if (isset($res) && $res !== '') {
    369377                $res = json_decode($res, true);
    370                 if (isset($res['crawlerRegexp']) && $res['crawlerRegexp'] !== '') {
    371                     set_transient(self::PLUGIN_CACHE_PREFIX . '_autoregexp', $res['crawlerRegexp'], $this->cacheCrawlerList);
     378                if (isset($res['crawlers']) && $res['crawlers'] !== '') {
     379                    set_transient(self::PLUGIN_CACHE_PREFIX . '_autoregexp', $res['crawlers'], $this->cacheCrawlerList);
    372380
    373381                    do_action('wpblast_updated_crawler_list', $this->cacheCrawlerList, $this);
    374382
    375                     return $res['crawlerRegexp'];
     383                    return $res['crawlers'];
    376384                } else if (isset($res['error']) && isset($res['error']['type']) && $res['error']['type'] === 'not-found') {
    377385                    set_transient(self::PLUGIN_CACHE_PREFIX . '_autoregexp', '', $this->cacheCrawlerList);
     
    17751783     * @return string
    17761784     */
     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     */
    17771806    public function getCrawlerAutoRegexp($forceUpdate = false)
    17781807    {
     
    17841813                $crawlerList = $this->updateCrawlerList();
    17851814            }
    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);
    17881824            } else {
    17891825                return ''; // in case of error
  • wpblast/trunk/changelog.txt

    r2816699 r2830275  
    11== Changelog ==
     2= 1.8.4 =
     3Release 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
    29= 1.8.3 =
    310Release Date: November 11th, 2022
  • wpblast/trunk/inc/third-party/advanced-cache.php

    r2807419 r2830275  
    11<?php
    22
    3 use Smartfire\Wordpress\WPBlast\AdvancedCache;
     3use Smartfire\Wordpress\WPBlast\Bootstrap;
    44
    55defined('ABSPATH') || exit;
     
    77require_once __DIR__ . '/../../globals.php';
    88
    9 if (AdvancedCache::skip_advanced_cache()) {
     9if (!defined('WPBLAST_ADVANCED_CACHE')) {
     10    define('WPBLAST_ADVANCED_CACHE', true);
     11}
     12
     13if (Bootstrap::should_blast()) {
    1014    define('WPBLAST_SKIP_ADVANCED_CACHE', true);
    1115}
  • wpblast/trunk/inc/third-party/index.php

    r2816699 r2830275  
    88require_once 'wp-super-cache/wp-super-cache-functions.php';
    99require_once 'wp-fastest-cache/wp-fastest-cache-functions.php';
     10require_once 'nitropack/nitropack-functions.php';
  • wpblast/trunk/inc/third-party/wp-fastest-cache/wp-fastest-cache-functions.php

    r2816699 r2830275  
    2020    {
    2121        // 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');
    2424    }
    2525
  • wpblast/trunk/inc/third-party/wp-rocket/wp-rocket-functions.php

    r2807381 r2830275  
    4242    {
    4343        $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        });
    4458        return array_merge($ua, $wpblastCrawlers);
    4559    }
     
    6478    add_action('wpblast_deactivate', function () {
    6579        remove_filter('rocket_advanced_cache_file', 'wpblast_rocket_advanced_cache_file');
     80        remove_filter('rocket_cache_reject_ua', 'wpblast_rocket_user_agent_reject');
    6681        wpblast_rocket_refresh();
    6782    });
  • wpblast/trunk/plugin.php

    r2816699 r2830275  
    55 * Plugin URI: https://www.wp-blast.com
    66 * 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.3
     7 * Version: 1.8.4
    88 * Requires at least: 4.9
    99 * Requires PHP: 5.6
     
    1919use Smartfire\Wordpress\WPBlast\Settings;
    2020
     21define('WPBLAST_DB_VERSION', '1.2.0');
     22define('WPBLAST_PLUGIN_VERSION', '1.8.4');
     23
    2124require_once 'globals.php';
    2225
     
    2427require_once 'inc/roles-functions.php';
    2528require_once 'inc/rest-functions.php';
     29require_once 'inc/mu-plugins-functions.php';
    2630require_once 'inc/third-party/index.php';
    27 
    28 define('WPBLAST_DB_VERSION', '1.2.0');
    29 define('WPBLAST_PLUGIN_VERSION', '1.8.3');
    3031
    3132add_action('admin_init', [new LinkPrerender($smartfire_wpblast_settings), 'adminInit']);
  • wpblast/trunk/readme.txt

    r2816699 r2830275  
    55Tested up to: 6.1
    66Requires PHP: 5.6
    7 Stable tag: 1.8.3
     7Stable tag: 1.8.4
    88License: Apache 2.0
    99License URI: http://www.apache.org/licenses/LICENSE-2.0
     
    8282
    8383== Changelog ==
    84 = 1.8.3 =
    85 Release Date: November 11th, 2022
     84= 1.8.4 =
     85Release Date: December 7th, 2022
    8686
    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  
    1616    const PLUGIN_CACHE_PREFIX = 'wpblast_plugin';
    1717    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';
    1919
    2020    private $menu_name = 'wpblast';
     
    3030    private $crawlerRegexp = self::CRAWLER_DEFAULT_VALUE;
    3131    private $crawlerAutoRegexp;
     32    private $crawlerListAuto;
    3233    private $crawlerCacheGen = 'WP-BLAST-Bot-CacheGen';
    3334    private $crawlerUserRegexp = '(^.+@smartfire\\.pro$)';
     
    215216
    216217        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            ]);
    218222            $crawlerUserDefined = $this->getCrawlerRegexp();
    219223            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                    }
    230238                }
    231239            }
     
    368376            if (isset($res) && $res !== '') {
    369377                $res = json_decode($res, true);
    370                 if (isset($res['crawlerRegexp']) && $res['crawlerRegexp'] !== '') {
    371                     set_transient(self::PLUGIN_CACHE_PREFIX . '_autoregexp', $res['crawlerRegexp'], $this->cacheCrawlerList);
     378                if (isset($res['crawlers']) && $res['crawlers'] !== '') {
     379                    set_transient(self::PLUGIN_CACHE_PREFIX . '_autoregexp', $res['crawlers'], $this->cacheCrawlerList);
    372380
    373381                    do_action('wpblast_updated_crawler_list', $this->cacheCrawlerList, $this);
    374382
    375                     return $res['crawlerRegexp'];
     383                    return $res['crawlers'];
    376384                } else if (isset($res['error']) && isset($res['error']['type']) && $res['error']['type'] === 'not-found') {
    377385                    set_transient(self::PLUGIN_CACHE_PREFIX . '_autoregexp', '', $this->cacheCrawlerList);
     
    17751783     * @return string
    17761784     */
     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     */
    17771806    public function getCrawlerAutoRegexp($forceUpdate = false)
    17781807    {
     
    17841813                $crawlerList = $this->updateCrawlerList();
    17851814            }
    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);
    17881824            } else {
    17891825                return ''; // in case of error
Note: See TracChangeset for help on using the changeset viewer.