| @@ -9,8 +9,12 @@ | ||
| 9 | 9 | |
| 10 | 10 | use Automattic\Jetpack\Constants; |
| 11 | 11 | use Automattic\Jetpack\Status\Host; |
| 12 | 12 | |
| 13 | +if ( ! defined( 'ABSPATH' ) ) { | |
| 14 | + exit( 0 ); | |
| 15 | +} | |
| 16 | + | |
| 13 | 17 | /** |
| 14 | 18 | * Handles suppressing development version notices on Atomic-hosted sites. |
| 15 | 19 | * |
| 16 | 20 | * @param bool $development_version Filterable value if this is a development version of Jetpack. |
| @@ -20,12 +24,9 @@ | ||
| 20 | 24 | function atomic_weekly_override( $development_version ) { |
| 21 | 25 | if ( ( new Host() )->is_atomic_platform() ) { |
| 22 | 26 | $haystack = Constants::get_constant( 'JETPACK__PLUGIN_DIR' ); |
| 23 | 27 | $needle = '/jetpack-dev/'; |
| 24 | - if ( | |
| 25 | - ( function_exists( 'str_ends_with' ) && str_ends_with( $haystack, $needle ) ) || // phpcs:ignore PHPCompatibility.FunctionUse.NewFunctions.str_ends_withFound | |
| 26 | - 0 === substr_compare( $haystack, $needle, -13 ) | |
| 27 | - ) { | |
| 28 | + if ( str_ends_with( $haystack, $needle ) ) { | |
| 28 | 29 | return $development_version; // Returns the default response if the active Jetpack version is from the beta plugin. |
| 29 | 30 | } |
| 30 | 31 | |
| 31 | 32 | $development_version = false; // Returns false for regular installs on Atomic. |