Email Log - Version 2.3.0

Version Description

The 'To' and 'Subject' fields now supports text upto 500 characters.

Download this release

Release Info

Developer sudar
Plugin Icon 128x128 Email Log
Version 2.3.0
Comparing to
See all releases

Code changes from version 2.2.5 to 2.3.0

assets/css/admin/view-logs.css CHANGED
@@ -30,5 +30,4 @@
30
 
31
  #TB_ajaxContent {
32
  padding-bottom: 10px !important; /* Override the default Thickbox css values. */
33
- overflow: hidden !important; /* Override the default Thickbox css values. */
34
  }
30
 
31
  #TB_ajaxContent {
32
  padding-bottom: 10px !important; /* Override the default Thickbox css values. */
 
33
  }
assets/js/admin/view-logs.js CHANGED
@@ -19,9 +19,8 @@
19
  $( element ).trigger( tabsInsertedEvent )
20
  });
21
 
22
- $( document ).on( tabsInsertedEvent, function() {
23
- $( '#tabs' ).tabs();
24
  });
25
 
26
-
27
  })( jQuery );
19
  $( element ).trigger( tabsInsertedEvent )
20
  });
21
 
22
+ $( document ).on( tabsInsertedEvent, function () {
23
+ $( '#tabs' ).tabs( { active: 1 } );
24
  });
25
 
 
26
  })( jQuery );
data/products.json CHANGED
@@ -6,7 +6,7 @@
6
  "slug": "more-fields",
7
  "title": "More Fields",
8
  "create_date": "2017-03-07 11:50:43",
9
- "modified_date": "2017-09-21 10:02:24",
10
  "status": "publish",
11
  "link": "http:\/\/wpemaillog.com\/?post_type=download&p=18",
12
  "content": "More Fields add-on shows additional fields about the email in the email log list page. The following are the additional fields that are added by this add-on.\r\n<ul>\r\n \t<li>From<\/li>\r\n \t<li>CC<\/li>\r\n \t<li>BCC<\/li>\r\n \t<li>Reply To<\/li>\r\n \t<li>Attachment<\/li>\r\n<\/ul>\r\nThese additional fields will allow you to see more information about the logged email.\r\n<h3>Screenshots<\/h3>\r\n[gallery columns=\"2\" ids=\"974,975\"]",
@@ -48,10 +48,10 @@
48
  "slug": "resend-email",
49
  "title": "Resend Email",
50
  "create_date": "2017-03-07 11:40:25",
51
- "modified_date": "2017-09-21 09:46:59",
52
  "status": "publish",
53
  "link": "http:\/\/wpemaillog.com\/?post_type=download&p=16",
54
- "content": "Resend Email add-on allows you to resend the entire email directly from the email log. Before re-sending the email, this\u00a0add-on allows you to modify the different fields before re-sending the email.\r\n<h3>Screenshots<\/h3>\r\n[gallery ids=\"980,981,982,983,984\"]",
55
  "excerpt": "Resend Email add-on allows you to resend the entire email directly from the email log. You can also modify the different fields before re-sending the email.",
56
  "thumbnail": "https:\/\/wpemaillog.com\/wp-content\/uploads\/edd\/2016\/11\/resend-email-addon.png",
57
  "category": [
@@ -70,7 +70,7 @@
70
  ],
71
  "tags": false,
72
  "permalink": "https:\/\/wpemaillog.com\/addons\/resend-email\/",
73
- "version": "2.0.2"
74
  },
75
  "pricing": {
76
  "singlesite": "19.00",
@@ -79,7 +79,7 @@
79
  },
80
  "licensing": {
81
  "enabled": true,
82
- "version": "2.0.2",
83
  "exp_unit": "years",
84
  "exp_length": "1"
85
  }
@@ -90,7 +90,7 @@
90
  "slug": "forward-email",
91
  "title": "Forward Email",
92
  "create_date": "2017-03-07 11:30:56",
93
- "modified_date": "2017-09-21 09:26:45",
94
  "status": "publish",
95
  "link": "http:\/\/wpemaillog.com\/?post_type=download&p=20",
96
  "content": "Forward Email add-on allows you to send a copy of all the emails send from WordPress, to another email address. The add-on allows you to choose whether you want to forward through to, cc or bcc fields. This can be extremely useful when you want to debug by analyzing the emails that are sent from WordPress.\r\n<h3>Screenshots<\/h3>\r\n[gallery ids=\"987,988,989\"]",
@@ -132,10 +132,10 @@
132
  "slug": "auto-delete-logs",
133
  "title": "Auto Delete Logs",
134
  "create_date": "2017-03-07 11:30:56",
135
- "modified_date": "2017-07-15 09:13:31",
136
  "status": "publish",
137
  "link": "https:\/\/wpemaillog.com\/?post_type=download&p=311",
138
- "content": "The Auto Delete Logs add-on allows you to automatically delete logs based on a schedule.\r\n<h3>Screenshots<\/h3>\r\n[gallery columns=\"2\" ids=\"991,992\"]",
139
  "excerpt": "The Auto Delete Logs add-on allows you to automatically delete logs based on a schedule.",
140
  "thumbnail": "https:\/\/wpemaillog.com\/wp-content\/uploads\/edd\/2017\/03\/delete-logs-addon.png",
141
  "category": [
@@ -154,7 +154,7 @@
154
  ],
155
  "tags": false,
156
  "permalink": "https:\/\/wpemaillog.com\/addons\/auto-delete-logs\/",
157
- "version": "1.0.0"
158
  },
159
  "pricing": {
160
  "singlesite": "19.00",
@@ -163,7 +163,7 @@
163
  },
164
  "licensing": {
165
  "enabled": true,
166
- "version": "1.0.0",
167
  "exp_unit": "years",
168
  "exp_length": "1"
169
  }
@@ -174,10 +174,10 @@
174
  "slug": "export-logs",
175
  "title": "Export Logs",
176
  "create_date": "2017-03-07 11:20:12",
177
- "modified_date": "2017-11-08 23:46:42",
178
  "status": "publish",
179
  "link": "https:\/\/wpemaillog.com\/?post_type=download&p=308",
180
- "content": "Export Logs add-on allows you to export the logged email logs as a csv file. The exported logs can be used for further processing or for record keeping.\r\n<h3>Screenshots<\/h3>\r\n[gallery ids=\"965,966,967,968\"]",
181
  "excerpt": "Export Logs add-on allows you to export the logged email logs for further processing or record keeping.",
182
  "thumbnail": "https:\/\/wpemaillog.com\/wp-content\/uploads\/edd\/2017\/03\/export-logs-addon.png",
183
  "category": [
@@ -196,7 +196,7 @@
196
  ],
197
  "tags": false,
198
  "permalink": "https:\/\/wpemaillog.com\/addons\/export-logs\/",
199
- "version": "1.1.0"
200
  },
201
  "pricing": {
202
  "singlesite": "19.00",
@@ -205,11 +205,11 @@
205
  },
206
  "licensing": {
207
  "enabled": true,
208
- "version": "1.1.0",
209
  "exp_unit": "years",
210
  "exp_length": "1"
211
  }
212
  }
213
  ],
214
- "request_speed": 0.010409116744995117
215
  }
6
  "slug": "more-fields",
7
  "title": "More Fields",
8
  "create_date": "2017-03-07 11:50:43",
9
+ "modified_date": "2018-02-13 14:48:45",
10
  "status": "publish",
11
  "link": "http:\/\/wpemaillog.com\/?post_type=download&p=18",
12
  "content": "More Fields add-on shows additional fields about the email in the email log list page. The following are the additional fields that are added by this add-on.\r\n<ul>\r\n \t<li>From<\/li>\r\n \t<li>CC<\/li>\r\n \t<li>BCC<\/li>\r\n \t<li>Reply To<\/li>\r\n \t<li>Attachment<\/li>\r\n<\/ul>\r\nThese additional fields will allow you to see more information about the logged email.\r\n<h3>Screenshots<\/h3>\r\n[gallery columns=\"2\" ids=\"974,975\"]",
48
  "slug": "resend-email",
49
  "title": "Resend Email",
50
  "create_date": "2017-03-07 11:40:25",
51
+ "modified_date": "2019-03-17 18:45:17",
52
  "status": "publish",
53
  "link": "http:\/\/wpemaillog.com\/?post_type=download&p=16",
54
+ "content": "Resend Email add-on allows you to resend the entire email directly from the email log. Before re-sending the email, this\u00a0add-on allows you to modify the different fields before re-sending the email.\r\n\r\nYou can also resend all emails or only selected emails in bulk in addition to individually re-sending them.\r\n<h3>Screenshots<\/h3>\r\n[gallery ids=\"980,981,982,983,984\"]",
55
  "excerpt": "Resend Email add-on allows you to resend the entire email directly from the email log. You can also modify the different fields before re-sending the email.",
56
  "thumbnail": "https:\/\/wpemaillog.com\/wp-content\/uploads\/edd\/2016\/11\/resend-email-addon.png",
57
  "category": [
70
  ],
71
  "tags": false,
72
  "permalink": "https:\/\/wpemaillog.com\/addons\/resend-email\/",
73
+ "version": "2.1.2"
74
  },
75
  "pricing": {
76
  "singlesite": "19.00",
79
  },
80
  "licensing": {
81
  "enabled": true,
82
+ "version": "2.1.2",
83
  "exp_unit": "years",
84
  "exp_length": "1"
85
  }
90
  "slug": "forward-email",
91
  "title": "Forward Email",
92
  "create_date": "2017-03-07 11:30:56",
93
+ "modified_date": "2018-02-13 14:50:29",
94
  "status": "publish",
95
  "link": "http:\/\/wpemaillog.com\/?post_type=download&p=20",
96
  "content": "Forward Email add-on allows you to send a copy of all the emails send from WordPress, to another email address. The add-on allows you to choose whether you want to forward through to, cc or bcc fields. This can be extremely useful when you want to debug by analyzing the emails that are sent from WordPress.\r\n<h3>Screenshots<\/h3>\r\n[gallery ids=\"987,988,989\"]",
132
  "slug": "auto-delete-logs",
133
  "title": "Auto Delete Logs",
134
  "create_date": "2017-03-07 11:30:56",
135
+ "modified_date": "2019-01-03 18:15:51",
136
  "status": "publish",
137
  "link": "https:\/\/wpemaillog.com\/?post_type=download&p=311",
138
+ "content": "The Auto Delete Logs add-on allows you to automatically delete logs based on a schedule.\r\n<h3>Screenshots<\/h3>\r\n[gallery columns=\"2\" ids=\"791182, 791183\"]",
139
  "excerpt": "The Auto Delete Logs add-on allows you to automatically delete logs based on a schedule.",
140
  "thumbnail": "https:\/\/wpemaillog.com\/wp-content\/uploads\/edd\/2017\/03\/delete-logs-addon.png",
141
  "category": [
154
  ],
155
  "tags": false,
156
  "permalink": "https:\/\/wpemaillog.com\/addons\/auto-delete-logs\/",
157
+ "version": "1.1.0"
158
  },
159
  "pricing": {
160
  "singlesite": "19.00",
163
  },
164
  "licensing": {
165
  "enabled": true,
166
+ "version": "1.1.0",
167
  "exp_unit": "years",
168
  "exp_length": "1"
169
  }
174
  "slug": "export-logs",
175
  "title": "Export Logs",
176
  "create_date": "2017-03-07 11:20:12",
177
+ "modified_date": "2019-04-11 10:47:40",
178
  "status": "publish",
179
  "link": "https:\/\/wpemaillog.com\/?post_type=download&p=308",
180
+ "content": "Export Logs add-on allows you to export the logged email logs as a csv file. The exported logs can be used for further processing or for record keeping.\r\n<h3>Screenshots<\/h3>\r\n[gallery ids=\"965,966,967,968, 791221\"]",
181
  "excerpt": "Export Logs add-on allows you to export the logged email logs for further processing or record keeping.",
182
  "thumbnail": "https:\/\/wpemaillog.com\/wp-content\/uploads\/edd\/2017\/03\/export-logs-addon.png",
183
  "category": [
196
  ],
197
  "tags": false,
198
  "permalink": "https:\/\/wpemaillog.com\/addons\/export-logs\/",
199
+ "version": "1.2.1"
200
  },
201
  "pricing": {
202
  "singlesite": "19.00",
205
  },
206
  "licensing": {
207
  "enabled": true,
208
+ "version": "1.2.1",
209
  "exp_unit": "years",
210
  "exp_length": "1"
211
  }
212
  }
213
  ],
214
+ "request_speed": 0.00640106201171875
215
  }
email-log.php CHANGED
@@ -5,7 +5,7 @@
5
  * Description: Logs every email sent through WordPress
6
  * Donate Link: http://sudarmuthu.com/if-you-wanna-thank-me
7
  * Author: Sudar
8
- * Version: 2.2.5
9
  * Author URI: http://sudarmuthu.com/
10
  * Text Domain: email-log
11
  * Domain Path: languages/
