Delete Duplicate Posts - Version 4.8.3

Version Description

  • FIX: Limit amount of duplicates to find - reduces server load for large sites with many duplicates.
  • FIX: PHP notice about missing redirection database when loading the plugin page.
Download this release

Release Info

Developer lkoudal
Plugin Icon 128x128 Delete Duplicate Posts
Version 4.8.3
Comparing to
See all releases

Code changes from version 4.8.2 to 4.8.3

delete-duplicate-posts.php CHANGED
@@ -5,7 +5,7 @@ Plugin Name: Delete Duplicate Posts
5
  Plugin Script: delete-duplicate-posts.php
6
  Plugin URI: https://cleverplugins.com
7
  Description: Remove duplicate blogposts on your blog! Searches and removes duplicate posts and their post meta tags. You can delete posts, pages and other Custom Post Types enabled on your website.
8
- Version: 4.8.2
9
  Author: cleverplugins.com
10
  Author URI: https://cleverplugins.com
11
  Min WP Version: 4.7
@@ -247,7 +247,7 @@ if ( !class_exists( 'Delete_Duplicate_Posts' ) ) {
247
  $current_user = wp_get_current_user();
248
  ?>
249
  <div id="cp-ddp-newsletter" data-dismissible="ddp-newsletter-14" class="updated notice notice-success is-dismissible">
250
- <h3>Delete Duplicate Posts Newsletter</h3>
251
  <h4>Please sign up for our newsletter to learn about changes and improvements to the plugin.</h4>
252
  <form class="ml-block-form" action="https://static.mailerlite.com/webforms/submit/l2v7x5" data-code="l2v7x5" method="post" target="_blank">
253
  <table>
@@ -286,7 +286,7 @@ if ( !class_exists( 'Delete_Duplicate_Posts' ) ) {
286
  <input type="hidden" name="ml-submit" value="1">
287
  <input type="hidden" name="anticsrf" value="true">
288
  </form>
289
- <p><small>Signup form is shown every 14 days until dismissed</small></p>
290
  </div>
291
  <?php
292
  }
@@ -569,8 +569,8 @@ if ( !class_exists( 'Delete_Duplicate_Posts' ) ) {
569
  if ( 'titlecompare' === $comparemethod ) {
570
  // @todo - prepare - not urgent, there is no way to exploit this query
571
  $resultsoutput = '';
572
- if ( 0 > $resultslimit ) {
573
- $resultsoutput = ' LIMIT ' . intval( $resultslimit );
574
  }
575
  $thisquery = "SELECT t1.ID, t1.post_title, t1.post_type, t1.post_status, save_this_post_id\n\t\t\t\t\t\t\t\t\t\t\t\t\tFROM {$table_name} AS t1 INNER JOIN (\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tSELECT post_title, " . $minmax . " AS save_this_post_id\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tFROM {$table_name}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tWHERE post_type IN (" . $ddp_pts . ')
576
  AND post_type NOT IN ("nav_menu_item")
@@ -603,6 +603,7 @@ if ( !class_exists( 'Delete_Duplicate_Posts' ) ) {
603
  $ddpstatuscnt[$mystatus] = 1;
604
  }
605
 
 
606
 
607
  if ( $dupe['ID'] !== $dupe['save_this_post_id'] ) {
608
  $dupedetails = array(
@@ -875,7 +876,7 @@ if ( !class_exists( 'Delete_Duplicate_Posts' ) ) {
875
  self::save_options( $options );
876
 
877
  if ( !$manualrun ) {
878
- self::log( __( 'Cron job running.', 'delete-duplicate-posts' ) );
879
  } else {
880
  self::log( __( 'Manually cleaning.', 'delete-duplicate-posts' ) );
881
  }
@@ -921,7 +922,7 @@ if ( !class_exists( 'Delete_Duplicate_Posts' ) ) {
921
 
922
  if ( $options['ddp_debug'] ) {
923
  self::log( sprintf(
924
- __( "DEBUG: Deleted %1\$s '%2\$s' (id: %3\$s) in %4\$s sec.", 'delete-duplicate-posts' ),
925
  $dupe['type'],
926
  $title,
927
  $postid,
@@ -1608,7 +1609,7 @@ if ( !class_exists( 'Delete_Duplicate_Posts' ) ) {
1608
  </tr>
1609
 
1610
  <tr>
1611
- <th><label for="ddp_enabled"><?php
1612
  esc_html_e( 'Post status', 'delete-duplicate-posts' );
1613
  ?></label>
1614
  </th>
5
  Plugin Script: delete-duplicate-posts.php
6
  Plugin URI: https://cleverplugins.com
7
  Description: Remove duplicate blogposts on your blog! Searches and removes duplicate posts and their post meta tags. You can delete posts, pages and other Custom Post Types enabled on your website.
8
+ Version: 4.8.3
9
  Author: cleverplugins.com
10
  Author URI: https://cleverplugins.com
11
  Min WP Version: 4.7
247
  $current_user = wp_get_current_user();
248
  ?>
249
  <div id="cp-ddp-newsletter" data-dismissible="ddp-newsletter-14" class="updated notice notice-success is-dismissible">
250
+ <h3>Cleverplugins.com Newsletter</h3>
251
  <h4>Please sign up for our newsletter to learn about changes and improvements to the plugin.</h4>
252
  <form class="ml-block-form" action="https://static.mailerlite.com/webforms/submit/l2v7x5" data-code="l2v7x5" method="post" target="_blank">
253
  <table>
286
  <input type="hidden" name="ml-submit" value="1">
287
  <input type="hidden" name="anticsrf" value="true">
288
  </form>
289
+ <p><small>Signup form is shown every 14 days</small></p>
290
  </div>
291
  <?php
292
  }
569
  if ( 'titlecompare' === $comparemethod ) {
570
  // @todo - prepare - not urgent, there is no way to exploit this query
571
  $resultsoutput = '';
572
+ if ( 0 < $viewlimit ) {
573
+ $resultsoutput = ' LIMIT ' . intval( $viewlimit );
574
  }
575
  $thisquery = "SELECT t1.ID, t1.post_title, t1.post_type, t1.post_status, save_this_post_id\n\t\t\t\t\t\t\t\t\t\t\t\t\tFROM {$table_name} AS t1 INNER JOIN (\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tSELECT post_title, " . $minmax . " AS save_this_post_id\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tFROM {$table_name}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tWHERE post_type IN (" . $ddp_pts . ')
576
  AND post_type NOT IN ("nav_menu_item")
603
  $ddpstatuscnt[$mystatus] = 1;
604
  }
605
 
606
+ // Only save the dupes
607
 
608
  if ( $dupe['ID'] !== $dupe['save_this_post_id'] ) {
609
  $dupedetails = array(
876
  self::save_options( $options );
877
 
878
  if ( !$manualrun ) {
879
+ self::log( __( 'Automatic CRON job running.', 'delete-duplicate-posts' ) );
880
  } else {
881
  self::log( __( 'Manually cleaning.', 'delete-duplicate-posts' ) );
882
  }
922
 
923
  if ( $options['ddp_debug'] ) {
924
  self::log( sprintf(
925
+ __( "DEBUG: Deleted %1\$s %2\$s (id: %3\$s) in %4\$s sec.", 'delete-duplicate-posts' ),
926
  $dupe['type'],
927
  $title,
928
  $postid,
1609
  </tr>
1610
 
1611
  <tr>
1612
+ <th><label for="ddp_pstati"><?php
1613
  esc_html_e( 'Post status', 'delete-duplicate-posts' );
1614
  ?></label>
1615
  </th>
readme.txt CHANGED
@@ -6,7 +6,7 @@ License: GPLv2 or later
6
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
7
  Requires at least: 4.7
8
  Tested up to: 6.0.3
9
- Stable tag: 4.8.2
10
  Requires PHP: 5.6
11
 
12
  Get rid of duplicate posts and pages on your blog!
@@ -54,6 +54,10 @@ You should restore the backup you took of your website before you ran this tool.
54
 
55
  == Changelog ==
56
 
 
 
 
 
57
  = 4.8.2 =
58
  * FIX: E-mails not getting sent - thank you @helenekh
59
  * Added debug information for email sending in the log.
6
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
7
  Requires at least: 4.7
8
  Tested up to: 6.0.3
9
+ Stable tag: 4.8.3
10
  Requires PHP: 5.6
11
 
12
  Get rid of duplicate posts and pages on your blog!
54
 
55
  == Changelog ==
56
 
57
+ = 4.8.3 =
58
+ * FIX: Limit amount of duplicates to find - reduces server load for large sites with many duplicates.
59
+ * FIX: PHP notice about missing redirection database when loading the plugin page.
60
+
61
  = 4.8.2 =
62
  * FIX: E-mails not getting sent - thank you @helenekh
63
  * Added debug information for email sending in the log.
vendor/composer/installed.php CHANGED
@@ -3,7 +3,7 @@
3
  'name' => '__root__',
4
  'pretty_version' => 'dev-master',
5
  'version' => 'dev-master',
6
- 'reference' => '8651c832b16b49e85fb2806ef4c86ac0a719707f',
7
  'type' => 'library',
8
  'install_path' => __DIR__ . '/../../',
9
  'aliases' => array(),
@@ -13,7 +13,7 @@
13
  '__root__' => array(
14
  'pretty_version' => 'dev-master',
15
  'version' => 'dev-master',
16
- 'reference' => '8651c832b16b49e85fb2806ef4c86ac0a719707f',
17
  'type' => 'library',
18
  'install_path' => __DIR__ . '/../../',
19
  'aliases' => array(),
3
  'name' => '__root__',
4
  'pretty_version' => 'dev-master',
5
  'version' => 'dev-master',
6
+ 'reference' => '8650461a0d017302652a14f73de78b687ac87061',
7
  'type' => 'library',
8
  'install_path' => __DIR__ . '/../../',
9
  'aliases' => array(),
13
  '__root__' => array(
14
  'pretty_version' => 'dev-master',
15
  'version' => 'dev-master',
16
+ 'reference' => '8650461a0d017302652a14f73de78b687ac87061',
17
  'type' => 'library',
18
  'install_path' => __DIR__ . '/../../',
19
  'aliases' => array(),