PluginProbe
Elementor Website Builder – more than just a page builder / 3.10.0-dev1
Elementor Website Builder – more than just a page builder v3.10.0-dev1
4.3.0-beta2 4.3.0-beta1 4.2.4 4.2.3 4.2.2 4.2.1 4.2.0 4.1.5 4.2.0-beta2 4.2.0-dev2 4.2.0-beta1 4.1.4 4.1.3 4.1.2 4.1.1 4.1.0 4.1.0-beta3 4.1.0-dev3 4.0.9 4.1.0-beta2 4.1.0-dev2 4.0.8 4.1.0-beta1 4.1.0-dev1 4.0.7 All 451 releases
← All changes | modules/performance-lab/module.php +16 -2 4.2.0-dev23.10.0-dev1 View file →
@@ -4,9 +4,9 @@
4 4 use Elementor\Core\Base\Module as BaseModule;
5 5 use Elementor\Plugin;
6 6
7 7 if ( ! defined( 'ABSPATH' ) ) {
8 - exit; // Exit if accessed directly.
8 + exit; // Exit if accessed directly
9 9 }
10 10
11 11 class Module extends BaseModule {
12 12
@@ -27,9 +27,9 @@
27 27 }
28 28 return false;
29 29 }
30 30
31 - private function performance_lab_get_webp_src( $attachment_id, $size, $url ) {
31 + private function performance_lab_get_webp_src( $attachment_id, $size = 'full', $url ) {
32 32 $image_object = wp_get_attachment_image_src( $attachment_id, $size );
33 33 $image_src = call_user_func( self::PERFORMANCE_LAB_FUNCTION_NAME, $image_object[0], 'webp', $attachment_id );
34 34 if ( ! empty( $image_src ) ) {
35 35 return $image_src;
@@ -50,7 +50,21 @@
50 50 if ( $this->is_performance_lab_is_active() ) {
51 51 add_filter( 'elementor/files/css/property', function( $value, $css_property, $matches ) {
52 52 return $this->replace_css_with_webp( $value, $css_property, $matches );
53 53 }, 10, 3 );
54 + }
55 +
56 + if ( is_admin() ) {
57 + add_action( 'activated_plugin', function( $plugin ) {
58 + if ( 'performance-lab/load.php' === $plugin ) {
59 + Plugin::$instance->files_manager->clear_cache();
60 + }
61 + } );
62 +
63 + add_action( 'deactivated_plugin', function( $plugin ) {
64 + if ( 'performance-lab/load.php' === $plugin ) {
65 + Plugin::$instance->files_manager->clear_cache();
66 + }
67 + } );
54 68 }
55 69 }
56 70 }