jetpack
Last commit date
3rd-party
2 years ago
_inc
1 year ago
css
1 year ago
extensions
1 year ago
images
1 year ago
jetpack_vendor
1 year ago
json-endpoints
1 year ago
modules
1 year ago
sal
1 year ago
src
1 year ago
vendor
1 year ago
views
2 years ago
CHANGELOG.md
1 year ago
LICENSE.txt
5 years ago
SECURITY.md
2 years ago
class-jetpack-connection-status.php
2 years ago
class-jetpack-gallery-settings.php
3 years ago
class-jetpack-pre-connection-jitms.php
2 years ago
class-jetpack-stats-dashboard-widget.php
2 years ago
class-jetpack-xmlrpc-methods.php
1 year ago
class.frame-nonce-preview.php
4 years ago
class.jetpack-admin.php
1 year ago
class.jetpack-affiliate.php
2 years ago
class.jetpack-autoupdate.php
2 years ago
class.jetpack-bbpress-json-api.compat.php
2 years ago
class.jetpack-cli.php
1 year ago
class.jetpack-client-server.php
2 years ago
class.jetpack-gutenberg.php
1 year ago
class.jetpack-heartbeat.php
2 years ago
class.jetpack-modules-list-table.php
2 years ago
class.jetpack-network-sites-list-table.php
2 years ago
class.jetpack-network.php
2 years ago
class.jetpack-plan.php
2 years ago
class.jetpack-post-images.php
1 year ago
class.jetpack-twitter-cards.php
2 years ago
class.jetpack-user-agent.php
2 years ago
class.jetpack.php
1 year ago
class.json-api-endpoints.php
2 years ago
class.json-api.php
2 years ago
class.photon.php
3 years ago
composer.json
1 year ago
enhanced-open-graph.php
3 years ago
functions.compat.php
2 years ago
functions.cookies.php
2 years ago
functions.global.php
1 year ago
functions.is-mobile.php
2 years ago
functions.opengraph.php
1 year ago
functions.photon.php
2 years ago
global.d.ts
1 year ago
jetpack.php
1 year ago
json-api-config.php
3 years ago
json-endpoints.php
2 years ago
load-jetpack.php
2 years ago
locales.php
4 years ago
readme.txt
1 year ago
uninstall.php
2 years ago
wpml-config.xml
3 years ago
uninstall.php
59 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Functionality that is executed when Jetpack is uninstalled via built-in WordPress commands. |
| 4 | * |
| 5 | * @package automattic/jetpack |
| 6 | */ |
| 7 | |
| 8 | use Automattic\Jetpack\Backup\V0004\Helper_Script_Manager; |
| 9 | use Automattic\Jetpack\Connection\Manager as Connection_Manager; |
| 10 | use Automattic\Jetpack\Sync\Sender; |
| 11 | |
| 12 | /** |
| 13 | * Uninstall script for Jetpack. |
| 14 | */ |
| 15 | function jetpack_uninstall() { |
| 16 | if ( |
| 17 | ! defined( 'WP_UNINSTALL_PLUGIN' ) || |
| 18 | ! WP_UNINSTALL_PLUGIN || |
| 19 | dirname( WP_UNINSTALL_PLUGIN ) !== dirname( plugin_basename( __FILE__ ) ) |
| 20 | ) { |
| 21 | status_header( 404 ); |
| 22 | exit; |
| 23 | } |
| 24 | |
| 25 | if ( ! defined( 'JETPACK__PLUGIN_DIR' ) ) { |
| 26 | define( 'JETPACK__PLUGIN_DIR', plugin_dir_path( __FILE__ ) ); |
| 27 | } |
| 28 | |
| 29 | require JETPACK__PLUGIN_DIR . 'vendor/autoload_packages.php'; |
| 30 | |
| 31 | if ( method_exists( Connection_Manager::class, 'is_ready_for_cleanup' ) && ! Connection_Manager::is_ready_for_cleanup( dirname( plugin_basename( __FILE__ ) ) ) ) { |
| 32 | // There are other active Jetpack plugins, no need for cleanup. |
| 33 | return; |
| 34 | } |
| 35 | |
| 36 | Jetpack_Options::delete_all_known_options(); |
| 37 | |
| 38 | // Delete all legacy options. |
| 39 | delete_option( 'jetpack_was_activated' ); |
| 40 | delete_option( 'jetpack_auto_installed' ); |
| 41 | delete_option( 'jetpack_register' ); |
| 42 | delete_transient( 'jetpack_register' ); |
| 43 | |
| 44 | // Delete sync options |
| 45 | // |
| 46 | // Do not initialize any listeners. |
| 47 | // Since all the files will be deleted. |
| 48 | // No need to try to sync anything. |
| 49 | add_filter( 'jetpack_sync_modules', '__return_empty_array', 100 ); |
| 50 | |
| 51 | // Jetpack Sync. |
| 52 | Sender::get_instance()->uninstall(); |
| 53 | |
| 54 | // Jetpack Backup: Cleanup any leftover Helper Scripts. |
| 55 | Helper_Script_Manager::delete_all_helper_scripts(); |
| 56 | } |
| 57 | |
| 58 | jetpack_uninstall(); |
| 59 |