Plugin Directory

Changeset 3731651


Ignore:
Timestamp:
10/06/2026 10:35:43 PM (3 weeks ago)
Author:
mikeywazowski
Message:

Release 0.1.9

Location:
triage-agent-connector/trunk
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • triage-agent-connector/trunk/includes/class-triage-agent-connector-sync.php

    r3697889 r3731651  
    4040            wp_schedule_event(time() + 300, 'daily', self::CRON_HOOK);
    4141        }
     42    }
     43
     44    /**
     45     * Status fields for admin, WP-CLI, and Abilities (never includes secrets).
     46     *
     47     * @return array{
     48     *     api_server: string,
     49     *     linked_site_id: string,
     50     *     last_successful_sync: string,
     51     *     next_sync_expected: string,
     52     *     next_retry_allowed: string,
     53     *     last_error: string
     54     * }
     55     */
     56    public static function status_fields()
     57    {
     58        $last_sync = (int) get_option(self::OPT_LAST_SYNC, 0);
     59        $last_error = (string) get_option(self::OPT_LAST_ERROR, '');
     60        $next_attempt = (int) get_option(self::OPT_NEXT_ATTEMPT, 0);
     61        $linked_site_id = trim((string) get_option(self::OPT_SITE_ID, ''));
     62        $date_format = get_option('date_format').' '.get_option('time_format');
     63
     64        $last_sync_label = $last_sync
     65            ? wp_date($date_format, $last_sync)
     66            : __('Never', 'triage-agent-connector');
     67
     68        $next_retry_label = $next_attempt > time()
     69            ? wp_date($date_format, $next_attempt)
     70            : __('Now', 'triage-agent-connector');
     71
     72        $site_label = $linked_site_id !== ''
     73            ? $linked_site_id
     74            : __('Not linked — save settings after entering agent key', 'triage-agent-connector');
     75
     76        return [
     77            'api_server' => self::api_base(),
     78            'linked_site_id' => $site_label,
     79            'last_successful_sync' => $last_sync_label,
     80            'next_sync_expected' => self::next_sync_expected_label(),
     81            'next_retry_allowed' => $next_retry_label,
     82            'last_error' => $last_error !== '' ? $last_error : __('(none)', 'triage-agent-connector'),
     83        ];
    4284    }
    4385
  • triage-agent-connector/trunk/readme.txt

    r3697889 r3731651  
    55Tested up to: 7.0
    66Requires PHP: 7.4
    7 Stable tag: 0.1.7
     7Stable tag: 0.1.9
    88License: GPLv2 or later
    99License URI: https://www.gnu.org/licenses/gpl-2.0.html
    … …  
    7272Generate a new key in WP Triage, then open **Settings → WP Triage** on each WordPress site, paste the new key, and save again.
    7373
     74= Can I use WP-CLI? =
     75
     76Yes. With WP-CLI installed on the server: `wp triage status`, `wp triage test`, and `wp triage sync`. Use `wp triage status --format=json` for scripts. Configure the agent key in **Settings → WP Triage** first.
     77
     78= Does this register WordPress Abilities? =
     79
     80On WordPress 6.9+, the plugin registers three abilities (`get-status`, `test-connection`, `send-snapshot`) for REST / MCP discovery. Older WordPress versions skip registration; the minimum remains 5.8.
     81
    7482== Changelog ==
     83
     84= 0.1.9 =
     85* Abilities API (WP 6.9+): get-status, test-connection, send-snapshot
     86
     87= 0.1.8 =
     88* WP-CLI commands: `wp triage status`, `wp triage test`, and `wp triage sync`
    7589
    7690= 0.1.7 =
  • triage-agent-connector/trunk/triage-agent-connector.php

    r3697889 r3731651  
    55 * Plugin URI:        https://wptriage.app/docs/connecting-wordpress
    66 * Description:       Sends site inventory (WordPress, PHP, plugins, themes) to your WP Triage backend.
    7  * Version:           0.1.7
     7 * Version:           0.1.9
    88 * Requires at least: 5.8
    99 * Requires PHP:      7.4
    … …  
    1818}
    1919
    20 define('TRIAGE_AGENT_CONNECTOR_VERSION', '0.1.7');
     20define('TRIAGE_AGENT_CONNECTOR_VERSION', '0.1.9');
    2121define('TRIAGE_AGENT_CONNECTOR_PLUGIN_FILE', __FILE__);
    2222define('TRIAGE_AGENT_CONNECTOR_PLUGIN_DIR', plugin_dir_path(__FILE__));
    … …  
    2525require_once TRIAGE_AGENT_CONNECTOR_PLUGIN_DIR.'includes/class-triage-agent-connector-sync.php';
    2626require_once TRIAGE_AGENT_CONNECTOR_PLUGIN_DIR.'includes/class-triage-agent-connector-admin.php';
     27require_once TRIAGE_AGENT_CONNECTOR_PLUGIN_DIR.'includes/class-triage-agent-connector-abilities.php';
    2728
    2829register_activation_hook(__FILE__, 'triage_agent_connector_activate');
    2930register_deactivation_hook(__FILE__, 'triage_agent_connector_deactivate');
     31
     32if (defined('WP_CLI') && WP_CLI) {
     33    add_action('cli_init', static function () {
     34        require_once TRIAGE_AGENT_CONNECTOR_PLUGIN_DIR.'includes/class-triage-agent-connector-cli.php';
     35        WP_CLI::add_command('triage', 'Triage_Agent_Connector_CLI');
     36    });
     37}
    3038
    3139/**
    … …  
    3644    Triage_Agent_Connector_Sync::ensure_cron_scheduled();
    3745    Triage_Agent_Connector_Admin::instance()->register();
     46    Triage_Agent_Connector_Abilities::register();
    3847
    3948    add_action(Triage_Agent_Connector_Sync::CRON_HOOK, ['Triage_Agent_Connector_Sync', 'run_scheduled']);
Note: See TracChangeset for help on using the changeset viewer.