| @@ -6,8 +6,12 @@ | ||
| 6 | 6 | */ |
| 7 | 7 | |
| 8 | 8 | use Automattic\Jetpack\Redirect; |
| 9 | 9 | |
| 10 | +if ( ! defined( 'ABSPATH' ) ) { | |
| 11 | + exit( 0 ); | |
| 12 | +} | |
| 13 | + | |
| 10 | 14 | /** |
| 11 | 15 | * Notify user that VaultPress has been disabled. Hide VaultPress notice that requested attention. |
| 12 | 16 | * |
| 13 | 17 | * @since 5.8 |
| @@ -17,32 +21,37 @@ | ||
| 17 | 21 | // such as admin_ajax, that could deactivate the plugin without showing this notification. |
| 18 | 22 | deactivate_plugins( 'vaultpress/vaultpress.php' ); |
| 19 | 23 | |
| 20 | 24 | // Remove WP core notice that says that the plugin was activated. |
| 21 | - unset( $_GET['activate'] ); // phpcs:ignore WordPress.Security.NonceVerification | |
| 25 | + unset( $_GET['activate'] ); | |
| 26 | + $message = sprintf( | |
| 27 | + wp_kses( | |
| 28 | + /* Translators: variable is the full URL to the new dashboard */ | |
| 29 | + __( '<p style="margin-bottom: 0.25em;"><strong>Jetpack is now handling your backups.</strong></p><p>VaultPress is no longer needed and has been deactivated. You can access your backups at <a href="%s" target="_blank" rel="noopener noreferrer">this dashboard</a>.</p>', 'jetpack' ), | |
| 30 | + array( | |
| 31 | + 'a' => array( | |
| 32 | + 'href' => array(), | |
| 33 | + 'target' => array(), | |
| 34 | + 'rel' => array(), | |
| 35 | + ), | |
| 36 | + 'p' => array( | |
| 37 | + 'style' => array(), | |
| 38 | + ), | |
| 39 | + 'strong' => array(), | |
| 40 | + ) | |
| 41 | + ), | |
| 42 | + esc_url( Redirect::get_url( 'calypso-backups' ) ) | |
| 43 | + ); | |
| 44 | + wp_admin_notice( | |
| 45 | + $message, | |
| 46 | + array( | |
| 47 | + 'type' => 'success', | |
| 48 | + 'dismissible' => true, | |
| 49 | + 'additional_classes' => array( 'vp-deactivated' ), | |
| 50 | + 'paragraph_wrap' => false, | |
| 51 | + ) | |
| 52 | + ); | |
| 22 | 53 | ?> |
| 23 | - <div class="notice notice-success is-dismissible vp-deactivated"> | |
| 24 | - <p style="margin-bottom: 0.25em;"><strong><?php esc_html_e( 'Jetpack is now handling your backups.', 'jetpack' ); ?></strong></p> | |
| 25 | - <p> | |
| 26 | - <?php esc_html_e( 'VaultPress is no longer needed and has been deactivated.', 'jetpack' ); ?> | |
| 27 | - <?php | |
| 28 | - printf( | |
| 29 | - wp_kses( | |
| 30 | - /* Translators: first variable is the full URL to the new dashboard */ | |
| 31 | - __( 'You can access your backups at <a href="%s" target="_blank" rel="noopener noreferrer">this dashboard</a>.', 'jetpack' ), | |
| 32 | - array( | |
| 33 | - 'a' => array( | |
| 34 | - 'href' => array(), | |
| 35 | - 'target' => array(), | |
| 36 | - 'rel' => array(), | |
| 37 | - ), | |
| 38 | - ) | |
| 39 | - ), | |
| 40 | - esc_url( Redirect::get_url( 'calypso-backups' ) ) | |
| 41 | - ); | |
| 42 | - ?> | |
| 43 | - </p> | |
| 44 | - </div> | |
| 45 | 54 | <style>#vp-notice{display:none;}</style> |
| 46 | 55 | <?php |
| 47 | 56 | } |
| 48 | 57 | |