Version Description
Apr 6 2021 = * Fix: Renaming setting to their original names in old update scripts. * Fix: Ajax forms protection response fixed. * Fix: No alert message when AJAX error happens.
Download this release
Release Info
Developer | Safronik |
Plugin | Spam protection, AntiSpam, FireWall by CleanTalk |
Version | 5.155.2 |
Comparing to | |
See all releases |
Code changes from version 5.155.1 to 5.155.2
- cleantalk.php +1 -1
- inc/ClassApbctListTable.php +0 -1434
- inc/cleantalk-updater.php +19 -19
- js/apbct-public.min.js +1 -1
- js/apbct-public.min.js.map +1 -1
- readme.txt +6 -1
cleantalk.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
Plugin Name: Anti-Spam by CleanTalk
|
4 |
Plugin URI: https://cleantalk.org
|
5 |
Description: Max power, all-in-one, no Captcha, premium anti-spam plugin. No comment spam, no registration spam, no contact spam, protects any WordPress forms.
|
6 |
-
Version: 5.155.
|
7 |
Author: СleanTalk <welcome@cleantalk.org>
|
8 |
Author URI: https://cleantalk.org
|
9 |
Text Domain: cleantalk-spam-protect
|
3 |
Plugin Name: Anti-Spam by CleanTalk
|
4 |
Plugin URI: https://cleantalk.org
|
5 |
Description: Max power, all-in-one, no Captcha, premium anti-spam plugin. No comment spam, no registration spam, no contact spam, protects any WordPress forms.
|
6 |
+
Version: 5.155.2
|
7 |
Author: СleanTalk <welcome@cleantalk.org>
|
8 |
Author URI: https://cleantalk.org
|
9 |
Text Domain: cleantalk-spam-protect
|
inc/ClassApbctListTable.php
DELETED
@@ -1,1434 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* This is copy of the WP_List_Table class for the future compability
|
4 |
-
*/
|
5 |
-
|
6 |
-
/**
|
7 |
-
* Administration API: WP_List_Table class
|
8 |
-
*
|
9 |
-
* @package WordPress
|
10 |
-
* @subpackage List_Table
|
11 |
-
* @since 3.1.0
|
12 |
-
*/
|
13 |
-
|
14 |
-
/**
|
15 |
-
* Base class for displaying a list of items in an ajaxified HTML table.
|
16 |
-
*
|
17 |
-
* @since 3.1.0
|
18 |
-
* @access private
|
19 |
-
*/
|
20 |
-
class ABPCT_List_Table {
|
21 |
-
|
22 |
-
/**
|
23 |
-
* The current list of items.
|
24 |
-
*
|
25 |
-
* @since 3.1.0
|
26 |
-
* @var array
|
27 |
-
*/
|
28 |
-
public $items;
|
29 |
-
|
30 |
-
/**
|
31 |
-
* Various information about the current table.
|
32 |
-
*
|
33 |
-
* @since 3.1.0
|
34 |
-
* @var array
|
35 |
-
*/
|
36 |
-
protected $_args;
|
37 |
-
|
38 |
-
/**
|
39 |
-
* Various information needed for displaying the pagination.
|
40 |
-
*
|
41 |
-
* @since 3.1.0
|
42 |
-
* @var array
|
43 |
-
*/
|
44 |
-
protected $_pagination_args = array();
|
45 |
-
|
46 |
-
/**
|
47 |
-
* The current screen.
|
48 |
-
*
|
49 |
-
* @since 3.1.0
|
50 |
-
* @var object
|
51 |
-
*/
|
52 |
-
protected $screen;
|
53 |
-
|
54 |
-
/**
|
55 |
-
* Cached bulk actions.
|
56 |
-
*
|
57 |
-
* @since 3.1.0
|
58 |
-
* @var array
|
59 |
-
*/
|
60 |
-
private $_actions;
|
61 |
-
|
62 |
-
/**
|
63 |
-
* Cached pagination output.
|
64 |
-
*
|
65 |
-
* @since 3.1.0
|
66 |
-
* @var string
|
67 |
-
*/
|
68 |
-
private $_pagination;
|
69 |
-
|
70 |
-
/**
|
71 |
-
* The view switcher modes.
|
72 |
-
*
|
73 |
-
* @since 4.1.0
|
74 |
-
* @var array
|
75 |
-
*/
|
76 |
-
protected $modes = array();
|
77 |
-
|
78 |
-
/**
|
79 |
-
* Stores the value returned by ->get_column_info().
|
80 |
-
*
|
81 |
-
* @since 4.1.0
|
82 |
-
* @var array
|
83 |
-
*/
|
84 |
-
protected $_column_headers;
|
85 |
-
|
86 |
-
/**
|
87 |
-
* {@internal Missing Summary}
|
88 |
-
*
|
89 |
-
* @var array
|
90 |
-
*/
|
91 |
-
protected $compat_fields = array( '_args', '_pagination_args', 'screen', '_actions', '_pagination' );
|
92 |
-
|
93 |
-
/**
|
94 |
-
* {@internal Missing Summary}
|
95 |
-
*
|
96 |
-
* @var array
|
97 |
-
*/
|
98 |
-
protected $compat_methods = array(
|
99 |
-
'set_pagination_args',
|
100 |
-
'get_views',
|
101 |
-
'get_bulk_actions',
|
102 |
-
'bulk_actions',
|
103 |
-
'row_actions',
|
104 |
-
'months_dropdown',
|
105 |
-
'view_switcher',
|
106 |
-
'comments_bubble',
|
107 |
-
'get_items_per_page',
|
108 |
-
'pagination',
|
109 |
-
'get_sortable_columns',
|
110 |
-
'get_column_info',
|
111 |
-
'get_table_classes',
|
112 |
-
'display_tablenav',
|
113 |
-
'extra_tablenav',
|
114 |
-
'single_row_columns',
|
115 |
-
);
|
116 |
-
|
117 |
-
/**
|
118 |
-
* Constructor.
|
119 |
-
*
|
120 |
-
* The child class should call this constructor from its own constructor to override
|
121 |
-
* the default $args.
|
122 |
-
*
|
123 |
-
* @since 3.1.0
|
124 |
-
*
|
125 |
-
* @param array|string $args {
|
126 |
-
* Array or string of arguments.
|
127 |
-
*
|
128 |
-
* @type string $plural Plural value used for labels and the objects being listed.
|
129 |
-
* This affects things such as CSS class-names and nonces used
|
130 |
-
* in the list table, e.g. 'posts'. Default empty.
|
131 |
-
* @type string $singular Singular label for an object being listed, e.g. 'post'.
|
132 |
-
* Default empty
|
133 |
-
* @type bool $ajax Whether the list table supports Ajax. This includes loading
|
134 |
-
* and sorting data, for example. If true, the class will call
|
135 |
-
* the _js_vars() method in the footer to provide variables
|
136 |
-
* to any scripts handling Ajax events. Default false.
|
137 |
-
* @type string $screen String containing the hook name used to determine the current
|
138 |
-
* screen. If left null, the current screen will be automatically set.
|
139 |
-
* Default null.
|
140 |
-
* }
|
141 |
-
*/
|
142 |
-
public function __construct( $args = array() ) {
|
143 |
-
$args = wp_parse_args(
|
144 |
-
$args,
|
145 |
-
array(
|
146 |
-
'plural' => '',
|
147 |
-
'singular' => '',
|
148 |
-
'ajax' => false,
|
149 |
-
'screen' => null,
|
150 |
-
)
|
151 |
-
);
|
152 |
-
|
153 |
-
$this->screen = convert_to_screen( $args['screen'] );
|
154 |
-
|
155 |
-
add_filter( "manage_{$this->screen->id}_columns", array( $this, 'get_columns' ), 0 );
|
156 |
-
|
157 |
-
if ( ! $args['plural'] ) {
|
158 |
-
$args['plural'] = $this->screen->base;
|
159 |
-
}
|
160 |
-
|
161 |
-
$args['plural'] = sanitize_key( $args['plural'] );
|
162 |
-
$args['singular'] = sanitize_key( $args['singular'] );
|
163 |
-
|
164 |
-
$this->_args = $args;
|
165 |
-
|
166 |
-
if ( $args['ajax'] ) {
|
167 |
-
// wp_enqueue_script( 'list-table' );
|
168 |
-
add_action( 'admin_footer', array( $this, '_js_vars' ) );
|
169 |
-
}
|
170 |
-
|
171 |
-
if ( empty( $this->modes ) ) {
|
172 |
-
$this->modes = array(
|
173 |
-
'list' => __( 'List View' ),
|
174 |
-
'excerpt' => __( 'Excerpt View' ),
|
175 |
-
);
|
176 |
-
}
|
177 |
-
}
|
178 |
-
|
179 |
-
/**
|
180 |
-
* Make private properties readable for backward compatibility.
|
181 |
-
*
|
182 |
-
* @since 4.0.0
|
183 |
-
*
|
184 |
-
* @param string $name Property to get.
|
185 |
-
* @return mixed Property.
|
186 |
-
*/
|
187 |
-
public function __get( $name ) {
|
188 |
-
if ( in_array( $name, $this->compat_fields ) ) {
|
189 |
-
return $this->$name;
|
190 |
-
}
|
191 |
-
}
|
192 |
-
|
193 |
-
/**
|
194 |
-
* Make private properties settable for backward compatibility.
|
195 |
-
*
|
196 |
-
* @since 4.0.0
|
197 |
-
*
|
198 |
-
* @param string $name Property to check if set.
|
199 |
-
* @param mixed $value Property value.
|
200 |
-
* @return mixed Newly-set property.
|
201 |
-
*/
|
202 |
-
public function __set( $name, $value ) {
|
203 |
-
if ( in_array( $name, $this->compat_fields ) ) {
|
204 |
-
return $this->$name = $value;
|
205 |
-
}
|
206 |
-
}
|
207 |
-
|
208 |
-
/**
|
209 |
-
* Make private properties checkable for backward compatibility.
|
210 |
-
*
|
211 |
-
* @since 4.0.0
|
212 |
-
*
|
213 |
-
* @param string $name Property to check if set.
|
214 |
-
* @return bool Whether the property is set.
|
215 |
-
*/
|
216 |
-
public function __isset( $name ) {
|
217 |
-
if ( in_array( $name, $this->compat_fields ) ) {
|
218 |
-
return isset( $this->$name );
|
219 |
-
}
|
220 |
-
}
|
221 |
-
|
222 |
-
/**
|
223 |
-
* Make private properties un-settable for backward compatibility.
|
224 |
-
*
|
225 |
-
* @since 4.0.0
|
226 |
-
*
|
227 |
-
* @param string $name Property to unset.
|
228 |
-
*/
|
229 |
-
public function __unset( $name ) {
|
230 |
-
if ( in_array( $name, $this->compat_fields ) ) {
|
231 |
-
unset( $this->$name );
|
232 |
-
}
|
233 |
-
}
|
234 |
-
|
235 |
-
/**
|
236 |
-
* Make private/protected methods readable for backward compatibility.
|
237 |
-
*
|
238 |
-
* @since 4.0.0
|
239 |
-
*
|
240 |
-
* @param string $name Method to call.
|
241 |
-
* @param array $arguments Arguments to pass when calling.
|
242 |
-
* @return mixed|bool Return value of the callback, false otherwise.
|
243 |
-
*/
|
244 |
-
public function __call( $name, $arguments ) {
|
245 |
-
if ( in_array( $name, $this->compat_methods ) ) {
|
246 |
-
return $this->$name( ...$arguments );
|
247 |
-
}
|
248 |
-
return false;
|
249 |
-
}
|
250 |
-
|
251 |
-
/**
|
252 |
-
* Checks the current user's permissions
|
253 |
-
*
|
254 |
-
* @since 3.1.0
|
255 |
-
* @abstract
|
256 |
-
*/
|
257 |
-
public function ajax_user_can() {
|
258 |
-
die( 'function WP_List_Table::ajax_user_can() must be over-ridden in a sub-class.' );
|
259 |
-
}
|
260 |
-
|
261 |
-
/**
|
262 |
-
* Prepares the list of items for displaying.
|
263 |
-
*
|
264 |
-
* @uses WP_List_Table::set_pagination_args()
|
265 |
-
*
|
266 |
-
* @since 3.1.0
|
267 |
-
* @abstract
|
268 |
-
*/
|
269 |
-
public function prepare_items() {
|
270 |
-
die( 'function WP_List_Table::prepare_items() must be over-ridden in a sub-class.' );
|
271 |
-
}
|
272 |
-
|
273 |
-
/**
|
274 |
-
* An internal method that sets all the necessary pagination arguments
|
275 |
-
*
|
276 |
-
* @since 3.1.0
|
277 |
-
*
|
278 |
-
* @param array|string $args Array or string of arguments with information about the pagination.
|
279 |
-
*/
|
280 |
-
protected function set_pagination_args( $args ) {
|
281 |
-
$args = wp_parse_args(
|
282 |
-
$args,
|
283 |
-
array(
|
284 |
-
'total_items' => 0,
|
285 |
-
'total_pages' => 0,
|
286 |
-
'per_page' => 0,
|
287 |
-
)
|
288 |
-
);
|
289 |
-
|
290 |
-
if ( ! $args['total_pages'] && $args['per_page'] > 0 ) {
|
291 |
-
$args['total_pages'] = ceil( $args['total_items'] / $args['per_page'] );
|
292 |
-
}
|
293 |
-
|
294 |
-
// Redirect if page number is invalid and headers are not already sent.
|
295 |
-
if ( ! headers_sent() && ! wp_doing_ajax() && $args['total_pages'] > 0 && $this->get_pagenum() > $args['total_pages'] ) {
|
296 |
-
wp_redirect( add_query_arg( 'paged', $args['total_pages'] ) );
|
297 |
-
exit;
|
298 |
-
}
|
299 |
-
|
300 |
-
$this->_pagination_args = $args;
|
301 |
-
}
|
302 |
-
|
303 |
-
/**
|
304 |
-
* Access the pagination args.
|
305 |
-
*
|
306 |
-
* @since 3.1.0
|
307 |
-
*
|
308 |
-
* @param string $key Pagination argument to retrieve. Common values include 'total_items',
|
309 |
-
* 'total_pages', 'per_page', or 'infinite_scroll'.
|
310 |
-
* @return int Number of items that correspond to the given pagination argument.
|
311 |
-
*/
|
312 |
-
public function get_pagination_arg( $key ) {
|
313 |
-
if ( 'page' === $key ) {
|
314 |
-
return $this->get_pagenum();
|
315 |
-
}
|
316 |
-
|
317 |
-
if ( isset( $this->_pagination_args[ $key ] ) ) {
|
318 |
-
return $this->_pagination_args[ $key ];
|
319 |
-
}
|
320 |
-
}
|
321 |
-
|
322 |
-
/**
|
323 |
-
* Whether the table has items to display or not
|
324 |
-
*
|
325 |
-
* @since 3.1.0
|
326 |
-
*
|
327 |
-
* @return bool
|
328 |
-
*/
|
329 |
-
public function has_items() {
|
330 |
-
return ! empty( $this->items );
|
331 |
-
}
|
332 |
-
|
333 |
-
/**
|
334 |
-
* Message to be displayed when there are no items
|
335 |
-
*
|
336 |
-
* @since 3.1.0
|
337 |
-
*/
|
338 |
-
public function no_items() {
|
339 |
-
_e( 'No items found.' );
|
340 |
-
}
|
341 |
-
|
342 |
-
/**
|
343 |
-
* Displays the search box.
|
344 |
-
*
|
345 |
-
* @since 3.1.0
|
346 |
-
*
|
347 |
-
* @param string $text The 'submit' button label.
|
348 |
-
* @param string $input_id ID attribute value for the search input field.
|
349 |
-
*/
|
350 |
-
public function search_box( $text, $input_id ) {
|
351 |
-
if ( empty( $_REQUEST['s'] ) && ! $this->has_items() ) {
|
352 |
-
return;
|
353 |
-
}
|
354 |
-
|
355 |
-
$input_id = $input_id . '-search-input';
|
356 |
-
|
357 |
-
if ( ! empty( $_REQUEST['orderby'] ) ) {
|
358 |
-
echo '<input type="hidden" name="orderby" value="' . esc_attr( $_REQUEST['orderby'] ) . '" />';
|
359 |
-
}
|
360 |
-
if ( ! empty( $_REQUEST['order'] ) ) {
|
361 |
-
echo '<input type="hidden" name="order" value="' . esc_attr( $_REQUEST['order'] ) . '" />';
|
362 |
-
}
|
363 |
-
if ( ! empty( $_REQUEST['post_mime_type'] ) ) {
|
364 |
-
echo '<input type="hidden" name="post_mime_type" value="' . esc_attr( $_REQUEST['post_mime_type'] ) . '" />';
|
365 |
-
}
|
366 |
-
if ( ! empty( $_REQUEST['detached'] ) ) {
|
367 |
-
echo '<input type="hidden" name="detached" value="' . esc_attr( $_REQUEST['detached'] ) . '" />';
|
368 |
-
}
|
369 |
-
?>
|
370 |
-
<p class="search-box">
|
371 |
-
<label class="screen-reader-text" for="<?php echo esc_attr( $input_id ); ?>"><?php echo $text; ?>:</label>
|
372 |
-
<input type="search" id="<?php echo esc_attr( $input_id ); ?>" name="s" value="<?php _admin_search_query(); ?>" />
|
373 |
-
<?php submit_button( $text, '', '', false, array( 'id' => 'search-submit' ) ); ?>
|
374 |
-
</p>
|
375 |
-
<?php
|
376 |
-
}
|
377 |
-
|
378 |
-
/**
|
379 |
-
* Get an associative array ( id => link ) with the list
|
380 |
-
* of views available on this table.
|
381 |
-
*
|
382 |
-
* @since 3.1.0
|
383 |
-
*
|
384 |
-
* @return array
|
385 |
-
*/
|
386 |
-
protected function get_views() {
|
387 |
-
return array();
|
388 |
-
}
|
389 |
-
|
390 |
-
/**
|
391 |
-
* Display the list of views available on this table.
|
392 |
-
*
|
393 |
-
* @since 3.1.0
|
394 |
-
*/
|
395 |
-
public function views() {
|
396 |
-
$views = $this->get_views();
|
397 |
-
/**
|
398 |
-
* Filters the list of available list table views.
|
399 |
-
*
|
400 |
-
* The dynamic portion of the hook name, `$this->screen->id`, refers
|
401 |
-
* to the ID of the current screen, usually a string.
|
402 |
-
*
|
403 |
-
* @since 3.5.0
|
404 |
-
*
|
405 |
-
* @param string[] $views An array of available list table views.
|
406 |
-
*/
|
407 |
-
$views = apply_filters( "views_{$this->screen->id}", $views );
|
408 |
-
|
409 |
-
if ( empty( $views ) ) {
|
410 |
-
return;
|
411 |
-
}
|
412 |
-
|
413 |
-
$this->screen->render_screen_reader_content( 'heading_views' );
|
414 |
-
|
415 |
-
echo "<ul class='subsubsub'>\n";
|
416 |
-
foreach ( $views as $class => $view ) {
|
417 |
-
$views[ $class ] = "\t<li class='$class'>$view";
|
418 |
-
}
|
419 |
-
echo implode( " |</li>\n", $views ) . "</li>\n";
|
420 |
-
echo '</ul>';
|
421 |
-
}
|
422 |
-
|
423 |
-
/**
|
424 |
-
* Get an associative array ( option_name => option_title ) with the list
|
425 |
-
* of bulk actions available on this table.
|
426 |
-
*
|
427 |
-
* @since 3.1.0
|
428 |
-
*
|
429 |
-
* @return array
|
430 |
-
*/
|
431 |
-
protected function get_bulk_actions() {
|
432 |
-
return array();
|
433 |
-
}
|
434 |
-
|
435 |
-
/**
|
436 |
-
* Display the bulk actions dropdown.
|
437 |
-
*
|
438 |
-
* @since 3.1.0
|
439 |
-
*
|
440 |
-
* @param string $which The location of the bulk actions: 'top' or 'bottom'.
|
441 |
-
* This is designated as optional for backward compatibility.
|
442 |
-
*/
|
443 |
-
protected function bulk_actions( $which = '' ) {
|
444 |
-
if ( is_null( $this->_actions ) ) {
|
445 |
-
$this->_actions = $this->get_bulk_actions();
|
446 |
-
/**
|
447 |
-
* Filters the list table Bulk Actions drop-down.
|
448 |
-
*
|
449 |
-
* The dynamic portion of the hook name, `$this->screen->id`, refers
|
450 |
-
* to the ID of the current screen, usually a string.
|
451 |
-
*
|
452 |
-
* This filter can currently only be used to remove bulk actions.
|
453 |
-
*
|
454 |
-
* @since 3.5.0
|
455 |
-
*
|
456 |
-
* @param string[] $actions An array of the available bulk actions.
|
457 |
-
*/
|
458 |
-
$this->_actions = apply_filters( "bulk_actions-{$this->screen->id}", $this->_actions ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores
|
459 |
-
$two = '';
|
460 |
-
} else {
|
461 |
-
$two = '2';
|
462 |
-
}
|
463 |
-
|
464 |
-
if ( empty( $this->_actions ) ) {
|
465 |
-
return;
|
466 |
-
}
|
467 |
-
|
468 |
-
echo '<label for="bulk-action-selector-' . esc_attr( $which ) . '" class="screen-reader-text">' . __( 'Select bulk action' ) . '</label>';
|
469 |
-
echo '<select name="action' . $two . '" id="bulk-action-selector-' . esc_attr( $which ) . "\">\n";
|
470 |
-
echo '<option value="-1">' . __( 'Bulk Actions' ) . "</option>\n";
|
471 |
-
|
472 |
-
foreach ( $this->_actions as $name => $title ) {
|
473 |
-
$class = 'edit' === $name ? ' class="hide-if-no-js"' : '';
|
474 |
-
|
475 |
-
echo "\t" . '<option value="' . $name . '"' . $class . '>' . $title . "</option>\n";
|
476 |
-
}
|
477 |
-
|
478 |
-
echo "</select>\n";
|
479 |
-
|
480 |
-
submit_button( __( 'Apply' ), 'action', '', false, array( 'id' => "doaction$two" ) );
|
481 |
-
echo "\n";
|
482 |
-
}
|
483 |
-
|
484 |
-
/**
|
485 |
-
* Get the current action selected from the bulk actions dropdown.
|
486 |
-
*
|
487 |
-
* @since 3.1.0
|
488 |
-
*
|
489 |
-
* @return string|false The action name or False if no action was selected
|
490 |
-
*/
|
491 |
-
public function current_action() {
|
492 |
-
if ( isset( $_REQUEST['filter_action'] ) && ! empty( $_REQUEST['filter_action'] ) ) {
|
493 |
-
return false;
|
494 |
-
}
|
495 |
-
|
496 |
-
if ( isset( $_REQUEST['action'] ) && -1 != $_REQUEST['action'] ) {
|
497 |
-
return $_REQUEST['action'];
|
498 |
-
}
|
499 |
-
|
500 |
-
if ( isset( $_REQUEST['action2'] ) && -1 != $_REQUEST['action2'] ) {
|
501 |
-
return $_REQUEST['action2'];
|
502 |
-
}
|
503 |
-
|
504 |
-
return false;
|
505 |
-
}
|
506 |
-
|
507 |
-
/**
|
508 |
-
* Generate row actions div
|
509 |
-
*
|
510 |
-
* @since 3.1.0
|
511 |
-
*
|
512 |
-
* @param string[] $actions An array of action links.
|
513 |
-
* @param bool $always_visible Whether the actions should be always visible.
|
514 |
-
* @return string
|
515 |
-
*/
|
516 |
-
protected function row_actions( $actions, $always_visible = false ) {
|
517 |
-
$action_count = count( $actions );
|
518 |
-
$i = 0;
|
519 |
-
|
520 |
-
if ( ! $action_count ) {
|
521 |
-
return '';
|
522 |
-
}
|
523 |
-
|
524 |
-
$out = '<div class="' . ( $always_visible ? 'row-actions visible' : 'row-actions' ) . '">';
|
525 |
-
foreach ( $actions as $action => $link ) {
|
526 |
-
++$i;
|
527 |
-
( $i == $action_count ) ? $sep = '' : $sep = ' | ';
|
528 |
-
$out .= "<span class='$action'>$link$sep</span>";
|
529 |
-
}
|
530 |
-
$out .= '</div>';
|
531 |
-
|
532 |
-
$out .= '<button type="button" class="toggle-row"><span class="screen-reader-text">' . __( 'Show more details' ) . '</span></button>';
|
533 |
-
|
534 |
-
return $out;
|
535 |
-
}
|
536 |
-
|
537 |
-
/**
|
538 |
-
* Display a monthly dropdown for filtering items
|
539 |
-
*
|
540 |
-
* @since 3.1.0
|
541 |
-
*
|
542 |
-
* @global wpdb $wpdb WordPress database abstraction object.
|
543 |
-
* @global WP_Locale $wp_locale WordPress date and time locale object.
|
544 |
-
*
|
545 |
-
* @param string $post_type
|
546 |
-
*/
|
547 |
-
protected function months_dropdown( $post_type ) {
|
548 |
-
global $wpdb, $wp_locale;
|
549 |
-
|
550 |
-
/**
|
551 |
-
* Filters whether to remove the 'Months' drop-down from the post list table.
|
552 |
-
*
|
553 |
-
* @since 4.2.0
|
554 |
-
*
|
555 |
-
* @param bool $disable Whether to disable the drop-down. Default false.
|
556 |
-
* @param string $post_type The post type.
|
557 |
-
*/
|
558 |
-
if ( apply_filters( 'disable_months_dropdown', false, $post_type ) ) {
|
559 |
-
return;
|
560 |
-
}
|
561 |
-
|
562 |
-
$extra_checks = "AND post_status != 'auto-draft'";
|
563 |
-
if ( ! isset( $_GET['post_status'] ) || 'trash' !== $_GET['post_status'] ) {
|
564 |
-
$extra_checks .= " AND post_status != 'trash'";
|
565 |
-
} elseif ( isset( $_GET['post_status'] ) ) {
|
566 |
-
$extra_checks = $wpdb->prepare( ' AND post_status = %s', $_GET['post_status'] );
|
567 |
-
}
|
568 |
-
|
569 |
-
$months = $wpdb->get_results(
|
570 |
-
$wpdb->prepare(
|
571 |
-
"
|
572 |
-
SELECT DISTINCT YEAR( post_date ) AS year, MONTH( post_date ) AS month
|
573 |
-
FROM $wpdb->posts
|
574 |
-
WHERE post_type = %s
|
575 |
-
$extra_checks
|
576 |
-
ORDER BY post_date DESC
|
577 |
-
",
|
578 |
-
$post_type
|
579 |
-
)
|
580 |
-
);
|
581 |
-
|
582 |
-
/**
|
583 |
-
* Filters the 'Months' drop-down results.
|
584 |
-
*
|
585 |
-
* @since 3.7.0
|
586 |
-
*
|
587 |
-
* @param object $months The months drop-down query results.
|
588 |
-
* @param string $post_type The post type.
|
589 |
-
*/
|
590 |
-
$months = apply_filters( 'months_dropdown_results', $months, $post_type );
|
591 |
-
|
592 |
-
$month_count = count( $months );
|
593 |
-
|
594 |
-
if ( ! $month_count || ( 1 == $month_count && 0 == $months[0]->month ) ) {
|
595 |
-
return;
|
596 |
-
}
|
597 |
-
|
598 |
-
$m = isset( $_GET['m'] ) ? (int) $_GET['m'] : 0;
|
599 |
-
?>
|
600 |
-
<label for="filter-by-date" class="screen-reader-text"><?php _e( 'Filter by date' ); ?></label>
|
601 |
-
<select name="m" id="filter-by-date">
|
602 |
-
<option<?php selected( $m, 0 ); ?> value="0"><?php _e( 'All dates' ); ?></option>
|
603 |
-
<?php
|
604 |
-
foreach ( $months as $arc_row ) {
|
605 |
-
if ( 0 == $arc_row->year ) {
|
606 |
-
continue;
|
607 |
-
}
|
608 |
-
|
609 |
-
$month = zeroise( $arc_row->month, 2 );
|
610 |
-
$year = $arc_row->year;
|
611 |
-
|
612 |
-
printf(
|
613 |
-
"<option %s value='%s'>%s</option>\n",
|
614 |
-
selected( $m, $year . $month, false ),
|
615 |
-
esc_attr( $arc_row->year . $month ),
|
616 |
-
/* translators: 1: Month name, 2: 4-digit year. */
|
617 |
-
sprintf( __( '%1$s %2$d' ), $wp_locale->get_month( $month ), $year )
|
618 |
-
);
|
619 |
-
}
|
620 |
-
?>
|
621 |
-
</select>
|
622 |
-
<?php
|
623 |
-
}
|
624 |
-
|
625 |
-
/**
|
626 |
-
* Display a view switcher
|
627 |
-
*
|
628 |
-
* @since 3.1.0
|
629 |
-
*
|
630 |
-
* @param string $current_mode
|
631 |
-
*/
|
632 |
-
protected function view_switcher( $current_mode ) {
|
633 |
-
?>
|
634 |
-
<input type="hidden" name="mode" value="<?php echo esc_attr( $current_mode ); ?>" />
|
635 |
-
<div class="view-switch">
|
636 |
-
<?php
|
637 |
-
foreach ( $this->modes as $mode => $title ) {
|
638 |
-
$classes = array( 'view-' . $mode );
|
639 |
-
$aria_current = '';
|
640 |
-
|
641 |
-
if ( $current_mode === $mode ) {
|
642 |
-
$classes[] = 'current';
|
643 |
-
$aria_current = ' aria-current="page"';
|
644 |
-
}
|
645 |
-
printf(
|
646 |
-
"<a href='%s' class='%s' id='view-switch-$mode'$aria_current><span class='screen-reader-text'>%s</span></a>\n",
|
647 |
-
esc_url( add_query_arg( 'mode', $mode ) ),
|
648 |
-
implode( ' ', $classes ),
|
649 |
-
$title
|
650 |
-
);
|
651 |
-
}
|
652 |
-
?>
|
653 |
-
</div>
|
654 |
-
<?php
|
655 |
-
}
|
656 |
-
|
657 |
-
/**
|
658 |
-
* Display a comment count bubble
|
659 |
-
*
|
660 |
-
* @since 3.1.0
|
661 |
-
*
|
662 |
-
* @param int $post_id The post ID.
|
663 |
-
* @param int $pending_comments Number of pending comments.
|
664 |
-
*/
|
665 |
-
protected function comments_bubble( $post_id, $pending_comments ) {
|
666 |
-
$approved_comments = get_comments_number();
|
667 |
-
|
668 |
-
$approved_comments_number = number_format_i18n( $approved_comments );
|
669 |
-
$pending_comments_number = number_format_i18n( $pending_comments );
|
670 |
-
|
671 |
-
$approved_only_phrase = sprintf(
|
672 |
-
/* translators: %s: Number of comments. */
|
673 |
-
_n( '%s comment', '%s comments', $approved_comments ),
|
674 |
-
$approved_comments_number
|
675 |
-
);
|
676 |
-
|
677 |
-
$approved_phrase = sprintf(
|
678 |
-
/* translators: %s: Number of comments. */
|
679 |
-
_n( '%s approved comment', '%s approved comments', $approved_comments ),
|
680 |
-
$approved_comments_number
|
681 |
-
);
|
682 |
-
|
683 |
-
$pending_phrase = sprintf(
|
684 |
-
/* translators: %s: Number of comments. */
|
685 |
-
_n( '%s pending comment', '%s pending comments', $pending_comments ),
|
686 |
-
$pending_comments_number
|
687 |
-
);
|
688 |
-
|
689 |
-
// No comments at all.
|
690 |
-
if ( ! $approved_comments && ! $pending_comments ) {
|
691 |
-
printf(
|
692 |
-
'<span aria-hidden="true">—</span><span class="screen-reader-text">%s</span>',
|
693 |
-
__( 'No comments' )
|
694 |
-
);
|
695 |
-
// Approved comments have different display depending on some conditions.
|
696 |
-
} elseif ( $approved_comments ) {
|
697 |
-
printf(
|
698 |
-
'<a href="%s" class="post-com-count post-com-count-approved"><span class="comment-count-approved" aria-hidden="true">%s</span><span class="screen-reader-text">%s</span></a>',
|
699 |
-
esc_url(
|
700 |
-
add_query_arg(
|
701 |
-
array(
|
702 |
-
'p' => $post_id,
|
703 |
-
'comment_status' => 'approved',
|
704 |
-
),
|
705 |
-
admin_url( 'edit-comments.php' )
|
706 |
-
)
|
707 |
-
),
|
708 |
-
$approved_comments_number,
|
709 |
-
$pending_comments ? $approved_phrase : $approved_only_phrase
|
710 |
-
);
|
711 |
-
} else {
|
712 |
-
printf(
|
713 |
-
'<span class="post-com-count post-com-count-no-comments"><span class="comment-count comment-count-no-comments" aria-hidden="true">%s</span><span class="screen-reader-text">%s</span></span>',
|
714 |
-
$approved_comments_number,
|
715 |
-
$pending_comments ? __( 'No approved comments' ) : __( 'No comments' )
|
716 |
-
);
|
717 |
-
}
|
718 |
-
|
719 |
-
if ( $pending_comments ) {
|
720 |
-
printf(
|
721 |
-
'<a href="%s" class="post-com-count post-com-count-pending"><span class="comment-count-pending" aria-hidden="true">%s</span><span class="screen-reader-text">%s</span></a>',
|
722 |
-
esc_url(
|
723 |
-
add_query_arg(
|
724 |
-
array(
|
725 |
-
'p' => $post_id,
|
726 |
-
'comment_status' => 'moderated',
|
727 |
-
),
|
728 |
-
admin_url( 'edit-comments.php' )
|
729 |
-
)
|
730 |
-
),
|
731 |
-
$pending_comments_number,
|
732 |
-
$pending_phrase
|
733 |
-
);
|
734 |
-
} else {
|
735 |
-
printf(
|
736 |
-
'<span class="post-com-count post-com-count-pending post-com-count-no-pending"><span class="comment-count comment-count-no-pending" aria-hidden="true">%s</span><span class="screen-reader-text">%s</span></span>',
|
737 |
-
$pending_comments_number,
|
738 |
-
$approved_comments ? __( 'No pending comments' ) : __( 'No comments' )
|
739 |
-
);
|
740 |
-
}
|
741 |
-
}
|
742 |
-
|
743 |
-
/**
|
744 |
-
* Get the current page number
|
745 |
-
*
|
746 |
-
* @since 3.1.0
|
747 |
-
*
|
748 |
-
* @return int
|
749 |
-
*/
|
750 |
-
public function get_pagenum() {
|
751 |
-
$pagenum = isset( $_REQUEST['paged'] ) ? absint( $_REQUEST['paged'] ) : 0;
|
752 |
-
|
753 |
-
if ( isset( $this->_pagination_args['total_pages'] ) && $pagenum > $this->_pagination_args['total_pages'] ) {
|
754 |
-
$pagenum = $this->_pagination_args['total_pages'];
|
755 |
-
}
|
756 |
-
|
757 |
-
return max( 1, $pagenum );
|
758 |
-
}
|
759 |
-
|
760 |
-
/**
|
761 |
-
* Get number of items to display on a single page
|
762 |
-
*
|
763 |
-
* @since 3.1.0
|
764 |
-
*
|
765 |
-
* @param string $option
|
766 |
-
* @param int $default
|
767 |
-
* @return int
|
768 |
-
*/
|
769 |
-
protected function get_items_per_page( $option, $default = 20 ) {
|
770 |
-
$per_page = (int) get_user_option( $option );
|
771 |
-
if ( empty( $per_page ) || $per_page < 1 ) {
|
772 |
-
$per_page = $default;
|
773 |
-
}
|
774 |
-
|
775 |
-
/**
|
776 |
-
* Filters the number of items to be displayed on each page of the list table.
|
777 |
-
*
|
778 |
-
* The dynamic hook name, $option, refers to the `per_page` option depending
|
779 |
-
* on the type of list table in use. Possible values include: 'edit_comments_per_page',
|
780 |
-
* 'sites_network_per_page', 'site_themes_network_per_page', 'themes_network_per_page',
|
781 |
-
* 'users_network_per_page', 'edit_post_per_page', 'edit_page_per_page',
|
782 |
-
* 'edit_{$post_type}_per_page', etc.
|
783 |
-
*
|
784 |
-
* @since 2.9.0
|
785 |
-
*
|
786 |
-
* @param int $per_page Number of items to be displayed. Default 20.
|
787 |
-
*/
|
788 |
-
return (int) apply_filters( "{$option}", $per_page );
|
789 |
-
}
|
790 |
-
|
791 |
-
/**
|
792 |
-
* Display the pagination.
|
793 |
-
*
|
794 |
-
* @since 3.1.0
|
795 |
-
*
|
796 |
-
* @param string $which
|
797 |
-
*/
|
798 |
-
protected function pagination( $which ) {
|
799 |
-
if ( empty( $this->_pagination_args ) ) {
|
800 |
-
return;
|
801 |
-
}
|
802 |
-
|
803 |
-
$total_items = $this->_pagination_args['total_items'];
|
804 |
-
$total_pages = $this->_pagination_args['total_pages'];
|
805 |
-
$infinite_scroll = false;
|
806 |
-
if ( isset( $this->_pagination_args['infinite_scroll'] ) ) {
|
807 |
-
$infinite_scroll = $this->_pagination_args['infinite_scroll'];
|
808 |
-
}
|
809 |
-
|
810 |
-
if ( 'top' === $which && $total_pages > 1 ) {
|
811 |
-
$this->screen->render_screen_reader_content( 'heading_pagination' );
|
812 |
-
}
|
813 |
-
|
814 |
-
$output = '<span class="displaying-num">' . sprintf(
|
815 |
-
/* translators: %s: Number of items. */
|
816 |
-
_n( '%s item', '%s items', $total_items ),
|
817 |
-
number_format_i18n( $total_items )
|
818 |
-
) . '</span>';
|
819 |
-
|
820 |
-
$current = $this->get_pagenum();
|
821 |
-
$removable_query_args = wp_removable_query_args();
|
822 |
-
|
823 |
-
$current_url = set_url_scheme( 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] );
|
824 |
-
|
825 |
-
$current_url = remove_query_arg( $removable_query_args, $current_url );
|
826 |
-
|
827 |
-
$page_links = array();
|
828 |
-
|
829 |
-
$total_pages_before = '<span class="paging-input">';
|
830 |
-
$total_pages_after = '</span></span>';
|
831 |
-
|
832 |
-
$disable_first = false;
|
833 |
-
$disable_last = false;
|
834 |
-
$disable_prev = false;
|
835 |
-
$disable_next = false;
|
836 |
-
|
837 |
-
if ( $current == 1 ) {
|
838 |
-
$disable_first = true;
|
839 |
-
$disable_prev = true;
|
840 |
-
}
|
841 |
-
if ( $current == 2 ) {
|
842 |
-
$disable_first = true;
|
843 |
-
}
|
844 |
-
if ( $current == $total_pages ) {
|
845 |
-
$disable_last = true;
|
846 |
-
$disable_next = true;
|
847 |
-
}
|
848 |
-
if ( $current == $total_pages - 1 ) {
|
849 |
-
$disable_last = true;
|
850 |
-
}
|
851 |
-
|
852 |
-
if ( $disable_first ) {
|
853 |
-
$page_links[] = '<span class="tablenav-pages-navspan button disabled" aria-hidden="true">«</span>';
|
854 |
-
} else {
|
855 |
-
$page_links[] = sprintf(
|
856 |
-
"<a class='first-page button' href='%s'><span class='screen-reader-text'>%s</span><span aria-hidden='true'>%s</span></a>",
|
857 |
-
esc_url( remove_query_arg( 'paged', $current_url ) ),
|
858 |
-
__( 'First page' ),
|
859 |
-
'«'
|
860 |
-
);
|
861 |
-
}
|
862 |
-
|
863 |
-
if ( $disable_prev ) {
|
864 |
-
$page_links[] = '<span class="tablenav-pages-navspan button disabled" aria-hidden="true">‹</span>';
|
865 |
-
} else {
|
866 |
-
$page_links[] = sprintf(
|
867 |
-
"<a class='prev-page button' href='%s'><span class='screen-reader-text'>%s</span><span aria-hidden='true'>%s</span></a>",
|
868 |
-
esc_url( add_query_arg( 'paged', max( 1, $current - 1 ), $current_url ) ),
|
869 |
-
__( 'Previous page' ),
|
870 |
-
'‹'
|
871 |
-
);
|
872 |
-
}
|
873 |
-
|
874 |
-
if ( 'bottom' === $which ) {
|
875 |
-
$html_current_page = $current;
|
876 |
-
$total_pages_before = '<span class="screen-reader-text">' . __( 'Current Page' ) . '</span><span id="table-paging" class="paging-input"><span class="tablenav-paging-text">';
|
877 |
-
} else {
|
878 |
-
$html_current_page = sprintf(
|
879 |
-
"%s<input class='current-page' id='current-page-selector' type='text' name='paged' value='%s' size='%d' aria-describedby='table-paging' /><span class='tablenav-paging-text'>",
|
880 |
-
'<label for="current-page-selector" class="screen-reader-text">' . __( 'Current Page' ) . '</label>',
|
881 |
-
$current,
|
882 |
-
strlen( $total_pages )
|
883 |
-
);
|
884 |
-
}
|
885 |
-
$html_total_pages = sprintf( "<span class='total-pages'>%s</span>", number_format_i18n( $total_pages ) );
|
886 |
-
$page_links[] = $total_pages_before . sprintf(
|
887 |
-
/* translators: 1: Current page, 2: Total pages. */
|
888 |
-
_x( '%1$s of %2$s', 'paging' ),
|
889 |
-
$html_current_page,
|
890 |
-
$html_total_pages
|
891 |
-
) . $total_pages_after;
|
892 |
-
|
893 |
-
if ( $disable_next ) {
|
894 |
-
$page_links[] = '<span class="tablenav-pages-navspan button disabled" aria-hidden="true">›</span>';
|
895 |
-
} else {
|
896 |
-
$page_links[] = sprintf(
|
897 |
-
"<a class='next-page button' href='%s'><span class='screen-reader-text'>%s</span><span aria-hidden='true'>%s</span></a>",
|
898 |
-
esc_url( add_query_arg( 'paged', min( $total_pages, $current + 1 ), $current_url ) ),
|
899 |
-
__( 'Next page' ),
|
900 |
-
'›'
|
901 |
-
);
|
902 |
-
}
|
903 |
-
|
904 |
-
if ( $disable_last ) {
|
905 |
-
$page_links[] = '<span class="tablenav-pages-navspan button disabled" aria-hidden="true">»</span>';
|
906 |
-
} else {
|
907 |
-
$page_links[] = sprintf(
|
908 |
-
"<a class='last-page button' href='%s'><span class='screen-reader-text'>%s</span><span aria-hidden='true'>%s</span></a>",
|
909 |
-
esc_url( add_query_arg( 'paged', $total_pages, $current_url ) ),
|
910 |
-
__( 'Last page' ),
|
911 |
-
'»'
|
912 |
-
);
|
913 |
-
}
|
914 |
-
|
915 |
-
$pagination_links_class = 'pagination-links';
|
916 |
-
if ( ! empty( $infinite_scroll ) ) {
|
917 |
-
$pagination_links_class .= ' hide-if-js';
|
918 |
-
}
|
919 |
-
$output .= "\n<span class='$pagination_links_class'>" . join( "\n", $page_links ) . '</span>';
|
920 |
-
|
921 |
-
if ( $total_pages ) {
|
922 |
-
$page_class = $total_pages < 2 ? ' one-page' : '';
|
923 |
-
} else {
|
924 |
-
$page_class = ' no-pages';
|
925 |
-
}
|
926 |
-
$this->_pagination = "<div class='tablenav-pages{$page_class}'>$output</div>";
|
927 |
-
|
928 |
-
echo $this->_pagination;
|
929 |
-
}
|
930 |
-
|
931 |
-
/**
|
932 |
-
* Get a list of columns. The format is:
|
933 |
-
* 'internal-name' => 'Title'
|
934 |
-
*
|
935 |
-
* @since 3.1.0
|
936 |
-
* @abstract
|
937 |
-
*
|
938 |
-
* @return array
|
939 |
-
*/
|
940 |
-
public function get_columns() {
|
941 |
-
die( 'function WP_List_Table::get_columns() must be over-ridden in a sub-class.' );
|
942 |
-
}
|
943 |
-
|
944 |
-
/**
|
945 |
-
* Get a list of sortable columns. The format is:
|
946 |
-
* 'internal-name' => 'orderby'
|
947 |
-
* or
|
948 |
-
* 'internal-name' => array( 'orderby', true )
|
949 |
-
*
|
950 |
-
* The second format will make the initial sorting order be descending
|
951 |
-
*
|
952 |
-
* @since 3.1.0
|
953 |
-
*
|
954 |
-
* @return array
|
955 |
-
*/
|
956 |
-
protected function get_sortable_columns() {
|
957 |
-
return array();
|
958 |
-
}
|
959 |
-
|
960 |
-
/**
|
961 |
-
* Gets the name of the default primary column.
|
962 |
-
*
|
963 |
-
* @since 4.3.0
|
964 |
-
*
|
965 |
-
* @return string Name of the default primary column, in this case, an empty string.
|
966 |
-
*/
|
967 |
-
protected function get_default_primary_column_name() {
|
968 |
-
$columns = $this->get_columns();
|
969 |
-
$column = '';
|
970 |
-
|
971 |
-
if ( empty( $columns ) ) {
|
972 |
-
return $column;
|
973 |
-
}
|
974 |
-
|
975 |
-
// We need a primary defined so responsive views show something,
|
976 |
-
// so let's fall back to the first non-checkbox column.
|
977 |
-
foreach ( $columns as $col => $column_name ) {
|
978 |
-
if ( 'cb' === $col ) {
|
979 |
-
continue;
|
980 |
-
}
|
981 |
-
|
982 |
-
$column = $col;
|
983 |
-
break;
|
984 |
-
}
|
985 |
-
|
986 |
-
return $column;
|
987 |
-
}
|
988 |
-
|
989 |
-
/**
|
990 |
-
* Public wrapper for WP_List_Table::get_default_primary_column_name().
|
991 |
-
*
|
992 |
-
* @since 4.4.0
|
993 |
-
*
|
994 |
-
* @return string Name of the default primary column.
|
995 |
-
*/
|
996 |
-
public function get_primary_column() {
|
997 |
-
return $this->get_primary_column_name();
|
998 |
-
}
|
999 |
-
|
1000 |
-
/**
|
1001 |
-
* Gets the name of the primary column.
|
1002 |
-
*
|
1003 |
-
* @since 4.3.0
|
1004 |
-
*
|
1005 |
-
* @return string The name of the primary column.
|
1006 |
-
*/
|
1007 |
-
protected function get_primary_column_name() {
|
1008 |
-
$columns = get_column_headers( $this->screen );
|
1009 |
-
$default = $this->get_default_primary_column_name();
|
1010 |
-
|
1011 |
-
// If the primary column doesn't exist fall back to the
|
1012 |
-
// first non-checkbox column.
|
1013 |
-
if ( ! isset( $columns[ $default ] ) ) {
|
1014 |
-
$default = ABPCT_List_Table::get_default_primary_column_name();
|
1015 |
-
}
|
1016 |
-
|
1017 |
-
/**
|
1018 |
-
* Filters the name of the primary column for the current list table.
|
1019 |
-
*
|
1020 |
-
* @since 4.3.0
|
1021 |
-
*
|
1022 |
-
* @param string $default Column name default for the specific list table, e.g. 'name'.
|
1023 |
-
* @param string $context Screen ID for specific list table, e.g. 'plugins'.
|
1024 |
-
*/
|
1025 |
-
$column = apply_filters( 'list_table_primary_column', $default, $this->screen->id );
|
1026 |
-
|
1027 |
-
if ( empty( $column ) || ! isset( $columns[ $column ] ) ) {
|
1028 |
-
$column = $default;
|
1029 |
-
}
|
1030 |
-
|
1031 |
-
return $column;
|
1032 |
-
}
|
1033 |
-
|
1034 |
-
/**
|
1035 |
-
* Get a list of all, hidden and sortable columns, with filter applied
|
1036 |
-
*
|
1037 |
-
* @since 3.1.0
|
1038 |
-
*
|
1039 |
-
* @return array
|
1040 |
-
*/
|
1041 |
-
protected function get_column_info() {
|
1042 |
-
// $_column_headers is already set / cached
|
1043 |
-
if ( isset( $this->_column_headers ) && is_array( $this->_column_headers ) ) {
|
1044 |
-
// Back-compat for list tables that have been manually setting $_column_headers for horse reasons.
|
1045 |
-
// In 4.3, we added a fourth argument for primary column.
|
1046 |
-
$column_headers = array( array(), array(), array(), $this->get_primary_column_name() );
|
1047 |
-
foreach ( $this->_column_headers as $key => $value ) {
|
1048 |
-
$column_headers[ $key ] = $value;
|
1049 |
-
}
|
1050 |
-
|
1051 |
-
return $column_headers;
|
1052 |
-
}
|
1053 |
-
|
1054 |
-
$columns = get_column_headers( $this->screen );
|
1055 |
-
$hidden = get_hidden_columns( $this->screen );
|
1056 |
-
|
1057 |
-
$sortable_columns = $this->get_sortable_columns();
|
1058 |
-
/**
|
1059 |
-
* Filters the list table sortable columns for a specific screen.
|
1060 |
-
*
|
1061 |
-
* The dynamic portion of the hook name, `$this->screen->id`, refers
|
1062 |
-
* to the ID of the current screen, usually a string.
|
1063 |
-
*
|
1064 |
-
* @since 3.5.0
|
1065 |
-
*
|
1066 |
-
* @param array $sortable_columns An array of sortable columns.
|
1067 |
-
*/
|
1068 |
-
$_sortable = apply_filters( "manage_{$this->screen->id}_sortable_columns", $sortable_columns );
|
1069 |
-
|
1070 |
-
$sortable = array();
|
1071 |
-
foreach ( $_sortable as $id => $data ) {
|
1072 |
-
if ( empty( $data ) ) {
|
1073 |
-
continue;
|
1074 |
-
}
|
1075 |
-
|
1076 |
-
$data = (array) $data;
|
1077 |
-
if ( ! isset( $data[1] ) ) {
|
1078 |
-
$data[1] = false;
|
1079 |
-
}
|
1080 |
-
|
1081 |
-
$sortable[ $id ] = $data;
|
1082 |
-
}
|
1083 |
-
|
1084 |
-
$primary = $this->get_primary_column_name();
|
1085 |
-
$this->_column_headers = array( $columns, $hidden, $sortable, $primary );
|
1086 |
-
|
1087 |
-
return $this->_column_headers;
|
1088 |
-
}
|
1089 |
-
|
1090 |
-
/**
|
1091 |
-
* Return number of visible columns
|
1092 |
-
*
|
1093 |
-
* @since 3.1.0
|
1094 |
-
*
|
1095 |
-
* @return int
|
1096 |
-
*/
|
1097 |
-
public function get_column_count() {
|
1098 |
-
list ( $columns, $hidden ) = $this->get_column_info();
|
1099 |
-
$hidden = array_intersect( array_keys( $columns ), array_filter( $hidden ) );
|
1100 |
-
return count( $columns ) - count( $hidden );
|
1101 |
-
}
|
1102 |
-
|
1103 |
-
/**
|
1104 |
-
* Print column headers, accounting for hidden and sortable columns.
|
1105 |
-
*
|
1106 |
-
* @since 3.1.0
|
1107 |
-
*
|
1108 |
-
* @staticvar int $cb_counter
|
1109 |
-
*
|
1110 |
-
* @param bool $with_id Whether to set the id attribute or not
|
1111 |
-
*/
|
1112 |
-
public function print_column_headers( $with_id = true ) {
|
1113 |
-
list( $columns, $hidden, $sortable, $primary ) = $this->get_column_info();
|
1114 |
-
|
1115 |
-
$current_url = set_url_scheme( 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] );
|
1116 |
-
$current_url = remove_query_arg( 'paged', $current_url );
|
1117 |
-
|
1118 |
-
if ( isset( $_GET['orderby'] ) ) {
|
1119 |
-
$current_orderby = $_GET['orderby'];
|
1120 |
-
} else {
|
1121 |
-
$current_orderby = '';
|
1122 |
-
}
|
1123 |
-
|
1124 |
-
if ( isset( $_GET['order'] ) && 'desc' === $_GET['order'] ) {
|
1125 |
-
$current_order = 'desc';
|
1126 |
-
} else {
|
1127 |
-
$current_order = 'asc';
|
1128 |
-
}
|
1129 |
-
|
1130 |
-
if ( ! empty( $columns['cb'] ) ) {
|
1131 |
-
static $cb_counter = 1;
|
1132 |
-
$columns['cb'] = '<label class="screen-reader-text" for="cb-select-all-' . $cb_counter . '">' . __( 'Select All' ) . '</label>'
|
1133 |
-
. '<input id="cb-select-all-' . $cb_counter . '" type="checkbox" />';
|
1134 |
-
$cb_counter++;
|
1135 |
-
}
|
1136 |
-
|
1137 |
-
foreach ( $columns as $column_key => $column_display_name ) {
|
1138 |
-
$class = array( 'manage-column', "column-$column_key" );
|
1139 |
-
|
1140 |
-
if ( in_array( $column_key, $hidden ) ) {
|
1141 |
-
$class[] = 'hidden';
|
1142 |
-
}
|
1143 |
-
|
1144 |
-
if ( 'cb' === $column_key ) {
|
1145 |
-
$class[] = 'check-column';
|
1146 |
-
} elseif ( in_array( $column_key, array( 'posts', 'comments', 'links' ) ) ) {
|
1147 |
-
$class[] = 'num';
|
1148 |
-
}
|
1149 |
-
|
1150 |
-
if ( $column_key === $primary ) {
|
1151 |
-
$class[] = 'column-primary';
|
1152 |
-
}
|
1153 |
-
|
1154 |
-
if ( isset( $sortable[ $column_key ] ) ) {
|
1155 |
-
list( $orderby, $desc_first ) = $sortable[ $column_key ];
|
1156 |
-
|
1157 |
-
if ( $current_orderby === $orderby ) {
|
1158 |
-
$order = 'asc' === $current_order ? 'desc' : 'asc';
|
1159 |
-
$class[] = 'sorted';
|
1160 |
-
$class[] = $current_order;
|
1161 |
-
} else {
|
1162 |
-
$order = $desc_first ? 'desc' : 'asc';
|
1163 |
-
$class[] = 'sortable';
|
1164 |
-
$class[] = $desc_first ? 'asc' : 'desc';
|
1165 |
-
}
|
1166 |
-
|
1167 |
-
$column_display_name = '<a href="' . esc_url( add_query_arg( compact( 'orderby', 'order' ), $current_url ) ) . '"><span>' . $column_display_name . '</span><span class="sorting-indicator"></span></a>';
|
1168 |
-
}
|
1169 |
-
|
1170 |
-
$tag = ( 'cb' === $column_key ) ? 'td' : 'th';
|
1171 |
-
$scope = ( 'th' === $tag ) ? 'scope="col"' : '';
|
1172 |
-
$id = $with_id ? "id='$column_key'" : '';
|
1173 |
-
|
1174 |
-
if ( ! empty( $class ) ) {
|
1175 |
-
$class = "class='" . join( ' ', $class ) . "'";
|
1176 |
-
}
|
1177 |
-
|
1178 |
-
echo "<$tag $scope $id $class>$column_display_name</$tag>";
|
1179 |
-
}
|
1180 |
-
}
|
1181 |
-
|
1182 |
-
/**
|
1183 |
-
* Displays the table.
|
1184 |
-
*
|
1185 |
-
* @since 3.1.0
|
1186 |
-
*/
|
1187 |
-
public function display() {
|
1188 |
-
$singular = $this->_args['singular'];
|
1189 |
-
|
1190 |
-
$this->display_tablenav( 'top' );
|
1191 |
-
|
1192 |
-
$this->screen->render_screen_reader_content( 'heading_list' );
|
1193 |
-
?>
|
1194 |
-
<table class="wp-list-table <?php echo implode( ' ', $this->get_table_classes() ); ?>">
|
1195 |
-
<thead>
|
1196 |
-
<tr>
|
1197 |
-
<?php $this->print_column_headers(); ?>
|
1198 |
-
</tr>
|
1199 |
-
</thead>
|
1200 |
-
|
1201 |
-
<tbody id="the-list"
|
1202 |
-
<?php
|
1203 |
-
if ( $singular ) {
|
1204 |
-
echo " data-wp-lists='list:$singular'";
|
1205 |
-
}
|
1206 |
-
?>
|
1207 |
-
>
|
1208 |
-
<?php $this->display_rows_or_placeholder(); ?>
|
1209 |
-
</tbody>
|
1210 |
-
|
1211 |
-
<tfoot>
|
1212 |
-
<tr>
|
1213 |
-
<?php $this->print_column_headers( false ); ?>
|
1214 |
-
</tr>
|
1215 |
-
</tfoot>
|
1216 |
-
|
1217 |
-
</table>
|
1218 |
-
<?php
|
1219 |
-
$this->display_tablenav( 'bottom' );
|
1220 |
-
}
|
1221 |
-
|
1222 |
-
/**
|
1223 |
-
* Get a list of CSS classes for the WP_List_Table table tag.
|
1224 |
-
*
|
1225 |
-
* @since 3.1.0
|
1226 |
-
*
|
1227 |
-
* @return array List of CSS classes for the table tag.
|
1228 |
-
*/
|
1229 |
-
protected function get_table_classes() {
|
1230 |
-
return array( 'widefat', 'fixed', 'striped', $this->_args['plural'] );
|
1231 |
-
}
|
1232 |
-
|
1233 |
-
/**
|
1234 |
-
* Generate the table navigation above or below the table
|
1235 |
-
*
|
1236 |
-
* @since 3.1.0
|
1237 |
-
* @param string $which
|
1238 |
-
*/
|
1239 |
-
protected function display_tablenav( $which ) {
|
1240 |
-
if ( 'top' === $which ) {
|
1241 |
-
wp_nonce_field( 'bulk-' . $this->_args['plural'] );
|
1242 |
-
}
|
1243 |
-
?>
|
1244 |
-
<div class="tablenav <?php echo esc_attr( $which ); ?>">
|
1245 |
-
|
1246 |
-
<?php if ( $this->has_items() ) : ?>
|
1247 |
-
<div class="alignleft actions bulkactions">
|
1248 |
-
<?php $this->bulk_actions( $which ); ?>
|
1249 |
-
</div>
|
1250 |
-
<?php
|
1251 |
-
endif;
|
1252 |
-
$this->extra_tablenav( $which );
|
1253 |
-
$this->pagination( $which );
|
1254 |
-
?>
|
1255 |
-
|
1256 |
-
<br class="clear" />
|
1257 |
-
</div>
|
1258 |
-
<?php
|
1259 |
-
}
|
1260 |
-
|
1261 |
-
/**
|
1262 |
-
* Extra controls to be displayed between bulk actions and pagination
|
1263 |
-
*
|
1264 |
-
* @since 3.1.0
|
1265 |
-
*
|
1266 |
-
* @param string $which
|
1267 |
-
*/
|
1268 |
-
protected function extra_tablenav( $which ) {}
|
1269 |
-
|
1270 |
-
/**
|
1271 |
-
* Generate the tbody element for the list table.
|
1272 |
-
*
|
1273 |
-
* @since 3.1.0
|
1274 |
-
*/
|
1275 |
-
public function display_rows_or_placeholder() {
|
1276 |
-
if ( $this->has_items() ) {
|
1277 |
-
$this->display_rows();
|
1278 |
-
} else {
|
1279 |
-
echo '<tr class="no-items"><td class="colspanchange" colspan="' . $this->get_column_count() . '">';
|
1280 |
-
$this->no_items();
|
1281 |
-
echo '</td></tr>';
|
1282 |
-
}
|
1283 |
-
}
|
1284 |
-
|
1285 |
-
/**
|
1286 |
-
* Generate the table rows
|
1287 |
-
*
|
1288 |
-
* @since 3.1.0
|
1289 |
-
*/
|
1290 |
-
public function display_rows() {
|
1291 |
-
foreach ( $this->items as $item ) {
|
1292 |
-
$this->single_row( $item );
|
1293 |
-
}
|
1294 |
-
}
|
1295 |
-
|
1296 |
-
/**
|
1297 |
-
* Generates content for a single row of the table
|
1298 |
-
*
|
1299 |
-
* @since 3.1.0
|
1300 |
-
*
|
1301 |
-
* @param object $item The current item
|
1302 |
-
*/
|
1303 |
-
public function single_row( $item ) {
|
1304 |
-
echo '<tr>';
|
1305 |
-
$this->single_row_columns( $item );
|
1306 |
-
echo '</tr>';
|
1307 |
-
}
|
1308 |
-
|
1309 |
-
/**
|
1310 |
-
* @param object $item
|
1311 |
-
* @param string $column_name
|
1312 |
-
*/
|
1313 |
-
protected function column_default( $item, $column_name ) {}
|
1314 |
-
|
1315 |
-
/**
|
1316 |
-
* @param object $item
|
1317 |
-
*/
|
1318 |
-
protected function column_cb( $item ) {}
|
1319 |
-
|
1320 |
-
/**
|
1321 |
-
* Generates the columns for a single row of the table
|
1322 |
-
*
|
1323 |
-
* @since 3.1.0
|
1324 |
-
*
|
1325 |
-
* @param object $item The current item
|
1326 |
-
*/
|
1327 |
-
protected function single_row_columns( $item ) {
|
1328 |
-
list( $columns, $hidden, $sortable, $primary ) = $this->get_column_info();
|
1329 |
-
|
1330 |
-
foreach ( $columns as $column_name => $column_display_name ) {
|
1331 |
-
$classes = "$column_name column-$column_name";
|
1332 |
-
if ( $primary === $column_name ) {
|
1333 |
-
$classes .= ' has-row-actions column-primary';
|
1334 |
-
}
|
1335 |
-
|
1336 |
-
if ( in_array( $column_name, $hidden ) ) {
|
1337 |
-
$classes .= ' hidden';
|
1338 |
-
}
|
1339 |
-
|
1340 |
-
// Comments column uses HTML in the display name with screen reader text.
|
1341 |
-
// Instead of using esc_attr(), we strip tags to get closer to a user-friendly string.
|
1342 |
-
$data = 'data-colname="' . wp_strip_all_tags( $column_display_name ) . '"';
|
1343 |
-
|
1344 |
-
$attributes = "class='$classes' $data";
|
1345 |
-
|
1346 |
-
if ( 'cb' === $column_name ) {
|
1347 |
-
echo '<th scope="row" class="check-column">';
|
1348 |
-
echo $this->column_cb( $item );
|
1349 |
-
echo '</th>';
|
1350 |
-
} elseif ( method_exists( $this, '_column_' . $column_name ) ) {
|
1351 |
-
echo call_user_func(
|
1352 |
-
array( $this, '_column_' . $column_name ),
|
1353 |
-
$item,
|
1354 |
-
$classes,
|
1355 |
-
$data,
|
1356 |
-
$primary
|
1357 |
-
);
|
1358 |
-
} elseif ( method_exists( $this, 'column_' . $column_name ) ) {
|
1359 |
-
echo "<td $attributes>";
|
1360 |
-
echo call_user_func( array( $this, 'column_' . $column_name ), $item );
|
1361 |
-
echo $this->handle_row_actions( $item, $column_name, $primary );
|
1362 |
-
echo '</td>';
|
1363 |
-
} else {
|
1364 |
-
echo "<td $attributes>";
|
1365 |
-
echo $this->column_default( $item, $column_name );
|
1366 |
-
echo $this->handle_row_actions( $item, $column_name, $primary );
|
1367 |
-
echo '</td>';
|
1368 |
-
}
|
1369 |
-
}
|
1370 |
-
}
|
1371 |
-
|
1372 |
-
/**
|
1373 |
-
* Generates and display row actions links for the list table.
|
1374 |
-
*
|
1375 |
-
* @since 4.3.0
|
1376 |
-
*
|
1377 |
-
* @param object $item The item being acted upon.
|
1378 |
-
* @param string $column_name Current column name.
|
1379 |
-
* @param string $primary Primary column name.
|
1380 |
-
* @return string The row actions HTML, or an empty string if the current column is the primary column.
|
1381 |
-
*/
|
1382 |
-
protected function handle_row_actions( $item, $column_name, $primary ) {
|
1383 |
-
return $column_name === $primary ? '<button type="button" class="toggle-row"><span class="screen-reader-text">' . __( 'Show more details' ) . '</span></button>' : '';
|
1384 |
-
}
|
1385 |
-
|
1386 |
-
/**
|
1387 |
-
* Handle an incoming ajax request (called from admin-ajax.php)
|
1388 |
-
*
|
1389 |
-
* @since 3.1.0
|
1390 |
-
*/
|
1391 |
-
public function ajax_response() {
|
1392 |
-
$this->prepare_items();
|
1393 |
-
|
1394 |
-
ob_start();
|
1395 |
-
if ( ! empty( $_REQUEST['no_placeholder'] ) ) {
|
1396 |
-
$this->display_rows();
|
1397 |
-
} else {
|
1398 |
-
$this->display_rows_or_placeholder();
|
1399 |
-
}
|
1400 |
-
|
1401 |
-
$rows = ob_get_clean();
|
1402 |
-
|
1403 |
-
$response = array( 'rows' => $rows );
|
1404 |
-
|
1405 |
-
if ( isset( $this->_pagination_args['total_items'] ) ) {
|
1406 |
-
$response['total_items_i18n'] = sprintf(
|
1407 |
-
/* translators: Number of items. */
|
1408 |
-
_n( '%s item', '%s items', $this->_pagination_args['total_items'] ),
|
1409 |
-
number_format_i18n( $this->_pagination_args['total_items'] )
|
1410 |
-
);
|
1411 |
-
}
|
1412 |
-
if ( isset( $this->_pagination_args['total_pages'] ) ) {
|
1413 |
-
$response['total_pages'] = $this->_pagination_args['total_pages'];
|
1414 |
-
$response['total_pages_i18n'] = number_format_i18n( $this->_pagination_args['total_pages'] );
|
1415 |
-
}
|
1416 |
-
|
1417 |
-
die( wp_json_encode( $response ) );
|
1418 |
-
}
|
1419 |
-
|
1420 |
-
/**
|
1421 |
-
* Send required variables to JavaScript land
|
1422 |
-
*/
|
1423 |
-
public function _js_vars() {
|
1424 |
-
$args = array(
|
1425 |
-
'class' => get_class( $this ),
|
1426 |
-
'screen' => array(
|
1427 |
-
'id' => $this->screen->id,
|
1428 |
-
'base' => $this->screen->base,
|
1429 |
-
),
|
1430 |
-
);
|
1431 |
-
|
1432 |
-
printf( "<script type='text/javascript'>list_args = %s;</script>\n", wp_json_encode( $args ) );
|
1433 |
-
}
|
1434 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
-
$apbct->settings['
|
175 |
-
$apbct->settings['
|
176 |
$apbct->saveSettings();
|
177 |
|
178 |
$wpdb->query('CREATE TABLE IF NOT EXISTS `'. APBCT_TBL_SESSIONS .'` (
|
@@ -271,7 +271,7 @@ function apbct_update_to_5_119_0(){
|
|
271 |
switch_to_blog($initial_blog);
|
272 |
}
|
273 |
|
274 |
-
// Drop work url
|
275 |
update_option(
|
276 |
'cleantalk_server',
|
277 |
array(
|
@@ -292,8 +292,8 @@ function apbct_update_to_5_124_0(){
|
|
292 |
function apbct_update_to_5_126_0(){
|
293 |
global $apbct;
|
294 |
// Enable storing URLs
|
295 |
-
$apbct->settings['
|
296 |
-
$apbct->settings['
|
297 |
$apbct->saveSettings();
|
298 |
}
|
299 |
|
@@ -345,10 +345,10 @@ function apbct_update_to_5_127_0(){
|
|
345 |
switch_to_blog( $blog );
|
346 |
|
347 |
$settings = get_option( 'cleantalk_settings' );
|
348 |
-
if( isset( $settings['
|
349 |
-
$settings['
|
350 |
? - 1
|
351 |
-
: $settings['
|
352 |
update_option( 'cleantalk_settings', $settings );
|
353 |
|
354 |
$data = get_option( 'cleantalk_data' );
|
@@ -361,13 +361,13 @@ function apbct_update_to_5_127_0(){
|
|
361 |
|
362 |
if( defined( 'APBCT_WHITELABEL' ) ){
|
363 |
$apbct->network_settings = array(
|
364 |
-
'
|
365 |
-
'
|
366 |
-
'
|
367 |
);
|
368 |
}elseif( defined( 'CLEANTALK_ACCESS_KEY' ) ){
|
369 |
$apbct->network_settings = array(
|
370 |
-
'
|
371 |
'apikey' => CLEANTALK_ACCESS_KEY,
|
372 |
);
|
373 |
}
|
@@ -375,9 +375,9 @@ function apbct_update_to_5_127_0(){
|
|
375 |
}
|
376 |
}else{
|
377 |
// Switch use_static_js_key to Auto if it was disabled
|
378 |
-
$apbct->settings['
|
379 |
? -1
|
380 |
-
: $apbct->settings['
|
381 |
$apbct->saveSettings();
|
382 |
}
|
383 |
}
|
@@ -386,11 +386,11 @@ function apbct_update_to_5_127_1(){
|
|
386 |
if(APBCT_WPMS && is_main_site()){
|
387 |
global $apbct;
|
388 |
$network_settings = get_site_option( 'cleantalk_network_settings' );
|
389 |
-
if( $network_settings !== false && empty( $network_settings['
|
390 |
-
$network_settings['
|
391 |
update_site_option( 'cleantalk_network_settings', $network_settings );
|
392 |
}
|
393 |
-
if( $network_settings !== false && $network_settings['
|
394 |
ct_account_status_check( $network_settings['apikey'] ? $network_settings['apikey'] : $apbct->settings['apikey'], false);
|
395 |
}
|
396 |
}
|
@@ -468,7 +468,7 @@ function apbct_update_to_5_138_0() {
|
|
468 |
apbct_activation__create_tables($sqls);
|
469 |
|
470 |
// Getting key
|
471 |
-
$settings = $net_settings['
|
472 |
? get_option('cleantalk_settings')
|
473 |
: $main_blog_settings;
|
474 |
|
@@ -480,7 +480,7 @@ function apbct_update_to_5_138_0() {
|
|
480 |
$result = \Cleantalk\ApbctWP\API::method__notice_paid_till(
|
481 |
$settings['api_key'],
|
482 |
preg_replace('/http[s]?:\/\//', '', get_option('siteurl'), 1),
|
483 |
-
! is_main_site() && $net_settings['
|
484 |
);
|
485 |
|
486 |
if( empty( $result['error'] ) || ! empty( $result['valid'] ) ){
|
171 |
|
172 |
global $apbct, $wpdb;
|
173 |
|
174 |
+
$apbct->settings['store_urls'] = 0;
|
175 |
+
$apbct->settings['store_urls__sessions'] = 0;
|
176 |
$apbct->saveSettings();
|
177 |
|
178 |
$wpdb->query('CREATE TABLE IF NOT EXISTS `'. APBCT_TBL_SESSIONS .'` (
|
271 |
switch_to_blog($initial_blog);
|
272 |
}
|
273 |
|
274 |
+
// Drop work url
|
275 |
update_option(
|
276 |
'cleantalk_server',
|
277 |
array(
|
292 |
function apbct_update_to_5_126_0(){
|
293 |
global $apbct;
|
294 |
// Enable storing URLs
|
295 |
+
$apbct->settings['store_urls'] = 1;
|
296 |
+
$apbct->settings['store_urls__sessions'] = 1;
|
297 |
$apbct->saveSettings();
|
298 |
}
|
299 |
|
345 |
switch_to_blog( $blog );
|
346 |
|
347 |
$settings = get_option( 'cleantalk_settings' );
|
348 |
+
if( isset( $settings['use_static_js_key'] ) ){
|
349 |
+
$settings['use_static_js_key'] = $settings['use_static_js_key'] === 0
|
350 |
? - 1
|
351 |
+
: $settings['use_static_js_key'];
|
352 |
update_option( 'cleantalk_settings', $settings );
|
353 |
|
354 |
$data = get_option( 'cleantalk_data' );
|
361 |
|
362 |
if( defined( 'APBCT_WHITELABEL' ) ){
|
363 |
$apbct->network_settings = array(
|
364 |
+
'white_label' => defined( 'APBCT_WHITELABEL' ) && APBCT_WHITELABEL == true ? 1 : 0,
|
365 |
+
'white_label__hoster_key' => defined( 'APBCT_HOSTER_API_KEY' ) ? APBCT_HOSTER_API_KEY : '',
|
366 |
+
'white_label__plugin_name' => defined( 'APBCT_WHITELABEL_NAME' ) ? APBCT_WHITELABEL_NAME : APBCT_NAME,
|
367 |
);
|
368 |
}elseif( defined( 'CLEANTALK_ACCESS_KEY' ) ){
|
369 |
$apbct->network_settings = array(
|
370 |
+
'allow_custom_key' => 0,
|
371 |
'apikey' => CLEANTALK_ACCESS_KEY,
|
372 |
);
|
373 |
}
|
375 |
}
|
376 |
}else{
|
377 |
// Switch use_static_js_key to Auto if it was disabled
|
378 |
+
$apbct->settings['use_static_js_key'] = $apbct->settings['use_static_js_key'] === 0
|
379 |
? -1
|
380 |
+
: $apbct->settings['use_static_js_key'];
|
381 |
$apbct->saveSettings();
|
382 |
}
|
383 |
}
|
386 |
if(APBCT_WPMS && is_main_site()){
|
387 |
global $apbct;
|
388 |
$network_settings = get_site_option( 'cleantalk_network_settings' );
|
389 |
+
if( $network_settings !== false && empty( $network_settings['allow_custom_key'] ) && empty( $network_settings['white_label'] ) ){
|
390 |
+
$network_settings['allow_custom_key'] = 1;
|
391 |
update_site_option( 'cleantalk_network_settings', $network_settings );
|
392 |
}
|
393 |
+
if( $network_settings !== false && $network_settings['white_label'] == 1 && $apbct->data['moderate'] == 0 ){
|
394 |
ct_account_status_check( $network_settings['apikey'] ? $network_settings['apikey'] : $apbct->settings['apikey'], false);
|
395 |
}
|
396 |
}
|
468 |
apbct_activation__create_tables($sqls);
|
469 |
|
470 |
// Getting key
|
471 |
+
$settings = $net_settings['allow_custom_key']
|
472 |
? get_option('cleantalk_settings')
|
473 |
: $main_blog_settings;
|
474 |
|
480 |
$result = \Cleantalk\ApbctWP\API::method__notice_paid_till(
|
481 |
$settings['api_key'],
|
482 |
preg_replace('/http[s]?:\/\//', '', get_option('siteurl'), 1),
|
483 |
+
! is_main_site() && $net_settings['white_label'] ? 'anti-spam-hosting' : 'antispam'
|
484 |
);
|
485 |
|
486 |
if( empty( $result['error'] ) || ! empty( $result['valid'] ) ){
|
js/apbct-public.min.js
CHANGED
@@ -1,2 +1,2 @@
|
|
1 |
-
function ctSetCookie(e,t){document.cookie=e+"="+encodeURIComponent(t)+"; path=/; samesite=lax"}function apbct_collect_visible_fields(e){var t,n=[],o="",i=0,
|
2 |
//# sourceMappingURL=apbct-public.min.js.map
|
1 |
+
function ctSetCookie(e,t){document.cookie=e+"="+encodeURIComponent(t)+"; path=/; samesite=lax"}function apbct_collect_visible_fields(e){var t,n=[],o="",i=0,c=[];for(t in e.elements)isNaN(+t)||(n[t]=e.elements[t]);return(n=n.filter(function(e){return"none"!==getComputedStyle(e).display&&"hidden"!==getComputedStyle(e).visibility&&"0"!==getComputedStyle(e).opacity&&"hidden"!==e.getAttribute("type")&&"submit"!==e.getAttribute("type")&&null!==e.getAttribute("name")&&-1===c.indexOf(e.getAttribute("name"))&&(i++,-1===["radio","checkbox"].indexOf(e.getAttribute("type"))||(c.push(e.getAttribute("name")),!1))})).forEach(function(e,t,n){o+=" "+e.getAttribute("name")}),{visible_fields:o=o.trim(),visible_fields_count:i}}function apbct_visible_fields_set_cookie(e){e="object"==typeof e&&null!==e?e:{};ctSetCookie("apbct_visible_fields",JSON.stringify(e))}function apbct_js_keys__set_input_value(e,t,n,o){if(0<document.querySelectorAll("[name^=ct_checkjs]").length)for(var i=document.querySelectorAll("[name^=ct_checkjs]"),c=0;c<i.length;c++)i[c].value=e.js_key}function apbct_public_sendAJAX(t,n,o){var i=n.callback||null,c=n.callback_context||null,a=n.callback_params||null,e=n.async||!0,l=n.notJson||null,s=n.timeout||15e3,o=o||null,r=n.button||null,u=n.spinner||null,p=n.progressbar||null,d=n.silent||null,m=n.no_nonce||null;"string"==typeof t?t=(t=!m?t+"&_ajax_nonce="+ctPublic._ajax_nonce:t)+"&no_cache="+Math.random():(m||(t._ajax_nonce=ctPublic._ajax_nonce),t.no_cache=Math.random()),r&&(r.setAttribute("disabled","disabled"),r.style.cursor="not-allowed"),u&&jQuery(u).css("display","inline"),jQuery.ajax({type:"POST",url:ctPublic._ajax_url,data:t,async:e,success:function(e){r&&(r.removeAttribute("disabled"),r.style.cursor="pointer"),u&&jQuery(u).css("display","none"),(e=!l?JSON.parse(e):e).error?(setTimeout(function(){p&&p.fadeOut("slow")},1e3),alert("Error happens: "+(e.error||"Unkown"))):i&&(a?i.apply(c,a.concat(e,t,n,o)):i(e,t,n,o))},error:function(e,t,n){r&&(r.removeAttribute("disabled"),r.style.cursor="pointer"),u&&jQuery(u).css("display","none"),n&&!d&&(console.log("APBCT_AJAX_ERROR"),console.log(e),console.log(t),console.log("Anti-spam by Cleantalk plugin error: "+n+"Please, contact Cleantalk tech support https://wordpress.org/support/plugin/cleantalk-spam-protect/"))},timeout:s})}function apbct_public_sendREST(t,n){var o=n.callback||null;jQuery.ajax({type:"POST",url:ctPublic._rest_url+"cleantalk-antispam/v1/"+t,beforeSend:function(e){e.setRequestHeader("X-WP-Nonce",ctPublic._rest_nonce)},success:function(e){e.error?alert("Error happens: "+(e.error||"Unknown")):o&&o(e,t,n,null)},error:function(e,t,n){n&&(console.log("APBCT_REST_ERROR"),console.log(e),console.log(t),console.log("Anti-spam by Cleantalk plugin error: "+n+"Please, contact Cleantalk tech support https://wordpress.org/support/plugin/cleantalk-spam-protect/"),alert("Anti-spam by Cleantalk plugin error: "+n+"Please, contact Cleantalk tech support https://wordpress.org/support/plugin/cleantalk-spam-protect/"))}})}!function(){var e=new Date,t=(new Date).getTime(),n=!0,o=[],i=0;function c(e,t,n){"function"==typeof window.addEventListener?e.addEventListener(t,n):e.attachEvent(t,n)}function a(e,t,n){"function"==typeof window.removeEventListener?e.removeEventListener(t,n):e.detachEvent(t,n)}ctSetCookie("ct_ps_timestamp",Math.floor((new Date).getTime()/1e3)),ctSetCookie("ct_fkp_timestamp","0"),ctSetCookie("ct_pointer_data","0"),ctSetCookie("ct_timezone","0"),setTimeout(function(){ctSetCookie("ct_timezone",e.getTimezoneOffset()/60*-1)},1e3);var l=function(e){ctSetCookie("ct_fkp_timestamp",Math.floor((new Date).getTime()/1e3)),a(window,"mousedown",l),a(window,"keydown",l)},s=setInterval(function(){n=!0},150),r=setInterval(function(){ctSetCookie("ct_pointer_data",JSON.stringify(o))},1200),u=function(e){!0===n&&(o.push([Math.round(e.clientY),Math.round(e.clientX),Math.round((new Date).getTime()-t)]),n=!1,50<=++i&&(a(window,"mousemove",u),clearInterval(s),clearInterval(r)))};c(window,"mousemove",u),c(window,"mousedown",l),c(window,"keydown",l),c(window,"DOMContentLoaded",function(){ctSetCookie("apbct_visible_fields",0),setTimeout(function(){for(var e={},t=0;t<document.forms.length;t++){var n=document.forms[t];n.classList.contains("slp_search_form")||n.parentElement.classList.contains("mec-booking")||-1!==n.action.toString().indexOf("activehosted.com")||n.id&&"caspioform"==n.id||n.name.classList&&n.name.classList.contains("tinkoffPayRow")||n.name.classList&&n.name.classList.contains("give-form ")||(e[t]=apbct_collect_visible_fields(n),n.onsubmit_prev=n.onsubmit,n.onsubmit=function(e){var t={};t[0]=apbct_collect_visible_fields(this),apbct_visible_fields_set_cookie(t),e.target.onsubmit_prev instanceof Function&&setTimeout(function(){e.target.onsubmit_prev.call(e.target,e)},500)})}apbct_visible_fields_set_cookie(e)},1e3)})}(),"undefined"!=typeof jQuery&&jQuery(document).ajaxComplete(function(e,t,n){!t.responseText||-1===t.responseText.indexOf('"apbct')||void 0!==(t=JSON.parse(t.responseText)).apbct&&(t=t.apbct).blocked&&(document.dispatchEvent(new CustomEvent("apbctAjaxBockAlert",{bubbles:!0,detail:{message:t.comment}})),cleantalkModal.loaded=t.comment,cleantalkModal.open(),1==+t.stop_script&&window.stop())});
|
2 |
//# sourceMappingURL=apbct-public.min.js.map
|
js/apbct-public.min.js.map
CHANGED
@@ -1 +1 @@
|
|
1 |
-
{"version":3,"file":"apbct-public.min.js","sources":["apbct-public.js"],"sourcesContent":["(function() {\n\n\tvar ct_date = new Date(),\n\t\tctTimeMs = new Date().getTime(),\n\t\tctMouseEventTimerFlag = true, //Reading interval flag\n\t\tctMouseData = [],\n\t\tctMouseDataCounter = 0;\n\n\tfunction apbct_attach_event_handler(elem, event, callback){\n\t\tif(typeof window.addEventListener === \"function\") elem.addEventListener(event, callback);\n\t\telse elem.attachEvent(event, callback);\n\t}\n\n\tfunction apbct_remove_event_handler(elem, event, callback){\n\t\tif(typeof window.removeEventListener === \"function\") elem.removeEventListener(event, callback);\n\t\telse elem.detachEvent(event, callback);\n\t}\n\n\tctSetCookie(\"ct_ps_timestamp\", Math.floor(new Date().getTime()/1000));\n\tctSetCookie(\"ct_fkp_timestamp\", \"0\");\n\tctSetCookie(\"ct_pointer_data\", \"0\");\n\tctSetCookie(\"ct_timezone\", \"0\");\n\n\tsetTimeout(function(){\n\t\tctSetCookie(\"ct_timezone\", ct_date.getTimezoneOffset()/60*(-1));\n\t},1000);\n\n\t//Writing first key press timestamp\n\tvar ctFunctionFirstKey = function output(event){\n\t\tvar KeyTimestamp = Math.floor(new Date().getTime()/1000);\n\t\tctSetCookie(\"ct_fkp_timestamp\", KeyTimestamp);\n\t\tctKeyStopStopListening();\n\t};\n\n\t//Reading interval\n\tvar ctMouseReadInterval = setInterval(function(){\n\t\tctMouseEventTimerFlag = true;\n\t}, 150);\n\n\t//Writting interval\n\tvar ctMouseWriteDataInterval = setInterval(function(){\n\t\tctSetCookie(\"ct_pointer_data\", JSON.stringify(ctMouseData));\n\t}, 1200);\n\n\t//Logging mouse position each 150 ms\n\tvar ctFunctionMouseMove = function output(event){\n\t\tif(ctMouseEventTimerFlag === true){\n\n\t\t\tctMouseData.push([\n\t\t\t\tMath.round(event.clientY),\n\t\t\t\tMath.round(event.clientX),\n\t\t\t\tMath.round(new Date().getTime() - ctTimeMs)\n\t\t\t]);\n\n\t\t\tctMouseDataCounter++;\n\t\t\tctMouseEventTimerFlag = false;\n\t\t\tif(ctMouseDataCounter >= 50){\n\t\t\t\tctMouseStopData();\n\t\t\t}\n\t\t}\n\t};\n\n\t//Stop mouse observing function\n\tfunction ctMouseStopData(){\n\t\tapbct_remove_event_handler(window, \"mousemove\", ctFunctionMouseMove);\n\t\tclearInterval(ctMouseReadInterval);\n\t\tclearInterval(ctMouseWriteDataInterval);\n\t}\n\n\t//Stop key listening function\n\tfunction ctKeyStopStopListening(){\n\t\tapbct_remove_event_handler(window, \"mousedown\", ctFunctionFirstKey);\n\t\tapbct_remove_event_handler(window, \"keydown\", ctFunctionFirstKey);\n\t}\n\n\tapbct_attach_event_handler(window, \"mousemove\", ctFunctionMouseMove);\n\tapbct_attach_event_handler(window, \"mousedown\", ctFunctionFirstKey);\n\tapbct_attach_event_handler(window, \"keydown\", ctFunctionFirstKey);\n\n\t// Ready function\n\tfunction apbct_ready(){\n\n\t\tctSetCookie(\"apbct_visible_fields\", 0);\n\n\t\tsetTimeout(function(){\n\n\t\t\tvar visible_fields_collection = {};\n\n\t\t\tfor(var i = 0; i < document.forms.length; i++){\n\t\t\t\tvar form = document.forms[i];\n\n\t\t\t\t//Exclusion for forms\n\t\t\t\tif (\n\t\t\t\t\tform.classList.contains('slp_search_form') || //StoreLocatorPlus form\n\t\t\t\t\tform.parentElement.classList.contains('mec-booking') ||\n\t\t\t\t\tform.action.toString().indexOf('activehosted.com') !== -1 || // Active Campaign\n\t\t\t\t\t(form.id && form.id == 'caspioform') || //Caspio Form\n\t\t\t\t\t(form.name.classList && form.name.classList.contains('tinkoffPayRow')) || // TinkoffPayForm\n\t\t\t\t\t(form.name.classList && form.name.classList.contains('give-form ')) // GiveWP\n\t\t\t\t)\n\t\t\t\t\tcontinue;\n\n\t\t\t\tvisible_fields_collection[i] = apbct_collect_visible_fields( form );\n\n\t\t\t\tform.onsubmit_prev = form.onsubmit;\n\t\t\t\tform.onsubmit = function (event) {\n\n\t\t\t\t\tvar visible_fields = {};\n\t\t\t\t\tvisible_fields[0] = apbct_collect_visible_fields(this);\n\t\t\t\t\tapbct_visible_fields_set_cookie( visible_fields );\n\n\t\t\t\t\t// Call previous submit action\n\t\t\t\t\tif (event.target.onsubmit_prev instanceof Function) {\n\t\t\t\t\t\tsetTimeout(function () {\n\t\t\t\t\t\t\tevent.target.onsubmit_prev.call(event.target, event);\n\t\t\t\t\t\t}, 500);\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t}\n\n\t\t\tapbct_visible_fields_set_cookie( visible_fields_collection );\n\n\t\t}, 1000);\n\t}\n\tapbct_attach_event_handler(window, \"DOMContentLoaded\", apbct_ready);\n\n}());\n\nfunction ctSetCookie(c_name, value) {\n\tdocument.cookie = c_name + \"=\" + encodeURIComponent(value) + \"; path=/; samesite=lax\";\n}\n\nfunction apbct_collect_visible_fields( form ) {\n\n\t// Get only fields\n\tvar inputs = [],\n\t\tinputs_visible = '',\n\t\tinputs_visible_count = 0,\n\t\tinputs_with_duplicate_names = [];\n\n\tfor(var key in form.elements){\n\t\tif(!isNaN(+key))\n\t\t\tinputs[key] = form.elements[key];\n\t}\n\n\t// Filter fields\n\tinputs = inputs.filter(function(elem){\n\n\t\t// Filter fields\n\t\tif( getComputedStyle(elem).display === \"none\" || // hidden\n\t\t\tgetComputedStyle(elem).visibility === \"hidden\" || // hidden\n\t\t\tgetComputedStyle(elem).opacity === \"0\" || // hidden\n\t\t\telem.getAttribute(\"type\") === \"hidden\" || // type == hidden\n\t\t\telem.getAttribute(\"type\") === \"submit\" || // type == submit\n\t\t\t//elem.value === \"\" || // empty value\n\t\t\telem.getAttribute('name') === null ||\n\t\t\tinputs_with_duplicate_names.indexOf( elem.getAttribute('name') ) !== -1 // name already added\n\t\t){\n\t\t\treturn false;\n\t\t}\n\n\t\t// Visible fields count\n\t\tinputs_visible_count++;\n\n\t\t// Filter inputs with same names for type == radio\n\t\tif( -1 !== ['radio', 'checkbox'].indexOf( elem.getAttribute(\"type\") )){\n\t\t\tinputs_with_duplicate_names.push( elem.getAttribute('name') );\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t});\n\n\t// Visible fields\n\tinputs.forEach(function(elem, i, elements){\n\t\tinputs_visible += \" \" + elem.getAttribute(\"name\");\n\t});\n\tinputs_visible = inputs_visible.trim();\n\n\treturn {\n\t\tvisible_fields : inputs_visible,\n\t\tvisible_fields_count : inputs_visible_count,\n\t}\n\n}\n\nfunction apbct_visible_fields_set_cookie( visible_fields_collection ) {\n\n\tvar collection = typeof visible_fields_collection === 'object' && visible_fields_collection !== null ? visible_fields_collection : {};\n\n\tctSetCookie(\"apbct_visible_fields\", JSON.stringify( collection ) );\n\n}\n\nfunction apbct_js_keys__set_input_value(result, data, params, obj){\n\tif( document.querySelectorAll('[name^=ct_checkjs]').length > 0 ) {\n\t\tvar elements = document.querySelectorAll('[name^=ct_checkjs]');\n\t\tfor ( var i = 0; i < elements.length; i++ ) {\n\t\t\telements[i].value = result.js_key;\n\t\t}\n\t}\n}\nfunction apbct_public_sendAJAX(data, params, obj){\n\n\t// Default params\n\tvar callback = params.callback || null;\n\tvar callback_context = params.callback_context || null;\n\tvar callback_params = params.callback_params || null;\n\tvar async = params.async || true;\n\tvar notJson = params.notJson || null;\n\tvar timeout = params.timeout || 15000;\n\tvar obj = obj || null;\n\tvar button = params.button || null;\n\tvar spinner = params.spinner || null;\n\tvar progressbar = params.progressbar || null;\n\tvar silent = params.silent || null;\n\tvar no_nonce = params.no_nonce || null;\n\n\tif(typeof (data) === 'string') {\n\t\tif( ! no_nonce )\n\t\t\tdata = data + '&_ajax_nonce=' + ctPublic._ajax_nonce;\n\t\tdata = data + '&no_cache=' + Math.random()\n\t} else {\n\t\tif( ! no_nonce )\n\t\t\tdata._ajax_nonce = ctPublic._ajax_nonce;\n\t\tdata.no_cache = Math.random();\n\t}\n\t// Button and spinner\n\tif(button) {button.setAttribute('disabled', 'disabled'); button.style.cursor = 'not-allowed'; }\n\tif(spinner) jQuery(spinner).css('display', 'inline');\n\n\tjQuery.ajax({\n\t\ttype: \"POST\",\n\t\turl: ctPublic._ajax_url,\n\t\tdata: data,\n\t\tasync: async,\n\t\tsuccess: function(result){\n\t\t\tif(button){ button.removeAttribute('disabled'); button.style.cursor = 'pointer'; }\n\t\t\tif(spinner) jQuery(spinner).css('display', 'none');\n\t\t\tif(!notJson) result = JSON.parse(result);\n\t\t\tif(result.error){\n\t\t\t\tsetTimeout(function(){ if(progressbar) progressbar.fadeOut('slow'); }, 1000);\n\t\t\t\talert('Error happens: ' + (result.error || 'Unkown'));\n\t\t\t}else{\n\t\t\t\tif(callback) {\n\t\t\t\t\tif (callback_params)\n\t\t\t\t\t\tcallback.apply( callback_context, callback_params.concat( result, data, params, obj ) );\n\t\t\t\t\telse\n\t\t\t\t\t\tcallback(result, data, params, obj);\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\terror: function(jqXHR, textStatus, errorThrown){\n\t\t\tif(button){ button.removeAttribute('disabled'); button.style.cursor = 'pointer'; }\n\t\t\tif(spinner) jQuery(spinner).css('display', 'none');\n\t\t\tif( errorThrown && ! silent ) {\n\t\t\t\tconsole.log('APBCT_AJAX_ERROR');\n\t\t\t\tconsole.log(jqXHR);\n\t\t\t\tconsole.log(textStatus);\n\t\t\t\tconsole.log('Anti-spam by Cleantalk plugin error: ' + errorThrown + 'Please, contact Cleantalk tech support https://wordpress.org/support/plugin/cleantalk-spam-protect/');\n\t\t\t\talert('Anti-spam by Cleantalk plugin error: ' + errorThrown + 'Please, contact Cleantalk tech support https://wordpress.org/support/plugin/cleantalk-spam-protect/');\n\t\t\t}\n\t\t},\n\t\ttimeout: timeout,\n\t});\n}\n\nfunction apbct_public_sendREST( route, params ) {\n\n\tvar callback = params.callback || null;\n\n\tjQuery.ajax({\n\t\ttype: \"POST\",\n\t\turl: ctPublic._rest_url + 'cleantalk-antispam/v1/' + route,\n\t\tbeforeSend : function ( xhr ) {\n\t\t\txhr.setRequestHeader( 'X-WP-Nonce', ctPublic._rest_nonce );\n\t\t},\n\t\tsuccess: function(result){\n\t\t\tif(result.error){\n\t\t\t\talert('Error happens: ' + (result.error || 'Unknown'));\n\t\t\t}else{\n\t\t\t\tif(callback) {\n\t\t\t\t\tvar obj = null;\n\t\t\t\t\tcallback(result, route, params, obj);\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\terror: function(jqXHR, textStatus, errorThrown){\n\t\t\tif( errorThrown ) {\n\t\t\t\tconsole.log('APBCT_REST_ERROR');\n\t\t\t\tconsole.log(jqXHR);\n\t\t\t\tconsole.log(textStatus);\n\t\t\t\tconsole.log('Anti-spam by Cleantalk plugin error: ' + errorThrown + 'Please, contact Cleantalk tech support https://wordpress.org/support/plugin/cleantalk-spam-protect/');\n\t\t\t\talert('Anti-spam by Cleantalk plugin error: ' + errorThrown + 'Please, contact Cleantalk tech support https://wordpress.org/support/plugin/cleantalk-spam-protect/');\n\t\t\t}\n\t\t},\n\t});\n\n}\n\nif(typeof jQuery !== 'undefined') {\n\n\t// Capturing responses and output block message for unknown AJAX forms\n\tjQuery(document).ajaxComplete(function (event, xhr, settings) {\n\t\tif (xhr.responseText && xhr.responseText.indexOf('\"apbct') !== -1) {\n\t\t\tvar response = JSON.parse(xhr.responseText);\n\t\t\tif (typeof response.apbct !== 'undefined') {\n\t\t\t\tresponse = response.apbct;\n\t\t\t\tif (response.blocked) {\n\t\t\t\t\tdocument.dispatchEvent(\n\t\t\t\t\t\tnew CustomEvent( \"apbctAjaxBockAlert\", {\n\t\t\t\t\t\t\tbubbles: true,\n\t\t\t\t\t\t\tdetail: { message: response.comment }\n\t\t\t\t\t\t} )\n\t\t\t\t\t);\n\n\t\t\t\t\t// Create hidden element contains result.\n\t\t\t\t\tvar apbct_result = document.createElement( 'div' );\n\t\t\t\t\tapbct_result.setAttribute( 'id', 'apbct-result' );\n\t\t\t\t\tapbct_result.style.display = 'none';\n\t\t\t\t\tapbct_result.innerHTML = response.comment;\n\t\t\t\t\tdocument.body.append( apbct_result );\n\n\t\t\t\t\t// Show the element\n\t\t\t\t\tcleantalkModal.open('apbct-result');\n\n\t\t\t\t\tif(+response.stop_script == 1)\n\t\t\t\t\t\twindow.stop();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t});\n}"],"names":["ctSetCookie","c_name","value","document","cookie","encodeURIComponent","apbct_collect_visible_fields","form","key","inputs","inputs_visible","inputs_visible_count","inputs_with_duplicate_names","elements","isNaN","filter","elem","getComputedStyle","display","visibility","opacity","getAttribute","indexOf","push","forEach","i","visible_fields","trim","visible_fields_count","apbct_visible_fields_set_cookie","visible_fields_collection","collection","JSON","stringify","apbct_js_keys__set_input_value","result","data","params","obj","querySelectorAll","length","js_key","apbct_public_sendAJAX","callback","callback_context","callback_params","async","notJson","timeout","button","spinner","progressbar","silent","no_nonce","ctPublic","_ajax_nonce","Math","random","no_cache","setAttribute","style","cursor","jQuery","css","ajax","type","url","_ajax_url","success","removeAttribute","parse","error","setTimeout","fadeOut","alert","apply","concat","jqXHR","textStatus","errorThrown","console","log","apbct_public_sendREST","route","_rest_url","beforeSend","xhr","setRequestHeader","_rest_nonce","ct_date","Date","ctTimeMs","getTime","ctMouseEventTimerFlag","ctMouseData","ctMouseDataCounter","apbct_attach_event_handler","event","window","addEventListener","attachEvent","apbct_remove_event_handler","removeEventListener","detachEvent","floor","getTimezoneOffset","ctFunctionFirstKey","ctMouseReadInterval","setInterval","ctMouseWriteDataInterval","ctFunctionMouseMove","round","clientY","clientX","clearInterval","forms","classList","contains","parentElement","action","toString","id","name","onsubmit_prev","onsubmit","this","target","Function","call","ajaxComplete","settings","response","responseText","apbct","blocked","dispatchEvent","CustomEvent","bubbles","detail","message","comment","apbct_result","createElement","innerHTML","body","append","cleantalkModal","open","stop_script","stop"],"mappings":"AAgIA,SAASA,YAAYC,EAAQC,GAC5BC,SAASC,OAASH,EAAS,IAAMI,mBAAmBH,GAAS,yBAG9D,SAASI,6BAA8BC,GAGtC,IAKQC,EALJC,EAAS,GACZC,EAAiB,GACjBC,EAAuB,EACvBC,EAA8B,GAE/B,IAAQJ,KAAOD,EAAKM,SACfC,OAAON,KACVC,EAAOD,GAAOD,EAAKM,SAASL,IAqC9B,OAjCAC,EAASA,EAAOM,OAAO,SAASC,GAG/B,MAA0C,SAAtCC,iBAAiBD,GAAME,SACY,WAAtCD,iBAAiBD,GAAMG,YACe,MAAtCF,iBAAiBD,GAAMI,SACe,WAAtCJ,EAAKK,aAAa,SACoB,WAAtCL,EAAKK,aAAa,SAEoB,OAAtCL,EAAKK,aAAa,UACoD,IAAtET,EAA4BU,QAASN,EAAKK,aAAa,WAMxDV,KAGK,IAAM,CAAC,QAAS,YAAYW,QAASN,EAAKK,aAAa,WAC3DT,EAA4BW,KAAMP,EAAKK,aAAa,UAC7C,OAOFG,QAAQ,SAASR,EAAMS,EAAGZ,GAChCH,GAAkB,IAAMM,EAAKK,aAAa,UAIpC,CACNK,eAHDhB,EAAiBA,EAAeiB,OAI/BC,qBAAuBjB,GAKzB,SAASkB,gCAAiCC,GAErCC,EAAkD,iBAA9BD,GAAwE,OAA9BA,EAAsCA,EAA4B,GAEpI9B,YAAY,uBAAwBgC,KAAKC,UAAWF,IAIrD,SAASG,+BAA+BC,EAAQC,EAAMC,EAAQC,GAC7D,GAA6D,EAAzDnC,SAASoC,iBAAiB,sBAAsBC,OAEnD,IADA,IAAI3B,EAAWV,SAASoC,iBAAiB,sBAC/Bd,EAAI,EAAGA,EAAIZ,EAAS2B,OAAQf,IACrCZ,EAASY,GAAGvB,MAAQiC,EAAOM,OAI9B,SAASC,sBAAsBN,EAAMC,EAAQC,GAG5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iCH,GAG7BuE,EAAM6B,OAAOH,yBAAyBI,UACzCvD,WAAW,WACVyB,EAAM6B,OAAOH,cAAcK,KAAK/B,EAAM6B,OAAQ7B,IAC5C,OAKNpE,gCAAiCC,IAE/B,OA1HL,GA4SqB,oBAAXgC,QAGTA,OAAO3D,UAAU8H,aAAa,SAAUhC,EAAOX,EAAK4C,GACnD,IAGEC,GAHE7C,EAAI8C,eAAwD,IAAxC9C,EAAI8C,aAAa9G,QAAQ,gBAElB,KAD1B6G,EAAWnG,KAAKsC,MAAMgB,EAAI8C,eACVC,QACnBF,EAAWA,EAASE,OACPC,UACZnI,SAASoI,cACR,IAAIC,YAAa,qBAAsB,CACtCC,SAAS,EACTC,OAAQ,CAAEC,QAASR,EAASS,aAK1BC,EAAe1I,SAAS2I,cAAe,QAC9BnF,aAAc,KAAM,gBACjCkF,EAAajF,MAAM1C,QAAU,OAC7B2H,EAAaE,UAAYZ,EAASS,QAClCzI,SAAS6I,KAAKC,OAAQJ,GAGtBK,eAAeC,KAAK,gBAEQ,IAAxBhB,EAASiB,aACZlD,OAAOmD"}
|
1 |
+
{"version":3,"file":"apbct-public.min.js","sources":["apbct-public.js"],"sourcesContent":["(function() {\n\n\tvar ct_date = new Date(),\n\t\tctTimeMs = new Date().getTime(),\n\t\tctMouseEventTimerFlag = true, //Reading interval flag\n\t\tctMouseData = [],\n\t\tctMouseDataCounter = 0;\n\n\tfunction apbct_attach_event_handler(elem, event, callback){\n\t\tif(typeof window.addEventListener === \"function\") elem.addEventListener(event, callback);\n\t\telse elem.attachEvent(event, callback);\n\t}\n\n\tfunction apbct_remove_event_handler(elem, event, callback){\n\t\tif(typeof window.removeEventListener === \"function\") elem.removeEventListener(event, callback);\n\t\telse elem.detachEvent(event, callback);\n\t}\n\n\tctSetCookie(\"ct_ps_timestamp\", Math.floor(new Date().getTime()/1000));\n\tctSetCookie(\"ct_fkp_timestamp\", \"0\");\n\tctSetCookie(\"ct_pointer_data\", \"0\");\n\tctSetCookie(\"ct_timezone\", \"0\");\n\n\tsetTimeout(function(){\n\t\tctSetCookie(\"ct_timezone\", ct_date.getTimezoneOffset()/60*(-1));\n\t},1000);\n\n\t//Writing first key press timestamp\n\tvar ctFunctionFirstKey = function output(event){\n\t\tvar KeyTimestamp = Math.floor(new Date().getTime()/1000);\n\t\tctSetCookie(\"ct_fkp_timestamp\", KeyTimestamp);\n\t\tctKeyStopStopListening();\n\t};\n\n\t//Reading interval\n\tvar ctMouseReadInterval = setInterval(function(){\n\t\tctMouseEventTimerFlag = true;\n\t}, 150);\n\n\t//Writting interval\n\tvar ctMouseWriteDataInterval = setInterval(function(){\n\t\tctSetCookie(\"ct_pointer_data\", JSON.stringify(ctMouseData));\n\t}, 1200);\n\n\t//Logging mouse position each 150 ms\n\tvar ctFunctionMouseMove = function output(event){\n\t\tif(ctMouseEventTimerFlag === true){\n\n\t\t\tctMouseData.push([\n\t\t\t\tMath.round(event.clientY),\n\t\t\t\tMath.round(event.clientX),\n\t\t\t\tMath.round(new Date().getTime() - ctTimeMs)\n\t\t\t]);\n\n\t\t\tctMouseDataCounter++;\n\t\t\tctMouseEventTimerFlag = false;\n\t\t\tif(ctMouseDataCounter >= 50){\n\t\t\t\tctMouseStopData();\n\t\t\t}\n\t\t}\n\t};\n\n\t//Stop mouse observing function\n\tfunction ctMouseStopData(){\n\t\tapbct_remove_event_handler(window, \"mousemove\", ctFunctionMouseMove);\n\t\tclearInterval(ctMouseReadInterval);\n\t\tclearInterval(ctMouseWriteDataInterval);\n\t}\n\n\t//Stop key listening function\n\tfunction ctKeyStopStopListening(){\n\t\tapbct_remove_event_handler(window, \"mousedown\", ctFunctionFirstKey);\n\t\tapbct_remove_event_handler(window, \"keydown\", ctFunctionFirstKey);\n\t}\n\n\tapbct_attach_event_handler(window, \"mousemove\", ctFunctionMouseMove);\n\tapbct_attach_event_handler(window, \"mousedown\", ctFunctionFirstKey);\n\tapbct_attach_event_handler(window, \"keydown\", ctFunctionFirstKey);\n\n\t// Ready function\n\tfunction apbct_ready(){\n\n\t\tctSetCookie(\"apbct_visible_fields\", 0);\n\n\t\tsetTimeout(function(){\n\n\t\t\tvar visible_fields_collection = {};\n\n\t\t\tfor(var i = 0; i < document.forms.length; i++){\n\t\t\t\tvar form = document.forms[i];\n\n\t\t\t\t//Exclusion for forms\n\t\t\t\tif (\n\t\t\t\t\tform.classList.contains('slp_search_form') || //StoreLocatorPlus form\n\t\t\t\t\tform.parentElement.classList.contains('mec-booking') ||\n\t\t\t\t\tform.action.toString().indexOf('activehosted.com') !== -1 || // Active Campaign\n\t\t\t\t\t(form.id && form.id == 'caspioform') || //Caspio Form\n\t\t\t\t\t(form.name.classList && form.name.classList.contains('tinkoffPayRow')) || // TinkoffPayForm\n\t\t\t\t\t(form.name.classList && form.name.classList.contains('give-form ')) // GiveWP\n\t\t\t\t)\n\t\t\t\t\tcontinue;\n\n\t\t\t\tvisible_fields_collection[i] = apbct_collect_visible_fields( form );\n\n\t\t\t\tform.onsubmit_prev = form.onsubmit;\n\t\t\t\tform.onsubmit = function (event) {\n\n\t\t\t\t\tvar visible_fields = {};\n\t\t\t\t\tvisible_fields[0] = apbct_collect_visible_fields(this);\n\t\t\t\t\tapbct_visible_fields_set_cookie( visible_fields );\n\n\t\t\t\t\t// Call previous submit action\n\t\t\t\t\tif (event.target.onsubmit_prev instanceof Function) {\n\t\t\t\t\t\tsetTimeout(function () {\n\t\t\t\t\t\t\tevent.target.onsubmit_prev.call(event.target, event);\n\t\t\t\t\t\t}, 500);\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t}\n\n\t\t\tapbct_visible_fields_set_cookie( visible_fields_collection );\n\n\t\t}, 1000);\n\t}\n\tapbct_attach_event_handler(window, \"DOMContentLoaded\", apbct_ready);\n\n}());\n\nfunction ctSetCookie(c_name, value) {\n\tdocument.cookie = c_name + \"=\" + encodeURIComponent(value) + \"; path=/; samesite=lax\";\n}\n\nfunction apbct_collect_visible_fields( form ) {\n\n\t// Get only fields\n\tvar inputs = [],\n\t\tinputs_visible = '',\n\t\tinputs_visible_count = 0,\n\t\tinputs_with_duplicate_names = [];\n\n\tfor(var key in form.elements){\n\t\tif(!isNaN(+key))\n\t\t\tinputs[key] = form.elements[key];\n\t}\n\n\t// Filter fields\n\tinputs = inputs.filter(function(elem){\n\n\t\t// Filter fields\n\t\tif( getComputedStyle(elem).display === \"none\" || // hidden\n\t\t\tgetComputedStyle(elem).visibility === \"hidden\" || // hidden\n\t\t\tgetComputedStyle(elem).opacity === \"0\" || // hidden\n\t\t\telem.getAttribute(\"type\") === \"hidden\" || // type == hidden\n\t\t\telem.getAttribute(\"type\") === \"submit\" || // type == submit\n\t\t\t//elem.value === \"\" || // empty value\n\t\t\telem.getAttribute('name') === null ||\n\t\t\tinputs_with_duplicate_names.indexOf( elem.getAttribute('name') ) !== -1 // name already added\n\t\t){\n\t\t\treturn false;\n\t\t}\n\n\t\t// Visible fields count\n\t\tinputs_visible_count++;\n\n\t\t// Filter inputs with same names for type == radio\n\t\tif( -1 !== ['radio', 'checkbox'].indexOf( elem.getAttribute(\"type\") )){\n\t\t\tinputs_with_duplicate_names.push( elem.getAttribute('name') );\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t});\n\n\t// Visible fields\n\tinputs.forEach(function(elem, i, elements){\n\t\tinputs_visible += \" \" + elem.getAttribute(\"name\");\n\t});\n\tinputs_visible = inputs_visible.trim();\n\n\treturn {\n\t\tvisible_fields : inputs_visible,\n\t\tvisible_fields_count : inputs_visible_count,\n\t}\n\n}\n\nfunction apbct_visible_fields_set_cookie( visible_fields_collection ) {\n\n\tvar collection = typeof visible_fields_collection === 'object' && visible_fields_collection !== null ? visible_fields_collection : {};\n\n\tctSetCookie(\"apbct_visible_fields\", JSON.stringify( collection ) );\n\n}\n\nfunction apbct_js_keys__set_input_value(result, data, params, obj){\n\tif( document.querySelectorAll('[name^=ct_checkjs]').length > 0 ) {\n\t\tvar elements = document.querySelectorAll('[name^=ct_checkjs]');\n\t\tfor ( var i = 0; i < elements.length; i++ ) {\n\t\t\telements[i].value = result.js_key;\n\t\t}\n\t}\n}\nfunction apbct_public_sendAJAX(data, params, obj){\n\n\t// Default params\n\tvar callback = params.callback || null;\n\tvar callback_context = params.callback_context || null;\n\tvar callback_params = params.callback_params || null;\n\tvar async = params.async || true;\n\tvar notJson = params.notJson || null;\n\tvar timeout = params.timeout || 15000;\n\tvar obj = obj || null;\n\tvar button = params.button || null;\n\tvar spinner = params.spinner || null;\n\tvar progressbar = params.progressbar || null;\n\tvar silent = params.silent || null;\n\tvar no_nonce = params.no_nonce || null;\n\n\tif(typeof (data) === 'string') {\n\t\tif( ! no_nonce )\n\t\t\tdata = data + '&_ajax_nonce=' + ctPublic._ajax_nonce;\n\t\tdata = data + '&no_cache=' + Math.random()\n\t} else {\n\t\tif( ! no_nonce )\n\t\t\tdata._ajax_nonce = ctPublic._ajax_nonce;\n\t\tdata.no_cache = Math.random();\n\t}\n\t// Button and spinner\n\tif(button) {button.setAttribute('disabled', 'disabled'); button.style.cursor = 'not-allowed'; }\n\tif(spinner) jQuery(spinner).css('display', 'inline');\n\n\tjQuery.ajax({\n\t\ttype: \"POST\",\n\t\turl: ctPublic._ajax_url,\n\t\tdata: data,\n\t\tasync: async,\n\t\tsuccess: function(result){\n\t\t\tif(button){ button.removeAttribute('disabled'); button.style.cursor = 'pointer'; }\n\t\t\tif(spinner) jQuery(spinner).css('display', 'none');\n\t\t\tif(!notJson) result = JSON.parse(result);\n\t\t\tif(result.error){\n\t\t\t\tsetTimeout(function(){ if(progressbar) progressbar.fadeOut('slow'); }, 1000);\n\t\t\t\talert('Error happens: ' + (result.error || 'Unkown'));\n\t\t\t}else{\n\t\t\t\tif(callback) {\n\t\t\t\t\tif (callback_params)\n\t\t\t\t\t\tcallback.apply( callback_context, callback_params.concat( result, data, params, obj ) );\n\t\t\t\t\telse\n\t\t\t\t\t\tcallback(result, data, params, obj);\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\terror: function(jqXHR, textStatus, errorThrown){\n\t\t\tif(button){ button.removeAttribute('disabled'); button.style.cursor = 'pointer'; }\n\t\t\tif(spinner) jQuery(spinner).css('display', 'none');\n\t\t\tif( errorThrown && ! silent ) {\n\t\t\t\tconsole.log('APBCT_AJAX_ERROR');\n\t\t\t\tconsole.log(jqXHR);\n\t\t\t\tconsole.log(textStatus);\n\t\t\t\tconsole.log('Anti-spam by Cleantalk plugin error: ' + errorThrown + 'Please, contact Cleantalk tech support https://wordpress.org/support/plugin/cleantalk-spam-protect/');\n\t\t\t}\n\t\t},\n\t\ttimeout: timeout,\n\t});\n}\n\nfunction apbct_public_sendREST( route, params ) {\n\n\tvar callback = params.callback || null;\n\n\tjQuery.ajax({\n\t\ttype: \"POST\",\n\t\turl: ctPublic._rest_url + 'cleantalk-antispam/v1/' + route,\n\t\tbeforeSend : function ( xhr ) {\n\t\t\txhr.setRequestHeader( 'X-WP-Nonce', ctPublic._rest_nonce );\n\t\t},\n\t\tsuccess: function(result){\n\t\t\tif(result.error){\n\t\t\t\talert('Error happens: ' + (result.error || 'Unknown'));\n\t\t\t}else{\n\t\t\t\tif(callback) {\n\t\t\t\t\tvar obj = null;\n\t\t\t\t\tcallback(result, route, params, obj);\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\terror: function(jqXHR, textStatus, errorThrown){\n\t\t\tif( errorThrown ) {\n\t\t\t\tconsole.log('APBCT_REST_ERROR');\n\t\t\t\tconsole.log(jqXHR);\n\t\t\t\tconsole.log(textStatus);\n\t\t\t\tconsole.log('Anti-spam by Cleantalk plugin error: ' + errorThrown + 'Please, contact Cleantalk tech support https://wordpress.org/support/plugin/cleantalk-spam-protect/');\n\t\t\t\talert('Anti-spam by Cleantalk plugin error: ' + errorThrown + 'Please, contact Cleantalk tech support https://wordpress.org/support/plugin/cleantalk-spam-protect/');\n\t\t\t}\n\t\t},\n\t});\n\n}\n\nif(typeof jQuery !== 'undefined') {\n\n\t// Capturing responses and output block message for unknown AJAX forms\n\tjQuery(document).ajaxComplete(function (event, xhr, settings) {\n\t\tif (xhr.responseText && xhr.responseText.indexOf('\"apbct') !== -1) {\n\t\t\tvar response = JSON.parse(xhr.responseText);\n\t\t\tif (typeof response.apbct !== 'undefined') {\n\t\t\t\tresponse = response.apbct;\n\t\t\t\tif (response.blocked) {\n\t\t\t\t\tdocument.dispatchEvent(\n\t\t\t\t\t\tnew CustomEvent( \"apbctAjaxBockAlert\", {\n\t\t\t\t\t\t\tbubbles: true,\n\t\t\t\t\t\t\tdetail: { message: response.comment }\n\t\t\t\t\t\t} )\n\t\t\t\t\t);\n\n\t\t\t\t\t// Show the result by modal\n\t\t\t\t\tcleantalkModal.loaded = response.comment;\n\t\t\t\t\tcleantalkModal.open();\n\n\t\t\t\t\tif(+response.stop_script == 1)\n\t\t\t\t\t\twindow.stop();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t});\n}"],"names":["ctSetCookie","c_name","value","document","cookie","encodeURIComponent","apbct_collect_visible_fields","form","key","inputs","inputs_visible","inputs_visible_count","inputs_with_duplicate_names","elements","isNaN","filter","elem","getComputedStyle","display","visibility","opacity","getAttribute","indexOf","push","forEach","i","visible_fields","trim","visible_fields_count","apbct_visible_fields_set_cookie","visible_fields_collection","collection","JSON","stringify","apbct_js_keys__set_input_value","result","data","params","obj","querySelectorAll","length","js_key","apbct_public_sendAJAX","callback","callback_context","callback_params","async","notJson","timeout","button","spinner","progressbar","silent","no_nonce","ctPublic","_ajax_nonce","Math","random","no_cache","setAttribute","style","cursor","jQuery","css","ajax","type","url","_ajax_url","success","removeAttribute","parse","error","setTimeout","fadeOut","alert","apply","concat","jqXHR","textStatus","errorThrown","console","log","apbct_public_sendREST","route","_rest_url","beforeSend","xhr","setRequestHeader","_rest_nonce","ct_date","Date","ctTimeMs","getTime","ctMouseEventTimerFlag","ctMouseData","ctMouseDataCounter","apbct_attach_event_handler","event","window","addEventListener","attachEvent","apbct_remove_event_handler","removeEventListener","detachEvent","floor","getTimezoneOffset","ctFunctionFirstKey","ctMouseReadInterval","setInterval","ctMouseWriteDataInterval","ctFunctionMouseMove","round","clientY","clientX","clearInterval","forms","classList","contains","parentElement","action","toString","id","name","onsubmit_prev","onsubmit","this","target","Function","call","ajaxComplete","settings","responseText","response","apbct","blocked","dispatchEvent","CustomEvent","bubbles","detail","message","comment","cleantalkModal","loaded","open","stop_script","stop"],"mappings":"AAgIA,SAASA,YAAYC,EAAQC,GAC5BC,SAASC,OAASH,EAAS,IAAMI,mBAAmBH,GAAS,yBAG9D,SAASI,6BAA8BC,GAGtC,IAKQC,EALJC,EAAS,GACZC,EAAiB,GACjBC,EAAuB,EACvBC,EAA8B,GAE/B,IAAQJ,KAAOD,EAAKM,SACfC,OAAON,KACVC,EAAOD,GAAOD,EAAKM,SAASL,IAqC9B,OAjCAC,EAASA,EAAOM,OAAO,SAASC,GAG/B,MAA0C,SAAtCC,iBAAiBD,GAAME,SACY,WAAtCD,iBAAiBD,GAAMG,YACe,MAAtCF,iBAAiBD,GAAMI,SACe,WAAtCJ,EAAKK,aAAa,SACoB,WAAtCL,EAAKK,aAAa,SAEoB,OAAtCL,EAAKK,aAAa,UACoD,IAAtET,EAA4BU,QAASN,EAAKK,aAAa,WAMxDV,KAGK,IAAM,CAAC,QAAS,YAAYW,QAASN,EAAKK,aAAa,WAC3DT,EAA4BW,KAAMP,EAAKK,aAAa,UAC7C,OAOFG,QAAQ,SAASR,EAAMS,EAAGZ,GAChCH,GAAkB,IAAMM,EAAKK,aAAa,UAIpC,CACNK,eAHDhB,EAAiBA,EAAeiB,OAI/BC,qBAAuBjB,GAKzB,SAASkB,gCAAiCC,GAErCC,EAAkD,iBAA9BD,GAAwE,OAA9BA,EAAsCA,EAA4B,GAEpI9B,YAAY,uBAAwBgC,KAAKC,UAAWF,IAIrD,SAASG,+BAA+BC,EAAQC,EAAMC,EAAQC,GAC7D,GAA6D,EAAzDnC,SAASoC,iBAAiB,sBAAsBC,OAEnD,IADA,IAAI3B,EAAWV,SAASoC,iBAAiB,sBAC/Bd,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KqH,SAAW,SAAU3B,GAEzB,IAAIvE,EAAiB,GACrBA,EAAe,GAAKpB,6BAA6BuH,MACjDhG,gCAAiCH,GAG7BuE,EAAM6B,OAAOH,yBAAyBI,UACzCvD,WAAW,WACVyB,EAAM6B,OAAOH,cAAcK,KAAK/B,EAAM6B,OAAQ7B,IAC5C,OAKNpE,gCAAiCC,IAE/B,OA1HL,GA2SqB,oBAAXgC,QAGTA,OAAO3D,UAAU8H,aAAa,SAAUhC,EAAOX,EAAK4C,IAC/C5C,EAAI6C,eAAwD,IAAxC7C,EAAI6C,aAAa7G,QAAQ,gBAElB,KAD1B8G,EAAWpG,KAAKsC,MAAMgB,EAAI6C,eACVE,QACnBD,EAAWA,EAASC,OACPC,UACZnI,SAASoI,cACR,IAAIC,YAAa,qBAAsB,CACtCC,SAAS,EACTC,OAAQ,CAAEC,QAASP,EAASQ,YAK9BC,eAAeC,OAASV,EAASQ,QACjCC,eAAeE,OAEa,IAAxBX,EAASY,aACZ9C,OAAO+C"}
|
readme.txt
CHANGED
@@ -4,7 +4,7 @@ Tags: spam, antispam, anti-spam, comments, firewall
|
|
4 |
Requires at least: 3.0
|
5 |
Tested up to: 5.7
|
6 |
Requires PHP: 5.4
|
7 |
-
Stable tag: 5.155.
|
8 |
License: GPLv2
|
9 |
|
10 |
Spam protection, anti-spam, firewall, premium plugin. No spam comments & users, no spam contact form & WooCommerce anti-spam.
|
@@ -580,6 +580,11 @@ If your website has forms that send data to external sources, you can enable opt
|
|
580 |
|
581 |
== Changelog ==
|
582 |
|
|
|
|
|
|
|
|
|
|
|
583 |
= 5.155.1 Apr 2 2021 =
|
584 |
* Fix: Using WP Rest API.
|
585 |
* Rollback: Show response for all AJAX forms.
|
4 |
Requires at least: 3.0
|
5 |
Tested up to: 5.7
|
6 |
Requires PHP: 5.4
|
7 |
+
Stable tag: 5.155.2
|
8 |
License: GPLv2
|
9 |
|
10 |
Spam protection, anti-spam, firewall, premium plugin. No spam comments & users, no spam contact form & WooCommerce anti-spam.
|
580 |
|
581 |
== Changelog ==
|
582 |
|
583 |
+
= 5.155.2 Apr 6 2021 =
|
584 |
+
* Fix: Renaming setting to their original names in old update scripts.
|
585 |
+
* Fix: Ajax forms protection response fixed.
|
586 |
+
* Fix: No alert message when AJAX error happens.
|
587 |
+
|
588 |
= 5.155.1 Apr 2 2021 =
|
589 |
* Fix: Using WP Rest API.
|
590 |
* Rollback: Show response for all AJAX forms.
|