PluginProbe
MailPoet – Newsletters, Email Marketing, and Automation / 3.77.1
MailPoet – Newsletters, Email Marketing, and Automation v3.77.1
5.38.0 5.37.0 5.36.1 5.36.0 5.35.1 5.35.0 5.34.3 5.34.2 5.34.1 5.34.0 5.33.1 5.33.0 5.32.0 5.31.0 5.30.0 5.29.0 5.28.1 5.28.0 5.27.0 5.26.0 5.26.1 5.25.0 5.24.0 4.43.0 4.43.1 All 542 releases
mailpoet / mailpoet.php
mailpoet.php
117 lines 4.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 if (!defined('ABSPATH')) exit;
4
5
6 /*
7 * Plugin Name: MailPoet 3 (New)
8 * Version: 3.77.1
9 * Plugin URI: http://www.mailpoet.com
10 * Description: Create and send newsletters, post notifications and welcome emails from your WordPress.
11 * Author: MailPoet
12 * Author URI: http://www.mailpoet.com
13 * Requires at least: 5.3
14 * Text Domain: mailpoet
15 * Domain Path: /lang
16 *
17 * @package WordPress
18 * @author MailPoet
19 * @since 3.0.0-beta.1
20 */
21
22 $mailpoetPlugin = [
23 'version' => '3.77.1',
24 'filename' => __FILE__,
25 'path' => dirname(__FILE__),
26 'autoloader' => dirname(__FILE__) . '/vendor/autoload.php',
27 'initializer' => dirname(__FILE__) . '/mailpoet_initializer.php',
28 ];
29
30 function mailpoet_deactivate_plugin() {
31 deactivate_plugins(plugin_basename(__FILE__));
32 if (!empty($_GET['activate'])) {
33 unset($_GET['activate']);
34 }
35 }
36
37 // Check for minimum supported WP version
38 if (version_compare(get_bloginfo('version'), '5.0', '<')) {
39 add_action('admin_notices', 'mailpoet_wp_version_notice');
40 // deactivate the plugin
41 add_action('admin_init', 'mailpoet_deactivate_plugin');
42 return;
43 }
44
45 // Check for minimum supported PHP version
46 if (version_compare(phpversion(), '7.2.0', '<')) {
47 add_action('admin_notices', 'mailpoet_php_version_notice');
48 // deactivate the plugin
49 add_action('admin_init', 'mailpoet_deactivate_plugin');
50 return;
51 }
52
53 // Display WP version error notice
54 function mailpoet_wp_version_notice() {
55 $notice = str_replace(
56 '[link]',
57 '<a href="https://kb.mailpoet.com/article/152-minimum-requirements-for-mailpoet-3#wp_version" target="_blank">',
58 __('MailPoet plugin requires WordPress version 4.6 or newer. Please read our [link]instructions[/link] on how to resolve this issue.', 'mailpoet')
59 );
60 $notice = str_replace('[/link]', '</a>', $notice);
61 printf('<div class="error"><p>%1$s</p></div>', $notice);
62 }
63
64 // Display PHP version error notice
65 function mailpoet_php_version_notice() {
66 $noticeP1 = __('MailPoet requires PHP version 7.2 or newer (8.0 recommended). You are running version [version].', 'mailpoet');
67 $noticeP1 = str_replace('[version]', phpversion(), $noticeP1);
68
69 $noticeP2 = __('Please read our [link]instructions[/link] on how to upgrade your site.', 'mailpoet');
70 $noticeP2 = str_replace(
71 '[link]',
72 '<a href="https://kb.mailpoet.com/article/251-upgrading-the-websites-php-version" target="_blank">',
73 $noticeP2
74 );
75 $noticeP2 = str_replace('[/link]', '</a>', $noticeP2);
76
77 $noticeP3 = __('If you can’t upgrade the PHP version, [link]install this version[/link] of MailPoet. Remember to not update MailPoet ever again!', 'mailpoet');
78 $noticeP3 = str_replace(
79 '[link]',
80 '<a href="https://downloads.wordpress.org/plugin/mailpoet.3.74.3.zip" target="_blank">',
81 $noticeP3
82 );
83 $noticeP3 = str_replace('[/link]', '</a>', $noticeP3);
84
85 printf('<div class="error"><p><strong>%s</strong></p><p>%s</p><p>%s</p></div>', $noticeP1, $noticeP2, $noticeP3);
86 }
87
88 if (isset($_SERVER['SERVER_SOFTWARE']) && strpos(strtolower($_SERVER['SERVER_SOFTWARE']), 'microsoft-iis') !== false) {
89 add_action('admin_notices', 'mailpoet_microsoft_iis_notice');
90 // deactivate the plugin
91 add_action('admin_init', 'mailpoet_deactivate_plugin');
92 return;
93 }
94
95 // Display IIS server error notice
96 function mailpoet_microsoft_iis_notice() {
97 $notice = __("MailPoet plugin cannot run under Microsoft's Internet Information Services (IIS) web server. We recommend that you use a web server powered by Apache or NGINX.", 'mailpoet');
98 printf('<div class="error"><p>%1$s</p></div>', $notice);
99 }
100
101 // Check for presence of core dependencies
102 if (!file_exists($mailpoetPlugin['autoloader']) || !file_exists($mailpoetPlugin['initializer'])) {
103 add_action('admin_notices', 'mailpoet_core_dependency_notice');
104 // deactivate the plugin
105 add_action('admin_init', 'mailpoet_deactivate_plugin');
106 return;
107 }
108
109 // Display missing core dependencies error notice
110 function mailpoet_core_dependency_notice() {
111 $notice = __('MailPoet cannot start because it is missing core files. Please reinstall the plugin.', 'mailpoet');
112 printf('<div class="error"><p>%1$s</p></div>', $notice);
113 }
114
115 // Initialize plugin
116 require_once($mailpoetPlugin['initializer']);
117