Mailster WordPress Newsletter Plugin Compatibility Tester - Version 1.0.1

Version Description

Download this release

Release Info

Developer everpress
Plugin Icon 128x128 Mailster WordPress Newsletter Plugin Compatibility Tester
Version 1.0.1
Comparing to
See all releases

Code changes from version 1.0 to 1.0.1

Files changed (3) hide show
  1. classes/tester.class.php +110 -0
  2. mailster.php +4 -111
  3. readme.txt +4 -4
classes/tester.class.php ADDED
@@ -0,0 +1,110 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class MailsterTester {
4
+
5
+ private $plugin_path;
6
+ private $plugin_url;
7
+
8
+ public function __construct() {
9
+
10
+ $this->plugin_path = plugin_dir_path( MAILSTER_TESTER_FILE );
11
+ $this->plugin_url = plugin_dir_url( MAILSTER_TESTER_FILE );
12
+
13
+ register_activation_hook( MAILSTER_TESTER_FILE, array( &$this, 'activate' ) );
14
+ register_deactivation_hook( MAILSTER_TESTER_FILE, array( &$this, 'deactivate' ) );
15
+
16
+ load_plugin_textdomain( 'mailster-tester' );
17
+
18
+ add_action( 'init', array( &$this, 'init' ), 1 );
19
+ }
20
+
21
+
22
+ public function activate( $network_wide ) { }
23
+
24
+
25
+ public function deactivate( $network_wide ) { }
26
+
27
+
28
+ public function init() {
29
+
30
+ add_action( 'admin_menu', array( $this, 'admin_menu' ) );
31
+
32
+ }
33
+
34
+
35
+
36
+ public function admin_menu() {
37
+ $hook = add_management_page( 'Mailster Tester', 'Mailster Tester', 'install_plugins', 'mailster-tester', array( $this, 'admin_page' ), '' );
38
+ }
39
+
40
+ public function admin_page() {
41
+
42
+ $errors = $this->check_compatibility();
43
+
44
+ if ( $errors->error_count ) {
45
+
46
+ echo '<h3>Following Errors occurred</h3>';
47
+ echo '<div class="error"><p><strong>' . implode( '<br>', $errors->errors->get_error_messages() ) . '</strong></p></div>';
48
+
49
+ } else {
50
+
51
+ echo '<h3>No errors where found!</h3>';
52
+
53
+ }
54
+
55
+ if ( $errors->warning_count ) {
56
+
57
+ echo '<h3>Following Warnings occurred</h3>';
58
+ echo '<div class="error"><p><strong>' . implode( '<br>', $errors->warnings->get_error_messages() ) . '</strong></p></div>';
59
+
60
+ } else {
61
+
62
+ echo '<h3>No warnings where found!</h3>';
63
+
64
+ }
65
+
66
+ echo '<p>Thanks for testing!</p>';
67
+
68
+ }
69
+
70
+ public function check_compatibility( $notices = true, $die = false ) {
71
+
72
+ $errors = (object) array(
73
+ 'error_count' => 0,
74
+ 'warning_count' => 0,
75
+ 'errors' => new WP_Error(),
76
+ 'warnings' => new WP_Error(),
77
+ );
78
+
79
+ $upload_folder = wp_upload_dir();
80
+
81
+ $content_dir = trailingslashit( $upload_folder['basedir'] );
82
+
83
+ if ( version_compare( PHP_VERSION, '5.3' ) < 0 ) {
84
+ $errors->errors->add( 'minphpversion', sprintf( 'Mailster requires PHP version 5.3 or higher. Your current version is %s. Please update or ask your hosting provider to help you updating.', PHP_VERSION ) );
85
+ }
86
+ if ( version_compare( get_bloginfo( 'version' ), '3.8' ) < 0 ) {
87
+ $errors->errors->add( 'minphpversion', sprintf( 'Mailster requires WordPress version 3.8 or higher. Your current version is %s.', get_bloginfo( 'version' ) ) );
88
+ }
89
+ if ( ! class_exists( 'DOMDocument' ) ) {
90
+ $errors->errors->add( 'DOMDocument', 'Mailster requires the <a href="https://php.net/manual/en/class.domdocument.php" target="_blank">DOMDocument</a> library.' );
91
+ }
92
+ if ( ! function_exists( 'fsockopen' ) ) {
93
+ $errors->warnings->add( 'fsockopen', 'Your server does not support <a href="https://php.net/manual/en/function.fsockopen.php" target="_blank">fsockopen</a>.' );
94
+ }
95
+ if ( ! is_dir( $content_dir ) || ! wp_is_writable( $content_dir ) ) {
96
+ $errors->warnings->add( 'writeable', sprintf( 'Your content folder in %s is not writeable.', '"' . $content_dir . '"' ) );
97
+ }
98
+ if ( max( intval( @ini_get( 'memory_limit' ) ), intval( WP_MAX_MEMORY_LIMIT ) ) < 128 ) {
99
+ $errors->warnings->add( 'menorylimit', 'Your Memory Limit is ' . size_format( WP_MEMORY_LIMIT * 1048576 ) . ', Mailster recommends at least 128 MB' );
100
+ }
101
+
102
+ $errors->error_count = count( $errors->errors->errors );
103
+ $errors->warning_count = count( $errors->warnings->errors );
104
+
105
+ return $errors;
106
+
107
+ }
108
+
109
+
110
+ }
mailster.php CHANGED
@@ -1,123 +1,16 @@
1
  <?php
