Plugin Directory

Changeset 3484639


Ignore:
Timestamp:
03/17/2026 10:07:31 AM (2 weeks ago)
Author:
satollo
Message:

Version 1.0.1

Location:
satollo-monitor
Files:
46 added
14 edited

Legend:

Unmodified
Added
Removed
  • satollo-monitor/trunk/admin/abilities/index.php

    r3481978 r3484639  
    22
    33defined('ABSPATH') || exit;
    4 
    5 // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- not relevant
    6 $subpage = sanitize_key($_GET['subpage'] ?? '');
    7 
    8 switch ($subpage) {
    9     case 'logs':
    10         include __DIR__ . '/logs.php';
    11         return;
    12 }
    134
    145class Monitor_List_Table extends WP_List_Table {
     
    8273?>
    8374<?php include __DIR__ . '/../menu.php'; ?>
    84 <div class="wrap" id="monitor-emails">
     75<div class="wrap">
    8576    <?php include __DIR__ . '/nav.php'; ?>
    8677
  • satollo-monitor/trunk/admin/abilities/logs.php

    r3481978 r3484639  
    11<?php
    2 
    32defined('ABSPATH') || exit;
    43
    54// phpcs:disable WordPress.DB.DirectDatabaseQuery.DirectQuery,WordPress.DB.DirectDatabaseQuery.NoCaching -- not relevant
    65
    7 class aMonitor_List_Table extends WP_List_Table {
     6global $wpdb;
     7
     8// phpcs:ignore WordPress.Security.ValidatedSanitizedInput.MissingUnslash,WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- not necessary
     9if (($_SERVER['REQUEST_METHOD'] ?? '') === 'POST') {
     10    check_admin_referer('monitor-action');
     11    if (isset($_POST['clear'])) {
     12        $wpdb->query("truncate {$wpdb->prefix}monitor_abilities");
     13    }
     14}
     15
     16class Monitor_List_Table extends WP_List_Table {
    817
    918    public function __construct() {
     
    6877}
    6978
    70 $table = new aMonitor_List_Table();
     79$table = new Monitor_List_Table();
    7180$table->prepare_items();
    7281add_thickbox();
    7382?>
    7483<?php include __DIR__ . '/../menu.php'; ?>
    75 <div class="wrap" id="monitor-emails">
     84<div class="wrap">
    7685    <?php include __DIR__ . '/nav.php'; ?>
     86
     87    <form method="post">
     88        <?php wp_nonce_field('monitor-action'); ?>
     89        <button name="clear" class="button button-secondary"><?php esc_html_e('Clear', 'satollo-monitor'); ?></button>
     90    </form>
    7791
    7892    <?php $table->display(); ?>
  • satollo-monitor/trunk/admin/admin.php

    r3481978 r3484639  
    4747        add_management_page('Monitor', 'Monitor', 'administrator', 'monitor', function () {
    4848            $section = $_GET['section'] ?? '';
     49            $subpage = $_GET['subpage'] ?? '';
    4950            switch ($section) {
    5051                case 'settings':
     
    5253                    break;
    5354                case 'abilities':
    54                     include __DIR__ . '/abilities/index.php';
     55                    switch ($subpage) {
     56                        case 'logs':
     57                            include __DIR__ . '/abilities/logs.php';
     58                            break;
     59                        default:
     60                            include __DIR__ . '/abilities/index.php';
     61                    }
    5562                    break;
    5663                case 'rest':
    57                     include __DIR__ . '/rest/index.php';
     64                    switch ($subpage) {
     65                        case 'logs':
     66                            include __DIR__ . '/rest/logs.php';
     67                            break;
     68                        default:
     69                            include __DIR__ . '/rest/index.php';
     70                    }
    5871                    break;
    5972                case 'http':
    60                     include __DIR__ . '/http/index.php';
     73                    switch ($subpage) {
     74                        case 'logs':
     75                            include __DIR__ . '/http/logs.php';
     76                            break;
     77                        default:
     78                            include __DIR__ . '/http/index.php';
     79                    }
    6180                    break;
    6281                case 'scheduler':
     
    6483                    break;
    6584                case 'emails':
    66                     include __DIR__ . '/emails/index.php';
     85                    switch ($subpage) {
     86                        case 'logs':
     87                            include __DIR__ . '/emails/logs.php';
     88                            break;
     89                        default:
     90                            include __DIR__ . '/emails/index.php';
     91                    }
    6792                    break;
    6893                case 'users':
     
    78103        require_once __DIR__ . '/admin-ajax.php';
    79104    }
    80 
    81105});
  • satollo-monitor/trunk/admin/assets/admin.css

    r3481978 r3484639  
    9999    color: green;
    100100}
     101
     102/* GRAPHS */
     103
     104.monitor-nodata {
     105    margin: 1.5rem 0;
     106    padding-top: 3rem;
     107    background-color: #eee;
     108    color: #ccc;
     109    border: 1px solid #ccc;
     110    height: 250px;
     111    font-size: 2rem;
     112    text-align: center;
     113}
  • satollo-monitor/trunk/admin/emails/index.php

    r3481978 r3484639  
    66
    77global $wpdb;
    8 
    9 // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- not relevant
    10 $subpage = sanitize_key($_GET['subpage'] ?? '');
    11 
    12 switch ($subpage) {
    13     case 'logs':
    14         include __DIR__ . '/logs.php';
    15         return;
    16     case 'filters':
    17         include __DIR__ . '/filters.php';
    18         return;
    19 }
    208
    219function hook_functions($tag) {
     
    5947    <?php include __DIR__ . '/nav.php'; ?>
    6048
    61     <p>For email logging with actions (resend, ...) conside the WP Mail Logging plugin.</p>
     49    <p>For email logging with actions (resend, ...) consider the WP Mail Logging plugin.</p>
    6250
    6351    <div class="monitor-dashboard">
  • satollo-monitor/trunk/admin/emails/logs.php

    r3481978 r3484639  
    123123</style>
    124124<?php include __DIR__ . '/../menu.php'; ?>
    125 <div class="wrap" id="monitor-emails">
     125<div class="wrap">
    126126    <?php include __DIR__ . '/nav.php'; ?>
    127127
  • satollo-monitor/trunk/admin/http/index.php

    r3481978 r3484639  
    55
    66global $wpdb;
    7 
    8 // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- not relevant
    9 $subpage = sanitize_key($_GET['subpage'] ?? '');
    10 
    11 switch ($subpage) {
    12     case 'logs':
    13         include __DIR__ . '/logs.php';
    14         return;
    15 }
    167
    178$per_day = $wpdb->get_results("select date(created) as date, count(*) as total from {$wpdb->prefix}monitor_http where created > DATE_SUB(NOW(), INTERVAL 30 DAY) group by date(created) order by date(created) asc");
     
    2920    <?php include __DIR__ . '/nav.php'; ?>
    3021
    31     <div id="graph" style="margin: 2rem 0"></div>
     22    <?php if (!$per_day) { ?>
     23        <div class="monitor-nodata">
     24            No recent data to show diagrams.
     25        </div>
     26    <?php } else { ?>
     27        <div id="graph" style="margin: 2rem 0"></div>
     28    <?php } ?>
    3229
    3330    <script>
  • satollo-monitor/trunk/admin/rest/index.php

    r3481978 r3484639  
    66
    77global $wpdb;
    8 
    9 // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- not relevant
    10 $subpage = sanitize_key($_GET['subpage'] ?? '');
    11 
    12 switch ($subpage) {
    13     case 'logs':
    14         include __DIR__ . '/logs.php';
    15         return;
    16 }
    178
    189$per_day = $wpdb->get_results("select date(created) as date, count(*) as total from {$wpdb->prefix}monitor_rest where created > DATE_SUB(NOW(), INTERVAL 30 DAY) group by date(created) order by date(created) asc");
  • satollo-monitor/trunk/admin/rest/logs.php

    r3481978 r3484639  
    9292?>
    9393<?php include __DIR__ . '/../menu.php'; ?>
    94 <div class="wrap" id="monitor-emails">
     94<div class="wrap">
    9595    <?php include __DIR__ . '/nav.php'; ?>
    9696
  • satollo-monitor/trunk/admin/scheduler/index.php

    r3481978 r3484639  
    9898    <?php } ?>
    9999
    100 
    101 
    102100    <p>
    103101        For detailed information on job scheduling install the WP Crontrol plugin.
     
    212210
    213211    <?php if (!$deltas) { ?>
    214         <div style="margin: 1.5rem 0; padding-top: 3rem; background-color: #eee; color: #ccc; border: 1px solid #ccc; height: 250px; font-size: 2rem; text-align: center;">
     212        <div  class="monitor-nodata">
    215213            No recent data to show diagrams.
    216214        </div>
     
    236234//        var data2 = [{
    237235//                //x: [1, 2, 3, 4, 5],
    238 //                y: <?php //echo json_encode($deltas_moving);         ?>
     236//                y: <?php //echo json_encode($deltas_moving);          ?>
    239237//            }];
    240238//
  • satollo-monitor/trunk/admin/scheduler/logs.php

    r3481978 r3484639  
    115115    <?php if (wp_using_ext_object_cache()) { ?>
    116116        <div class="monitor-notice monitor-notice-warning">
    117             An object cache is active. If you see on each schduler run that only one job is executed even if there are
     117            An object cache is active. If you see on each scheduler run that only one job is executed even if there are
    118118            more than one queued, try to disable the object cache.
    119119        </div>
     
    128128    <?php $table->display(); ?>
    129129
    130 
    131130</div>
  • satollo-monitor/trunk/readme.txt

    r3481978 r3484639  
    1 === Monitor ===
     1=== Monitor: Scheduler, Emails, API, HTTP and more ===
    22Contributors: satollo
    33Tags: debug,logging
     
    55Tested up to: 6.9
    66Requires PHP: 8.1
    7 Stable tag: 1.0.0
     7Stable tag: 1.0.1
    88License: GPLv2 or later
    99License URI: https://www.gnu.org/licenses/gpl-2.0.html
    1010
    11 Track and store internal site events for analysis and debugging: abilities calls, http calls, emails, scheduled jobs, ...
     11Track and store internal WP events for analysis and debugging: abilities calls, http calls, emails, scheduled jobs, ...
    1212
    1313== Description ==
     
    2424
    2525Please, [read the official page for more details](htps://www.satollo.net/plugins/monitor).
     26
     27= What's monitored =
     28
     29* Emails
     30* HTTP calls (using the wp_remote_* functions)
     31* REST API calls
     32* Scheduler runs with detailed jobs data
     33* Abilities invocation
     34
     35Please, [read the official page for more details](htps://www.satollo.net/plugins/monitor) for more detail, examples of problems and solutions.
    2636
    2737= Contacts, Requests, Bugs =
     
    4353* Activate monitors only for what you really need on Monitor/Settings
    4454
    45 = Does exists an extended version of Monitor? =
     55= Does exist an extended version of Monitor? =
    4656
    4757No, but if you have specific needs, let's discuss them.
     
    4959= Is collected data shared with someone? =
    5060
    51 No, all the data is stored into your WP database.
     61No, all the data is stored into your WP database. No log files are created.
    5262
    5363= Can I give access to Monitor to non administrator users? =
     
    5969Not right now.
    6070
     71== Screenshots ==
     72
     731. WordPress scheduler overview with statistical values and graphs
     742. Detailed scheduler runs with jobs
     753. HTTP monitoring with calls per day
     764. Overview of the email monitoring
     77
    6178
    6279== Changelog ==
     80
     81= 1.0.1 =
     82
     83* Fixed some typos
     84* Fixed log clean for the REST API monitoring
     85* Added the logs clean button on Abilities monitor page
     86* Fixed abilities tracking (WP 6.9 has a different hook than the original library...)
    6387
    6488= 1.0.0 =
  • satollo-monitor/trunk/satollo-monitor.php

    r3481978 r3484639  
    66 * Plugin Name: Monitor: Scheduler, Emails, API, HTTP and more
    77 * Description: Records and displays WP events: abilities calls, scheduler job executions, http calls, emails, and so on
    8  * Version: 1.0.0
     8 * Version: 1.0.1
    99 * Author: Stefano Lissa
    1010 * Author URI: https://www.satollo.net
     
    1616 * Plugin URI: https://www.satollo.net/plugins/monitor
    1717 */
    18 
    1918defined('ABSPATH') || exit;
    2019
    21 define('SATOLLO_MONITOR_VERSION', '1.0.0');
     20define('SATOLLO_MONITOR_VERSION', '1.0.1');
    2221
    2322/** @var wpdb $wpdb */
     
    2524    delete_option('monitor_emails_hooks');
    2625    delete_option('monitor_scheduler_hooks');
    27     delete_option('monitor_update_data');
    2826    wp_unschedule_hook('monitor');
    2927});
     
    143141    }, 0, 3);
    144142
    145     add_action('after_execute_ability', function ($name, $input, $result) {
     143    add_action('wp_after_execute_ability', function ($name, $input, $result) {
    146144        global $wpdb, $monitor_ability_method;
    147145
     
    360358    $wpdb->query($wpdb->prepare("delete from `{$wpdb->prefix}monitor_scheduler` where created < date_sub(now(), interval %d day)", $days));
    361359    $wpdb->query($wpdb->prepare("delete from `{$wpdb->prefix}monitor_http` where created < date_sub(now(), interval %d day)", $days));
    362 }
     360    $wpdb->query($wpdb->prepare("delete from `{$wpdb->prefix}monitor_rest` where created < date_sub(now(), interval %d day)", $days));
     361}
  • satollo-monitor/trunk/uninstall.php

    r3481978 r3484639  
    1414delete_option('monitor_emails_hooks');
    1515delete_option('monitor_scheduler_hooks');
    16 delete_option('monitor_update_data');
    1716delete_option('monitor_emails_failed_count');
    1817delete_option('monitor_emails_sent_count');
Note: See TracChangeset for help on using the changeset viewer.