diff --git a/lib/AdminPages/Pages/Update.php b/lib/AdminPages/Pages/Update.php deleted file mode 100644 index 6a236d5f7a..0000000000 --- a/lib/AdminPages/Pages/Update.php +++ /dev/null @@ -1,72 +0,0 @@ -pageRenderer = $pageRenderer; - $this->wp = $wp; - $this->settings = $settings; - } - - public function render() { - global $wp; - $currentUrl = $this->wp->homeUrl(add_query_arg($wp->query_string, $wp->request)); // phpcs:ignore Squiz.NamingConventions.ValidVariableName.NotCamelCaps - $redirectUrl = - (!empty($_GET['mailpoet_redirect'])) - ? urldecode($_GET['mailpoet_redirect']) - : $this->wp->wpGetReferer(); - - if ( - $redirectUrl === $currentUrl - or - strpos($redirectUrl, 'mailpoet') === false - ) { - $redirectUrl = $this->wp->adminUrl('admin.php?page=' . Menu::MAIN_PAGE_SLUG); - } - - $data = [ - 'settings' => $this->settings->getAll(), - 'current_user' => $this->wp->wpGetCurrentUser(), - 'redirect_url' => $redirectUrl, - 'sub_menu' => Menu::MAIN_PAGE_SLUG, - ]; - - $data['is_new_user'] = true; - $data['is_old_user'] = false; - if (!empty($data['settings']['installed_at'])) { - $installedAt = Carbon::createFromTimestamp(strtotime($data['settings']['installed_at'])); - $currentTime = Carbon::createFromTimestamp($this->wp->currentTime('timestamp')); - $data['is_new_user'] = $currentTime->diffInDays($installedAt) <= 30; - $data['is_old_user'] = $currentTime->diffInMonths($installedAt) >= 6; - $data['stop_call_for_rating'] = isset($data['settings']['stop_call_for_rating']) ? $data['settings']['stop_call_for_rating'] : false; - } - - $readmeFile = Env::$path . '/readme.txt'; - if (is_readable($readmeFile)) { - $changelog = Readme::parseChangelog(file_get_contents($readmeFile), 1); - if ($changelog) { - $data['changelog'] = $changelog; - } - } - - $this->pageRenderer->displayPage('update.html', $data); - } -} diff --git a/lib/Config/Menu.php b/lib/Config/Menu.php index 45350bda49..cc3249f2a2 100644 --- a/lib/Config/Menu.php +++ b/lib/Config/Menu.php @@ -15,7 +15,6 @@ use MailPoet\AdminPages\Pages\Settings; use MailPoet\AdminPages\Pages\Subscribers; use MailPoet\AdminPages\Pages\SubscribersExport; use MailPoet\AdminPages\Pages\SubscribersImport; -use MailPoet\AdminPages\Pages\Update; use MailPoet\AdminPages\Pages\WelcomeWizard; use MailPoet\AdminPages\Pages\WooCommerceSetup; use MailPoet\DI\ContainerWrapper; @@ -350,19 +349,6 @@ class Menu { ] ); - // Update page - $this->wp->addSubmenuPage( - true, - $this->setPageTitle(__('Update', 'mailpoet')), - $this->wp->__('Update', 'mailpoet'), - AccessControl::PERMISSION_ACCESS_PLUGIN_ADMIN, - 'mailpoet-update', - [ - $this, - 'update', - ] - ); - // Migration page $this->wp->addSubmenuPage( true, @@ -404,10 +390,6 @@ class Menu { $this->container->get(WooCommerceSetup::class)->render(); } - public function update() { - $this->container->get(Update::class)->render(); - } - public function premium() { $this->container->get(Premium::class)->render(); } diff --git a/lib/DI/ContainerConfigurator.php b/lib/DI/ContainerConfigurator.php index 0ad0ad53c5..52824fd924 100644 --- a/lib/DI/ContainerConfigurator.php +++ b/lib/DI/ContainerConfigurator.php @@ -43,7 +43,6 @@ class ContainerConfigurator implements IContainerConfigurator { $container->autowire(\MailPoet\AdminPages\Pages\Subscribers::class)->setPublic(true); $container->autowire(\MailPoet\AdminPages\Pages\SubscribersExport::class)->setPublic(true); $container->autowire(\MailPoet\AdminPages\Pages\SubscribersImport::class)->setPublic(true); - $container->autowire(\MailPoet\AdminPages\Pages\Update::class)->setPublic(true); $container->autowire(\MailPoet\AdminPages\Pages\WelcomeWizard::class)->setPublic(true); $container->autowire(\MailPoet\AdminPages\Pages\WooCommerceSetup::class)->setPublic(true); // Analytics diff --git a/views/update.html b/views/update.html deleted file mode 100644 index 5620bfa594..0000000000 --- a/views/update.html +++ /dev/null @@ -1,124 +0,0 @@ -<% extends 'layout.html' %> - -<% block content %> - -
-

<%= __('Thanks for updating MailPoet') %>

- -
- <%= __('Thanks, now take me to where I was going.') %> → -
- -
-

<%= __('List of Changes') %>

- <% if changelog %> - <% for item in changelog %> -

<%= item.version %>

- - <% endfor %> - <% else %> -

<%= __('See readme.txt for a changelog.') %>

- <% endif %> - <%= __('View all changes') %> → -
- -
- - <% if(is_new_user) %> -

<%= __('Care to Give Your Opinion?') %>

-
-
- <% elseif(is_old_user and not stop_call_for_rating) %> -

<%= __('Do you enjoy using MailPoet?') %>

-

- <%= __('If you have the time, we’d really appreciate it if you left us a review on the WordPress Plugin Directory.') %> -
<%= __('Every star counts.') %> - -

- <%= __('No thanks') %> - <%= __('Next time') %> - <%= __('Rate now') %> -

- <%= __('Care to share criticism or a feature request instead?') %> -
<%= __('Click on the question mark (?) in the blue circle at the bottom right of this page to send us a message.') %> - <% else %> -

<%= __('Care to Give Your Opinion?') %>

- - - <% endif %> - -
- - - -
- - -<% endblock %>