PluginProbe
Content Control – The Ultimate Content Restriction Plugin! Restrict Content, Create Conditional Blocks & More / 2.6.1
Content Control – The Ultimate Content Restriction Plugin! Restrict Content, Create Conditional Blocks & More v2.6.1
trunk 1.0.0 1.0.1 1.0.2 1.0.3 1.1.0 1.1.1 1.1.10 1.1.2 1.1.3 1.1.4 1.1.5 1.1.6 1.1.7 1.1.8 2.0.0 2.0.1 2.0.10 2.0.11 2.0.12 2.0.2 2.0.3 2.0.4 2.0.5 2.0.6 All 47 releases
← All changes | classes/Controllers/Admin/Reviews.php +12 -6 2.0.42.6.1 View file →
@@ -24,9 +24,9 @@
24 24
25 25 /**
26 26 * Enable debug mode.
27 27 *
28 - * @var boolean|array
28 + * @var boolean
29 29 */
30 30 private $debug = false;
31 31
32 32 /**
@@ -31,9 +31,9 @@
31 31
32 32 /**
33 33 * Debug trigger.
34 34 *
35 - * @var array
35 + * @var array{group:string,code:string}
36 36 */
37 37 private $debug_trigger = [
38 38 'group' => 'time_installed',
39 39 'code' => 'one_week',
@@ -55,8 +55,10 @@
55 55 }
56 56
57 57 /**
58 58 * Hook into relevant WP actions.
59 + *
60 + * @return void
59 61 */
60 62 public function hooks() {
61 63 if ( is_admin() && current_user_can( 'manage_options' ) ) {
62 64 $this->installed_on();
@@ -83,8 +85,10 @@
83 85 }
84 86
85 87 /**
86 88 * AJAX Handler
89 + *
90 + * @return void
87 91 */
88 92 public function ajax_handler() {
89 93 // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
90 94 if ( ! isset( $_REQUEST['nonce'] ) || ! wp_verify_nonce( wp_unslash( $_REQUEST['nonce'] ), 'content_control_review_action' ) ) {
@@ -132,9 +136,9 @@
132 136 public function get_trigger_group() {
133 137 static $selected;
134 138
135 139 if ( $this->debug ) {
136 - return isset( $this->debug_trigger['group'] ) ? $this->debug_trigger['group'] : 'time_installed';
140 + return ! empty( $this->debug_trigger['group'] ) ? $this->debug_trigger['group'] : 'time_installed';
137 141 }
138 142
139 143 if ( ! isset( $selected ) ) {
140 144 $dismissed_triggers = $this->dismissed_triggers();
@@ -166,9 +170,9 @@
166 170 public function get_trigger_code() {
167 171 static $selected;
168 172
169 173 if ( $this->debug ) {
170 - return isset( $this->debug_trigger['code'] ) ? $this->debug_trigger['code'] : 'one_week';
174 + return ! empty( $this->debug_trigger['code'] ) ? $this->debug_trigger['code'] : 'one_week';
171 175 }
172 176
173 177 if ( ! isset( $selected ) ) {
174 178 $dismissed_triggers = $this->dismissed_triggers();
@@ -356,8 +360,10 @@
356 360 }
357 361
358 362 /**
359 363 * Render admin notices if available.
364 + *
365 + * @return void
360 366 */
361 367 public function admin_notices() {
362 368 if ( $this->hide_notices() ) {
363 369 return;
@@ -549,10 +555,10 @@
549 555
550 556 /**
551 557 * Sort array in reverse by priority value
552 558 *
553 - * @param array $a First array to compare.
554 - * @param array $b Second array to compare.
559 + * @param array{pri:int|null} $a First array to compare.
560 + * @param array{pri:int|null} $b Second array to compare.
555 561 *
556 562 * @return int
557 563 */
558 564 public function rsort_by_priority( $a, $b ) {