PluginProbe
Jetpack – WP Security, Backup, Speed, & Growth / 16.3-a.5
Jetpack – WP Security, Backup, Speed, & Growth v16.3-a.5
16.3-a.5 16.3-a.7 16.3-a.3 16.3-a.1 16.2 16.2-beta 12.0.3 12.1.3 12.2.3 12.3.2 12.4.2 12.5.2 12.6.4 12.7.3 12.8.3 12.9.5 13.0.2 13.1.5 13.2.4 13.3.3 13.4.5 13.5.2 13.6.2 13.7.2 13.8.3 All 506 releases
← All changes | jetpack_vendor/automattic/jetpack-backup/src/class-initial-state.php +18 -4 12.3.2 → 16.3-a.5 View file →
@@ -4,12 +4,27 @@
4 4 *
5 5 * @package automattic/jetpack-backup-plugin
6 6 */
7 7
8 -namespace Automattic\Jetpack\Backup;
8 +// After changing this file, consider increasing the version number ("VXXX") in all the files using this namespace, in
9 +// order to ensure that the specific version of this file always get loaded. Otherwise, Jetpack autoloader might decide
10 +// to load an older/newer version of the class (if, for example, both the standalone and bundled versions of the plugin
11 +// are installed, or in some other cases).
12 +namespace Automattic\Jetpack\Backup\V0005;
9 13
10 14 use Automattic\Jetpack\Connection\Plugin_Storage as Connection_Plugin_Storage;
11 15 use Automattic\Jetpack\Status;
16 +use Jetpack_Options;
17 +use function add_action;
18 +use function admin_url;
19 +use function esc_url;
20 +use function esc_url_raw;
21 +use function get_bloginfo;
22 +use function get_site_url;
23 +use function plugins_url;
24 +use function rest_url;
25 +use function wp_create_nonce;
26 +use function wp_json_encode;
12 27
13 28 /**
14 29 * The React initial state.
15 30 */
@@ -30,9 +45,9 @@
30 45 'calypsoSlug' => ( new Status() )->get_site_suffix(),
31 46 ),
32 47 'connectedPlugins' => Connection_Plugin_Storage::get_all(),
33 48 'siteData' => array(
34 - 'id' => \Jetpack_Options::get_option( 'id' ),
49 + 'id' => Jetpack_Options::get_option( 'id' ),
35 50 'title' => get_bloginfo( 'name' ) ? get_bloginfo( 'name' ) : get_site_url(),
36 51 'adminUrl' => esc_url( admin_url() ),
37 52 ),
38 53 'assets' => array(
@@ -48,8 +63,7 @@
48 63 */
49 64 public function render() {
50 65 add_action( 'jetpack_use_iframe_authorization_flow', '__return_true' );
51 66
52 - return 'var JPBACKUP_INITIAL_STATE=JSON.parse(decodeURIComponent("' . rawurlencode( wp_json_encode( $this->get_data() ) ) . '"));';
67 + return 'var JPBACKUP_INITIAL_STATE=' . wp_json_encode( $this->get_data(), JSON_UNESCAPED_SLASHES | JSON_HEX_TAG | JSON_HEX_AMP ) . ';';
53 68 }
54 -
55 69 }