| 1 |
<?php |
| 2 |
|
| 3 |
namespace Yoast\WP\SEO\Conditionals; |
| 4 |
|
| 5 |
/** |
| 6 |
* Conditional that is only met when on deactivating Yoast SEO. |
| 7 |
*/ |
| 8 |
class Deactivating_Yoast_Seo_Conditional implements Conditional { |
| 9 |
|
| 10 |
/** |
| 11 |
* Returns whether this conditional is met. |
| 12 |
* |
| 13 |
* @return bool Whether the conditional is met. |
| 14 |
*/ |
| 15 |
public function is_met() { |
| 16 |
// phpcs:ignore WordPress.Security.NonceVerification -- We can't verify nonce since this might run from any user. |
| 17 |
if ( isset( $_GET['action'] ) && \sanitize_text_field( \wp_unslash( $_GET['action'] ) ) === 'deactivate' && isset( $_GET['plugin'] ) && \sanitize_text_field( \wp_unslash( $_GET['plugin'] === 'wordpress-seo/wp-seo.php' ) ) ) { |
| 18 |
return true; |
| 19 |
} |
| 20 |
|
| 21 |
return false; |
| 22 |
} |
| 23 |
} |
| 24 |
|