Version Description
- 2020/06/08
- Code cleanup and security hardening.
- 235,094 downloads
Download this release
Release Info
Developer | cleverplugins |
Plugin | Delete Duplicate Posts |
Version | 4.4.4 |
Comparing to | |
See all releases |
Code changes from version 4.4.3.1 to 4.4.4
- css/delete-duplicate-posts.css +17 -0
- delete-duplicate-posts.php +262 -123
- js/delete-duplicate-posts.js +26 -0
- readme.txt +6 -1
- sidebar.php +31 -22
- vendor/collizo4sky/persist-admin-notices-dismissal/.gitattributes +4 -0
- vendor/collizo4sky/persist-admin-notices-dismissal/.gitignore +5 -0
- vendor/collizo4sky/persist-admin-notices-dismissal/dismiss-notice.js +3 -2
- vendor/composer/installed.json +12 -10
css/delete-duplicate-posts.css
CHANGED
@@ -4,6 +4,23 @@
|
|
4 |
clear: both;
|
5 |
|
6 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
7 |
|
8 |
.tools_page_delete-duplicate-posts .updated {
|
9 |
clear: both;
|
4 |
clear: both;
|
5 |
|
6 |
}
|
7 |
+
#cp-ddp-reviewlink ul {
|
8 |
+
float: left;
|
9 |
+
width: 100%;
|
10 |
+
margin-bottom: 10px;
|
11 |
+
}
|
12 |
+
#cp-ddp-reviewlink ul li {
|
13 |
+
|
14 |
+
float: left;
|
15 |
+
margin-right: 10px;
|
16 |
+
vertical-align: middle;
|
17 |
+
line-height: 30px;
|
18 |
+
}
|
19 |
+
|
20 |
+
#cp-ddp-reviewlinkul li .dashicons {
|
21 |
+
line-height: 30px;
|
22 |
+
margin-right: 5px;
|
23 |
+
}
|
24 |
|
25 |
.tools_page_delete-duplicate-posts .updated {
|
26 |
clear: both;
|
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.4.
|
9 |
Author: cleverplugins.com
|
10 |
Author URI: https://cleverplugins.com
|
11 |
Min WP Version: 4.7
|
@@ -27,10 +27,12 @@ if ( !function_exists( 'ddp_fs' ) ) {
|
|
27 |
if ( !isset( $ddp_fs ) ) {
|
28 |
// Include Freemius SDK.
|
29 |
require_once dirname( __FILE__ ) . '/freemius/start.php';
|
30 |
-
|
31 |
-
//
|
32 |
-
|
33 |
-
|
|
|
|
|
34 |
$ddp_fs = fs_dynamic_init( array(
|
35 |
'id' => '925',
|
36 |
'slug' => 'delete-duplicate-posts',
|
@@ -44,9 +46,13 @@ if ( !function_exists( 'ddp_fs' ) ) {
|
|
44 |
'days' => 7,
|
45 |
'is_require_payment' => true,
|
46 |
),
|
|
|
47 |
'menu' => array(
|
48 |
-
'slug'
|
49 |
-
'
|
|
|
|
|
|
|
50 |
'slug' => 'tools.php',
|
51 |
),
|
52 |
),
|
@@ -71,6 +77,7 @@ function ddp_fs_uninstall_cleanup()
|
|
71 |
$wpdb->query( $wpdb->prepare( 'DROP TABLE IF EXISTS %s', $wpdb->prefix . 'ddp_log' ) );
|
72 |
delete_option( 'ddp_deleted_duplicates' );
|
73 |
delete_option( 'delete_duplicate_posts_options_v4' );
|
|
|
74 |
}
|
75 |
|
76 |
require plugin_dir_path( __FILE__ ) . 'vendor/autoload.php';
|
@@ -101,6 +108,9 @@ if ( !class_exists( 'Delete_Duplicate_Posts' ) ) {
|
|
101 |
add_action( 'wp_ajax_ddp_get_loglines', array( $this, 'return_loglines' ) );
|
102 |
add_action( 'wp_ajax_ddp_get_duplicates', array( $this, 'return_duplicates_ajax' ) );
|
103 |
add_action( 'wp_ajax_ddp_delete_duplicates', array( $this, 'delete_duplicates' ) );
|
|
|
|
|
|
|
104 |
add_action( 'admin_menu', array( $this, 'admin_menu_link' ) );
|
105 |
add_action( 'admin_enqueue_scripts', array( $this, 'admin_enqueue_scripts' ) );
|
106 |
register_activation_hook( __FILE__, array( $this, 'install' ) );
|
@@ -109,41 +119,164 @@ if ( !class_exists( 'Delete_Duplicate_Posts' ) ) {
|
|
109 |
add_action( 'admin_notices', array( $this, 'ddp_action_admin_notices' ) );
|
110 |
}
|
111 |
|
112 |
-
|
|
|
|
|
|
|
113 |
{
|
114 |
-
|
115 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
116 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
117 |
$screen = get_current_screen();
|
118 |
if ( 'tools_page_delete-duplicate-posts' !== $screen->id ) {
|
119 |
return;
|
120 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
121 |
$totaldeleted = get_option( 'ddp_deleted_duplicates' );
|
122 |
|
123 |
if ( false !== $totaldeleted && 0 < $totaldeleted ) {
|
124 |
$totaldeleted = number_format_i18n( $totaldeleted );
|
125 |
?>
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
// translators: Total number of deleted duplicates
|
130 |
-
printf( esc_html__(
|
131 |
?>
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
// translators: Asking for a review text
|
136 |
printf( esc_html__( "Hey, I noticed this plugin has deleted %s duplicate posts for you - that's awesome! Could you please do me a BIG favor and give it a 5-star rating on WordPress? Just to help us spread the word and boost our motivation.", 'delete-duplicate-posts' ), esc_html( $totaldeleted ) );
|
137 |
?>
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
</div>
|
147 |
<?php
|
148 |
}
|
149 |
|
@@ -207,13 +340,10 @@ if ( !class_exists( 'Delete_Duplicate_Posts' ) ) {
|
|
207 |
}
|
208 |
|
209 |
/**
|
210 |
-
* Returns duplicates based on current settings
|
211 |
*/
|
212 |
public static function return_duplicates( $return = false )
|
213 |
{
|
214 |
-
// if ( defined( 'DOING_AJAX' ) && DOING_AJAX ) {
|
215 |
-
// check_ajax_referer( 'cp_ddp_return_duplicates' );
|
216 |
-
// }
|
217 |
self::timerstart( 'return_duplicates' );
|
218 |
$options = self::get_options();
|
219 |
$comparemethod = 'titlecompare';
|
@@ -270,7 +400,14 @@ if ( !class_exists( 'Delete_Duplicate_Posts' ) ) {
|
|
270 |
|
271 |
if ( 'titlecompare' === $comparemethod ) {
|
272 |
// @todo - prepare - not urgent, there is no way to exploit this query
|
273 |
-
$thisquery = "SELECT a.ID, a.post_title, a.post_type, a.post_status, save_this_post_id\n\t\t\t\t\tFROM {$table_name} AS a\n\t\t\t\t\tINNER JOIN (\n\t\t\t\t\tSELECT post_title, " . $minmax . " AS save_this_post_id\n\t\t\t\t\tFROM {$table_name}\n\t\t\t\t\tWHERE post_type IN(" . $ddp_pts .
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
274 |
$dupes = $wpdb->get_results( $thisquery, ARRAY_A );
|
275 |
|
276 |
if ( $dupes ) {
|
@@ -524,7 +661,10 @@ if ( !class_exists( 'Delete_Duplicate_Posts' ) ) {
|
|
524 |
{
|
525 |
global $wpdb ;
|
526 |
$ddp_logtable = $wpdb->prefix . 'ddp_log';
|
527 |
-
$
|
|
|
|
|
|
|
528 |
// When over 1000 entries, strip down to 500.
|
529 |
$total = (int) $wpdb->get_var( "SELECT COUNT(*) FROM `{$ddp_logtable}`;" );
|
530 |
// phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared
|
@@ -811,10 +951,10 @@ if ( !class_exists( 'Delete_Duplicate_Posts' ) ) {
|
|
811 |
<table id="ddp_buttons">
|
812 |
<tr>
|
813 |
<td><input type="submit" name="deleteduplicateposts_resetview" id="deleteduplicateposts_resetview"class="button button-small button-secondary" value="<?php
|
814 |
-
|
815 |
?>" disabled/></td>
|
816 |
<td><input type="submit" name="deleteduplicateposts_deleteall" id="deleteduplicateposts_deleteall" class="button button-small button-primary" value="<?php
|
817 |
-
|
818 |
?>" disabled/></td>
|
819 |
</tr>
|
820 |
</table>
|
@@ -827,7 +967,6 @@ if ( !class_exists( 'Delete_Duplicate_Posts' ) ) {
|
|
827 |
<h3><?php
|
828 |
esc_html_e( 'Settings', 'delete-duplicate-posts' );
|
829 |
?></h3>
|
830 |
-
|
831 |
<p>
|
832 |
<?php
|
833 |
$nextscheduled = wp_next_scheduled( 'ddp_cron' );
|
@@ -839,7 +978,7 @@ if ( !class_exists( 'Delete_Duplicate_Posts' ) ) {
|
|
839 |
echo '<p class="cronstatus center">' . __( 'You have enabled automatic deletion, so I am running on automatic. I will take care of everything...', 'delete-duplicate-posts' ) . '</p>' ;
|
840 |
echo '<p class="center">' ;
|
841 |
// translators: Showing when the next check happens and what the current time is
|
842 |
-
echo sprintf( esc_html( __( 'Next automated check %1$s. Current time %2$s', 'delete-duplicate-posts' ) ), esc_html( date_i18n( get_option( 'date_format' ) . ' ' . get_option( 'time_format' ), $nextscheduled ) ), esc_html( date_i18n( get_option( 'date_format' ) . ' ' . get_option( 'time_format' ), time() ) ) ) ;
|
843 |
echo '</p>' ;
|
844 |
?>
|
845 |
</div>
|
@@ -910,7 +1049,7 @@ if ( !class_exists( 'Delete_Duplicate_Posts' ) ) {
|
|
910 |
|
911 |
?>
|
912 |
<p class="description"><?php
|
913 |
-
|
914 |
?></p>
|
915 |
</td>
|
916 |
</tr>
|
@@ -987,10 +1126,10 @@ if ( !class_exists( 'Delete_Duplicate_Posts' ) ) {
|
|
987 |
<input type="radio" name="ddp_method" value="titlecompare" <?php
|
988 |
checked( 'titlecompare', $comparemethod );
|
989 |
?> /> <?php
|
990 |
-
|
991 |
?>
|
992 |
<span class="optiondesc"><?php
|
993 |
-
|
994 |
?></span>
|
995 |
</label>
|
996 |
|
@@ -1038,171 +1177,171 @@ if ( !class_exists( 'Delete_Duplicate_Posts' ) ) {
|
|
1038 |
/*
|
1039 |
|
1040 |
<tr valign="top">
|
1041 |
-
|
1042 |
-
|
1043 |
-
|
1044 |
-
|
1045 |
-
|
1046 |
-
|
1047 |
-
|
1048 |
-
}
|
1049 |
-
echo '>' . esc_attr( $val ) . '</option>';
|
1050 |
}
|
1051 |
-
|
1052 |
-
|
1053 |
-
|
1054 |
-
|
|
|
|
|
1055 |
</td>
|
1056 |
</tr>
|
1057 |
*/
|
1058 |
?>
|
1059 |
|
1060 |
-
|
1061 |
-
|
1062 |
-
|
1063 |
|
1064 |
|
1065 |
|
1066 |
-
|
1067 |
-
|
1068 |
esc_html_e( 'Enable automatic deletion?:', 'delete-duplicate-posts' );
|
1069 |
?>
|
1070 |
|
1071 |
-
|
1072 |
-
|
1073 |
-
|
1074 |
-
|
1075 |
if ( true === $options['ddp_enabled'] ) {
|
1076 |
echo 'checked="checked"' ;
|
1077 |
}
|
1078 |
?>
|
1079 |
-
|
1080 |
-
|
1081 |
esc_html_e( 'Clean duplicates automatically.', 'delete-duplicate-posts' );
|
1082 |
?></p>
|
1083 |
-
|
1084 |
-
|
1085 |
-
|
1086 |
|
1087 |
|
1088 |
-
|
1089 |
-
|
1090 |
esc_html_e( 'How often?:', 'delete-duplicate-posts' );
|
1091 |
?></label></th><td>
|
1092 |
|
1093 |
-
|
1094 |
-
|
1095 |
$schedules = wp_get_schedules();
|
1096 |
if ( $schedules ) {
|
1097 |
foreach ( $schedules as $key => $sch ) {
|
1098 |
?>
|
1099 |
-
|
1100 |
echo esc_attr( $key ) ;
|
1101 |
?>"
|
1102 |
-
|
1103 |
if ( isset( $options['ddp_schedule'] ) && esc_attr( $key ) === $options['ddp_schedule'] ) {
|
1104 |
echo esc_html( 'selected="selected"' ) ;
|
1105 |
}
|
1106 |
?>
|
1107 |
-
|
1108 |
echo esc_html( $sch['display'] ) ;
|
1109 |
?></option>
|
1110 |
-
|
1111 |
}
|
1112 |
}
|
1113 |
?>
|
1114 |
-
|
1115 |
-
|
1116 |
esc_html_e( 'How often should the cron job run?', 'delete-duplicate-posts' );
|
1117 |
?></p>
|
1118 |
-
|
1119 |
-
|
1120 |
|
1121 |
|
1122 |
|
1123 |
-
|
1124 |
-
|
1125 |
-
|
1126 |
|
1127 |
-
|
1128 |
-
|
1129 |
esc_html_e( 'Send status mail?:', 'delete-duplicate-posts' );
|
1130 |
?></th>
|
1131 |
-
|
1132 |
-
|
1133 |
-
|
1134 |
-
|
1135 |
if ( isset( $options['ddp_statusmail'] ) && true === $options['ddp_statusmail'] ) {
|
1136 |
echo 'checked="checked"' ;
|
1137 |
}
|
1138 |
?>
|
1139 |
-
|
1140 |
esc_html_e( 'Sends a status email if duplicates have been found.', 'delete-duplicate-posts' );
|
1141 |
?></p>
|
1142 |
-
|
1143 |
-
|
1144 |
-
|
1145 |
|
1146 |
-
|
1147 |
-
|
1148 |
esc_html_e( 'Email recipient:', 'delete-duplicate-posts' );
|
1149 |
?></th>
|
1150 |
-
|
1151 |
-
|
1152 |
|
1153 |
-
|
1154 |
echo esc_html( $options['ddp_statusmail_recipient'] ) ;
|
1155 |
?>">
|
1156 |
-
|
1157 |
esc_html_e( 'Who should get the notification email.', 'delete-duplicate-posts' );
|
1158 |
?></p>
|
1159 |
-
|
1160 |
-
|
1161 |
-
|
1162 |
|
1163 |
|
1164 |
|
1165 |
|
1166 |
-
|
1167 |
esc_html_e( 'Save Settings', 'delete-duplicate-posts' );
|
1168 |
?>" /></th>
|
1169 |
-
|
1170 |
|
1171 |
-
|
1172 |
|
1173 |
-
|
1174 |
-
|
1175 |
|
1176 |
|
1177 |
-
|
1178 |
|
1179 |
-
|
1180 |
esc_html_e( 'The Log', 'delete-duplicate-posts' );
|
1181 |
?></h3>
|
1182 |
-
|
1183 |
-
|
1184 |
-
|
1185 |
|
1186 |
-
|
1187 |
-
|
1188 |
-
|
1189 |
-
|
1190 |
wp_nonce_field( 'ddp_clearlog_nonce' );
|
1191 |
?>
|
1192 |
|
1193 |
-
|
1194 |
esc_html_e( 'Reset log', 'delete-duplicate-posts' );
|
1195 |
?>" />
|
1196 |
-
|
1197 |
-
|
1198 |
|
1199 |
-
|
1200 |
|
1201 |
-
|
1202 |
include_once 'sidebar.php';
|
1203 |
?>
|
1204 |
|
1205 |
-
|
1206 |
|
1207 |
if ( function_exists( 'ddp_fs' ) ) {
|
1208 |
global $ddp_fs ;
|
@@ -1217,11 +1356,11 @@ if ( !class_exists( 'Delete_Duplicate_Posts' ) ) {
|
|
1217 |
|
1218 |
?>
|
1219 |
|
|
|
1220 |
</div>
|
1221 |
-
</div>
|
1222 |
|
1223 |
-
|
1224 |
-
|
1225 |
}
|
1226 |
|
1227 |
}
|
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.4.4
|
9 |
Author: cleverplugins.com
|
10 |
Author URI: https://cleverplugins.com
|
11 |
Min WP Version: 4.7
|
27 |
if ( !isset( $ddp_fs ) ) {
|
28 |
// Include Freemius SDK.
|
29 |
require_once dirname( __FILE__ ) . '/freemius/start.php';
|
30 |
+
define( 'CP_DDP_FREEMIUS_STATE', 'cp_ddp_freemius_state' );
|
31 |
+
// Check anonymous mode.
|
32 |
+
$cp_ddp_freemius_state = get_site_option( CP_DDP_FREEMIUS_STATE, 'anonymous' );
|
33 |
+
$is_anonymous = 'anonymous' === $cp_ddp_freemius_state || 'skipped' === $cp_ddp_freemius_state;
|
34 |
+
$is_premium = false;
|
35 |
+
$is_anonymous = ( $is_premium ? false : $is_anonymous );
|
36 |
$ddp_fs = fs_dynamic_init( array(
|
37 |
'id' => '925',
|
38 |
'slug' => 'delete-duplicate-posts',
|
46 |
'days' => 7,
|
47 |
'is_require_payment' => true,
|
48 |
),
|
49 |
+
'anonymous_mode' => $is_anonymous,
|
50 |
'menu' => array(
|
51 |
+
'slug' => 'delete-duplicate-posts.php',
|
52 |
+
'first-path' => 'admin.php?page=delete-duplicate-posts.php',
|
53 |
+
'support' => false,
|
54 |
+
'affiliation' => false,
|
55 |
+
'parent' => array(
|
56 |
'slug' => 'tools.php',
|
57 |
),
|
58 |
),
|
77 |
$wpdb->query( $wpdb->prepare( 'DROP TABLE IF EXISTS %s', $wpdb->prefix . 'ddp_log' ) );
|
78 |
delete_option( 'ddp_deleted_duplicates' );
|
79 |
delete_option( 'delete_duplicate_posts_options_v4' );
|
80 |
+
delete_option( 'cp_ddp_freemius_state' );
|
81 |
}
|
82 |
|
83 |
require plugin_dir_path( __FILE__ ) . 'vendor/autoload.php';
|
108 |
add_action( 'wp_ajax_ddp_get_loglines', array( $this, 'return_loglines' ) );
|
109 |
add_action( 'wp_ajax_ddp_get_duplicates', array( $this, 'return_duplicates_ajax' ) );
|
110 |
add_action( 'wp_ajax_ddp_delete_duplicates', array( $this, 'delete_duplicates' ) );
|
111 |
+
add_action( 'wp_ajax_cp_ddp_freemius_opt_in', array( __CLASS__, 'cp_ddp_fs_opt_in' ) );
|
112 |
+
// loads persistent admin notices
|
113 |
+
add_action( 'admin_init', array( 'PAnD', 'init' ) );
|
114 |
add_action( 'admin_menu', array( $this, 'admin_menu_link' ) );
|
115 |
add_action( 'admin_enqueue_scripts', array( $this, 'admin_enqueue_scripts' ) );
|
116 |
register_activation_hook( __FILE__, array( $this, 'install' ) );
|
119 |
add_action( 'admin_notices', array( $this, 'ddp_action_admin_notices' ) );
|
120 |
}
|
121 |
|
122 |
+
/**
|
123 |
+
* Ajax callback to handle freemius opt in/out.
|
124 |
+
*/
|
125 |
+
public static function cp_ddp_fs_opt_in()
|
126 |
{
|
127 |
+
// Get post array through filter.
|
128 |
+
$nonce = filter_input( INPUT_POST, 'opt_nonce', FILTER_SANITIZE_STRING );
|
129 |
+
// Nonce.
|
130 |
+
$choice = filter_input( INPUT_POST, 'choice', FILTER_SANITIZE_STRING );
|
131 |
+
// Choice selected by user.
|
132 |
+
// Verify nonce.
|
133 |
+
|
134 |
+
if ( empty($nonce) || !wp_verify_nonce( $nonce, 'cp-ddp-freemius-opt' ) ) {
|
135 |
+
// Nonce verification failed.
|
136 |
+
echo wp_json_encode( array(
|
137 |
+
'success' => false,
|
138 |
+
'message' => esc_html__( 'Nonce verification failed.', 'delete-duplicate-posts' ),
|
139 |
+
) ) ;
|
140 |
+
exit;
|
141 |
}
|
142 |
+
|
143 |
+
// Check if choice is not empty.
|
144 |
+
|
145 |
+
if ( !empty($choice) ) {
|
146 |
+
|
147 |
+
if ( 'yes' === $choice ) {
|
148 |
+
|
149 |
+
if ( !is_multisite() ) {
|
150 |
+
ddp_fs()->opt_in();
|
151 |
+
// Opt in.
|
152 |
+
} else {
|
153 |
+
// Get sites.
|
154 |
+
$sites = Freemius::get_sites();
|
155 |
+
$sites_data = array();
|
156 |
+
if ( !empty($sites) ) {
|
157 |
+
foreach ( $sites as $site ) {
|
158 |
+
$sites_data[] = ddp_fs()->get_site_info( $site );
|
159 |
+
}
|
160 |
+
}
|
161 |
+
ddp_fs()->opt_in(
|
162 |
+
false,
|
163 |
+
false,
|
164 |
+
false,
|
165 |
+
false,
|
166 |
+
false,
|
167 |
+
false,
|
168 |
+
false,
|
169 |
+
false,
|
170 |
+
$sites_data
|
171 |
+
);
|
172 |
+
}
|
173 |
+
|
174 |
+
// Update freemius state.
|
175 |
+
update_site_option( CP_DDP_FREEMIUS_STATE, 'in' );
|
176 |
+
} elseif ( 'no' === $choice ) {
|
177 |
+
|
178 |
+
if ( !is_multisite() ) {
|
179 |
+
ddp_fs()->skip_connection();
|
180 |
+
// Opt out.
|
181 |
+
} else {
|
182 |
+
ddp_fs()->skip_connection( null, true );
|
183 |
+
// Opt out for all websites.
|
184 |
+
}
|
185 |
+
|
186 |
+
// Update freemius state.
|
187 |
+
update_site_option( CP_DDP_FREEMIUS_STATE, 'skipped' );
|
188 |
+
}
|
189 |
+
|
190 |
+
echo wp_json_encode( array(
|
191 |
+
'success' => true,
|
192 |
+
'message' => esc_html__( 'Freemius opt choice selected.', 'delete-duplicate-posts' ),
|
193 |
+
) ) ;
|
194 |
+
} else {
|
195 |
+
echo wp_json_encode( array(
|
196 |
+
'success' => false,
|
197 |
+
'message' => esc_html__( 'Freemius opt choice not found.', 'delete-duplicate-posts' ),
|
198 |
+
) ) ;
|
199 |
+
}
|
200 |
+
|
201 |
+
exit;
|
202 |
+
}
|
203 |
+
|
204 |
+
public static function ddp_action_admin_notices()
|
205 |
+
{
|
206 |
$screen = get_current_screen();
|
207 |
if ( 'tools_page_delete-duplicate-posts' !== $screen->id ) {
|
208 |
return;
|
209 |
}
|
210 |
+
// Check anonymous mode.
|
211 |
+
if ( 'anonymous' === get_site_option( CP_DDP_FREEMIUS_STATE, 'anonymous' ) ) {
|
212 |
+
// If user manually opt-out then don't show the notice.
|
213 |
+
if ( ddp_fs()->is_anonymous() && ddp_fs()->is_not_paying() && ddp_fs()->has_api_connectivity() ) {
|
214 |
+
if ( !is_multisite() || is_multisite() && is_network_admin() ) {
|
215 |
+
|
216 |
+
if ( PAnD::is_admin_notice_active( 'cp-ddp-improve-notice-30' ) ) {
|
217 |
+
?>
|
218 |
+
<div id="cp-ddp-freemius" data-dismissible="cp-ddp-improve-notice-30" class="notice notice-success is-dismissible">
|
219 |
+
<h3><?php
|
220 |
+
esc_html_e( 'Help Delete Duplicate Posts improve!', 'delete-duplicate-posts' );
|
221 |
+
?></h3>
|
222 |
+
|
223 |
+
<p><?php
|
224 |
+
echo esc_html__( 'Gathering non-sensitive diagnostic data about the plugin install helps us improve the plugin.', 'delete-duplicate-posts' ) . ' <a href="' . esc_url( '/' ) . '" target="_blank">' . esc_html__( 'Read more about what we collect.', 'delete-duplicate-posts' ) . '</a>' ;
|
225 |
+
?></p>
|
226 |
+
|
227 |
+
<p>
|
228 |
+
<?php
|
229 |
+
printf( __( 'If you opt-in, some data about your usage of %1$s will be sent to Freemius.com. If you skip this, that\'s okay! %1$s will still work just fine.', 'delete-duplicate-posts' ), '<b>Delete Duplicate Posts</b>' );
|
230 |
+
?>
|
231 |
+
</p>
|
232 |
+
<p>
|
233 |
+
<a href="javascript:;" class="button button-primary" onclick="cp_ddp_freemius_opt_in(this)" data-opt="yes"><?php
|
234 |
+
esc_html_e( 'Sure, opt-in', 'delete-duplicate-posts' );
|
235 |
+
?></a>
|
236 |
+
|
237 |
+
<a href="javascript:;" class="button dismiss-this"><?php
|
238 |
+
esc_html_e( 'No, thank you', 'delete-duplicate-posts' );
|
239 |
+
?></a>
|
240 |
+
</p>
|
241 |
+
<input type="hidden" id="cp-ddp-freemius-opt-nonce" value="<?php
|
242 |
+
echo esc_attr( wp_create_nonce( 'cp-ddp-freemius-opt' ) ) ;
|
243 |
+
?>" />
|
244 |
+
|
245 |
+
</div>
|
246 |
+
<?php
|
247 |
+
}
|
248 |
+
|
249 |
+
}
|
250 |
+
}
|
251 |
+
}
|
252 |
+
if ( !PAnD::is_admin_notice_active( 'ddp-leavereview-14' ) ) {
|
253 |
+
return;
|
254 |
+
}
|
255 |
$totaldeleted = get_option( 'ddp_deleted_duplicates' );
|
256 |
|
257 |
if ( false !== $totaldeleted && 0 < $totaldeleted ) {
|
258 |
$totaldeleted = number_format_i18n( $totaldeleted );
|
259 |
?>
|
260 |
+
<div id="cp-ddp-reviewlink" data-dismissible="ddp-leavereview-14" class="updated notice notice-success is-dismissible">
|
261 |
+
<h3>
|
262 |
+
<?php
|
263 |
// translators: Total number of deleted duplicates
|
264 |
+
printf( esc_html__( '%s duplicates deleted!', 'delete-duplicate-posts' ), esc_html( $totaldeleted ) );
|
265 |
?>
|
266 |
+
</h3>
|
267 |
+
<p>
|
268 |
+
<?php
|
269 |
// translators: Asking for a review text
|
270 |
printf( esc_html__( "Hey, I noticed this plugin has deleted %s duplicate posts for you - that's awesome! Could you please do me a BIG favor and give it a 5-star rating on WordPress? Just to help us spread the word and boost our motivation.", 'delete-duplicate-posts' ), esc_html( $totaldeleted ) );
|
271 |
?>
|
272 |
+
</p>
|
273 |
+
|
274 |
+
<p>
|
275 |
+
<a href="https://wordpress.org/support/plugin/delete-duplicate-posts/reviews/?filter=5#new-post" class="cp-ddp-dismiss-review-notice cp-ddp-reviewlink button-primary dismiss-this" target="_blank" rel="noopener">Ok, you deserve it</a>
|
276 |
+
<span class="dashicons dashicons-calendar"></span><a href="#" class="cp-ddp-dismiss-review-notice dismiss-this" target="_blank" rel="noopener">Nope, maybe later</a>
|
277 |
+
<span class="dashicons dashicons-smiley"></span><a href="#" class="cp-ddp-dismiss-review-notice dismiss-this" target="_blank" rel="noopener">I already did</a>
|
278 |
+
</p>
|
279 |
+
</div>
|
|
|
280 |
<?php
|
281 |
}
|
282 |
|
340 |
}
|
341 |
|
342 |
/**
|
343 |
+
* Returns duplicates based on current settings - internal, not used via AJAX
|
344 |
*/
|
345 |
public static function return_duplicates( $return = false )
|
346 |
{
|
|
|
|
|
|
|
347 |
self::timerstart( 'return_duplicates' );
|
348 |
$options = self::get_options();
|
349 |
$comparemethod = 'titlecompare';
|
400 |
|
401 |
if ( 'titlecompare' === $comparemethod ) {
|
402 |
// @todo - prepare - not urgent, there is no way to exploit this query
|
403 |
+
$thisquery = "SELECT a.ID, a.post_title, a.post_type, a.post_status, save_this_post_id\n\t\t\t\t\tFROM {$table_name} AS a\n\t\t\t\t\tINNER JOIN (\n\t\t\t\t\tSELECT post_title, " . $minmax . " AS save_this_post_id\n\t\t\t\t\tFROM {$table_name}\n\t\t\t\t\tWHERE post_type IN(" . $ddp_pts . ')
|
404 |
+
AND post_status IN(' . $post_stati . ')
|
405 |
+
GROUP BY post_title
|
406 |
+
HAVING COUNT( * ) > 1
|
407 |
+
) AS b ON b.post_title = a.post_title
|
408 |
+
AND b.save_this_post_id <> a.id
|
409 |
+
AND a.post_type IN(' . $ddp_pts . ')
|
410 |
+
AND a.post_status IN(' . $post_stati . ')';
|
411 |
$dupes = $wpdb->get_results( $thisquery, ARRAY_A );
|
412 |
|
413 |
if ( $dupes ) {
|
661 |
{
|
662 |
global $wpdb ;
|
663 |
$ddp_logtable = $wpdb->prefix . 'ddp_log';
|
664 |
+
$wpdb->insert( $ddp_logtable, array(
|
665 |
+
'datime' => current_time( 'mysql' ),
|
666 |
+
'note' => $text,
|
667 |
+
), array( '%s', '%s' ) );
|
668 |
// When over 1000 entries, strip down to 500.
|
669 |
$total = (int) $wpdb->get_var( "SELECT COUNT(*) FROM `{$ddp_logtable}`;" );
|
670 |
// phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared
|
951 |
<table id="ddp_buttons">
|
952 |
<tr>
|
953 |
<td><input type="submit" name="deleteduplicateposts_resetview" id="deleteduplicateposts_resetview"class="button button-small button-secondary" value="<?php
|
954 |
+
esc_html_e( 'Refresh list', 'delete-duplicate-posts' );
|
955 |
?>" disabled/></td>
|
956 |
<td><input type="submit" name="deleteduplicateposts_deleteall" id="deleteduplicateposts_deleteall" class="button button-small button-primary" value="<?php
|
957 |
+
esc_html_e( 'Delete duplicates', 'delete-duplicate-posts' );
|
958 |
?>" disabled/></td>
|
959 |
</tr>
|
960 |
</table>
|
967 |
<h3><?php
|
968 |
esc_html_e( 'Settings', 'delete-duplicate-posts' );
|
969 |
?></h3>
|
|
|
970 |
<p>
|
971 |
<?php
|
972 |
$nextscheduled = wp_next_scheduled( 'ddp_cron' );
|
978 |
echo '<p class="cronstatus center">' . __( 'You have enabled automatic deletion, so I am running on automatic. I will take care of everything...', 'delete-duplicate-posts' ) . '</p>' ;
|
979 |
echo '<p class="center">' ;
|
980 |
// translators: Showing when the next check happens and what the current time is
|
981 |
+
echo sprintf( esc_html( __( 'Next automated check %1$s. Current time %2$s', 'delete-duplicate-posts' ) ), '<strong>' . esc_html( date_i18n( get_option( 'date_format' ) . ' ' . get_option( 'time_format' ), $nextscheduled ) ) . '</strong>', '<strong>' . esc_html( date_i18n( get_option( 'date_format' ) . ' ' . get_option( 'time_format' ), time() ) ) . '</strong>' ) ;
|
982 |
echo '</p>' ;
|
983 |
?>
|
984 |
</div>
|
1049 |
|
1050 |
?>
|
1051 |
<p class="description"><?php
|
1052 |
+
esc_html_e( 'Choose which post types to scan for duplicates.', 'delete-duplicate-posts' );
|
1053 |
?></p>
|
1054 |
</td>
|
1055 |
</tr>
|
1126 |
<input type="radio" name="ddp_method" value="titlecompare" <?php
|
1127 |
checked( 'titlecompare', $comparemethod );
|
1128 |
?> /> <?php
|
1129 |
+
esc_html_e( 'Compare by title (default)', 'delete-duplicate-posts' );
|
1130 |
?>
|
1131 |
<span class="optiondesc"><?php
|
1132 |
+
esc_html_e( 'Looks at the title of the post itself.', 'delete-duplicate-posts' );
|
1133 |
?></span>
|
1134 |
</label>
|
1135 |
|
1177 |
/*
|
1178 |
|
1179 |
<tr valign="top">
|
1180 |
+
<th><label for="ddp_limit"><?php esc_html_e( 'Delete at maximum :', 'delete-duplicate-posts' ); ?></label></th><td><select name="ddp_limit">
|
1181 |
+
<?php
|
1182 |
+
for ( $x = 1; $x <= 10; $x++ ) {
|
1183 |
+
$val = ( $x * 50 );
|
1184 |
+
echo "<option value='" . esc_attr( $val ) . "' ";
|
1185 |
+
if ( $options['ddp_limit'] === $val ) {
|
1186 |
+
echo 'selected';
|
|
|
|
|
1187 |
}
|
1188 |
+
echo '>' . esc_attr( $val ) . '</option>';
|
1189 |
+
}
|
1190 |
+
?>
|
1191 |
+
</select>
|
1192 |
+
<?php esc_html_e( 'duplicates.', 'delete-duplicate-posts' ); ?>
|
1193 |
+
<p class="description"><?php esc_html_e( 'Setting a limit is a good idea, especially if your site is on a busy server.', 'delete-duplicate-posts' ); ?></p>
|
1194 |
</td>
|
1195 |
</tr>
|
1196 |
*/
|
1197 |
?>
|
1198 |
|
1199 |
+
<tr>
|
1200 |
+
<td colspan="2"><hr></td>
|
1201 |
+
</tr>
|
1202 |
|
1203 |
|
1204 |
|
1205 |
+
<tr valign="top">
|
1206 |
+
<th><?php
|
1207 |
esc_html_e( 'Enable automatic deletion?:', 'delete-duplicate-posts' );
|
1208 |
?>
|
1209 |
|
1210 |
+
</th>
|
1211 |
+
<td><label for="ddp_enabled">
|
1212 |
+
<input type="checkbox" id="ddp_enabled" name="ddp_enabled"
|
1213 |
+
<?php
|
1214 |
if ( true === $options['ddp_enabled'] ) {
|
1215 |
echo 'checked="checked"' ;
|
1216 |
}
|
1217 |
?>
|
1218 |
+
>
|
1219 |
+
<p class="description"><?php
|
1220 |
esc_html_e( 'Clean duplicates automatically.', 'delete-duplicate-posts' );
|
1221 |
?></p>
|
1222 |
+
</label>
|
1223 |
+
</td>
|
1224 |
+
</tr>
|
1225 |
|
1226 |
|
1227 |
+
<tr>
|
1228 |
+
<th><label for="ddp_schedule"><?php
|
1229 |
esc_html_e( 'How often?:', 'delete-duplicate-posts' );
|
1230 |
?></label></th><td>
|
1231 |
|
1232 |
+
<select name="ddp_schedule" id="ddp_schedule">
|
1233 |
+
<?php
|
1234 |
$schedules = wp_get_schedules();
|
1235 |
if ( $schedules ) {
|
1236 |
foreach ( $schedules as $key => $sch ) {
|
1237 |
?>
|
1238 |
+
<option value="<?php
|
1239 |
echo esc_attr( $key ) ;
|
1240 |
?>"
|
1241 |
+
<?php
|
1242 |
if ( isset( $options['ddp_schedule'] ) && esc_attr( $key ) === $options['ddp_schedule'] ) {
|
1243 |
echo esc_html( 'selected="selected"' ) ;
|
1244 |
}
|
1245 |
?>
|
1246 |
+
><?php
|
1247 |
echo esc_html( $sch['display'] ) ;
|
1248 |
?></option>
|
1249 |
+
<?php
|
1250 |
}
|
1251 |
}
|
1252 |
?>
|
1253 |
+
</select>
|
1254 |
+
<p class="description"><?php
|
1255 |
esc_html_e( 'How often should the cron job run?', 'delete-duplicate-posts' );
|
1256 |
?></p>
|
1257 |
+
</td>
|
1258 |
+
</tr>
|
1259 |
|
1260 |
|
1261 |
|
1262 |
+
<tr>
|
1263 |
+
<td colspan="2"><hr></td>
|
1264 |
+
</tr>
|
1265 |
|
1266 |
+
<tr>
|
1267 |
+
<th><?php
|
1268 |
esc_html_e( 'Send status mail?:', 'delete-duplicate-posts' );
|
1269 |
?></th>
|
1270 |
+
<td>
|
1271 |
+
<label for="ddp_statusmail">
|
1272 |
+
<input type="checkbox" id="ddp_statusmail" name="ddp_statusmail"
|
1273 |
+
<?php
|
1274 |
if ( isset( $options['ddp_statusmail'] ) && true === $options['ddp_statusmail'] ) {
|
1275 |
echo 'checked="checked"' ;
|
1276 |
}
|
1277 |
?>
|
1278 |
+
<p class="description"><?php
|
1279 |
esc_html_e( 'Sends a status email if duplicates have been found.', 'delete-duplicate-posts' );
|
1280 |
?></p>
|
1281 |
+
</label>
|
1282 |
+
</td>
|
1283 |
+
</tr>
|
1284 |
|
1285 |
+
<tr>
|
1286 |
+
<th><?php
|
1287 |
esc_html_e( 'Email recipient:', 'delete-duplicate-posts' );
|
1288 |
?></th>
|
1289 |
+
<td>
|
1290 |
+
<label for="ddp_statusmail_recipient">
|
1291 |
|
1292 |
+
<input type="text" class="regular-text" id="ddp_statusmail_recipient" name="ddp_statusmail_recipient" value="<?php
|
1293 |
echo esc_html( $options['ddp_statusmail_recipient'] ) ;
|
1294 |
?>">
|
1295 |
+
<p class="description"><?php
|
1296 |
esc_html_e( 'Who should get the notification email.', 'delete-duplicate-posts' );
|
1297 |
?></p>
|
1298 |
+
</label>
|
1299 |
+
</td>
|
1300 |
+
</tr>
|
1301 |
|
1302 |
|
1303 |
|
1304 |
|
1305 |
+
<th colspan=2><input type="submit" class="button-primary" name="delete_duplicate_posts_save" value="<?php
|
1306 |
esc_html_e( 'Save Settings', 'delete-duplicate-posts' );
|
1307 |
?>" /></th>
|
1308 |
+
</tr>
|
1309 |
|
1310 |
+
</table>
|
1311 |
|
1312 |
+
</form>
|
1313 |
+
</div><!-- #configuration -->
|
1314 |
|
1315 |
|
1316 |
+
<div id="log">
|
1317 |
|
1318 |
+
<h3><?php
|
1319 |
esc_html_e( 'The Log', 'delete-duplicate-posts' );
|
1320 |
?></h3>
|
1321 |
+
<div class="spinner is-active"></div>
|
1322 |
+
<ul class="large-text" name="ddp_log" id="ddp_log">
|
1323 |
+
</ul>
|
1324 |
|
1325 |
+
</div>
|
1326 |
+
<p>
|
1327 |
+
<form method="post" id="ddp_clearlog">
|
1328 |
+
<?php
|
1329 |
wp_nonce_field( 'ddp_clearlog_nonce' );
|
1330 |
?>
|
1331 |
|
1332 |
+
<input class="button-secondary" type="submit" name="ddp_clearlog" value="<?php
|
1333 |
esc_html_e( 'Reset log', 'delete-duplicate-posts' );
|
1334 |
?>" />
|
1335 |
+
</form>
|
1336 |
+
</p>
|
1337 |
|
1338 |
+
</div><!-- #ddp_container -->
|
1339 |
|
1340 |
+
<?php
|
1341 |
include_once 'sidebar.php';
|
1342 |
?>
|
1343 |
|
1344 |
+
<?php
|
1345 |
|
1346 |
if ( function_exists( 'ddp_fs' ) ) {
|
1347 |
global $ddp_fs ;
|
1356 |
|
1357 |
?>
|
1358 |
|
1359 |
+
</div>
|
1360 |
</div>
|
|
|
1361 |
|
1362 |
+
</div>
|
1363 |
+
<?php
|
1364 |
}
|
1365 |
|
1366 |
}
|
js/delete-duplicate-posts.js
CHANGED
@@ -1,3 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
jQuery(document).ready(function(){
|
2 |
|
3 |
let senddata = [];
|
1 |
+
|
2 |
+
function cp_ddp_freemius_opt_in( element ) {
|
3 |
+
var nonce = jQuery( '#cp-ddp-freemius-opt-nonce' ).val(); // Nonce.
|
4 |
+
var choice = jQuery( element ).data( 'opt' ); // Choice.
|
5 |
+
|
6 |
+
jQuery.ajax( {
|
7 |
+
type: 'POST',
|
8 |
+
url: ajaxurl,
|
9 |
+
async: true,
|
10 |
+
data: {
|
11 |
+
action: 'cp_ddp_freemius_opt_in',
|
12 |
+
opt_nonce: nonce,
|
13 |
+
choice: choice
|
14 |
+
},
|
15 |
+
success: function( data ) {
|
16 |
+
location.reload();
|
17 |
+
},
|
18 |
+
error: function( xhr, textStatus, error ) {
|
19 |
+
console.log( xhr.statusText );
|
20 |
+
console.log( textStatus );
|
21 |
+
console.log( error );
|
22 |
+
}
|
23 |
+
} );
|
24 |
+
}
|
25 |
+
|
26 |
+
|
27 |
jQuery(document).ready(function(){
|
28 |
|
29 |
let senddata = [];
|
readme.txt
CHANGED
@@ -5,7 +5,7 @@ License: GPLv2 or later
|
|
5 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
6 |
Requires at least: 4.7
|
7 |
Tested up to: 5.4.1
|
8 |
-
Stable tag: 4.4.
|
9 |
Requires PHP: 5.6
|
10 |
|
11 |
Get rid of duplicate posts and pages on your blog!
|
@@ -39,6 +39,11 @@ You should restore the backup you took of your website before you ran this tool.
|
|
39 |
|
40 |
== Changelog ==
|
41 |
|
|
|
|
|
|
|
|
|
|
|
42 |
= 4.4.3.1 =
|
43 |
* 2020/05/08
|
44 |
* Removes some debug code, whoopsie.
|
5 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
6 |
Requires at least: 4.7
|
7 |
Tested up to: 5.4.1
|
8 |
+
Stable tag: 4.4.4
|
9 |
Requires PHP: 5.6
|
10 |
|
11 |
Get rid of duplicate posts and pages on your blog!
|
39 |
|
40 |
== Changelog ==
|
41 |
|
42 |
+
= 4.4.4 =
|
43 |
+
* 2020/06/08
|
44 |
+
* Code cleanup and security hardening.
|
45 |
+
* 235,094 downloads
|
46 |
+
|
47 |
= 4.4.3.1 =
|
48 |
* 2020/05/08
|
49 |
* Removes some debug code, whoopsie.
|
sidebar.php
CHANGED
@@ -8,25 +8,6 @@ if ( !defined( 'ABSPATH' ) ) {
|
|
8 |
<div id="sidebar-container" class="ddp_content_cell">
|
9 |
<?php
|
10 |
global $ddp_fs ;
|
11 |
-
|
12 |
-
if ( !$ddp_fs->is_registered() && !$ddp_fs->is_pending_activation() ) {
|
13 |
-
?>
|
14 |
-
<div class="sidebarrow">
|
15 |
-
<h3><span class="dashicons dashicons-warning"></span> <?php
|
16 |
-
_e( 'Never miss an important update', 'delete-duplicate-posts' );
|
17 |
-
?></h3>
|
18 |
-
<p><?php
|
19 |
-
_e( 'Opt-in to our security and feature updates notifications, and non-sensitive diagnostic tracking.', 'delete-duplicate-posts' );
|
20 |
-
?></p>
|
21 |
-
<p><a href="<?php
|
22 |
-
echo esc_url( $ddp_fs->get_reconnect_url() ) ;
|
23 |
-
?>" class="button button-secondary"><?php
|
24 |
-
_e( 'Click here to opt in.', 'delete-duplicate-posts' );
|
25 |
-
?></a></p>
|
26 |
-
</div>
|
27 |
-
<?php
|
28 |
-
}
|
29 |
-
|
30 |
$ddp_deleted_duplicates = get_option( 'ddp_deleted_duplicates' );
|
31 |
|
32 |
if ( $ddp_deleted_duplicates ) {
|
@@ -37,13 +18,40 @@ if ( $ddp_deleted_duplicates ) {
|
|
37 |
printf(
|
38 |
/* translators: %s: Number of deleted posts */
|
39 |
__( '%s duplicates deleted!', 'delete-duplicate-posts' ),
|
40 |
-
number_format_i18n( $ddp_deleted_duplicates )
|
41 |
);
|
42 |
?>
|
43 |
</h3>
|
44 |
</div>
|
|
|
|
|
45 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
46 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
47 |
<?php
|
48 |
}
|
49 |
|
@@ -64,12 +72,13 @@ if ( $display_promotion ) {
|
|
64 |
<ul class="linklist">
|
65 |
<li><strong>New compare method</strong> - Compare by meta tag <span>Use with WooCommerce (compare SKU) or other plugins</span></li>
|
66 |
<li><strong>Choose post status</strong> - Look for duplicates in scheduled posts, drafts or any other available post status on your site.</li>
|
|
|
67 |
<?php
|
68 |
/*
|
69 |
<li>301 Redirect deleted posts <span>Make sure traffic is directed to the right place</span></li>
|
70 |
*/
|
71 |
?>
|
72 |
-
<li>Support the developer :-)</li>
|
73 |
</ul>
|
74 |
|
75 |
<a href="<?php
|
@@ -94,7 +103,7 @@ if ( $display_promotion ) {
|
|
94 |
|
95 |
<div class="sidebarrow">
|
96 |
<h3><?php
|
97 |
-
|
98 |
?></h3>
|
99 |
<a href="https://wpsecurityninja.com" target="_blank" style="float: right;"><img src="<?php
|
100 |
echo esc_url( plugin_dir_url( __FILE__ ) . 'images/security-ninja-logo.png' ) ;
|
8 |
<div id="sidebar-container" class="ddp_content_cell">
|
9 |
<?php
|
10 |
global $ddp_fs ;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11 |
$ddp_deleted_duplicates = get_option( 'ddp_deleted_duplicates' );
|
12 |
|
13 |
if ( $ddp_deleted_duplicates ) {
|
18 |
printf(
|
19 |
/* translators: %s: Number of deleted posts */
|
20 |
__( '%s duplicates deleted!', 'delete-duplicate-posts' ),
|
21 |
+
esc_html( number_format_i18n( $ddp_deleted_duplicates ) )
|
22 |
);
|
23 |
?>
|
24 |
</h3>
|
25 |
</div>
|
26 |
+
<?php
|
27 |
+
}
|
28 |
|
29 |
+
?>
|
30 |
+
|
31 |
+
<div class="sidebarrow">
|
32 |
+
<h3>Need help?</h3>
|
33 |
+
<p><a href="https://wordpress.org/support/plugin/delete-duplicate-posts/" target="_blank"><?php
|
34 |
+
esc_html_e( 'Support Forum on WordPress.org', 'delete-duplicate-posts' );
|
35 |
+
?></a></p>
|
36 |
+
</div>
|
37 |
+
|
38 |
+
<?php
|
39 |
|
40 |
+
if ( !$ddp_fs->is_registered() && !$ddp_fs->is_pending_activation() ) {
|
41 |
+
?>
|
42 |
+
<div class="sidebarrow">
|
43 |
+
<h3><span class="dashicons dashicons-warning"></span> <?php
|
44 |
+
esc_html_e( 'Never miss an important update', 'delete-duplicate-posts' );
|
45 |
+
?></h3>
|
46 |
+
<p><?php
|
47 |
+
esc_html_e( 'Opt-in to our security and feature updates notifications, and non-sensitive diagnostic tracking.', 'delete-duplicate-posts' );
|
48 |
+
?></p>
|
49 |
+
<p><a href="<?php
|
50 |
+
echo esc_url( $ddp_fs->get_reconnect_url() ) ;
|
51 |
+
?>" class="button button-secondary"><?php
|
52 |
+
esc_html_e( 'Click here to opt in.', 'delete-duplicate-posts' );
|
53 |
+
?></a></p>
|
54 |
+
</div>
|
55 |
<?php
|
56 |
}
|
57 |
|
72 |
<ul class="linklist">
|
73 |
<li><strong>New compare method</strong> - Compare by meta tag <span>Use with WooCommerce (compare SKU) or other plugins</span></li>
|
74 |
<li><strong>Choose post status</strong> - Look for duplicates in scheduled posts, drafts or any other available post status on your site.</li>
|
75 |
+
<li><strong>Premium Support</strong> - Get help from the developers behind the plugin.</li>
|
76 |
<?php
|
77 |
/*
|
78 |
<li>301 Redirect deleted posts <span>Make sure traffic is directed to the right place</span></li>
|
79 |
*/
|
80 |
?>
|
81 |
+
<li><strong>No ads</strong> - Support the developer :-)</li>
|
82 |
</ul>
|
83 |
|
84 |
<a href="<?php
|
103 |
|
104 |
<div class="sidebarrow">
|
105 |
<h3><?php
|
106 |
+
esc_html_e( 'Our other plugins', 'delete-duplicate-posts' );
|
107 |
?></h3>
|
108 |
<a href="https://wpsecurityninja.com" target="_blank" style="float: right;"><img src="<?php
|
109 |
echo esc_url( plugin_dir_url( __FILE__ ) . 'images/security-ninja-logo.png' ) ;
|
vendor/collizo4sky/persist-admin-notices-dismissal/.gitattributes
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
1 |
+
* text=auto
|
2 |
+
|
3 |
+
.gitattributes export-ignore
|
4 |
+
.gitignore export-ignore
|
vendor/collizo4sky/persist-admin-notices-dismissal/.gitignore
ADDED
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
1 |
+
.DS_Store
|
2 |
+
.idea
|
3 |
+
.vs-code
|
4 |
+
vendor/*
|
5 |
+
/vendor/
|
vendor/collizo4sky/persist-admin-notices-dismissal/dismiss-notice.js
CHANGED
@@ -2,14 +2,14 @@
|
|
2 |
//shorthand for ready event.
|
3 |
$(
|
4 |
function () {
|
5 |
-
$( 'div[data-dismissible] button.notice-dismiss' ).click(
|
6 |
function (event) {
|
7 |
event.preventDefault();
|
8 |
var $this = $( this );
|
9 |
|
10 |
var attr_value, option_name, dismissible_length, data;
|
11 |
|
12 |
-
attr_value = $this.
|
13 |
|
14 |
// remove the dismissible length from the attribute value and rejoin the array.
|
15 |
dismissible_length = attr_value.pop();
|
@@ -25,6 +25,7 @@
|
|
25 |
|
26 |
// We can also pass the url value separately from ajaxurl for front end AJAX implementations
|
27 |
$.post( ajaxurl, data );
|
|
|
28 |
}
|
29 |
);
|
30 |
}
|
2 |
//shorthand for ready event.
|
3 |
$(
|
4 |
function () {
|
5 |
+
$( 'div[data-dismissible] button.notice-dismiss, div[data-dismissible] .dismiss-this' ).click(
|
6 |
function (event) {
|
7 |
event.preventDefault();
|
8 |
var $this = $( this );
|
9 |
|
10 |
var attr_value, option_name, dismissible_length, data;
|
11 |
|
12 |
+
attr_value = $this.closest("div[data-dismissible]").attr( 'data-dismissible' ).split( '-' );
|
13 |
|
14 |
// remove the dismissible length from the attribute value and rejoin the array.
|
15 |
dismissible_length = attr_value.pop();
|
25 |
|
26 |
// We can also pass the url value separately from ajaxurl for front end AJAX implementations
|
27 |
$.post( ajaxurl, data );
|
28 |
+
$this.closest("div[data-dismissible]").hide('slow');
|
29 |
}
|
30 |
);
|
31 |
}
|
vendor/composer/installed.json
CHANGED
@@ -1,35 +1,37 @@
|
|
1 |
[
|
2 |
{
|
3 |
"name": "collizo4sky/persist-admin-notices-dismissal",
|
4 |
-
"version": "
|
5 |
-
"version_normalized": "
|
6 |
"source": {
|
7 |
"type": "git",
|
8 |
-
"url": "https://github.com/
|
9 |
-
"reference": "
|
10 |
},
|
11 |
"dist": {
|
12 |
"type": "zip",
|
13 |
-
"url": "https://api.github.com/repos/
|
14 |
-
"reference": "
|
15 |
"shasum": ""
|
16 |
},
|
17 |
-
"time": "
|
18 |
"type": "library",
|
19 |
-
"installation-source": "
|
20 |
"autoload": {
|
21 |
"classmap": [
|
22 |
"persist-admin-notices-dismissal.php"
|
23 |
]
|
24 |
},
|
25 |
-
"notification-url": "https://packagist.org/downloads/",
|
26 |
"authors": [
|
27 |
{
|
28 |
"name": "Collins Agbonghama",
|
29 |
"email": "me@w3guy.com"
|
30 |
}
|
31 |
],
|
32 |
-
"description": "Simple library to persist dismissal of admin notices across pages in WordPress dashboard."
|
|
|
|
|
|
|
33 |
},
|
34 |
{
|
35 |
"name": "typisttech/imposter",
|
1 |
[
|
2 |
{
|
3 |
"name": "collizo4sky/persist-admin-notices-dismissal",
|
4 |
+
"version": "dev-extra-dismiss-links",
|
5 |
+
"version_normalized": "dev-extra-dismiss-links",
|
6 |
"source": {
|
7 |
"type": "git",
|
8 |
+
"url": "https://github.com/lkoudal/persist-admin-notices-dismissal.git",
|
9 |
+
"reference": "0d858995370efc143177068000dc21811f3f6e4b"
|
10 |
},
|
11 |
"dist": {
|
12 |
"type": "zip",
|
13 |
+
"url": "https://api.github.com/repos/lkoudal/persist-admin-notices-dismissal/zipball/0d858995370efc143177068000dc21811f3f6e4b",
|
14 |
+
"reference": "0d858995370efc143177068000dc21811f3f6e4b",
|
15 |
"shasum": ""
|
16 |
},
|
17 |
+
"time": "2020-05-16T15:43:35+00:00",
|
18 |
"type": "library",
|
19 |
+
"installation-source": "source",
|
20 |
"autoload": {
|
21 |
"classmap": [
|
22 |
"persist-admin-notices-dismissal.php"
|
23 |
]
|
24 |
},
|
|
|
25 |
"authors": [
|
26 |
{
|
27 |
"name": "Collins Agbonghama",
|
28 |
"email": "me@w3guy.com"
|
29 |
}
|
30 |
],
|
31 |
+
"description": "Simple library to persist dismissal of admin notices across pages in WordPress dashboard.",
|
32 |
+
"support": {
|
33 |
+
"source": "https://github.com/lkoudal/persist-admin-notices-dismissal/tree/extra-dismiss-links"
|
34 |
+
}
|
35 |
},
|
36 |
{
|
37 |
"name": "typisttech/imposter",
|