Add activation url to store
[MAILPOET-3719]
This commit is contained in:
@@ -64,6 +64,7 @@ export default function makeDefaultState(window: any): State {
|
||||
inProgress: false,
|
||||
congratulatoryMssEmailSentTo: null,
|
||||
downloadUrl: window.mailpoet_premium_plugin_download_url,
|
||||
activationUrl: window.mailpoet_premium_plugin_activation_url,
|
||||
};
|
||||
const testEmail = {
|
||||
state: TestEmailState.NONE,
|
||||
|
@@ -212,6 +212,7 @@ export type KeyActivationState = {
|
||||
congratulatoryMssEmailSentTo: string|null;
|
||||
code?: number;
|
||||
downloadUrl?: string;
|
||||
activationUrl?: string;
|
||||
}
|
||||
|
||||
export enum TestEmailState {
|
||||
|
@@ -3,6 +3,7 @@
|
||||
namespace MailPoet\AdminPages\Pages;
|
||||
|
||||
use MailPoet\AdminPages\PageRenderer;
|
||||
use MailPoet\API\JSON\v1\Premium;
|
||||
use MailPoet\Config\Installer;
|
||||
use MailPoet\Config\ServicesChecker;
|
||||
use MailPoet\Segments\SegmentsSimpleListRepository;
|
||||
@@ -79,6 +80,7 @@ class Settings {
|
||||
'is_woocommerce_active' => $this->woocommerceHelper->isWooCommerceActive(),
|
||||
'is_members_plugin_active' => $this->wp->isPluginActive('members/members.php'),
|
||||
'premium_plugin_download_url' => $pluginInformation->download_link ?? null, // phpcs:ignore Squiz.NamingConventions.ValidVariableName.MemberNotCamelCaps
|
||||
'premium_plugin_activation_url' => $this->generatePluginActivationUrl(Premium::PREMIUM_PLUGIN_PATH),
|
||||
'hosts' => [
|
||||
'web' => Hosts::getWebHosts(),
|
||||
'smtp' => Hosts::getSMTPHosts(),
|
||||
@@ -103,4 +105,12 @@ class Settings {
|
||||
}
|
||||
$this->pageRenderer->displayPage('settings.html', $data);
|
||||
}
|
||||
|
||||
private function generatePluginActivationUrl(string $plugin): string {
|
||||
return $this->wp->adminUrl('plugins.php?' . implode('&', [
|
||||
'action=activate',
|
||||
'plugin=' . urlencode($plugin),
|
||||
'_wpnonce=' . wp_create_nonce('activate-plugin_' . $plugin),
|
||||
]));
|
||||
}
|
||||
}
|
||||
|
@@ -15,6 +15,7 @@
|
||||
var mailpoet_premium_key_valid = <%= json_encode(premium_key_valid) %>;
|
||||
var mailpoet_premium_plugin_installed = <%= json_encode(premium_plugin_installed) %>;
|
||||
var mailpoet_premium_plugin_download_url = <%= json_encode(premium_plugin_download_url) %>;
|
||||
var mailpoet_premium_plugin_activation_url = <%= json_encode(premium_plugin_activation_url) %>;
|
||||
var mailpoet_paths = <%= json_encode(paths) %>;
|
||||
var mailpoet_built_in_captcha_supported = <%= json_encode(built_in_captcha_supported == true) %>;
|
||||
var mailpoet_free_plan_url = "<%= add_referral_id('https://www.mailpoet.com/free-plan') %>";
|
||||
|
Reference in New Issue
Block a user