aelia-currencyswitcher.cls.php
7 months ago
amp.cls.php
7 months ago
autoptimize.cls.php
7 months ago
avada.cls.php
7 months ago
bbpress.cls.php
7 months ago
beaver-builder.cls.php
7 months ago
caldera-forms.cls.php
7 months ago
divi-theme-builder.cls.php
7 months ago
elementor.cls.php
7 months ago
entry.inc.php
7 months ago
facetwp.cls.php
7 months ago
gravity-forms.cls.php
7 months ago
litespeed-check.cls.php
7 months ago
nextgengallery.cls.php
7 months ago
perfmatters.cls.php
7 months ago
theme-my-login.cls.php
7 months ago
user-switching.cls.php
7 months ago
wc-pdf-product-vouchers.cls.php
7 months ago
wcml.cls.php
7 months ago
woo-paypal.cls.php
7 months ago
woocommerce.cls.php
7 months ago
woocommerce.content.tpl.php
7 months ago
woocommerce.tab.tpl.php
7 months ago
wp-polls.cls.php
7 months ago
wp-postratings.cls.php
7 months ago
wpdiscuz.cls.php
7 months ago
wplister.cls.php
7 months ago
wpml.cls.php
7 months ago
wptouch.cls.php
7 months ago
yith-wishlist.cls.php
7 months ago
elementor.cls.php
57 lines
| 1 | <?php |
| 2 | // phpcs:ignoreFile |
| 3 | /** |
| 4 | * The Third Party integration with the bbPress plugin. |
| 5 | * |
| 6 | * @since 2.9.8.8 |
| 7 | */ |
| 8 | namespace LiteSpeed\Thirdparty; |
| 9 | |
| 10 | defined('WPINC') || exit(); |
| 11 | |
| 12 | use LiteSpeed\Debug2; |
| 13 | |
| 14 | class Elementor { |
| 15 | |
| 16 | public static function preload() { |
| 17 | if (!defined('ELEMENTOR_VERSION')) { |
| 18 | return; |
| 19 | } |
| 20 | |
| 21 | if (!is_admin()) { |
| 22 | // add_action( 'init', __CLASS__ . '::disable_litespeed_esi', 4 ); // temporarily comment out this line for backward compatibility |
| 23 | } |
| 24 | |
| 25 | if (isset($_GET['action']) && $_GET['action'] === 'elementor') { |
| 26 | do_action('litespeed_disable_all', 'elementor edit mode'); |
| 27 | } |
| 28 | |
| 29 | if (!empty($_SERVER['HTTP_REFERER']) && strpos($_SERVER['HTTP_REFERER'], 'action=elementor')) { |
| 30 | if (!empty($_REQUEST['actions'])) { |
| 31 | $json = json_decode(stripslashes($_REQUEST['actions']), true); |
| 32 | // Debug2::debug( '3rd Elementor', $json ); |
| 33 | if ( |
| 34 | !empty($json['save_builder']['action']) && |
| 35 | $json['save_builder']['action'] == 'save_builder' && |
| 36 | !empty($json['save_builder']['data']['status']) && |
| 37 | $json['save_builder']['data']['status'] == 'publish' |
| 38 | ) { |
| 39 | return; // Save post, don't disable all in case we will allow fire crawler right away after purged |
| 40 | } |
| 41 | } |
| 42 | do_action('litespeed_disable_all', 'elementor edit mode in HTTP_REFERER'); |
| 43 | } |
| 44 | |
| 45 | // Clear LSC cache on Elementor Regenerate CSS & Data |
| 46 | add_action('elementor/core/files/clear_cache', __CLASS__ . '::regenerate_litespeed_cache'); |
| 47 | } |
| 48 | |
| 49 | public static function disable_litespeed_esi() { |
| 50 | define('LITESPEED_ESI_OFF', true); |
| 51 | } |
| 52 | |
| 53 | public static function regenerate_litespeed_cache() { |
| 54 | do_action('litespeed_purge_all', 'Elementor - Regenerate CSS & Data'); |
| 55 | } |
| 56 | } |
| 57 |