2
  /*
3
- Plugin Name: Mailster Newsletter
4
  Plugin URI: http://mailster.co
5
  Description: This is a compatibility test plugin for the Mailster Newsletter plugin
6
- Version: 1.0
7
  Author: EverPress
8
  Author URI: https://everpress.io
9
  Text Domain: mailster-tester
10
  License: GPLv2 or later
11
  */
12
 
13
- class MailsterTester {
14
-
15
- private $plugin_path;
16
- private $plugin_url;
17
-
18
- public function __construct() {
19
-
20
- $this->plugin_path = plugin_dir_path( __FILE__ );
21
- $this->plugin_url = plugin_dir_url( __FILE__ );
22
-
23
- register_activation_hook( __FILE__, array( &$this, 'activate' ) );
24
- register_deactivation_hook( __FILE__, array( &$this, 'deactivate' ) );
25
-
26
- load_plugin_textdomain( 'mailster-tester' );
27
-
28
- add_action( 'init', array( &$this, 'init' ), 1 );
29
- }
30
-
31
-
32
- public function activate( $network_wide ) { }
33
-
34
-
35
- public function deactivate( $network_wide ) { }
36
-
37
-
38
- public function init() {
39
-
40
- add_action( 'admin_menu', array( $this, 'admin_menu' ) );
41
-
42
- }
43
-
44
-
45
-
46
- public function admin_menu() {
47
- $hook = add_management_page( 'Mailster Tester', 'Mailster Tester', 'install_plugins', 'mailster-tester', array( $this, 'admin_page' ), '' );
48
- }
49
-
50
- public function admin_page() {
51
-
52
- $errors = $this->check_compatibility();
53
-
54
- if ( $errors->error_count ) {
55
-
56
- echo '<h3>Following Errors occurred</h3>';
57
- echo '<div class="error"><p><strong>' . implode( '<br>', $errors->errors->get_error_messages() ) . '</strong></p></div>';
58
-
59
- } else {
60
-
61
- echo '<h3>No errors where found!</h3>';
62
-
63
- }
64
-
65
- if ( $errors->warning_count ) {
66
-
67
- echo '<h3>Following Warnings occurred</h3>';
68
- echo '<div class="error"><p><strong>' . implode( '<br>', $errors->warnings->get_error_messages() ) . '</strong></p></div>';
69
-
70
- } else {
71
-
72
- echo '<h3>No warnings where found!</h3>';
73
-
74
- }
75
-
76
- echo '<p>Thanks for testing!</p>';
77
-
78
- }
79
-
80
- public function check_compatibility( $notices = true, $die = false ) {
81
-
82
- $errors = (object) array(
83
- 'error_count' => 0,
84
- 'warning_count' => 0,
85
- 'errors' => new WP_Error(),
86
- 'warnings' => new WP_Error(),
87
- );
88
-
89
- $upload_folder = wp_upload_dir();
90
-
91
- $content_dir = trailingslashit( $upload_folder['basedir'] );
92
-
93
- if ( version_compare( PHP_VERSION, '5.3' ) < 0 ) {
94
- $errors->errors->add( 'minphpversion', sprintf( 'Mailster requires PHP version 5.3 or higher. Your current version is %s. Please update or ask your hosting provider to help you updating.', PHP_VERSION ) );
95
- }
96
- if ( version_compare( get_bloginfo( 'version' ), '3.8' ) < 0 ) {
97
- $errors->errors->add( 'minphpversion', sprintf( 'Mailster requires WordPress version 3.8 or higher. Your current version is %s.', get_bloginfo( 'version' ) ) );
98
- }
99
- if ( ! class_exists( 'DOMDocument' ) ) {
100
- $errors->errors->add( 'DOMDocument', 'Mailster requires the <a href="https://php.net/manual/en/class.domdocument.php" target="_blank">DOMDocument</a> library.' );
101
- }
102
- if ( ! function_exists( 'fsockopen' ) ) {
103
- $errors->warnings->add( 'fsockopen', 'Your server does not support <a href="https://php.net/manual/en/function.fsockopen.php" target="_blank">fsockopen</a>.' );
104
- }
105
- if ( ! is_dir( $content_dir ) || ! wp_is_writable( $content_dir ) ) {
106
- $errors->warnings->add( 'writeable', sprintf( 'Your content folder in %s is not writeable.', '"' . $content_dir . '"' ) );
107
- }
108
- if ( max( intval( @ini_get( 'memory_limit' ) ), intval( WP_MAX_MEMORY_LIMIT ) ) < 128 ) {
109
- $errors->warnings->add( 'menorylimit', 'Your Memory Limit is ' . size_format( WP_MEMORY_LIMIT * 1048576 ) . ', Mailster recommends at least 128 MB' );
110
- }
111
-
112
- $errors->error_count = count( $errors->errors->errors );
113
- $errors->warning_count = count( $errors->warnings->errors );
114
-
115
- return $errors;
116
-
117
- }
118
-
119
-
120
- }
121
-
122
 
 
123
  new MailsterTester();
