PluginProbe
MailPoet – Newsletters, Email Marketing, and Automation / 3.16.0
MailPoet – Newsletters, Email Marketing, and Automation v3.16.0
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
102 lines 3.5 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 * Plugin Name: MailPoet 3 (New)
7 * Version: 3.15.0
8 * Plugin URI: http://www.mailpoet.com
9 * Description: Create and send newsletters, post notifications and welcome emails from your WordPress.
10 * Author: MailPoet
11 * Author URI: http://www.mailpoet.com
12 * Requires at least: 4.7
13 * Tested up to: 4.9
14 *
15 * @package WordPress
16 * @author MailPoet
17 * @since 3.0.0-beta.1
18 */
19
20 $mailpoet_plugin = array(
21 'version' => '3.15.0',
22 'filename' => __FILE__,
23 'path' => dirname(__FILE__),
24 'autoloader' => dirname(__FILE__) . '/vendor/autoload.php',
25 'initializer' => dirname(__FILE__) . '/mailpoet_initializer.php'
26 );
27
28 function mailpoet_deactivate_plugin() {
29 deactivate_plugins(plugin_basename(__FILE__));
30 if(!empty($_GET['activate'])) {
31 unset($_GET['activate']);
32 }
33 }
34
35 // Check for minimum supported WP version
36 if(version_compare(get_bloginfo('version'), '4.6', '<')) {
37 add_action('admin_notices', 'mailpoet_wp_version_notice');
38 // deactivate the plugin
39 add_action('admin_init', 'mailpoet_deactivate_plugin');
40 return;
41 }
42
43 // Check for minimum supported PHP version
44 if(version_compare(phpversion(), '5.6.0', '<')) {
45 add_action('admin_notices', 'mailpoet_php_version_notice');
46 // deactivate the plugin
47 add_action('admin_init', 'mailpoet_deactivate_plugin');
48 return;
49 }
50
51 // Display WP version error notice
52 function mailpoet_wp_version_notice() {
53 $notice = str_replace(
54 '[link]',
55 '<a href="//beta.docs.mailpoet.com/article/152-minimum-requirements-for-mailpoet-3#wp_version" target="_blank">',
56 __('MailPoet plugin requires WordPress version 4.6 or newer. Please read our [link]instructions[/link] on how to resolve this issue.', 'mailpoet')
57 );
58 $notice = str_replace('[/link]', '</a>', $notice);
59 printf('<div class="error"><p>%1$s</p></div>', $notice);
60 }
61
62 // Display PHP version error notice
63 function mailpoet_php_version_notice() {
64 $notice = str_replace(
65 '[link]',
66 '<a href="//beta.docs.mailpoet.com/article/152-minimum-requirements-for-mailpoet-3#php_version" target="_blank">',
67 __('MailPoet requires PHP version 5.6 or newer (version 7.2 recommended). Please read our [link]instructions[/link] on how to upgrade your site.', 'mailpoet')
68 );
69 $notice = str_replace('[/link]', '</a>', $notice);
70 printf('<div class="error"><p>%1$s</p></div>', $notice);
71 }
72
73 if(isset($_SERVER['SERVER_SOFTWARE']) && strpos(strtolower($_SERVER['SERVER_SOFTWARE']), 'microsoft-iis') !== false) {
74 add_action('admin_notices', 'mailpoet_microsoft_iis_notice');
75 // deactivate the plugin
76 add_action('admin_init', 'mailpoet_deactivate_plugin');
77 return;
78 }
79
80 // Display IIS server error notice
81 function mailpoet_microsoft_iis_notice() {
82 $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');
83 printf('<div class="error"><p>%1$s</p></div>', $notice);
84 }
85
86 // Check for presence of core dependencies
87 if(!file_exists($mailpoet_plugin['autoloader']) || !file_exists($mailpoet_plugin['initializer'])) {
88 add_action('admin_notices', 'mailpoet_core_dependency_notice');
89 // deactivate the plugin
90 add_action('admin_init', 'mailpoet_deactivate_plugin');
91 return;
92 }
93
94 // Display missing core dependencies error notice
95 function mailpoet_core_dependency_notice() {
96 $notice = __('MailPoet cannot start because it is missing core files. Please reinstall the plugin.', 'mailpoet');
97 printf('<div class="error"><p>%1$s</p></div>', $notice);
98 }
99
100 // Initialize plugin
101 require_once($mailpoet_plugin['initializer']);
102