PATH:
home
/
lab2454c
/
adenbic.com
/
wp-content
/
plugins
/
woocommerce
/
vendor
/
automattic
/
jetpack-connection
/
src
<?php /** * The React initial state. * * @package automattic/jetpack-connection */ namespace Automattic\Jetpack\Connection; use Automattic\Jetpack\Status; /** * The React initial state. */ class Initial_State { /** * Whether the initial state was already rendered * * @var boolean */ private static $rendered = false; /** * Get the initial state data. * * @return array */ private static function get_data() { global $wp_version; $status = new Status(); return array( 'apiRoot' => esc_url_raw( rest_url() ), 'apiNonce' => wp_create_nonce( 'wp_rest' ), 'registrationNonce' => wp_create_nonce( 'jetpack-registration-nonce' ), 'connectionStatus' => REST_Connector::connection_status( false ), 'userConnectionData' => REST_Connector::get_user_connection_data( false ), 'connectedPlugins' => REST_Connector::get_connection_plugins( false ), 'wpVersion' => $wp_version, 'siteSuffix' => $status->get_site_suffix(), 'connectionErrors' => Error_Handler::get_instance()->get_verified_errors(), 'isOfflineMode' => $status->is_offline_mode(), 'calypsoEnv' => ( new Status\Host() )->get_calypso_env(), ); } /** * Render the initial state into a JavaScript variable. * * @return string */ public static function render() { if ( self::$rendered ) { return null; } self::$rendered = true; return 'var JP_CONNECTION_INITIAL_STATE=JSON.parse(decodeURIComponent("' . rawurlencode( wp_json_encode( self::get_data() ) ) . '"));'; } /** * Render the initial state using an inline script. * * @param string $handle The JS script handle. * * @return void */ public static function render_script( $handle ) { if ( ! static::$rendered ) { wp_add_inline_script( $handle, static::render(), 'before' ); } } }
[-] class-client.php
[edit]
[-] class-xmlrpc-connector.php
[edit]
[-] class-rest-authentication.php
[edit]
[-] class-rest-connector.php
[edit]
[+]
..
[-] class-urls.php
[edit]
[-] class-xmlrpc-async-call.php
[edit]
[-] class-tokens-locks.php
[edit]
[-] class-package-version-tracker.php
[edit]
[-] class-plugin-storage.php
[edit]
[-] class-utils.php
[edit]
[-] class-connection-notice.php
[edit]
[-] class-server-sandbox.php
[edit]
[-] class-initial-state.php
[edit]
[+]
webhooks
[-] class-plugin.php
[edit]
[-] class-webhooks.php
[edit]
[-] class-heartbeat.php
[edit]
[-] class-secrets.php
[edit]
[-] class-nonce-handler.php
[edit]
[-] class-error-handler.php
[edit]
[-] interface-manager.php
[edit]
[-] class-terms-of-service.php
[edit]
[-] class-tracking.php
[edit]
[-] class-tokens.php
[edit]
[-] class-package-version.php
[edit]
[-] class-manager.php
[edit]