PluginProbe
Imagify Image Optimization: Optimize Images | Compress & Convert to WebP/AVIF / 2.3.0
Imagify Image Optimization: Optimize Images | Compress & Convert to WebP/AVIF v2.3.0
2.3.4 2.3.3 2.3.2 2.3.1 2.3.0 2.2.9 2.2.8 trunk 1.10 1.3.3 1.3.4 1.3.5 1.3.5.1 1.3.5.2 1.3.6 1.3.6.1 1.4 1.4.1 1.4.2 1.4.3 1.4.4 1.4.5 1.4.6 1.4.7 1.5 All 103 releases
imagify / classes / Abilities / AbilitiesInterface.php

AbilitiesInterface.php in Imagify Image Optimization: Optimize Images | Compress & Convert to WebP/AVIF 2.3.0, at classes/Abilities/AbilitiesInterface.php

45 lines 1.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 declare(strict_types=1);
3
4 namespace Imagify\Abilities;
5
6 /**
7 * Contract that every Imagify MCP ability must implement.
8 *
9 * Each ability is responsible for registering itself with the WP Abilities API,
10 * verifying that the current user has sufficient permissions, and executing the
11 * ability's business logic when invoked by the MCP layer.
12 *
13 * @since 2.3.0
14 */
15 interface AbilitiesInterface {
16
17 /**
18 * Register the ability with the WP Abilities API.
19 *
20 * Implementations must call `wp_register_ability()` (guarded by
21 * `function_exists()`) and wire `execute_callback` and `permission_callback`
22 * to the concrete class's own methods.
23 *
24 * @return void
25 */
26 public function register(): void;
27
28 /**
29 * Check if the current user has permission to execute this ability.
30 *
31 * @return bool True if the current user may execute the ability.
32 */
33 public function check_permissions(): bool;
34
35 /**
36 * Execute the ability and return the tool result.
37 *
38 * The return type is intentionally untyped because abilities may return a
39 * tool-result array, a resource string, or any other MCP-compatible value.
40 *
41 * @return mixed
42 */
43 public function execute();
44 }
45