1
  <?php
2
  /*
3
+ Plugin Name: Mailster WordPress Newsletter Plugin
4
  Plugin URI: http://mailster.co
5
  Description: This is a compatibility test plugin for the Mailster Newsletter plugin
6
+ Version: 1.0.1
7
  Author: EverPress
8
  Author URI: https://everpress.io
9
  Text Domain: mailster-tester
10
  License: GPLv2 or later
11
  */
12
 
13
+ define( 'MAILSTER_TESTER_FILE', __FILE__ );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
14
 
15
+ require_once dirname( __FILE__ ) . '/classes/tester.class.php';
16
  new MailsterTester();
readme.txt CHANGED
@@ -1,9 +1,9 @@
1
- === Mailster Email Newsletters ===
2
- Contributors: everpress, revaxarts
3
- Tags: mailster tester, newsletter, email, newsletters
4
  Requires at least: 3.8
5
  Tested up to: 4.8
6
- Stable tag: 1.0
7
  License: GPLv2 or later
8
  Author: EverPress
9
  Author URI: https://mailster.co
1
+ === Mailster WordPress Newsletter Plugin ===
2
+ Contributors: everpress
3
+ Tags: email newsletter, newsletter, newsletter signup, email signup, email marketing
4
  Requires at least: 3.8
5
  Tested up to: 4.8
6
+ Stable tag: 1.0.1
7
  License: GPLv2 or later
8
  Author: EverPress
9
  Author URI: https://mailster.co