PluginProbe
ThinkRank AI SEO – AI SEO Plugin for WordPress: Schema, XML Sitemaps, Meta Tags, Search Console & Local SEO / 2.7.0
ThinkRank AI SEO – AI SEO Plugin for WordPress: Schema, XML Sitemaps, Meta Tags, Search Console & Local SEO v2.7.0
2.7.0 2.6.0 2.5.0 2.4.0 2.3.0 2.2.0 2.1.1 2.1.0 2.0.2 2.0.1 2.0.0 1.32.0 1.31.0 1.30.0 1.29.0 1.28.0 1.27.0 1.26.0 1.25.0 trunk 1.0.0 1.0.1 1.0.2 1.1.0 1.10.0 All 48 releases
← All changes | includes/abilities/class-ability-base.php +22 -0 1.28.02.7.0 View file →
@@ -61,8 +61,30 @@
61 61 */
62 62 protected $capability = 'manage_options';
63 63
64 64 /**
65 + * An empty JSON Schema `properties` map.
66 + *
67 + * A schema that takes no arguments still has to say so, and the shape it
68 + * says it in matters twice over:
69 + *
70 + * - `[]` JSON-encodes as `[]`. JSON Schema requires an object there, and
71 + * strict MCP clients reject the array form (#476).
72 + * - `(object) []` encodes as `{}` but is not array-accessible, and
73 + * `rest_validate_object_value_from_schema()` indexes into the map —
74 + * `isset( $args['properties'][ $key ] )`. On PHP 8 that is a fatal
75 + * `Error`, so a single unexpected input key turns a clean 400 into a 500.
76 + *
77 + * `ArrayObject` is the shape that satisfies both: it JSON-encodes as `{}`
78 + * and still answers array access, so core validation runs as it always did.
79 + *
80 + * @return \ArrayObject<string, mixed> Empty properties map.
81 + */
82 + protected static function empty_properties() {
83 + return new \ArrayObject();
84 + }
85 +
86 + /**
65 87 * Get the JSON Schema for ability input.
66 88 *
67 89 * @return array<string, mixed>
68 90 */