Plugin Directory

Changeset 3813397


Ignore:
Timestamp:
11/20/2026 10:02:12 AM (less than one hour ago)
Author:
shahidirfan100
Message:

Release 1.0.6

Location:
schedsense-fast-diagnostics-for-action-scheduler
Files:
50 added
18 edited
7 copied

Legend:

Unmodified
Added
Removed
  • schedsense-fast-diagnostics-for-action-scheduler/tags/1.0.6/admin/views/failures.php

    r3718291 r3813397  
    11<?php
    2 /** @package SchedSense */
     2/**
     3 * Filtered queue list and individual failed-action controls.
     4 *
     5 * @package SchedSense
     6 */
     7
    38defined( 'ABSPATH' ) || exit;
    4 $schedsense_age_labels = array(
     9$schedsense_age_labels  = array(
    510        'under_1h' => __( 'Under 1 hour', 'schedsense-fast-diagnostics-for-action-scheduler' ),
    611        '1_to_6h'  => __( '1–6 hours', 'schedsense-fast-diagnostics-for-action-scheduler' ),
    … …  
    6368                ?>
    6469                <tr><td colspan="10"><?php echo esc_html__( 'No matching actions found.', 'schedsense-fast-diagnostics-for-action-scheduler' ); ?></td></tr><?php endif; ?>
    65         <?php foreach ( $failure_data['actions'] as $action ) : ?>
     70        <?php foreach ( $failure_data['actions'] as $schedsense_action ) : ?>
    6671                <?php
    67                 $schedsense_scheduled_in_future = $action['scheduled'] > time();
    68                 $schedsense_age_display         = ! $action['scheduled'] ? '—' : human_time_diff( $schedsense_scheduled_in_future ? time() : $action['scheduled'], $schedsense_scheduled_in_future ? $action['scheduled'] : time() );
    69                 if ( $schedsense_scheduled_in_future && $action['scheduled'] ) {
     72                $schedsense_scheduled_in_future = $schedsense_action['scheduled'] > time();
     73                $schedsense_age_display         = ! $schedsense_action['scheduled'] ? '—' : human_time_diff( $schedsense_scheduled_in_future ? time() : $schedsense_action['scheduled'], $schedsense_scheduled_in_future ? $schedsense_action['scheduled'] : time() );
     74                if ( $schedsense_scheduled_in_future && $schedsense_action['scheduled'] ) {
    7075                        /* translators: %s: Time until the action is scheduled. */
    7176                        $schedsense_age_display = sprintf( __( 'In %s', 'schedsense-fast-diagnostics-for-action-scheduler' ), $schedsense_age_display );
    72                 } elseif ( $action['scheduled'] ) {
     77                } elseif ( $schedsense_action['scheduled'] ) {
    7378                        /* translators: %s: Time since the action was scheduled. */
    7479                        $schedsense_age_display = sprintf( __( '%s ago', 'schedsense-fast-diagnostics-for-action-scheduler' ), $schedsense_age_display );
    7580                }
    76                 $schedsense_next_step = 'failed' === $action['status']
     81                $schedsense_next_step = 'failed' === $schedsense_action['status']
    7782                        ? __( 'Review callback failure', 'schedsense-fast-diagnostics-for-action-scheduler' )
    78                         : ( 'not_due' === $action['age_bucket']
     83                        : ( 'not_due' === $schedsense_action['age_bucket']
    7984                                ? __( 'No action needed yet', 'schedsense-fast-diagnostics-for-action-scheduler' )
    80                                 : ( 'in-progress' === $action['status']
     85                                : ( 'in-progress' === $schedsense_action['status']
    8186                                        ? __( 'Check worker activity', 'schedsense-fast-diagnostics-for-action-scheduler' )
    8287                                        : __( 'Check queue source and cron', 'schedsense-fast-diagnostics-for-action-scheduler' ) ) );
    8388                ?>
    84                 <tr><td class="schedsense-action-cell">#<?php echo esc_html( $action['id'] ); ?>
    85                         <?php if ( 'failed' === $action['status'] ) : ?>
     89                <tr><td class="schedsense-action-cell">#<?php echo esc_html( $schedsense_action['id'] ); ?>
     90                        <?php if ( 'failed' === $schedsense_action['status'] ) : ?>
    8691                                <form action="<?php echo esc_url( admin_url( 'admin-post.php' ) ); ?>" method="post" class="schedsense-delete-form" data-schedsense-confirm="<?php echo esc_attr__( 'Delete this failed action record? This cannot be undone and will not fix or retry its callback.', 'schedsense-fast-diagnostics-for-action-scheduler' ); ?>">
    8792                                        <input type="hidden" name="action" value="schedsense_delete_failed_action">
    88                                         <input type="hidden" name="action_id" value="<?php echo esc_attr( $action['id'] ); ?>">
     93                                        <input type="hidden" name="action_id" value="<?php echo esc_attr( $schedsense_action['id'] ); ?>">
    8994                                        <input type="hidden" name="hook" value="<?php echo esc_attr( $failure_data['hook'] ); ?>">
    9095                                        <input type="hidden" name="group" value="<?php echo esc_attr( $failure_data['group'] ); ?>">
    … …  
    9499                                        $schedsense_delete_label = __( 'Delete failed action #%s', 'schedsense-fast-diagnostics-for-action-scheduler' );
    95100                                        ?>
    96                                         <button type="submit" class="schedsense-delete-button button-link-delete" aria-label="<?php echo esc_attr( sprintf( $schedsense_delete_label, $action['id'] ) ); ?>"><?php echo esc_html__( 'Delete', 'schedsense-fast-diagnostics-for-action-scheduler' ); ?></button>
     101                                        <button type="submit" class="schedsense-delete-button button-link-delete" aria-label="<?php echo esc_attr( sprintf( $schedsense_delete_label, $schedsense_action['id'] ) ); ?>"><?php echo esc_html__( 'Delete', 'schedsense-fast-diagnostics-for-action-scheduler' ); ?></button>
    97102                                </form>
    98103                        <?php endif; ?>
    99                 </td><td><code><?php echo esc_html( $action['hook'] ); ?></code></td><td><?php echo esc_html( $action['source']['name'] ); ?><small><?php echo esc_html( ucfirst( $action['source']['confidence'] ) ); ?></small></td><td><?php echo esc_html( ! empty( $action['group'] ) ? $action['group'] : '—' ); ?></td><td><?php echo esc_html( $action['scheduled'] ? wp_date( 'Y-m-d H:i:s', $action['scheduled'] ) : '—' ); ?></td><td><span class="schedsense-pill"><?php echo esc_html( $action['status'] ); ?></span></td><td><?php echo esc_html( $action['recurring'] ? __( 'Recurring', 'schedsense-fast-diagnostics-for-action-scheduler' ) : __( 'One-time', 'schedsense-fast-diagnostics-for-action-scheduler' ) ); ?></td><td><?php echo esc_html( $schedsense_age_display ); ?></td><td><?php echo esc_html( isset( $schedsense_age_labels[ $action['age_bucket'] ] ) ? $schedsense_age_labels[ $action['age_bucket'] ] : __( 'Unavailable', 'schedsense-fast-diagnostics-for-action-scheduler' ) ); ?></td><td><?php echo esc_html( $schedsense_next_step ); ?></td></tr>
     104                </td><td><code><?php echo esc_html( $schedsense_action['hook'] ); ?></code></td><td><?php echo esc_html( $schedsense_action['source']['name'] ); ?><small><?php echo esc_html( ucfirst( $schedsense_action['source']['confidence'] ) ); ?></small></td><td><?php echo esc_html( ! empty( $schedsense_action['group'] ) ? $schedsense_action['group'] : '—' ); ?></td><td><?php echo esc_html( $schedsense_action['scheduled'] ? wp_date( 'Y-m-d H:i:s', $schedsense_action['scheduled'] ) : '—' ); ?></td><td><span class="schedsense-pill"><?php echo esc_html( $schedsense_action['status'] ); ?></span></td><td><?php echo esc_html( $schedsense_action['recurring'] ? __( 'Recurring', 'schedsense-fast-diagnostics-for-action-scheduler' ) : __( 'One-time', 'schedsense-fast-diagnostics-for-action-scheduler' ) ); ?></td><td><?php echo esc_html( $schedsense_age_display ); ?></td><td><?php echo esc_html( isset( $schedsense_age_labels[ $schedsense_action['age_bucket'] ] ) ? $schedsense_age_labels[ $schedsense_action['age_bucket'] ] : __( 'Unavailable', 'schedsense-fast-diagnostics-for-action-scheduler' ) ); ?></td><td><?php echo esc_html( $schedsense_next_step ); ?></td></tr>
    100105        <?php endforeach; ?>
    101106        </tbody></table></div>
    … …  
    106111                        paginate_links(
    107112                                array(
    108                                         'base'    => wp_nonce_url( add_query_arg( 'paged', '%#%' ), 'schedsense_view' ),
     113                                        'base'    => add_query_arg(
     114                                                array(
     115                                                        '_wpnonce' => wp_create_nonce( 'schedsense_view' ),
     116                                                        'paged'    => '%#%',
     117                                                )
     118                                        ),
    109119                                        'format'  => '',
    110120                                        'current' => $failure_data['page'],
  • schedsense-fast-diagnostics-for-action-scheduler/tags/1.0.6/admin/views/notice.php

    r3718291 r3813397  
    11<?php
    2 /** @package SchedSense */
     2/**
     3 * Feedback after diagnostics or queue-record actions.
     4 *
     5 * @package SchedSense
     6 */
     7
    38defined( 'ABSPATH' ) || exit;
    49
    510$schedsense_messages = array(
    6         'refreshed'        => __( 'Diagnostics refreshed.', 'schedsense-fast-diagnostics-for-action-scheduler' ),
    7         'cache-cleared'    => __( 'SchedSense caches cleared.', 'schedsense-fast-diagnostics-for-action-scheduler' ),
    8         'cron-spawned'     => __( 'WordPress accepted a standard cron spawn request. This does not prove that every queued callback completed.', 'schedsense-fast-diagnostics-for-action-scheduler' ),
    9         'cron-not-spawned' => __( 'WordPress did not start another cron spawn. A cron process may already be running or spawning may be unavailable.', 'schedsense-fast-diagnostics-for-action-scheduler' ),
    10         'action-deleted'   => __( 'Failed action record deleted. This does not repair or retry its callback.', 'schedsense-fast-diagnostics-for-action-scheduler' ),
    11         'action-no-longer-failed' => __( 'This action is no longer failed, so it was not deleted.', 'schedsense-fast-diagnostics-for-action-scheduler' ),
     11        'refreshed'                 => __( 'Diagnostics refreshed.', 'schedsense-fast-diagnostics-for-action-scheduler' ),
     12        'cache-cleared'             => __( 'SchedSense caches cleared.', 'schedsense-fast-diagnostics-for-action-scheduler' ),
     13        'cron-spawned'              => __( 'WordPress accepted a standard cron spawn request. This does not prove that every queued callback completed.', 'schedsense-fast-diagnostics-for-action-scheduler' ),
     14        'cron-not-spawned'          => __( 'WordPress did not start another cron spawn. A cron process may already be running or spawning may be unavailable.', 'schedsense-fast-diagnostics-for-action-scheduler' ),
     15        'action-deleted'            => __( 'Failed action record deleted. This does not repair or retry its callback.', 'schedsense-fast-diagnostics-for-action-scheduler' ),
     16        'action-no-longer-failed'   => __( 'This action is no longer failed, so it was not deleted.', 'schedsense-fast-diagnostics-for-action-scheduler' ),
    1217        'action-delete-unavailable' => __( 'Action Scheduler’s delete function is unavailable. No action was removed.', 'schedsense-fast-diagnostics-for-action-scheduler' ),
    13         'action-delete-error' => __( 'The failed action could not be deleted. Refresh the list and check its current status.', 'schedsense-fast-diagnostics-for-action-scheduler' ),
     18        'action-delete-error'       => __( 'The failed action could not be deleted. Refresh the list and check its current status.', 'schedsense-fast-diagnostics-for-action-scheduler' ),
    1419);
    1520?>
  • schedsense-fast-diagnostics-for-action-scheduler/tags/1.0.6/admin/views/overview.php

    r3718291 r3813397  
    11<?php
    2 /** @package SchedSense */
     2/**
     3 * Queue health, environment checks, and diagnostic controls.
     4 *
     5 * @package SchedSense
     6 */
     7
    38defined( 'ABSPATH' ) || exit;
    49$schedsense_counts = isset( $snapshot['queue']['counts'] ) ? $snapshot['queue']['counts'] : array();
    … …  
    2227                <div class="schedsense-metrics">
    2328                        <?php
    24                         $schedsense_metrics = array(
    25                                 'pending'     => __( 'Pending', 'schedsense-fast-diagnostics-for-action-scheduler' ),
    26                                 'overdue_1h'  => __( 'Past due > 1 hour', 'schedsense-fast-diagnostics-for-action-scheduler' ),
    27                                 'overdue_24h' => __( 'Past due > 24 hours', 'schedsense-fast-diagnostics-for-action-scheduler' ),
    28                                 'failed'      => __( 'Failed', 'schedsense-fast-diagnostics-for-action-scheduler' ),
    29                                 'in_progress' => __( 'In progress', 'schedsense-fast-diagnostics-for-action-scheduler' ),
     29                        $schedsense_metrics        = array(
     30                                'pending'           => __( 'Pending', 'schedsense-fast-diagnostics-for-action-scheduler' ),
     31                                'overdue_1h'        => __( 'Past due > 1 hour', 'schedsense-fast-diagnostics-for-action-scheduler' ),
     32                                'overdue_24h'       => __( 'Past due > 24 hours', 'schedsense-fast-diagnostics-for-action-scheduler' ),
     33                                'failed'            => __( 'Failed', 'schedsense-fast-diagnostics-for-action-scheduler' ),
     34                                'in_progress'       => __( 'In progress', 'schedsense-fast-diagnostics-for-action-scheduler' ),
    3035                                'stuck_in_progress' => __( 'In progress > 1 hour', 'schedsense-fast-diagnostics-for-action-scheduler' ),
    31                                 'complete'    => __( 'Completed', 'schedsense-fast-diagnostics-for-action-scheduler' ),
     36                                'complete'          => __( 'Completed', 'schedsense-fast-diagnostics-for-action-scheduler' ),
    3237                        );
    3338                        $schedsense_metric_filters = array(
    3439                                'pending'           => array( 'status' => 'pending' ),
    35                                 'overdue_1h'        => array( 'status' => 'pending', 'age' => 'overdue_1h' ),
    36                                 'overdue_24h'       => array( 'status' => 'pending', 'age' => 'overdue_24h' ),
     40                                'overdue_1h'        => array(
     41                                        'status' => 'pending',
     42                                        'age'    => 'overdue_1h',
     43                                ),
     44                                'overdue_24h'       => array(
     45                                        'status' => 'pending',
     46                                        'age'    => 'overdue_24h',
     47                                ),
    3748                                'failed'            => array( 'status' => 'failed' ),
    3849                                'in_progress'       => array( 'status' => 'in-progress' ),
    39                                 'stuck_in_progress' => array( 'status' => 'in-progress', 'age' => 'stuck' ),
     50                                'stuck_in_progress' => array(
     51                                        'status' => 'in-progress',
     52                                        'age'    => 'stuck',
     53                                ),
    4054                                'complete'          => array( 'status' => 'complete' ),
    4155                        );
    … …  
    6074                        <?php
    6175                        $schedsense_age_buckets = array(
    62                                 'under_1h'   => array( 'count' => 'under_1h', 'label' => __( 'Under 1 hour', 'schedsense-fast-diagnostics-for-action-scheduler' ) ),
    63                                 'one_to_6h'  => array( 'count' => 'one_to_6h', 'label' => __( '1–6 hours', 'schedsense-fast-diagnostics-for-action-scheduler' ) ),
    64                                 'six_to_24h' => array( 'count' => 'six_to_24h', 'label' => __( '6–24 hours', 'schedsense-fast-diagnostics-for-action-scheduler' ) ),
    65                                 'one_to_7d'  => array( 'count' => 'one_to_7d', 'label' => __( '1–7 days', 'schedsense-fast-diagnostics-for-action-scheduler' ) ),
    66                                 'overdue_7d' => array( 'count' => 'overdue_7d', 'label' => __( 'Over 7 days', 'schedsense-fast-diagnostics-for-action-scheduler' ) ),
     76                                'under_1h'   => array(
     77                                        'count' => 'under_1h',
     78                                        'label' => __( 'Under 1 hour', 'schedsense-fast-diagnostics-for-action-scheduler' ),
     79                                ),
     80                                'one_to_6h'  => array(
     81                                        'count' => 'one_to_6h',
     82                                        'label' => __( '1–6 hours', 'schedsense-fast-diagnostics-for-action-scheduler' ),
     83                                ),
     84                                'six_to_24h' => array(
     85                                        'count' => 'six_to_24h',
     86                                        'label' => __( '6–24 hours', 'schedsense-fast-diagnostics-for-action-scheduler' ),
     87                                ),
     88                                'one_to_7d'  => array(
     89                                        'count' => 'one_to_7d',
     90                                        'label' => __( '1–7 days', 'schedsense-fast-diagnostics-for-action-scheduler' ),
     91                                ),
     92                                'overdue_7d' => array(
     93                                        'count' => 'overdue_7d',
     94                                        'label' => __( 'Over 7 days', 'schedsense-fast-diagnostics-for-action-scheduler' ),
     95                                ),
    6796                        );
    6897                        foreach ( $schedsense_age_buckets as $schedsense_age => $schedsense_bucket ) :
  • schedsense-fast-diagnostics-for-action-scheduler/tags/1.0.6/admin/views/page.php

    r3718291 r3813397  
    1313defined( 'ABSPATH' ) || exit;
    1414
    15 $tabs = array(
     15$schedsense_tabs = array(
    1616        'overview' => __( 'Overview', 'schedsense-fast-diagnostics-for-action-scheduler' ),
    1717        'failures' => __( 'Actions', 'schedsense-fast-diagnostics-for-action-scheduler' ),
    … …  
    3939
    4040        <nav class="nav-tab-wrapper" aria-label="<?php echo esc_attr__( 'SchedSense sections', 'schedsense-fast-diagnostics-for-action-scheduler' ); ?>">
    41                 <?php foreach ( $tabs as $schedsense_tab_key => $schedsense_tab_label ) : ?>
     41                <?php foreach ( $schedsense_tabs as $schedsense_tab_key => $schedsense_tab_label ) : ?>
    4242                        <?php
    4343                        $schedsense_tab_url = wp_nonce_url(
    … …  
    6969                ?>
    7070        </main>
    71         <footer class="schedsense-footer">
    72                 <?php
    73                 /* translators: %s: Date and time when the diagnostic snapshot was generated. */
    74                 echo esc_html( sprintf( __( 'Snapshot generated %s. Queue source totals are a bounded sample of up to 300 relevant actions.', 'schedsense-fast-diagnostics-for-action-scheduler' ), wp_date( 'Y-m-d H:i:s T', $snapshot['generated_at'] ) ) );
    75                 ?>
    76         </footer>
     71        <?php if ( isset( $snapshot ) ) : ?>
     72                <footer class="schedsense-footer">
     73                        <?php
     74                        /* translators: %s: Date and time when the diagnostic snapshot was generated. */
     75                        echo esc_html( sprintf( __( 'Snapshot generated %s. Queue source totals are a bounded sample of up to 300 relevant actions.', 'schedsense-fast-diagnostics-for-action-scheduler' ), wp_date( 'Y-m-d H:i:s T', $snapshot['generated_at'] ) ) );
     76                        ?>
     77                </footer>
     78        <?php endif; ?>
    7779</div>
  • schedsense-fast-diagnostics-for-action-scheduler/tags/1.0.6/admin/views/report.php

    r3718291 r3813397  
    11<?php
    2 /** @package SchedSense */
     2/**
     3 * Copyable diagnostic report and its privacy information.
     4 *
     5 * @package SchedSense
     6 */
     7
    38defined( 'ABSPATH' ) || exit;
    49?>
  • schedsense-fast-diagnostics-for-action-scheduler/tags/1.0.6/admin/views/sources.php

    r3718291 r3813397  
    11<?php
    2 /** @package SchedSense */
     2/**
     3 * Likely callback sources from the bounded queue sample.
     4 *
     5 * @package SchedSense
     6 */
     7
    38defined( 'ABSPATH' ) || exit;
    49?>
  • schedsense-fast-diagnostics-for-action-scheduler/tags/1.0.6/includes/class-autoloader.php

    r3718291 r3813397  
    11<?php
    22/**
    3  * Small PSR-4 style autoloader for SchedSense classes.
     3 * Load SchedSense classes from WordPress-style filenames.
    44 *
    55 * @package SchedSense
    … …  
    1717                }
    1818
    19                 $relative = substr( $class_name, strlen( $prefix ) );
    20                 $file     = SCHEDSENSE_PLUGIN_DIR . 'includes/' . str_replace( '\\', '/', $relative ) . '.php';
     19                $relative  = strtolower( str_replace( '\\', '/', substr( $class_name, strlen( $prefix ) ) ) );
     20                $directory = dirname( $relative );
     21                $file      = __DIR__ . '/' . ( '.' === $directory ? '' : $directory . '/' ) . 'class-' . basename( $relative ) . '.php';
    2122                if ( is_readable( $file ) ) {
    2223                        require_once $file;
  • schedsense-fast-diagnostics-for-action-scheduler/tags/1.0.6/languages/index.php

    r3718291 r3813397  
    11<?php
    2 /** Silence is golden. */
     2/**
     3 * Prevent direct directory indexing.
     4 *
     5 * @package SchedSense
     6 */
  • schedsense-fast-diagnostics-for-action-scheduler/tags/1.0.6/readme.txt

    r3718291 r3813397  
    44Requires at least: 6.8
    55Tested up to: 7.1
    6 Stable tag: 1.0.4
     6Stable tag: 1.0.6
    77Requires PHP: 7.4
    88License: GPLv2 or later
    … …  
    2020* Overdue-age buckets from one hour to seven days, with links to matching action lists.
    2121* Flags in-progress actions with no recorded update for over one hour as potentially stuck; long callbacks can be intentional.
    22 * Checks WP-Cron configuration, the local WordPress loopback, and the local REST API.
     22* Checks WP-Cron configuration, the default Action Scheduler cron event, the local WordPress loopback, and the local REST API.
    2323* Attributes registered callbacks to likely source plugins using callback file metadata; uncertain matches are labelled.
    2424* Bounded, filterable action lists by status, age range, exact hook, and exact group. Action arguments are never displayed.
    … …  
    8080== Changelog ==
    8181
     82= 1.0.6 =
     83
     84* Load the Actions tab without running a full health scan or loopback checks.
     85* Show the default Action Scheduler cron event and its scheduled time.
     86* Flag hour-old backlogs and require registered callback evidence before attributing failures to one plugin.
     87
     88= 1.0.5 =
     89
     90* Fixed pagination on the Actions tab so page links preserve the current filters.
     91* Reduced cache writes when resolving sources for large action samples.
     92* Local WP-Cron and REST checks now report redirects without forwarding diagnostic headers.
     93
    8294= 1.0.4 =
    8395* Make nonce verification explicit in each read-only GET filter handler.
  • schedsense-fast-diagnostics-for-action-scheduler/tags/1.0.6/schedsense-fast-diagnostics-for-action-scheduler.php

    r3718291 r3813397  
    44 * Plugin URI:        https://github.com/shahidirfan100/schedsense-fast-diagnostics-for-action-scheduler
    55 * Description:       Diagnose overdue, failed, and stuck Action Scheduler jobs, WP-Cron issues, loopback failures, and queue health.
    6  * Version:           1.0.4
     6 * Version:           1.0.6
    77 * Requires at least: 6.8
    88 * Requires PHP:      7.4
    … …  
    1919defined( 'ABSPATH' ) || exit;
    2020
    21 define( 'SCHEDSENSE_VERSION', '1.0.4' );
     21define( 'SCHEDSENSE_VERSION', '1.0.6' );
    2222define( 'SCHEDSENSE_PLUGIN_FILE', __FILE__ );
    2323define( 'SCHEDSENSE_PLUGIN_DIR', plugin_dir_path( SCHEDSENSE_PLUGIN_FILE ) );
  • schedsense-fast-diagnostics-for-action-scheduler/trunk/admin/views/failures.php

    r3718291 r3813397  
    11<?php
    2 /** @package SchedSense */
     2/**
     3 * Filtered queue list and individual failed-action controls.
     4 *
     5 * @package SchedSense
     6 */
     7
    38defined( 'ABSPATH' ) || exit;
    4 $schedsense_age_labels = array(
     9$schedsense_age_labels  = array(
    510        'under_1h' => __( 'Under 1 hour', 'schedsense-fast-diagnostics-for-action-scheduler' ),
    611        '1_to_6h'  => __( '1–6 hours', 'schedsense-fast-diagnostics-for-action-scheduler' ),
    … …  
    6368                ?>
    6469                <tr><td colspan="10"><?php echo esc_html__( 'No matching actions found.', 'schedsense-fast-diagnostics-for-action-scheduler' ); ?></td></tr><?php endif; ?>
    65         <?php foreach ( $failure_data['actions'] as $action ) : ?>
     70        <?php foreach ( $failure_data['actions'] as $schedsense_action ) : ?>
    6671                <?php
    67                 $schedsense_scheduled_in_future = $action['scheduled'] > time();
    68                 $schedsense_age_display         = ! $action['scheduled'] ? '—' : human_time_diff( $schedsense_scheduled_in_future ? time() : $action['scheduled'], $schedsense_scheduled_in_future ? $action['scheduled'] : time() );
    69                 if ( $schedsense_scheduled_in_future && $action['scheduled'] ) {
     72                $schedsense_scheduled_in_future = $schedsense_action['scheduled'] > time();
     73                $schedsense_age_display         = ! $schedsense_action['scheduled'] ? '—' : human_time_diff( $schedsense_scheduled_in_future ? time() : $schedsense_action['scheduled'], $schedsense_scheduled_in_future ? $schedsense_action['scheduled'] : time() );
     74                if ( $schedsense_scheduled_in_future && $schedsense_action['scheduled'] ) {
    7075                        /* translators: %s: Time until the action is scheduled. */
    7176                        $schedsense_age_display = sprintf( __( 'In %s', 'schedsense-fast-diagnostics-for-action-scheduler' ), $schedsense_age_display );
    72                 } elseif ( $action['scheduled'] ) {
     77                } elseif ( $schedsense_action['scheduled'] ) {
    7378                        /* translators: %s: Time since the action was scheduled. */
    7479                        $schedsense_age_display = sprintf( __( '%s ago', 'schedsense-fast-diagnostics-for-action-scheduler' ), $schedsense_age_display );
    7580                }
    76                 $schedsense_next_step = 'failed' === $action['status']
     81                $schedsense_next_step = 'failed' === $schedsense_action['status']
    7782                        ? __( 'Review callback failure', 'schedsense-fast-diagnostics-for-action-scheduler' )
    78                         : ( 'not_due' === $action['age_bucket']
     83                        : ( 'not_due' === $schedsense_action['age_bucket']
    7984                                ? __( 'No action needed yet', 'schedsense-fast-diagnostics-for-action-scheduler' )
    80                                 : ( 'in-progress' === $action['status']
     85                                : ( 'in-progress' === $schedsense_action['status']
    8186                                        ? __( 'Check worker activity', 'schedsense-fast-diagnostics-for-action-scheduler' )
    8287                                        : __( 'Check queue source and cron', 'schedsense-fast-diagnostics-for-action-scheduler' ) ) );
    8388                ?>
    84                 <tr><td class="schedsense-action-cell">#<?php echo esc_html( $action['id'] ); ?>
    85                         <?php if ( 'failed' === $action['status'] ) : ?>
     89                <tr><td class="schedsense-action-cell">#<?php echo esc_html( $schedsense_action['id'] ); ?>
     90                        <?php if ( 'failed' === $schedsense_action['status'] ) : ?>
    8691                                <form action="<?php echo esc_url( admin_url( 'admin-post.php' ) ); ?>" method="post" class="schedsense-delete-form" data-schedsense-confirm="<?php echo esc_attr__( 'Delete this failed action record? This cannot be undone and will not fix or retry its callback.', 'schedsense-fast-diagnostics-for-action-scheduler' ); ?>">
    8792                                        <input type="hidden" name="action" value="schedsense_delete_failed_action">
    88                                         <input type="hidden" name="action_id" value="<?php echo esc_attr( $action['id'] ); ?>">
     93                                        <input type="hidden" name="action_id" value="<?php echo esc_attr( $schedsense_action['id'] ); ?>">
    8994                                        <input type="hidden" name="hook" value="<?php echo esc_attr( $failure_data['hook'] ); ?>">
    9095                                        <input type="hidden" name="group" value="<?php echo esc_attr( $failure_data['group'] ); ?>">
    … …  
    9499                                        $schedsense_delete_label = __( 'Delete failed action #%s', 'schedsense-fast-diagnostics-for-action-scheduler' );
    95100                                        ?>
    96                                         <button type="submit" class="schedsense-delete-button button-link-delete" aria-label="<?php echo esc_attr( sprintf( $schedsense_delete_label, $action['id'] ) ); ?>"><?php echo esc_html__( 'Delete', 'schedsense-fast-diagnostics-for-action-scheduler' ); ?></button>
     101                                        <button type="submit" class="schedsense-delete-button button-link-delete" aria-label="<?php echo esc_attr( sprintf( $schedsense_delete_label, $schedsense_action['id'] ) ); ?>"><?php echo esc_html__( 'Delete', 'schedsense-fast-diagnostics-for-action-scheduler' ); ?></button>
    97102                                </form>
    98103                        <?php endif; ?>
    99                 </td><td><code><?php echo esc_html( $action['hook'] ); ?></code></td><td><?php echo esc_html( $action['source']['name'] ); ?><small><?php echo esc_html( ucfirst( $action['source']['confidence'] ) ); ?></small></td><td><?php echo esc_html( ! empty( $action['group'] ) ? $action['group'] : '—' ); ?></td><td><?php echo esc_html( $action['scheduled'] ? wp_date( 'Y-m-d H:i:s', $action['scheduled'] ) : '—' ); ?></td><td><span class="schedsense-pill"><?php echo esc_html( $action['status'] ); ?></span></td><td><?php echo esc_html( $action['recurring'] ? __( 'Recurring', 'schedsense-fast-diagnostics-for-action-scheduler' ) : __( 'One-time', 'schedsense-fast-diagnostics-for-action-scheduler' ) ); ?></td><td><?php echo esc_html( $schedsense_age_display ); ?></td><td><?php echo esc_html( isset( $schedsense_age_labels[ $action['age_bucket'] ] ) ? $schedsense_age_labels[ $action['age_bucket'] ] : __( 'Unavailable', 'schedsense-fast-diagnostics-for-action-scheduler' ) ); ?></td><td><?php echo esc_html( $schedsense_next_step ); ?></td></tr>
     104                </td><td><code><?php echo esc_html( $schedsense_action['hook'] ); ?></code></td><td><?php echo esc_html( $schedsense_action['source']['name'] ); ?><small><?php echo esc_html( ucfirst( $schedsense_action['source']['confidence'] ) ); ?></small></td><td><?php echo esc_html( ! empty( $schedsense_action['group'] ) ? $schedsense_action['group'] : '—' ); ?></td><td><?php echo esc_html( $schedsense_action['scheduled'] ? wp_date( 'Y-m-d H:i:s', $schedsense_action['scheduled'] ) : '—' ); ?></td><td><span class="schedsense-pill"><?php echo esc_html( $schedsense_action['status'] ); ?></span></td><td><?php echo esc_html( $schedsense_action['recurring'] ? __( 'Recurring', 'schedsense-fast-diagnostics-for-action-scheduler' ) : __( 'One-time', 'schedsense-fast-diagnostics-for-action-scheduler' ) ); ?></td><td><?php echo esc_html( $schedsense_age_display ); ?></td><td><?php echo esc_html( isset( $schedsense_age_labels[ $schedsense_action['age_bucket'] ] ) ? $schedsense_age_labels[ $schedsense_action['age_bucket'] ] : __( 'Unavailable', 'schedsense-fast-diagnostics-for-action-scheduler' ) ); ?></td><td><?php echo esc_html( $schedsense_next_step ); ?></td></tr>
    100105        <?php endforeach; ?>
    101106        </tbody></table></div>
    … …  
    106111                        paginate_links(
    107112                                array(
    108                                         'base'    => wp_nonce_url( add_query_arg( 'paged', '%#%' ), 'schedsense_view' ),
     113                                        'base'    => add_query_arg(
     114                                                array(
     115                                                        '_wpnonce' => wp_create_nonce( 'schedsense_view' ),
     116                                                        'paged'    => '%#%',
     117                                                )
     118                                        ),
    109119                                        'format'  => '',
    110120                                        'current' => $failure_data['page'],
  • schedsense-fast-diagnostics-for-action-scheduler/trunk/admin/views/notice.php

    r3718291 r3813397  
    11<?php
    2 /** @package SchedSense */
     2/**
     3 * Feedback after diagnostics or queue-record actions.
     4 *
     5 * @package SchedSense
     6 */
     7
    38defined( 'ABSPATH' ) || exit;
    49
    510$schedsense_messages = array(
    6         'refreshed'        => __( 'Diagnostics refreshed.', 'schedsense-fast-diagnostics-for-action-scheduler' ),
    7         'cache-cleared'    => __( 'SchedSense caches cleared.', 'schedsense-fast-diagnostics-for-action-scheduler' ),
    8         'cron-spawned'     => __( 'WordPress accepted a standard cron spawn request. This does not prove that every queued callback completed.', 'schedsense-fast-diagnostics-for-action-scheduler' ),
    9         'cron-not-spawned' => __( 'WordPress did not start another cron spawn. A cron process may already be running or spawning may be unavailable.', 'schedsense-fast-diagnostics-for-action-scheduler' ),
    10         'action-deleted'   => __( 'Failed action record deleted. This does not repair or retry its callback.', 'schedsense-fast-diagnostics-for-action-scheduler' ),
    11         'action-no-longer-failed' => __( 'This action is no longer failed, so it was not deleted.', 'schedsense-fast-diagnostics-for-action-scheduler' ),
     11        'refreshed'                 => __( 'Diagnostics refreshed.', 'schedsense-fast-diagnostics-for-action-scheduler' ),
     12        'cache-cleared'             => __( 'SchedSense caches cleared.', 'schedsense-fast-diagnostics-for-action-scheduler' ),
     13        'cron-spawned'              => __( 'WordPress accepted a standard cron spawn request. This does not prove that every queued callback completed.', 'schedsense-fast-diagnostics-for-action-scheduler' ),
     14        'cron-not-spawned'          => __( 'WordPress did not start another cron spawn. A cron process may already be running or spawning may be unavailable.', 'schedsense-fast-diagnostics-for-action-scheduler' ),
     15        'action-deleted'            => __( 'Failed action record deleted. This does not repair or retry its callback.', 'schedsense-fast-diagnostics-for-action-scheduler' ),
     16        'action-no-longer-failed'   => __( 'This action is no longer failed, so it was not deleted.', 'schedsense-fast-diagnostics-for-action-scheduler' ),
    1217        'action-delete-unavailable' => __( 'Action Scheduler’s delete function is unavailable. No action was removed.', 'schedsense-fast-diagnostics-for-action-scheduler' ),
    13         'action-delete-error' => __( 'The failed action could not be deleted. Refresh the list and check its current status.', 'schedsense-fast-diagnostics-for-action-scheduler' ),
     18        'action-delete-error'       => __( 'The failed action could not be deleted. Refresh the list and check its current status.', 'schedsense-fast-diagnostics-for-action-scheduler' ),
    1419);
    1520?>
  • schedsense-fast-diagnostics-for-action-scheduler/trunk/admin/views/overview.php

    r3718291 r3813397  
    11<?php
    2 /** @package SchedSense */
     2/**
     3 * Queue health, environment checks, and diagnostic controls.
     4 *
     5 * @package SchedSense
     6 */
     7
    38defined( 'ABSPATH' ) || exit;
    49$schedsense_counts = isset( $snapshot['queue']['counts'] ) ? $snapshot['queue']['counts'] : array();
    … …  
    2227                <div class="schedsense-metrics">
    2328                        <?php
    24                         $schedsense_metrics = array(
    25                                 'pending'     => __( 'Pending', 'schedsense-fast-diagnostics-for-action-scheduler' ),
    26                                 'overdue_1h'  => __( 'Past due > 1 hour', 'schedsense-fast-diagnostics-for-action-scheduler' ),
    27                                 'overdue_24h' => __( 'Past due > 24 hours', 'schedsense-fast-diagnostics-for-action-scheduler' ),
    28                                 'failed'      => __( 'Failed', 'schedsense-fast-diagnostics-for-action-scheduler' ),
    29                                 'in_progress' => __( 'In progress', 'schedsense-fast-diagnostics-for-action-scheduler' ),
     29                        $schedsense_metrics        = array(
     30                                'pending'           => __( 'Pending', 'schedsense-fast-diagnostics-for-action-scheduler' ),
     31                                'overdue_1h'        => __( 'Past due > 1 hour', 'schedsense-fast-diagnostics-for-action-scheduler' ),
     32                                'overdue_24h'       => __( 'Past due > 24 hours', 'schedsense-fast-diagnostics-for-action-scheduler' ),
     33                                'failed'            => __( 'Failed', 'schedsense-fast-diagnostics-for-action-scheduler' ),
     34                                'in_progress'       => __( 'In progress', 'schedsense-fast-diagnostics-for-action-scheduler' ),
    3035                                'stuck_in_progress' => __( 'In progress > 1 hour', 'schedsense-fast-diagnostics-for-action-scheduler' ),
    31                                 'complete'    => __( 'Completed', 'schedsense-fast-diagnostics-for-action-scheduler' ),
     36                                'complete'          => __( 'Completed', 'schedsense-fast-diagnostics-for-action-scheduler' ),
    3237                        );
    3338                        $schedsense_metric_filters = array(
    3439                                'pending'           => array( 'status' => 'pending' ),
    35                                 'overdue_1h'        => array( 'status' => 'pending', 'age' => 'overdue_1h' ),
    36                                 'overdue_24h'       => array( 'status' => 'pending', 'age' => 'overdue_24h' ),
     40                                'overdue_1h'        => array(
     41                                        'status' => 'pending',
     42                                        'age'    => 'overdue_1h',
     43                                ),
     44                                'overdue_24h'       => array(
     45                                        'status' => 'pending',
     46                                        'age'    => 'overdue_24h',
     47                                ),
    3748                                'failed'            => array( 'status' => 'failed' ),
    3849                                'in_progress'       => array( 'status' => 'in-progress' ),
    39                                 'stuck_in_progress' => array( 'status' => 'in-progress', 'age' => 'stuck' ),
     50                                'stuck_in_progress' => array(
     51                                        'status' => 'in-progress',
     52                                        'age'    => 'stuck',
     53                                ),
    4054                                'complete'          => array( 'status' => 'complete' ),
    4155                        );
    … …  
    6074                        <?php
    6175                        $schedsense_age_buckets = array(
    62                                 'under_1h'   => array( 'count' => 'under_1h', 'label' => __( 'Under 1 hour', 'schedsense-fast-diagnostics-for-action-scheduler' ) ),
    63                                 'one_to_6h'  => array( 'count' => 'one_to_6h', 'label' => __( '1–6 hours', 'schedsense-fast-diagnostics-for-action-scheduler' ) ),
    64                                 'six_to_24h' => array( 'count' => 'six_to_24h', 'label' => __( '6–24 hours', 'schedsense-fast-diagnostics-for-action-scheduler' ) ),
    65                                 'one_to_7d'  => array( 'count' => 'one_to_7d', 'label' => __( '1–7 days', 'schedsense-fast-diagnostics-for-action-scheduler' ) ),
    66                                 'overdue_7d' => array( 'count' => 'overdue_7d', 'label' => __( 'Over 7 days', 'schedsense-fast-diagnostics-for-action-scheduler' ) ),
     76                                'under_1h'   => array(
     77                                        'count' => 'under_1h',
     78                                        'label' => __( 'Under 1 hour', 'schedsense-fast-diagnostics-for-action-scheduler' ),
     79                                ),
     80                                'one_to_6h'  => array(
     81                                        'count' => 'one_to_6h',
     82                                        'label' => __( '1–6 hours', 'schedsense-fast-diagnostics-for-action-scheduler' ),
     83                                ),
     84                                'six_to_24h' => array(
     85                                        'count' => 'six_to_24h',
     86                                        'label' => __( '6–24 hours', 'schedsense-fast-diagnostics-for-action-scheduler' ),
     87                                ),
     88                                'one_to_7d'  => array(
     89                                        'count' => 'one_to_7d',
     90                                        'label' => __( '1–7 days', 'schedsense-fast-diagnostics-for-action-scheduler' ),
     91                                ),
     92                                'overdue_7d' => array(
     93                                        'count' => 'overdue_7d',
     94                                        'label' => __( 'Over 7 days', 'schedsense-fast-diagnostics-for-action-scheduler' ),
     95                                ),
    6796                        );
    6897                        foreach ( $schedsense_age_buckets as $schedsense_age => $schedsense_bucket ) :
  • schedsense-fast-diagnostics-for-action-scheduler/trunk/admin/views/page.php

    r3718291 r3813397  
    1313defined( 'ABSPATH' ) || exit;
    1414
    15 $tabs = array(
     15$schedsense_tabs = array(
    1616        'overview' => __( 'Overview', 'schedsense-fast-diagnostics-for-action-scheduler' ),
    1717        'failures' => __( 'Actions', 'schedsense-fast-diagnostics-for-action-scheduler' ),
    … …  
    3939
    4040        <nav class="nav-tab-wrapper" aria-label="<?php echo esc_attr__( 'SchedSense sections', 'schedsense-fast-diagnostics-for-action-scheduler' ); ?>">
    41                 <?php foreach ( $tabs as $schedsense_tab_key => $schedsense_tab_label ) : ?>
     41                <?php foreach ( $schedsense_tabs as $schedsense_tab_key => $schedsense_tab_label ) : ?>
    4242                        <?php
    4343                        $schedsense_tab_url = wp_nonce_url(
    … …  
    6969                ?>
    7070        </main>
    71         <footer class="schedsense-footer">
    72                 <?php
    73                 /* translators: %s: Date and time when the diagnostic snapshot was generated. */
    74                 echo esc_html( sprintf( __( 'Snapshot generated %s. Queue source totals are a bounded sample of up to 300 relevant actions.', 'schedsense-fast-diagnostics-for-action-scheduler' ), wp_date( 'Y-m-d H:i:s T', $snapshot['generated_at'] ) ) );
    75                 ?>
    76         </footer>
     71        <?php if ( isset( $snapshot ) ) : ?>
     72                <footer class="schedsense-footer">
     73                        <?php
     74                        /* translators: %s: Date and time when the diagnostic snapshot was generated. */
     75                        echo esc_html( sprintf( __( 'Snapshot generated %s. Queue source totals are a bounded sample of up to 300 relevant actions.', 'schedsense-fast-diagnostics-for-action-scheduler' ), wp_date( 'Y-m-d H:i:s T', $snapshot['generated_at'] ) ) );
     76                        ?>
     77                </footer>
     78        <?php endif; ?>
    7779</div>
  • schedsense-fast-diagnostics-for-action-scheduler/trunk/admin/views/report.php

    r3718291 r3813397  
    11<?php
    2 /** @package SchedSense */
     2/**
     3 * Copyable diagnostic report and its privacy information.
     4 *
     5 * @package SchedSense
     6 */
     7
    38defined( 'ABSPATH' ) || exit;
    49?>
  • schedsense-fast-diagnostics-for-action-scheduler/trunk/admin/views/sources.php

    r3718291 r3813397  
    11<?php
    2 /** @package SchedSense */
     2/**
     3 * Likely callback sources from the bounded queue sample.
     4 *
     5 * @package SchedSense
     6 */
     7
    38defined( 'ABSPATH' ) || exit;
    49?>
  • schedsense-fast-diagnostics-for-action-scheduler/trunk/includes/class-autoloader.php

    r3718291 r3813397  
    11<?php
    22/**
    3  * Small PSR-4 style autoloader for SchedSense classes.
     3 * Load SchedSense classes from WordPress-style filenames.
    44 *
    55 * @package SchedSense
    … …  
    1717                }
    1818
    19                 $relative = substr( $class_name, strlen( $prefix ) );
    20                 $file     = SCHEDSENSE_PLUGIN_DIR . 'includes/' . str_replace( '\\', '/', $relative ) . '.php';
     19                $relative  = strtolower( str_replace( '\\', '/', substr( $class_name, strlen( $prefix ) ) ) );
     20                $directory = dirname( $relative );
     21                $file      = __DIR__ . '/' . ( '.' === $directory ? '' : $directory . '/' ) . 'class-' . basename( $relative ) . '.php';
    2122                if ( is_readable( $file ) ) {
    2223                        require_once $file;
  • schedsense-fast-diagnostics-for-action-scheduler/trunk/languages/index.php

    r3718291 r3813397  
    11<?php
    2 /** Silence is golden. */
     2/**
     3 * Prevent direct directory indexing.
     4 *
     5 * @package SchedSense
     6 */
  • schedsense-fast-diagnostics-for-action-scheduler/trunk/readme.txt

    r3718291 r3813397  
    44Requires at least: 6.8
    55Tested up to: 7.1
    6 Stable tag: 1.0.4
     6Stable tag: 1.0.6
    77Requires PHP: 7.4
    88License: GPLv2 or later
    … …  
    2020* Overdue-age buckets from one hour to seven days, with links to matching action lists.
    2121* Flags in-progress actions with no recorded update for over one hour as potentially stuck; long callbacks can be intentional.
    22 * Checks WP-Cron configuration, the local WordPress loopback, and the local REST API.
     22* Checks WP-Cron configuration, the default Action Scheduler cron event, the local WordPress loopback, and the local REST API.
    2323* Attributes registered callbacks to likely source plugins using callback file metadata; uncertain matches are labelled.
    2424* Bounded, filterable action lists by status, age range, exact hook, and exact group. Action arguments are never displayed.
    … …  
    8080== Changelog ==
    8181
     82= 1.0.6 =
     83
     84* Load the Actions tab without running a full health scan or loopback checks.
     85* Show the default Action Scheduler cron event and its scheduled time.
     86* Flag hour-old backlogs and require registered callback evidence before attributing failures to one plugin.
     87
     88= 1.0.5 =
     89
     90* Fixed pagination on the Actions tab so page links preserve the current filters.
     91* Reduced cache writes when resolving sources for large action samples.
     92* Local WP-Cron and REST checks now report redirects without forwarding diagnostic headers.
     93
    8294= 1.0.4 =
    8395* Make nonce verification explicit in each read-only GET filter handler.
  • schedsense-fast-diagnostics-for-action-scheduler/trunk/schedsense-fast-diagnostics-for-action-scheduler.php

    r3718291 r3813397  
    44 * Plugin URI:        https://github.com/shahidirfan100/schedsense-fast-diagnostics-for-action-scheduler
    55 * Description:       Diagnose overdue, failed, and stuck Action Scheduler jobs, WP-Cron issues, loopback failures, and queue health.
    6  * Version:           1.0.4
     6 * Version:           1.0.6
    77 * Requires at least: 6.8
    88 * Requires PHP:      7.4
    … …  
    1919defined( 'ABSPATH' ) || exit;
    2020
    21 define( 'SCHEDSENSE_VERSION', '1.0.4' );
     21define( 'SCHEDSENSE_VERSION', '1.0.6' );
    2222define( 'SCHEDSENSE_PLUGIN_FILE', __FILE__ );
    2323define( 'SCHEDSENSE_PLUGIN_DIR', plugin_dir_path( SCHEDSENSE_PLUGIN_FILE ) );
Note: See TracChangeset for help on using the changeset viewer.