PluginProbe
Jetpack – WP Security, Backup, Speed, & Growth / 16.2
Jetpack – WP Security, Backup, Speed, & Growth v16.2
16.3-a.1 16.2 16.2-beta 12.0.3 12.1.3 12.2.3 12.3.2 12.4.2 12.5.2 12.6.4 12.7.3 12.8.3 12.9.5 13.0.2 13.1.5 13.2.4 13.3.3 13.4.5 13.5.2 13.6.2 13.7.2 13.8.3 13.9.2 14.0.1 14.1.1 All 503 releases
← All changes | uninstall.php +13 -2 12.7.316.2 View file →
@@ -4,11 +4,16 @@
4 4 *
5 5 * @package automattic/jetpack
6 6 */
7 7
8 -use Automattic\Jetpack\Backup\Helper_Script_Manager;
8 +use Automattic\Jetpack\Backup\V0005\Helper_Script_Manager;
9 +use Automattic\Jetpack\Connection\Manager as Connection_Manager;
9 10 use Automattic\Jetpack\Sync\Sender;
10 11
12 +if ( ! defined( 'ABSPATH' ) ) {
13 + exit( 0 );
14 +}
15 +
11 16 /**
12 17 * Uninstall script for Jetpack.
13 18 */
14 19 function jetpack_uninstall() {
@@ -14,12 +19,13 @@
14 19 function jetpack_uninstall() {
15 20 if (
16 21 ! defined( 'WP_UNINSTALL_PLUGIN' ) ||
17 22 ! WP_UNINSTALL_PLUGIN ||
23 + // @phan-suppress-next-line PhanTypeMismatchArgumentInternal -- If it's defined, it's a string: https://developer.wordpress.org/plugins/plugin-basics/uninstall-methods/#method-2-uninstall-php
18 24 dirname( WP_UNINSTALL_PLUGIN ) !== dirname( plugin_basename( __FILE__ ) )
19 25 ) {
20 26 status_header( 404 );
21 - exit;
27 + exit( 0 );
22 28 }
23 29
24 30 if ( ! defined( 'JETPACK__PLUGIN_DIR' ) ) {
25 31 define( 'JETPACK__PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
@@ -25,8 +31,13 @@
25 31 define( 'JETPACK__PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
26 32 }
27 33
28 34 require JETPACK__PLUGIN_DIR . 'vendor/autoload_packages.php';
35 +
36 + if ( method_exists( Connection_Manager::class, 'is_ready_for_cleanup' ) && ! Connection_Manager::is_ready_for_cleanup( dirname( plugin_basename( __FILE__ ) ) ) ) {
37 + // There are other active Jetpack plugins, no need for cleanup.
38 + return;
39 + }
29 40
30 41 Jetpack_Options::delete_all_known_options();
31 42
32 43 // Delete all legacy options.