PluginProbe
Hostinger Tools / 3.0.3
Hostinger Tools v3.0.3
3.0.77 3.0.76 3.0.75 3.0.74 3.0.73 3.0.72 3.0.71 3.0.70 3.0.69 3.0.68 3.0.67 3.0.66 1.8.1 1.8.2 1.8.3 1.9.1 1.9.4 1.9.5 1.9.6 1.9.7 1.9.8 1.9.9 2.0.0 2.0.1 2.0.4 All 108 releases
← All changes | includes/Admin/Ajax.php +20 -20 3.0.773.0.3 View file →
@@ -4,32 +4,32 @@
4 4
5 5 defined( 'ABSPATH' ) || exit;
6 6
7 7 class Ajax {
8 - private const TWO_DAYS = 86400 * 2;
9 - public const AJAX_METHOD_PREFIX = 'wp_ajax_hostinger_';
10 - public const HIDE_PLUGIN_SPLIT_NOTICE = 'hts_plugin_split_notice_hidden';
8 + private const TWO_DAYS = 86400 * 2;
9 + public const AJAX_METHOD_PREFIX = 'wp_ajax_hostinger_';
10 + public const HIDE_PLUGIN_SPLIT_NOTICE = 'hts_plugin_split_notice_hidden';
11 11
12 12 public const AJAX_EVENTS = array(
13 13 'dismiss_plugin_split_notice',
14 14 );
15 15
16 - public function __construct() {
17 - add_action( 'admin_init', array( $this, 'define_ajax_events' ), 0 );
18 - }
16 + public function __construct() {
17 + add_action( 'admin_init', array( $this, 'define_ajax_events' ), 0 );
18 + }
19 19
20 - public function define_ajax_events(): void {
21 - foreach ( self::AJAX_EVENTS as $event ) {
22 - add_action( self::AJAX_METHOD_PREFIX . $event, array( $this, $event ) );
23 - }
24 - }
20 + public function define_ajax_events(): void {
21 + foreach ( self::AJAX_EVENTS as $event ) {
22 + add_action( self::AJAX_METHOD_PREFIX . $event, array( $this, $event ) );
23 + }
24 + }
25 25
26 - public function dismiss_plugin_split_notice(): void {
27 - $nonce = isset( $_POST['nonce'] ) ? sanitize_text_field( $_POST['nonce'] ) : '';
28 - // @codeCoverageIgnoreStart
29 - if ( ! wp_verify_nonce( $nonce, 'hts_close_plugin_split' ) ) {
30 - wp_send_json_error( 'Invalid nonce' );
31 - }
32 - // @codeCoverageIgnoreEnd
33 - update_option( self::HIDE_PLUGIN_SPLIT_NOTICE, true );
34 - }
26 + public function dismiss_plugin_split_notice(): void {
27 + $nonce = isset( $_POST['nonce'] ) ? sanitize_text_field( $_POST['nonce'] ) : '';
28 + // @codeCoverageIgnoreStart
29 + if ( ! wp_verify_nonce( $nonce, 'hts_close_plugin_split' ) ) {
30 + wp_send_json_error( 'Invalid nonce' );
31 + }
32 + // @codeCoverageIgnoreEnd
33 + set_transient( self::HIDE_PLUGIN_SPLIT_NOTICE, true, self::TWO_DAYS );
34 + }
35 35 }