| @@ -3,39 +3,45 @@ | ||
| 3 | 3 | * Plugin Name: Jetpack |
| 4 | 4 | * Plugin URI: https://jetpack.com |
| 5 | 5 | * Description: Security, performance, and marketing tools made by WordPress experts. Jetpack keeps your site protected so you can focus on more important things. |
| 6 | 6 | * Author: Automattic |
| 7 | - * Version: 12.8.3 | |
| 7 | + * Version: 16.2 | |
| 8 | 8 | * Author URI: https://jetpack.com |
| 9 | 9 | * License: GPL2+ |
| 10 | 10 | * Text Domain: jetpack |
| 11 | - * Requires at least: 6.2 | |
| 12 | - * Requires PHP: 5.6 | |
| 11 | + * Requires at least: 7.0 | |
| 12 | + * Requires PHP: 7.4 | |
| 13 | 13 | * |
| 14 | 14 | * @package automattic/jetpack |
| 15 | 15 | */ |
| 16 | 16 | |
| 17 | -use Automattic\Jetpack\Image_CDN\Image_CDN_Core; | |
| 18 | - | |
| 19 | 17 | /* |
| 20 | -This program is free software; you can redistribute it and/or | |
| 21 | -modify it under the terms of the GNU General Public License | |
| 22 | -as published by the Free Software Foundation; either version 2 | |
| 23 | -of the License, or (at your option) any later version. | |
| 18 | + * This program is free software; you can redistribute it and/or | |
| 19 | + * modify it under the terms of the GNU General Public License | |
| 20 | + * as published by the Free Software Foundation; either version 2 | |
| 21 | + * of the License, or (at your option) any later version. | |
| 22 | + * | |
| 23 | + * This program is distributed in the hope that it will be useful, | |
| 24 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 25 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| 26 | + * GNU General Public License for more details. | |
| 27 | + * | |
| 28 | + * You should have received a copy of the GNU General Public License | |
| 29 | + * along with this program; if not, see <https://www.gnu.org/licenses/>. | |
| 30 | + */ | |
| 24 | 31 | |
| 25 | -This program is distributed in the hope that it will be useful, | |
| 26 | -but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 27 | -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| 28 | -GNU General Public License for more details. | |
| 32 | +use Automattic\Jetpack\Image_CDN\Image_CDN_Core; | |
| 29 | 33 | |
| 30 | -You should have received a copy of the GNU General Public License | |
| 31 | -along with this program; if not, write to the Free Software | |
| 32 | -Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | |
| 33 | -*/ | |
| 34 | +if ( ! defined( 'ABSPATH' ) ) { | |
| 35 | + exit( 0 ); | |
| 36 | +} | |
| 34 | 37 | |
| 35 | -define( 'JETPACK__MINIMUM_WP_VERSION', '6.2' ); | |
| 36 | -define( 'JETPACK__MINIMUM_PHP_VERSION', '5.6' ); | |
| 37 | -define( 'JETPACK__VERSION', '12.8.3' ); | |
| 38 | +if ( ! defined( 'JETPACK__VERSION' ) ) { | |
| 39 | + // This breaks the project version checks when a one-liner. | |
| 40 | + define( 'JETPACK__VERSION', '16.2' ); | |
| 41 | +} | |
| 42 | +defined( 'JETPACK__MINIMUM_WP_VERSION' ) || define( 'JETPACK__MINIMUM_WP_VERSION', '7.0' ); | |
| 43 | +defined( 'JETPACK__MINIMUM_PHP_VERSION' ) || define( 'JETPACK__MINIMUM_PHP_VERSION', '7.4' ); | |
| 38 | 44 | |
| 39 | 45 | /** |
| 40 | 46 | * Constant used to fetch the connection owner token |
| 41 | 47 | * |
| @@ -41,15 +47,14 @@ | ||
| 41 | 47 | * |
| 42 | 48 | * @deprecated 9.0.0 |
| 43 | 49 | * @var boolean |
| 44 | 50 | */ |
| 45 | -define( 'JETPACK_MASTER_USER', true ); | |
| 51 | +defined( 'JETPACK_MASTER_USER' ) || define( 'JETPACK_MASTER_USER', true ); | |
| 46 | 52 | |
| 47 | -define( 'JETPACK__API_VERSION', 1 ); | |
| 48 | -define( 'JETPACK__PLUGIN_DIR', plugin_dir_path( __FILE__ ) ); | |
| 49 | -define( 'JETPACK__PLUGIN_FILE', __FILE__ ); | |
| 53 | +defined( 'JETPACK__API_VERSION' ) || define( 'JETPACK__API_VERSION', 1 ); | |
| 54 | +defined( 'JETPACK__PLUGIN_DIR' ) || define( 'JETPACK__PLUGIN_DIR', plugin_dir_path( __FILE__ ) ); | |
| 55 | +defined( 'JETPACK__PLUGIN_FILE' ) || define( 'JETPACK__PLUGIN_FILE', __FILE__ ); | |
| 50 | 56 | |
| 51 | -defined( 'JETPACK__RELEASE_POST_BLOG_SLUG' ) || define( 'JETPACK__RELEASE_POST_BLOG_SLUG', 'jetpackreleaseblog.wordpress.com' ); | |
| 52 | 57 | defined( 'JETPACK_CLIENT__AUTH_LOCATION' ) || define( 'JETPACK_CLIENT__AUTH_LOCATION', 'header' ); |
| 53 | 58 | |
| 54 | 59 | /** |
| 55 | 60 | * WP.com API no longer supports `http://` protocol. |
| @@ -155,8 +160,22 @@ | ||
| 155 | 160 | ) |
| 156 | 161 | ); |
| 157 | 162 | } |
| 158 | 163 | |
| 164 | + // Add a red bubble notification to My Jetpack if the installation is bad. | |
| 165 | + add_filter( | |
| 166 | + 'my_jetpack_red_bubble_notification_slugs', | |
| 167 | + function ( $slugs ) { | |
| 168 | + $slugs['jetpack-plugin-bad-installation'] = array( | |
| 169 | + 'data' => array( | |
| 170 | + 'plugin' => 'Jetpack', | |
| 171 | + ), | |
| 172 | + ); | |
| 173 | + | |
| 174 | + return $slugs; | |
| 175 | + } | |
| 176 | + ); | |
| 177 | + | |
| 159 | 178 | /** |
| 160 | 179 | * Outputs an admin notice for folks running Jetpack without having run composer install. |
| 161 | 180 | * |
| 162 | 181 | * @since 7.4.0 |
| @@ -161,31 +180,33 @@ | ||
| 161 | 180 | * |
| 162 | 181 | * @since 7.4.0 |
| 163 | 182 | */ |
| 164 | 183 | function jetpack_admin_missing_files() { |
| 165 | - ?> | |
| 166 | - <div class="notice notice-error is-dismissible"> | |
| 167 | - <p> | |
| 168 | - <?php | |
| 169 | - printf( | |
| 170 | - wp_kses( | |
| 171 | - /* translators: Placeholder is a link to a support document. */ | |
| 172 | - __( 'Your installation of Jetpack is incomplete. If you installed Jetpack from GitHub, please refer to <a href="%1$s" target="_blank" rel="noopener noreferrer">this document</a> to set up your development environment. Jetpack must have Composer dependencies installed and built via the build command: <code>jetpack build plugins/jetpack --with-deps</code>', 'jetpack' ), | |
| 173 | - array( | |
| 174 | - 'a' => array( | |
| 175 | - 'href' => array(), | |
| 176 | - 'rel' => array(), | |
| 177 | - 'target' => array(), | |
| 178 | - ), | |
| 179 | - 'code' => array(), | |
| 180 | - ) | |
| 184 | + if ( get_current_screen()->id !== 'plugins' ) { | |
| 185 | + return; | |
| 186 | + } | |
| 187 | + $message = sprintf( | |
| 188 | + wp_kses( | |
| 189 | + /* translators: Placeholder is a link to a support document. */ | |
| 190 | + __( 'Your installation of Jetpack is incomplete. If you installed Jetpack from GitHub, please refer to <a href="%1$s" target="_blank" rel="noopener noreferrer">this document</a> to set up your development environment. Jetpack must have Composer dependencies installed and built via the build command: <code>jetpack build plugins/jetpack --deps</code>', 'jetpack' ), | |
| 191 | + array( | |
| 192 | + 'a' => array( | |
| 193 | + 'href' => array(), | |
| 194 | + 'rel' => array(), | |
| 195 | + 'target' => array(), | |
| 181 | 196 | ), |
| 182 | - 'https://github.com/Automattic/jetpack/blob/trunk/docs/development-environment.md#building-your-project' | |
| 183 | - ); | |
| 184 | - ?> | |
| 185 | - </p> | |
| 186 | - </div> | |
| 187 | - <?php | |
| 197 | + 'code' => array(), | |
| 198 | + ) | |
| 199 | + ), | |
| 200 | + 'https://github.com/Automattic/jetpack/blob/trunk/docs/development-environment.md#building-your-project' | |
| 201 | + ); | |
| 202 | + wp_admin_notice( | |
| 203 | + $message, | |
| 204 | + array( | |
| 205 | + 'type' => 'error', | |
| 206 | + 'dismissible' => true, | |
| 207 | + ) | |
| 208 | + ); | |
| 188 | 209 | } |
| 189 | 210 | |
| 190 | 211 | add_action( 'admin_notices', 'jetpack_admin_missing_files' ); |
| 191 | 212 | return; |