Use javascript notice

[MAILPOET-2643]
This commit is contained in:
Pavel Dohnal
2020-04-07 16:41:16 +02:00
committed by Veljko V
parent f6c602d474
commit 47a9586aa7
17 changed files with 107 additions and 37 deletions

View File

@ -56,7 +56,6 @@ class Menu {
}
public function init() {
$this->checkMailPoetAPIKey();
$this->checkPremiumKey();
$this->wp->addAction(
@ -552,20 +551,6 @@ class Menu {
// Used for displaying admin notices only
}
public function checkMailPoetAPIKey(ServicesChecker $checker = null) {
if (self::isOnMailPoetAdminPage()) {
$showNotices = isset($_REQUEST['page'])
&& (
stripos($_REQUEST['page'], self::MAIN_PAGE_SLUG) !== false
|| stripos($_REQUEST['page'], 'mailpoet-segments') !== false
|| stripos($_REQUEST['page'], 'mailpoet-subscribers') !== false
);
$checker = $checker ?: $this->servicesChecker;
$checker = $checker ?: $this->servicesChecker;
$this->mpApiKeyValid = $checker->isMailPoetAPIKeyValid($showNotices);
}
}
public function checkPremiumKey(ServicesChecker $checker = null) {
$showNotices = isset($_SERVER['SCRIPT_NAME'])
&& stripos($_SERVER['SCRIPT_NAME'], 'plugins.php') !== false;