@@ -46,7 +46,7 @@ if ( version_compare( PHP_VERSION, '5.3.0', '<' ) ) {
46
  <p>
47
  <?php
48
  printf(
49
- __( 'Email Log requires at least PHP 5.3 to function properly. Please upgrade PHP or use <a href="%s">v1.9.1 of Email Log</a>.', 'email-log' ), // @codingStandardsIgnoreLine
50
  'https://downloads.wordpress.org/plugin/email-log.1.9.1.zip'
51
  );
52
  ?>
5
  * Description: Logs every email sent through WordPress
6
  * Donate Link: http://sudarmuthu.com/if-you-wanna-thank-me
7
  * Author: Sudar
8
+ * Version: 2.3.0
9
  * Author URI: http://sudarmuthu.com/
10
  * Text Domain: email-log
11
  * Domain Path: languages/
46
  <p>
47
  <?php
48
  printf(
49
+ __( 'Email Log requires at least PHP 5.3 to function properly. Please upgrade PHP or use <a href="%s" target="_blank" rel="noopener">v1.9.1 of Email Log</a>.', 'email-log' ), // @codingStandardsIgnoreLine
50
  'https://downloads.wordpress.org/plugin/email-log.1.9.1.zip'
51
  );
52
  ?>
include/Addon/Addon.php CHANGED
@@ -63,7 +63,7 @@ class Addon {
63
  <div class="el-addon">
64
  <h3 class="el-addon-title"> <?php echo esc_html( $this->name ); ?> </h3>
65
 
66
- <a href="<?php echo esc_url( $this->link ); ?>?utm_campaign=Upsell&utm_medium=wpadmin&utm_source=addon-grid&utm_content=<?php echo $this->name; ?>"
67
  title="<?php echo esc_attr( $this->name ); ?>">
68
  <img src="<?php echo esc_url( $this->thumbnail ); ?>" class="attachment-showcase wp-post-image"
69
  alt="<?php echo esc_attr( $this->name ); ?>" title="<?php echo esc_attr( $this->name ); ?>">
@@ -137,7 +137,7 @@ class Addon {
137
  }
138
 
139
  $actions .= sprintf(
140
- ' <a class="button button-secondary" target="_blank" onclick="%s" href="%s">%s</a>',
141
  $this->get_download_button_js(),
142
  $this->get_download_url(),
143
  _x( 'Download', 'Download to your computer', 'email-log' )
@@ -182,12 +182,12 @@ class Addon {
182
  * Render Individual license form.
183
  */
184
  protected function render_individual_license() {
185
- $action = 'el_license_activate';
186
- $action_text = __( 'Activate', 'email-log' );
187
- $button_class = 'button-primary';
188
- $dashicon = 'down';
189
- $license_wrap = 'hidden';
190
- $expires = '';
191
 
192
  if ( $this->has_valid_addon_license() ) {
193
  $action = 'el_license_deactivate';
@@ -197,7 +197,14 @@ class Addon {
197
  $license_wrap = '';
198
 
199
  $expiry_date = date( 'F d, Y', strtotime( $this->get_license()->get_expiry_date() ) );
200
- $expires = sprintf( __( 'Your license expires on %s', 'email-log' ), $expiry_date );
 
 
 
 
 
 
 
201
  }
202
  ?>
203
 
@@ -214,7 +221,7 @@ class Addon {
214
  <input type="submit" class="button button-large <?php echo sanitize_html_class( $button_class ); ?>"
215
  value="<?php echo esc_attr( $action_text ); ?>">
216
 
217
- <p class="expires"><?php echo esc_html( $expires ); ?></p>
218
 
219
  <input type="hidden" name="el-addon" value="<?php echo esc_attr( $this->name ); ?>">
220
  <input type="hidden" name="el-action" value="<?php echo esc_attr( $action ); ?>">
@@ -223,7 +230,6 @@ class Addon {
223
  </form>
224
  </div>
225
  <?php
226
-
227
  }
228
 
229
  /**
63
  <div class="el-addon">
64
  <h3 class="el-addon-title"> <?php echo esc_html( $this->name ); ?> </h3>
65
 
66
+ <a rel="noopener" target="_blank" href="<?php echo esc_url( $this->link ); ?>?utm_campaign=Upsell&utm_medium=wpadmin&utm_source=addon-grid&utm_content=<?php echo $this->name; ?>"
67
  title="<?php echo esc_attr( $this->name ); ?>">
68
  <img src="<?php echo esc_url( $this->thumbnail ); ?>" class="attachment-showcase wp-post-image"
69
  alt="<?php echo esc_attr( $this->name ); ?>" title="<?php echo esc_attr( $this->name ); ?>">
137
  }
138
 
139
  $actions .= sprintf(
140
+ ' <a class="button button-secondary" rel="noopener" target="_blank" onclick="%s" href="%s">%s</a>',
141
  $this->get_download_button_js(),
142
  $this->get_download_url(),
143
  _x( 'Download', 'Download to your computer', 'email-log' )
182
  * Render Individual license form.
183
  */
184
  protected function render_individual_license() {
185
+ $action = 'el_license_activate';
186
+ $action_text = __( 'Activate', 'email-log' );
187
+ $button_class = 'button-primary';
188
+ $dashicon = 'down';
189
+ $license_wrap = 'hidden';
190
+ $expiry_details = '';
191
 
192
  if ( $this->has_valid_addon_license() ) {
193
  $action = 'el_license_deactivate';
197
  $license_wrap = '';
198
 
199
  $expiry_date = date( 'F d, Y', strtotime( $this->get_license()->get_expiry_date() ) );
200
+
201
+ if ( $this->get_license()->has_expired() ) {
202
+ /* translators: 1 License expiry date, 2 License Renewal link */
203
+ $expiry_details = sprintf( __( 'Your license has expired on %1$s. Please <a href="%2$s">renew it</a> to receive automatic updates and support.', 'email-log' ), $expiry_date, esc_url( $this->get_license()->get_renewal_link() ) );
204
+ } else {
205
+ /* translators: 1 License expiry date */
206
+ $expiry_details = sprintf( __( 'Your license is valid till %s', 'email-log' ), $expiry_date );
207
+ }
208
  }
209
  ?>
210
 
221
  <input type="submit" class="button button-large <?php echo sanitize_html_class( $button_class ); ?>"
222
  value="<?php echo esc_attr( $action_text ); ?>">
223
 
224
+ <p class="expires"><?php echo $expiry_details; ?></p>
225
 
226
  <input type="hidden" name="el-addon" value="<?php echo esc_attr( $this->name ); ?>">
227
  <input type="hidden" name="el-action" value="<?php echo esc_attr( $action ); ?>">
230
  </form>
231
  </div>
232
  <?php
 
233
  }
234
 
235
  /**
include/Addon/AddonList.php CHANGED
@@ -97,7 +97,7 @@ class AddonList {
97
  *
98
  * @return Addon[] List of add-ons, empty array if API call fails.
99
  */
100
- protected function get_addons() {
101
  $json = get_transient( self::CACHE_KEY );
102
  if ( false === $json ) {
103
  $response = wp_remote_get( $this->get_api_url() );
@@ -174,7 +174,7 @@ class AddonList {
174
  <span class="el-addon-empty">
175
  <?php
176
  printf(
177
- __( 'We are not able to retrieve the add-on list now. Please visit the <a href="%s">add-on page</a> to view the add-ons.', 'email-log' ), // @codingStandardsIgnoreLine
178
  'https://wpemaillog.com/store/?utm_campaign=Upsell&utm_medium=wpadmin&utm_source=addon-grid-failed'
179
  );
180
  ?>
97
  *
98
  * @return Addon[] List of add-ons, empty array if API call fails.
99
  */
100
+ public function get_addons() {
101
  $json = get_transient( self::CACHE_KEY );
102
  if ( false === $json ) {
103
  $response = wp_remote_get( $this->get_api_url() );
174
  <span class="el-addon-empty">
175
  <?php
176
  printf(
177
+ __( 'We are not able to retrieve the add-on list now. Please visit the <a target="_blank" rel="noopener" href="%s">add-on page</a> to view the add-ons.', 'email-log' ), // @codingStandardsIgnoreLine
178
  'https://wpemaillog.com/store/?utm_campaign=Upsell&utm_medium=wpadmin&utm_source=addon-grid-failed'
179
  );
180
  ?>
include/Addon/License/AddonLicense.php CHANGED
@@ -9,14 +9,6 @@ defined( 'ABSPATH' ) || exit; // Exit if accessed directly.
9
  */
10
  class AddonLicense extends BaseLicense {
11
 
12
- public function is_valid() {
13
- if ( ! $this->license_data instanceof \stdClass || ! isset( $this->license_data->license ) ) {
14
- return false;
15
- }
16
-
17
- return ( 'valid' === $this->license_data->license );
18
- }
19
-
20
  /**
21
  * Get License key.
22
  *
9
  */
10
  class AddonLicense extends BaseLicense {
11
 
 
 
 
 
 
 
 
 
12
  /**
13
  * Get License key.
14
  *
include/Addon/License/BaseLicense.php CHANGED
@@ -22,13 +22,6 @@ abstract class BaseLicense {
22
  */
23
  protected $edd_api;
24
 
25
- /**
26
- * Is the license activated and valid?
27
- *
28
- * @return bool True if license is active, False otherwise.
29
- */
30
- abstract public function is_valid();
31
-
32
  /**
33
  * Get the option name in which license data will be stored.
34
  *
@@ -99,6 +92,61 @@ abstract class BaseLicense {
99
  return false;
100
  }
101
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
102
  /**
103
  * Activate License by calling EDD API.
104
  * The license data returned by API is stored in an option.
@@ -121,34 +169,41 @@ abstract class BaseLicense {
121
  switch ( $response->error ) {
122
  case 'expired':
123
  $message = sprintf(
124
- __( 'Your license key expired on %s.' , 'email-log'),
125
- date_i18n( get_option( 'date_format' ), strtotime( $response->expires, current_time( 'timestamp' ) ) )
 
 
126
  );
127
  break;
128
 
129
  case 'revoked':
130
- $message = __( 'Your license key has been disabled.' , 'email-log');
131
  break;
132
 
133
  case 'missing':
134
- $message = __( 'Your license key is invalid.' , 'email-log');
135
  break;
136
 
137
  case 'invalid':
138
  case 'site_inactive':
139
- $message = __( 'Your license is not active for this URL.' , 'email-log');
140
  break;
141
 
142
  case 'item_name_mismatch':
143
- $message = sprintf( __( 'Your license key is not valid for %s.' , 'email-log'), $this->get_addon_name() );
 
144
  break;
145
 
146
  case 'no_activations_left':
147
- $message = __( 'Your license key has reached its activation limit.' , 'email-log');
 
 
 
 
148
  break;
149
 
150
  default:
151
- $message = __( 'An error occurred, please try again.' , 'email-log');
152
  break;
153
  }
154
 
@@ -172,6 +227,13 @@ abstract class BaseLicense {
172
  return $response;
173
  }
174
 
 
 
 
 
 
 
 
175
  $message = __( 'An error occurred, please try again.', 'email-log' );
176
 
177
  if ( isset( $response->error ) ) {
22
  */
23
  protected $edd_api;
24
 
 
 
 
 
 
 
 
25
  /**
26
  * Get the option name in which license data will be stored.
27
  *
92
  return false;
93
  }
94
 
95
+ /**
96
+ * Has the bundle license expired?
97
+ *
98
+ * @since 2.3.0
99
+ *
100
+ * @return bool True if expired, False otherwise.
101
+ */
102
+ public function has_expired() {
103
+ $is_valid = $this->is_valid();
104
+
105
+ if ( ! $is_valid ) {
106
+ return true;
107
+ }
108
+
109
+ $expiry_date = $this->get_expiry_date();
110
+
111
+ if ( ! $expiry_date ) {
112
+ return true;
113
+ }
114
+
115
+ return ( strtotime( $expiry_date ) < time() );
116
+ }
117
+
118
+ /**
119
+ * Is the license activated and valid?
120
+ *
121
+ * @since 2.3.0 Moved to BaseLicense class.
122
+ *
123
+ * @return bool True if license is active, False otherwise.
124
+ */
125
+ public function is_valid() {
126
+ if ( ! $this->license_data instanceof \stdClass || ! isset( $this->license_data->license ) ) {
127
+ return false;
128
+ }
129
+
130
+ return ( 'valid' === $this->license_data->license );
131
+ }
132
+
133
+ /**
134
+ * Get the renewal link for bundle license.
135
+ *
136
+ * @since 2.3.0
137
+ *
138
+ * @return string Renewal link.
139
+ */
140
+ public function get_renewal_link() {
141
+ $license_key = $this->get_license_key();
142
+
143
+ if ( empty( $license_key ) ) {
144
+ return 'https://wpemaillog.com/store/?utm_campaign=Renewal&utm_medium=wpadmin&utm_source=renewal-notice';
145
+ }
146
+
147
+ return sprintf( 'https://wpemaillog.com/checkout/?edd_license_key=%s&utm_campaign=Renewal&utm_medium=wpadmin&utm_source=renewal-notice', $license_key );
148
+ }
149
+
150
  /**
151
  * Activate License by calling EDD API.
152
  * The license data returned by API is stored in an option.
169
  switch ( $response->error ) {
170
  case 'expired':
171
  $message = sprintf(
172
+ /* translators: 1 License expiry date, 2 License Renewal link */
173
+ __( 'Your license key expired on %1$s. Please <a href="%2$s">renew it</a> to receive automatic updates and support.', 'email-log' ),
174
+ date_i18n( get_option( 'date_format' ), strtotime( $response->expires, current_time( 'timestamp' ) ) ),
175
+ 'https://wpemaillog.com/checkout/?edd_license_key=' . $this->get_license_key() . '&utm_campaign=Renewal&utm_medium=wpadmin&utm_source=activation-failed'
176
  );
177
  break;
178
 
179
  case 'revoked':
180
+ $message = __( 'Your license key has been disabled.', 'email-log' );
181
  break;
182
 
183
  case 'missing':
184
+ $message = __( 'Your license key is invalid.', 'email-log' );
185
  break;
186
 
187
  case 'invalid':
188
  case 'site_inactive':
189
+ $message = __( 'Your license is not active for this URL.', 'email-log' );
190
  break;
191
 
192
  case 'item_name_mismatch':
193
+ /* translators: 1 Add-on name */
194
+ $message = sprintf( __( 'Your license key is not valid for %s.', 'email-log' ), $this->get_addon_name() );
195
  break;
196
 
197
  case 'no_activations_left':
198
+ $message = sprintf(
199
+ /* translators: 1 License Upgrade link */
200
+ __( 'Your license key has reached its activation limit. Please <a href="%s">upgrade</a> your license.', 'email-log' ),
201
+ 'https://wpemaillog.com/account/?utm_campaign=Upgrade&utm_medium=wpadmin&utm_source=activation-failed'
202
+ );
203
  break;
204
 
205
  default:
206
+ $message = __( 'An error occurred, please try again.', 'email-log' );
207
  break;
208
  }
209
 
227
  return $response;
228
  }
229
 
230
+ if ( $response->expires < time() ) {
231
+ // license has expired. Expired license can't be de-activated. So let's just clear it.
232
+ $this->clear();
233
+
234
+ return $response;
235
+ }
236
+
237
  $message = __( 'An error occurred, please try again.', 'email-log' );
238
 
239
  if ( isset( $response->error ) ) {
include/Addon/License/BundleLicense.php CHANGED
@@ -17,17 +17,10 @@ class BundleLicense extends BaseLicense {
17
  */
18
  protected $addon_name = 'Email Log Bundle';
19
 
20
- /**
21
- * Is the license valid?
22
- *
23
- * @return bool True if valid, False otherwise.
24
- */
25
- public function is_valid() {
26
- if ( empty( $this->license_data ) ) {
27
- return false;
28
- }
29
 
30
- return ( 'valid' === $this->license_data->license );
31
  }
32
 
33
  /**
17
  */
18
  protected $addon_name = 'Email Log Bundle';
19
 
20
+ public function get_renewal_link() {
21
+ $renewal_link = parent::get_renewal_link();
 
 
 
 
 
 
 
22
 
23
+ return $renewal_link . '&utm_content=BL';
24
  }
25
 
26
  /**
include/Addon/License/Licenser.php CHANGED
@@ -103,14 +103,25 @@ final class Licenser implements Loadie {
103
  $action = 'el_bundle_license_activate';
104
  $action_text = __( 'Activate', 'email-log' );
105
  $button_class = 'button-primary';
106
- $expires = '';
 
 
107
 
108
  if ( $this->is_bundle_license_valid() ) {
109
  $action = 'el_bundle_license_deactivate';
110
  $action_text = __( 'Deactivate', 'email-log' );
111
  $button_class = '';
112
  $expiry_date = date( 'F d, Y', strtotime( $this->get_bundle_license_expiry_date() ) );
113
- $expires = sprintf( __( 'Your license expires on %s', 'email-log' ), $expiry_date );
 
 
 
 
 
 
 
 
 
114
  }
115
  ?>
116
 
@@ -135,7 +146,9 @@ final class Licenser implements Loadie {
135
  <input type="submit" class="button button-large <?php echo sanitize_html_class( $button_class ); ?>"
136
  value="<?php echo esc_attr( $action_text ); ?>">
137
 
138
- <p class="expires"><?php echo esc_html( $expires ); ?></p>
 
 
139
 
140
  <input type="hidden" name="el-action" value="<?php echo esc_attr( $action ); ?>">
141
 
@@ -159,7 +172,7 @@ final class Licenser implements Loadie {
159
  _e( 'Install it', 'email-log' );
160
  echo '</a>';
161
  } else {
162
- echo '<a href="https://wpemaillog.com/addons/more-fields/?utm_campaign=Upsell&utm_medium=wpadmin&utm_source=inline&utm_content=mf" style="color:red">';
163
  _e( 'Buy Now', 'email-log' );
164
  echo '</a>';
165
  }
@@ -312,4 +325,13 @@ final class Licenser implements Loadie {
312
 
313
  return '';
314
  }
 
 
 
 
 
 
 
 
 
315
  }
103
  $action = 'el_bundle_license_activate';
104
  $action_text = __( 'Activate', 'email-log' );
105
  $button_class = 'button-primary';
106
+
107
+ $expiry_details = '';
108
+ $expiry_details_class = '';
109
 
110
  if ( $this->is_bundle_license_valid() ) {
111
  $action = 'el_bundle_license_deactivate';
112
  $action_text = __( 'Deactivate', 'email-log' );
113
  $button_class = '';
114
  $expiry_date = date( 'F d, Y', strtotime( $this->get_bundle_license_expiry_date() ) );
115
+
116
+ if ( $this->bundle_license->has_expired() ) {
117
+ /* translators: 1 License expiry date, 2 License Renewal link */
118
+ $expiry_details = sprintf( __( 'Your license has expired on %1$s. Please <a href="%2$s">renew it</a> to receive automatic updates and support.', 'email-log' ), $expiry_date, esc_url( $this->bundle_license->get_renewal_link() ) );
119
+ $expiry_details_class = 'notice notice-warning';
120
+ } else {
121
+ /* translators: 1 License expiry date */
122
+ $expiry_details = sprintf( __( 'Your license is valid till %s', 'email-log' ), $expiry_date );
123
+ $expiry_details_class = 'expires';
124
+ }
125
  }
126
  ?>
127
 
146
  <input type="submit" class="button button-large <?php echo sanitize_html_class( $button_class ); ?>"
147
  value="<?php echo esc_attr( $action_text ); ?>">
148
 
149
+ <p class="<?php echo esc_attr( $expiry_details_class ); ?>">
150
+ <?php echo $expiry_details; ?>
151
+ </p>
152
 
153
  <input type="hidden" name="el-action" value="<?php echo esc_attr( $action ); ?>">
154
 
172
  _e( 'Install it', 'email-log' );
173
  echo '</a>';
174
  } else {
175
+ echo '<a rel="noopener" target="_blank" href="https://wpemaillog.com/addons/more-fields/?utm_campaign=Upsell&utm_medium=wpadmin&utm_source=inline&utm_content=mf" style="color:red">';
176
  _e( 'Buy Now', 'email-log' );
177
  echo '</a>';
178
  }
325
 
326
  return '';
327
  }
328
+
329
+ /**
330
+ * Return the bundle license.
331
+ *
332
+ * @return \EmailLog\Addon\License\BundleLicense|null Bundle license or null if no bundle license.
333
+ */
334
+ public function get_bundle_license() {
335
+ return $this->bundle_license;
336
+ }
337
  }
include/Core/DB/TableManager.php CHANGED
@@ -4,6 +4,7 @@
4
  * Handle installation and db table creation.
5
  */
6
  use EmailLog\Core\Loadie;
 
7
 
8
  defined( 'ABSPATH' ) || exit; // Exit if accessed directly.
9
 
@@ -21,7 +22,7 @@ class TableManager implements Loadie {
21
  const DB_OPTION_NAME = 'email-log-db';
22
 
23
  /* Database version */
24
- const DB_VERSION = '0.1';
25
 
26
  /**
27
  * Setup hooks.
@@ -30,6 +31,9 @@ class TableManager implements Loadie {
30
  add_action( 'wpmu_new_blog', array( $this, 'create_table_for_new_blog' ) );
31
 
32
  add_filter( 'wpmu_drop_tables', array( $this, 'delete_table_from_deleted_blog' ) );
 
 
 
33
  }
34
 
35
  /**
@@ -41,16 +45,15 @@ class TableManager implements Loadie {
41
  if ( is_multisite() && $network_wide ) {
42
  // Note: if there are more than 10,000 blogs or
43
  // if `wp_is_large_network` filter is set, then this may fail.
44
- // TODO: Take care of the deprecated function.
45
- $sites = wp_get_sites();
46
 
47
  foreach ( $sites as $site ) {
48
- switch_to_blog( $site['blog_id'] );
49
- $this->create_table();
50
  restore_current_blog();
51
  }
52
  } else {
53
- $this->create_table();
54
  }
55
  }
56
 
@@ -62,7 +65,7 @@ class TableManager implements Loadie {
62
  public function create_table_for_new_blog( $blog_id ) {
63
  if ( is_plugin_active_for_network( 'email-log/email-log.php' ) ) {
64
  switch_to_blog( $blog_id );
65
- $this->create_table();
66
  restore_current_blog();
67
  }
68
  }
@@ -154,16 +157,29 @@ class TableManager implements Loadie {
154
  /**
155
  * Fetch log item by ID.
156
  *
157
- * @param array $ids Optional. Array of IDs of the log items to be retrieved.
 
 
 
 
 
 
 
158
  *
159
  * @return array Log item(s).
160
  */
161
- public function fetch_log_items_by_id( $ids = array() ) {
162
  global $wpdb;
163
  $table_name = $this->get_log_table_name();
164
 
165
  $query = "SELECT * FROM {$table_name}";
166
 
 
 
 
 
 
 
167
  if ( ! empty( $ids ) ) {
168
  $ids = array_map( 'absint', $ids );
169
 
@@ -179,6 +195,11 @@ class TableManager implements Loadie {
179
  /**
180
  * Fetch log items.
181
  *
 
 
 
 
 
182
  * @param array $request Request object.
183
  * @param int $per_page Entries per page.
184
  * @param int $current_page_no Current page no.
@@ -193,9 +214,74 @@ class TableManager implements Loadie {
193
  $count_query = 'SELECT count(*) FROM ' . $table_name;
194
  $query_cond = '';
195
 
196
- if ( isset( $request['s'] ) && $request['s'] !== '' ) {
197
  $search_term = trim( esc_sql( $request['s'] ) );
198
- $query_cond .= " WHERE ( to_email LIKE '%$search_term%' OR subject LIKE '%$search_term%' ) ";
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
199
  }
200
 
201
  if ( isset( $request['d'] ) && $request['d'] !== '' ) {
@@ -221,7 +307,7 @@ class TableManager implements Loadie {
221
 
222
  // Adjust the query to take pagination into account.
223
  if ( ! empty( $current_page_no ) && ! empty( $per_page ) ) {
224
- $offset = ( $current_page_no - 1 ) * $per_page;
225
  $query_cond .= ' LIMIT ' . (int) $offset . ',' . (int) $per_page;
226
  }
227
 
@@ -235,28 +321,16 @@ class TableManager implements Loadie {
235
  /**
236
  * Create email log table.
237
  *
238
- * @access private
239
- *
240
  * @global object $wpdb
241
  */
242
- private function create_table() {
243
  global $wpdb;
244
 
245
- $table_name = $this->get_log_table_name();
246
- $charset_collate = $wpdb->get_charset_collate();
247
 
248
  if ( $wpdb->get_var( "show tables like '{$table_name}'" ) != $table_name ) {
249
 
250
- $sql = 'CREATE TABLE ' . $table_name . ' (
251
- id mediumint(9) NOT NULL AUTO_INCREMENT,
252
- to_email VARCHAR(100) NOT NULL,
253
- subject VARCHAR(250) NOT NULL,
254
- message TEXT NOT NULL,
255
- headers TEXT NOT NULL,
256
- attachments TEXT NOT NULL,
257
- sent_date timestamp NOT NULL,
258
- PRIMARY KEY (id)
259
- ) ' . $charset_collate . ' ;';
260
 
261
  require_once ABSPATH . 'wp-admin/includes/upgrade.php';
262
  dbDelta( $sql );
@@ -277,4 +351,207 @@ class TableManager implements Loadie {
277
 
278
  return $wpdb->get_var( $query );
279
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
280
  }
4
  * Handle installation and db table creation.
5
  */
6
  use EmailLog\Core\Loadie;
7
+ use EmailLog\Util;
8
 
9
  defined( 'ABSPATH' ) || exit; // Exit if accessed directly.
10
 
22
  const DB_OPTION_NAME = 'email-log-db';
23
 
24
  /* Database version */
25
+ const DB_VERSION = '0.2';
26
 
27
  /**
28
  * Setup hooks.
31
  add_action( 'wpmu_new_blog', array( $this, 'create_table_for_new_blog' ) );
32
 
33
  add_filter( 'wpmu_drop_tables', array( $this, 'delete_table_from_deleted_blog' ) );
34
+
35
+ // Do any DB upgrades.
36
+ $this->update_table_if_needed();
37
  }
38
 
39
  /**
45
  if ( is_multisite() && $network_wide ) {
46
  // Note: if there are more than 10,000 blogs or
47
  // if `wp_is_large_network` filter is set, then this may fail.
48
+ $sites = get_sites();
 
49
 
50
  foreach ( $sites as $site ) {
51
+ switch_to_blog( $site->blog_id );
52
+ $this->create_table_if_needed();
53
  restore_current_blog();
54
  }
55
  } else {
56
+ $this->create_table_if_needed();
57
  }
58
  }
59
 
65
  public function create_table_for_new_blog( $blog_id ) {
66
  if ( is_plugin_active_for_network( 'email-log/email-log.php' ) ) {
67
  switch_to_blog( $blog_id );
68
+ $this->create_table_if_needed();
69
  restore_current_blog();
70
  }
71
  }
157
  /**
158
  * Fetch log item by ID.
159
  *
160
+ * @param array $ids Optional. Array of IDs of the log items to be retrieved.
161
+ * @param array $additional_args {
162
+ * Optional. Array of additional args.
163
+ *
164
+ * @type string $date_column_format MySQL date column format. Refer
165
+ *
166
+ * @link https://dev.mysql.com/doc/refman/5.5/en/date-and-time-functions.html#function_date-format
167
+ * }
168
  *
169
  * @return array Log item(s).
170
  */
171
+ public function fetch_log_items_by_id( $ids = array(), $additional_args = array() ) {
172
  global $wpdb;
173
  $table_name = $this->get_log_table_name();
174
 
175
  $query = "SELECT * FROM {$table_name}";
176
 
177
+ // When `date_column_format` exists, should replace the `$query` var.
178
+ $date_column_format_key = 'date_column_format';
179
+ if ( array_key_exists( $date_column_format_key, $additional_args ) && ! empty( $additional_args[ $date_column_format_key ] ) ) {
180
+ $query = "SELECT DATE_FORMAT(sent_date, \"{$additional_args[ $date_column_format_key ]}\") as sent_date_custom, el.* FROM {$table_name} as el";
181
+ }
182
+
183
  if ( ! empty( $ids ) ) {
184
  $ids = array_map( 'absint', $ids );
185
 
195
  /**
196
  * Fetch log items.
197
  *
198
+ * @since 2.3.0 Implemented Advanced Search. Search queries could look like the following.
199
+ * Example:
200
+ * id: 2
201
+ * to: sudar@sudarmuthu.com
202
+ *
203
  * @param array $request Request object.
204
  * @param int $per_page Entries per page.
205
  * @param int $current_page_no Current page no.
214
  $count_query = 'SELECT count(*) FROM ' . $table_name;
215
  $query_cond = '';
216
 
217
+ if ( isset( $request['s'] ) && is_string( $request['s'] ) && $request['s'] !== '' ) {
218
  $search_term = trim( esc_sql( $request['s'] ) );
219
+
220
+ if ( Util\is_advanced_search_term( $search_term ) ) {
221
+ $predicates = Util\get_advanced_search_term_predicates( $search_term );
222
+
223
+ foreach ( $predicates as $column => $email ) {
224
+ switch ( $column ) {
225
+ case 'id':
226
+ $query_cond .= empty( $query_cond ) ? ' WHERE ' : ' AND ';
227
+ $query_cond .= "id = '$email'";
228
+ break;
229
+ case 'to':
230
+ $query_cond .= empty( $query_cond ) ? ' WHERE ' : ' AND ';
231
+ $query_cond .= "to_email LIKE '%$email%'";
232
+ break;
233
+ case 'email':
234
+ $query_cond .= empty( $query_cond ) ? ' WHERE ' : ' AND ';
235
+ $query_cond .= ' ( '; /* Begin 1st */
236
+ $query_cond .= " ( to_email LIKE '%$email%' OR subject LIKE '%$email%' ) "; /* Begin 2nd & End 2nd */
237
+ $query_cond .= ' OR ';
238
+ $query_cond .= ' ( '; /* Begin 3rd */
239
+ $query_cond .= "headers <> ''";
240
+ $query_cond .= ' AND ';
241
+ $query_cond .= ' ( '; /* Begin 4th */
242
+ $query_cond .= "headers REGEXP '[F|f]rom:.*$email' OR ";
243
+ $query_cond .= "headers REGEXP '[CC|Cc|cc]:.*$email' OR ";
244
+ $query_cond .= "headers REGEXP '[BCC|Bcc|bcc]:.*$email' OR ";
245
+ $query_cond .= "headers REGEXP '[R|r]eply-[T|t]o:.*$email'";
246
+ $query_cond .= ' ) '; /* End 4th */
247
+ $query_cond .= ' ) '; /* End 3rd */
248
+ $query_cond .= ' ) '; /* End 1st */
249
+ break;
250
+ case 'cc':
251
+ $query_cond .= empty( $query_cond ) ? ' WHERE ' : ' AND ';
252
+ $query_cond .= ' ( '; /* Begin 1st */
253
+ $query_cond .= "headers <> ''";
254
+ $query_cond .= ' AND ';
255
+ $query_cond .= ' ( '; /* Begin 2nd */
256
+ $query_cond .= "headers REGEXP '[CC|Cc|cc]:.*$email' ";
257
+ $query_cond .= ' ) '; /* End 2nd */
258
+ $query_cond .= ' ) '; /* End 1st */
259
+ break;
260
+ case 'bcc':
261
+ $query_cond .= empty( $query_cond ) ? ' WHERE ' : ' AND ';
262
+ $query_cond .= ' ( '; /* Begin 1st */
263
+ $query_cond .= "headers <> ''";
264
+ $query_cond .= ' AND ';
265
+ $query_cond .= ' ( '; /* Begin 2nd */
266
+ $query_cond .= "headers REGEXP '[BCC|Bcc|bcc]:.*$email' ";
267
+ $query_cond .= ' ) '; /* End 2nd */
268
+ $query_cond .= ' ) '; /* End 1st */
269
+ break;
270
+ case 'reply-to':
271
+ $query_cond .= empty( $query_cond ) ? ' WHERE ' : ' AND ';
272
+ $query_cond .= ' ( '; /* Begin 1st */
273
+ $query_cond .= "headers <> ''";
274
+ $query_cond .= ' AND ';
275
+ $query_cond .= ' ( '; /* Begin 2nd */
276
+ $query_cond .= "headers REGEXP '[R|r]eply-to:.*$email' ";
277
+ $query_cond .= ' ) '; /* End 2nd */
278
+ $query_cond .= ' ) '; /* End 1st */
279
+ break;
280
+ }
281
+ }
282
+ } else {
283
+ $query_cond .= " WHERE ( to_email LIKE '%$search_term%' OR subject LIKE '%$search_term%' ) ";
284
+ }
285
  }
286
 
287
  if ( isset( $request['d'] ) && $request['d'] !== '' ) {
307
 
308
  // Adjust the query to take pagination into account.
309
  if ( ! empty( $current_page_no ) && ! empty( $per_page ) ) {
310
+ $offset = ( $current_page_no - 1 ) * $per_page;
311
  $query_cond .= ' LIMIT ' . (int) $offset . ',' . (int) $per_page;
312
  }
313
 
321
  /**
322
  * Create email log table.
323
  *
 
 
324
  * @global object $wpdb
325
  */
326
+ public function create_table_if_needed() {
327
  global $wpdb;
328
 
329
+ $table_name = $this->get_log_table_name();
 
330
 
331
  if ( $wpdb->get_var( "show tables like '{$table_name}'" ) != $table_name ) {
332
 
333
+ $sql = $this->get_create_table_query();
 
 
 
 
 
 
 
 
 
334
 
335
  require_once ABSPATH . 'wp-admin/includes/upgrade.php';
336
  dbDelta( $sql );
351
 
352
  return $wpdb->get_var( $query );
353
  }
354
+
355
+ /**
356
+ * Fetches the log item by the item data.
357
+ *
358
+ * Use this method to get the log item when the error instance only returns the log item data.
359
+ *
360
+ * @param array $data Array of Email information. {
361
+ *
362
+ * @type array|string to
363
+ * @type string subject
364
+ * @type string message
365
+ * @type array|string headers
366
+ * @type array|string attachments
367
+ * }
368
+ *
369
+ * @return int
370
+ */
371
+ public function fetch_log_item_by_item_data( $data ) {
372
+ if ( empty( $data ) || ! is_array( $data ) ) {
373
+ return 0;
374
+ }
375
+
376
+ global $wpdb;
377
+ $table_name = $this->get_log_table_name();
378
+
379
+ $query = "SELECT ID FROM {$table_name}";
380
+ $query_cond = '';
381
+ $where = array();
382
+
383
+ // Execute the following `if` conditions only when $data is array.
384
+ if ( array_key_exists( 'to', $data ) ) {
385
+ // Since the value is stored as CSV in DB, convert the values from error data to CSV to compare.
386
+ $to_email = Util\join_array_elements_with_delimiter( $data['to'] );
387
+
388
+ $to_email = trim( esc_sql( $to_email ) );
389
+ $where[] = "to_email = '$to_email'";
390
+ }
391
+
392
+ if ( array_key_exists( 'subject', $data ) ) {
393
+ $subject = trim( esc_sql( $data['subject'] ) );
394
+ $where[] = "subject = '$subject'";
395
+ }
396
+
397
+ if ( array_key_exists( 'attachments', $data ) ) {
398
+ if ( is_array( $data['attachments'] ) ) {
399
+ $attachments = count( $data['attachments'] ) > 0 ? 'true' : 'false';
400
+ } else {
401
+ $attachments = empty( $data['attachments'] ) ? 'false' : 'true';
402
+ }
403
+ $attachments = trim( esc_sql( $attachments ) );
404
+ $where[] = "attachments = '$attachments'";
405
+ }
406
+
407
+ foreach ( $where as $index => $value ) {
408
+ $query_cond .= 0 === $index ? ' WHERE ' : ' AND ';
409
+ $query_cond .= $value;
410
+ }
411
+
412
+ // Get only the latest logged item when multiple rows match.
413
+ $query_cond .= ' ORDER BY id DESC LIMIT 1';
414
+
415
+ $query = $query . $query_cond;
416
+
417
+ return absint( $wpdb->get_var( $query ) );
418
+ }
419
+
420
+ /**
421
+ * Sets email sent status as failed for the given log item.
422
+ *
423
+ * @since 2.3.0
424
+ *
425
+ * @param int $log_item_id ID of the log item whose email sent status should be set to failed.
426
+ */
427
+ public function set_log_item_fail_status_by_id( $log_item_id ) {
428
+ global $wpdb;
429
+ $table_name = $this->get_log_table_name();
430
+
431
+ $wpdb->update(
432
+ $table_name,
433
+ array( 'result' => '0' ),
434
+ array( 'ID' => $log_item_id ),
435
+ array( '%d' ),
436
+ array( '%d' )
437
+ );
438
+ }
439
+
440
+ /**
441
+ * Updates the DB schema.
442
+ *
443
+ * Adds new columns to the Database as of v0.2.
444
+ *
445
+ * @since 2.3.0
446
+ */
447
+ private function update_table_if_needed() {
448
+ $existing_db_version = get_option( self::DB_OPTION_NAME, false );
449
+ $updated_db_version = self::DB_VERSION;
450
+
451
+ // Bail out when the DB version is `0.1` or equals to self::DB_VERSION
452
+ if ( ! $existing_db_version || $existing_db_version !== '0.1' || $existing_db_version === $updated_db_version ) {
453
+ return;
454
+ }
455
+
456
+ $sql = $this->get_create_table_query();
457
+
458
+ require_once ABSPATH . 'wp-admin/includes/upgrade.php';
459
+ dbDelta( $sql );
460
+
461
+ update_option( self::DB_OPTION_NAME, self::DB_VERSION );
462
+ }
463
+
464
+ /**
465
+ * Gets the Create Table query.
466
+ *
467
+ * @since 2.3.0
468
+ *
469
+ * @return string
470
+ */
471
+ private function get_create_table_query() {
472
+ global $wpdb;
473
+ $table_name = $this->get_log_table_name();
474
+ $charset_collate = $wpdb->get_charset_collate();
475
+
476
+ $sql = 'CREATE TABLE ' . $table_name . ' (
477
+ id mediumint(9) NOT NULL AUTO_INCREMENT,
478
+ to_email VARCHAR(500) NOT NULL,
479
+ subject VARCHAR(500) NOT NULL,
480
+ message TEXT NOT NULL,
481
+ headers TEXT NOT NULL,
482
+ attachments TEXT NOT NULL,
483
+ sent_date timestamp NOT NULL,
484
+ attachment_name VARCHAR(1000),
485
+ ip_address VARCHAR(15),
486
+ result TINYINT(1),
487
+ PRIMARY KEY (id)
488
+ ) ' . $charset_collate . ';';
489
+
490
+ return $sql;
491
+ }
492
+
493
+ /**
494
+ * Callback for the Array filter.
495
+ *
496
+ * @since 2.3.0
497
+ *
498
+ * @param string $column A column from the array Columns.
499
+ *
500
+ * @return bool
501
+ */
502
+ private function validate_columns( $column ) {
503
+ return in_array( $column, array( 'to' ), true );
504
+ }
505
+
506
+ /**
507
+ * Query log items by column.
508
+ *
509
+ * @since 2.3.0
510
+ *
511
+ * @param array $columns Key value pair based on which items should be retrieved.
512
+ *
513
+ * @uses \EmailLog\Core\DB\TableManager::validate_columns()
514
+ *
515
+ * @return array|object|null
516
+ */
517
+ public function query_log_items_by_column( $columns ) {
518
+ if ( ! is_array( $columns ) ) {
519
+ return;
520
+ }
521
+
522
+ // Since we support PHP v5.2.4, we cannot use ARRAY_FILTER_USE_KEY
523
+ // TODO: PHP v5.5: Once WordPress updates minimum PHP version to v5.5, start using ARRAY_FILTER_USE_KEY.
524
+ $columns_keys = array_keys( $columns );
525
+ if ( ! array_filter( $columns_keys, array( $this, 'validate_columns' ) ) ) {
526
+ return;
527
+ }
528
+
529
+ global $wpdb;
530
+
531
+ $table_name = $this->get_log_table_name();
532
+ $query = "SELECT id, sent_date, to_email, subject FROM {$table_name}";
533
+ $query_cond = '';
534
+ $where = array();
535
+
536
+ // Execute the following `if` conditions only when $data is array.
537
+ if ( array_key_exists( 'to', $columns ) ) {
538
+ // Since the value is stored as CSV in DB, convert the values from error data to CSV to compare.
539
+ $to_email = Util\join_array_elements_with_delimiter( $columns['to'] );
540
+
541
+ $to_email = trim( esc_sql( $to_email ) );
542
+ $where[] = "to_email = '$to_email'";
543
+
544
+ foreach ( $where as $index => $value ) {
545
+ $query_cond .= 0 === $index ? ' WHERE ' : ' AND ';
546
+ $query_cond .= $value;
547
+ }
548
+
549
+ // Get only the latest logged item when multiple rows match.
550
+ $query_cond .= ' ORDER BY id DESC';
551
+
552
+ $query = $query . $query_cond;
553
+
554
+ return $wpdb->get_results( $query );
555
+ }
556
+ }
557
  }
include/Core/EmailLog.php CHANGED
@@ -17,7 +17,7 @@ class EmailLog {
17
  *
18
  * @var string
19
  */
20
- const VERSION = '2.2.5';
21
 
22
  /**
23
  * Email Log Store URL.
17
  *
18
  * @var string
19
  */
20
+ const VERSION = '2.3.0';
21
 
22
  /**
23
  * Email Log Store URL.
include/Core/EmailLogger.php CHANGED
@@ -13,6 +13,7 @@ class EmailLogger implements Loadie {
13
  */
14
  public function load() {
15
  add_filter( 'wp_mail', array( $this, 'log_email' ) );
 
16
  }
17
 
18
  /**
@@ -30,41 +31,61 @@ class EmailLogger implements Loadie {
30
  * @since Genesis
31
  *
32
  * @param array $mail_info {
33
- * @type string $to
34
- * @type string $subject
35
- * @type string $message
36
- * @type string $headers
37
- * @type string $attachment
 
 
38
  * }
39
  */
40
  $mail_info = apply_filters( 'el_wp_mail_log', $mail_info );
41
 
42
  // Sometimes the array passed to the `wp_mail` filter may not contain all the required keys.
43
- // See https://wordpress.org/support/topic/illegal-string-offset-attachments/
44
- $mail_info = wp_parse_args( $mail_info, array(
45
- 'attachments' => array(),
46
- 'to' => '',
47
- 'subject' => '',
48
- 'headers' => '',
49
- ) );
 
 
 
50
 
 
51
  $data = array(
52
- 'attachments' => ( count( $mail_info['attachments'] ) > 0 ) ? 'true' : 'false',
53
- 'to_email' => is_array( $mail_info['to'] ) ? implode( ',', $mail_info['to'] ) : $mail_info['to'],
54
- 'subject' => $mail_info['subject'],
55
- 'headers' => is_array( $mail_info['headers'] ) ? implode( "\n", $mail_info['headers'] ) : $mail_info['headers'],
56
- 'sent_date' => current_time( 'mysql' ),
 
 
 
57
  );
58
 
 
 
 
 
 
 
 
 
 
 
 
59
  $message = '';
60
 
61
- if ( isset( $mail_info['message'] ) ) {
62
- $message = $mail_info['message'];
63
  } else {
64
  // wpmandrill plugin is changing "message" key to "html". See https://github.com/sudar/email-log/issues/20
65
  // Ideally this should be fixed in wpmandrill, but I am including this hack here till it is fixed by them.
66
- if ( isset( $mail_info['html'] ) ) {
67
- $message = $mail_info['html'];
68
  }
69
  }
70
 
@@ -72,6 +93,50 @@ class EmailLogger implements Loadie {
72
 
73
  $email_log->table_manager->insert_log( $data );
74
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
75
  return $mail_info;
76
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
77
  }
13
  */
14
  public function load() {
15
  add_filter( 'wp_mail', array( $this, 'log_email' ) );
16
+ add_action( 'wp_mail_failed', array( $this, 'update_email_fail_status' ) );
17
  }
18
 
19
  /**
31
  * @since Genesis
32
  *
33
  * @param array $mail_info {
34
+ * @type string|array $to
35
+ * @type string $subject
36
+ * @type string $message
37
+ * @type string $headers
38
+ * @type string $attachment
39
+ * @type string|array $headers
40
+ * @type string|array $attachment
41
  * }
42
  */
43
  $mail_info = apply_filters( 'el_wp_mail_log', $mail_info );
44
 
45
  // Sometimes the array passed to the `wp_mail` filter may not contain all the required keys.
46
+ // See https://wordpress.org/support/topic/illegal-string-offset-attachments/.
47
+ $cleaned_mail_info = wp_parse_args(
48
+ $mail_info,
49
+ array(
50
+ 'attachments' => array(),
51
+ 'to' => '',
52
+ 'subject' => '',
53
+ 'headers' => '',
54
+ )
55
+ );
56
 
57
+ // ! empty() check on attachments handles both empty string and empty array.
58
  $data = array(
59
+ 'attachments' => ( ! empty( $cleaned_mail_info['attachments'] ) ) ? 'true' : 'false',
60
+ 'subject' => $cleaned_mail_info['subject'],
61
+ 'headers' => is_array( $cleaned_mail_info['headers'] ) ? implode( "\n", $cleaned_mail_info['headers'] ) : $cleaned_mail_info['headers'],
62
+ 'sent_date' => current_time( 'mysql' ),
63
+ 'attachment_name' => implode( ',', $cleaned_mail_info['attachments'] ),
64
+ // TODO: Improve the Client's IP using https://www.virendrachandak.com/techtalk/getting-real-client-ip-address-in-php-2/.
65
+ 'ip_address' => $_SERVER['REMOTE_ADDR'],
66
+ 'result' => 1,
67
  );
68
 
69
+ $to = '';
70
+ if ( empty( $cleaned_mail_info['to'] ) ) {
71
+ $to = '';
72
+ } elseif ( is_array( $cleaned_mail_info['to'] ) ) {
73
+ $to = implode( ',', $cleaned_mail_info['to'] );
74
+ } else {
75
+ $to = $cleaned_mail_info['to'];
76
+ }
77
+
78
+ $data['to_email'] = $to;
79
+
80
  $message = '';
81
 
82
+ if ( isset( $cleaned_mail_info['message'] ) ) {
83
+ $message = $cleaned_mail_info['message'];
84
  } else {
85
  // wpmandrill plugin is changing "message" key to "html". See https://github.com/sudar/email-log/issues/20
86
  // Ideally this should be fixed in wpmandrill, but I am including this hack here till it is fixed by them.
87
+ if ( isset( $cleaned_mail_info['html'] ) ) {
88
+ $message = $cleaned_mail_info['html'];
89
  }
90
  }
91
 
93
 
94
  $email_log->table_manager->insert_log( $data );
95
 
96
+ /**
97
+ * Fires the `el_email_log_inserted` action right after the log is inserted in to DB.
98
+ *
99
+ * @param array $data {
100
+ * @type string $to
101
+ * @type string $subject
102
+ * @type string $message
103
+ * @type string $headers
104
+ * @type string $attachments
105
+ * @type string $sent_date
106
+ * }
107
+ */
108
+ do_action( 'el_email_log_inserted', $data );
109
+
110
  return $mail_info;
111
  }
112
+
113
+ /**
114
+ * Updates the failed email in the DB.
115
+ *
116
+ * @since 2.3.0
117
+ *
118
+ * @param \WP_Error $wp_error The error instance.
119
+ */
120
+ public function update_email_fail_status( $wp_error ) {
121
+ if ( ! ( $wp_error instanceof \WP_Error ) ) {
122
+ return;
123
+ }
124
+
125
+ $email_log = email_log();
126
+ $mail_error_data = $wp_error->get_error_data( 'wp_mail_failed' );
127
+
128
+ // $mail_error_data can be of type mixed.
129
+ if ( ! is_array( $mail_error_data ) ) {
130
+ return;
131
+ }
132
+
133
+ // @see wp-includes/pluggable.php#484
134
+ $log_item_id = $email_log->table_manager->fetch_log_item_by_item_data( $mail_error_data );
135
+ // Empty will handle 0 and return FALSE.
136
+ if ( empty( $log_item_id ) ) {
137
+ return;
138
+ }
139
+
140
+ $email_log->table_manager->set_log_item_fail_status_by_id( $log_item_id );
141
+ }
142
  }
include/Core/Request/LogListAction.php CHANGED
@@ -84,7 +84,7 @@ class LogListAction implements Loadie {
84
  </div>
85
 
86
  <div id="tabs-preview">
87
- <?php echo wp_kses_post( $log_item['message'] ); ?>
88
  </div>
89
  </div>
90
 
@@ -106,6 +106,10 @@ class LogListAction implements Loadie {
106
  * @param array $data Request data.
107
  */
108
  public function delete_logs( $data ) {
 
 
 
 
109
  $ids = $data['email-log'];
110
 
111
  if ( ! is_array( $ids ) ) {
@@ -187,4 +191,29 @@ class LogListAction implements Loadie {
187
 
188
  return $email_log->table_manager;
189
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
190
  }
84
  </div>
85
 
86
  <div id="tabs-preview">
87
+ <?php echo wp_kses( $log_item['message'], $this->el_kses_allowed_html( 'post' ) ); ?>
88
  </div>
89
  </div>
90
 
106
  * @param array $data Request data.
107
  */
108
  public function delete_logs( $data ) {
109
+ if ( ! is_array( $data ) || ! array_key_exists( 'email-log', $data ) ) {
110
+ return;
111
+ }
112
+
113
  $ids = $data['email-log'];
114
 
115
  if ( ! is_array( $ids ) ) {
191
 
192
  return $email_log->table_manager;
193
  }
194
+
195
+ /**
196
+ * Allows `<link>` tag in wp_kses().
197
+ *
198
+ * Gets the list of allowed HTML for the `post` context.
199
+ * Appends <link> tag to the above list and returns the array.
200
+ *
201
+ * @since 2.3.0
202
+ *
203
+ * @param string $context Optional. Default `post`. The context for which to retrieve tags.
204
+ *
205
+ * @return array List of allowed tags and their allowed attributes.
206
+ */
207
+ protected function el_kses_allowed_html( $context = 'post' ) {
208
+ $allowed_tags = wp_kses_allowed_html( $context );
209
+
210
+ $allowed_tags['link'] = array(
211
+ 'rel' => true,
212
+ 'href' => true,
213
+ 'type' => true,
214
+ 'media' => true,
215
+ );
216
+
217
+ return $allowed_tags;
218
+ }
219
  }
include/Core/UI/Component/AdminUIEnhancer.php CHANGED
@@ -65,7 +65,7 @@ class AdminUIEnhancer {
65
  */
66
  public function insert_addon_store_link( $links, $file ) {
67
  if ( $file === $this->plugin_basename ) {
68
- $links[] = '<a href="https://wpemaillog.com/store/?utm_campaign=Upsell&utm_medium=wpadmin&utm_source=plugin-page" target="_blank">' .
69
  __( 'Buy Addons', 'email-log' ) . '</a>';
70
  }
71
 
@@ -75,13 +75,16 @@ class AdminUIEnhancer {
75
  /**
76
  * Add link to 'View logs' page in plugin listing page.
77
  *
 
 
78
  * @param array $links List of links.
79
  *
80
  * @return array Modified list of links.
81
  */
82
  public function insert_view_logs_link( $links ) {
83
- $settings_link = '<a href="admin.php?page=email-log">' . __( 'View Logs', 'email-log' ) . '</a>';
84
- array_unshift( $links, $settings_link );
 
85
 
86
  return $links;
87
  }
65
  */
66
  public function insert_addon_store_link( $links, $file ) {
67
  if ( $file === $this->plugin_basename ) {
68
+ $links[] = '<a href="https://wpemaillog.com/store/?utm_campaign=Upsell&utm_medium=wpadmin&utm_source=plugin-page" rel="noopener" target="_blank">' .
69
  __( 'Buy Addons', 'email-log' ) . '</a>';
70
  }
71
 
75
  /**
76
  * Add link to 'View logs' page in plugin listing page.
77
  *
78
+ * @since 2.4.0 Added Settings link.
79
+ *
80
  * @param array $links List of links.
81
  *
82
  * @return array Modified list of links.
83
  */
84
  public function insert_view_logs_link( $links ) {
85
+ $view_logs_link = '<a href="admin.php?page=email-log">' . __( 'View Logs', 'email-log' ) . '</a>';
86
+ $settings_link = '<a href="admin.php?page=email-log-settings">' . __( 'Settings', 'email-log' ) . '</a>';
87
+ array_unshift( $links, $view_logs_link, $settings_link );
88
 
89
  return $links;
90
  }
include/Core/UI/Component/DashboardWidget.php CHANGED
@@ -1,6 +1,7 @@
1
  <?php namespace EmailLog\Core\UI\Component;
2
 
3
  use EmailLog\Core\Loadie;
 
4
 
5
  defined( 'ABSPATH' ) || exit; // Exit if accessed directly.
6
 
@@ -40,9 +41,11 @@ class DashboardWidget implements Loadie {
40
  ?>
41
 
42
  <p>
43
- <?php _e( 'Total number of emails logged' , 'email-log' ); ?>: <strong><?php echo absint( $logs_count ); ?></strong>
44
  </p>
45
 
 
 
46
  <ul class="subsubsub" style="float: none">
47
  <li><?php printf( __( '<a href="%s">Email Logs</a>', 'email-log' ), 'admin.php?page=email-log' ); ?> <span style="color: #ddd"> | </span></li>
48
  <li><?php printf( __( '<a href="%s">Settings</a>', 'email-log' ), 'admin.php?page=email-log-settings' ); ?> <span style="color: #ddd"> | </span></li>
1
  <?php namespace EmailLog\Core\UI\Component;
2
 
3
  use EmailLog\Core\Loadie;
4
+ use EmailLog\Util;
5
 
6
  defined( 'ABSPATH' ) || exit; // Exit if accessed directly.
7
 
41
  ?>
42
 
43
  <p>
44
+ <?php _e( 'Total number of emails logged' , 'email-log' ); ?>: <strong><?php echo number_format( absint( $logs_count ), 0, ',', ',' ); ?></strong>
45
  </p>
46
 
47
+ <?php Util\render_auto_delete_logs_next_run_schedule(); ?>
48
+
49
  <ul class="subsubsub" style="float: none">
50
  <li><?php printf( __( '<a href="%s">Email Logs</a>', 'email-log' ), 'admin.php?page=email-log' ); ?> <span style="color: #ddd"> | </span></li>
51
  <li><?php printf( __( '<a href="%s">Settings</a>', 'email-log' ), 'admin.php?page=email-log-settings' ); ?> <span style="color: #ddd"> | </span></li>
include/Core/UI/Component/EmailLogSystemInfo.php ADDED
@@ -0,0 +1,156 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace EmailLog\Core\UI\Component;
4
+
5
+ use EmailLog\Core\DB\TableManager;
6
+ use EmailLog\Core\EmailLog;
7
+ use Sudar\WPSystemInfo\SystemInfo;
8
+
9
+ defined( 'ABSPATH' ) || exit; // Exit if accessed directly.
10
+
11
+ /**
12
+ * Email Log System Info.
13
+ *
14
+ * Uses the WPSystemInfo library.
15
+ *
16
+ * @since 2.3.0
17
+ * @link https://github.com/sudar/wp-system-info
18
+ */
19
+ class EmailLogSystemInfo extends SystemInfo {
20
+
21
+ /**
22
+ * Setup hooks and filters.
23
+ */
24
+ public function load() {
25
+ add_action( 'before_system_info_for_email-log', array( $this, 'print_email_log_details' ) );
26
+ add_action( 'before_system_info_for_email-log', array( $this, 'print_email_log_license_details' ) );
27
+ }
28
+
29
+ /**
30
+ * Print details about Email Log.
31
+ *
32
+ * PHPCS is disabled for this function since alignment will mess up the system info output.
33
+ * phpcs:disable
34
+ */
35
+ public function print_email_log_details() {
36
+ $email_log = email_log();
37
+
38
+ $email_log_core = get_option( 'email-log-core' );
39
+ ?>
40
+ -- Email Log Configuration --
41
+
42
+ Email Log Version: <?php echo EmailLog::VERSION . "\n"; ?>
43
+ Number of Logs: <?php echo $email_log->table_manager->get_logs_count() . "\n"; ?>
44
+ Email Log DB Version: <?php echo get_option( TableManager::DB_OPTION_NAME ) . "\n"; ?>
45
+ <?php if ( is_array( $email_log_core ) ) : ?>
46
+ Additional allowed user roles: <?php echo implode( ', ', $email_log_core['allowed_user_roles'] ) . "\n"; ?>
47
+ Remove All Data on Uninstallation: <?php echo $email_log_core['remove_on_uninstall'] !== '' ? 'Yes' : 'No' . "\n"; ?>
48
+ Disable DashBoard Widget: <?php echo $email_log_core['hide_dashboard_widget'] === 'true' ? 'Yes' : 'No' . "\n"; ?>
49
+ <?php endif; ?>
50
+
51
+ <?php
52
+ }
53
+ // phpcs:enable
54
+
55
+ /**
56
+ * Print details about Email Log Licenses.
57
+ */
58
+ public function print_email_log_license_details() {
59
+ $bundle_license = $this->get_bundle_license();
60
+
61
+ if ( ! is_null( $bundle_license ) ) {
62
+ $this->print_bundle_license_details( $bundle_license );
63
+ } else {
64
+ $this->print_individual_addon_license();
65
+ }
66
+ }
67
+
68
+ /**
69
+ * Get Bundle license.
70
+ *
71
+ * @return \EmailLog\Addon\License\BundleLicense|null Bundle license or null if no bundle license.
72
+ */
73
+ protected function get_bundle_license() {
74
+ $email_log = email_log();
75
+
76
+ $licenser = $email_log->get_licenser();
77
+ $bundle_license = $licenser->get_bundle_license();
78
+
79
+ $bundle_license_key = $bundle_license->get_license_key();
80
+ if ( ! empty( $bundle_license_key ) ) {
81
+ return $bundle_license;
82
+ }
83
+
84
+ return null;
85
+ }
86
+
87
+ /**
88
+ * Print bundle license details.
89
+ *
90
+ * @param \EmailLog\Addon\License\BundleLicense $bundle_license Bundle license.
91
+ *
92
+ * PHPCS is disabled for this function since alignment will mess up the system info output.
93
+ * phpcs:disable
94
+ */
95
+ protected function print_bundle_license_details( $bundle_license ) {
96
+ ?>
97
+ -- Email Log Bundle License --
98
+
99
+ License Key: <?php echo $bundle_license->get_license_key(), "\n"; ?>
100
+ License Expiry Date: <?php echo $bundle_license->get_expiry_date(), "\n"; ?>
101
+ <?php if ( $bundle_license->is_valid() ) : ?>
102
+ License Valid: <?php echo 'Yes', "\n"; ?>
103
+ <?php else : ?>
104
+ License Valid: <?php echo 'No', "\n"; ?>
105
+ <?php endif; ?>
106
+
107
+ <?php
108
+ }
109
+ // phpcs:enable
110
+
111
+ /**
112
+ * Print license details of individual add-ons.
113
+ *
114
+ * PHPCS is disabled for this function since alignment will mess up the system info output.
115
+ * phpcs:disable
116
+ */
117
+ protected function print_individual_addon_license() {
118
+ $email_log = email_log();
119
+
120
+ $licenser = $email_log->get_licenser();
121
+ $addons = $licenser->get_addon_list()->get_addons();
122
+ ?>
123
+ -- Email Log Addon License --
124
+
125
+ <?php
126
+ foreach ( $addons as $addon ) {
127
+ echo '- ', $addon->name;
128
+
129
+ $license_key = $addon->get_addon_license_key();
130
+
131
+ if ( ! empty( $license_key ) ) {
132
+ $addon_license = $addon->get_license();
133
+ echo ' (', $license_key, ' - ', $addon_license->get_expiry_date(), ')';
134
+ }
135
+
136
+ echo "\n";
137
+ }
138
+ echo "\n";
139
+ }
140
+ // phpcs:enable
141
+
142
+ /**
143
+ * Change the default config.
144
+ *
145
+ * @return array Modified config.
146
+ */
147
+ protected function get_default_config() {
148
+ $config = parent::get_default_config();
149
+
150
+ $config['show_posts'] = false;
151
+ $config['show_taxonomies'] = false;
152
+ $config['show_users'] = false;
153
+
154
+ return $config;
155
+ }
156
+ }
include/Core/UI/ListTable/LogListTable.php CHANGED
@@ -1,5 +1,7 @@
1
  <?php namespace EmailLog\Core\UI\ListTable;
2
 
 
 
3
  if ( ! class_exists( 'WP_List_Table' ) ) {
4
  require_once ABSPATH . WPINC . '/class-wp-list-table.php';
5
  }
@@ -59,16 +61,19 @@ class LogListTable extends \WP_List_Table {
59
  /**
60
  * Returns the list of column and title names.
61
  *
 
62
  * @see WP_List_Table::single_row_columns()
63
  *
 
 
64
  * @return array An associative array containing column information: 'slugs'=>'Visible Titles'.
65
  */
66
  public function get_columns() {
67
  $columns = array(
68
  'cb' => '<input type="checkbox" />', // Render a checkbox instead of text.
69
- 'sent_date' => __( 'Sent at', 'email-log' ),
70
- 'to' => __( 'To', 'email-log' ),
71
- 'subject' => __( 'Subject', 'email-log' ),
72
  );
73
 
74
  /**
@@ -193,7 +198,16 @@ class LogListTable extends \WP_List_Table {
193
  * @return string
194
  */
195
  protected function column_to( $item ) {
196
- return esc_html( $item->to_email );
 
 
 
 
 
 
 
 
 
197
  }
198
 
199
  /**
1
  <?php namespace EmailLog\Core\UI\ListTable;
2
 
3
+ use EmailLog\Util;
4
+
5
  if ( ! class_exists( 'WP_List_Table' ) ) {
6
  require_once ABSPATH . WPINC . '/class-wp-list-table.php';
7
  }
61
  /**
62
  * Returns the list of column and title names.
63
  *
64
+ * @since 2.3.0 Retrieve Column labels using Utility methods.
65
  * @see WP_List_Table::single_row_columns()
66
  *
67
+ * @uses \EmailLog\Util\get_column_label_by_column()
68
+ *
69
  * @return array An associative array containing column information: 'slugs'=>'Visible Titles'.
70
  */
71
  public function get_columns() {
72
  $columns = array(
73
  'cb' => '<input type="checkbox" />', // Render a checkbox instead of text.
74
+ 'sent_date' => Util\get_column_label_by_db_column( 'sent_date' ),
75
+ 'to' => Util\get_column_label_by_db_column( 'to' ),
76
+ 'subject' => Util\get_column_label_by_db_column( 'subject' ),
77
  );
78
 
79
  /**
198
  * @return string
199
  */
200
  protected function column_to( $item ) {
201
+ /**
202
+ * Filters the `To` field before outputting on the table.
203
+ *
204
+ * @since 2.3.0
205
+ *
206
+ * @param string $email `To` field
207
+ */
208
+ $email = apply_filters( 'el_row_email', esc_html( $item->to_email ) );
209
+
210
+ return $email;
211
  }
212
 
213
  /**
include/Core/UI/Page/BasePage.php CHANGED
@@ -51,13 +51,13 @@ abstract class BasePage implements Loadie {
51
  '<p>' .
52
  __( 'You can view the logged emails from the View Logs screen. ', 'email-log' ) .
53
  sprintf(
54
- __( 'Check the <a href="%s">documentation about the View Logs screen</a> for more details.', 'email-log' ),
55
  'https://wpemaillog.com/docs/view-logged-email/?utm_campaign=Upsell&utm_medium=wpadmin&utm_source=help&utm_content=docs-content'
56
  ) .
57
  '</p>' .
58
  '<p>' .
59
  sprintf(
60
- __( 'You can perform advanced actions like re-sending email, automatically forwarding emails or export logs with our <a href="%s">premium plugins</a>.', 'email-log' ),
61
  'https://wpemaillog.com/store/?utm_campaign=Upsell&utm_medium=wpadmin&utm_source=help&utm_content=store-content'
62
  ) .
63
  '</p>';
@@ -73,9 +73,9 @@ abstract class BasePage implements Loadie {
73
 
74
  $this->get_screen()->set_help_sidebar(
75
  '<p><strong>' . __( 'More information', 'email-log' ) . '</strong></p>' .
76
- '<p><a href = "https://wpemaillog.com/docs/?utm_campaign=Upsell&utm_medium=wpadmin&utm_source=help&utm_content=docs">' . __( 'Documentation', 'email-log' ) . '</a></p>' .
77
- '<p><a href = "https://wpemaillog.com/support/?utm_campaign=Upsell&utm_medium=wpadmin&utm_source=help&utm_content=support">' . __( 'Support', 'email-log' ) . '</a></p>' .
78
- '<p><a href = "https://wpemaillog.com/store/?utm_campaign=Upsell&utm_medium=wpadmin&utm_source=help&utm_content=store">' . __( 'Add-ons', 'email-log' ) . '</a></p>'
79
  );
80
  }
81
 
51
  '<p>' .
52
  __( 'You can view the logged emails from the View Logs screen. ', 'email-log' ) .
53
  sprintf(
54
+ __( 'Check the <a target="_blank" rel="noopener" href="%s">documentation about the View Logs screen</a> for more details.', 'email-log' ),
55
  'https://wpemaillog.com/docs/view-logged-email/?utm_campaign=Upsell&utm_medium=wpadmin&utm_source=help&utm_content=docs-content'
56
  ) .
57
  '</p>' .
58
  '<p>' .
59
  sprintf(
60
+ __( 'You can perform advanced actions like re-sending email, automatically forwarding emails or export logs with our <a target="_blank" rel="noopener" href="%s">premium plugins</a>.', 'email-log' ),
61
  'https://wpemaillog.com/store/?utm_campaign=Upsell&utm_medium=wpadmin&utm_source=help&utm_content=store-content'
62
  ) .
63
  '</p>';
73
 
74
  $this->get_screen()->set_help_sidebar(
75
  '<p><strong>' . __( 'More information', 'email-log' ) . '</strong></p>' .
76
+ '<p><a target="_blank" rel="noopener" href = "https://wpemaillog.com/docs/?utm_campaign=Upsell&utm_medium=wpadmin&utm_source=help&utm_content=docs">' . __( 'Documentation', 'email-log' ) . '</a></p>' .
77
+ '<p><a target="_blank" rel="noopener" href = "https://wpemaillog.com/support/?utm_campaign=Upsell&utm_medium=wpadmin&utm_source=help&utm_content=support">' . __( 'Support', 'email-log' ) . '</a></p>' .
78
+ '<p><a target="_blank" rel="noopener" href = "https://wpemaillog.com/store/?utm_campaign=Upsell&utm_medium=wpadmin&utm_source=help&utm_content=store">' . __( 'Add-ons', 'email-log' ) . '</a></p>'
79
  );
80
  }
81
 
include/Core/UI/Page/LogListPage.php CHANGED
@@ -100,15 +100,13 @@ class LogListPage extends BasePage {
100
  <h2><?php _e( 'Email Logs', 'email-log' ); ?></h2>
101
  <?php settings_errors(); ?>
102
 
103
- <form id="email-logs-search" method="get">
104
  <input type="hidden" name="page" value="<?php echo esc_attr( self::PAGE_SLUG ); ?>">
105
  <?php $this->log_list_table->search_box( __( 'Search Logs', 'email-log' ), 'search_id' ); ?>
106
- </form>
107
 
108
- <form id="email-logs-filter" method="get">
109
- <input type="hidden" name="page" value="<?php echo esc_attr( $_REQUEST['page'] ); ?>"/>
110
  <?php
111
- wp_nonce_field( self::LOG_LIST_ACTION_NONCE, self::LOG_LIST_ACTION_NONCE_FIELD );
 
112
  $this->log_list_table->display();
113
  ?>
114
  </form>
@@ -214,10 +212,13 @@ class LogListPage extends BasePage {
214
  wp_enqueue_style( 'jquery-ui-css', $plugin_dir_url . 'assets/vendor/jquery-ui/themes/base/jquery-ui.min.css', array(), '1.12.1' );
215
  wp_enqueue_style( 'el-view-logs-css', $plugin_dir_url . 'assets/css/admin/view-logs.css', array( 'jquery-ui-css' ), $email_log->get_version() );
216
 
 
 
 
217
  wp_register_script( 'jquery-ui', $plugin_dir_url . 'assets/vendor/jquery-ui/jquery-ui.min.js', array( 'jquery' ), '1.12.1', true );
218
  wp_register_script( 'insertionQ', $plugin_dir_url . 'assets/vendor/insertionQuery/insQ.min.js', array( 'jquery' ), '1.0.4', true );
219
  wp_enqueue_script( 'jquery-ui-datepicker' );
220
 
221
- wp_enqueue_script( 'el-view-logs', $plugin_dir_url . 'assets/js/admin/view-logs.js', array( 'jquery-ui', 'jquery-ui-datepicker', 'insertionQ' ), $email_log->get_version(), true );
222
  }
223
  }
100
  <h2><?php _e( 'Email Logs', 'email-log' ); ?></h2>
101
  <?php settings_errors(); ?>
102
 
103
+ <form id="email-logs-list" method="get">
104
  <input type="hidden" name="page" value="<?php echo esc_attr( self::PAGE_SLUG ); ?>">
105
  <?php $this->log_list_table->search_box( __( 'Search Logs', 'email-log' ), 'search_id' ); ?>
 
106
 
 
 
107
  <?php
108
+ // Disable the output of referrer hidden field, since it will be generated by the log list table.
109
+ wp_nonce_field( self::LOG_LIST_ACTION_NONCE, self::LOG_LIST_ACTION_NONCE_FIELD, false );
110
  $this->log_list_table->display();
111
  ?>
112
  </form>
212
  wp_enqueue_style( 'jquery-ui-css', $plugin_dir_url . 'assets/vendor/jquery-ui/themes/base/jquery-ui.min.css', array(), '1.12.1' );
213
  wp_enqueue_style( 'el-view-logs-css', $plugin_dir_url . 'assets/css/admin/view-logs.css', array( 'jquery-ui-css' ), $email_log->get_version() );
214
 
215
+ // @see bower.json file for the Version.
216
+ wp_enqueue_style( 'jquery-ui-smoothness', $plugin_dir_url . 'assets/vendor/jquery-ui/themes/smoothness/jquery-ui.min.css', array( 'jquery-ui-css' ), '1.12.1' );
217
+
218
  wp_register_script( 'jquery-ui', $plugin_dir_url . 'assets/vendor/jquery-ui/jquery-ui.min.js', array( 'jquery' ), '1.12.1', true );
219
  wp_register_script( 'insertionQ', $plugin_dir_url . 'assets/vendor/insertionQuery/insQ.min.js', array( 'jquery' ), '1.0.4', true );
220
  wp_enqueue_script( 'jquery-ui-datepicker' );
221
 
222
+ wp_enqueue_script( 'el-view-logs', $plugin_dir_url . 'assets/js/admin/view-logs.js', array( 'jquery-ui', 'jquery-ui-datepicker', 'insertionQ', 'jquery-ui-tooltip' ), $email_log->get_version(), true );
223
  }
224
  }
include/Core/UI/Page/SystemInfoPage.php ADDED
@@ -0,0 +1,110 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php namespace EmailLog\Core\UI\Page;
2
+
3
+ use EmailLog\Core\UI\Component\EmailLogSystemInfo;
4
+
5
+ defined( 'ABSPATH' ) || exit; // Exit if accessed directly.
6
+
7
+ /**
8
+ * System Info Page.
9
+ *
10
+ * This page displays information about the current WordPress install that can be used in support requests.
11
+ *
12
+ * @since 2.3.0
13
+ */
14
+ class SystemInfoPage extends BasePage {
15
+ const PAGE_SLUG = 'email-log-system-info';
16
+
17
+ /**
18
+ * Capability to Manage system info.
19
+ */
20
+ const CAPABILITY = 'manage_email_logs';
21
+
22
+ /**
23
+ * SystemInfo class.
24
+ *
25
+ * @var EmailLogSystemInfo
26
+ */
27
+ protected $system_info;
28
+
29
+ public function load() {
30
+ parent::load();
31
+
32
+ add_action( 'el-download-system-info', array( $this, 'download_system_info' ) );
33
+
34
+ $this->system_info = new EmailLogSystemInfo( 'email-log' );
35
+ $this->system_info->load();
36
+ }
37
+
38
+ public function register_page() {
39
+ $this->page = add_submenu_page(
40
+ LogListPage::PAGE_SLUG,
41
+ __( 'System Info', 'email-log' ),
42
+ __( 'System Info', 'email-log' ),
43
+ self::CAPABILITY,
44
+ self::PAGE_SLUG,
45
+ array( $this, 'render_page' )
46
+ );
47
+
48
+ add_action( "load-{$this->page}", array( $this, 'render_help_tab' ) );
49
+
50
+ /**
51
+ * Fires before loading Sytem Info page.
52
+ *
53
+ * @since 2.3.0
54
+ *
55
+ * @param string $page Page slug.
56
+ */
57
+ do_action( 'el_load_system_info_page', $this->page );
58
+ }
59
+
60
+ /**
61
+ * Render the page.
62
+ */
63
+ public function render_page() {
64
+ ?>
65
+
66
+ <form method="post">
67
+ <div class="updated">
68
+ <p>
69
+ <strong>
70
+ <?php _e( 'Please include this information when posting support requests.', 'email-log' ); ?>
71
+ </strong>
72
+ </p>
73
+ </div>
74
+
75
+ <?php if ( defined( 'DISABLE_WP_CRON' ) && DISABLE_WP_CRON ) : ?>
76
+ <div class="notice notice-warning">
77
+ <p><strong>
78
+ <?php printf( __( 'DISABLE_WP_CRON is <a href="%s" rel="noopener" target="_blank">enabled</a>. This prevents scheduler from running.', 'email-log' ), 'https://codex.wordpress.org/Editing_wp-config.php#Disable_Cron_and_Cron_Timeout' ); ?>
79
+ </strong></p>
80
+ </div>
81
+ <?php endif; ?>
82
+
83
+ <div class="wrap">
84
+ <h1><?php _e( 'Email Log - System Info', 'email-log' ); ?></h1>
85
+
86
+ <?php
87
+ $this->system_info->render();
88
+ ?>
89
+
90
+ <p class="submit">
91
+ <input type="hidden" name="el-action" value="el-download-system-info">
92
+ <?php
93
+ wp_nonce_field( 'el-download-system-info', 'el-download-system-info_nonce', false );
94
+ submit_button( __( 'Download System Info File', 'email-log' ), 'primary', 'el-download-system-info', false );
95
+ ?>
96
+ </p>
97
+ </div>
98
+ </form>
99
+
100
+ <?php
101
+ $this->render_page_footer();
102
+ }
103
+
104
+ /**
105
+ * Download System info file.
106
+ */
107
+ public function download_system_info() {
108
+ $this->system_info->download_as_file();
109
+ }
110
+ }
include/Core/UI/Setting/CoreSetting.php CHANGED
@@ -1,5 +1,7 @@
1
  <?php namespace EmailLog\Core\UI\Setting;
2
 
 
 
3
  defined( 'ABSPATH' ) || exit; // Exit if accessed directly.
4
 
5
  /**
@@ -15,13 +17,23 @@ class CoreSetting extends Setting {
15
  $this->section->option_name = 'email-log-core';
16
 
17
  $this->section->field_labels = array(
18
- 'allowed_user_roles' => __( 'Allowed User Roles', 'email-log' ),
19
- 'remove_on_uninstall' => __( 'Remove Data on Uninstall?', 'email-log' ),
 
 
20
  );
21
 
22
  $this->section->default_value = array(
23
- 'allowed_user_roles' => array(),
24
- 'remove_on_uninstall' => '',
 
 
 
 
 
 
 
 
25
  );
26
 
27
  $this->load();
@@ -37,6 +49,9 @@ class CoreSetting extends Setting {
37
 
38
  add_action( 'add_option_' . $this->section->option_name, array( $this, 'allowed_user_roles_added' ), 10, 2 );
39
  add_action( 'update_option_' . $this->section->option_name, array( $this, 'allowed_user_roles_changed' ), 10, 2 );
 
 
 
40
  }
41
 
42
  /**
@@ -184,4 +199,300 @@ class CoreSetting extends Setting {
184
 
185
  return $user_roles;
186
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
187
  }
1
  <?php namespace EmailLog\Core\UI\Setting;
2
 
3
+ use \EmailLog\Core\UI\Page\SettingsPage;
4
+
5
  defined( 'ABSPATH' ) || exit; // Exit if accessed directly.
6
 
7
  /**
17
  $this->section->option_name = 'email-log-core';
18
 
19
  $this->section->field_labels = array(
20
+ 'allowed_user_roles' => __( 'Allowed User Roles', 'email-log' ),
21
+ 'remove_on_uninstall' => __( 'Remove Data on Uninstall?', 'email-log' ),
22
+ 'hide_dashboard_widget' => __( 'Disable Dashboard Widget', 'email-log' ),
23
+ 'db_size_notification' => __( 'Database Size Notification', 'email-log' ),
24
  );
25
 
26
  $this->section->default_value = array(
27
+ 'allowed_user_roles' => array(),
28
+ 'remove_on_uninstall' => '',
29
+ 'hide_dashboard_widget' => false,
30
+ 'db_size_notification' => array(
31
+ 'notify' => false,
32
+ 'admin_email' => '',
33
+ 'logs_threshold' => '',
34
+ 'log_threshold_met' => false,
35
+ 'threshold_email_last_sent' => false,
36
+ ),
37
  );
38
 
39
  $this->load();
49
 
50
  add_action( 'add_option_' . $this->section->option_name, array( $this, 'allowed_user_roles_added' ), 10, 2 );
51
  add_action( 'update_option_' . $this->section->option_name, array( $this, 'allowed_user_roles_changed' ), 10, 2 );
52
+
53
+ add_action( 'el_email_log_inserted', array( $this, 'verify_email_log_threshold' ) );
54
+ add_action( 'el_trigger_notify_email_when_log_threshold_met', array( $this, 'trigger_threshold_met_notification_email' ) );
55
  }
56
 
57
  /**
199
 
200
  return $user_roles;
201
  }
202
+
203
+ /**
204
+ * Renders the Email Log `Remove Data on Uninstall?` settings.
205
+ *
206
+ * @param array $args
207
+ */
208
+ public function render_hide_dashboard_widget_settings( $args ) {
209
+ $option = $this->get_value();
210
+ $hide_dashboard_widget = $option[ $args['id'] ];
211
+
212
+ $field_name = $this->section->option_name . '[' . $args['id'] . ']';
213
+ ?>
214
+
215
+ <input type="checkbox" name="<?php echo esc_attr( $field_name ); ?>" value="true" <?php checked( 'true', $hide_dashboard_widget ); ?>>
216
+ <?php _e( 'Check this box if you would like to disable dashboard widget.', 'email-log' ) ?>
217
+
218
+ <p>
219
+ <em>
220
+ <?php printf(
221
+ __( '<strong>Note:</strong> Each users can also disable dashboard widget using screen options', 'email-log' )
222
+ ); ?>
223
+ </em>
224
+ </p>
225
+
226
+ <?php
227
+ }
228
+
229
+ /**
230
+ * Renders the Email Log `Database Size Notification` settings.
231
+ *
232
+ * @since 2.3.0
233
+ *
234
+ * @param array $args
235
+ */
236
+ public function render_db_size_notification_settings( $args ) {
237
+ $option = $this->get_value();
238
+ $db_size_notification_data = $option[ $args['id'] ];
239
+
240
+ $field_name = $this->section->option_name . '[' . $args['id'] . ']';
241
+ // Since we store three different fields, give each field a unique name.
242
+ $db_size_notification_field_name = $field_name . '[notify]';
243
+ $admin_email_field_name = $field_name . '[admin_email]';
244
+ $logs_threshold_field_name = $field_name . '[logs_threshold]';
245
+
246
+ $email_log = email_log();
247
+ $logs_count = $email_log->table_manager->get_logs_count();
248
+
249
+ $admin_email_input_field = sprintf(
250
+ '<input type="email" name="%1$s" value="%2$s" size="35" />', esc_attr( $admin_email_field_name ), empty( $db_size_notification_data['admin_email'] ) ? get_option( 'admin_email', '' ) : esc_attr( $db_size_notification_data['admin_email'] ) );
251
+
252
+ $logs_threshold_input_field = sprintf( '<input type="number" name="%1$s" placeholder="5000" value="%2$s" min="0" max="99999999" />',
253
+ esc_attr( $logs_threshold_field_name ),
254
+ empty( $db_size_notification_data['logs_threshold'] ) ? '' : esc_attr( $db_size_notification_data['logs_threshold'] )
255
+ );
256
+ ?>
257
+
258
+ <input type="checkbox" name="<?php echo esc_attr( $db_size_notification_field_name ); ?>" value="true" <?php
259
+ checked( true, $db_size_notification_data['notify'] ); ?> />
260
+ <?php
261
+ // The values within each field are already escaped.
262
+ printf( __( 'Notify %1$s if there are more than %2$s logs.', 'email-log' ),
263
+ $admin_email_input_field,
264
+ $logs_threshold_input_field
265
+ );
266
+ ?>
267
+ <p>
268
+ <em>
269
+ <?php printf(
270
+ __( '%1$s There are %2$s email logs currently logged in the database.', 'email-log' ),
271
+ '<strong>Note:</strong>',
272
+ '<strong>' . esc_attr( $logs_count ) . '</strong>'
273
+ ); ?>
274
+ </em>
275
+ </p>
276
+ <?php if ( ! empty( $db_size_notification_data['threshold_email_last_sent'] ) ) : ?>
277
+ <p>
278
+ <?php printf(
279
+ __( 'Last notification email was sent on %1$s. Click %2$s button to reset sending the notification.', 'email-log' ),
280
+ '<strong>' . get_date_from_gmt( date( 'Y-m-d H:i:s', $db_size_notification_data['threshold_email_last_sent'] ), \EmailLog\Util\get_user_defined_date_time_format() ) . '</strong>',
281
+ '<b>Save</b>'
282
+ ); ?>
283
+ </p>
284
+ <?php endif; ?>
285
+ <?php
286
+ }
287
+
288
+ /**
289
+ * Removes any additional keys set other than the ones in db_size_notification array.
290
+ *
291
+ * @since 2.3.0
292
+ *
293
+ * @param array $arr `db_size_notification` option array.
294
+ *
295
+ * @return array `db_size_notification` option array with keys removed other than the allowed.
296
+ */
297
+ protected function restrict_array_to_db_size_notification_setting_keys( $arr ) {
298
+ $allowed_keys = array_keys( $this->section->default_value['db_size_notification'] );
299
+ $arr_keys = array_keys( $arr );
300
+
301
+ // Return the array when only the allowed keys exist.
302
+ $intersecting_keys = array_intersect( $allowed_keys, $arr_keys );
303
+ if ( count( $allowed_keys ) === count( $intersecting_keys ) ) {
304
+ return $arr;
305
+ }
306
+
307
+ // Otherwise remove keys that aren't expected.
308
+ $diff_keys = array_diff_key( $arr, $allowed_keys );
309
+ foreach ( $diff_keys as $key ) {
310
+ unset( $arr[ $key ] );
311
+ }
312
+
313
+ return $arr;
314
+ }
315
+
316
+ /**
317
+ * Sanitizes the db_size_notification option.
318
+ *
319
+ * @since 2.3.0
320
+ *
321
+ * @param array $db_size_notification_data
322
+ *
323
+ * @return array $db_size_notification_data
324
+ */
325
+ public function sanitize_db_size_notification( $db_size_notification_data ) {
326
+ $db_size_notification_data = $this->restrict_array_to_db_size_notification_setting_keys( $db_size_notification_data );
327
+
328
+ foreach ( $db_size_notification_data as $setting => $value ) {
329
+ if ( 'notify' === $setting ) {
330
+ $db_size_notification_data[ $setting ] = \filter_var( $value, FILTER_VALIDATE_BOOLEAN );
331
+ } elseif ( 'admin_email' === $setting ) {
332
+ $db_size_notification_data[ $setting ] = \sanitize_email( $value );
333
+ } elseif ( 'logs_threshold' === $setting ) {
334
+ $db_size_notification_data[ $setting ] = absint( \sanitize_text_field( $value ) );
335
+ }
336
+ }
337
+
338
+ // wp_parse_args won't merge nested array keys. So add the key here if it is not set.
339
+ if ( ! array_key_exists( 'notify', $db_size_notification_data ) ) {
340
+ $db_size_notification_data['notify'] = false;
341
+ }
342
+ if ( ! array_key_exists( 'log_threshold_met', $db_size_notification_data ) ) {
343
+ $db_size_notification_data['log_threshold_met'] = false;
344
+ }
345
+ if ( ! array_key_exists( 'threshold_email_last_sent', $db_size_notification_data ) ) {
346
+ $db_size_notification_data['threshold_email_last_sent'] = false;
347
+ }
348
+
349
+ return $db_size_notification_data;
350
+ }
351
+
352
+ /**
353
+ * Triggers the Cron to notify admin via email.
354
+ *
355
+ * Email is triggered only when the threshold setting is met.
356
+ *
357
+ * @since 2.3.0
358
+ */
359
+ public function verify_email_log_threshold() {
360
+ $cron_hook = 'el_trigger_notify_email_when_log_threshold_met';
361
+ if ( ! wp_next_scheduled( $cron_hook ) ) {
362
+ wp_schedule_event( time(), 'hourly', $cron_hook );
363
+ }
364
+ }
365
+
366
+ /**
367
+ * Utility method to verify all the given keys exist in the given array.
368
+ *
369
+ * This method helps reduce the Cyclomatic Complexity in its parent method.
370
+ *
371
+ * @since 2.3.0
372
+ *
373
+ * @param array $arr The array whose keys must be checked.
374
+ * @param array $keys All the required keys that the array must contain.
375
+ *
376
+ * @return bool
377
+ */
378
+ protected function has_array_contains_required_keys( $arr, $keys ) {
379
+ $has_keys = true;
380
+
381
+ if ( ! is_array( $arr ) || ! is_array( $keys ) ) {
382
+ return false;
383
+ }
384
+
385
+ foreach ( $arr as $key => $value ) {
386
+ $has_keys = $has_keys && in_array( $key, $keys, true );
387
+ }
388
+
389
+ return $has_keys;
390
+ }
391
+
392
+ /**
393
+ * Send the Threshold notification email to the admin.
394
+ *
395
+ * @since 2.3.0
396
+ */
397
+ public function trigger_threshold_met_notification_email() {
398
+ $email_log = email_log();
399
+ $logs_count = absint( $email_log->table_manager->get_logs_count() );
400
+
401
+ $setting_data = $this->get_value();
402
+
403
+ // Return early.
404
+ if ( ! array_key_exists( 'db_size_notification', $setting_data ) ) {
405
+ return;
406
+ }
407
+
408
+ $db_size_notification_key = 'db_size_notification';
409
+ $db_size_notification_data = $setting_data[ $db_size_notification_key ];
410
+
411
+ // Return early.
412
+ $keys = array_keys( $this->section->default_value['db_size_notification'] );
413
+ if ( ! $this->has_array_contains_required_keys( $db_size_notification_data, $keys ) ) {
414
+ return;
415
+ }
416
+
417
+ $is_notification_enabled = $db_size_notification_data['notify'];
418
+ $admin_email = $db_size_notification_data['admin_email'];
419
+ $logs_threshold = absint( $db_size_notification_data['logs_threshold'] );
420
+ $logs_threshold_met = $db_size_notification_data['log_threshold_met'];
421
+
422
+ // Ideally threshold cannot be 0. Also, skip sending email if it is already sent.
423
+ if ( 0 === $logs_threshold || true === $logs_threshold_met ) {
424
+ return;
425
+ }
426
+
427
+ if ( $logs_count < $logs_threshold ) {
428
+ return;
429
+ }
430
+
431
+ $this->register_threshold_met_admin_notice();
432
+
433
+ if ( $is_notification_enabled && is_email( $admin_email ) ) {
434
+ $subject = sprintf( __( 'Email Log Plugin: Your log threshold of %s has been met', 'email-log' ), $logs_threshold );
435
+ $message = <<<EOT
436
+ <p>This email is generated by the Email Log plugin.</p>
437
+ <p>Your log threshold of $logs_threshold has been met. You may manually delete the logs to keep your database table in size.</p>
438
+ <p>Also, consider using our <a href="https://wpemaillog.com/addons/auto-delete-logs/">Auto Delete Logs</a> plugin to delete the logs automatically.</p>
439
+ EOT;
440
+ $headers = array( 'Content-Type: text/html; charset=UTF-8' );
441
+
442
+ /**
443
+ * Filters Log threshold notification email subject.
444
+ *
445
+ * @since 2.3.0
446
+ *
447
+ * @param string $subject The email subject.
448
+ */
449
+ $subject = apply_filters( 'el_log_threshold_met_notification_email_subject', $subject );
450
+
451
+ /**
452
+ * Filters Log threshold notification email body.
453
+ *
454
+ * @since 2.3.0
455
+ *
456
+ * @param string $message The email body.
457
+ * @param int $logs_threshold The log threshold value set by the user.
458
+ */
459
+ $message = apply_filters( 'el_log_threshold_met_notification_email_body', $message, $logs_threshold );
460
+
461
+ wp_mail( $admin_email, $subject, $message, $headers );
462
+
463
+ $setting_data[ $db_size_notification_key ]['log_threshold_met'] = true;
464
+ $setting_data[ $db_size_notification_key ]['threshold_email_last_sent'] = time();
465
+ \update_option( $this->section->option_name, $setting_data );
466
+ }
467
+ }
468
+
469
+ /**
470
+ * Registers the Email Log threshold met admin notice.
471
+ *
472
+ * @since 2.3.0
473
+ */
474
+ public function register_threshold_met_admin_notice() {
475
+ add_action( 'admin_notices', array( $this, 'render_log_threshold_met_notice' ) );
476
+ }
477
+
478
+ /**
479
+ * Displays the Email Log threshold met admin notice.
480
+ *
481
+ * @since 2.3.0
482
+ */
483
+ public function render_log_threshold_met_notice() {
484
+ $email_log = email_log();
485
+ $logs_count = absint( $email_log->table_manager->get_logs_count() );
486
+ $notice_message = sprintf( __( 'Currently there are %1$s logged, which is more than the threshold that is set in the %2$s screen. You can delete some logs or increase the threshold. You can also use our %3$s add-on to automatically delete logs', 'email-log' ),
487
+ $logs_count . _n( ' email log', ' email logs', $logs_count, 'email-log' ),
488
+ '<a href="' . esc_url( admin_url( 'admin.php?page=' . SettingsPage::PAGE_SLUG ) ) . '">settings</a> screen',
489
+ '<a href="' . esc_url( 'https://wpemaillog.com/addons/auto-delete-logs/' ) . '">Auto Delete Logs</a>'
490
+ );
491
+ ?>
492
+ <div class="notice notice-warning is-dismissible">
493
+ <p><?php echo $notice_message; ?></p>
494
+ </div>
495
+ <?php
496
+ }
497
+
498
  }
include/Core/UI/UILoader.php CHANGED
@@ -45,6 +45,17 @@ class UILoader implements Loadie {
45
  }
46
  }
47
 
 
 
 
 
 
 
 
 
 
 
 
48
  /**
49
  * Initialize UI component Objects.
50
  *
@@ -53,11 +64,11 @@ class UILoader implements Loadie {
53
  * @access protected
54
  */
55
  protected function initialize_components() {
56
- $this->components['core_settings'] = new Setting\CoreSetting();
57
-
58
  if ( current_user_can( LogListPage::CAPABILITY ) ) {
59
  $this->components['admin_ui_enhancer'] = new Component\AdminUIEnhancer();
60
- $this->components['dashboard_widget'] = new Component\DashboardWidget();
 
 
61
  }
62
  }
63
 
@@ -69,8 +80,9 @@ class UILoader implements Loadie {
69
  * @access protected
70
  */
71
  protected function initialize_pages() {
72
- $this->pages['log_list_page'] = new Page\LogListPage();
73
- $this->pages['settings_page'] = new Page\SettingsPage();
74
- $this->pages['addon_list_page'] = new Page\AddonListPage();
 
75
  }
76
  }
45
  }
46
  }
47
 
48
+ public function is_show_dashboard_widget() {
49
+ $this->components['core_settings'] = new Setting\CoreSetting();
50
+ $dashboard_status = false;
51
+ $options = get_option( 'email-log-core' );
52
+ if( isset( $options['hide_dashboard_widget'] ) ) {
53
+ $dashboard_status = $options['hide_dashboard_widget'];
54
+ }
55
+
56
+ return $dashboard_status;
57
+ }
58
+
59
  /**
60
  * Initialize UI component Objects.
61
  *
64
  * @access protected
65
  */
66
  protected function initialize_components() {
 
 
67
  if ( current_user_can( LogListPage::CAPABILITY ) ) {
68
  $this->components['admin_ui_enhancer'] = new Component\AdminUIEnhancer();
69
+ if( ! $this->is_show_dashboard_widget() ) {
70
+ $this->components['dashboard_widget'] = new Component\DashboardWidget();
71
+ }
72
  }
73
  }
74
 
80
  * @access protected
81
  */
82
  protected function initialize_pages() {
83
+ $this->pages['log_list_page'] = new Page\LogListPage();
84
+ $this->pages['settings_page'] = new Page\SettingsPage();
85
+ $this->pages['addon_list_page'] = new Page\AddonListPage();
86
+ $this->pages['system_info_page'] = new Page\SystemInfoPage();
87
  }
88
  }
include/EmailLogAutoloader.php CHANGED
@@ -1,7 +1,7 @@
1
  <?php namespace EmailLog;
2
 
3
  /**
4
- * Autoloader for EmailLog, based on the PSR-4 general purpose implemetation.
5
  *
6
  * @see http://www.php-fig.org/psr/psr-4/
7
  *
1
  <?php namespace EmailLog;
2
 
3
  /**
4
+ * Autoloader for EmailLog, based on the PSR-4 general purpose implementation.
5
  *
6
  * @see http://www.php-fig.org/psr/psr-4/
7
  *
include/Util/helper.php CHANGED
@@ -111,3 +111,189 @@ function checked_array( $values, $current ) {
111
  echo "checked='checked'";
112
  }
113
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
111
  echo "checked='checked'";
112
  }
113
  }
114
+
115
+ /**
116
+ * Returns Comma separated values of the given array elements.
117
+ *
118
+ * Use $delimiter param to join elements other than `,`.
119
+ *
120
+ * @since 2.3.0
121
+ *
122
+ * @param array|string $value The array whose values are to be joined.
123
+ * @param string $delimiter Optional. Default is `,`.
124
+ *
125
+ * @return string
126
+ */
127
+ function join_array_elements_with_delimiter( $value, $delimiter = ',' ) {
128
+ if ( is_array( $value ) ) {
129
+ return implode( $delimiter, $value );
130
+ }
131
+
132
+ return is_string( $value ) ? $value : '';
133
+ }
134
+
135
+ /**
136
+ * Gets the User defined Date time format.
137
+ *
138
+ * @used-by \EmailLog\Core\UI\Setting\CoreSetting
139
+ * @used-by \EmailLog\Util\render_auto_delete_logs_next_run_schedule()
140
+ *
141
+ * @since 2.3.0
142
+ *
143
+ * @return string
144
+ */
145
+ function get_user_defined_date_time_format() {
146
+ return sprintf( '%1$s %2$s', get_option( 'date_format', 'Y-m-d' ), get_option( 'time_format', 'g:i a' ) );
147
+ }
148
+
149
+ /**
150
+ * Renders the next run auto delete logs schedule in Date and time format set within WordPress.
151
+ *
152
+ * @used-by \EmailLog\Addon\UI\Setting\DashboardWidget
153
+ * @used-by \EmailLog\Core\UI\Component\AutoDeleteLogsSetting
154
+ *
155
+ * @since 2.3.0
156
+ */
157
+ function render_auto_delete_logs_next_run_schedule() {
158
+ ?>
159
+ <?php if ( wp_next_scheduled( 'el_scheduled_delete_logs' ) ) : ?>
160
+ <p>
161
+ <?php _e( 'Auto delete logs cron will be triggered next at', 'email-log' ); ?>:
162
+ <?php $date_time_format = get_user_defined_date_time_format(); ?>
163
+ <strong><?php echo get_date_from_gmt( date( 'Y-m-d H:i:s', wp_next_scheduled( 'el_scheduled_delete_logs' ) ), $date_time_format ); ?></strong>
164
+ </p>
165
+ <?php endif; ?>
166
+ <?php
167
+ }
168
+
169
+ /**
170
+ * Gets the value by key from the array.
171
+ *
172
+ * If the key isn't found, then null is returned.
173
+ *
174
+ * @since 2.3.0
175
+ *
176
+ * @param array $array The actual array.
177
+ * @param string $key The key whose value is to be retrieved.
178
+ * @param string $default Optional.
179
+ *
180
+ * @return mixed|null
181
+ */
182
+ function el_array_get( $array, $key, $default = null ) {
183
+ return isset( $array[ $key ] ) ? $array[ $key ] : $default;
184
+ }
185
+
186
+ /**
187
+ * Returns TRUE if the given search term is Advanced Search Term.
188
+ *
189
+ * @param string $term Search Term.
190
+ *
191
+ * @return bool
192
+ */
193
+ function is_advanced_search_term( $term ) {
194
+ if ( ! is_string( $term ) ) {
195
+ return false;
196
+ }
197
+
198
+ $predicates = get_advanced_search_term_predicates( $term );
199
+
200
+ return ! empty( $predicates );
201
+ }
202
+
203
+ /**
204
+ * Gets the Search Term Predicates.
205
+ *
206
+ * Example:
207
+ *
208
+ * If $term = to:admin@local.wordpress.test then,
209
+ *
210
+ * the output would be
211
+ *
212
+ * $output = array(
213
+ * 'to' => admin@local.wordpress.test
214
+ * )
215
+ *
216
+ * @since 2.3.0
217
+ *
218
+ * @param string $term Search Term.
219
+ *
220
+ * @return array
221
+ */
222
+ function get_advanced_search_term_predicates( $term ) {
223
+ if ( ! is_string( $term ) ) {
224
+ return array();
225
+ }
226
+
227
+ $predicates = explode( ' ', $term );
228
+ $predicates_organized = array();
229
+
230
+ foreach ( $predicates as $predicate ) {
231
+ $is_match = preg_match( '/(id|email|to|cc|bcc|reply-to):(.*)$/', $predicate, $matches );
232
+ if ( 1 === $is_match ) {
233
+ $predicates_organized[ $matches[1] ] = $matches[2];
234
+ }
235
+ }
236
+
237
+ return $predicates_organized;
238
+ }
239
+
240
+ /**
241
+ * Gets the Advanced Search URL.
242
+ *
243
+ * @since 2.3.0
244
+ *
245
+ * @return string
246
+ */
247
+ function get_advanced_search_url() {
248
+ $admin_url = get_admin_url( null, 'admin.php?page=email-log' );
249
+
250
+ return add_query_arg( 'el_as', 1, $admin_url );
251
+ }
252
+
253
+ /**
254
+ * Gets the Column labels to be used in LogList table.
255
+ *
256
+ * @since 2.3.0
257
+ *
258
+ * @param string $db_column
259
+ *
260
+ * @return string
261
+ */
262
+ function get_column_label_by_db_column( $db_column ) {
263
+ $labels = array(
264
+ 'id' => __( 'ID', 'email-log' ),
265
+ 'sent_date' => __( 'Sent at', 'email-log' ),
266
+ 'to' => __( 'To', 'email-log' ), // EmailLog\Core\UI\ListTable::get_columns() uses `to`
267
+ 'to_email' => __( 'To', 'email-log' ),
268
+ 'subject' => __( 'Subject', 'email-log' ),
269
+ 'message' => __( 'Message', 'email-log' ),
270
+ 'from' => __( 'From', 'email-log' ),
271
+ 'cc' => __( 'CC', 'email-log' ),
272
+ 'bcc' => __( 'BCC', 'email-log' ),
273
+ 'reply-to' => __( 'Reply To', 'email-log' ),
274
+ 'attachments' => __( 'Attachment', 'email-log' ),
275
+ 'attachment' => __( 'Attachment', 'email-log' ),
276
+ );
277
+
278
+ /**
279
+ * Filters the Labels used through out the Email Log plugin.
280
+ *
281
+ * @since 2.3.0
282
+ *
283
+ * @param array $labels {
284
+ * List of DB Columns and its respective labels.
285
+ *
286
+ * Example:
287
+ * 'id' => __( 'ID', 'email-log' ),
288
+ *
289
+ * @type string $key DB Column or any key for which a Label would be required. Accepts a internationalized string as Label.
290
+ * }
291
+ */
292
+ $labels = apply_filters( 'el_db_column_labels', $labels );
293
+
294
+ if ( array_key_exists( $db_column, $labels ) ) {
295
+ return $labels[ $db_column ];
296
+ }
297
+
298
+ return $db_column;
299
+ }
languages/email-log.pot CHANGED
@@ -1,21 +1,22 @@
1
- # Copyright (C) 2018 Email Log
2
  # This file is distributed under the same license as the Email Log package.
3
  msgid ""
4
  msgstr ""
5
- "Project-Id-Version: Email Log 2.2.5\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/email-log\n"
7
- "POT-Creation-Date: 2018-02-22 11:06:34+00:00\n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=UTF-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
11
- "PO-Revision-Date: 2018-MO-DA HO:MI+ZONE\n"
12
  "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
13
  "Language-Team: LANGUAGE <LL@li.org>\n"
14
 
15
  #: dist/email-log.php:49 email-log.php:49
16
  msgid ""
17
  "Email Log requires at least PHP 5.3 to function properly. Please upgrade PHP "
18
- "or use <a href=\"%s\">v1.9.1 of Email Log</a>."
 
19
  msgstr ""
20
 
21
  #: dist/include/Addon/API/EDDAPI.php:115 include/Addon/API/EDDAPI.php:115
@@ -64,37 +65,46 @@ msgstr ""
64
  msgid "You need an active license to use the add-on"
65
  msgstr ""
66
 
67
- #: dist/include/Addon/Addon.php:186 dist/include/Addon/License/Licenser.php:103
68
  #: include/Addon/Addon.php:186 include/Addon/License/Licenser.php:104
69
  msgid "Activate"
70
  msgstr ""
71
 
72
- #: dist/include/Addon/Addon.php:194 dist/include/Addon/License/Licenser.php:109
73
- #: include/Addon/Addon.php:194 include/Addon/License/Licenser.php:110
74
  msgid "Deactivate"
75
  msgstr ""
76
 
77
- #: dist/include/Addon/Addon.php:200 dist/include/Addon/License/Licenser.php:112
78
- #: include/Addon/Addon.php:200 include/Addon/License/Licenser.php:113
79
- msgid "Your license expires on %s"
 
 
 
 
 
 
 
 
 
80
  msgstr ""
81
 
82
- #: dist/include/Addon/Addon.php:205 include/Addon/Addon.php:205
83
  msgid "Individual add-on license"
84
  msgstr ""
85
 
86
- #: dist/include/Addon/Addon.php:210 include/Addon/Addon.php:210
87
  msgid "Email Log License Key"
88
  msgstr ""
89
 
90
- #: dist/include/Addon/Addon.php:211 include/Addon/Addon.php:211
91
  msgid "%s Add-on License Key"
92
  msgstr ""
93
 
94
  #: dist/include/Addon/AddonList.php:177 include/Addon/AddonList.php:177
95
  msgid ""
96
- "We are not able to retrieve the add-on list now. Please visit the <a href="
97
- "\"%s\">add-on page</a> to view the add-ons."
98
  msgstr ""
99
 
100
  #: dist/include/Addon/DependencyEnforcer.php:46
@@ -109,108 +119,127 @@ msgstr ""
109
  msgid "Please get the latest version of these add-ons from add-on store."
110
  msgstr ""
111
 
112
- #: dist/include/Addon/License/BaseLicense.php:124
113
- #: include/Addon/License/BaseLicense.php:124
114
- msgid "Your license key expired on %s."
 
 
 
115
  msgstr ""
116
 
117
- #: dist/include/Addon/License/BaseLicense.php:130
118
- #: include/Addon/License/BaseLicense.php:130
119
  msgid "Your license key has been disabled."
120
  msgstr ""
121
 
122
- #: dist/include/Addon/License/BaseLicense.php:134
123
- #: include/Addon/License/BaseLicense.php:134
124
  msgid "Your license key is invalid."
125
  msgstr ""
126
 
127
- #: dist/include/Addon/License/BaseLicense.php:139
128
- #: include/Addon/License/BaseLicense.php:139
129
  msgid "Your license is not active for this URL."
130
  msgstr ""
131
 
132
- #: dist/include/Addon/License/BaseLicense.php:143
133
- #: include/Addon/License/BaseLicense.php:143
 
134
  msgid "Your license key is not valid for %s."
135
  msgstr ""
136
 
137
- #: dist/include/Addon/License/BaseLicense.php:147
138
- #: include/Addon/License/BaseLicense.php:147
139
- msgid "Your license key has reached its activation limit."
 
 
 
140
  msgstr ""
141
 
142
- #: dist/include/Addon/License/BaseLicense.php:151
143
- #: dist/include/Addon/License/BaseLicense.php:175
144
- #: include/Addon/License/BaseLicense.php:151
145
- #: include/Addon/License/BaseLicense.php:175
146
  msgid "An error occurred, please try again."
147
  msgstr ""
148
 
149
- #: dist/include/Addon/License/BaseLicense.php:199
150
- #: include/Addon/License/BaseLicense.php:199
151
  msgid "An error occurred, please try again"
152
  msgstr ""
153
 
154
- #: dist/include/Addon/License/Licenser.php:121
155
- #: include/Addon/License/Licenser.php:122
156
  msgid ""
157
  "Enter your license key to activate add-ons. If you don't have a license, "
158
  "then you can <a href='%s' target='_blank'>buy it</a>"
159
  msgstr ""
160
 
161
- #: dist/include/Addon/License/Licenser.php:130
162
- #: dist/include/Addon/License/Licenser.php:131
163
- #: include/Addon/License/Licenser.php:131
164
- #: include/Addon/License/Licenser.php:132
165
  msgid "Email Log Bundle License Key"
166
  msgstr ""
167
 
168
- #: dist/include/Addon/License/Licenser.php:159
169
- #: include/Addon/License/Licenser.php:182
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
170
  msgid ""
171
  "Your license has been activated. You can now install add-ons, will receive "
172
  "automatic updates and access to email support."
173
  msgstr ""
174
 
175
- #: dist/include/Addon/License/Licenser.php:175
176
- #: include/Addon/License/Licenser.php:198
177
  msgid ""
178
  "Your license has been deactivated. You will not receive automatic updates."
179
  msgstr ""
180
 
181
- #: dist/include/Addon/License/Licenser.php:218
182
- #: include/Addon/License/Licenser.php:241
183
  msgid ""
184
  "Your license for %s has been activated. You will receive automatic updates "
185
  "and access to email support."
186
  msgstr ""
187
 
188
- #: dist/include/Addon/License/Licenser.php:245
189
- #: include/Addon/License/Licenser.php:268
190
  msgid ""
191
  "Your license for %s has been deactivated. You will not receive automatic "
192
  "updates."
193
  msgstr ""
194
 
195
  #: dist/include/Core/Request/LogListAction.php:50
196
- #: dist/include/Core/UI/ListTable/LogListTable.php:70
197
- #: include/Core/Request/LogListAction.php:50
198
- #: include/Core/UI/ListTable/LogListTable.php:69
199
  msgid "Sent at"
200
  msgstr ""
201
 
202
  #: dist/include/Core/Request/LogListAction.php:54
203
- #: dist/include/Core/UI/ListTable/LogListTable.php:71
204
- #: include/Core/Request/LogListAction.php:54
205
- #: include/Core/UI/ListTable/LogListTable.php:70
206
- #: tmp_addon/ForwardEmailSetting.php:32
207
  msgid "To"
208
  msgstr ""
209
 
210
  #: dist/include/Core/Request/LogListAction.php:58
211
- #: dist/include/Core/UI/ListTable/LogListTable.php:72
212
- #: include/Core/Request/LogListAction.php:58
213
- #: include/Core/UI/ListTable/LogListTable.php:71
214
  msgid "Subject"
215
  msgstr ""
216
 
@@ -229,13 +258,13 @@ msgstr ""
229
  msgid "Close"
230
  msgstr ""
231
 
232
- #: dist/include/Core/Request/LogListAction.php:164
233
- #: include/Core/Request/LogListAction.php:164
234
  msgid "There was some problem in deleting the email logs"
235
  msgstr ""
236
 
237
- #: dist/include/Core/Request/LogListAction.php:168
238
- #: include/Core/Request/LogListAction.php:168
239
  msgid "1 email log deleted."
240
  msgid_plural "%s email logs deleted"
241
  msgstr[0] ""
@@ -246,103 +275,103 @@ msgstr[1] ""
246
  msgid "Buy Addons"
247
  msgstr ""
248
 
249
- #: dist/include/Core/UI/Component/AdminUIEnhancer.php:83
250
  #: dist/include/Core/UI/Page/LogListPage.php:68
251
  #: dist/include/Core/UI/Page/LogListPage.php:69
252
- #: include/Core/UI/Component/AdminUIEnhancer.php:83
253
  #: include/Core/UI/Page/LogListPage.php:68
254
  #: include/Core/UI/Page/LogListPage.php:69
255
  msgid "View Logs"
256
  msgstr ""
257
 
258
- #: dist/include/Core/UI/Component/AdminUIEnhancer.php:106
259
- #: include/Core/UI/Component/AdminUIEnhancer.php:106
 
 
 
 
 
 
 
 
 
260
  msgid "plugin"
261
  msgstr ""
262
 
263
- #: dist/include/Core/UI/Component/AdminUIEnhancer.php:106
264
- #: include/Core/UI/Component/AdminUIEnhancer.php:106
265
  msgid "Version"
266
  msgstr ""
267
 
268
- #: dist/include/Core/UI/Component/AdminUIEnhancer.php:106
269
- #: include/Core/UI/Component/AdminUIEnhancer.php:106
270
  msgid "by"
271
  msgstr ""
272
 
273
- #: dist/include/Core/UI/Component/DashboardWidget.php:29
274
- #: include/Core/UI/Component/DashboardWidget.php:29
275
  msgid "Email Logs Summary"
276
  msgstr ""
277
 
278
- #: dist/include/Core/UI/Component/DashboardWidget.php:43
279
- #: include/Core/UI/Component/DashboardWidget.php:43
280
  msgid "Total number of emails logged"
281
  msgstr ""
282
 
283
- #: dist/include/Core/UI/Component/DashboardWidget.php:47
284
- #: include/Core/UI/Component/DashboardWidget.php:47
285
  msgid "<a href=\"%s\">Email Logs</a>"
286
  msgstr ""
287
 
288
- #: dist/include/Core/UI/Component/DashboardWidget.php:48
289
- #: include/Core/UI/Component/DashboardWidget.php:48
290
  msgid "<a href=\"%s\">Settings</a>"
291
  msgstr ""
292
 
293
- #: dist/include/Core/UI/Component/DashboardWidget.php:49
294
- #: include/Core/UI/Component/DashboardWidget.php:49
295
  msgid "<a href=\"%s\">Addons</a>"
296
  msgstr ""
297
 
298
- #: dist/include/Core/UI/ListTable/LogListTable.php:52
299
- msgid "Additional fields are available in Pro add-on. "
300
- msgstr ""
301
-
302
- #: dist/include/Core/UI/ListTable/LogListTable.php:54
303
- #: include/Addon/License/Licenser.php:163
304
- msgid "Buy Now"
305
- msgstr ""
306
-
307
- #: dist/include/Core/UI/ListTable/LogListTable.php:134
308
- #: include/Core/UI/ListTable/LogListTable.php:133
309
  msgid "%s @ %s"
310
  msgstr ""
311
 
312
- #: dist/include/Core/UI/ListTable/LogListTable.php:152
313
- #: include/Core/UI/ListTable/LogListTable.php:151
314
  msgid "Email Content"
315
  msgstr ""
316
 
317
- #: dist/include/Core/UI/ListTable/LogListTable.php:153
318
- #: include/Core/UI/ListTable/LogListTable.php:152
319
  msgid "View Content"
320
  msgstr ""
321
 
322
- #: dist/include/Core/UI/ListTable/LogListTable.php:167
323
- #: dist/include/Core/UI/ListTable/LogListTable.php:239
324
- #: include/Core/UI/ListTable/LogListTable.php:166
325
- #: include/Core/UI/ListTable/LogListTable.php:238
326
  msgid "Delete"
327
  msgstr ""
328
 
329
- #: dist/include/Core/UI/ListTable/LogListTable.php:240
330
- #: include/Core/UI/ListTable/LogListTable.php:239
331
  msgid "Delete All Logs"
332
  msgstr ""
333
 
334
- #: dist/include/Core/UI/ListTable/LogListTable.php:273
335
- #: include/Core/UI/ListTable/LogListTable.php:272
336
  msgid "Your email log is empty"
337
  msgstr ""
338
 
339
- #: dist/include/Core/UI/ListTable/LogListTable.php:300
340
- #: include/Core/UI/ListTable/LogListTable.php:299
341
  msgid "Search by date"
342
  msgstr ""
343
 
344
- #: dist/include/Core/UI/ListTable/LogListTable.php:301
345
- #: include/Core/UI/ListTable/LogListTable.php:300
346
  msgid "Search by term"
347
  msgstr ""
348
 
@@ -389,15 +418,16 @@ msgstr ""
389
  #: dist/include/Core/UI/Page/BasePage.php:54
390
  #: include/Core/UI/Page/BasePage.php:54
391
  msgid ""
392
- "Check the <a href=\"%s\">documentation about the View Logs screen</a> for "
393
- "more details."
394
  msgstr ""
395
 
396
  #: dist/include/Core/UI/Page/BasePage.php:60
397
  #: include/Core/UI/Page/BasePage.php:60
398
  msgid ""
399
  "You can perform advanced actions like re-sending email, automatically "
400
- "forwarding emails or export logs with our <a href=\"%s\">premium plugins</a>."
 
401
  msgstr ""
402
 
403
  #: dist/include/Core/UI/Page/BasePage.php:67
@@ -420,7 +450,7 @@ msgstr ""
420
  msgid "Support"
421
  msgstr ""
422
 
423
- #. #-#-#-#-# email-log.pot (Email Log 2.2.5) #-#-#-#-#
424
  #. Plugin Name of the plugin/theme
425
  #: dist/include/Core/UI/Page/LogListPage.php:57
426
  #: dist/include/Core/UI/Page/LogListPage.php:58
@@ -439,18 +469,11 @@ msgstr ""
439
  msgid "Search Logs"
440
  msgstr ""
441
 
442
- #: dist/include/Core/UI/Page/LogListPage.php:130
443
- #: include/Core/UI/Page/LogListPage.php:130
444
  msgid "Entries per page"
445
  msgstr ""
446
 
447
- #: dist/include/Core/UI/Page/SettingsPage.php:94
448
- #: dist/include/Core/UI/Page/SettingsPage.php:95
449
- #: include/Core/UI/Page/SettingsPage.php:94
450
- #: include/Core/UI/Page/SettingsPage.php:95
451
- msgid "Settings"
452
- msgstr ""
453
-
454
  #: dist/include/Core/UI/Page/SettingsPage.php:111
455
  #: include/Core/UI/Page/SettingsPage.php:111
456
  msgid "Email Log Settings"
@@ -461,205 +484,193 @@ msgstr ""
461
  msgid "Save"
462
  msgstr ""
463
 
464
- #: dist/include/Core/UI/Setting/CoreSetting.php:14
465
- #: include/Core/UI/Setting/CoreSetting.php:14
466
- msgid "Core Email Log Settings"
467
- msgstr ""
468
-
469
- #: dist/include/Core/UI/Setting/CoreSetting.php:18
470
- #: include/Core/UI/Setting/CoreSetting.php:18
471
- msgid "Allowed User Roles"
472
- msgstr ""
473
-
474
- #: dist/include/Core/UI/Setting/CoreSetting.php:19
475
- #: include/Core/UI/Setting/CoreSetting.php:19
476
- msgid "Remove Data on Uninstall?"
477
  msgstr ""
478
 
479
- #: dist/include/Core/UI/Setting/CoreSetting.php:58
480
- #: include/Core/UI/Setting/CoreSetting.php:58
481
- msgid "Administrator"
482
  msgstr ""
483
 
484
- #: dist/include/Core/UI/Setting/CoreSetting.php:72
485
- #: include/Core/UI/Setting/CoreSetting.php:72
486
  msgid ""
487
- "<strong>Note:</strong> Users with the above User Roles can view Email Logs."
 
488
  msgstr ""
489
 
490
- #: dist/include/Core/UI/Setting/CoreSetting.php:73
491
- #: include/Core/UI/Setting/CoreSetting.php:73
492
- msgid "Administrator role always has access and cannot be disabled."
493
- msgstr ""
494
-
495
- #: dist/include/Core/UI/Setting/CoreSetting.php:108
496
- #: include/Core/UI/Setting/CoreSetting.php:108
497
- msgid ""
498
- "Check this box if you would like to completely remove all of its data when "
499
- "the plugin is deleted."
500
  msgstr ""
501
 
502
- #: dist/include/Core/UI/Setting/CoreSetting.php:113
503
- #: include/Core/UI/Setting/CoreSetting.php:113
504
- msgid ""
505
- "<strong>Note:</strong> You can also export the Email Logs using our <a href="
506
- "\"%s\" rel=\"noopener noreferrer\" target=\"_blank\">Export Logs</a> add-on."
507
- msgstr ""
508
-
509
- #: dist/include/libraries/EDD_SL_Plugin_Updater.php:201
510
- #: include/libraries/EDD_SL_Plugin_Updater.php:201
511
- msgid ""
512
- "There is a new version of %1$s available. %2$sView version %3$s details%4$s."
513
  msgstr ""
514
 
515
- #: dist/include/libraries/EDD_SL_Plugin_Updater.php:209
516
- #: include/libraries/EDD_SL_Plugin_Updater.php:209
517
- msgid ""
518
- "There is a new version of %1$s available. %2$sView version %3$s details%4$s "
519
- "or %5$supdate now%6$s."
520
  msgstr ""
521
 
522
- #: dist/include/libraries/EDD_SL_Plugin_Updater.php:399
523
- #: include/libraries/EDD_SL_Plugin_Updater.php:399
524
- msgid "You do not have permission to install plugin updates"
525
  msgstr ""
526
 
527
- #: dist/include/libraries/EDD_SL_Plugin_Updater.php:399
528
- #: include/libraries/EDD_SL_Plugin_Updater.php:399
529
- msgid "Error"
530
  msgstr ""
531
 
532
- #: include/Addon/License/Licenser.php:155
533
- msgid "Additional fields are available through More Fields add-on. "
 
534
  msgstr ""
535
 
536
- #: include/Addon/License/Licenser.php:159
537
- msgid "Install it"
 
538
  msgstr ""
539
 
540
- #: tmp_addon/AutoDeleteLogsSetting.php:15
541
- msgid "Auto Delete Logs Add-on Settings"
 
542
  msgstr ""
543
 
544
- #: tmp_addon/AutoDeleteLogsSetting.php:24
 
545
  msgid ""
546
- "Auto Delete Logs allows you to automatically delete logs that are older than "
547
- "specified interval (in days)."
548
  msgstr ""
549
 
550
- #: tmp_addon/AutoDeleteLogsSetting.php:25
551
- msgid "Specify the interval beyond which the logs are to be auto deleted."
 
552
  msgstr ""
553
 
554
- #: tmp_addon/AutoDeleteLogsSetting.php:34
555
- msgid "Interval"
 
 
 
556
  msgstr ""
557
 
558
- #: tmp_addon/AutoDeleteLogsSetting.php:58
559
- msgid "Specify the interval in days."
 
 
 
560
  msgstr ""
561
 
562
- #: tmp_addon/EmailLogAddonActivator.php:94
563
- msgid "This plugin"
 
564
  msgstr ""
565
 
566
- #: tmp_addon/EmailLogAddonActivator.php:144
 
567
  msgid ""
568
- "requires at least PHP %1$s or above! You are currently using PHP %2$s, which "
569
- "is very old. Please contact your web host and upgrade PHP."
570
  msgstr ""
571
 
572
- #: tmp_addon/EmailLogAddonActivator.php:157
573
- msgid "activate it"
 
574
  msgstr ""
575
 
576
- #: tmp_addon/EmailLogAddonActivator.php:160
577
- msgid "install it"
 
578
  msgstr ""
579
 
580
- #: tmp_addon/EmailLogAddonActivator.php:165
581
- msgid "requires Email Log! Please %s to continue!"
 
 
 
582
  msgstr ""
583
 
584
- #: tmp_addon/EmailLogAddonActivator.php:174
585
- msgid "update it"
 
586
  msgstr ""
587
 
588
- #: tmp_addon/EmailLogAddonActivator.php:178
589
- msgid "requires Email Log version %s or above! Please %s to continue!"
 
 
 
 
590
  msgstr ""
591
 
592
- #: tmp_addon/ExportLogsAddon.php:50
593
- msgid "Export"
594
- msgstr ""
 
 
 
595
 
596
- #: tmp_addon/ExportLogsAddon.php:51
597
- msgid "Export All Logs"
598
  msgstr ""
599
 
600
- #: tmp_addon/ForwardEmailSetting.php:15
601
- msgid "Forward Email Add-on Settings"
602
  msgstr ""
603
 
604
- #: tmp_addon/ForwardEmailSetting.php:22
605
- msgid ""
606
- "Forward Email add-on allows you to automatically send a copy of all emails "
607
- "generated by WordPress to other email addresses."
608
  msgstr ""
609
 
610
- #: tmp_addon/ForwardEmailSetting.php:23
611
- msgid ""
612
- "Specify the list of email addresses to which the emails should be forwarded."
613
  msgstr ""
614
 
615
- #: tmp_addon/ForwardEmailSetting.php:33 tmp_addon/MoreFieldsAddon.php:46
616
- #: tmp_addon/ResendEmailAddon.php:113
617
  msgid "CC"
618
  msgstr ""
619
 
620
- #: tmp_addon/ForwardEmailSetting.php:34 tmp_addon/MoreFieldsAddon.php:47
621
- #: tmp_addon/ResendEmailAddon.php:117
622
  msgid "BCC"
623
  msgstr ""
624
 
625
- #: tmp_addon/ForwardEmailSetting.php:58
626
- msgid "You can enter multiple email address by separating them with comma."
627
- msgstr ""
628
-
629
- #: tmp_addon/MoreFieldsAddon.php:45 tmp_addon/ResendEmailAddon.php:109
630
- msgid "From"
631
- msgstr ""
632
-
633
- #: tmp_addon/MoreFieldsAddon.php:48 tmp_addon/ResendEmailAddon.php:121
634
  msgid "Reply To"
635
  msgstr ""
636
 
637
- #: tmp_addon/MoreFieldsAddon.php:49
 
638
  msgid "Attachment"
639
  msgstr ""
640
 
641
- #: tmp_addon/ResendEmailAddon.php:48 tmp_addon/ResendEmailAddon.php:129
642
- msgid "Resend Email"
643
- msgstr ""
644
-
645
- #: tmp_addon/ResendEmailAddon.php:90
646
- msgid "Email Details"
647
- msgstr ""
648
-
649
- #: tmp_addon/ResendEmailAddon.php:106
650
- msgid "Additional Details"
651
  msgstr ""
652
 
653
- #: tmp_addon/ResendEmailAddon.php:125
654
- msgid "Content Type"
 
 
 
655
  msgstr ""
656
 
657
- #: tmp_addon/ResendEmailAddon.php:193
658
- msgid "Email was successfully resent"
 
659
  msgstr ""
660
 
661
- #: tmp_addon/ResendEmailAddon.php:195
662
- msgid "There was some problem in sending the email"
 
663
  msgstr ""
664
 
665
  #: vendor/lucatume/wp-browser/src/data/plugins/wordpress-importer/parsers.php:42
@@ -873,6 +884,12 @@ msgid ""
873
  "strong> from a WordPress export file."
874
  msgstr ""
875
 
 
 
 
 
 
 
876
  #. Plugin URI of the plugin/theme
877
  msgid "https://wpemaillog.com"
878
  msgstr ""
1
+ # Copyright (C) 2019 Email Log
2
  # This file is distributed under the same license as the Email Log package.
3
  msgid ""
4
  msgstr ""
5
+ "Project-Id-Version: Email Log 2.3.0\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/email-log\n"
7
+ "POT-Creation-Date: 2019-04-11 11:03:17+00:00\n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=UTF-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
11
+ "PO-Revision-Date: 2019-MO-DA HO:MI+ZONE\n"
12
  "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
13
  "Language-Team: LANGUAGE <LL@li.org>\n"
14
 
15
  #: dist/email-log.php:49 email-log.php:49
16
  msgid ""
17
  "Email Log requires at least PHP 5.3 to function properly. Please upgrade PHP "
18
+ "or use <a href=\"%s\" target=\"_blank\" rel=\"noopener\">v1.9.1 of Email "
19
+ "Log</a>."
20
  msgstr ""
21
 
22
  #: dist/include/Addon/API/EDDAPI.php:115 include/Addon/API/EDDAPI.php:115
65
  msgid "You need an active license to use the add-on"
66
  msgstr ""
67
 
68
+ #: dist/include/Addon/Addon.php:186 dist/include/Addon/License/Licenser.php:104
69
  #: include/Addon/Addon.php:186 include/Addon/License/Licenser.php:104
70
  msgid "Activate"
71
  msgstr ""
72
 
73
+ #: dist/include/Addon/Addon.php:194 dist/include/Addon/License/Licenser.php:112
74
+ #: include/Addon/Addon.php:194 include/Addon/License/Licenser.php:112
75
  msgid "Deactivate"
76
  msgstr ""
77
 
78
+ #. translators: 1 License expiry date, 2 License Renewal link
79
+ #: dist/include/Addon/Addon.php:203 dist/include/Addon/License/Licenser.php:118
80
+ #: include/Addon/Addon.php:203 include/Addon/License/Licenser.php:118
81
+ msgid ""
82
+ "Your license has expired on %1$s. Please <a href=\"%2$s\">renew it</a> to "
83
+ "receive automatic updates and support."
84
+ msgstr ""
85
+
86
+ #. translators: 1 License expiry date
87
+ #: dist/include/Addon/Addon.php:206 dist/include/Addon/License/Licenser.php:122
88
+ #: include/Addon/Addon.php:206 include/Addon/License/Licenser.php:122
89
+ msgid "Your license is valid till %s"
90
  msgstr ""
91
 
92
+ #: dist/include/Addon/Addon.php:212 include/Addon/Addon.php:212
93
  msgid "Individual add-on license"
94
  msgstr ""
95
 
96
+ #: dist/include/Addon/Addon.php:217 include/Addon/Addon.php:217
97
  msgid "Email Log License Key"
98
  msgstr ""
99
 
100
+ #: dist/include/Addon/Addon.php:218 include/Addon/Addon.php:218
101
  msgid "%s Add-on License Key"
102
  msgstr ""
103
 
104
  #: dist/include/Addon/AddonList.php:177 include/Addon/AddonList.php:177
105
  msgid ""
106
+ "We are not able to retrieve the add-on list now. Please visit the <a target="
107
+ "\"_blank\" rel=\"noopener\" href=\"%s\">add-on page</a> to view the add-ons."
108
  msgstr ""
109
 
110
  #: dist/include/Addon/DependencyEnforcer.php:46
119
  msgid "Please get the latest version of these add-ons from add-on store."
120
  msgstr ""
121
 
122
+ #. translators: 1 License expiry date, 2 License Renewal link
123
+ #: dist/include/Addon/License/BaseLicense.php:173
124
+ #: include/Addon/License/BaseLicense.php:173
125
+ msgid ""
126
+ "Your license key expired on %1$s. Please <a href=\"%2$s\">renew it</a> to "
127
+ "receive automatic updates and support."
128
  msgstr ""
129
 
130
+ #: dist/include/Addon/License/BaseLicense.php:180
131
+ #: include/Addon/License/BaseLicense.php:180
132
  msgid "Your license key has been disabled."
133
  msgstr ""
134
 
135
+ #: dist/include/Addon/License/BaseLicense.php:184
136
+ #: include/Addon/License/BaseLicense.php:184
137
  msgid "Your license key is invalid."
138
  msgstr ""
139
 
140
+ #: dist/include/Addon/License/BaseLicense.php:189
141
+ #: include/Addon/License/BaseLicense.php:189
142
  msgid "Your license is not active for this URL."
143
  msgstr ""
144
 
145
+ #. translators: 1 Add-on name
146
+ #: dist/include/Addon/License/BaseLicense.php:194
147
+ #: include/Addon/License/BaseLicense.php:194
148
  msgid "Your license key is not valid for %s."
149
  msgstr ""
150
 
151
+ #. translators: 1 License Upgrade link
152
+ #: dist/include/Addon/License/BaseLicense.php:200
153
+ #: include/Addon/License/BaseLicense.php:200
154
+ msgid ""
155
+ "Your license key has reached its activation limit. Please <a href=\"%s"
156
+ "\">upgrade</a> your license."
157
  msgstr ""
158
 
159
+ #: dist/include/Addon/License/BaseLicense.php:206
160
+ #: dist/include/Addon/License/BaseLicense.php:237
161
+ #: include/Addon/License/BaseLicense.php:206
162
+ #: include/Addon/License/BaseLicense.php:237
163
  msgid "An error occurred, please try again."
164
  msgstr ""
165
 
166
+ #: dist/include/Addon/License/BaseLicense.php:261
167
+ #: include/Addon/License/BaseLicense.php:261
168
  msgid "An error occurred, please try again"
169
  msgstr ""
170
 
171
+ #: dist/include/Addon/License/Licenser.php:133
172
+ #: include/Addon/License/Licenser.php:133
173
  msgid ""
174
  "Enter your license key to activate add-ons. If you don't have a license, "
175
  "then you can <a href='%s' target='_blank'>buy it</a>"
176
  msgstr ""
177
 
178
+ #: dist/include/Addon/License/Licenser.php:142
179
+ #: dist/include/Addon/License/Licenser.php:143
180
+ #: include/Addon/License/Licenser.php:142
181
+ #: include/Addon/License/Licenser.php:143
182
  msgid "Email Log Bundle License Key"
183
  msgstr ""
184
 
185
+ #: dist/include/Addon/License/Licenser.php:168
186
+ #: include/Addon/License/Licenser.php:168
187
+ msgid "Additional fields are available through More Fields add-on. "
188
+ msgstr ""
189
+
190
+ #: dist/include/Addon/License/Licenser.php:172
191
+ #: include/Addon/License/Licenser.php:172
192
+ msgid "Install it"
193
+ msgstr ""
194
+
195
+ #: dist/include/Addon/License/Licenser.php:176
196
+ #: include/Addon/License/Licenser.php:176
197
+ msgid "Buy Now"
198
+ msgstr ""
199
+
200
+ #: dist/include/Addon/License/Licenser.php:195
201
+ #: include/Addon/License/Licenser.php:195
202
  msgid ""
203
  "Your license has been activated. You can now install add-ons, will receive "
204
  "automatic updates and access to email support."
205
  msgstr ""
206
 
207
+ #: dist/include/Addon/License/Licenser.php:211
208
+ #: include/Addon/License/Licenser.php:211
209
  msgid ""
210
  "Your license has been deactivated. You will not receive automatic updates."
211
  msgstr ""
212
 
213
+ #: dist/include/Addon/License/Licenser.php:254
214
+ #: include/Addon/License/Licenser.php:254
215
  msgid ""
216
  "Your license for %s has been activated. You will receive automatic updates "
217
  "and access to email support."
218
  msgstr ""
219
 
220
+ #: dist/include/Addon/License/Licenser.php:281
221
+ #: include/Addon/License/Licenser.php:281
222
  msgid ""
223
  "Your license for %s has been deactivated. You will not receive automatic "
224
  "updates."
225
  msgstr ""
226
 
227
  #: dist/include/Core/Request/LogListAction.php:50
228
+ #: dist/include/Util/helper.php:265 include/Core/Request/LogListAction.php:50
229
+ #: include/Util/helper.php:265
 
230
  msgid "Sent at"
231
  msgstr ""
232
 
233
  #: dist/include/Core/Request/LogListAction.php:54
234
+ #: dist/include/Util/helper.php:266 dist/include/Util/helper.php:267
235
+ #: include/Core/Request/LogListAction.php:54 include/Util/helper.php:266
236
+ #: include/Util/helper.php:267
 
237
  msgid "To"
238
  msgstr ""
239
 
240
  #: dist/include/Core/Request/LogListAction.php:58
241
+ #: dist/include/Util/helper.php:268 include/Core/Request/LogListAction.php:58
242
+ #: include/Util/helper.php:268
 
243
  msgid "Subject"
244
  msgstr ""
245
 
258
  msgid "Close"
259
  msgstr ""
260
 
261
+ #: dist/include/Core/Request/LogListAction.php:168
262
+ #: include/Core/Request/LogListAction.php:168
263
  msgid "There was some problem in deleting the email logs"
264
  msgstr ""
265
 
266
+ #: dist/include/Core/Request/LogListAction.php:172
267
+ #: include/Core/Request/LogListAction.php:172
268
  msgid "1 email log deleted."
269
  msgid_plural "%s email logs deleted"
270
  msgstr[0] ""
275
  msgid "Buy Addons"
276
  msgstr ""
277
 
278
+ #: dist/include/Core/UI/Component/AdminUIEnhancer.php:85
279
  #: dist/include/Core/UI/Page/LogListPage.php:68
280
  #: dist/include/Core/UI/Page/LogListPage.php:69
281
+ #: include/Core/UI/Component/AdminUIEnhancer.php:85
282
  #: include/Core/UI/Page/LogListPage.php:68
283
  #: include/Core/UI/Page/LogListPage.php:69
284
  msgid "View Logs"
285
  msgstr ""
286
 
287
+ #: dist/include/Core/UI/Component/AdminUIEnhancer.php:86
288
+ #: dist/include/Core/UI/Page/SettingsPage.php:94
289
+ #: dist/include/Core/UI/Page/SettingsPage.php:95
290
+ #: include/Core/UI/Component/AdminUIEnhancer.php:86
291
+ #: include/Core/UI/Page/SettingsPage.php:94
292
+ #: include/Core/UI/Page/SettingsPage.php:95
293
+ msgid "Settings"
294
+ msgstr ""
295
+
296
+ #: dist/include/Core/UI/Component/AdminUIEnhancer.php:109
297
+ #: include/Core/UI/Component/AdminUIEnhancer.php:109
298
  msgid "plugin"
299
  msgstr ""
300
 
301
+ #: dist/include/Core/UI/Component/AdminUIEnhancer.php:109
302
+ #: include/Core/UI/Component/AdminUIEnhancer.php:109
303
  msgid "Version"
304
  msgstr ""
305
 
306
+ #: dist/include/Core/UI/Component/AdminUIEnhancer.php:109
307
+ #: include/Core/UI/Component/AdminUIEnhancer.php:109
308
  msgid "by"
309
  msgstr ""
310
 
311
+ #: dist/include/Core/UI/Component/DashboardWidget.php:30
312
+ #: include/Core/UI/Component/DashboardWidget.php:30
313
  msgid "Email Logs Summary"
314
  msgstr ""
315
 
316
+ #: dist/include/Core/UI/Component/DashboardWidget.php:44
317
+ #: include/Core/UI/Component/DashboardWidget.php:44
318
  msgid "Total number of emails logged"
319
  msgstr ""
320
 
321
+ #: dist/include/Core/UI/Component/DashboardWidget.php:50
322
+ #: include/Core/UI/Component/DashboardWidget.php:50
323
  msgid "<a href=\"%s\">Email Logs</a>"
324
  msgstr ""
325
 
326
+ #: dist/include/Core/UI/Component/DashboardWidget.php:51
327
+ #: include/Core/UI/Component/DashboardWidget.php:51
328
  msgid "<a href=\"%s\">Settings</a>"
329
  msgstr ""
330
 
331
+ #: dist/include/Core/UI/Component/DashboardWidget.php:52
332
+ #: include/Core/UI/Component/DashboardWidget.php:52
333
  msgid "<a href=\"%s\">Addons</a>"
334
  msgstr ""
335
 
336
+ #: dist/include/Core/UI/ListTable/LogListTable.php:138
337
+ #: include/Core/UI/ListTable/LogListTable.php:138
 
 
 
 
 
 
 
 
 
338
  msgid "%s @ %s"
339
  msgstr ""
340
 
341
+ #: dist/include/Core/UI/ListTable/LogListTable.php:156
342
+ #: include/Core/UI/ListTable/LogListTable.php:156
343
  msgid "Email Content"
344
  msgstr ""
345
 
346
+ #: dist/include/Core/UI/ListTable/LogListTable.php:157
347
+ #: include/Core/UI/ListTable/LogListTable.php:157
348
  msgid "View Content"
349
  msgstr ""
350
 
351
+ #: dist/include/Core/UI/ListTable/LogListTable.php:171
352
+ #: dist/include/Core/UI/ListTable/LogListTable.php:252
353
+ #: include/Core/UI/ListTable/LogListTable.php:171
354
+ #: include/Core/UI/ListTable/LogListTable.php:252
355
  msgid "Delete"
356
  msgstr ""
357
 
358
+ #: dist/include/Core/UI/ListTable/LogListTable.php:253
359
+ #: include/Core/UI/ListTable/LogListTable.php:253
360
  msgid "Delete All Logs"
361
  msgstr ""
362
 
363
+ #: dist/include/Core/UI/ListTable/LogListTable.php:286
364
+ #: include/Core/UI/ListTable/LogListTable.php:286
365
  msgid "Your email log is empty"
366
  msgstr ""
367
 
368
+ #: dist/include/Core/UI/ListTable/LogListTable.php:313
369
+ #: include/Core/UI/ListTable/LogListTable.php:313
370
  msgid "Search by date"
371
  msgstr ""
372
 
373
+ #: dist/include/Core/UI/ListTable/LogListTable.php:314
374
+ #: include/Core/UI/ListTable/LogListTable.php:314
375
  msgid "Search by term"
376
  msgstr ""
377
 
418
  #: dist/include/Core/UI/Page/BasePage.php:54
419
  #: include/Core/UI/Page/BasePage.php:54
420
  msgid ""
421
+ "Check the <a target=\"_blank\" rel=\"noopener\" href=\"%s\">documentation "
422
+ "about the View Logs screen</a> for more details."
423
  msgstr ""
424
 
425
  #: dist/include/Core/UI/Page/BasePage.php:60
426
  #: include/Core/UI/Page/BasePage.php:60
427
  msgid ""
428
  "You can perform advanced actions like re-sending email, automatically "
429
+ "forwarding emails or export logs with our <a target=\"_blank\" rel=\"noopener"
430
+ "\" href=\"%s\">premium plugins</a>."
431
  msgstr ""
432
 
433
  #: dist/include/Core/UI/Page/BasePage.php:67
450
  msgid "Support"
451
  msgstr ""
452
 
453
+ #. #-#-#-#-# email-log.pot (Email Log 2.3.0) #-#-#-#-#
454
  #. Plugin Name of the plugin/theme
455
  #: dist/include/Core/UI/Page/LogListPage.php:57
456
  #: dist/include/Core/UI/Page/LogListPage.php:58
469
  msgid "Search Logs"
470
  msgstr ""
471
 
472
+ #: dist/include/Core/UI/Page/LogListPage.php:128
473
+ #: include/Core/UI/Page/LogListPage.php:128
474
  msgid "Entries per page"
475
  msgstr ""
476
 
 
 
 
 
 
 
 
477
  #: dist/include/Core/UI/Page/SettingsPage.php:111
478
  #: include/Core/UI/Page/SettingsPage.php:111
479
  msgid "Email Log Settings"
484
  msgid "Save"
485
  msgstr ""
486
 
487
+ #: dist/include/Core/UI/Page/SystemInfoPage.php:41
488
+ #: dist/include/Core/UI/Page/SystemInfoPage.php:42
489
+ #: include/Core/UI/Page/SystemInfoPage.php:41
490
+ #: include/Core/UI/Page/SystemInfoPage.php:42
491
+ msgid "System Info"
 
 
 
 
 
 
 
 
492
  msgstr ""
493
 
494
+ #: dist/include/Core/UI/Page/SystemInfoPage.php:70
495
+ #: include/Core/UI/Page/SystemInfoPage.php:70
496
+ msgid "Please include this information when posting support requests."
497
  msgstr ""
498
 
499
+ #: dist/include/Core/UI/Page/SystemInfoPage.php:78
500
+ #: include/Core/UI/Page/SystemInfoPage.php:78
501
  msgid ""
502
+ "DISABLE_WP_CRON is <a href=\"%s\" rel=\"noopener\" target=\"_blank"
503
+ "\">enabled</a>. This prevents scheduler from running."
504
  msgstr ""
505
 
506
+ #: dist/include/Core/UI/Page/SystemInfoPage.php:84
507
+ #: include/Core/UI/Page/SystemInfoPage.php:84
508
+ msgid "Email Log - System Info"
 
 
 
 
 
 
 
509
  msgstr ""
510
 
511
+ #: dist/include/Core/UI/Page/SystemInfoPage.php:94
512
+ #: include/Core/UI/Page/SystemInfoPage.php:94
513
+ msgid "Download System Info File"
 
 
 
 
 
 
 
 
514
  msgstr ""
515
 
516
+ #: dist/include/Core/UI/Setting/CoreSetting.php:16
517
+ #: include/Core/UI/Setting/CoreSetting.php:16
518
+ msgid "Core Email Log Settings"
 
 
519
  msgstr ""
520
 
521
+ #: dist/include/Core/UI/Setting/CoreSetting.php:20
522
+ #: include/Core/UI/Setting/CoreSetting.php:20
523
+ msgid "Allowed User Roles"
524
  msgstr ""
525
 
526
+ #: dist/include/Core/UI/Setting/CoreSetting.php:21
527
+ #: include/Core/UI/Setting/CoreSetting.php:21
528
+ msgid "Remove Data on Uninstall?"
529
  msgstr ""
530
 
531
+ #: dist/include/Core/UI/Setting/CoreSetting.php:22
532
+ #: include/Core/UI/Setting/CoreSetting.php:22
533
+ msgid "Disable Dashboard Widget"
534
  msgstr ""
535
 
536
+ #: dist/include/Core/UI/Setting/CoreSetting.php:23
537
+ #: include/Core/UI/Setting/CoreSetting.php:23
538
+ msgid "Database Size Notification"
539
  msgstr ""
540
 
541
+ #: dist/include/Core/UI/Setting/CoreSetting.php:73
542
+ #: include/Core/UI/Setting/CoreSetting.php:73
543
+ msgid "Administrator"
544
  msgstr ""
545
 
546
+ #: dist/include/Core/UI/Setting/CoreSetting.php:87
547
+ #: include/Core/UI/Setting/CoreSetting.php:87
548
  msgid ""
549
+ "<strong>Note:</strong> Users with the above User Roles can view Email Logs."
 
550
  msgstr ""
551
 
552
+ #: dist/include/Core/UI/Setting/CoreSetting.php:88
553
+ #: include/Core/UI/Setting/CoreSetting.php:88
554
+ msgid "Administrator role always has access and cannot be disabled."
555
  msgstr ""
556
 
557
+ #: dist/include/Core/UI/Setting/CoreSetting.php:123
558
+ #: include/Core/UI/Setting/CoreSetting.php:123
559
+ msgid ""
560
+ "Check this box if you would like to completely remove all of its data when "
561
+ "the plugin is deleted."
562
  msgstr ""
563
 
564
+ #: dist/include/Core/UI/Setting/CoreSetting.php:128
565
+ #: include/Core/UI/Setting/CoreSetting.php:128
566
+ msgid ""
567
+ "<strong>Note:</strong> You can also export the Email Logs using our <a href="
568
+ "\"%s\" rel=\"noopener noreferrer\" target=\"_blank\">Export Logs</a> add-on."
569
  msgstr ""
570
 
571
+ #: dist/include/Core/UI/Setting/CoreSetting.php:216
572
+ #: include/Core/UI/Setting/CoreSetting.php:216
573
+ msgid "Check this box if you would like to disable dashboard widget."
574
  msgstr ""
575
 
576
+ #: dist/include/Core/UI/Setting/CoreSetting.php:221
577
+ #: include/Core/UI/Setting/CoreSetting.php:221
578
  msgid ""
579
+ "<strong>Note:</strong> Each users can also disable dashboard widget using "
580
+ "screen options"
581
  msgstr ""
582
 
583
+ #: dist/include/Core/UI/Setting/CoreSetting.php:262
584
+ #: include/Core/UI/Setting/CoreSetting.php:262
585
+ msgid "Notify %1$s if there are more than %2$s logs."
586
  msgstr ""
587
 
588
+ #: dist/include/Core/UI/Setting/CoreSetting.php:270
589
+ #: include/Core/UI/Setting/CoreSetting.php:270
590
+ msgid "%1$s There are %2$s email logs currently logged in the database."
591
  msgstr ""
592
 
593
+ #: dist/include/Core/UI/Setting/CoreSetting.php:279
594
+ #: include/Core/UI/Setting/CoreSetting.php:279
595
+ msgid ""
596
+ "Last notification email was sent on %1$s. Click %2$s button to reset sending "
597
+ "the notification."
598
  msgstr ""
599
 
600
+ #: dist/include/Core/UI/Setting/CoreSetting.php:434
601
+ #: include/Core/UI/Setting/CoreSetting.php:434
602
+ msgid "Email Log Plugin: Your log threshold of %s has been met"
603
  msgstr ""
604
 
605
+ #: dist/include/Core/UI/Setting/CoreSetting.php:486
606
+ #: include/Core/UI/Setting/CoreSetting.php:486
607
+ msgid ""
608
+ "Currently there are %1$s logged, which is more than the threshold that is "
609
+ "set in the %2$s screen. You can delete some logs or increase the threshold. "
610
+ "You can also use our %3$s add-on to automatically delete logs"
611
  msgstr ""
612
 
613
+ #: dist/include/Core/UI/Setting/CoreSetting.php:487
614
+ #: include/Core/UI/Setting/CoreSetting.php:487
615
+ msgid " email log"
616
+ msgid_plural " email logs"
617
+ msgstr[0] ""
618
+ msgstr[1] ""
619
 
620
+ #: dist/include/Util/helper.php:161 include/Util/helper.php:161
621
+ msgid "Auto delete logs cron will be triggered next at"
622
  msgstr ""
623
 
624
+ #: dist/include/Util/helper.php:264 include/Util/helper.php:264
625
+ msgid "ID"
626
  msgstr ""
627
 
628
+ #: dist/include/Util/helper.php:269 include/Util/helper.php:269
629
+ msgid "Message"
 
 
630
  msgstr ""
631
 
632
+ #: dist/include/Util/helper.php:270 include/Util/helper.php:270
633
+ msgid "From"
 
634
  msgstr ""
635
 
636
+ #: dist/include/Util/helper.php:271 include/Util/helper.php:271
 
637
  msgid "CC"
638
  msgstr ""
639
 
640
+ #: dist/include/Util/helper.php:272 include/Util/helper.php:272
 
641
  msgid "BCC"
642
  msgstr ""
643
 
644
+ #: dist/include/Util/helper.php:273 include/Util/helper.php:273
 
 
 
 
 
 
 
 
645
  msgid "Reply To"
646
  msgstr ""
647
 
648
+ #: dist/include/Util/helper.php:274 dist/include/Util/helper.php:275
649
+ #: include/Util/helper.php:274 include/Util/helper.php:275
650
  msgid "Attachment"
651
  msgstr ""
652
 
653
+ #: dist/include/libraries/EDD_SL_Plugin_Updater.php:201
654
+ #: include/libraries/EDD_SL_Plugin_Updater.php:201
655
+ msgid ""
656
+ "There is a new version of %1$s available. %2$sView version %3$s details%4$s."
 
 
 
 
 
 
657
  msgstr ""
658
 
659
+ #: dist/include/libraries/EDD_SL_Plugin_Updater.php:209
660
+ #: include/libraries/EDD_SL_Plugin_Updater.php:209
661
+ msgid ""
662
+ "There is a new version of %1$s available. %2$sView version %3$s details%4$s "
663
+ "or %5$supdate now%6$s."
664
  msgstr ""
665
 
666
+ #: dist/include/libraries/EDD_SL_Plugin_Updater.php:399
667
+ #: include/libraries/EDD_SL_Plugin_Updater.php:399
668
+ msgid "You do not have permission to install plugin updates"
669
  msgstr ""
670
 
671
+ #: dist/include/libraries/EDD_SL_Plugin_Updater.php:399
672
+ #: include/libraries/EDD_SL_Plugin_Updater.php:399
673
+ msgid "Error"
674
  msgstr ""
675
 
676
  #: vendor/lucatume/wp-browser/src/data/plugins/wordpress-importer/parsers.php:42
884
  "strong> from a WordPress export file."
885
  msgstr ""
886
 
887
+ #: vendor/sudar/wp-system-info/src/SystemInfo.php:78
888
+ msgid ""
889
+ "To copy the system info, click below then press Ctrl + C (PC) or Cmd + C "
890
+ "(Mac)."
891
+ msgstr ""
892
+
893
  #. Plugin URI of the plugin/theme
894
  msgid "https://wpemaillog.com"
895
  msgstr ""
load-email-log.php CHANGED
@@ -26,6 +26,7 @@ function load_email_log( $plugin_file ) {
26
 
27
  $loader = new \EmailLog\EmailLogAutoloader();
28
  $loader->add_namespace( 'EmailLog', $plugin_dir . 'include' );
 
29
 
30
  if ( file_exists( $plugin_dir . 'tests/' ) ) {
31
  // if tests are present, then add them.
26
 
27
  $loader = new \EmailLog\EmailLogAutoloader();
28
  $loader->add_namespace( 'EmailLog', $plugin_dir . 'include' );
29
+ $loader->add_namespace( 'Sudar\\WPSystemInfo', $plugin_dir . 'vendor/sudar/wp-system-info/src/' );
30
 
31
  if ( file_exists( $plugin_dir . 'tests/' ) ) {
32
  // if tests are present, then add them.
readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: sudar
3
  Tags: email, log, log email, resend email, multisite
4
  Requires PHP: 5.3
5
  Requires at least: 4.0
6
- Tested up to: 4.9
7
- Stable tag: 2.2.5
8
 
9
  Log and view all outgoing emails from WordPress. Works with WordPress Multisite as well.
10
 
@@ -120,6 +120,20 @@ Meanwhile, I have added a hack to handle this condition in v1.7.3 of my plugin.
120
  This Readme file was generated using <a href = 'http://sudarmuthu.com/wordpress/wp-readme'>wp-readme</a>, which generates readme files for WordPress Plugins.
121
  == Changelog ==
122
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
123
  = v2.2.5 - (2018-02-22) =
124
  - Tweak: Show Dashboard Widget only if the user can view email logs.
125
 
@@ -295,6 +309,9 @@ This Readme file was generated using <a href = 'http://sudarmuthu.com/wordpress/
295
 
296
  == Upgrade Notice ==
297
 
 
 
 
298
  = 2.2.5 =
299
  Hide Dashboard Widget for users who can't view email logs.
300
 
3
  Tags: email, log, log email, resend email, multisite
4
  Requires PHP: 5.3
5
  Requires at least: 4.0
6
+ Tested up to: 5.1
7
+ Stable tag: 2.3.0
8
 
9
  Log and view all outgoing emails from WordPress. Works with WordPress Multisite as well.
10
 
120
  This Readme file was generated using <a href = 'http://sudarmuthu.com/wordpress/wp-readme'>wp-readme</a>, which generates readme files for WordPress Plugins.
121
  == Changelog ==
122
 
123
+ = v2.3.0 - (2019-04-11) =
124
+
125
+ - New: The 'To' and 'Subject' fields now supports text upto 500 characters.
126
+ - New: Store the name of the attachment file if present.
127
+ - New: Store ip address of the request that triggered the email.
128
+ - New: Setting to enable notification when the number of email logs reach a threshold.
129
+ - New: Dashboard Widget - Provide an option to hide Dashboard Widget from all users.
130
+ - Tweak: Dashboard Widget - Add thousand separator for logs count.
131
+ - Tweak: Improve preview of HTML emails.
132
+ - Tweak: Enhanced the output of System Info page.
133
+ - Fix: Deleting logs in bulk was not working.
134
+ - Fix: Added compatibility with wp-ses plugin.
135
+ - Fix: Added the ability to deactivate expired license.
136
+
137
  = v2.2.5 - (2018-02-22) =
138
  - Tweak: Show Dashboard Widget only if the user can view email logs.
139
 
309
 
310
  == Upgrade Notice ==
311
 
312
+ = 2.3.0 =
313
+ The 'To' and 'Subject' fields now supports text upto 500 characters.
314
+
315
  = 2.2.5 =
316
  Hide Dashboard Widget for users who can't view email logs.
317
 
uninstall.php CHANGED
@@ -13,10 +13,10 @@ if ( ! defined( 'ABSPATH' ) && ! defined( 'WP_UNINSTALL_PLUGIN' ) ) {
13
  if ( is_multisite() ) {
14
  // Note: if there are more than 10,000 blogs or
15
  // if `wp_is_large_network` filter is set, then this may fail.
16
- $sites = wp_get_sites();
17
 
18
  foreach ( $sites as $site ) {
19
- switch_to_blog( $site['blog_id'] );
20
  email_log_delete_db_data();
21
  restore_current_blog();
22
  }
13
  if ( is_multisite() ) {
14
  // Note: if there are more than 10,000 blogs or
15
  // if `wp_is_large_network` filter is set, then this may fail.
16
+ $sites = get_sites();
17
 
18
  foreach ( $sites as $site ) {
19
+ switch_to_blog( $site->blog_id );
20
  email_log_delete_db_data();
21
  restore_current_blog();
22
  }
vendor/sudar/wp-system-info/LICENSE ADDED
@@ -0,0 +1,339 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ GNU GENERAL PUBLIC LICENSE
2
+ Version 2, June 1991
3
+
4
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
5
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
6
+ Everyone is permitted to copy and distribute verbatim copies
7
+ of this license document, but changing it is not allowed.
8
+
9
+ Preamble
10
+
11
+ The licenses for most software are designed to take away your
12
+ freedom to share and change it. By contrast, the GNU General Public
13
+ License is intended to guarantee your freedom to share and change free
14
+ software--to make sure the software is free for all its users. This
15
+ General Public License applies to most of the Free Software
16
+ Foundation's software and to any other program whose authors commit to
17
+ using it. (Some other Free Software Foundation software is covered by
18
+ the GNU Lesser General Public License instead.) You can apply it to
19
+ your programs, too.
20
+
21
+ When we speak of free software, we are referring to freedom, not
22
+ price. Our General Public Licenses are designed to make sure that you
23
+ have the freedom to distribute copies of free software (and charge for
24
+ this service if you wish), that you receive source code or can get it
25
+ if you want it, that you can change the software or use pieces of it
26
+ in new free programs; and that you know you can do these things.
27
+
28
+ To protect your rights, we need to make restrictions that forbid
29
+ anyone to deny you these rights or to ask you to surrender the rights.
30
+ These restrictions translate to certain responsibilities for you if you
31
+ distribute copies of the software, or if you modify it.
32
+
33
+ For example, if you distribute copies of such a program, whether
34
+ gratis or for a fee, you must give the recipients all the rights that
35
+ you have. You must make sure that they, too, receive or can get the
36
+ source code. And you must show them these terms so they know their
37
+ rights.
38
+
39
+ We protect your rights with two steps: (1) copyright the software, and
40
+ (2) offer you this license which gives you legal permission to copy,
41
+ distribute and/or modify the software.
42
+
43
+ Also, for each author's protection and ours, we want to make certain
44
+ that everyone understands that there is no warranty for this free
45
+ software. If the software is modified by someone else and passed on, we
46
+ want its recipients to know that what they have is not the original, so
47
+ that any problems introduced by others will not reflect on the original
48
+ authors' reputations.
49
+
50
+ Finally, any free program is threatened constantly by software
51
+ patents. We wish to avoid the danger that redistributors of a free
52
+ program will individually obtain patent licenses, in effect making the
53
+ program proprietary. To prevent this, we have made it clear that any
54
+ patent must be licensed for everyone's free use or not licensed at all.
55
+
56
+ The precise terms and conditions for copying, distribution and
57
+ modification follow.
58
+
59
+ GNU GENERAL PUBLIC LICENSE
60
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
61
+
62
+ 0. This License applies to any program or other work which contains
63
+ a notice placed by the copyright holder saying it may be distributed
64
+ under the terms of this General Public License. The "Program", below,
65
+ refers to any such program or work, and a "work based on the Program"
66
+ means either the Program or any derivative work under copyright law:
67
+ that is to say, a work containing the Program or a portion of it,
68
+ either verbatim or with modifications and/or translated into another
69
+ language. (Hereinafter, translation is included without limitation in
70
+ the term "modification".) Each licensee is addressed as "you".
71
+
72
+ Activities other than copying, distribution and modification are not
73
+ covered by this License; they are outside its scope. The act of
74
+ running the Program is not restricted, and the output from the Program
75
+ is covered only if its contents constitute a work based on the
76
+ Program (independent of having been made by running the Program).
77
+ Whether that is true depends on what the Program does.
78
+
79
+ 1. You may copy and distribute verbatim copies of the Program's
80
+ source code as you receive it, in any medium, provided that you
81
+ conspicuously and appropriately publish on each copy an appropriate
82
+ copyright notice and disclaimer of warranty; keep intact all the
83
+ notices that refer to this License and to the absence of any warranty;
84
+ and give any other recipients of the Program a copy of this License
85
+ along with the Program.
86
+
87
+ You may charge a fee for the physical act of transferring a copy, and
88
+ you may at your option offer warranty protection in exchange for a fee.
89
+
90
+ 2. You may modify your copy or copies of the Program or any portion
91
+ of it, thus forming a work based on the Program, and copy and
92
+ distribute such modifications or work under the terms of Section 1
93
+ above, provided that you also meet all of these conditions:
94
+
95
+ a) You must cause the modified files to carry prominent notices
96
+ stating that you changed the files and the date of any change.
97
+
98
+ b) You must cause any work that you distribute or publish, that in
99
+ whole or in part contains or is derived from the Program or any
100
+ part thereof, to be licensed as a whole at no charge to all third
101
+ parties under the terms of this License.
102
+
103
+ c) If the modified program normally reads commands interactively
104
+ when run, you must cause it, when started running for such
105
+ interactive use in the most ordinary way, to print or display an
106
+ announcement including an appropriate copyright notice and a
107
+ notice that there is no warranty (or else, saying that you provide
108
+ a warranty) and that users may redistribute the program under
109
+ these conditions, and telling the user how to view a copy of this
110
+ License. (Exception: if the Program itself is interactive but
111
+ does not normally print such an announcement, your work based on
112
+ the Program is not required to print an announcement.)
113
+
114
+ These requirements apply to the modified work as a whole. If
115
+ identifiable sections of that work are not derived from the Program,
116
+ and can be reasonably considered independent and separate works in
117
+ themselves, then this License, and its terms, do not apply to those
118
+ sections when you distribute them as separate works. But when you
119
+ distribute the same sections as part of a whole which is a work based
120
+ on the Program, the distribution of the whole must be on the terms of
121
+ this License, whose permissions for other licensees extend to the
122
+ entire whole, and thus to each and every part regardless of who wrote it.
123
+
124
+ Thus, it is not the intent of this section to claim rights or contest
125
+ your rights to work written entirely by you; rather, the intent is to
126
+ exercise the right to control the distribution of derivative or
127
+ collective works based on the Program.
128
+
129
+ In addition, mere aggregation of another work not based on the Program
130
+ with the Program (or with a work based on the Program) on a volume of
131
+ a storage or distribution medium does not bring the other work under
132
+ the scope of this License.
133
+
134
+ 3. You may copy and distribute the Program (or a work based on it,
135
+ under Section 2) in object code or executable form under the terms of
136
+ Sections 1 and 2 above provided that you also do one of the following:
137
+
138
+ a) Accompany it with the complete corresponding machine-readable
139
+ source code, which must be distributed under the terms of Sections
140
+ 1 and 2 above on a medium customarily used for software interchange; or,
141
+
142
+ b) Accompany it with a written offer, valid for at least three
143
+ years, to give any third party, for a charge no more than your
144
+ cost of physically performing source distribution, a complete
145
+ machine-readable copy of the corresponding source code, to be
146
+ distributed under the terms of Sections 1 and 2 above on a medium
147
+ customarily used for software interchange; or,
148
+
149
+ c) Accompany it with the information you received as to the offer
150
+ to distribute corresponding source code. (This alternative is
151
+ allowed only for noncommercial distribution and only if you
152
+ received the program in object code or executable form with such
153
+ an offer, in accord with Subsection b above.)
154
+
155
+ The source code for a work means the preferred form of the work for
156
+ making modifications to it. For an executable work, complete source
157
+ code means all the source code for all modules it contains, plus any
158
+ associated interface definition files, plus the scripts used to
159
+ control compilation and installation of the executable. However, as a
160
+ special exception, the source code distributed need not include
161
+ anything that is normally distributed (in either source or binary
162
+ form) with the major components (compiler, kernel, and so on) of the
163
+ operating system on which the executable runs, unless that component
164
+ itself accompanies the executable.
165
+
166
+ If distribution of executable or object code is made by offering
167
+ access to copy from a designated place, then offering equivalent
168
+ access to copy the source code from the same place counts as
169
+ distribution of the source code, even though third parties are not
170
+ compelled to copy the source along with the object code.
171
+
172
+ 4. You may not copy, modify, sublicense, or distribute the Program
173
+ except as expressly provided under this License. Any attempt
174
+ otherwise to copy, modify, sublicense or distribute the Program is
175
+ void, and will automatically terminate your rights under this License.
176
+ However, parties who have received copies, or rights, from you under
177
+ this License will not have their licenses terminated so long as such
178
+ parties remain in full compliance.
179
+
180
+ 5. You are not required to accept this License, since you have not
181
+ signed it. However, nothing else grants you permission to modify or
182
+ distribute the Program or its derivative works. These actions are
183
+ prohibited by law if you do not accept this License. Therefore, by
184
+ modifying or distributing the Program (or any work based on the
185
+ Program), you indicate your acceptance of this License to do so, and
186
+ all its terms and conditions for copying, distributing or modifying
187
+ the Program or works based on it.
188
+
189
+ 6. Each time you redistribute the Program (or any work based on the
190
+ Program), the recipient automatically receives a license from the
191
+ original licensor to copy, distribute or modify the Program subject to
192
+ these terms and conditions. You may not impose any further
193
+ restrictions on the recipients' exercise of the rights granted herein.
194
+ You are not responsible for enforcing compliance by third parties to
195
+ this License.
196
+
197
+ 7. If, as a consequence of a court judgment or allegation of patent
198
+ infringement or for any other reason (not limited to patent issues),
199
+ conditions are imposed on you (whether by court order, agreement or
200
+ otherwise) that contradict the conditions of this License, they do not
201
+ excuse you from the conditions of this License. If you cannot
202
+ distribute so as to satisfy simultaneously your obligations under this
203
+ License and any other pertinent obligations, then as a consequence you
204
+ may not distribute the Program at all. For example, if a patent
205
+ license would not permit royalty-free redistribution of the Program by
206
+ all those who receive copies directly or indirectly through you, then
207
+ the only way you could satisfy both it and this License would be to
208
+ refrain entirely from distribution of the Program.
209
+
210
+ If any portion of this section is held invalid or unenforceable under
211
+ any particular circumstance, the balance of the section is intended to
212
+ apply and the section as a whole is intended to apply in other
213
+ circumstances.
214
+
215
+ It is not the purpose of this section to induce you to infringe any
216
+ patents or other property right claims or to contest validity of any
217
+ such claims; this section has the sole purpose of protecting the
218
+ integrity of the free software distribution system, which is
219
+ implemented by public license practices. Many people have made
220
+ generous contributions to the wide range of software distributed
221
+ through that system in reliance on consistent application of that
222
+ system; it is up to the author/donor to decide if he or she is willing
223
+ to distribute software through any other system and a licensee cannot
224
+ impose that choice.
225
+
226
+ This section is intended to make thoroughly clear what is believed to
227
+ be a consequence of the rest of this License.
228
+
229
+ 8. If the distribution and/or use of the Program is restricted in
230
+ certain countries either by patents or by copyrighted interfaces, the
231
+ original copyright holder who places the Program under this License
232
+ may add an explicit geographical distribution limitation excluding
233
+ those countries, so that distribution is permitted only in or among
234
+ countries not thus excluded. In such case, this License incorporates
235
+ the limitation as if written in the body of this License.
236
+
237
+ 9. The Free Software Foundation may publish revised and/or new versions
238
+ of the General Public License from time to time. Such new versions will
239
+ be similar in spirit to the present version, but may differ in detail to
240
+ address new problems or concerns.
241
+
242
+ Each version is given a distinguishing version number. If the Program
243
+ specifies a version number of this License which applies to it and "any
244
+ later version", you have the option of following the terms and conditions
245
+ either of that version or of any later version published by the Free
246
+ Software Foundation. If the Program does not specify a version number of
247
+ this License, you may choose any version ever published by the Free Software
248
+ Foundation.
249
+
250
+ 10. If you wish to incorporate parts of the Program into other free
251
+ programs whose distribution conditions are different, write to the author
252
+ to ask for permission. For software which is copyrighted by the Free
253
+ Software Foundation, write to the Free Software Foundation; we sometimes
254
+ make exceptions for this. Our decision will be guided by the two goals
255
+ of preserving the free status of all derivatives of our free software and
256
+ of promoting the sharing and reuse of software generally.
257
+
258
+ NO WARRANTY
259
+
260
+ 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
261
+ FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
262
+ OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
263
+ PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
264
+ OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
265
+ MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
266
+ TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
267
+ PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
268
+ REPAIR OR CORRECTION.
269
+
270
+ 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
271
+ WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
272
+ REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
273
+ INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
274
+ OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
275
+ TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
276
+ YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
277
+ PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
278
+ POSSIBILITY OF SUCH DAMAGES.
279
+
280
+ END OF TERMS AND CONDITIONS
281
+
282
+ How to Apply These Terms to Your New Programs
283
+
284
+ If you develop a new program, and you want it to be of the greatest
285
+ possible use to the public, the best way to achieve this is to make it
286
+ free software which everyone can redistribute and change under these terms.
287
+
288
+ To do so, attach the following notices to the program. It is safest
289
+ to attach them to the start of each source file to most effectively
290
+ convey the exclusion of warranty; and each file should have at least
291
+ the "copyright" line and a pointer to where the full notice is found.
292
+
293
+ <one line to give the program's name and a brief idea of what it does.>
294
+ Copyright (C) <year> <name of author>
295
+
296
+ This program is free software; you can redistribute it and/or modify
297
+ it under the terms of the GNU General Public License as published by
298
+ the Free Software Foundation; either version 2 of the License, or
299
+ (at your option) any later version.
300
+
301
+ This program is distributed in the hope that it will be useful,
302
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
303
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
304
+ GNU General Public License for more details.
305
+
306
+ You should have received a copy of the GNU General Public License along
307
+ with this program; if not, write to the Free Software Foundation, Inc.,
308
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
309
+
310
+ Also add information on how to contact you by electronic and paper mail.
311
+
312
+ If the program is interactive, make it output a short notice like this
313
+ when it starts in an interactive mode:
314
+
315
+ Gnomovision version 69, Copyright (C) year name of author
316
+ Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
317
+ This is free software, and you are welcome to redistribute it
318
+ under certain conditions; type `show c' for details.
319
+
320
+ The hypothetical commands `show w' and `show c' should show the appropriate
321
+ parts of the General Public License. Of course, the commands you use may
322
+ be called something other than `show w' and `show c'; they could even be
323
+ mouse-clicks or menu items--whatever suits your program.
324
+
325
+ You should also get your employer (if you work as a programmer) or your
326
+ school, if any, to sign a "copyright disclaimer" for the program, if
327
+ necessary. Here is a sample; alter the names:
328
+
329
+ Yoyodyne, Inc., hereby disclaims all copyright interest in the program
330
+ `Gnomovision' (which makes passes at compilers) written by James Hacker.
331
+
332
+ <signature of Ty Coon>, 1 April 1989
333
+ Ty Coon, President of Vice
334
+
335
+ This General Public License does not permit incorporating your program into
336
+ proprietary programs. If your program is a subroutine library, you may
337
+ consider it more useful to permit linking proprietary applications with the
338
+ library. If this is what you want to do, use the GNU Lesser General
339
+ Public License instead of this License.
vendor/sudar/wp-system-info/README.md ADDED
@@ -0,0 +1,2 @@
 
 
1
+ # wp-system-info
2
+ A WordPress library that adds System Info to WordPress plugins
vendor/sudar/wp-system-info/composer.json ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "name": "sudar/wp-system-info",
3
+ "description": "A WordPress library that adds System Info to WordPress plugins",
4
+ "type": "library",
5
+ "license": "GPL-2.0-or-later",
6
+ "authors": [
7
+ {
8
+ "name": "Sudar Muthu",
9
+ "homepage": "https://sudarmuthu.com"
10
+ }
11
+ ],
12
+ "support": {
13
+ "issues": "https://github.com/sudar/wp-system-info/issues"
14
+ },
15
+ "require": {
16
+ "php": ">=5.3"
17
+ },
18
+ "autoload": {
19
+ "psr-4": {
20
+ "Sudar\\WPSystemInfo\\": "src/"
21
+ }
22
+ }
23
+ }
vendor/sudar/wp-system-info/src/SystemInfo.php ADDED
@@ -0,0 +1,393 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Library to show and generate System Info file for WordPress plugins.
4
+ *
5
+ * Greatly inspired (and shares code) from the system info component in Easy Digital Downloads plugin.
6
+ * https://github.com/easydigitaldownloads/easy-digital-downloads
7
+ *
8
+ * @license GPL-2.0+
9
+ * @author Sudar (https://sudarmuthu.com)
10
+ */
11
+
12
+ namespace Sudar\WPSystemInfo;
13
+
14
+ if ( class_exists( 'Sudar\\WPSystemInfo\\SystemInfo' ) ) {
15
+ return;
16
+ }
17
+
18
+ /**
19
+ * Shows and generates the System Info file.
20
+ *
21
+ * @since 1.0.0
22
+ */
23
+ class SystemInfo {
24
+ /**
25
+ * Plugin slug.
26
+ *
27
+ * @var string
28
+ */
29
+ protected $plugin_slug = '';
30
+
31
+ /**
32
+ * Config that controls which sections should be displayed.
33
+ *
34
+ * @var array
35
+ */
36
+ protected $config = array();
37
+
38
+ /**
39
+ * SystemInfo constructor.
40
+ *
41
+ * @param string $plugin_slug Slug of the plugin.
42
+ * @param array $config (Optional) Configuration options.
43
+ *
44
+ * @see SystemInfo::get_default_config for the list of default config information.
45
+ */
46
+ public function __construct( $plugin_slug, $config = array() ) {
47
+ $this->plugin_slug = $plugin_slug;
48
+ $this->config = wp_parse_args( $config, $this->get_default_config() );
49
+ }
50
+
51
+ /**
52
+ * Get Default configuration.
53
+ *
54
+ * @return array Default configuration.
55
+ */
56
+ protected function get_default_config() {
57
+ return array(
58
+ 'show_post_types' => true,
59
+ 'show_taxonomies' => true,
60
+ 'show_users' => true,
61
+ 'show_plugins' => true,
62
+ 'show_network_plugins' => true,
63
+ );
64
+ }
65
+
66
+ /**
67
+ * Render system info.
68
+ *
69
+ * PHPCS is disabled for this function since alignment will mess up the system info output.
70
+ * phpcs:disable
71
+ */
72
+ public function render() {
73
+ global $wpdb;
74
+ ?>
75
+
76
+ <textarea wrap="off" readonly="readonly" name="<?php echo esc_attr( $this->plugin_slug ); ?>-system-info"
77
+ style="font-family:Menlo,Monaco,monospace; white-space:pre; width:100%; height:500px;" onclick="this.focus();this.select()"
78
+ title="<?php _e( 'To copy the system info, click below then press Ctrl + C (PC) or Cmd + C (Mac).', 'email-log' ); ?>">
79
+ ### Begin System Info (Generated at <?php echo current_time( 'Y-m-d H:i:s', true ); ?>) ###
80
+
81
+ <?php
82
+ /**
83
+ * Runs before displaying system info.
84
+ *
85
+ * This action is primarily for adding extra content in System Info.
86
+ *
87
+ * @since 1.0.0
88
+ *
89
+ * @param string $plugin_name Plugin slug.
90
+ */
91
+ do_action( 'before_system_info', $this->plugin_slug );
92
+ do_action( "before_system_info_for_{$this->plugin_slug}" );
93
+ ?>
94
+ -- Site Info --
95
+
96
+ Site URL: <?php echo site_url() . "\n"; ?>
97
+ Home URL: <?php echo home_url() . "\n"; ?>
98
+ Multisite: <?php echo is_multisite() ? 'Yes' . "\n" : 'No' . "\n"; ?>
99
+
100
+ -- WordPress Configuration --
101
+
102
+ Version: <?php echo get_bloginfo( 'version' ) . "\n"; ?>
103
+ Language: <?php echo get_locale() . "\n"; ?>
104
+ Permalink Structure: <?php echo get_option( 'permalink_structure' ) . "\n"; ?>
105
+ GMT Offset: <?php echo esc_html( get_option( 'gmt_offset' ) ), "\n"; ?>
106
+ Memory Limit: <?php echo WP_MEMORY_LIMIT; ?><?php echo "\n"; ?>
107
+ Memory Max Limit: <?php echo WP_MAX_MEMORY_LIMIT; ?><?php echo "\n"; ?>
108
+ Active Theme: <?php echo $this->get_current_theme_name() . "\n"; ?>
109
+ ABSPATH: <?php echo ABSPATH . "\n"; ?>
110
+ WP Table Prefix: <?php echo $wpdb->prefix, "\n"; ?>
111
+ WP_DEBUG: <?php echo defined( 'WP_DEBUG' ) ? WP_DEBUG ? 'Enabled' . "\n" : 'Disabled' . "\n" : 'Not set' . "\n"; ?>
112
+ SAVEQUERIES: <?php echo defined( 'SAVEQUERIES' ) ? SAVEQUERIES ? 'Enabled' . "\n" : 'Disabled' . "\n" : 'Not set' . "\n"; ?>
113
+ WP_SCRIPT_DEBUG: <?php echo defined( 'WP_SCRIPT_DEBUG' ) ? WP_SCRIPT_DEBUG ? 'Enabled' . "\n" : 'Disabled' . "\n" : 'Not set' . "\n"; ?>
114
+ DISABLE_WP_CRON: <?php echo defined( 'DISABLE_WP_CRON' ) ? DISABLE_WP_CRON ? 'Yes' . "\n" : 'No' . "\n" : 'Not set' . "\n"; ?>
115
+ WP_CRON_LOCK_TIMEOUT: <?php echo defined( 'WP_CRON_LOCK_TIMEOUT' ) ? WP_CRON_LOCK_TIMEOUT : 'Not set', "\n"; ?>
116
+ EMPTY_TRASH_DAYS: <?php echo defined( 'EMPTY_TRASH_DAYS' ) ? EMPTY_TRASH_DAYS : 'Not set', "\n"; ?>
117
+
118
+ <?php
119
+ $this->print_post_types();
120
+ $this->print_taxonomies();
121
+ $this->print_user_roles();
122
+ $this->print_current_plugins();
123
+ $this->print_network_active_plugins();
124
+ $host = $this->print_web_host_details();
125
+ ?>
126
+ -- User Browser --
127
+
128
+ User Agent String: <?php echo esc_html( $_SERVER['HTTP_USER_AGENT'] ), "\n"; ?>
129
+
130
+ -- Webserver Configuration --
131
+
132
+ PHP Version: <?php echo PHP_VERSION . "\n"; ?>
133
+ MySQL Version: <?php echo $wpdb->db_version() . "\n"; ?>
134
+ Web Server Info: <?php echo $_SERVER['SERVER_SOFTWARE'] . "\n"; ?>
135
+ Platform: <?php echo php_uname( 's' ) . "\n"; ?>
136
+
137
+ -- PHP Configuration --
138
+
139
+ PHP Memory Limit: <?php echo ini_get( 'memory_limit' ) . "\n"; ?>
140
+ PHP Safe Mode: <?php echo ini_get( 'safe_mode' ) ? 'Yes' : 'No', "\n"; // phpcs:ignore PHPCompatibility.PHP.DeprecatedIniDirectives.safe_modeDeprecatedRemoved ?>
141
+ PHP Upload Max Size: <?php echo ini_get( 'upload_max_filesize' ) . "\n"; ?>
142
+ PHP Post Max Size: <?php echo ini_get( 'post_max_size' ) . "\n"; ?>
143
+ PHP Upload Max Filesize: <?php echo ini_get( 'upload_max_filesize' ) . "\n"; ?>
144
+ PHP Time Limit: <?php echo ini_get( 'max_execution_time' ) . "\n"; ?>
145
+ PHP Max Input Vars: <?php echo ini_get( 'max_input_vars' ) . "\n"; // phpcs:ignore PHPCompatibility.PHP.NewIniDirectives.max_input_varsFound ?>
146
+ Display Errors: <?php echo ( ini_get( 'display_errors' ) ) ? 'On (' . ini_get( 'display_errors' ) . ')' : 'N/A'; ?><?php echo "\n"; ?>
147
+ PHP Arg Separator: <?php echo ini_get( 'arg_separator.output' ) . "\n"; ?>
148
+ PHP Allow URL File Open: <?php echo ini_get( 'allow_url_fopen' ) ? 'Yes' : 'No', "\n"; ?>
149
+
150
+ -- PHP Extensions --
151
+
152
+ fsockopen: <?php echo ( function_exists( 'fsockopen' ) ) ? 'Your server supports fsockopen.' : 'Your server does not support fsockopen.'; ?><?php echo "\n"; ?>
153
+ cURL: <?php echo ( function_exists( 'curl_init' ) ) ? 'Your server supports cURL.' : 'Your server does not support cURL.'; ?><?php echo "\n"; ?>
154
+ SOAP Client: <?php echo ( class_exists( 'SoapClient' ) ) ? 'Your server has the SOAP Client enabled.' : 'Your server does not have the SOAP Client enabled.'; ?><?php echo "\n"; ?>
155
+ SUHOSIN: <?php echo ( extension_loaded( 'suhosin' ) ) ? 'Your server has SUHOSIN installed.' : 'Your server does not have SUHOSIN installed.'; ?><?php echo "\n"; ?>
156
+
157
+ -- Session Configuration --
158
+
159
+ Session: <?php echo isset( $_SESSION ) ? 'Enabled' : 'Disabled'; ?><?php echo "\n"; ?>
160
+ Session Name: <?php echo esc_html( ini_get( 'session.name' ) ); ?><?php echo "\n"; ?>
161
+ Cookie Path: <?php echo esc_html( ini_get( 'session.cookie_path' ) ); ?><?php echo "\n"; ?>
162
+ Save Path: <?php echo esc_html( ini_get( 'session.save_path' ) ); ?><?php echo "\n"; ?>
163
+ Use Cookies: <?php echo ini_get( 'session.use_cookies' ) ? 'On' : 'Off'; ?><?php echo "\n"; ?>
164
+ Use Only Cookies: <?php echo ini_get( 'session.use_only_cookies' ) ? 'On' : 'Off'; ?><?php echo "\n"; ?>
165
+
166
+ <?php
167
+ /**
168
+ * Runs after displaying system info.
169
+ *
170
+ * This action is primarily for adding extra content in System Info.
171
+ *
172
+ * @param string $plugin_name Plugin slug.
173
+ */
174
+ do_action( 'after_system_info', $this->plugin_slug );
175
+ do_action( "after_system_info_for_{$this->plugin_slug}" );
176
+ ?>
177
+ ### End System Info ###</textarea>
178
+
179
+ <?php
180
+ }
181
+ // phpcs:enable
182
+
183
+ /**
184
+ * Download System info as a file.
185
+ *
186
+ * @param string $file_name (Optional)Name of the file. Default is {plugin slug}-system-info.txt.
187
+ */
188
+ public function download_as_file( $file_name = '' ) {
189
+ if ( empty( $file_name ) ) {
190
+ $file_name = $this->plugin_slug . '-system-info.txt';
191
+ }
192
+
193
+ nocache_headers();
194
+
195
+ header( 'Content-type: text/plain' );
196
+ header( 'Content-Disposition: attachment; filename="' . $file_name . '"' );
197
+
198
+ echo wp_strip_all_tags( $_POST[ $this->plugin_slug . '-system-info'] );
199
+ die();
200
+ }
201
+
202
+ /**
203
+ * Get current theme name.
204
+ *
205
+ * @return string Current theme name.
206
+ */
207
+ protected function get_current_theme_name() {
208
+ if ( get_bloginfo( 'version' ) < '3.4' ) {
209
+ $theme_data = get_theme_data( get_stylesheet_directory() . '/style.css' );
210
+
211
+ return $theme_data['Name'] . ' ' . $theme_data['Version'];
212
+ }
213
+
214
+ $theme_data = wp_get_theme();
215
+
216
+ return $theme_data->Name . ' ' . $theme_data->Version;
217
+ }
218
+
219
+ /**
220
+ * Try to identity the hosting provider.
221
+ *
222
+ * @return string Web host name if identified, empty string otherwise.
223
+ */
224
+ protected function print_web_host_details() {
225
+ $host = '';
226
+
227
+ if ( defined( 'WPE_APIKEY' ) ) {
228
+ $host = 'WP Engine';
229
+ } elseif ( defined( 'PAGELYBIN' ) ) {
230
+ $host = 'Pagely';
231
+ }
232
+
233
+ /**
234
+ * Filter the identified webhost.
235
+ *
236
+ * @since 1.0.0
237
+ *
238
+ * @param string $host Identified web host.
239
+ * @param string $plugin_name Plugin slug.
240
+ */
241
+ $host = apply_filters( 'system_info_host', $host, $this->plugin_slug );
242
+
243
+ if ( empty( $host ) ) {
244
+ return;
245
+ }
246
+
247
+ echo '-- Hosting Provider --', "\n\n";
248
+ echo 'Host: ', $host, "\n";
249
+ echo "\n";
250
+ }
251
+
252
+ /**
253
+ * Print plugins that are currently active.
254
+ */
255
+ protected function print_current_plugins() {
256
+ if ( ! $this->config['show_plugins'] ) {
257
+ return;
258
+ }
259
+
260
+ echo "\n";
261
+ echo '-- WordPress Active Plugins --', "\n\n";
262
+
263
+ $plugins = get_plugins();
264
+ $active_plugins = get_option( 'active_plugins', array() );
265
+
266
+ foreach ( $plugins as $plugin_path => $plugin ) {
267
+ // If the plugin isn't active, don't show it.
268
+ if ( ! in_array( $plugin_path, $active_plugins, true ) ) {
269
+ continue;
270
+ }
271
+
272
+ echo $plugin['Name'] . ': ' . $plugin['Version'] . "\n";
273
+ }
274
+
275
+ echo "\n";
276
+ }
277
+
278
+ /**
279
+ * Print network active plugins.
280
+ */
281
+ protected function print_network_active_plugins() {
282
+ if ( ! is_multisite() || ! $this->config['show_network_plugins'] ) {
283
+ return;
284
+ }
285
+
286
+ echo "\n";
287
+ echo '-- Network Active Plugins --';
288
+
289
+ $plugins = wp_get_active_network_plugins();
290
+ $active_plugins = get_site_option( 'active_sitewide_plugins', array() );
291
+
292
+ foreach ( $plugins as $plugin_path ) {
293
+ $plugin_base = plugin_basename( $plugin_path );
294
+
295
+ // If the plugin isn't active, don't show it.
296
+ if ( ! array_key_exists( $plugin_base, $active_plugins ) ) {
297
+ continue;
298
+ }
299
+
300
+ $plugin = get_plugin_data( $plugin_path );
301
+
302
+ echo $plugin['Name'] . ' :' . $plugin['Version'] . "\n";
303
+ }
304
+
305
+ echo "\n";
306
+ }
307
+
308
+ /**
309
+ * Print the list of post types and the number of posts in them.
310
+ *
311
+ * @param int $spacing Spacing length.
312
+ */
313
+ protected function print_post_types( $spacing = 26 ) {
314
+ if ( ! $this->config['show_post_types'] ) {
315
+ return;
316
+ }
317
+
318
+ $post_types = get_post_types();
319
+
320
+ echo 'Registered Post types: ', implode( ', ', $post_types ), "\n";
321
+
322
+ foreach ( $post_types as $post_type ) {
323
+ echo $post_type;
324
+
325
+ if ( strlen( $post_type ) < $spacing ) {
326
+ echo str_repeat( ' ', $spacing - strlen( $post_type ) );
327
+ }
328
+
329
+ $post_count = wp_count_posts( $post_type );
330
+ foreach ( $post_count as $key => $value ) {
331
+ echo $key, '=', $value, ', ';
332
+ }
333
+
334
+ echo "\n";
335
+ }
336
+ }
337
+
338
+ /**
339
+ * Print the list of taxonomies together with term count.
340
+ */
341
+ protected function print_taxonomies() {
342
+ if ( ! $this->config['show_taxonomies'] ) {
343
+ return;
344
+ }
345
+
346
+ echo "\n";
347
+ echo 'Registered Taxonomies: ';
348
+
349
+ $taxonomies = get_taxonomies();
350
+ foreach ( $taxonomies as $taxonomy ) {
351
+ echo $taxonomy, ' (', wp_count_terms( $taxonomy, array( 'hide_empty' => false ) ), '), ';
352
+ }
353
+ echo "\n";
354
+ }
355
+
356
+ /**
357
+ * Print list of user roles and the number of users in each role.
358
+ */
359
+ protected function print_user_roles() {
360
+ global $wp_roles;
361
+
362
+ if ( ! $this->config['show_users'] ) {
363
+ return;
364
+ }
365
+
366
+ echo "\n";
367
+ echo 'Users: ';
368
+
369
+ foreach ( $wp_roles->roles as $role => $role_details ) {
370
+ echo $role_details['name'], ' (', absint( $this->get_user_count_by_role( $role ) ), '), ';
371
+ }
372
+ echo "\n";
373
+ }
374
+
375
+ /**
376
+ * Get the number of users present in a role.
377
+ *
378
+ * @param string $role Role slug.
379
+ *
380
+ * @return int Number of users in that role.
381
+ */
382
+ protected function get_user_count_by_role( $role ) {
383
+ $users_count = count_users();
384
+
385
+ $roles = $users_count['avail_roles'];
386
+
387
+ if ( ! array_key_exists( $role, $roles ) ) {
388
+ return 0;
389
+ }
390
+
391
+ return $roles[ $role ];
392
+ }
393
+ }