Post Expirator - Version 2.7.5

Version Description

Download this release

Release Info

Developer andergmartins
Plugin Icon 128x128 Post Expirator
Version 2.7.5
Comparing to
See all releases

Code changes from version 2.7.4 to 2.7.5

Files changed (3) hide show
  1. post-expirator.php +22 -14
  2. readme.txt +6 -1
  3. vendor/composer/installed.php +2 -2
post-expirator.php CHANGED
@@ -4,7 +4,7 @@
4
  * Plugin URI: http://wordpress.org/extend/plugins/post-expirator/
5
  * Description: Allows you to add an expiration date (minute) to posts which you can configure to either delete the post, change it to a draft, or update the post categories at expiration time.
6
  * Author: PublishPress
7
- * Version: 2.7.4
8
  * Author URI: http://publishpress.com
9
  * Text Domain: post-expirator
10
  * Domain Path: /languages
@@ -27,7 +27,7 @@ if (class_exists('PublishPressInstanceProtection\\Config')) {
27
 
28
  if (! defined('POSTEXPIRATOR_LOADED')) {
29
  // Default Values
30
- define('POSTEXPIRATOR_VERSION', '2.7.4');
31
  define('POSTEXPIRATOR_DATEFORMAT', __('l F jS, Y', 'post-expirator'));
32
  define('POSTEXPIRATOR_TIMEFORMAT', __('g:ia', 'post-expirator'));
33
  define('POSTEXPIRATOR_FOOTERCONTENTS', __('Post expires at EXPIRATIONTIME on EXPIRATIONDATE', 'post-expirator'));
@@ -801,6 +801,8 @@ if (! defined('POSTEXPIRATOR_LOADED')) {
801
 
802
  $id = (int)$id;
803
 
 
 
804
  if (empty($id)) {
805
  if (POSTEXPIRATOR_DEBUG) {
806
  $debug->save(array('message' => 'No Post ID found - exiting'));
@@ -1367,6 +1369,7 @@ if (! defined('POSTEXPIRATOR_LOADED')) {
1367
  );
1368
 
1369
  $emailsToSend = array();
 
1370
  // Get Blog Admins
1371
  $blogAdmins = get_option('expirationdateEmailNotificationAdmins', POSTEXPIRATOR_EMAILNOTIFICATIONADMINS);
1372
  // phpcs:ignore WordPress.PHP.StrictComparisons.LooseComparison
@@ -1395,15 +1398,21 @@ if (! defined('POSTEXPIRATOR_LOADED')) {
1395
  }
1396
  }
1397
 
1398
- // Send Emails
1399
- foreach ($emailsToSend as $email) {
1400
- if (wp_mail($email, sprintf(__('[%1$s] %2$s'), get_option('blogname'), $emailSubject), $emailBody)) {
1401
- if (POSTEXPIRATOR_DEBUG) {
1402
- $debug->save(array('message' => $id . ' -> EXPIRATION EMAIL SENT (' . $email . ')'));
1403
- }
1404
- } else {
1405
- if (POSTEXPIRATOR_DEBUG) {
1406
- $debug->save(array('message' => $id . ' -> EXPIRATION EMAIL FAILED (' . $email . ')'));
 
 
 
 
 
 
1407
  }
1408
  }
1409
  }
@@ -2103,12 +2112,11 @@ if (! defined('POSTEXPIRATOR_LOADED')) {
2103
  function postexpirator_date_save_bulk_edit()
2104
  {
2105
  // Save Bulk edit data
2106
- $wpListTable = _get_list_table('WP_Posts_List_Table');
2107
- $doaction = $wpListTable->current_action();
2108
  $facade = PostExpirator_Facade::getInstance();
2109
 
2110
  if (
2111
- 'edit' !== $doaction
2112
  || ! isset($_REQUEST['postexpirator_view'])
2113
  || $_REQUEST['postexpirator_view'] !== 'bulk-edit'
2114
  || ! isset($_REQUEST['expirationdate_status'])
4
  * Plugin URI: http://wordpress.org/extend/plugins/post-expirator/
5
  * Description: Allows you to add an expiration date (minute) to posts which you can configure to either delete the post, change it to a draft, or update the post categories at expiration time.
6
  * Author: PublishPress
7
+ * Version: 2.7.5
8
  * Author URI: http://publishpress.com
9
  * Text Domain: post-expirator
10
  * Domain Path: /languages
27
 
28
  if (! defined('POSTEXPIRATOR_LOADED')) {
29
  // Default Values
30
+ define('POSTEXPIRATOR_VERSION', '2.7.5');
31
  define('POSTEXPIRATOR_DATEFORMAT', __('l F jS, Y', 'post-expirator'));
32
  define('POSTEXPIRATOR_TIMEFORMAT', __('g:ia', 'post-expirator'));
33
  define('POSTEXPIRATOR_FOOTERCONTENTS', __('Post expires at EXPIRATIONTIME on EXPIRATIONDATE', 'post-expirator'));
801
 
802
  $id = (int)$id;
803
 
804
+ $debug->save(array('message' => 'Called postexpirator_expire_post with id=' . $id));
805
+
806
  if (empty($id)) {
807
  if (POSTEXPIRATOR_DEBUG) {
808
  $debug->save(array('message' => 'No Post ID found - exiting'));
1369
  );
1370
 
1371
  $emailsToSend = array();
1372
+
1373
  // Get Blog Admins
1374
  $blogAdmins = get_option('expirationdateEmailNotificationAdmins', POSTEXPIRATOR_EMAILNOTIFICATIONADMINS);
1375
  // phpcs:ignore WordPress.PHP.StrictComparisons.LooseComparison
1398
  }
1399
  }
1400
 
1401
+ $emailsToSend = array_unique($emailsToSend);
1402
+
1403
+ if (! empty($emailsToSend)) {
1404
+ $debug->save(array('message' => $id . ' -> SENDING EMAIL TO (' . implode(', ', $emailsToSend) . ')'));
1405
+
1406
+ // Send Emails
1407
+ foreach ($emailsToSend as $email) {
1408
+ if (wp_mail($email, sprintf(__('[%1$s] %2$s'), get_option('blogname'), $emailSubject), $emailBody)) {
1409
+ if (POSTEXPIRATOR_DEBUG) {
1410
+ $debug->save(array('message' => $id . ' -> EXPIRATION EMAIL SENT (' . $email . ')'));
1411
+ }
1412
+ } else {
1413
+ if (POSTEXPIRATOR_DEBUG) {
1414
+ $debug->save(array('message' => $id . ' -> EXPIRATION EMAIL FAILED (' . $email . ')'));
1415
+ }
1416
  }
1417
  }
1418
  }
2112
  function postexpirator_date_save_bulk_edit()
2113
  {
2114
  // Save Bulk edit data
2115
+ $doAction = isset($_GET['action']) ? sanitize_key($_GET['action']) : '';
 
2116
  $facade = PostExpirator_Facade::getInstance();
2117
 
2118
  if (
2119
+ 'edit' !== $doAction
2120
  || ! isset($_REQUEST['postexpirator_view'])
2121
  || $_REQUEST['postexpirator_view'] !== 'bulk-edit'
2122
  || ! isset($_REQUEST['expirationdate_status'])
readme.txt CHANGED
@@ -5,7 +5,7 @@ Author URI: https://publishpress.com
5
  Tags: expire, posts, pages, schedule
6
  Requires at least: 5.3
7
  Tested up to: 6.0
8
- Stable tag: 2.7.4
9
 
10
  Add an expiration date to posts. When your post is automatically unpublished, you can delete the post, change the status, or update the post categories.
11
 
@@ -81,6 +81,11 @@ This section describes how to install the plugin and get it working.
81
 
82
  == Changelog ==
83
 
 
 
 
 
 
84
  = [2.7.4] - 07 Jun, 2022 =
85
 
86
  * CHANGED: Add library to protect breaking site when multiple instances of the plugin are activated;
5
  Tags: expire, posts, pages, schedule
6
  Requires at least: 5.3
7
  Tested up to: 6.0
8
+ Stable tag: 2.7.5
9
 
10
  Add an expiration date to posts. When your post is automatically unpublished, you can delete the post, change the status, or update the post categories.
11
 
81
 
82
  == Changelog ==
83
 
84
+ = [2.7.5] - 09 Jun, 2022 =
85
+
86
+ * FIXED: Fix undefined array key "hook_suffix" warning, #259;
87
+ * FIXED: Double email sending bug confirmed bug, #204;
88
+
89
  = [2.7.4] - 07 Jun, 2022 =
90
 
91
  * CHANGED: Add library to protect breaking site when multiple instances of the plugin are activated;
vendor/composer/installed.php CHANGED
@@ -5,7 +5,7 @@
5
  'type' => 'wordpress-plugin',
6
  'install_path' => __DIR__ . '/../../',
7
  'aliases' => array(),
8
- 'reference' => '723a707562d75682325e118656502b6c744b3146',
9
  'name' => 'publishpress/publishpress-future',
10
  'dev' => false,
11
  ),
@@ -16,7 +16,7 @@
16
  'type' => 'wordpress-plugin',
17
  'install_path' => __DIR__ . '/../../',
18
  'aliases' => array(),
19
- 'reference' => '723a707562d75682325e118656502b6c744b3146',
20
  'dev_requirement' => false,
21
  ),
22
  'publishpress/publishpress-instance-protection' => array(
5
  'type' => 'wordpress-plugin',
6
  'install_path' => __DIR__ . '/../../',
7
  'aliases' => array(),
8
+ 'reference' => '01ad0a2423e306e4401d57279d2c34ed02add9e6',
9
  'name' => 'publishpress/publishpress-future',
10
  'dev' => false,
11
  ),
16
  'type' => 'wordpress-plugin',
17
  'install_path' => __DIR__ . '/../../',
18
  'aliases' => array(),
19
+ 'reference' => '01ad0a2423e306e4401d57279d2c34ed02add9e6',
20
  'dev_requirement' => false,
21
  ),
22
  'publishpress/publishpress-instance-protection' => array(