claude-plugin-wordpress-manager 2.4.0 → 2.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. package/.claude-plugin/plugin.json +10 -3
  2. package/CHANGELOG.md +42 -0
  3. package/agents/wp-content-strategist.md +104 -0
  4. package/docs/GUIDE.md +183 -23
  5. package/package.json +12 -3
  6. package/servers/wp-rest-bridge/build/tools/comments.d.ts +6 -6
  7. package/servers/wp-rest-bridge/build/tools/gsc.d.ts +3 -0
  8. package/servers/wp-rest-bridge/build/tools/gsc.js +354 -0
  9. package/servers/wp-rest-bridge/build/tools/index.d.ts +38 -38
  10. package/servers/wp-rest-bridge/build/tools/index.js +3 -0
  11. package/servers/wp-rest-bridge/build/tools/media.d.ts +2 -2
  12. package/servers/wp-rest-bridge/build/tools/multisite-sites.d.ts +2 -2
  13. package/servers/wp-rest-bridge/build/tools/plugin-repository.d.ts +1 -1
  14. package/servers/wp-rest-bridge/build/tools/search.d.ts +2 -2
  15. package/servers/wp-rest-bridge/build/tools/unified-content.d.ts +8 -8
  16. package/servers/wp-rest-bridge/build/tools/unified-taxonomies.d.ts +4 -4
  17. package/servers/wp-rest-bridge/build/tools/users.d.ts +6 -6
  18. package/servers/wp-rest-bridge/build/tools/wc-coupons.d.ts +1 -1
  19. package/servers/wp-rest-bridge/build/tools/wc-customers.d.ts +3 -3
  20. package/servers/wp-rest-bridge/build/tools/wc-orders.d.ts +4 -4
  21. package/servers/wp-rest-bridge/build/tools/wc-products.d.ts +8 -8
  22. package/servers/wp-rest-bridge/build/tools/wc-webhooks.d.ts +4 -4
  23. package/servers/wp-rest-bridge/build/wordpress.d.ts +5 -0
  24. package/servers/wp-rest-bridge/build/wordpress.js +39 -0
  25. package/servers/wp-rest-bridge/package.json +1 -0
  26. package/skills/wordpress-router/references/decision-tree.md +6 -2
  27. package/skills/wp-content/SKILL.md +1 -0
  28. package/skills/wp-content-attribution/SKILL.md +2 -0
  29. package/skills/wp-content-optimization/SKILL.md +172 -0
  30. package/skills/wp-content-optimization/references/content-freshness.md +234 -0
  31. package/skills/wp-content-optimization/references/headline-optimization.md +171 -0
  32. package/skills/wp-content-optimization/references/meta-optimization.md +243 -0
  33. package/skills/wp-content-optimization/references/readability-analysis.md +201 -0
  34. package/skills/wp-content-optimization/references/seo-content-scoring.md +245 -0
  35. package/skills/wp-content-optimization/scripts/content_optimization_inspect.mjs +237 -0
  36. package/skills/wp-monitoring/SKILL.md +1 -0
  37. package/skills/wp-programmatic-seo/SKILL.md +2 -0
  38. package/skills/wp-search-console/SKILL.md +121 -0
  39. package/skills/wp-search-console/references/competitor-gap-analysis.md +226 -0
  40. package/skills/wp-search-console/references/content-seo-feedback.md +181 -0
  41. package/skills/wp-search-console/references/gsc-setup.md +110 -0
  42. package/skills/wp-search-console/references/indexing-management.md +182 -0
  43. package/skills/wp-search-console/references/keyword-tracking.md +181 -0
  44. package/skills/wp-search-console/scripts/search_console_inspect.mjs +178 -0
@@ -18,6 +18,7 @@ import { wcWebhookTools, wcWebhookHandlers } from './wc-webhooks.js';
18
18
  import { mailchimpTools, mailchimpHandlers } from './mailchimp.js';
19
19
  import { bufferTools, bufferHandlers } from './buffer.js';
20
20
  import { sendgridTools, sendgridHandlers } from './sendgrid.js';
21
+ import { gscTools, gscHandlers } from './gsc.js';
21
22
  // Combine all tools
