@@ -136,26 +136,26 @@ public static function get_initial_state() {
136
136
$ block_availability = Jetpack_Gutenberg::get_cached_availability ();
137
137
138
138
return array (
139
- 'WP_API_root ' => esc_url_raw ( rest_url () ),
140
- 'WP_API_nonce ' => wp_create_nonce ( 'wp_rest ' ),
141
- 'registrationNonce ' => wp_create_nonce ( 'jetpack-registration-nonce ' ),
142
- 'purchaseToken ' => self ::get_purchase_token (),
143
- 'partnerCoupon ' => Jetpack_Partner_Coupon::get_coupon (),
144
- 'pluginBaseUrl ' => plugins_url ( '' , JETPACK__PLUGIN_FILE ),
145
- 'connectionStatus ' => $ connection_status ,
146
- 'connectedPlugins ' => Connection_Plugin_Storage::get_all (),
147
- 'connectUrl ' => false == $ current_user_data ['isConnected ' ] // phpcs:ignore Universal.Operators.StrictComparisons.LooseEqual
139
+ 'WP_API_root ' => esc_url_raw ( rest_url () ),
140
+ 'WP_API_nonce ' => wp_create_nonce ( 'wp_rest ' ),
141
+ 'registrationNonce ' => wp_create_nonce ( 'jetpack-registration-nonce ' ),
142
+ 'purchaseToken ' => self ::get_purchase_token (),
143
+ 'partnerCoupon ' => Jetpack_Partner_Coupon::get_coupon (),
144
+ 'pluginBaseUrl ' => plugins_url ( '' , JETPACK__PLUGIN_FILE ),
145
+ 'connectionStatus ' => $ connection_status ,
146
+ 'connectedPlugins ' => Connection_Plugin_Storage::get_all (),
147
+ 'connectUrl ' => false == $ current_user_data ['isConnected ' ] // phpcs:ignore Universal.Operators.StrictComparisons.LooseEqual
148
148
? Jetpack::init ()->build_connect_url ( true , false , false )
149
149
: '' ,
150
- 'dismissedNotices ' => self ::get_dismissed_jetpack_notices (),
151
- 'isDevVersion ' => Jetpack::is_development_version (),
152
- 'currentVersion ' => JETPACK__VERSION ,
153
- 'is_gutenberg_available ' => true ,
154
- 'getModules ' => $ modules ,
155
- 'rawUrl ' => ( new Status () )->get_site_suffix (),
156
- 'adminUrl ' => esc_url ( admin_url () ),
157
- 'siteTitle ' => (string ) htmlspecialchars_decode ( get_option ( 'blogname ' ), ENT_QUOTES ),
158
- 'stats ' => array (
150
+ 'dismissedNotices ' => self ::get_dismissed_jetpack_notices (),
151
+ 'isDevVersion ' => Jetpack::is_development_version (),
152
+ 'currentVersion ' => JETPACK__VERSION ,
153
+ 'is_gutenberg_available ' => true ,
154
+ 'getModules ' => $ modules ,
155
+ 'rawUrl ' => ( new Status () )->get_site_suffix (),
156
+ 'adminUrl ' => esc_url ( admin_url () ),
157
+ 'siteTitle ' => (string ) htmlspecialchars_decode ( get_option ( 'blogname ' ), ENT_QUOTES ),
158
+ 'stats ' => array (
159
159
// data is populated asynchronously on page load.
160
160
'data ' => array (
161
161
'general ' => false ,
@@ -165,13 +165,13 @@ public static function get_initial_state() {
165
165
),
166
166
'roles ' => $ stats_roles ,
167
167
),
168
- 'aff ' => Partner::init ()->get_partner_code ( Partner::AFFILIATE_CODE ),
169
- 'partnerSubsidiaryId ' => Partner::init ()->get_partner_code ( Partner::SUBSIDIARY_CODE ),
170
- 'settings ' => self ::get_flattened_settings (),
171
- 'userData ' => array (
168
+ 'aff ' => Partner::init ()->get_partner_code ( Partner::AFFILIATE_CODE ),
169
+ 'partnerSubsidiaryId ' => Partner::init ()->get_partner_code ( Partner::SUBSIDIARY_CODE ),
170
+ 'settings ' => self ::get_flattened_settings (),
171
+ 'userData ' => array (
172
172
'currentUser ' => $ current_user_data ,
173
173
),
174
- 'siteData ' => array (
174
+ 'siteData ' => array (
175
175
'blog_id ' => Jetpack_Options::get_option ( 'id ' , 0 ),
176
176
'icon ' => has_site_icon ()
177
177
? apply_filters ( 'jetpack_photon_url ' , get_site_icon_url (), array ( 'w ' => 64 ) )
@@ -199,7 +199,7 @@ public static function get_initial_state() {
199
199
'isSharingBlockAvailable ' => (bool ) isset ( $ block_availability ['sharing-buttons ' ] )
200
200
&& $ block_availability ['sharing-buttons ' ]['available ' ],
201
201
),
202
- 'themeData ' => array (
202
+ 'themeData ' => array (
203
203
'name ' => $ current_theme ->get ( 'Name ' ),
204
204
'stylesheet ' => $ current_theme ->get_stylesheet (),
205
205
'hasUpdate ' => (bool ) get_theme_update_available ( $ current_theme ),
@@ -211,42 +211,43 @@ public static function get_initial_state() {
211
211
&& ( function_exists ( 'wp_register_webfont_provider ' ) || function_exists ( 'wp_register_webfonts ' ) ),
212
212
),
213
213
),
214
- 'jetpackStateNotices ' => array (
214
+ 'jetpackStateNotices ' => array (
215
215
'messageCode ' => Jetpack::state ( 'message ' ),
216
216
'errorCode ' => Jetpack::state ( 'error ' ),
217
217
'errorDescription ' => Jetpack::state ( 'error_description ' ),
218
218
'messageContent ' => Jetpack::state ( 'display_update_modal ' ) ? self ::get_update_modal_data () : null ,
219
219
),
220
- 'tracksUserData ' => Jetpack_Tracks_Client::get_connected_user_tracks_identity (),
221
- 'currentIp ' => IP_Utils::get_ip (),
222
- 'lastPostUrl ' => esc_url ( $ last_post ),
223
- 'externalServicesConnectUrls ' => self ::get_external_services_connect_urls (),
224
- 'calypsoEnv ' => ( new Host () )->get_calypso_env (),
225
- 'products ' => Jetpack::get_products_for_purchase (),
226
- 'recommendationsStep ' => Jetpack_Core_Json_Api_Endpoints::get_recommendations_step ()['step ' ],
227
- 'isSafari ' => $ is_safari || User_Agent_Info::is_opera_desktop (), // @todo Rename isSafari everywhere.
228
- 'doNotUseConnectionIframe ' => Constants::is_true ( 'JETPACK_SHOULD_NOT_USE_CONNECTION_IFRAME ' ),
229
- 'licensing ' => array (
220
+ 'tracksUserData ' => Jetpack_Tracks_Client::get_connected_user_tracks_identity (),
221
+ 'currentIp ' => IP_Utils::get_ip (),
222
+ 'lastPostUrl ' => esc_url ( $ last_post ),
223
+ 'externalServicesConnectUrls ' => self ::get_external_services_connect_urls (),
224
+ 'calypsoEnv ' => ( new Host () )->get_calypso_env (),
225
+ 'products ' => Jetpack::get_products_for_purchase (),
226
+ 'recommendationsStep ' => Jetpack_Core_Json_Api_Endpoints::get_recommendations_step ()['step ' ],
227
+ 'isSafari ' => $ is_safari || User_Agent_Info::is_opera_desktop (), // @todo Rename isSafari everywhere.
228
+ 'doNotUseConnectionIframe ' => Constants::is_true ( 'JETPACK_SHOULD_NOT_USE_CONNECTION_IFRAME ' ),
229
+ 'licensing ' => array (
230
230
'error ' => Licensing::instance ()->last_error (),
231
231
'showLicensingUi ' => Licensing::instance ()->is_licensing_input_enabled (),
232
232
'userCounts ' => Licensing_Endpoints::get_user_license_counts (),
233
233
'activationNoticeDismiss ' => Licensing::instance ()->get_license_activation_notice_dismiss (),
234
234
),
235
- 'jetpackManage ' => array (
235
+ 'jetpackManage ' => array (
236
236
'isEnabled ' => Jetpack_Manage::could_use_jp_manage (),
237
237
'isAgencyAccount ' => Jetpack_Manage::is_agency_account (),
238
238
),
239
- 'hasSeenWCConnectionModal ' => Jetpack_Options::get_option ( 'has_seen_wc_connection_modal ' , false ),
240
- 'newRecommendations ' => Jetpack_Recommendations::get_new_conditional_recommendations (),
239
+ 'hasSeenWCConnectionModal ' => Jetpack_Options::get_option ( 'has_seen_wc_connection_modal ' , false ),
240
+ 'newRecommendations ' => Jetpack_Recommendations::get_new_conditional_recommendations (),
241
241
// Check if WooCommerce plugin is active (based on https://docs.woocommerce.com/document/create-a-plugin/).
242
- 'isWooCommerceActive ' => in_array ( 'woocommerce/woocommerce.php ' , apply_filters ( 'active_plugins ' , Jetpack::get_active_plugins () ), true ),
243
- 'useMyJetpackLicensingUI ' => My_Jetpack_Initializer::is_licensing_ui_enabled (),
244
- 'isOdysseyStatsEnabled ' => Stats_Options::get_option ( 'enable_odyssey_stats ' ),
245
- 'shouldInitializeBlaze ' => Blaze::should_initialize (),
246
- 'isBlazeDashboardEnabled ' => Blaze::is_dashboard_enabled (),
247
- 'socialInitialState ' => self ::get_publicize_initial_state (),
248
- 'gutenbergInitialState ' => self ::get_gutenberg_initial_state (),
249
- 'isSubscriptionSiteEnabled ' => apply_filters ( 'jetpack_subscription_site_enabled ' , false ) && version_compare ( $ wp_version , '6.5-beta2 ' , '>= ' ),
242
+ 'isWooCommerceActive ' => in_array ( 'woocommerce/woocommerce.php ' , apply_filters ( 'active_plugins ' , Jetpack::get_active_plugins () ), true ),
243
+ 'useMyJetpackLicensingUI ' => My_Jetpack_Initializer::is_licensing_ui_enabled (),
244
+ 'isOdysseyStatsEnabled ' => Stats_Options::get_option ( 'enable_odyssey_stats ' ),
245
+ 'shouldInitializeBlaze ' => Blaze::should_initialize (),
246
+ 'isBlazeDashboardEnabled ' => Blaze::is_dashboard_enabled (),
247
+ 'socialInitialState ' => self ::get_publicize_initial_state (),
248
+ 'gutenbergInitialState ' => self ::get_gutenberg_initial_state (),
249
+ 'isSubscriptionSiteEnabled ' => apply_filters ( 'jetpack_subscription_site_enabled ' , false ),
250
+ 'subscriptionSiteEditSupported ' => $ current_theme ->is_block_theme () && version_compare ( $ wp_version , '6.5-beta2 ' , '>= ' ),
250
251
);
251
252
}
252
253
0 commit comments