Delete Duplicate Posts - Version 4.7.9

Version Description

  • FIX: Plugin would not show results if the limit was set to "No limit".
Download this release

Release Info

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

Code changes from version 4.7.8 to 4.7.9

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.7.8
9
  Author: cleverplugins.com
10
  Author URI: https://cleverplugins.com
11
  Min WP Version: 4.7
@@ -542,14 +542,10 @@ if ( !class_exists( 'Delete_Duplicate_Posts' ) ) {
542
  global $wpdb ;
543
  $table_name = $wpdb->prefix . 'posts';
544
  $resultslimit = $options['ddp_resultslimit'];
545
- $viewlimit = $resultslimit;
546
- /*
547
- if ( 101 < $resultslimit ) {
548
- $viewlimit = $resultslimit;
549
- } else {
550
- $viewlimit = 50;
551
- }
552
- */
553
  $ddp_pts_arr = $options['ddp_pts'];
554
 
555
  if ( isset( $ddp_pts_arr ) && is_array( $ddp_pts_arr ) ) {
@@ -660,6 +656,51 @@ if ( !class_exists( 'Delete_Duplicate_Posts' ) ) {
660
 
661
  $return_duplicates_time = self::timerstop( 'return_duplicates' );
662
  // @todo memory usage
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
663
  self::log( $json_response['dupescount'] . ' duplicates found in ' . $return_duplicates_time . ' sec. ' . $statusdata . ' Mem usage: ' . self::pretty_value( memory_get_peak_usage( true ) ) );
664
  } else {
665
  $json_response['msg'] = __( 'Error: Choose post types to check.', '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.7.9
9
  Author: cleverplugins.com
10
  Author URI: https://cleverplugins.com
11
  Min WP Version: 4.7
542
  global $wpdb ;
543
  $table_name = $wpdb->prefix . 'posts';
544
  $resultslimit = $options['ddp_resultslimit'];
545
+ $viewlimit = intval( $resultslimit );
546
+ if ( 0 === $viewlimit ) {
547
+ $viewlimit = 9999;
548
+ }
 
 
 
 
549
  $ddp_pts_arr = $options['ddp_pts'];
550
 
551
  if ( isset( $ddp_pts_arr ) && is_array( $ddp_pts_arr ) ) {
656
 
657
  $return_duplicates_time = self::timerstop( 'return_duplicates' );
658
  // @todo memory usage
659
+
660
+ if ( $options['ddp_debug'] ) {
661
+ //$outputlist = array_values( array_slice($json_response['dupes'], 0, 5) );
662
+ $max = 5;
663
+
664
+ if ( isset( $json_response['dupes'] ) ) {
665
+ $idlist = array();
666
+ $step = 0;
667
+ foreach ( $json_response['dupes'] as $dupe ) {
668
+
669
+ if ( $step <= $max ) {
670
+ $details = '';
671
+ if ( isset( $dupe['ID'] ) ) {
672
+ $details .= 'ID: ' . $dupe['ID'] . ' ';
673
+ }
674
+ if ( isset( $dupe['title'] ) ) {
675
+ $details .= ' title: "' . $dupe['title'] . '" ';
676
+ }
677
+ if ( isset( $dupe['permalink'] ) ) {
678
+ $details .= 'Permalink: ' . $dupe['permalink'] . ' ';
679
+ }
680
+ if ( isset( $dupe['status'] ) ) {
681
+ $details .= 'Status: ' . $dupe['status'] . ' ';
682
+ }
683
+ if ( isset( $dupe['type'] ) ) {
684
+ $details .= 'Type: ' . $dupe['type'] . ' ';
685
+ }
686
+ if ( isset( $dupe['orgID'] ) ) {
687
+ $details .= 'orgID: ' . $dupe['orgID'] . ' ';
688
+ }
689
+ if ( isset( $dupe['orgtitle'] ) ) {
690
+ $details .= 'orgtitle: ' . $dupe['orgtitle'] . ' ';
691
+ }
692
+ if ( isset( $dupe['orgpermalink'] ) ) {
693
+ $details .= ' orgpermalink: ' . $dupe['orgpermalink'] . ' ';
694
+ }
695
+ self::log( $details );
696
+ }
697
+
698
+ $step++;
699
+ }
700
+ }
701
+
702
+ }
703
+
704
  self::log( $json_response['dupescount'] . ' duplicates found in ' . $return_duplicates_time . ' sec. ' . $statusdata . ' Mem usage: ' . self::pretty_value( memory_get_peak_usage( true ) ) );
705
  } else {
706
  $json_response['msg'] = __( 'Error: Choose post types to check.', 'delete-duplicate-posts' );
phpcs.xml ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <ruleset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="WordPress Coding Standards" xsi:noNamespaceSchemaLocation="https://raw.githubusercontent.com/squizlabs/PHP_CodeSniffer/master/phpcs.xsd">
3
+
4
+ <description>The Coding standard for the WordPress Coding Standards itself.</description>
5
+
6
+ <file>.</file>
7
+
8
+ <arg value="sp"/>
9
+ <arg name="extensions" value="php"/>
10
+
11
+ <exclude-pattern>/bin/class-ruleset-test.php</exclude-pattern>
12
+ <!-- Exclude Composer vendor directory. -->
13
+ <exclude-pattern>*/vendor/*</exclude-pattern>
14
+
15
+ <rule ref="WordPress-Extra">
16
+ <exclude name="WordPress.Files.FileName"/>
17
+ </rule>
18
+
19
+ <!-- <rule ref="WordPress-Docs"/> -->
20
+
21
+ <!-- Enforce PSR1 compatible namespaces. -->
22
+ <rule ref="PSR1.Classes.ClassDeclaration"/>
23
+
24
+ <rule ref="WordPress.Arrays.MultipleStatementAlignment">
25
+ <properties>
26
+ <property name="alignMultilineItems" value="!=100"/>
27
+ <property name="exact" value="false" phpcs-only="true"/>
28
+ </properties>
29
+ </rule>
30
+
31
+ <rule ref="PSR2.Methods.FunctionClosingBrace"/>
32
+
33
+ <rule ref="WordPress.NamingConventions.PrefixAllGlobals.DeprecatedWhitelistCommentFound">
34
+ <!-- False positive for whitelist comment recognition, but no use fixing this now
35
+ as the WPCS native whitelist comments are deprecated anyhow. -->
36
+ <exclude-pattern>/WordPress/AbstractClassRestrictionsSniff\.php$</exclude-pattern>
37
+ </rule>
38
+ </ruleset>
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
9
- Stable tag: 4.7.8
10
  Requires PHP: 5.6
11
 
12
  Get rid of duplicate posts and pages on your blog!
@@ -54,6 +54,9 @@ You should restore the backup you took of your website before you ran this tool.
54
 
55
  == Changelog ==
56
 
 
 
 
57
  = 4.7.8 =
58
  * Fix: Reworked JS code - fixing the list of duplicates not loading.
59
  * Improved loading time by fixing a few logic issues in the JavaScript code.
@@ -67,7 +70,7 @@ You should restore the backup you took of your website before you ran this tool.
67
  * Tested with WordPress 6.0.
68
  * Updated language file for translations.
69
 
70
- = 4.7.6 =
71
  * New: Free demo - Test how the plugin works, just click and in a few seconds your unique demo site is online. Thank you TasteWP.com :-)
72
 
73
  = 4.7.5 =
6
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
7
  Requires at least: 4.7
8
  Tested up to: 6.0
9
+ Stable tag: 4.7.9
10
  Requires PHP: 5.6
11
 
12
  Get rid of duplicate posts and pages on your blog!
54
 
55
  == Changelog ==
56
 
57
+ = 4.7.9 =
58
+ * FIX: Plugin would not show results if the limit was set to "No limit".
59
+
60
  = 4.7.8 =
61
  * Fix: Reworked JS code - fixing the list of duplicates not loading.
62
  * Improved loading time by fixing a few logic issues in the JavaScript code.
70
  * Tested with WordPress 6.0.
71
  * Updated language file for translations.
72
 
73
+ = 4.7.6
74
  * New: Free demo - Test how the plugin works, just click and in a few seconds your unique demo site is online. Thank you TasteWP.com :-)
75
 
76
  = 4.7.5 =
vendor/composer/installed.php CHANGED
@@ -5,7 +5,7 @@
5
  'type' => 'library',
6
  'install_path' => __DIR__ . '/../../',
7
  'aliases' => array(),
8
- 'reference' => 'c3a3fe4d9434d01ad6c5bcdedb5668faec7521e4',
9
  'name' => '__root__',
10
  'dev' => false,
11
  ),
@@ -16,7 +16,7 @@
16
  'type' => 'library',
17
  'install_path' => __DIR__ . '/../../',
18
  'aliases' => array(),
19
- 'reference' => 'c3a3fe4d9434d01ad6c5bcdedb5668faec7521e4',
20
  'dev_requirement' => false,
21
  ),
22
  'collizo4sky/persist-admin-notices-dismissal' => array(
5
  'type' => 'library',
6
  'install_path' => __DIR__ . '/../../',
7
  'aliases' => array(),
8
+ 'reference' => '886ac33e24aa3ad159bf707d5b36157e3e696d1d',
9
  'name' => '__root__',
10
  'dev' => false,
11
  ),
16
  'type' => 'library',
17
  'install_path' => __DIR__ . '/../../',
18
  'aliases' => array(),
19
+ 'reference' => '886ac33e24aa3ad159bf707d5b36157e3e696d1d',
20
  'dev_requirement' => false,
21
  ),
22
  'collizo4sky/persist-admin-notices-dismissal' => array(