Plugin Directory

Changeset 3722324


Ignore:
Timestamp:
10/01/2026 03:43:10 AM (3 weeks ago)
Author:
Mosamlife
Message:

Release 0.61.155

Location:
fleet-agent-site-manager
Files:
12 added
12 edited
1 copied

Legend:

Unmodified
Added
Removed
  • fleet-agent-site-manager/tags/0.61.155/fleet-agent-site-manager.php

    r3721588 r3722324  
    44 * Plugin URI:        https://github.com/mosamlife/wpmgr
    55 * Description:        Connects this WordPress site to a WPMgr control plane for backups, updates, monitoring, and security scanning.
    6  * Version:           0.61.154
     6 * Version:           0.61.155
    77 * Requires at least: 6.2
    88 * Requires PHP:      8.1
    … …  
    2121}
    2222
    23 define('WPMGR_AGENT_VERSION', '0.61.154');
     23define('WPMGR_AGENT_VERSION', '0.61.155');
    2424define('WPMGR_WPORG_BUILD', true);
    2525
  • fleet-agent-site-manager/tags/0.61.155/includes/class-plugin.php

    r3721588 r3722324  
    5656use WPMgr\Agent\Commands\UnblockIpCommand;
    5757use WPMgr\Agent\Commands\UpdateCommand;
     58use WPMgr\Agent\Abilities\OwnAbilities;
     59use WPMgr\Agent\Commands\AbilityRunCommand;
    5860use WPMgr\Agent\Commands\ContentProbeCommand;
    5961use WPMgr\Agent\Commands\ContentUpdateCommand;
    … …  
    698700        }
    699701
     702        // WPMgr's own read abilities, offered to the WordPress Abilities API
     703        // (6.9+). These hooks never fire on older WordPress; the engine runs
     704        // the same abilities in-process either way.
     705        add_action('wp_abilities_api_categories_init', [OwnAbilities::class, 'registerCategory']);
     706        add_action('wp_abilities_api_init', [OwnAbilities::class, 'registerAbilities']);
     707
    700708        add_action('rest_api_init', [$this->router, 'registerRoutes']);
    701709        add_action('rest_api_init', [$this, 'registerAutologinRoute']);
    … …  
    20292037            // post_content is what a visitor sees for a page. Writes nothing.
    20302038            new ContentProbeCommand(),
     2039            // The engine's signed command: modes read, precheck and ledger,
     2040            // for WPMgr's own wpmgr/* abilities only. Params are digest-bound
     2041            // to the token (claim pd) over the exact JSON bytes.
     2042            new AbilityRunCommand(),
    20312043            // M5.6 / ADR-033: BackupCommand validates the signed CP request,
    20322044            // dedups, seeds the wpmgr_backup_tasks row, schedules the
  • fleet-agent-site-manager/tags/0.61.155/includes/commands/class-content-probe-command.php

    r3721588 r3722324  
    44
    55namespace WPMgr\Agent\Commands;
     6
     7use WPMgr\Agent\Abilities\AbilitySchema;
    68
    79// Direct-file-access guard: keep above the docblock (see the note in
    … …  
    607609
    608610    /**
    609      * Structural hash of an ability's input schema: type, property names
    610      * (recursively), required, items, additionalProperties and enum values,
    611      * with enum dropped at dynamic paths. Titles, descriptions, examples,
    612      * defaults and translated text never contribute, and keys are sorted, so a
    613      * locale change or a newly registered element type does not change the
    614      * hash but a real change of shape does.
     611     * Structural hash of an ability's input schema (see AbilitySchema).
    615612     *
    616613     * @param object       $ability Registered ability.
    … …  
    620617    private function schemaHash(object $ability, array $dynamic): ?string
    621618    {
    622         if (!method_exists($ability, 'get_input_schema')) {
    623             return null;
    624         }
    625         try {
    626             $schema = $ability->get_input_schema();
    627         } catch (\Throwable $e) {
    628             return null;
    629         }
    630         if (!is_array($schema)) {
    631             return null;
    632         }
    633         $json = json_encode($this->structural($schema, '', $dynamic));
    634 
    635         return is_string($json) ? 'sha256:' . hash('sha256', $json) : null;
    636     }
    637 
    638     /**
    639      * @param array<mixed> $node    Schema node.
    640      * @param string       $path    Dotted property path of this node.
    641      * @param list<string> $dynamic Dynamic enum paths.
    642      * @return array<mixed>
    643      */
    644     private function structural(array $node, string $path, array $dynamic): array
    645     {
    646         $out = [];
    647         if (isset($node['type']) && (is_string($node['type']) || is_array($node['type']))) {
    648             $type = $node['type'];
    649             if (is_array($type)) {
    650                 $type = array_values(array_filter($type, 'is_string'));
    651                 sort($type);
    652             }
    653             $out['type'] = $type;
    654         }
    655         if (isset($node['properties']) && is_array($node['properties'])) {
    656             $props = [];
    657             foreach ($node['properties'] as $key => $child) {
    658                 $childPath = $path === '' ? (string) $key : $path . '.' . $key;
    659                 $props[(string) $key] = is_array($child) ? $this->structural($child, $childPath, $dynamic) : [];
    660             }
    661             ksort($props);
    662             $out['properties'] = $props === [] ? new \stdClass() : $props;
    663         }
    664         if (isset($node['required']) && is_array($node['required'])) {
    665             $req = array_values(array_filter($node['required'], 'is_string'));
    666             sort($req);
    667             $out['required'] = $req;
    668         }
    669         if (isset($node['items']) && is_array($node['items'])) {
    670             $out['items'] = $this->structural($node['items'], $path, $dynamic);
    671         }
    672         if (array_key_exists('additionalProperties', $node)) {
    673             $out['additionalProperties'] = is_array($node['additionalProperties'])
    674                 ? $this->structural($node['additionalProperties'], $path, $dynamic)
    675                 : (bool) $node['additionalProperties'];
    676         }
    677         if (isset($node['enum']) && is_array($node['enum']) && !in_array($path, $dynamic, true)) {
    678             $enum = array_map(static fn ($v) => is_scalar($v) ? $v : null, array_values($node['enum']));
    679             usort($enum, static fn ($a, $b) => strcmp((string) json_encode($a), (string) json_encode($b)));
    680             $out['enum'] = $enum;
    681         }
    682         ksort($out);
    683 
    684         return $out;
     619        return AbilitySchema::hashOf($ability, $dynamic);
    685620    }
    686621
  • fleet-agent-site-manager/tags/0.61.155/readme.txt

    r3721588 r3722324  
    55Tested up to: 7.1
    66Requires PHP: 8.1
    7 Stable tag: 0.61.154
     7Stable tag: 0.61.155
    88License: MIT
    99License URI: https://opensource.org/licenses/MIT
    … …  
    286286
    287287The entries below summarize the notable changes since 0.31.1. This project ships frequently and not every intermediate patch release is listed here. Full history: https://github.com/mosamlife/wpmgr/blob/main/CHANGELOG.md
     288
     289= 0.61.155 =
     290* Added: a signed command the control plane uses to list the tools (abilities) a site registers, and to run WPMgr's own read-only abilities: list the site's abilities, report site facts, and read the text of a published page. It changes nothing on the site. It sends the names, labels and descriptions of registered abilities, with each one's owner type, site facts (WordPress and PHP versions, theme and active plugin names), and, for a published page without a password that the control plane asks for, that page's title and text.
    288291
    289292= 0.61.154 =
    … …  
    476479== Upgrade Notice ==
    477480
     481= 0.61.155 =
     482Adds a signed command the control plane uses to list the tools (abilities) a site registers and to run WPMgr's own read-only abilities. It changes nothing on the site. It sends the names, labels and descriptions of registered abilities, with each one's owner type, site facts (WordPress and PHP versions, theme and active plugin names), and, for a published page without a password that the control plane asks for, that page's title and text.
     483
    478484= 0.61.154 =
    479485Adds a read-only check the control plane can run to see which editor owns each page and whether it is a special page. It changes nothing on the site and does not send page body text or stored builder data; it sends published page titles and, for a single page, editor display names.
  • fleet-agent-site-manager/tags/0.61.155/vendor/composer/autoload_classmap.php

    r3721588 r3722324  
    2020    'MatthiasMullie\\PathConverter\\NoConverter' => $vendorDir . '/matthiasmullie/path-converter/src/NoConverter.php',
    2121    'Symfony\\Polyfill\\Mbstring\\Mbstring' => $vendorDir . '/symfony/polyfill-mbstring/Mbstring.php',
     22    'WPMgr\\Agent\\Abilities\\AbilityDenylist' => $baseDir . '/includes/abilities/class-ability-denylist.php',
     23    'WPMgr\\Agent\\Abilities\\AbilityGuards' => $baseDir . '/includes/abilities/class-ability-guards.php',
     24    'WPMgr\\Agent\\Abilities\\AbilitySchema' => $baseDir . '/includes/abilities/class-ability-schema.php',
     25    'WPMgr\\Agent\\Abilities\\OwnAbilities' => $baseDir . '/includes/abilities/class-own-abilities.php',
    2226    'WPMgr\\Agent\\Admin' => $baseDir . '/includes/class-admin.php',
    2327    'WPMgr\\Agent\\AutoOptimizeUpload' => $baseDir . '/includes/class-auto-optimize-upload.php',
    … …  
    6973    'WPMgr\\Agent\\Cache\\WpCacheConstant' => $baseDir . '/includes/cache/class-wp-cache-constant.php',
    7074    'WPMgr\\Agent\\Cache\\WpConfigEditor' => $baseDir . '/includes/cache/class-wp-config-editor.php',
     75    'WPMgr\\Agent\\Commands\\AbilityRunCommand' => $baseDir . '/includes/commands/class-ability-run-command.php',
    7176    'WPMgr\\Agent\\Commands\\AgentSelfUpdateCommand' => $baseDir . '/includes/commands/class-agent-self-update-command.php',
    7277    'WPMgr\\Agent\\Commands\\AutologinCommand' => $baseDir . '/includes/commands/class-autologin-command.php',
  • fleet-agent-site-manager/tags/0.61.155/vendor/composer/autoload_static.php

    r3721588 r3722324  
    6060        'MatthiasMullie\\PathConverter\\NoConverter' => __DIR__ . '/..' . '/matthiasmullie/path-converter/src/NoConverter.php',
    6161        'Symfony\\Polyfill\\Mbstring\\Mbstring' => __DIR__ . '/..' . '/symfony/polyfill-mbstring/Mbstring.php',
     62        'WPMgr\\Agent\\Abilities\\AbilityDenylist' => __DIR__ . '/../..' . '/includes/abilities/class-ability-denylist.php',
     63        'WPMgr\\Agent\\Abilities\\AbilityGuards' => __DIR__ . '/../..' . '/includes/abilities/class-ability-guards.php',
     64        'WPMgr\\Agent\\Abilities\\AbilitySchema' => __DIR__ . '/../..' . '/includes/abilities/class-ability-schema.php',
     65        'WPMgr\\Agent\\Abilities\\OwnAbilities' => __DIR__ . '/../..' . '/includes/abilities/class-own-abilities.php',
    6266        'WPMgr\\Agent\\Admin' => __DIR__ . '/../..' . '/includes/class-admin.php',
    6367        'WPMgr\\Agent\\AutoOptimizeUpload' => __DIR__ . '/../..' . '/includes/class-auto-optimize-upload.php',
    … …  
    109113        'WPMgr\\Agent\\Cache\\WpCacheConstant' => __DIR__ . '/../..' . '/includes/cache/class-wp-cache-constant.php',
    110114        'WPMgr\\Agent\\Cache\\WpConfigEditor' => __DIR__ . '/../..' . '/includes/cache/class-wp-config-editor.php',
     115        'WPMgr\\Agent\\Commands\\AbilityRunCommand' => __DIR__ . '/../..' . '/includes/commands/class-ability-run-command.php',
    111116        'WPMgr\\Agent\\Commands\\AgentSelfUpdateCommand' => __DIR__ . '/../..' . '/includes/commands/class-agent-self-update-command.php',
    112117        'WPMgr\\Agent\\Commands\\AutologinCommand' => __DIR__ . '/../..' . '/includes/commands/class-autologin-command.php',
  • fleet-agent-site-manager/trunk/fleet-agent-site-manager.php

    r3721588 r3722324  
    44 * Plugin URI:        https://github.com/mosamlife/wpmgr
    55 * Description:        Connects this WordPress site to a WPMgr control plane for backups, updates, monitoring, and security scanning.
    6  * Version:           0.61.154
     6 * Version:           0.61.155
    77 * Requires at least: 6.2
    88 * Requires PHP:      8.1
    … …  
    2121}
    2222
    23 define('WPMGR_AGENT_VERSION', '0.61.154');
     23define('WPMGR_AGENT_VERSION', '0.61.155');
    2424define('WPMGR_WPORG_BUILD', true);
    2525
  • fleet-agent-site-manager/trunk/includes/class-plugin.php

    r3721588 r3722324  
    5656use WPMgr\Agent\Commands\UnblockIpCommand;
    5757use WPMgr\Agent\Commands\UpdateCommand;
     58use WPMgr\Agent\Abilities\OwnAbilities;
     59use WPMgr\Agent\Commands\AbilityRunCommand;
    5860use WPMgr\Agent\Commands\ContentProbeCommand;
    5961use WPMgr\Agent\Commands\ContentUpdateCommand;
    … …  
    698700        }
    699701
     702        // WPMgr's own read abilities, offered to the WordPress Abilities API
     703        // (6.9+). These hooks never fire on older WordPress; the engine runs
     704        // the same abilities in-process either way.
     705        add_action('wp_abilities_api_categories_init', [OwnAbilities::class, 'registerCategory']);
     706        add_action('wp_abilities_api_init', [OwnAbilities::class, 'registerAbilities']);
     707
    700708        add_action('rest_api_init', [$this->router, 'registerRoutes']);
    701709        add_action('rest_api_init', [$this, 'registerAutologinRoute']);
    … …  
    20292037            // post_content is what a visitor sees for a page. Writes nothing.
    20302038            new ContentProbeCommand(),
     2039            // The engine's signed command: modes read, precheck and ledger,
     2040            // for WPMgr's own wpmgr/* abilities only. Params are digest-bound
     2041            // to the token (claim pd) over the exact JSON bytes.
     2042            new AbilityRunCommand(),
    20312043            // M5.6 / ADR-033: BackupCommand validates the signed CP request,
    20322044            // dedups, seeds the wpmgr_backup_tasks row, schedules the
  • fleet-agent-site-manager/trunk/includes/commands/class-content-probe-command.php

    r3721588 r3722324  
    44
    55namespace WPMgr\Agent\Commands;
     6
     7use WPMgr\Agent\Abilities\AbilitySchema;
    68
    79// Direct-file-access guard: keep above the docblock (see the note in
    … …  
    607609
    608610    /**
    609      * Structural hash of an ability's input schema: type, property names
    610      * (recursively), required, items, additionalProperties and enum values,
    611      * with enum dropped at dynamic paths. Titles, descriptions, examples,
    612      * defaults and translated text never contribute, and keys are sorted, so a
    613      * locale change or a newly registered element type does not change the
    614      * hash but a real change of shape does.
     611     * Structural hash of an ability's input schema (see AbilitySchema).
    615612     *
    616613     * @param object       $ability Registered ability.
    … …  
    620617    private function schemaHash(object $ability, array $dynamic): ?string
    621618    {
    622         if (!method_exists($ability, 'get_input_schema')) {
    623             return null;
    624         }
    625         try {
    626             $schema = $ability->get_input_schema();
    627         } catch (\Throwable $e) {
    628             return null;
    629         }
    630         if (!is_array($schema)) {
    631             return null;
    632         }
    633         $json = json_encode($this->structural($schema, '', $dynamic));
    634 
    635         return is_string($json) ? 'sha256:' . hash('sha256', $json) : null;
    636     }
    637 
    638     /**
    639      * @param array<mixed> $node    Schema node.
    640      * @param string       $path    Dotted property path of this node.
    641      * @param list<string> $dynamic Dynamic enum paths.
    642      * @return array<mixed>
    643      */
    644     private function structural(array $node, string $path, array $dynamic): array
    645     {
    646         $out = [];
    647         if (isset($node['type']) && (is_string($node['type']) || is_array($node['type']))) {
    648             $type = $node['type'];
    649             if (is_array($type)) {
    650                 $type = array_values(array_filter($type, 'is_string'));
    651                 sort($type);
    652             }
    653             $out['type'] = $type;
    654         }
    655         if (isset($node['properties']) && is_array($node['properties'])) {
    656             $props = [];
    657             foreach ($node['properties'] as $key => $child) {
    658                 $childPath = $path === '' ? (string) $key : $path . '.' . $key;
    659                 $props[(string) $key] = is_array($child) ? $this->structural($child, $childPath, $dynamic) : [];
    660             }
    661             ksort($props);
    662             $out['properties'] = $props === [] ? new \stdClass() : $props;
    663         }
    664         if (isset($node['required']) && is_array($node['required'])) {
    665             $req = array_values(array_filter($node['required'], 'is_string'));
    666             sort($req);
    667             $out['required'] = $req;
    668         }
    669         if (isset($node['items']) && is_array($node['items'])) {
    670             $out['items'] = $this->structural($node['items'], $path, $dynamic);
    671         }
    672         if (array_key_exists('additionalProperties', $node)) {
    673             $out['additionalProperties'] = is_array($node['additionalProperties'])
    674                 ? $this->structural($node['additionalProperties'], $path, $dynamic)
    675                 : (bool) $node['additionalProperties'];
    676         }
    677         if (isset($node['enum']) && is_array($node['enum']) && !in_array($path, $dynamic, true)) {
    678             $enum = array_map(static fn ($v) => is_scalar($v) ? $v : null, array_values($node['enum']));
    679             usort($enum, static fn ($a, $b) => strcmp((string) json_encode($a), (string) json_encode($b)));
    680             $out['enum'] = $enum;
    681         }
    682         ksort($out);
    683 
    684         return $out;
     619        return AbilitySchema::hashOf($ability, $dynamic);
    685620    }
    686621
  • fleet-agent-site-manager/trunk/readme.txt

    r3721588 r3722324  
    55Tested up to: 7.1
    66Requires PHP: 8.1
    7 Stable tag: 0.61.154
     7Stable tag: 0.61.155
    88License: MIT
    99License URI: https://opensource.org/licenses/MIT
    … …  
    286286
    287287The entries below summarize the notable changes since 0.31.1. This project ships frequently and not every intermediate patch release is listed here. Full history: https://github.com/mosamlife/wpmgr/blob/main/CHANGELOG.md
     288
     289= 0.61.155 =
     290* Added: a signed command the control plane uses to list the tools (abilities) a site registers, and to run WPMgr's own read-only abilities: list the site's abilities, report site facts, and read the text of a published page. It changes nothing on the site. It sends the names, labels and descriptions of registered abilities, with each one's owner type, site facts (WordPress and PHP versions, theme and active plugin names), and, for a published page without a password that the control plane asks for, that page's title and text.
    288291
    289292= 0.61.154 =
    … …  
    476479== Upgrade Notice ==
    477480
     481= 0.61.155 =
     482Adds a signed command the control plane uses to list the tools (abilities) a site registers and to run WPMgr's own read-only abilities. It changes nothing on the site. It sends the names, labels and descriptions of registered abilities, with each one's owner type, site facts (WordPress and PHP versions, theme and active plugin names), and, for a published page without a password that the control plane asks for, that page's title and text.
     483
    478484= 0.61.154 =
    479485Adds a read-only check the control plane can run to see which editor owns each page and whether it is a special page. It changes nothing on the site and does not send page body text or stored builder data; it sends published page titles and, for a single page, editor display names.
  • fleet-agent-site-manager/trunk/vendor/composer/autoload_classmap.php

    r3721588 r3722324  
    2020    'MatthiasMullie\\PathConverter\\NoConverter' => $vendorDir . '/matthiasmullie/path-converter/src/NoConverter.php',
    2121    'Symfony\\Polyfill\\Mbstring\\Mbstring' => $vendorDir . '/symfony/polyfill-mbstring/Mbstring.php',
     22    'WPMgr\\Agent\\Abilities\\AbilityDenylist' => $baseDir . '/includes/abilities/class-ability-denylist.php',
     23    'WPMgr\\Agent\\Abilities\\AbilityGuards' => $baseDir . '/includes/abilities/class-ability-guards.php',
     24    'WPMgr\\Agent\\Abilities\\AbilitySchema' => $baseDir . '/includes/abilities/class-ability-schema.php',
     25    'WPMgr\\Agent\\Abilities\\OwnAbilities' => $baseDir . '/includes/abilities/class-own-abilities.php',
    2226    'WPMgr\\Agent\\Admin' => $baseDir . '/includes/class-admin.php',
    2327    'WPMgr\\Agent\\AutoOptimizeUpload' => $baseDir . '/includes/class-auto-optimize-upload.php',
    … …  
    6973    'WPMgr\\Agent\\Cache\\WpCacheConstant' => $baseDir . '/includes/cache/class-wp-cache-constant.php',
    7074    'WPMgr\\Agent\\Cache\\WpConfigEditor' => $baseDir . '/includes/cache/class-wp-config-editor.php',
     75    'WPMgr\\Agent\\Commands\\AbilityRunCommand' => $baseDir . '/includes/commands/class-ability-run-command.php',
    7176    'WPMgr\\Agent\\Commands\\AgentSelfUpdateCommand' => $baseDir . '/includes/commands/class-agent-self-update-command.php',
    7277    'WPMgr\\Agent\\Commands\\AutologinCommand' => $baseDir . '/includes/commands/class-autologin-command.php',
  • fleet-agent-site-manager/trunk/vendor/composer/autoload_static.php

    r3721588 r3722324  
    6060        'MatthiasMullie\\PathConverter\\NoConverter' => __DIR__ . '/..' . '/matthiasmullie/path-converter/src/NoConverter.php',
    6161        'Symfony\\Polyfill\\Mbstring\\Mbstring' => __DIR__ . '/..' . '/symfony/polyfill-mbstring/Mbstring.php',
     62        'WPMgr\\Agent\\Abilities\\AbilityDenylist' => __DIR__ . '/../..' . '/includes/abilities/class-ability-denylist.php',
     63        'WPMgr\\Agent\\Abilities\\AbilityGuards' => __DIR__ . '/../..' . '/includes/abilities/class-ability-guards.php',
     64        'WPMgr\\Agent\\Abilities\\AbilitySchema' => __DIR__ . '/../..' . '/includes/abilities/class-ability-schema.php',
     65        'WPMgr\\Agent\\Abilities\\OwnAbilities' => __DIR__ . '/../..' . '/includes/abilities/class-own-abilities.php',
    6266        'WPMgr\\Agent\\Admin' => __DIR__ . '/../..' . '/includes/class-admin.php',
    6367        'WPMgr\\Agent\\AutoOptimizeUpload' => __DIR__ . '/../..' . '/includes/class-auto-optimize-upload.php',
    … …  
    109113        'WPMgr\\Agent\\Cache\\WpCacheConstant' => __DIR__ . '/../..' . '/includes/cache/class-wp-cache-constant.php',
    110114        'WPMgr\\Agent\\Cache\\WpConfigEditor' => __DIR__ . '/../..' . '/includes/cache/class-wp-config-editor.php',
     115        'WPMgr\\Agent\\Commands\\AbilityRunCommand' => __DIR__ . '/../..' . '/includes/commands/class-ability-run-command.php',
    111116        'WPMgr\\Agent\\Commands\\AgentSelfUpdateCommand' => __DIR__ . '/../..' . '/includes/commands/class-agent-self-update-command.php',
    112117        'WPMgr\\Agent\\Commands\\AutologinCommand' => __DIR__ . '/../..' . '/includes/commands/class-autologin-command.php',
Note: See TracChangeset for help on using the changeset viewer.