Skip to content

Commit 7736905

Browse files
authored
chore: align reqs with WP6.9 merge target (#18)
* chore: align reqs with WP6.9 * ci: remove from test * chore: align version numbers to 0.1.0
1 parent 9806cae commit 7736905

File tree

8 files changed

+39
-40
lines changed

8 files changed

+39
-40
lines changed

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ jobs:
178178
strategy:
179179
matrix:
180180
php: ['8.4', '8.3', '8.2', '8.1', '8.0', '7.4']
181-
wp: [latest, trunk, '6.7']
181+
wp: [latest, trunk ]
182182
coverage: [false]
183183
include:
184184
- php: '8.4'

CONTRIBUTING.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ Join the `#core-ai` channel [on WordPress Slack](http://wordpress.slack.com) ([s
1010

1111
## Coding standards
1212

13-
In general, all code must follow the [WordPress Coding Standards and best practices](https://developer.wordpress.org/coding-standards/). All code in the Performance Lab plugin must follow these requirements:
13+
In general, all code must follow the [WordPress Coding Standards and best practices](https://developer.wordpress.org/coding-standards/). All code in the Abilities API plugin must follow these requirements:
1414

15-
- **WordPress**: As of Performance Lab v0.0.1, released {@todo}, the plugin's minimum WordPress version requirement is 6.7.
16-
- **PHP**: The minimum required version right now is 7.4. This is subject to change and will be brought in sync with the WordPress core minimum PHP version requirement closer to release.
15+
- **WordPress**: The plugin's minimum WordPress version requirement is 6.8.
16+
- **PHP**: The minimum required version of the code slated for WordPress Core includes is PHP7.2, but the tooling and development environment requires PHP 7.4 or higher.
1717

1818
We include [several tools](#useful-commands) to help ensure your code meets contribution
1919

abilities-api.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@
1111
* Plugin Name: Abilities API
1212
* Plugin URI: https://github.com/WordPress/abilities-api
1313
* Description: Provides a framework for registering and executing AI abilities in WordPress.
14-
* Requires at least: 6.7
15-
* Version: 0.0.1
16-
* Requires PHP: 7.4
14+
* Requires at least: 6.8
15+
* Version: 0.1.0
16+
* Requires PHP: 7.2
1717
* Author: WordPress.org Contributors
1818
* Author URI: https://github.com/WordPress/abilities-api/graphs/contributors
1919
* License: GPLv2 or later
@@ -29,7 +29,7 @@
2929
/**
3030
* Version of the plugin.
3131
*/
32-
define( 'WP_ABILITIES_API_VERSION', '0.0.1' );
32+
define( 'WP_ABILITIES_API_VERSION', '0.1.0' );
3333

3434
/**
3535
* First the WP_Ability class that users can extend.

composer.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"description": "AI Abilities for WordPress",
44
"license": "GPL-2.0-or-later",
55
"type": "wordpress-plugin",
6+
"version": "0.1.0",
67
"keywords": [
78
"ai",
89
"llm",

includes/rest-api/endpoints/class-wp-rest-abilities-list-controller.php

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ public function register_routes(): void {
6969
array(
7070
'args' => array(
7171
'name' => array(
72-
'description' => __( 'Unique identifier for the ability.', 'abilities-api' ),
72+
'description' => __( 'Unique identifier for the ability.' ),
7373
'type' => 'string',
7474
'pattern' => '^[a-zA-Z0-9\-\/]+$',
7575
),
@@ -152,7 +152,7 @@ public function get_item( $request ) {
152152
if ( ! $ability ) {
153153
return new \WP_Error(
154154
'rest_ability_not_found',
155-
__( 'Ability not found.', 'abilities-api' ),
155+
__( 'Ability not found.' ),
156156
array( 'status' => 404 )
157157
);
158158
}
@@ -233,37 +233,37 @@ public function get_item_schema(): array {
233233
'type' => 'object',
234234
'properties' => array(
235235
'name' => array(
236-
'description' => __( 'Unique identifier for the ability.', 'abilities-api' ),
236+
'description' => __( 'Unique identifier for the ability.' ),
237237
'type' => 'string',
238238
'context' => array( 'view', 'edit', 'embed' ),
239239
'readonly' => true,
240240
),
241241
'label' => array(
242-
'description' => __( 'Display label for the ability.', 'abilities-api' ),
242+
'description' => __( 'Display label for the ability.' ),
243243
'type' => 'string',
244244
'context' => array( 'view', 'edit', 'embed' ),
245245
'readonly' => true,
246246
),
247247
'description' => array(
248-
'description' => __( 'Description of the ability.', 'abilities-api' ),
248+
'description' => __( 'Description of the ability.' ),
249249
'type' => 'string',
250250
'context' => array( 'view', 'edit' ),
251251
'readonly' => true,
252252
),
253253
'input_schema' => array(
254-
'description' => __( 'JSON Schema for the ability input.', 'abilities-api' ),
254+
'description' => __( 'JSON Schema for the ability input.' ),
255255
'type' => 'object',
256256
'context' => array( 'view', 'edit' ),
257257
'readonly' => true,
258258
),
259259
'output_schema' => array(
260-
'description' => __( 'JSON Schema for the ability output.', 'abilities-api' ),
260+
'description' => __( 'JSON Schema for the ability output.' ),
261261
'type' => 'object',
262262
'context' => array( 'view', 'edit' ),
263263
'readonly' => true,
264264
),
265265
'meta' => array(
266-
'description' => __( 'Meta information about the ability.', 'abilities-api' ),
266+
'description' => __( 'Meta information about the ability.' ),
267267
'type' => 'object',
268268
'context' => array( 'view', 'edit' ),
269269
'readonly' => true,
@@ -286,15 +286,15 @@ public function get_collection_params(): array {
286286
return array(
287287
'context' => $this->get_context_param( array( 'default' => 'view' ) ),
288288
'page' => array(
289-
'description' => __( 'Current page of the collection.', 'abilities-api' ),
289+
'description' => __( 'Current page of the collection.' ),
290290
'type' => 'integer',
291291
'default' => 1,
292292
'sanitize_callback' => 'absint',
293293
'validate_callback' => 'rest_validate_request_arg',
294294
'minimum' => 1,
295295
),
296296
'per_page' => array(
297-
'description' => __( 'Maximum number of items to be returned in result set.', 'abilities-api' ),
297+
'description' => __( 'Maximum number of items to be returned in result set.' ),
298298
'type' => 'integer',
299299
'default' => self::DEFAULT_PER_PAGE,
300300
'minimum' => 1,

includes/rest-api/endpoints/class-wp-rest-abilities-run-controller.php

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public function register_routes(): void {
4747
array(
4848
'args' => array(
4949
'name' => array(
50-
'description' => __( 'Unique identifier for the ability.', 'abilities-api' ),
50+
'description' => __( 'Unique identifier for the ability.' ),
5151
'type' => 'string',
5252
'pattern' => '^[a-zA-Z0-9\-\/]+$',
5353
),
@@ -84,7 +84,7 @@ public function run_ability_with_method_check( $request ) {
8484
if ( ! $ability ) {
8585
return new \WP_Error(
8686
'rest_ability_not_found',
87-
__( 'Ability not found.', 'abilities-api' ),
87+
__( 'Ability not found.' ),
8888
array( 'status' => 404 )
8989
);
9090
}
@@ -97,15 +97,15 @@ public function run_ability_with_method_check( $request ) {
9797
if ( 'resource' === $type && 'GET' !== $method ) {
9898
return new \WP_Error(
9999
'rest_invalid_method',
100-
__( 'Resource abilities require GET method.', 'abilities-api' ),
100+
__( 'Resource abilities require GET method.' ),
101101
array( 'status' => 405 )
102102
);
103103
}
104104

105105
if ( 'tool' === $type && 'POST' !== $method ) {
106106
return new \WP_Error(
107107
'rest_invalid_method',
108-
__( 'Tool abilities require POST method.', 'abilities-api' ),
108+
__( 'Tool abilities require POST method.' ),
109109
array( 'status' => 405 )
110110
);
111111
}
@@ -127,7 +127,7 @@ public function run_ability( $request ) {
127127
if ( ! $ability ) {
128128
return new \WP_Error(
129129
'rest_ability_not_found',
130-
__( 'Ability not found.', 'abilities-api' ),
130+
__( 'Ability not found.' ),
131131
array( 'status' => 404 )
132132
);
133133
}
@@ -156,7 +156,7 @@ public function run_ability( $request ) {
156156
if ( is_null( $result ) ) {
157157
return new \WP_Error(
158158
'rest_ability_execution_failed',
159-
__( 'Ability execution failed. Please check permissions and input parameters.', 'abilities-api' ),
159+
__( 'Ability execution failed. Please check permissions and input parameters.' ),
160160
array( 'status' => 500 )
161161
);
162162
}
@@ -183,7 +183,7 @@ public function run_ability_permissions_check( $request ) {
183183
if ( ! $ability ) {
184184
return new \WP_Error(
185185
'rest_ability_not_found',
186-
__( 'Ability not found.', 'abilities-api' ),
186+
__( 'Ability not found.' ),
187187
array( 'status' => 404 )
188188
);
189189
}
@@ -193,7 +193,7 @@ public function run_ability_permissions_check( $request ) {
193193
if ( ! $ability->has_permission( $input ) ) {
194194
return new \WP_Error(
195195
'rest_cannot_execute',
196-
__( 'Sorry, you are not allowed to execute this ability.', 'abilities-api' ),
196+
__( 'Sorry, you are not allowed to execute this ability.' ),
197197
array( 'status' => rest_authorization_required_code() )
198198
);
199199
}
@@ -223,7 +223,7 @@ private function validate_input( $ability, $input ) {
223223
'rest_invalid_param',
224224
sprintf(
225225
/* translators: %s: error message */
226-
__( 'Invalid input parameters: %s', 'abilities-api' ),
226+
__( 'Invalid input parameters: %s' ),
227227
$validation_result->get_error_message()
228228
),
229229
array( 'status' => 400 )
@@ -255,7 +255,7 @@ private function validate_output( $ability, $output ) {
255255
'rest_invalid_response',
256256
sprintf(
257257
/* translators: %s: error message */
258-
__( 'Invalid response from ability: %s', 'abilities-api' ),
258+
__( 'Invalid response from ability: %s' ),
259259
$validation_result->get_error_message()
260260
),
261261
array( 'status' => 500 )
@@ -299,7 +299,7 @@ private function get_input_from_request( $request ) {
299299
public function get_run_args(): array {
300300
return array(
301301
'input' => array(
302-
'description' => __( 'Input parameters for the ability execution.', 'abilities-api' ),
302+
'description' => __( 'Input parameters for the ability execution.' ),
303303
'type' => 'object',
304304
'default' => array(),
305305
),
@@ -320,7 +320,7 @@ public function get_run_schema(): array {
320320
'type' => 'object',
321321
'properties' => array(
322322
'result' => array(
323-
'description' => __( 'The result of the ability execution.', 'abilities-api' ),
323+
'description' => __( 'The result of the ability execution.' ),
324324
'type' => 'mixed',
325325
'context' => array( 'view' ),
326326
'readonly' => true,

phpcs.xml.dist

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,13 @@
4141
Tests for PHP version compatibility.
4242
https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards#Recomended-additional-rulesets
4343
-->
44-
<config name="testVersion" value="7.4-" />
44+
<config name="testVersion" value="7.2-" />
4545

4646
<!--
4747
Tests for WordPress version compatibility.
4848
https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards/wiki/Customizable-sniff-properties
4949
-->
50-
<config name="minimum_wp_version" value="6.7" />
50+
<config name="minimum_wp_version" value="6.8" />
5151

5252
<!--
5353
Load WordPress VIP Go standards
@@ -59,9 +59,8 @@
5959
<exclude name="WordPressVIPMinimum.JS" />
6060
</rule>
6161
<rule ref="WordPress-Extra">
62-
<!-- @todo: Determine a strategy on namespacing/merging into core. -->
6362
<exclude name="WordPress.WP.I18n.MissingArgDomain" />
64-
<exclude name="WordPress.NamingConventions.PrefixAllGlobals" />
63+
<exclude name="WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedFunctionFound" />
6564
<!-- Needed to typehint, see: https://github.com/WordPress/WordPress-Coding-Standards/issues/403 -->
6665
<exclude name="Generic.Commenting.DocComment.MissingShort" />
6766
</rule>
@@ -196,21 +195,20 @@
196195
<rule ref="WordPress.NamingConventions.PrefixAllGlobals">
197196
<properties>
198197
<property name="prefixes" type="array">
199-
<!-- @todo: Should we use a namespace or prefix ? -->
200-
<element value="abilities_api" />
198+
<element value="abilities_api_" /><!-- Hook prefix -->
201199
<element value="WP_Ability" />
202200
<element value="WP_Abilities" />
203-
<element value="WP_ABILITIES_API" />
204201
<element value="WP_REST_Abilities" />
202+
<element value="WP_ABILITIES_API" /> <!-- Constant -->
205203
</property>
206204
</properties>
207205
</rule>
208206

209207
<rule ref="WordPress.WP.I18n">
210208
<properties>
211209
<property name="text_domain" type="array">
212-
<!-- Value: replace the text domain(s) used. -->
213-
<element value="abilities-api" />
210+
<!-- If flagged, remove the text-domain entirely. -->
211+
<element value="" />
214212
</property>
215213
</properties>
216214
</rule>

phpstan.neon.dist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ parameters:
1515
# Configuration
1616
level: 8
1717
phpVersion:
18-
min: 70400
18+
min: 70200
1919
max: 80300
2020
bootstrapFiles:
2121
- abilities-api.php

0 commit comments

Comments
 (0)