Move old versions code to own class
[MAILPOET-1316]
This commit is contained in:
@@ -138,6 +138,8 @@ class Initializer {
|
||||
|
||||
$this->setupPages();
|
||||
|
||||
$this->setupPHPVersionWarnings();
|
||||
|
||||
do_action('mailpoet_initialized', MAILPOET_VERSION);
|
||||
} catch(\Exception $e) {
|
||||
return $this->handleFailedInitialization($e);
|
||||
@@ -270,6 +272,12 @@ class Initializer {
|
||||
$exporters->init();
|
||||
}
|
||||
|
||||
function setupPHPVersionWarnings() {
|
||||
$php_version_warnings = new PHPVersionWarnings();
|
||||
$warnings = $php_version_warnings->init(phpversion(), Menu::isOnMailPoetAdminPage());
|
||||
if(is_string($warnings)) echo $warnings;
|
||||
}
|
||||
|
||||
function handleFailedInitialization($exception) {
|
||||
// check if we are able to add pages at this point
|
||||
if(function_exists('wp_get_current_user')) {
|
||||
|
Reference in New Issue
Block a user