diff --git a/mailpoet/lib/EmailEditor/Integrations/MailPoet/EditorPageRenderer.php b/mailpoet/lib/EmailEditor/Integrations/MailPoet/EditorPageRenderer.php index 2f734be3bf..7d0b990ae8 100644 --- a/mailpoet/lib/EmailEditor/Integrations/MailPoet/EditorPageRenderer.php +++ b/mailpoet/lib/EmailEditor/Integrations/MailPoet/EditorPageRenderer.php @@ -3,7 +3,6 @@ namespace MailPoet\EmailEditor\Integrations\MailPoet; use MailPoet\Analytics\Analytics; -use MailPoet\API\JSON\API; use MailPoet\Config\Env; use MailPoet\Config\Installer; use MailPoet\Config\ServicesChecker; @@ -136,9 +135,6 @@ class EditorPageRenderer { $assetsParams['version'] ); - $jsonAPIRoot = rtrim($this->wp->escUrlRaw(admin_url('admin-ajax.php')), '/'); - $token = $this->wp->wpCreateNonce('mailpoet_token'); - $apiVersion = API::CURRENT_VERSION; $currentUserEmail = $this->wp->wpGetCurrentUser()->user_email; $this->wp->wpLocalizeScript( 'mailpoet_email_editor', @@ -146,11 +142,6 @@ class EditorPageRenderer { [ 'current_post_type' => esc_js($currentPostType), 'current_post_id' => $post->ID, - 'json_api_root' => esc_js($jsonAPIRoot), - 'api_token' => esc_js($token), - 'api_version' => esc_js($apiVersion), - 'cdn_url' => esc_js($this->cdnAssetUrl->generateCdnUrl("")), - 'is_premium_plugin_active' => (bool)$this->servicesChecker->isPremiumPluginActive(), 'current_wp_user_email' => esc_js($currentUserEmail), 'editor_settings' => $this->settingsController->get_settings(), 'editor_theme' => $this->themeController->get_base_theme()->get_raw_data(), diff --git a/packages/js/email-editor/src/global.d.ts b/packages/js/email-editor/src/global.d.ts index b85ece3a7b..84d87b4ee2 100644 --- a/packages/js/email-editor/src/global.d.ts +++ b/packages/js/email-editor/src/global.d.ts @@ -1,18 +1,12 @@ interface Window { MailPoetEmailEditor: { - json_api_root: string; - api_token: string; - api_version: string; - cdn_url: string; - is_premium_plugin_active: boolean; current_wp_user_email: string; user_theme_post_id: number; urls: { listings: string; + send: string; }; editor_settings: unknown; // Can't import type in global.d.ts. Typed in getEditorSettings() in store/settings.ts - email_styles: unknown; // Can't import type in global.d.ts. Typed in getEmailStyles() in store/settings.ts - editor_layout: unknown; // Can't import type in global.d.ts. Typed in getEmailLayout() in store/settings.ts editor_theme: unknown; // Can't import type in global.d.ts. Typed in getEditorTheme() in store/settings.ts current_post_type: string; current_post_id: string; diff --git a/packages/js/email-editor/src/store/initial-state.ts b/packages/js/email-editor/src/store/initial-state.ts index 64aa296d84..aaaba7f8d8 100644 --- a/packages/js/email-editor/src/store/initial-state.ts +++ b/packages/js/email-editor/src/store/initial-state.ts @@ -3,13 +3,7 @@ */ import { mainSidebarDocumentTab, editorCurrentPostId } from './constants'; import { State } from './types'; -import { - getEditorSettings, - getCdnUrl, - isPremiumPluginActive, - getEditorTheme, - getUrls, -} from './settings'; +import { getEditorSettings, getEditorTheme, getUrls } from './settings'; export function getInitialState(): State { const postId = editorCurrentPostId; @@ -30,8 +24,6 @@ export function getInitialState(): State { globalStylesPostId: window.MailPoetEmailEditor.user_theme_post_id, }, autosaveInterval: 60, - cdnUrl: getCdnUrl(), - isPremiumPluginActive: isPremiumPluginActive(), urls: getUrls(), preview: { deviceType: 'Desktop', diff --git a/packages/js/email-editor/src/store/selectors.ts b/packages/js/email-editor/src/store/selectors.ts index 61c4626e8b..79e74dc1f9 100644 --- a/packages/js/email-editor/src/store/selectors.ts +++ b/packages/js/email-editor/src/store/selectors.ts @@ -353,14 +353,6 @@ export function getAutosaveInterval( return state.autosaveInterval; } -export function getCdnUrl( state: State ): State[ 'cdnUrl' ] { - return state.cdnUrl; -} - -export function isPremiumPluginActive( state: State ): boolean { - return state.isPremiumPluginActive; -} - export function getTheme( state: State ): State[ 'theme' ] { return state.theme; } diff --git a/packages/js/email-editor/src/store/settings.ts b/packages/js/email-editor/src/store/settings.ts index 77a26580a3..c374791c52 100644 --- a/packages/js/email-editor/src/store/settings.ts +++ b/packages/js/email-editor/src/store/settings.ts @@ -7,14 +7,6 @@ export function getEditorSettings(): EmailEditorSettings { return window.MailPoetEmailEditor.editor_settings as EmailEditorSettings; } -export function getCdnUrl(): string { - return window.MailPoetEmailEditor.cdn_url; -} - -export function isPremiumPluginActive(): boolean { - return window.MailPoetEmailEditor.is_premium_plugin_active; -} - export function getEditorTheme(): EmailTheme { return window.MailPoetEmailEditor.editor_theme as EmailTheme; } diff --git a/packages/js/email-editor/src/store/types.ts b/packages/js/email-editor/src/store/types.ts index db07a5ec02..a2d48cb421 100644 --- a/packages/js/email-editor/src/store/types.ts +++ b/packages/js/email-editor/src/store/types.ts @@ -195,9 +195,7 @@ export type State = { globalStylesPostId: number | null; }; autosaveInterval: number; - cdnUrl: string; urls: EmailEditorUrls; - isPremiumPluginActive: boolean; preview: { deviceType: string; toEmail: string;