jetpack
Last commit date
3rd-party
5 years ago
_inc
4 years ago
css
4 years ago
extensions
4 years ago
images
5 years ago
json-endpoints
4 years ago
modules
4 years ago
sal
5 years ago
src
5 years ago
vendor
4 years ago
views
5 years ago
CHANGELOG.md
4 years ago
LICENSE.txt
5 years ago
SECURITY.md
5 years ago
class-jetpack-connection-status.php
5 years ago
class-jetpack-pre-connection-jitms.php
5 years ago
class-jetpack-recommendations-banner.php
5 years ago
class-jetpack-wizard-banner.php
5 years ago
class-jetpack-xmlrpc-methods.php
5 years ago
class.frame-nonce-preview.php
6 years ago
class.jetpack-admin.php
5 years ago
class.jetpack-affiliate.php
6 years ago
class.jetpack-autoupdate.php
5 years ago
class.jetpack-bbpress-json-api.compat.php
5 years ago
class.jetpack-cli.php
5 years ago
class.jetpack-client-server.php
5 years ago
class.jetpack-connection-banner.php
5 years ago
class.jetpack-data.php
5 years ago
class.jetpack-gutenberg.php
5 years ago
class.jetpack-heartbeat.php
5 years ago
class.jetpack-idc.php
6 years ago
class.jetpack-ixr-client.php
5 years ago
class.jetpack-modules-list-table.php
5 years ago
class.jetpack-network-sites-list-table.php
5 years ago
class.jetpack-network.php
5 years ago
class.jetpack-plan.php
5 years ago
class.jetpack-post-images.php
5 years ago
class.jetpack-twitter-cards.php
5 years ago
class.jetpack-user-agent.php
5 years ago
class.jetpack.php
5 years ago
class.json-api-endpoints.php
5 years ago
class.json-api.php
5 years ago
class.photon.php
5 years ago
composer.json
4 years ago
functions.compat.php
5 years ago
functions.cookies.php
5 years ago
functions.gallery.php
6 years ago
functions.global.php
5 years ago
functions.opengraph.php
5 years ago
functions.photon.php
5 years ago
jest.config.js
5 years ago
jetpack.php
4 years ago
json-api-config.php
5 years ago
json-endpoints.php
7 years ago
load-jetpack.php
5 years ago
locales.php
7 years ago
readme.txt
4 years ago
require-lib.php
5 years ago
uninstall.php
5 years ago
wpml-config.xml
10 years ago
uninstall.php
53 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\Helper_Script_Manager; |
| 9 | use Automattic\Jetpack\Sync\Sender; |
| 10 | |
| 11 | /** |
| 12 | * Uninstall script for Jetpack. |
| 13 | */ |
| 14 | function jetpack_uninstall() { |
| 15 | if ( |
| 16 | ! defined( 'WP_UNINSTALL_PLUGIN' ) || |
| 17 | ! WP_UNINSTALL_PLUGIN || |
| 18 | dirname( WP_UNINSTALL_PLUGIN ) !== dirname( plugin_basename( __FILE__ ) ) |
| 19 | ) { |
| 20 | status_header( 404 ); |
| 21 | exit; |
| 22 | } |
| 23 | |
| 24 | if ( ! defined( 'JETPACK__PLUGIN_DIR' ) ) { |
| 25 | define( 'JETPACK__PLUGIN_DIR', plugin_dir_path( __FILE__ ) ); |
| 26 | } |
| 27 | |
| 28 | require JETPACK__PLUGIN_DIR . 'vendor/autoload_packages.php'; |
| 29 | |
| 30 | Jetpack_Options::delete_all_known_options(); |
| 31 | |
| 32 | // Delete all legacy options. |
| 33 | delete_option( 'jetpack_was_activated' ); |
| 34 | delete_option( 'jetpack_auto_installed' ); |
| 35 | delete_option( 'jetpack_register' ); |
| 36 | delete_transient( 'jetpack_register' ); |
| 37 | |
| 38 | // Delete sync options |
| 39 | // |
| 40 | // Do not initialize any listeners. |
| 41 | // Since all the files will be deleted. |
| 42 | // No need to try to sync anything. |
| 43 | add_filter( 'jetpack_sync_modules', '__return_empty_array', 100 ); |
| 44 | |
| 45 | // Jetpack Sync. |
| 46 | Sender::get_instance()->uninstall(); |
| 47 | |
| 48 | // Jetpack Backup: Cleanup any leftover Helper Scripts. |
| 49 | Helper_Script_Manager::delete_all_helper_scripts(); |
| 50 | } |
| 51 | |
| 52 | jetpack_uninstall(); |
| 53 |