Changeset 3731651
- Timestamp:
- 10/06/2026 10:35:43 PM (3 weeks ago)
- Location:
- triage-agent-connector/trunk
- Files:
-
- 2 added
- 3 edited
-
includes/class-triage-agent-connector-abilities.php (added)
-
includes/class-triage-agent-connector-cli.php (added)
-
includes/class-triage-agent-connector-sync.php (modified) (1 diff)
-
readme.txt (modified) (2 diffs)
-
triage-agent-connector.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
triage-agent-connector/trunk/includes/class-triage-agent-connector-sync.php
r3697889 r3731651 40 40 wp_schedule_event(time() + 300, 'daily', self::CRON_HOOK); 41 41 } 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 ]; 42 84 } 43 85 -
triage-agent-connector/trunk/readme.txt
r3697889 r3731651 5 5 Tested up to: 7.0 6 6 Requires PHP: 7.4 7 Stable tag: 0.1. 77 Stable tag: 0.1.9 8 8 License: GPLv2 or later 9 9 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 72 72 Generate a new key in WP Triage, then open **Settings → WP Triage** on each WordPress site, paste the new key, and save again. 73 73 74 = Can I use WP-CLI? = 75 76 Yes. 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 80 On 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 74 82 == 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` 75 89 76 90 = 0.1.7 = -
triage-agent-connector/trunk/triage-agent-connector.php
r3697889 r3731651 5 5 * Plugin URI: https://wptriage.app/docs/connecting-wordpress 6 6 * Description: Sends site inventory (WordPress, PHP, plugins, themes) to your WP Triage backend. 7 * Version: 0.1. 77 * Version: 0.1.9 8 8 * Requires at least: 5.8 9 9 * Requires PHP: 7.4 … … 18 18 } 19 19 20 define('TRIAGE_AGENT_CONNECTOR_VERSION', '0.1. 7');20 define('TRIAGE_AGENT_CONNECTOR_VERSION', '0.1.9'); 21 21 define('TRIAGE_AGENT_CONNECTOR_PLUGIN_FILE', __FILE__); 22 22 define('TRIAGE_AGENT_CONNECTOR_PLUGIN_DIR', plugin_dir_path(__FILE__)); … … 25 25 require_once TRIAGE_AGENT_CONNECTOR_PLUGIN_DIR.'includes/class-triage-agent-connector-sync.php'; 26 26 require_once TRIAGE_AGENT_CONNECTOR_PLUGIN_DIR.'includes/class-triage-agent-connector-admin.php'; 27 require_once TRIAGE_AGENT_CONNECTOR_PLUGIN_DIR.'includes/class-triage-agent-connector-abilities.php'; 27 28 28 29 register_activation_hook(__FILE__, 'triage_agent_connector_activate'); 29 30 register_deactivation_hook(__FILE__, 'triage_agent_connector_deactivate'); 31 32 if (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 } 30 38 31 39 /** … … 36 44 Triage_Agent_Connector_Sync::ensure_cron_scheduled(); 37 45 Triage_Agent_Connector_Admin::instance()->register(); 46 Triage_Agent_Connector_Abilities::register(); 38 47 39 48 add_action(Triage_Agent_Connector_Sync::CRON_HOOK, ['Triage_Agent_Connector_Sync', 'run_scheduled']);
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)