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