PluginProbe
Image Optimizer – Compress Images and Convert to WebP or AVIF / trunk
Image Optimizer – Compress Images and Convert to WebP or AVIF vtrunk
1.7.7 1.7.6 1.7.5 1.7.4 trunk 1.0.0 1.0.1 1.0.2 1.1.0 1.2.0 1.2.1 1.3.0 1.4.0 1.4.1 1.5.0 1.5.1 1.5.2 1.5.3 1.5.4 1.6.0 1.6.1 1.6.2 1.6.3 1.6.4 1.6.5 All 33 releases
← All changes | vendor/woocommerce/action-scheduler/classes/ActionScheduler_AdminView.php +48 -23 1.5.4 → trunk View file →
@@ -1,22 +1,37 @@
1 1 <?php
2 2
3 3 /**
4 4 * Class ActionScheduler_AdminView
5 + *
5 6 * @codeCoverageIgnore
6 7 */
7 8 class ActionScheduler_AdminView extends ActionScheduler_AdminView_Deprecated {
8 9
9 - /** @var null|self */
10 - private static $admin_view = NULL;
10 + /**
11 + * Instance.
12 + *
13 + * @var null|self
14 + */
15 + private static $admin_view = null;
11 16
12 - /** @var string */
17 + /**
18 + * Screen ID.
19 + *
20 + * @var string
21 + */
13 22 private static $screen_id = 'tools_page_action-scheduler';
14 23
15 - /** @var ActionScheduler_ListTable */
24 + /**
25 + * ActionScheduler_ListTable instance.
26 + *
27 + * @var ActionScheduler_ListTable
28 + */
16 29 protected $list_table;
17 30
18 31 /**
32 + * Get instance.
33 + *
19 34 * @return ActionScheduler_AdminView
20 35 * @codeCoverageIgnore
21 36 */
22 37 public static function instance() {
@@ -21,9 +36,9 @@
21 36 */
22 37 public static function instance() {
23 38
24 39 if ( empty( self::$admin_view ) ) {
25 - $class = apply_filters('action_scheduler_admin_view_class', 'ActionScheduler_AdminView');
40 + $class = apply_filters( 'action_scheduler_admin_view_class', 'ActionScheduler_AdminView' );
26 41 self::$admin_view = new $class();
27 42 }
28 43
29 44 return self::$admin_view;
@@ -34,9 +49,9 @@
34 49 *
35 50 * @codeCoverageIgnore
36 51 */
37 52 public function init() {
38 - if ( is_admin() && ( ! defined( 'DOING_AJAX' ) || false == DOING_AJAX ) ) {
53 + if ( is_admin() && ( ! defined( 'DOING_AJAX' ) || ! DOING_AJAX ) ) {
39 54
40 55 if ( class_exists( 'WooCommerce' ) ) {
41 56 add_action( 'woocommerce_admin_status_content_action-scheduler', array( $this, 'render_admin_ui' ) );
42 57 add_action( 'woocommerce_system_status_report', array( $this, 'system_status_report' ) );
@@ -84,9 +99,9 @@
84 99 'manage_options',
85 100 'action-scheduler',
86 101 array( $this, 'render_admin_ui' )
87 102 );
88 - add_action( 'load-' . $hook_suffix , array( $this, 'process_admin_ui' ) );
103 + add_action( 'load-' . $hook_suffix, array( $this, 'process_admin_ui' ) );
89 104 }
90 105
91 106 /**
92 107 * Triggers processing of any pending actions.
@@ -144,10 +159,8 @@
144 159 }
145 160
146 161 /**
147 162 * Check past-due actions, and print notice.
148 - *
149 - * @todo update $link_url to "Past-due" filter when released (see issue #510, PR #511)
150 163 */
151 164 protected function check_pastdue_actions() {
152 165
153 166 // Set thresholds.
@@ -173,9 +186,9 @@
173 186 );
174 187
175 188 // If no third-party preempted, run default check.
176 189 if ( is_null( $check ) ) {
177 - $store = ActionScheduler_Store::instance();
190 + $store = ActionScheduler_Store::instance();
178 191 $num_pastdue_actions = (int) $store->query_actions( $query_args, 'count' );
179 192
180 193 // Check if past-due actions count is greater than or equal to threshold.
181 194 $check = ( $num_pastdue_actions >= $threshold_min );
@@ -189,25 +202,37 @@
189 202
190 203 return;
191 204 }
192 205
193 - $actions_url = add_query_arg( array(
194 - 'page' => 'action-scheduler',
195 - 'status' => 'past-due',
196 - 'order' => 'asc',
197 - ), admin_url( 'tools.php' ) );
206 + $actions_url = add_query_arg(
207 + array(
208 + 'page' => 'action-scheduler',
209 + 'status' => 'past-due',
210 + 'order' => 'asc',
211 + ),
212 + admin_url( 'tools.php' )
213 + );
198 214
199 215 // Print notice.
200 216 echo '<div class="notice notice-warning"><p>';
201 217 printf(
202 - // translators: 1) is the number of affected actions, 2) is a link to an admin screen.
203 - _n(
204 - '<strong>Action Scheduler:</strong> %1$d <a href="%2$s">past-due action</a> found; something may be wrong. <a href="https://actionscheduler.org/faq/#my-site-has-past-due-actions-what-can-i-do" target="_blank">Read documentation &raquo;</a>',
205 - '<strong>Action Scheduler:</strong> %1$d <a href="%2$s">past-due actions</a> found; something may be wrong. <a href="https://actionscheduler.org/faq/#my-site-has-past-due-actions-what-can-i-do" target="_blank">Read documentation &raquo;</a>',
206 - $num_pastdue_actions,
207 - 'action-scheduler'
218 + wp_kses(
219 + // translators: 1) is the number of affected actions, 2) is a link to an admin screen.
220 + _n(
221 + '<strong>Action Scheduler:</strong> %1$d <a href="%2$s">past-due action</a> found; something may be wrong. <a href="https://actionscheduler.org/faq/#my-site-has-past-due-actions-what-can-i-do" target="_blank">Read documentation &raquo;</a>',
222 + '<strong>Action Scheduler:</strong> %1$d <a href="%2$s">past-due actions</a> found; something may be wrong. <a href="https://actionscheduler.org/faq/#my-site-has-past-due-actions-what-can-i-do" target="_blank">Read documentation &raquo;</a>',
223 + $num_pastdue_actions,
224 + 'action-scheduler'
225 + ),
226 + array(
227 + 'strong' => array(),
228 + 'a' => array(
229 + 'href' => true,
230 + 'target' => true,
231 + ),
232 + )
208 233 ),
209 - $num_pastdue_actions,
234 + absint( $num_pastdue_actions ),
210 235 esc_attr( esc_url( $actions_url ) )
211 236 );
212 237 echo '</p></div>';
213 238
@@ -220,9 +245,9 @@
220 245 */
221 246 public function add_help_tabs() {
222 247 $screen = get_current_screen();
223 248
224 - if ( ! $screen || self::$screen_id != $screen->id ) {
249 + if ( ! $screen || self::$screen_id !== $screen->id ) {
225 250 return;
226 251 }
227 252
228 253 $as_version = ActionScheduler_Versions::instance()->latest_version();