PluginProbe
MailPoet – Newsletters, Email Marketing, and Automation / 3.0.2
MailPoet – Newsletters, Email Marketing, and Automation v3.0.2
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
85 lines 2.8 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.0.2
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.6
13 * Tested up to: 4.8
14 *
15 * Domain Path: /lang/
16 *
17 * @package WordPress
18 * @author MailPoet
19 * @since 3.0.0-beta.1
20 */
21
22 $mailpoet_plugin = array(
23 'version' => '3.0.2',
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 PHP version
38 if(version_compare(phpversion(), '5.3.3', '<')) {
39 add_action('admin_notices', 'mailpoet_php_version_notice');
40 // deactivate the plugin
41 add_action('admin_init', 'mailpoet_deactivate_plugin');
42 return;
43 }
44
45 // Display PHP version error notice
46 function mailpoet_php_version_notice() {
47 $notice = str_replace(
48 '[link]',
49 '<a href="//beta.docs.mailpoet.com/article/152-minimum-requirements-for-mailpoet-3#php_version" target="_blank">',
50 __('MailPoet plugin requires PHP version 5.3.3 or newer. Please read our [link]instructions[/link] on how to resolve this issue.', 'mailpoet')
51 );
52 $notice = str_replace('[/link]', '</a>', $notice);
53 printf('<div class="error"><p>%1$s</p></div>', $notice);
54 }
55
56 if(isset($_SERVER['SERVER_SOFTWARE']) && strpos(strtolower($_SERVER['SERVER_SOFTWARE']), 'microsoft-iis') !== false) {
57 add_action('admin_notices', 'mailpoet_microsoft_iis_notice');
58 // deactivate the plugin
59 add_action('admin_init', 'mailpoet_deactivate_plugin');
60 return;
61 }
62
63 // Display IIS server error notice
64 function mailpoet_microsoft_iis_notice() {
65 $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');
66 printf('<div class="error"><p>%1$s</p></div>', $notice);
67 }
68
69 // Check for presence of core dependencies
70 if(!file_exists($mailpoet_plugin['autoloader']) || !file_exists($mailpoet_plugin['initializer'])) {
71 add_action('admin_notices', 'mailpoet_core_dependency_notice');
72 // deactivate the plugin
73 add_action('admin_init', 'mailpoet_deactivate_plugin');
74 return;
75 }
76
77 // Display missing core dependencies error notice
78 function mailpoet_core_dependency_notice() {
79 $notice = __('MailPoet cannot start because it is missing core files. Please reinstall the plugin.', 'mailpoet');
80 printf('<div class="error"><p>%1$s</p></div>', $notice);
81 }
82
83 // Initialize plugin
84 require_once($mailpoet_plugin['initializer']);
85