| @@ -1,11 +1,5 @@ | ||
| 1 | -<?php // phpcs:ignore WordPress.Files.FileName.InvalidClassFileName | |
| 2 | -/** | |
| 3 | - * Client = Plugin | |
| 4 | - * Client Server = API Methods the Plugin must respond to | |
| 5 | - * | |
| 6 | - * @package automattic/jetpack | |
| 7 | - */ | |
| 1 | +<?php | |
| 8 | 2 | |
| 9 | 3 | use Automattic\Jetpack\Connection\Webhooks; |
| 10 | 4 | |
| 11 | 5 | /** |
| @@ -62,15 +56,8 @@ | ||
| 62 | 56 | _deprecated_function( __METHOD__, 'jetpack-9.5.0', 'Automattic\\Jetpack\\Connection\\Webhooks::handle_authorize' ); |
| 63 | 57 | ( new Webhooks() )->handle_authorize(); |
| 64 | 58 | } |
| 65 | 59 | |
| 66 | - /** | |
| 67 | - * Deactivate a plugin. | |
| 68 | - * | |
| 69 | - * @param string $probable_file Expected plugin file. | |
| 70 | - * @param string $probable_title Expected plugin title. | |
| 71 | - * @return int 1 if a plugin was deactivated, 0 if not. | |
| 72 | - */ | |
| 73 | 60 | public static function deactivate_plugin( $probable_file, $probable_title ) { |
| 74 | 61 | include_once ABSPATH . 'wp-admin/includes/plugin.php'; |
| 75 | 62 | if ( is_plugin_active( $probable_file ) ) { |
| 76 | 63 | deactivate_plugins( $probable_file ); |
| @@ -79,9 +66,9 @@ | ||
| 79 | 66 | // If the plugin is not in the usual place, try looking through all active plugins. |
| 80 | 67 | $active_plugins = Jetpack::get_active_plugins(); |
| 81 | 68 | foreach ( $active_plugins as $plugin ) { |
| 82 | 69 | $data = get_plugin_data( WP_PLUGIN_DIR . '/' . $plugin ); |
| 83 | - if ( $data['Name'] === $probable_title ) { | |
| 70 | + if ( $data['Name'] == $probable_title ) { | |
| 84 | 71 | deactivate_plugins( $plugin ); |
| 85 | 72 | return 1; |
| 86 | 73 | } |
| 87 | 74 | } |
| @@ -90,10 +77,8 @@ | ||
| 90 | 77 | return 0; |
| 91 | 78 | } |
| 92 | 79 | |
| 93 | 80 | /** |
| 94 | - * Get the Jetpack instance. | |
| 95 | - * | |
| 96 | 81 | * @deprecated since Jetpack 9.5.0 |
| 97 | 82 | * @see Jetpack::init() |
| 98 | 83 | */ |
| 99 | 84 | public function get_jetpack() { |