22
23
  export const allTools = [
23
24
  ...unifiedContentTools, // 8 tools
@@ -40,6 +41,7 @@ export const allTools = [
40
41
  ...mailchimpTools, // 7 tools
41
42
  ...bufferTools, // 5 tools
42
43
  ...sendgridTools, // 6 tools
44
+ ...gscTools, // 8 tools
43
45
  ];
44
46
  // Combine all handlers
45
47
  export const toolHandlers = {
@@ -63,4 +65,5 @@ export const toolHandlers = {
63
65
  ...mailchimpHandlers,
64
66
  ...bufferHandlers,
65
67
  ...sendgridHandlers,
68
+ ...gscHandlers,
66
69
  };
@@ -8,16 +8,16 @@ declare const listMediaSchema: z.ZodObject<{
8
8
  _fields: z.ZodOptional<z.ZodString>;
9
9
  include_pagination: z.ZodOptional<z.ZodBoolean>;
10
10
  }, "strict", z.ZodTypeAny, {
11
+ search?: string | undefined;
11
12
  page?: number | undefined;
12
13
  per_page?: number | undefined;
13
- search?: string | undefined;
14
14
  _embed?: boolean | undefined;
15
15
  _fields?: string | undefined;
16
16
  include_pagination?: boolean | undefined;
17
17
  }, {
18
+ search?: string | undefined;
18
19
  page?: number | undefined;
19
20
  per_page?: number | undefined;
20
- search?: string | undefined;
21
21
  _embed?: boolean | undefined;
22
22
  _fields?: string | undefined;
23
23
  include_pagination?: boolean | undefined;
@@ -23,14 +23,14 @@ declare const msCreateSiteSchema: z.ZodObject<{
23
23
  email: z.ZodString;
24
24
  site_id: z.ZodOptional<z.ZodString>;
25
25
  }, "strict", z.ZodTypeAny, {
26
+ email: string;
26
27
  slug: string;
27
28
  title: string;
28
- email: string;
29
29
  site_id?: string | undefined;
30
30
  }, {
31
+ email: string;
31
32
  slug: string;
32
33
  title: string;
33
- email: string;
34
34
  site_id?: string | undefined;
35
35
  }>;
36
36
  declare const msActivateSiteSchema: z.ZodObject<{
@@ -5,9 +5,9 @@ declare const searchPluginRepositorySchema: z.ZodObject<{
5
5
  page: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
6
6
  per_page: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
7
7
  }, "strict", z.ZodTypeAny, {
8
+ search: string;
8
9
  page: number;
9
10
  per_page: number;
10
- search: string;
11
11
  }, {
12
12
  search: string;
13
13
  page?: number | undefined;
@@ -11,18 +11,18 @@ declare const wpSearchSchema: z.ZodObject<{
11
11
  include_pagination: z.ZodOptional<z.ZodBoolean>;
12
12
  }, "strip", z.ZodTypeAny, {
13
13
  search: string;
14
+ type?: string | undefined;
14
15
  page?: number | undefined;
15
16
  per_page?: number | undefined;
16
- type?: string | undefined;
17
17
  _embed?: boolean | undefined;
18
18
  _fields?: string | undefined;
19
19
  include_pagination?: boolean | undefined;
20
20
  subtype?: string | undefined;
21
21
  }, {
22
22
  search: string;
23
+ type?: string | undefined;
23
24
  page?: number | undefined;
24
25
  per_page?: number | undefined;
25
- type?: string | undefined;
26
26
  _embed?: boolean | undefined;
27
27
  _fields?: string | undefined;
28
28
  include_pagination?: boolean | undefined;
@@ -20,9 +20,9 @@ declare const listContentSchema: z.ZodObject<{
20
20
  include_pagination: z.ZodOptional<z.ZodBoolean>;
21
21
  }, "strip", z.ZodTypeAny, {
22
22
  content_type: string;
23
+ search?: string | undefined;
23
24
  page?: number | undefined;
24
25
  per_page?: number | undefined;
25
- search?: string | undefined;
26
26
  slug?: string | undefined;
27
27
  status?: string | undefined;
28
28
  author?: number | number[] | undefined;
@@ -38,9 +38,9 @@ declare const listContentSchema: z.ZodObject<{
38
38
  include_pagination?: boolean | undefined;
39
39
  }, {
40
40
  content_type: string;
41
+ search?: string | undefined;
41
42
  page?: number | undefined;
42
43
  per_page?: number | undefined;
43
- search?: string | undefined;
44
44
  slug?: string | undefined;
45
45
  status?: string | undefined;
46
46
  author?: number | number[] | undefined;
@@ -61,13 +61,13 @@ declare const getContentSchema: z.ZodObject<{
61
61
  _embed: z.ZodOptional<z.ZodBoolean>;
62
62
  _fields: z.ZodOptional<z.ZodString>;
63
63
  }, "strip", z.ZodTypeAny, {
64
- content_type: string;
65
64
  id: number;
65
+ content_type: string;
66
66
  _embed?: boolean | undefined;
67
67
  _fields?: string | undefined;
68
68
  }, {
69
- content_type: string;
70
69
  id: number;
70
+ content_type: string;
71
71
  _embed?: boolean | undefined;
72
72
  _fields?: string | undefined;
73
73
  }>;
@@ -138,8 +138,8 @@ declare const updateContentSchema: z.ZodObject<{
138
138
  meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
139
139
  custom_fields: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
140
140
  }, "strip", z.ZodTypeAny, {
141
- content_type: string;
142
141
  id: number;
142
+ content_type: string;
143
143
  slug?: string | undefined;
144
144
  status?: string | undefined;
145
145
  author?: number | undefined;
@@ -155,8 +155,8 @@ declare const updateContentSchema: z.ZodObject<{
155
155
  meta?: Record<string, any> | undefined;
156
156
  custom_fields?: Record<string, any> | undefined;
157
157
  }, {
158
- content_type: string;
159
158
  id: number;
159
+ content_type: string;
160
160
  slug?: string | undefined;
161
161
  status?: string | undefined;
162
162
  author?: number | undefined;
@@ -177,12 +177,12 @@ declare const deleteContentSchema: z.ZodObject<{
177
177
  id: z.ZodNumber;
178
178
  force: z.ZodOptional<z.ZodBoolean>;
179
179
  }, "strip", z.ZodTypeAny, {
180
- content_type: string;
181
180
  id: number;
181
+ content_type: string;
182
182
  force?: boolean | undefined;
183
183
  }, {
184
- content_type: string;
185
184
  id: number;
185
+ content_type: string;
186
186
  force?: boolean | undefined;
187
187
  }>;
188
188
  declare const discoverContentTypesSchema: z.ZodObject<{
@@ -25,12 +25,12 @@ declare const listTermsSchema: z.ZodObject<{
25
25
  include_pagination: z.ZodOptional<z.ZodBoolean>;
26
26
  }, "strip", z.ZodTypeAny, {
27
27
  taxonomy: string;
28
+ search?: string | undefined;
28
29
  page?: number | undefined;
29
30
  per_page?: number | undefined;
30
- search?: string | undefined;
31
31
  slug?: string | undefined;
32
32
  parent?: number | undefined;
33
- orderby?: "slug" | "id" | "description" | "name" | "include" | "term_group" | "count" | undefined;
33
+ orderby?: "id" | "slug" | "description" | "name" | "include" | "term_group" | "count" | undefined;
34
34
  order?: "asc" | "desc" | undefined;
35
35
  _embed?: boolean | undefined;
36
36
  _fields?: string | undefined;
@@ -38,12 +38,12 @@ declare const listTermsSchema: z.ZodObject<{
38
38
  hide_empty?: boolean | undefined;
39
39
  }, {
40
40
  taxonomy: string;
41
+ search?: string | undefined;
41
42
  page?: number | undefined;
42
43
  per_page?: number | undefined;
43
- search?: string | undefined;
44
44
  slug?: string | undefined;
45
45
  parent?: number | undefined;
46
- orderby?: "slug" | "id" | "description" | "name" | "include" | "term_group" | "count" | undefined;
46
+ orderby?: "id" | "slug" | "description" | "name" | "include" | "term_group" | "count" | undefined;
47
47
  order?: "asc" | "desc" | undefined;
48
48
  _embed?: boolean | undefined;
49
49
  _fields?: string | undefined;
@@ -12,10 +12,10 @@ declare const listUsersSchema: z.ZodObject<{
12
12
  _fields: z.ZodOptional<z.ZodString>;
13
13
  include_pagination: z.ZodOptional<z.ZodBoolean>;
14
14
  }, "strip", z.ZodTypeAny, {
15
+ search?: string | undefined;
15
16
  page?: number | undefined;
16
17
  per_page?: number | undefined;
17
- search?: string | undefined;
18
- orderby?: "url" | "slug" | "id" | "name" | "include" | "registered_date" | "email" | undefined;
18
+ orderby?: "url" | "id" | "email" | "slug" | "name" | "include" | "registered_date" | undefined;
19
19
  order?: "asc" | "desc" | undefined;
20
20
  _embed?: boolean | undefined;
21
21
  _fields?: string | undefined;
@@ -23,10 +23,10 @@ declare const listUsersSchema: z.ZodObject<{
23
23
  context?: "view" | "embed" | "edit" | undefined;
24
24
  roles?: string[] | undefined;
25
25
  }, {
26
+ search?: string | undefined;
26
27
  page?: number | undefined;
27
28
  per_page?: number | undefined;
28
- search?: string | undefined;
29
- orderby?: "url" | "slug" | "id" | "name" | "include" | "registered_date" | "email" | undefined;
29
+ orderby?: "url" | "id" | "email" | "slug" | "name" | "include" | "registered_date" | undefined;
30
30
  order?: "asc" | "desc" | undefined;
31
31
  _embed?: boolean | undefined;
32
32
  _fields?: string | undefined;
@@ -117,10 +117,10 @@ declare const updateUserSchema: z.ZodObject<{
117
117
  }, "strict", z.ZodTypeAny, {
118
118
  id: number;
119
119
  url?: string | undefined;
120
+ email?: string | undefined;
120
121
  slug?: string | undefined;
121
122
  description?: string | undefined;
122
123
  name?: string | undefined;
123
- email?: string | undefined;
124
124
  roles?: string[] | undefined;
125
125
  username?: string | undefined;
126
126
  first_name?: string | undefined;
@@ -131,10 +131,10 @@ declare const updateUserSchema: z.ZodObject<{
131
131
  }, {
132
132
  id: number;
133
133
  url?: string | undefined;
134
+ email?: string | undefined;
134
135
  slug?: string | undefined;
135
136
  description?: string | undefined;
136
137
  name?: string | undefined;
137
- email?: string | undefined;
138
138
  roles?: string[] | undefined;
139
139
  username?: string | undefined;
140
140
  first_name?: string | undefined;
@@ -9,9 +9,9 @@ declare const wcListCouponsSchema: z.ZodObject<{
9
9
  per_page: number;
10
10
  search?: string | undefined;
11
11
  }, {
12
+ search?: string | undefined;
12
13
  page?: number | undefined;
13
14
  per_page?: number | undefined;
14
- search?: string | undefined;
15
15
  }>;
16
16
  declare const wcGetCouponSchema: z.ZodObject<{
17
17
  id: z.ZodNumber;
@@ -14,15 +14,15 @@ declare const wcListCustomersSchema: z.ZodObject<{
14
14
  order: "asc" | "desc";
15
15
  role: "author" | "customer" | "all" | "administrator" | "editor" | "contributor" | "subscriber";
16
16
  search?: string | undefined;
17
- orderby?: "id" | "name" | "registered_date" | undefined;
18
17
  email?: string | undefined;
18
+ orderby?: "id" | "name" | "registered_date" | undefined;
19
19
  }, {
20
+ search?: string | undefined;
21
+ email?: string | undefined;
20
22
  page?: number | undefined;
21
23
  per_page?: number | undefined;
22
- search?: string | undefined;
23
24
  orderby?: "id" | "name" | "registered_date" | undefined;
24
25
  order?: "asc" | "desc" | undefined;
25
- email?: string | undefined;
26
26
  role?: "author" | "customer" | "all" | "administrator" | "editor" | "contributor" | "subscriber" | undefined;
27
27
  }>;
28
28
  declare const wcGetCustomerSchema: z.ZodObject<{
@@ -14,7 +14,7 @@ declare const wcListOrdersSchema: z.ZodObject<{
14
14
  per_page: number;
15
15
  order: "asc" | "desc";
16
16
  status?: "trash" | "pending" | "any" | "processing" | "on-hold" | "completed" | "cancelled" | "refunded" | "failed" | undefined;
17
- orderby?: "slug" | "date" | "id" | "title" | undefined;
17
+ orderby?: "id" | "slug" | "date" | "title" | undefined;
18
18
  after?: string | undefined;
19
19
  before?: string | undefined;
20
20
  customer?: number | undefined;
@@ -22,7 +22,7 @@ declare const wcListOrdersSchema: z.ZodObject<{
22
22
  page?: number | undefined;
23
23
  per_page?: number | undefined;
24
24
  status?: "trash" | "pending" | "any" | "processing" | "on-hold" | "completed" | "cancelled" | "refunded" | "failed" | undefined;
25
- orderby?: "slug" | "date" | "id" | "title" | undefined;
25
+ orderby?: "id" | "slug" | "date" | "title" | undefined;
26
26
  order?: "asc" | "desc" | undefined;
27
27
  after?: string | undefined;
28
28
  before?: string | undefined;
@@ -39,11 +39,11 @@ declare const wcUpdateOrderStatusSchema: z.ZodObject<{
39
39
  id: z.ZodNumber;
40
40
  status: z.ZodEnum<["pending", "processing", "on-hold", "completed", "cancelled", "refunded", "failed"]>;
41
41
  }, "strict", z.ZodTypeAny, {
42
- status: "pending" | "processing" | "on-hold" | "completed" | "cancelled" | "refunded" | "failed";
43
42
  id: number;
44
- }, {
45
43
  status: "pending" | "processing" | "on-hold" | "completed" | "cancelled" | "refunded" | "failed";
44
+ }, {
46
45
  id: number;
46
+ status: "pending" | "processing" | "on-hold" | "completed" | "cancelled" | "refunded" | "failed";
47
47
  }>;
48
48
  declare const wcListOrderNotesSchema: z.ZodObject<{
49
49
  order_id: z.ZodNumber;
@@ -17,17 +17,17 @@ declare const wcListProductsSchema: z.ZodObject<{
17
17
  order: "asc" | "desc";
18
18
  search?: string | undefined;
19
19
  status?: "draft" | "pending" | "private" | "publish" | "any" | undefined;
20
- orderby?: "slug" | "date" | "id" | "title" | "price" | "popularity" | "rating" | undefined;
20
+ orderby?: "id" | "slug" | "date" | "title" | "price" | "popularity" | "rating" | undefined;
21
21
  category?: number | undefined;
22
22
  tag?: number | undefined;
23
23
  sku?: string | undefined;
24
24
  stock_status?: "instock" | "outofstock" | "onbackorder" | undefined;
25
25
  }, {
26
+ search?: string | undefined;
26
27
  page?: number | undefined;
27
28
  per_page?: number | undefined;
28
- search?: string | undefined;
29
29
  status?: "draft" | "pending" | "private" | "publish" | "any" | undefined;
30
- orderby?: "slug" | "date" | "id" | "title" | "price" | "popularity" | "rating" | undefined;
30
+ orderby?: "id" | "slug" | "date" | "title" | "price" | "popularity" | "rating" | undefined;
31
31
  order?: "asc" | "desc" | undefined;
32
32
  category?: number | undefined;
33
33
  tag?: number | undefined;
@@ -74,8 +74,8 @@ declare const wcCreateProductSchema: z.ZodObject<{
74
74
  src: string;
75
75
  }>, "many">>;
76
76
  }, "strict", z.ZodTypeAny, {
77
- status: "draft" | "pending" | "private" | "publish";
78
77
  type: "simple" | "grouped" | "external" | "variable";
78
+ status: "draft" | "pending" | "private" | "publish";
79
79
  name: string;
80
80
  categories?: {
81
81
  id: number;
@@ -95,8 +95,8 @@ declare const wcCreateProductSchema: z.ZodObject<{
95
95
  }[] | undefined;
96
96
  }, {
97
97
  name: string;
98
- status?: "draft" | "pending" | "private" | "publish" | undefined;
99
98
  type?: "simple" | "grouped" | "external" | "variable" | undefined;
99
+ status?: "draft" | "pending" | "private" | "publish" | undefined;
100
100
  categories?: {
101
101
  id: number;
102
102
  }[] | undefined;
@@ -174,13 +174,13 @@ declare const wcListProductCategoriesSchema: z.ZodObject<{
174
174
  order: "asc" | "desc";
175
175
  search?: string | undefined;
176
176
  parent?: number | undefined;
177
- orderby?: "slug" | "id" | "name" | "count" | undefined;
177
+ orderby?: "id" | "slug" | "name" | "count" | undefined;
178
178
  }, {
179
+ search?: string | undefined;
179
180
  page?: number | undefined;
180
181
  per_page?: number | undefined;
181
- search?: string | undefined;
182
182
  parent?: number | undefined;
183
- orderby?: "slug" | "id" | "name" | "count" | undefined;
183
+ orderby?: "id" | "slug" | "name" | "count" | undefined;
184
184
  order?: "asc" | "desc" | undefined;
185
185
  }>;
186
186
  declare const wcListProductVariationsSchema: z.ZodObject<{
@@ -17,14 +17,14 @@ declare const wcCreateWebhookSchema: z.ZodObject<{
17
17
  name: string;
18
18
  topic: string;
19
19
  delivery_url: string;
20
- status?: "active" | "paused" | "disabled" | undefined;
21
20
  secret?: string | undefined;
21
+ status?: "active" | "paused" | "disabled" | undefined;
22
22
  }, {
23
23
  name: string;
24
24
  topic: string;
25
25
  delivery_url: string;
26
- status?: "active" | "paused" | "disabled" | undefined;
27
26
  secret?: string | undefined;
27
+ status?: "active" | "paused" | "disabled" | undefined;
28
28
  }>;
29
29
  declare const wcUpdateWebhookSchema: z.ZodObject<{
30
30
  id: z.ZodNumber;
@@ -35,18 +35,18 @@ declare const wcUpdateWebhookSchema: z.ZodObject<{
35
35
  status: z.ZodOptional<z.ZodEnum<["active", "paused", "disabled"]>>;
36
36
  }, "strict", z.ZodTypeAny, {
37
37
  id: number;
38
+ secret?: string | undefined;
38
39
  status?: "active" | "paused" | "disabled" | undefined;
39
40
  name?: string | undefined;
40
41
  topic?: string | undefined;
41
42
  delivery_url?: string | undefined;
42
- secret?: string | undefined;
43
43
  }, {
44
44
  id: number;
45
+ secret?: string | undefined;
45
46
  status?: "active" | "paused" | "disabled" | undefined;
46
47
  name?: string | undefined;
47
48
  topic?: string | undefined;
48
49
  delivery_url?: string | undefined;
49
- secret?: string | undefined;
50
50
  }>;
51
51
  declare const wcDeleteWebhookSchema: z.ZodObject<{
52
52
  id: z.ZodNumber;
@@ -14,6 +14,8 @@ interface SiteConfig {
14
14
  mailchimp_api_key?: string;
15
15
  buffer_access_token?: string;
16
16
  sendgrid_api_key?: string;
17
+ gsc_service_account_key?: string;
18
+ gsc_site_url?: string;
17
19
  }
18
20
  /**
19
21
  * Parse WP_SITES_CONFIG JSON and initialize all site clients
@@ -78,6 +80,9 @@ export declare function hasBuffer(siteId?: string): boolean;
78
80
  export declare function makeBufferRequest(method: string, endpoint: string, data?: any, siteId?: string): Promise<any>;
79
81
  export declare function hasSendGrid(siteId?: string): boolean;
80
82
  export declare function makeSendGridRequest(method: string, endpoint: string, data?: any, siteId?: string): Promise<any>;
83
+ export declare function hasGSC(siteId?: string): boolean;
84
+ export declare function getGSCSiteUrl(siteId?: string): string;
85
+ export declare function getGSCAuth(siteId?: string): Promise<any>;
81
86
  /**
82
87
  * Search the WordPress.org Plugin Repository
83
88
  */
@@ -1,5 +1,7 @@
1
1
  // src/wordpress.ts - Multi-site WordPress REST API client
2
2
  import axios from 'axios';
3
+ import { google } from 'googleapis';
4
+ import { readFileSync } from 'fs';
3
5
  // ── Concurrency Limiter ──────────────────────────────────────────────
4
6
  // Simple FIFO semaphore to cap concurrent requests per site
5
7
  class ConcurrencyLimiter {
@@ -469,6 +471,43 @@ export async function makeSendGridRequest(method, endpoint, data, siteId) {
469
471
  limiter.release();
470
472
  }
471
473
  }
474
+ // ── Google Search Console Interface ─────────────────────────────
475
+ const gscAuthClients = new Map();
476
+ export function hasGSC(siteId) {
477
+ const id = siteId || activeSiteId;
478
+ const sites = JSON.parse(process.env.WP_SITES_CONFIG || '[]');
479
+ const site = sites.find((s) => s.id === id);
480
+ return !!(site?.gsc_service_account_key && site?.gsc_site_url);
481
+ }
482
+ export function getGSCSiteUrl(siteId) {
483
+ const id = siteId || activeSiteId;
484
+ const sites = JSON.parse(process.env.WP_SITES_CONFIG || '[]');
485
+ const site = sites.find((s) => s.id === id);
486
+ if (!site?.gsc_site_url) {
487
+ throw new Error(`GSC site URL not configured for site "${id}". Add gsc_site_url to WP_SITES_CONFIG.`);
488
+ }
489
+ return site.gsc_site_url;
490
+ }
491
+ export async function getGSCAuth(siteId) {
492
+ const id = siteId || activeSiteId;
493
+ // Return cached client if available
494
+ if (gscAuthClients.has(id)) {
495
+ return gscAuthClients.get(id);
496
+ }
497
+ const sites = JSON.parse(process.env.WP_SITES_CONFIG || '[]');
498
+ const site = sites.find((s) => s.id === id);
499
+ if (!site?.gsc_service_account_key) {
500
+ throw new Error(`GSC not configured for site "${id}". Add gsc_service_account_key (path to JSON key file) to WP_SITES_CONFIG.`);
501
+ }
502
+ const keyContent = JSON.parse(readFileSync(site.gsc_service_account_key, 'utf-8'));
503
+ const auth = new google.auth.GoogleAuth({
504
+ credentials: keyContent,
505
+ scopes: ['https://www.googleapis.com/auth/webmasters'],
506
+ });
507
+ const authClient = await auth.getClient();
508
+ gscAuthClients.set(id, authClient);
509
+ return authClient;
510
+ }
472
511
  // ── Plugin Repository (External API) ────────────────────────────────
473
512
  /**
474
513
  * Search the WordPress.org Plugin Repository
@@ -17,6 +17,7 @@
17
17
  "@modelcontextprotocol/sdk": "^1.27.1",
18
18
  "axios": "^1.7.9",
19
19
  "form-data": "^4.0.1",
20
+ "googleapis": "^171.4.0",
20
21
  "zod": "^3.24.2"
21
22
  },
22
23
  "devDependencies": {
@@ -1,4 +1,4 @@
1
- # Router decision tree (v11 — development + local environment + operations + multisite + CI/CD + monitoring + webhooks + content repurposing + programmatic SEO + content attribution + multi-language network + social/email distribution)
1
+ # Router decision tree (v13 — development + local environment + operations + multisite + CI/CD + monitoring + webhooks + content repurposing + programmatic SEO + content attribution + multi-language network + social/email distribution + search console + content optimization)
2
2
 
3
3
  This routing guide covers WordPress **development**, **local environment**, and **operations** workflows.
4
4
 
@@ -14,7 +14,7 @@ Keywords that indicate **local environment**:
14
14
  local site, Studio, LocalWP, Local by Flywheel, wp-env, local WordPress, start site, stop site, create local site, local development, symlink plugin, local database, switch PHP version, localhost, local preview, detect environment, WASM, SQLite local
15
15
 
16
16
  Keywords that indicate **operations**:
17
- deploy, push to production, audit, security check, backup, restore, migrate, move site, create post, manage content, site status, check plugins, performance check, SEO audit, WooCommerce, prodotto, ordine, coupon, negozio, catalogo, inventario, vendite, carrello, multisite, network, sub-site, sub-sito, domain mapping, super admin, network activate, monitor, uptime, health report, trend, scansione periodica, alerting, performance baseline, fleet, all sites, network health, cross-site, webhook, outbound notification, event propagation, Zapier, content sync, repurpose content, social posts from blog, content atomization, newsletter from posts, content distribution, programmatic SEO, template pages, city pages, location pages, bulk page generation, scalable landing pages, content ROI, attribution, which content drives sales, conversion tracking, UTM tracking, revenue per post, multilingual, multi-language, hreflang, international SEO, translate site, language sites, localize content, social publish, schedule post, Buffer, email campaign, Mailchimp, SendGrid, transactional email, content distribution, newsletter send
17
+ deploy, push to production, audit, security check, backup, restore, migrate, move site, create post, manage content, site status, check plugins, performance check, SEO audit, WooCommerce, prodotto, ordine, coupon, negozio, catalogo, inventario, vendite, carrello, multisite, network, sub-site, sub-sito, domain mapping, super admin, network activate, monitor, uptime, health report, trend, scansione periodica, alerting, performance baseline, fleet, all sites, network health, cross-site, webhook, outbound notification, event propagation, Zapier, content sync, repurpose content, social posts from blog, content atomization, newsletter from posts, content distribution, programmatic SEO, template pages, city pages, location pages, bulk page generation, scalable landing pages, content ROI, attribution, which content drives sales, conversion tracking, UTM tracking, revenue per post, multilingual, multi-language, hreflang, international SEO, translate site, language sites, localize content, social publish, schedule post, Buffer, email campaign, Mailchimp, SendGrid, transactional email, content distribution, newsletter send, Google Search Console, GSC, keyword tracking, keyword rankings, search analytics, indexing status, URL inspection, sitemap submit, search performance, SERP data, optimize content, headline scoring, readability analysis, SEO score, content scoring, meta optimization, content freshness, content triage, bulk optimize, Flesch-Kincaid, keyword density
18
18
 
19
19
  Keywords that indicate **development**:
20
20
  create block, block.json, theme.json, register_rest_route, plugin development, hooks, PHPStan, build, test, scaffold, i18n, translation, accessibility, a11y, headless, decoupled, WPGraphQL, CI, CD, pipeline, GitHub Actions, GitLab CI, deploy automatico, workflow, quality gate
@@ -106,6 +106,10 @@ Priority: `gutenberg` > `wp-core` > `wp-site` > `wp-block-theme` > `wp-block-plu
106
106
  → `wp-multilang-network` skill + `wp-site-manager` agent
107
107
  - **Social/email distribution / publish to social / schedule post / email campaign / Mailchimp / Buffer / SendGrid / newsletter / transactional email / content distribution**
108
108
  → `wp-social-email` skill + `wp-distribution-manager` agent
109
+ - **Google Search Console / keyword tracking / indexing status / sitemap submit / search performance / GSC / SERP data**
110
+ → `wp-search-console` skill + `wp-content-strategist` agent
111
+ - **Content optimization / headline scoring / readability / SEO score / meta optimization / content freshness / content triage / optimize posts / Flesch-Kincaid / keyword density**
112
+ → `wp-content-optimization` skill + `wp-content-strategist` agent
109
113
 
110
114
  ## Step 2c: route by local environment intent (keywords)
111
115
 
@@ -106,3 +106,4 @@ Tool: assign_terms_to_content — assign terms to content
106
106
  - **`wp-content-repurposing`** — transform existing content for social media, email, and multi-channel distribution
107
107
  - **`wp-content-attribution`** — measure which content drives WooCommerce sales (UTM tracking, attribution models, ROI)
108
108
  - **wp-social-email** — distribute content to social media and email after creation
109
+ - **wp-content-optimization** — optimize existing content: headlines, readability, SEO scoring, meta descriptions, freshness audit
@@ -95,3 +95,5 @@ The script checks WooCommerce presence, analytics plugins, UTM tracking setup, c
95
95
  - `wp-content` — content management and editorial workflows
96
96
  - `wp-monitoring` — ongoing site performance and health tracking
97
97
  - `wp-content-repurposing` — transform high-ROI content into multi-channel formats
98
+ - `wp-search-console` — correlate GSC keyword data with WooCommerce conversions for content-commerce attribution
99
+ - `wp-content-optimization` — prioritize optimization of high-revenue content using attribution data