| @@ -12,14 +12,13 @@ | ||
| 12 | 12 | // Prohibit direct script loading. |
| 13 | 13 | defined( 'ABSPATH' ) || die( 'No direct script access allowed!' ); |
| 14 | 14 | |
| 15 | 15 | /** |
| 16 | - * Check if the site is using WordPress 6.7 or newer. | |
| 17 | - * Do not use `wp_get_wp_version()` here, as it is only available since WP 6.7. | |
| 16 | + * Check if the site is using WordPress 6.2 or newer. | |
| 18 | 17 | */ |
| 19 | 18 | // Include an unmodified $wp_version. |
| 20 | -require ABSPATH . WPINC . '/version.php'; | |
| 21 | -if ( version_compare( str_replace( '-src', '', $wp_version ), '6.7', '<' ) ) { // @phpstan-ignore variable.undefined ($wp_version is a global variable, defined in the included file.) | |
| 19 | +require ABSPATH . WPINC . '/version.php'; // @phpstan-ignore require.fileNotFound (This is a WordPress core file that always exists.) | |
| 20 | +if ( version_compare( str_replace( '-src', '', $wp_version ), '6.2', '<' ) ) { // @phpstan-ignore variable.undefined ($wp_version is a global variable, defined in the included file.) | |
| 22 | 21 | /** |
| 23 | 22 | * Show an error notice to admins, if the installed version of WordPress is not supported. |
| 24 | 23 | * |
| 25 | 24 | * @since 2.2.0 |
| @@ -39,11 +38,11 @@ | ||
| 39 | 38 | <p style="font-size:14px"> |
| 40 | 39 | <strong> |
| 41 | 40 | <?php |
| 42 | 41 | if ( current_user_can( 'update_core' ) ) { |
| 43 | - printf( __( 'Please <a href="%1$s">update your WordPress installation</a> to at least version %2$s!', 'tablepress' ), esc_url( self_admin_url( 'update-core.php' ) ), '6.7' ); | |
| 42 | + printf( __( 'Please <a href="%1$s">update your WordPress installation</a> to at least version %2$s!', 'tablepress' ), esc_url( self_admin_url( 'update-core.php' ) ), '6.2' ); | |
| 44 | 43 | } else { |
| 45 | - printf( __( 'Please ask your site’s administrator to update WordPress to at least version %1$s!', 'tablepress' ), '6.7' ); | |
| 44 | + printf( __( 'Please ask your site’s administrator to update WordPress to at least version %1$s!', 'tablepress' ), '6.2' ); | |
| 46 | 45 | } |
| 47 | 46 | ?> |
| 48 | 47 | </strong> |
| 49 | 48 | </p> |
| @@ -58,9 +57,9 @@ | ||
| 58 | 57 | |
| 59 | 58 | /** |
| 60 | 59 | * Check if the server is running PHP 7.4 or newer. |
| 61 | 60 | */ |
| 62 | -if ( PHP_VERSION_ID < 70400 ) { // @phpstan-ignore smaller.alwaysFalse (PHPStan thinks that the Composer minimum version will always be fulfilled.) | |
| 61 | +if ( PHP_VERSION_ID < 70400 ) { | |
| 63 | 62 | /** |
| 64 | 63 | * Show an error notice to admins, if the installed version of PHP is not supported. |
| 65 | 64 | * |
| 66 | 65 | * @since 2.2.0 |
| @@ -87,7 +86,25 @@ | ||
| 87 | 86 | |
| 88 | 87 | // Exit TablePress early. |
| 89 | 88 | return false; |
| 90 | 89 | } |
| 90 | + | |
| 91 | +/** | |
| 92 | + * Turns off Elementor's element caching if used as the callback for the `pre_option_elementor_experiment-e_element_cache` filter hook. | |
| 93 | + * | |
| 94 | + * @since 3.0.0 | |
| 95 | + * | |
| 96 | + * @param string $value The value to return for the option. | |
| 97 | + * @param string $option The option name. | |
| 98 | + * @param string $default_value The default value for the option. | |
| 99 | + * @return string The value to return for the option. | |
| 100 | + */ | |
| 101 | +function tablepress_turn_off_elementor_element_caching( $value, /* string */ $option, $default_value ) /* No return type declaration, due to required PHP compatibility! */ { | |
| 102 | + // Don't use type hints in the function declaration, due to required PHP compatibility of this file! | |
| 103 | + return 'inactive'; | |
| 104 | +} | |
| 105 | + | |
| 106 | +// Turn off Elementor's Element Caching as it breaks the loading of CSS and JS files. | |
| 107 | +add_filter( 'pre_option_elementor_experiment-e_element_cache', 'tablepress_turn_off_elementor_element_caching', 10, 3 ); | |
| 91 | 108 | |
| 92 | 109 | // All environment checks passed. |
| 93 | 110 | return true; |