Plugin Directory

Changeset 2874671


Ignore:
Timestamp:
03/04/2023 12:05:55 PM (3 years ago)
Author:
wpblast
Message:

Release 1.x.x

Location:
wpblast
Files:
10 edited
1 copied

Legend:

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

    r2852021 r2874671  
    11== Changelog ==
     2= 1.8.6 =
     3Release Date: March 4th, 2023
     4
     5- Add ability to inject or not css in wpblast cache
     6
    27= 1.8.5 =
    38Release Date: December 13th, 2022
  • wpblast/tags/1.8.6/plugin.php

    r2852021 r2874671  
    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.5
     7 * Version: 1.8.6
    88 * Requires at least: 4.9
    99 * Requires PHP: 5.6
     
    2020
    2121define('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');
     22define('WPBLAST_PLUGIN_VERSION', '1.8.6');
    2323
    2424require 'globals.php';
  • wpblast/tags/1.8.6/readme.txt

    r2852021 r2874671  
    55Tested up to: 6.1
    66Requires PHP: 5.6
    7 Stable tag: 1.8.5
     7Stable tag: 1.8.6
    88License: Apache 2.0
    99License URI: http://www.apache.org/licenses/LICENSE-2.0
     
    8282
    8383== Changelog ==
    84 = 1.8.5 =
    85 Release Date: December 13th, 2022
     84= 1.8.6 =
     85Release Date: March 4th, 2023
    8686
    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  
    1717    private $withScroll = true;
    1818    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)
    2122    {
    2223        $this->static = $static;
    2324        $this->withScroll = $withScroll;
    2425        $this->withImages = $withImages;
     26        $this->injectCss = $injectCss;
    2527        $this->settings = $settings;
    2628    }
     
    147149        }
    148150
     151        if ($this->settings->shouldInjectCss()) {
     152            $this->injectCss = true;
     153        } else {
     154            $this->injectCss = false;
     155        }
     156
    149157        $allow = apply_filters('wpblast_render_should_render', true, [
    150158            'static' => $this->static,
     
    152160            'withScroll' => $this->withScroll,
    153161            'withImages' => $this->withImages,
     162            'injectCss' => $this->injectCss,
    154163        ]);
    155164
     
    170179    {
    171180        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);
    173182        } catch (\Throwable $e) {
    174183            header('HTTP/1.1 500 Internal Server Error');
     
    182191    }
    183192
    184     public function hashKey($body, $static, $userId, $url, $withScroll, $withImages)
     193    public function hashKey($body, $static, $userId, $url, $withScroll, $withImages, $injectCss)
    185194    {
    186195        global $wp;
     
    202211            'withScroll' => $withScroll,
    203212            'withImages' => $withImages,
     213            'injectCss' => $injectCss,
    204214            'current_user_id' => $userId,
    205215            'posts' => $posts,
     
    295305     * This is executed after wp has shutdown
    296306     */
    297     public function renderFor($url, $body, $static, $withScroll, $withImages)
     307    public function renderFor($url, $body, $static, $withScroll, $withImages, $injectCss)
    298308    {
    299309        try {
    300310            $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);
    302312            $hash = $hashCompute['hash'];
    303313            $isValidForceGeneration = $this->isValidForceGeneration($hashCompute, $body);
     
    356366            }
    357367            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);
    359369                $hashUser = $hashComputeUser['hash'];
    360370                $cachedUser = $this->getCacheItem($hashUser);
     
    376386                return $cached;
    377387            }
    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);
    381391            if ($expire === 0) {
    382392                $expire = 1; // Disable default no expiration feature of wordpress by setting 0
     
    457467    }
    458468
    459     public function blast($url, $body, $static, $withScroll, $withImages, $hash)
     469    public function blast($url, $body, $static, $withScroll, $withImages, $injectCss, $hash)
    460470    {
    461471        $array_merge = array_merge(
     
    483493                'withScroll' => $withScroll,
    484494                'withImages' => $withImages,
     495                'injectCss' => $injectCss,
    485496                'hash' => $hash,
    486497                'plans' => $plans, // this is not used for plan check but only to flag a loose of sync of database
     
    531542     * @return mixed|void
    532543     */
    533     private function getExpiration($static, $withScroll, $withImages, $url, $body, $hash, $content)
     544    private function getExpiration($static, $withScroll, $withImages, $injectCss, $url, $body, $hash, $content)
    534545    {
    535546        return apply_filters(
     
    543554                'withScroll' => $withScroll,
    544555                'withImages' => $withImages,
     556                'injectCss' => $injectCss,
    545557            ],
    546558            $content
  • wpblast/tags/1.8.6/src/Smartfire/Wordpress/WPBlast/Settings.php

    r2852021 r2874671  
    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.5';
     18    const WPBLAST_UA_PLUGIN = 'WP-BLAST-Bot-Plugin 1.8.6';
    1919
    2020    private $menu_name = 'wpblast';
     
    4646    private $withImages = true;
    4747    private $withScroll = true;
     48    private $injectCss = false;
    4849    private $rootPluginFile = __DIR__ . '/../../../../plugin.php';
    4950    private $account;
     
    123124            'withImages',
    124125            'withScroll',
     126            'injectCss',
    125127        ];
    126128        $needPurgeCache = false;
     
    309311        $this->withImages = $this->api->get_option('withImages', 'wpblast_crawler', $this->withImages ? 'on' : '') === 'on';
    310312        $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';
    311314        $this->crawlerRegexp = $this->api->get_option('regex', 'wpblast_crawler', $this->crawlerRegexp);
    312315        $this->crawlerUserRegexp = $this->api->get_option('user_regex', 'wpblast_crawler', $this->crawlerUserRegexp);
     
    13041307                'type' => 'checkbox',
    13051308                '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' : '',
    13061316            ],
    13071317            [
     
    19861996    }
    19871997
     1998    public function shouldInjectCss()
     1999    {
     2000        return $this->injectCss;
     2001    }
     2002
    19882003    public function isWithImages()
    19892004    {
  • wpblast/trunk/changelog.txt

    r2852021 r2874671  
    11== Changelog ==
     2= 1.8.6 =
     3Release Date: March 4th, 2023
     4
     5- Add ability to inject or not css in wpblast cache
     6
    27= 1.8.5 =
    38Release Date: December 13th, 2022
  • wpblast/trunk/plugin.php

    r2852021 r2874671  
    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.5
     7 * Version: 1.8.6
    88 * Requires at least: 4.9
    99 * Requires PHP: 5.6
     
    2020
    2121define('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');
     22define('WPBLAST_PLUGIN_VERSION', '1.8.6');
    2323
    2424require 'globals.php';
  • wpblast/trunk/readme.txt

    r2852021 r2874671  
    55Tested up to: 6.1
    66Requires PHP: 5.6
    7 Stable tag: 1.8.5
     7Stable tag: 1.8.6
    88License: Apache 2.0
    99License URI: http://www.apache.org/licenses/LICENSE-2.0
     
    8282
    8383== Changelog ==
    84 = 1.8.5 =
    85 Release Date: December 13th, 2022
     84= 1.8.6 =
     85Release Date: March 4th, 2023
    8686
    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  
    1717    private $withScroll = true;
    1818    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)
    2122    {
    2223        $this->static = $static;
    2324        $this->withScroll = $withScroll;
    2425        $this->withImages = $withImages;
     26        $this->injectCss = $injectCss;
    2527        $this->settings = $settings;
    2628    }
     
    147149        }
    148150
     151        if ($this->settings->shouldInjectCss()) {
     152            $this->injectCss = true;
     153        } else {
     154            $this->injectCss = false;
     155        }
     156
    149157        $allow = apply_filters('wpblast_render_should_render', true, [
    150158            'static' => $this->static,
     
    152160            'withScroll' => $this->withScroll,
    153161            'withImages' => $this->withImages,
     162            'injectCss' => $this->injectCss,
    154163        ]);
    155164
     
    170179    {
    171180        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);
    173182        } catch (\Throwable $e) {
    174183            header('HTTP/1.1 500 Internal Server Error');
     
    182191    }
    183192
    184     public function hashKey($body, $static, $userId, $url, $withScroll, $withImages)
     193    public function hashKey($body, $static, $userId, $url, $withScroll, $withImages, $injectCss)
    185194    {
    186195        global $wp;
     
    202211            'withScroll' => $withScroll,
    203212            'withImages' => $withImages,
     213            'injectCss' => $injectCss,
    204214            'current_user_id' => $userId,
    205215            'posts' => $posts,
     
    295305     * This is executed after wp has shutdown
    296306     */
    297     public function renderFor($url, $body, $static, $withScroll, $withImages)
     307    public function renderFor($url, $body, $static, $withScroll, $withImages, $injectCss)
    298308    {
    299309        try {
    300310            $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);
    302312            $hash = $hashCompute['hash'];
    303313            $isValidForceGeneration = $this->isValidForceGeneration($hashCompute, $body);
     
    356366            }
    357367            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);
    359369                $hashUser = $hashComputeUser['hash'];
    360370                $cachedUser = $this->getCacheItem($hashUser);
     
    376386                return $cached;
    377387            }
    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);
    381391            if ($expire === 0) {
    382392                $expire = 1; // Disable default no expiration feature of wordpress by setting 0
     
    457467    }
    458468
    459     public function blast($url, $body, $static, $withScroll, $withImages, $hash)
     469    public function blast($url, $body, $static, $withScroll, $withImages, $injectCss, $hash)
    460470    {
    461471        $array_merge = array_merge(
     
    483493                'withScroll' => $withScroll,
    484494                'withImages' => $withImages,
     495                'injectCss' => $injectCss,
    485496                'hash' => $hash,
    486497                'plans' => $plans, // this is not used for plan check but only to flag a loose of sync of database
     
    531542     * @return mixed|void
    532543     */
    533     private function getExpiration($static, $withScroll, $withImages, $url, $body, $hash, $content)
     544    private function getExpiration($static, $withScroll, $withImages, $injectCss, $url, $body, $hash, $content)
    534545    {
    535546        return apply_filters(
     
    543554                'withScroll' => $withScroll,
    544555                'withImages' => $withImages,
     556                'injectCss' => $injectCss,
    545557            ],
    546558            $content
  • wpblast/trunk/src/Smartfire/Wordpress/WPBlast/Settings.php

    r2852021 r2874671  
    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.5';
     18    const WPBLAST_UA_PLUGIN = 'WP-BLAST-Bot-Plugin 1.8.6';
    1919
    2020    private $menu_name = 'wpblast';
     
    4646    private $withImages = true;
    4747    private $withScroll = true;
     48    private $injectCss = false;
    4849    private $rootPluginFile = __DIR__ . '/../../../../plugin.php';
    4950    private $account;
     
    123124            'withImages',
    124125            'withScroll',
     126            'injectCss',
    125127        ];
    126128        $needPurgeCache = false;
     
    309311        $this->withImages = $this->api->get_option('withImages', 'wpblast_crawler', $this->withImages ? 'on' : '') === 'on';
    310312        $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';
    311314        $this->crawlerRegexp = $this->api->get_option('regex', 'wpblast_crawler', $this->crawlerRegexp);
    312315        $this->crawlerUserRegexp = $this->api->get_option('user_regex', 'wpblast_crawler', $this->crawlerUserRegexp);
     
    13041307                'type' => 'checkbox',
    13051308                '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' : '',
    13061316            ],
    13071317            [
     
    19861996    }
    19871997
     1998    public function shouldInjectCss()
     1999    {
     2000        return $this->injectCss;
     2001    }
     2002
    19882003    public function isWithImages()
    19892004    {
Note: See TracChangeset for help on using the changeset viewer.