claude-plugin-wordpress-manager 2.4.0 → 2.9.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.
- package/.claude-plugin/plugin.json +10 -3
- package/CHANGELOG.md +103 -0
- package/agents/wp-content-strategist.md +104 -0
- package/agents/wp-monitoring-agent.md +44 -0
- package/agents/wp-site-manager.md +19 -0
- package/docs/GUIDE.md +183 -23
- package/docs/plans/2026-03-01-tier4-5-implementation.md +1783 -0
- package/docs/plans/2026-03-01-tier4-5-observability-automation-design.md +426 -0
- package/docs/plans/2026-03-01-wcop-reassessment-v2.6.0.md +403 -0
- package/hooks/hooks.json +9 -0
- package/package.json +19 -3
- package/servers/wp-rest-bridge/build/tools/comments.d.ts +6 -6
- package/servers/wp-rest-bridge/build/tools/cwv.d.ts +3 -0
- package/servers/wp-rest-bridge/build/tools/cwv.js +196 -0
- package/servers/wp-rest-bridge/build/tools/ga4.d.ts +3 -0
- package/servers/wp-rest-bridge/build/tools/ga4.js +323 -0
- package/servers/wp-rest-bridge/build/tools/gsc.d.ts +3 -0
- package/servers/wp-rest-bridge/build/tools/gsc.js +354 -0
- package/servers/wp-rest-bridge/build/tools/index.d.ts +38 -38
- package/servers/wp-rest-bridge/build/tools/index.js +18 -0
- package/servers/wp-rest-bridge/build/tools/media.d.ts +2 -2
- package/servers/wp-rest-bridge/build/tools/multisite-sites.d.ts +2 -2
- package/servers/wp-rest-bridge/build/tools/plausible.d.ts +3 -0
- package/servers/wp-rest-bridge/build/tools/plausible.js +207 -0
- package/servers/wp-rest-bridge/build/tools/plugin-repository.d.ts +1 -1
- package/servers/wp-rest-bridge/build/tools/search.d.ts +2 -2
- package/servers/wp-rest-bridge/build/tools/slack.d.ts +3 -0
- package/servers/wp-rest-bridge/build/tools/slack.js +129 -0
- package/servers/wp-rest-bridge/build/tools/unified-content.d.ts +8 -8
- package/servers/wp-rest-bridge/build/tools/unified-taxonomies.d.ts +4 -4
- package/servers/wp-rest-bridge/build/tools/users.d.ts +6 -6
- package/servers/wp-rest-bridge/build/tools/wc-coupons.d.ts +1 -1
- package/servers/wp-rest-bridge/build/tools/wc-customers.d.ts +3 -3
- package/servers/wp-rest-bridge/build/tools/wc-orders.d.ts +4 -4
- package/servers/wp-rest-bridge/build/tools/wc-products.d.ts +8 -8
- package/servers/wp-rest-bridge/build/tools/wc-webhooks.d.ts +4 -4
- package/servers/wp-rest-bridge/build/tools/wc-workflows.d.ts +3 -0
- package/servers/wp-rest-bridge/build/tools/wc-workflows.js +222 -0
- package/servers/wp-rest-bridge/build/wordpress.d.ts +23 -0
- package/servers/wp-rest-bridge/build/wordpress.js +178 -0
- package/servers/wp-rest-bridge/package.json +1 -0
- package/skills/wordpress-router/SKILL.md +1 -1
- package/skills/wordpress-router/references/decision-tree.md +12 -2
- package/skills/wp-alerting/SKILL.md +142 -0
- package/skills/wp-alerting/references/alert-thresholds.md +79 -0
- package/skills/wp-alerting/references/escalation-paths.md +92 -0
- package/skills/wp-alerting/references/report-scheduling.md +142 -0
- package/skills/wp-alerting/references/slack-integration.md +109 -0
- package/skills/wp-alerting/scripts/alerting_inspect.mjs +150 -0
- package/skills/wp-analytics/SKILL.md +158 -0
- package/skills/wp-analytics/references/analytics-dashboards.md +83 -0
- package/skills/wp-analytics/references/cwv-monitoring.md +101 -0
- package/skills/wp-analytics/references/ga4-integration.md +76 -0
- package/skills/wp-analytics/references/plausible-setup.md +92 -0
- package/skills/wp-analytics/references/traffic-attribution.md +92 -0
- package/skills/wp-analytics/scripts/analytics_inspect.mjs +153 -0
- package/skills/wp-content/SKILL.md +1 -0
- package/skills/wp-content-attribution/SKILL.md +3 -0
- package/skills/wp-content-optimization/SKILL.md +173 -0
- package/skills/wp-content-optimization/references/content-freshness.md +234 -0
- package/skills/wp-content-optimization/references/headline-optimization.md +171 -0
- package/skills/wp-content-optimization/references/meta-optimization.md +243 -0
- package/skills/wp-content-optimization/references/readability-analysis.md +201 -0
- package/skills/wp-content-optimization/references/seo-content-scoring.md +245 -0
- package/skills/wp-content-optimization/scripts/content_optimization_inspect.mjs +237 -0
- package/skills/wp-content-workflows/SKILL.md +142 -0
- package/skills/wp-content-workflows/references/content-lifecycle-hooks.md +131 -0
- package/skills/wp-content-workflows/references/multi-channel-actions.md +151 -0
- package/skills/wp-content-workflows/references/schedule-triggers.md +118 -0
- package/skills/wp-content-workflows/references/trigger-management.md +159 -0
- package/skills/wp-content-workflows/references/wp-action-hooks.md +114 -0
- package/skills/wp-content-workflows/scripts/workflow_inspect.mjs +202 -0
- package/skills/wp-monitoring/SKILL.md +3 -0
- package/skills/wp-programmatic-seo/SKILL.md +2 -0
- package/skills/wp-search-console/SKILL.md +122 -0
- package/skills/wp-search-console/references/competitor-gap-analysis.md +226 -0
- package/skills/wp-search-console/references/content-seo-feedback.md +181 -0
- package/skills/wp-search-console/references/gsc-setup.md +110 -0
- package/skills/wp-search-console/references/indexing-management.md +182 -0
- package/skills/wp-search-console/references/keyword-tracking.md +181 -0
- package/skills/wp-search-console/scripts/search_console_inspect.mjs +178 -0
- package/skills/wp-social-email/SKILL.md +1 -0
- package/skills/wp-webhooks/SKILL.md +1 -0
|
@@ -0,0 +1,354 @@
|
|
|
1
|
+
import { hasGSC, getGSCAuth, getGSCSiteUrl } from '../wordpress.js';
|
|
2
|
+
import { google } from 'googleapis';
|
|
3
|
+
import { z } from 'zod';
|
|
4
|
+
// ── Zod Schemas ─────────────────────────────────────────────────
|
|
5
|
+
const gscListSitesSchema = z.object({}).strict();
|
|
6
|
+
const gscSearchAnalyticsSchema = z.object({
|
|
7
|
+
start_date: z.string().describe('Start date in YYYY-MM-DD format'),
|
|
8
|
+
end_date: z.string().describe('End date in YYYY-MM-DD format'),
|
|
9
|
+
dimensions: z.array(z.enum(['query', 'page', 'country', 'device', 'date'])).optional()
|
|
10
|
+
.describe('Dimensions to group results by'),
|
|
11
|
+
row_limit: z.number().optional().default(100)
|
|
12
|
+
.describe('Maximum number of rows to return (default 100)'),
|
|
13
|
+
dimension_filter_groups: z.array(z.object({
|
|
14
|
+
groupType: z.enum(['and']).optional(),
|
|
15
|
+
filters: z.array(z.object({
|
|
16
|
+
dimension: z.enum(['query', 'page', 'country', 'device']),
|
|
17
|
+
operator: z.enum(['contains', 'equals', 'notContains', 'notEquals', 'includingRegex', 'excludingRegex']),
|
|
18
|
+
expression: z.string(),
|
|
19
|
+
})),
|
|
20
|
+
})).optional()
|
|
21
|
+
.describe('Filter groups for narrowing results'),
|
|
22
|
+
}).strict();
|
|
23
|
+
const gscInspectUrlSchema = z.object({
|
|
24
|
+
inspection_url: z.string().describe('The fully-qualified URL to inspect'),
|
|
25
|
+
site_url: z.string().optional()
|
|
26
|
+
.describe('Site URL (defaults to configured gsc_site_url)'),
|
|
27
|
+
}).strict();
|
|
28
|
+
const gscListSitemapsSchema = z.object({}).strict();
|
|
29
|
+
const gscSubmitSitemapSchema = z.object({
|
|
30
|
+
feedpath: z.string().describe('Full URL to the sitemap (e.g. https://example.com/sitemap.xml)'),
|
|
31
|
+
}).strict();
|
|
32
|
+
const gscDeleteSitemapSchema = z.object({
|
|
33
|
+
feedpath: z.string().describe('Full URL of the sitemap to delete'),
|
|
34
|
+
}).strict();
|
|
35
|
+
const gscTopQueriesSchema = z.object({
|
|
36
|
+
start_date: z.string().describe('Start date in YYYY-MM-DD format'),
|
|
37
|
+
end_date: z.string().describe('End date in YYYY-MM-DD format'),
|
|
38
|
+
limit: z.number().optional().default(25)
|
|
39
|
+
.describe('Number of top queries to return (default 25)'),
|
|
40
|
+
}).strict();
|
|
41
|
+
const gscPagePerformanceSchema = z.object({
|
|
42
|
+
start_date: z.string().describe('Start date in YYYY-MM-DD format'),
|
|
43
|
+
end_date: z.string().describe('End date in YYYY-MM-DD format'),
|
|
44
|
+
page_filter: z.string().optional()
|
|
45
|
+
.describe('Filter pages by URL containing this string'),
|
|
46
|
+
limit: z.number().optional().default(50)
|
|
47
|
+
.describe('Number of pages to return (default 50)'),
|
|
48
|
+
}).strict();
|
|
49
|
+
// ── Tool Definitions ────────────────────────────────────────────
|
|
50
|
+
export const gscTools = [
|
|
51
|
+
{
|
|
52
|
+
name: "gsc_list_sites",
|
|
53
|
+
description: "Lists all sites verified in Google Search Console",
|
|
54
|
+
inputSchema: {
|
|
55
|
+
type: "object",
|
|
56
|
+
properties: {},
|
|
57
|
+
},
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
name: "gsc_search_analytics",
|
|
61
|
+
description: "Queries search analytics data (impressions, clicks, CTR, position) for a site",
|
|
62
|
+
inputSchema: {
|
|
63
|
+
type: "object",
|
|
64
|
+
properties: {
|
|
65
|
+
start_date: { type: "string", description: "Start date in YYYY-MM-DD format" },
|
|
66
|
+
end_date: { type: "string", description: "End date in YYYY-MM-DD format" },
|
|
67
|
+
dimensions: {
|
|
68
|
+
type: "array",
|
|
69
|
+
items: {
|
|
70
|
+
type: "string",
|
|
71
|
+
enum: ["query", "page", "country", "device", "date"],
|
|
72
|
+
},
|
|
73
|
+
description: "Dimensions to group results by",
|
|
74
|
+
},
|
|
75
|
+
row_limit: { type: "number", description: "Maximum number of rows to return (default 100)" },
|
|
76
|
+
dimension_filter_groups: {
|
|
77
|
+
type: "array",
|
|
78
|
+
items: {
|
|
79
|
+
type: "object",
|
|
80
|
+
properties: {
|
|
81
|
+
groupType: { type: "string", enum: ["and"] },
|
|
82
|
+
filters: {
|
|
83
|
+
type: "array",
|
|
84
|
+
items: {
|
|
85
|
+
type: "object",
|
|
86
|
+
properties: {
|
|
87
|
+
dimension: { type: "string", enum: ["query", "page", "country", "device"] },
|
|
88
|
+
operator: {
|
|
89
|
+
type: "string",
|
|
90
|
+
enum: ["contains", "equals", "notContains", "notEquals", "includingRegex", "excludingRegex"],
|
|
91
|
+
},
|
|
92
|
+
expression: { type: "string" },
|
|
93
|
+
},
|
|
94
|
+
required: ["dimension", "operator", "expression"],
|
|
95
|
+
},
|
|
96
|
+
},
|
|
97
|
+
},
|
|
98
|
+
},
|
|
99
|
+
description: "Filter groups for narrowing results",
|
|
100
|
+
},
|
|
101
|
+
},
|
|
102
|
+
required: ["start_date", "end_date"],
|
|
103
|
+
},
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
name: "gsc_inspect_url",
|
|
107
|
+
description: "Inspects a URL's indexing status in Google Search Console",
|
|
108
|
+
inputSchema: {
|
|
109
|
+
type: "object",
|
|
110
|
+
properties: {
|
|
111
|
+
inspection_url: { type: "string", description: "The fully-qualified URL to inspect" },
|
|
112
|
+
site_url: { type: "string", description: "Site URL (defaults to configured gsc_site_url)" },
|
|
113
|
+
},
|
|
114
|
+
required: ["inspection_url"],
|
|
115
|
+
},
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
name: "gsc_list_sitemaps",
|
|
119
|
+
description: "Lists all sitemaps submitted to Google Search Console",
|
|
120
|
+
inputSchema: {
|
|
121
|
+
type: "object",
|
|
122
|
+
properties: {},
|
|
123
|
+
},
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
name: "gsc_submit_sitemap",
|
|
127
|
+
description: "Submits a sitemap to Google Search Console",
|
|
128
|
+
inputSchema: {
|
|
129
|
+
type: "object",
|
|
130
|
+
properties: {
|
|
131
|
+
feedpath: { type: "string", description: "Full URL to the sitemap (e.g. https://example.com/sitemap.xml)" },
|
|
132
|
+
},
|
|
133
|
+
required: ["feedpath"],
|
|
134
|
+
},
|
|
135
|
+
},
|
|
136
|
+
{
|
|
137
|
+
name: "gsc_delete_sitemap",
|
|
138
|
+
description: "Deletes a sitemap from Google Search Console",
|
|
139
|
+
inputSchema: {
|
|
140
|
+
type: "object",
|
|
141
|
+
properties: {
|
|
142
|
+
feedpath: { type: "string", description: "Full URL of the sitemap to delete" },
|
|
143
|
+
},
|
|
144
|
+
required: ["feedpath"],
|
|
145
|
+
},
|
|
146
|
+
},
|
|
147
|
+
{
|
|
148
|
+
name: "gsc_top_queries",
|
|
149
|
+
description: "Gets top search queries for a site ordered by clicks (convenience wrapper around gsc_search_analytics)",
|
|
150
|
+
inputSchema: {
|
|
151
|
+
type: "object",
|
|
152
|
+
properties: {
|
|
153
|
+
start_date: { type: "string", description: "Start date in YYYY-MM-DD format" },
|
|
154
|
+
end_date: { type: "string", description: "End date in YYYY-MM-DD format" },
|
|
155
|
+
limit: { type: "number", description: "Number of top queries to return (default 25)" },
|
|
156
|
+
},
|
|
157
|
+
required: ["start_date", "end_date"],
|
|
158
|
+
},
|
|
159
|
+
},
|
|
160
|
+
{
|
|
161
|
+
name: "gsc_page_performance",
|
|
162
|
+
description: "Gets performance metrics for specific pages with optional URL filter (convenience wrapper)",
|
|
163
|
+
inputSchema: {
|
|
164
|
+
type: "object",
|
|
165
|
+
properties: {
|
|
166
|
+
start_date: { type: "string", description: "Start date in YYYY-MM-DD format" },
|
|
167
|
+
end_date: { type: "string", description: "End date in YYYY-MM-DD format" },
|
|
168
|
+
page_filter: { type: "string", description: "Filter pages by URL containing this string" },
|
|
169
|
+
limit: { type: "number", description: "Number of pages to return (default 50)" },
|
|
170
|
+
},
|
|
171
|
+
required: ["start_date", "end_date"],
|
|
172
|
+
},
|
|
173
|
+
},
|
|
174
|
+
];
|
|
175
|
+
// ── Handlers ────────────────────────────────────────────────────
|
|
176
|
+
export const gscHandlers = {
|
|
177
|
+
gsc_list_sites: async (_params) => {
|
|
178
|
+
if (!hasGSC()) {
|
|
179
|
+
return { toolResult: { isError: true, content: [{ type: "text", text: "GSC not configured. Add gsc_service_account_key and gsc_site_url to WP_SITES_CONFIG." }] } };
|
|
180
|
+
}
|
|
181
|
+
try {
|
|
182
|
+
const auth = await getGSCAuth();
|
|
183
|
+
const searchconsole = google.searchconsole({ version: 'v1', auth });
|
|
184
|
+
const response = await searchconsole.sites.list();
|
|
185
|
+
return { toolResult: { content: [{ type: "text", text: JSON.stringify(response.data, null, 2) }] } };
|
|
186
|
+
}
|
|
187
|
+
catch (error) {
|
|
188
|
+
const errorMessage = error.response?.data?.error?.message || error.message;
|
|
189
|
+
return { toolResult: { isError: true, content: [{ type: "text", text: `Error listing sites: ${errorMessage}` }] } };
|
|
190
|
+
}
|
|
191
|
+
},
|
|
192
|
+
gsc_search_analytics: async (params) => {
|
|
193
|
+
if (!hasGSC()) {
|
|
194
|
+
return { toolResult: { isError: true, content: [{ type: "text", text: "GSC not configured. Add gsc_service_account_key and gsc_site_url to WP_SITES_CONFIG." }] } };
|
|
195
|
+
}
|
|
196
|
+
try {
|
|
197
|
+
const auth = await getGSCAuth();
|
|
198
|
+
const siteUrl = getGSCSiteUrl();
|
|
199
|
+
const { start_date, end_date, dimensions, row_limit, dimension_filter_groups } = params;
|
|
200
|
+
const searchconsole = google.searchconsole({ version: 'v1', auth });
|
|
201
|
+
const requestBody = {
|
|
202
|
+
startDate: start_date,
|
|
203
|
+
endDate: end_date,
|
|
204
|
+
rowLimit: row_limit || 100,
|
|
205
|
+
};
|
|
206
|
+
if (dimensions)
|
|
207
|
+
requestBody.dimensions = dimensions;
|
|
208
|
+
if (dimension_filter_groups)
|
|
209
|
+
requestBody.dimensionFilterGroups = dimension_filter_groups;
|
|
210
|
+
const response = await searchconsole.searchanalytics.query({
|
|
211
|
+
siteUrl,
|
|
212
|
+
requestBody,
|
|
213
|
+
});
|
|
214
|
+
return { toolResult: { content: [{ type: "text", text: JSON.stringify(response.data, null, 2) }] } };
|
|
215
|
+
}
|
|
216
|
+
catch (error) {
|
|
217
|
+
const errorMessage = error.response?.data?.error?.message || error.message;
|
|
218
|
+
return { toolResult: { isError: true, content: [{ type: "text", text: `Error querying search analytics: ${errorMessage}` }] } };
|
|
219
|
+
}
|
|
220
|
+
},
|
|
221
|
+
gsc_inspect_url: async (params) => {
|
|
222
|
+
if (!hasGSC()) {
|
|
223
|
+
return { toolResult: { isError: true, content: [{ type: "text", text: "GSC not configured. Add gsc_service_account_key and gsc_site_url to WP_SITES_CONFIG." }] } };
|
|
224
|
+
}
|
|
225
|
+
try {
|
|
226
|
+
const auth = await getGSCAuth();
|
|
227
|
+
const { inspection_url, site_url } = params;
|
|
228
|
+
const siteUrl = site_url || getGSCSiteUrl();
|
|
229
|
+
const searchconsole = google.searchconsole({ version: 'v1', auth });
|
|
230
|
+
const response = await searchconsole.urlInspection.index.inspect({
|
|
231
|
+
requestBody: {
|
|
232
|
+
inspectionUrl: inspection_url,
|
|
233
|
+
siteUrl,
|
|
234
|
+
},
|
|
235
|
+
});
|
|
236
|
+
return { toolResult: { content: [{ type: "text", text: JSON.stringify(response.data, null, 2) }] } };
|
|
237
|
+
}
|
|
238
|
+
catch (error) {
|
|
239
|
+
const errorMessage = error.response?.data?.error?.message || error.message;
|
|
240
|
+
return { toolResult: { isError: true, content: [{ type: "text", text: `Error inspecting URL: ${errorMessage}` }] } };
|
|
241
|
+
}
|
|
242
|
+
},
|
|
243
|
+
gsc_list_sitemaps: async (_params) => {
|
|
244
|
+
if (!hasGSC()) {
|
|
245
|
+
return { toolResult: { isError: true, content: [{ type: "text", text: "GSC not configured. Add gsc_service_account_key and gsc_site_url to WP_SITES_CONFIG." }] } };
|
|
246
|
+
}
|
|
247
|
+
try {
|
|
248
|
+
const auth = await getGSCAuth();
|
|
249
|
+
const siteUrl = getGSCSiteUrl();
|
|
250
|
+
const webmasters = google.webmasters({ version: 'v3', auth });
|
|
251
|
+
const response = await webmasters.sitemaps.list({ siteUrl });
|
|
252
|
+
return { toolResult: { content: [{ type: "text", text: JSON.stringify(response.data, null, 2) }] } };
|
|
253
|
+
}
|
|
254
|
+
catch (error) {
|
|
255
|
+
const errorMessage = error.response?.data?.error?.message || error.message;
|
|
256
|
+
return { toolResult: { isError: true, content: [{ type: "text", text: `Error listing sitemaps: ${errorMessage}` }] } };
|
|
257
|
+
}
|
|
258
|
+
},
|
|
259
|
+
gsc_submit_sitemap: async (params) => {
|
|
260
|
+
if (!hasGSC()) {
|
|
261
|
+
return { toolResult: { isError: true, content: [{ type: "text", text: "GSC not configured. Add gsc_service_account_key and gsc_site_url to WP_SITES_CONFIG." }] } };
|
|
262
|
+
}
|
|
263
|
+
try {
|
|
264
|
+
const auth = await getGSCAuth();
|
|
265
|
+
const siteUrl = getGSCSiteUrl();
|
|
266
|
+
const { feedpath } = params;
|
|
267
|
+
const webmasters = google.webmasters({ version: 'v3', auth });
|
|
268
|
+
await webmasters.sitemaps.submit({ siteUrl, feedpath });
|
|
269
|
+
return { toolResult: { content: [{ type: "text", text: JSON.stringify({ success: true, message: `Sitemap submitted: ${feedpath}` }, null, 2) }] } };
|
|
270
|
+
}
|
|
271
|
+
catch (error) {
|
|
272
|
+
const errorMessage = error.response?.data?.error?.message || error.message;
|
|
273
|
+
return { toolResult: { isError: true, content: [{ type: "text", text: `Error submitting sitemap: ${errorMessage}` }] } };
|
|
274
|
+
}
|
|
275
|
+
},
|
|
276
|
+
gsc_delete_sitemap: async (params) => {
|
|
277
|
+
if (!hasGSC()) {
|
|
278
|
+
return { toolResult: { isError: true, content: [{ type: "text", text: "GSC not configured. Add gsc_service_account_key and gsc_site_url to WP_SITES_CONFIG." }] } };
|
|
279
|
+
}
|
|
280
|
+
try {
|
|
281
|
+
const auth = await getGSCAuth();
|
|
282
|
+
const siteUrl = getGSCSiteUrl();
|
|
283
|
+
const { feedpath } = params;
|
|
284
|
+
const webmasters = google.webmasters({ version: 'v3', auth });
|
|
285
|
+
await webmasters.sitemaps.delete({ siteUrl, feedpath });
|
|
286
|
+
return { toolResult: { content: [{ type: "text", text: JSON.stringify({ success: true, message: `Sitemap deleted: ${feedpath}` }, null, 2) }] } };
|
|
287
|
+
}
|
|
288
|
+
catch (error) {
|
|
289
|
+
const errorMessage = error.response?.data?.error?.message || error.message;
|
|
290
|
+
return { toolResult: { isError: true, content: [{ type: "text", text: `Error deleting sitemap: ${errorMessage}` }] } };
|
|
291
|
+
}
|
|
292
|
+
},
|
|
293
|
+
gsc_top_queries: async (params) => {
|
|
294
|
+
if (!hasGSC()) {
|
|
295
|
+
return { toolResult: { isError: true, content: [{ type: "text", text: "GSC not configured. Add gsc_service_account_key and gsc_site_url to WP_SITES_CONFIG." }] } };
|
|
296
|
+
}
|
|
297
|
+
try {
|
|
298
|
+
const auth = await getGSCAuth();
|
|
299
|
+
const siteUrl = getGSCSiteUrl();
|
|
300
|
+
const { start_date, end_date, limit } = params;
|
|
301
|
+
const searchconsole = google.searchconsole({ version: 'v1', auth });
|
|
302
|
+
const response = await searchconsole.searchanalytics.query({
|
|
303
|
+
siteUrl,
|
|
304
|
+
requestBody: {
|
|
305
|
+
startDate: start_date,
|
|
306
|
+
endDate: end_date,
|
|
307
|
+
dimensions: ['query'],
|
|
308
|
+
rowLimit: limit || 25,
|
|
309
|
+
},
|
|
310
|
+
});
|
|
311
|
+
return { toolResult: { content: [{ type: "text", text: JSON.stringify(response.data, null, 2) }] } };
|
|
312
|
+
}
|
|
313
|
+
catch (error) {
|
|
314
|
+
const errorMessage = error.response?.data?.error?.message || error.message;
|
|
315
|
+
return { toolResult: { isError: true, content: [{ type: "text", text: `Error getting top queries: ${errorMessage}` }] } };
|
|
316
|
+
}
|
|
317
|
+
},
|
|
318
|
+
gsc_page_performance: async (params) => {
|
|
319
|
+
if (!hasGSC()) {
|
|
320
|
+
return { toolResult: { isError: true, content: [{ type: "text", text: "GSC not configured. Add gsc_service_account_key and gsc_site_url to WP_SITES_CONFIG." }] } };
|
|
321
|
+
}
|
|
322
|
+
try {
|
|
323
|
+
const auth = await getGSCAuth();
|
|
324
|
+
const siteUrl = getGSCSiteUrl();
|
|
325
|
+
const { start_date, end_date, page_filter, limit } = params;
|
|
326
|
+
const searchconsole = google.searchconsole({ version: 'v1', auth });
|
|
327
|
+
const requestBody = {
|
|
328
|
+
startDate: start_date,
|
|
329
|
+
endDate: end_date,
|
|
330
|
+
dimensions: ['page'],
|
|
331
|
+
rowLimit: limit || 50,
|
|
332
|
+
};
|
|
333
|
+
if (page_filter) {
|
|
334
|
+
requestBody.dimensionFilterGroups = [{
|
|
335
|
+
groupType: 'and',
|
|
336
|
+
filters: [{
|
|
337
|
+
dimension: 'page',
|
|
338
|
+
operator: 'contains',
|
|
339
|
+
expression: page_filter,
|
|
340
|
+
}],
|
|
341
|
+
}];
|
|
342
|
+
}
|
|
343
|
+
const response = await searchconsole.searchanalytics.query({
|
|
344
|
+
siteUrl,
|
|
345
|
+
requestBody,
|
|
346
|
+
});
|
|
347
|
+
return { toolResult: { content: [{ type: "text", text: JSON.stringify(response.data, null, 2) }] } };
|
|
348
|
+
}
|
|
349
|
+
catch (error) {
|
|
350
|
+
const errorMessage = error.response?.data?.error?.message || error.message;
|
|
351
|
+
return { toolResult: { isError: true, content: [{ type: "text", text: `Error getting page performance: ${errorMessage}` }] } };
|
|
352
|
+
}
|
|
353
|
+
},
|
|
354
|
+
};
|
|
@@ -34,14 +34,14 @@ export declare const toolHandlers: {
|
|
|
34
34
|
name: string;
|
|
35
35
|
topic: string;
|
|
36
36
|
delivery_url: string;
|
|
37
|
-
status?: "active" | "paused" | "disabled" | undefined;
|
|
38
37
|
secret?: string | undefined;
|
|
38
|
+
status?: "active" | "paused" | "disabled" | undefined;
|
|
39
39
|
}, {
|
|
40
40
|
name: string;
|
|
41
41
|
topic: string;
|
|
42
42
|
delivery_url: string;
|
|
43
|
-
status?: "active" | "paused" | "disabled" | undefined;
|
|
44
43
|
secret?: string | undefined;
|
|
44
|
+
status?: "active" | "paused" | "disabled" | undefined;
|
|
45
45
|
}>>) => Promise<{
|
|
46
46
|
toolResult: {
|
|
47
47
|
content: {
|
|
@@ -68,18 +68,18 @@ export declare const toolHandlers: {
|
|
|
68
68
|
status: import("zod").ZodOptional<import("zod").ZodEnum<["active", "paused", "disabled"]>>;
|
|
69
69
|
}, "strict", import("zod").ZodTypeAny, {
|
|
70
70
|
id: number;
|
|
71
|
+
secret?: string | undefined;
|
|
71
72
|
status?: "active" | "paused" | "disabled" | undefined;
|
|
72
73
|
name?: string | undefined;
|
|
73
74
|
topic?: string | undefined;
|
|
74
75
|
delivery_url?: string | undefined;
|
|
75
|
-
secret?: string | undefined;
|
|
76
76
|
}, {
|
|
77
77
|
id: number;
|
|
78
|
+
secret?: string | undefined;
|
|
78
79
|
status?: "active" | "paused" | "disabled" | undefined;
|
|
79
80
|
name?: string | undefined;
|
|
80
81
|
topic?: string | undefined;
|
|
81
82
|
delivery_url?: string | undefined;
|
|
82
|
-
secret?: string | undefined;
|
|
83
83
|
}>>) => Promise<{
|
|
84
84
|
toolResult: {
|
|
85
85
|
content: {
|
|
@@ -296,14 +296,14 @@ export declare const toolHandlers: {
|
|
|
296
296
|
email: import("zod").ZodString;
|
|
297
297
|
site_id: import("zod").ZodOptional<import("zod").ZodString>;
|
|
298
298
|
}, "strict", import("zod").ZodTypeAny, {
|
|
299
|
+
email: string;
|
|
299
300
|
slug: string;
|
|
300
301
|
title: string;
|
|
301
|
-
email: string;
|
|
302
302
|
site_id?: string | undefined;
|
|
303
303
|
}, {
|
|
304
|
+
email: string;
|
|
304
305
|
slug: string;
|
|
305
306
|
title: string;
|
|
306
|
-
email: string;
|
|
307
307
|
site_id?: string | undefined;
|
|
308
308
|
}>>) => Promise<{
|
|
309
309
|
toolResult: {
|
|
@@ -566,9 +566,9 @@ export declare const toolHandlers: {
|
|
|
566
566
|
per_page: number;
|
|
567
567
|
search?: string | undefined;
|
|
568
568
|
}, {
|
|
569
|
+
search?: string | undefined;
|
|
569
570
|
page?: number | undefined;
|
|
570
571
|
per_page?: number | undefined;
|
|
571
|
-
search?: string | undefined;
|
|
572
572
|
}>>) => Promise<{
|
|
573
573
|
toolResult: {
|
|
574
574
|
content: {
|
|
@@ -705,15 +705,15 @@ export declare const toolHandlers: {
|
|
|
705
705
|
order: "asc" | "desc";
|
|
706
706
|
role: "author" | "customer" | "all" | "administrator" | "editor" | "contributor" | "subscriber";
|
|
707
707
|
search?: string | undefined;
|
|
708
|
-
orderby?: "id" | "name" | "registered_date" | undefined;
|
|
709
708
|
email?: string | undefined;
|
|
709
|
+
orderby?: "id" | "name" | "registered_date" | undefined;
|
|
710
710
|
}, {
|
|
711
|
+
search?: string | undefined;
|
|
712
|
+
email?: string | undefined;
|
|
711
713
|
page?: number | undefined;
|
|
712
714
|
per_page?: number | undefined;
|
|
713
|
-
search?: string | undefined;
|
|
714
715
|
orderby?: "id" | "name" | "registered_date" | undefined;
|
|
715
716
|
order?: "asc" | "desc" | undefined;
|
|
716
|
-
email?: string | undefined;
|
|
717
717
|
role?: "author" | "customer" | "all" | "administrator" | "editor" | "contributor" | "subscriber" | undefined;
|
|
718
718
|
}>>) => Promise<{
|
|
719
719
|
toolResult: {
|
|
@@ -836,7 +836,7 @@ export declare const toolHandlers: {
|
|
|
836
836
|
per_page: number;
|
|
837
837
|
order: "asc" | "desc";
|
|
838
838
|
status?: "trash" | "pending" | "any" | "processing" | "on-hold" | "completed" | "cancelled" | "refunded" | "failed" | undefined;
|
|
839
|
-
orderby?: "
|
|
839
|
+
orderby?: "id" | "slug" | "date" | "title" | undefined;
|
|
840
840
|
after?: string | undefined;
|
|
841
841
|
before?: string | undefined;
|
|
842
842
|
customer?: number | undefined;
|
|
@@ -844,7 +844,7 @@ export declare const toolHandlers: {
|
|
|
844
844
|
page?: number | undefined;
|
|
845
845
|
per_page?: number | undefined;
|
|
846
846
|
status?: "trash" | "pending" | "any" | "processing" | "on-hold" | "completed" | "cancelled" | "refunded" | "failed" | undefined;
|
|
847
|
-
orderby?: "
|
|
847
|
+
orderby?: "id" | "slug" | "date" | "title" | undefined;
|
|
848
848
|
order?: "asc" | "desc" | undefined;
|
|
849
849
|
after?: string | undefined;
|
|
850
850
|
before?: string | undefined;
|
|
@@ -893,11 +893,11 @@ export declare const toolHandlers: {
|
|
|
893
893
|
id: import("zod").ZodNumber;
|
|
894
894
|
status: import("zod").ZodEnum<["pending", "processing", "on-hold", "completed", "cancelled", "refunded", "failed"]>;
|
|
895
895
|
}, "strict", import("zod").ZodTypeAny, {
|
|
896
|
-
status: "pending" | "processing" | "on-hold" | "completed" | "cancelled" | "refunded" | "failed";
|
|
897
896
|
id: number;
|
|
898
|
-
}, {
|
|
899
897
|
status: "pending" | "processing" | "on-hold" | "completed" | "cancelled" | "refunded" | "failed";
|
|
898
|
+
}, {
|
|
900
899
|
id: number;
|
|
900
|
+
status: "pending" | "processing" | "on-hold" | "completed" | "cancelled" | "refunded" | "failed";
|
|
901
901
|
}>>) => Promise<{
|
|
902
902
|
toolResult: {
|
|
903
903
|
content: {
|
|
@@ -1013,17 +1013,17 @@ export declare const toolHandlers: {
|
|
|
1013
1013
|
order: "asc" | "desc";
|
|
1014
1014
|
search?: string | undefined;
|
|
1015
1015
|
status?: "draft" | "pending" | "private" | "publish" | "any" | undefined;
|
|
1016
|
-
orderby?: "
|
|
1016
|
+
orderby?: "id" | "slug" | "date" | "title" | "price" | "popularity" | "rating" | undefined;
|
|
1017
1017
|
category?: number | undefined;
|
|
1018
1018
|
tag?: number | undefined;
|
|
1019
1019
|
sku?: string | undefined;
|
|
1020
1020
|
stock_status?: "instock" | "outofstock" | "onbackorder" | undefined;
|
|
1021
1021
|
}, {
|
|
1022
|
+
search?: string | undefined;
|
|
1022
1023
|
page?: number | undefined;
|
|
1023
1024
|
per_page?: number | undefined;
|
|
1024
|
-
search?: string | undefined;
|
|
1025
1025
|
status?: "draft" | "pending" | "private" | "publish" | "any" | undefined;
|
|
1026
|
-
orderby?: "
|
|
1026
|
+
orderby?: "id" | "slug" | "date" | "title" | "price" | "popularity" | "rating" | undefined;
|
|
1027
1027
|
order?: "asc" | "desc" | undefined;
|
|
1028
1028
|
category?: number | undefined;
|
|
1029
1029
|
tag?: number | undefined;
|
|
@@ -1102,8 +1102,8 @@ export declare const toolHandlers: {
|
|
|
1102
1102
|
src: string;
|
|
1103
1103
|
}>, "many">>;
|
|
1104
1104
|
}, "strict", import("zod").ZodTypeAny, {
|
|
1105
|
-
status: "draft" | "pending" | "private" | "publish";
|
|
1106
1105
|
type: "simple" | "grouped" | "external" | "variable";
|
|
1106
|
+
status: "draft" | "pending" | "private" | "publish";
|
|
1107
1107
|
name: string;
|
|
1108
1108
|
categories?: {
|
|
1109
1109
|
id: number;
|
|
@@ -1123,8 +1123,8 @@ export declare const toolHandlers: {
|
|
|
1123
1123
|
}[] | undefined;
|
|
1124
1124
|
}, {
|
|
1125
1125
|
name: string;
|
|
1126
|
-
status?: "draft" | "pending" | "private" | "publish" | undefined;
|
|
1127
1126
|
type?: "simple" | "grouped" | "external" | "variable" | undefined;
|
|
1127
|
+
status?: "draft" | "pending" | "private" | "publish" | undefined;
|
|
1128
1128
|
categories?: {
|
|
1129
1129
|
id: number;
|
|
1130
1130
|
}[] | undefined;
|
|
@@ -1250,13 +1250,13 @@ export declare const toolHandlers: {
|
|
|
1250
1250
|
order: "asc" | "desc";
|
|
1251
1251
|
search?: string | undefined;
|
|
1252
1252
|
parent?: number | undefined;
|
|
1253
|
-
orderby?: "
|
|
1253
|
+
orderby?: "id" | "slug" | "name" | "count" | undefined;
|
|
1254
1254
|
}, {
|
|
1255
|
+
search?: string | undefined;
|
|
1255
1256
|
page?: number | undefined;
|
|
1256
1257
|
per_page?: number | undefined;
|
|
1257
|
-
search?: string | undefined;
|
|
1258
1258
|
parent?: number | undefined;
|
|
1259
|
-
orderby?: "
|
|
1259
|
+
orderby?: "id" | "slug" | "name" | "count" | undefined;
|
|
1260
1260
|
order?: "asc" | "desc" | undefined;
|
|
1261
1261
|
}>>) => Promise<{
|
|
1262
1262
|
toolResult: {
|
|
@@ -1309,9 +1309,9 @@ export declare const toolHandlers: {
|
|
|
1309
1309
|
}>;
|
|
1310
1310
|
wp_search: (params: {
|
|
1311
1311
|
search: string;
|
|
1312
|
+
type?: string | undefined;
|
|
1312
1313
|
page?: number | undefined;
|
|
1313
1314
|
per_page?: number | undefined;
|
|
1314
|
-
type?: string | undefined;
|
|
1315
1315
|
_embed?: boolean | undefined;
|
|
1316
1316
|
_fields?: string | undefined;
|
|
1317
1317
|
include_pagination?: boolean | undefined;
|
|
@@ -1327,13 +1327,13 @@ export declare const toolHandlers: {
|
|
|
1327
1327
|
}>;
|
|
1328
1328
|
list_comments: (params: {
|
|
1329
1329
|
post?: number | undefined;
|
|
1330
|
+
search?: string | undefined;
|
|
1331
|
+
type?: string | undefined;
|
|
1330
1332
|
page?: number | undefined;
|
|
1331
1333
|
per_page?: number | undefined;
|
|
1332
|
-
search?: string | undefined;
|
|
1333
1334
|
status?: "approve" | "hold" | "spam" | "trash" | undefined;
|
|
1334
|
-
type?: string | undefined;
|
|
1335
1335
|
author?: number | number[] | undefined;
|
|
1336
|
-
orderby?: "post" | "
|
|
1336
|
+
orderby?: "post" | "id" | "type" | "date" | "parent" | "include" | "date_gmt" | undefined;
|
|
1337
1337
|
order?: "asc" | "desc" | undefined;
|
|
1338
1338
|
after?: string | undefined;
|
|
1339
1339
|
_embed?: boolean | undefined;
|
|
@@ -1453,9 +1453,9 @@ export declare const toolHandlers: {
|
|
|
1453
1453
|
};
|
|
1454
1454
|
}>;
|
|
1455
1455
|
search_plugin_repository: (params: {
|
|
1456
|
+
search: string;
|
|
1456
1457
|
page: number;
|
|
1457
1458
|
per_page: number;
|
|
1458
|
-
search: string;
|
|
1459
1459
|
}) => Promise<{
|
|
1460
1460
|
toolResult: {
|
|
1461
1461
|
content: {
|
|
@@ -1493,10 +1493,10 @@ export declare const toolHandlers: {
|
|
|
1493
1493
|
};
|
|
1494
1494
|
}>;
|
|
1495
1495
|
list_users: (params: {
|
|
1496
|
+
search?: string | undefined;
|
|
1496
1497
|
page?: number | undefined;
|
|
1497
1498
|
per_page?: number | undefined;
|
|
1498
|
-
|
|
1499
|
-
orderby?: "url" | "slug" | "id" | "name" | "include" | "registered_date" | "email" | undefined;
|
|
1499
|
+
orderby?: "url" | "id" | "email" | "slug" | "name" | "include" | "registered_date" | undefined;
|
|
1500
1500
|
order?: "asc" | "desc" | undefined;
|
|
1501
1501
|
_embed?: boolean | undefined;
|
|
1502
1502
|
_fields?: string | undefined;
|
|
@@ -1601,10 +1601,10 @@ export declare const toolHandlers: {
|
|
|
1601
1601
|
update_user: (params: {
|
|
1602
1602
|
id: number;
|
|
1603
1603
|
url?: string | undefined;
|
|
1604
|
+
email?: string | undefined;
|
|
1604
1605
|
slug?: string | undefined;
|
|
1605
1606
|
description?: string | undefined;
|
|
1606
1607
|
name?: string | undefined;
|
|
1607
|
-
email?: string | undefined;
|
|
1608
1608
|
roles?: string[] | undefined;
|
|
1609
1609
|
username?: string | undefined;
|
|
1610
1610
|
first_name?: string | undefined;
|
|
@@ -1658,16 +1658,16 @@ export declare const toolHandlers: {
|
|
|
1658
1658
|
_fields: import("zod").ZodOptional<import("zod").ZodString>;
|
|
1659
1659
|
include_pagination: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
1660
1660
|
}, "strict", import("zod").ZodTypeAny, {
|
|
1661
|
+
search?: string | undefined;
|
|
1661
1662
|
page?: number | undefined;
|
|
1662
1663
|
per_page?: number | undefined;
|
|
1663
|
-
search?: string | undefined;
|
|
1664
1664
|
_embed?: boolean | undefined;
|
|
1665
1665
|
_fields?: string | undefined;
|
|
1666
1666
|
include_pagination?: boolean | undefined;
|
|
1667
1667
|
}, {
|
|
1668
|
+
search?: string | undefined;
|
|
1668
1669
|
page?: number | undefined;
|
|
1669
1670
|
per_page?: number | undefined;
|
|
1670
|
-
search?: string | undefined;
|
|
1671
1671
|
_embed?: boolean | undefined;
|
|
1672
1672
|
_fields?: string | undefined;
|
|
1673
1673
|
include_pagination?: boolean | undefined;
|
|
@@ -1968,12 +1968,12 @@ export declare const toolHandlers: {
|
|
|
1968
1968
|
}>;
|
|
1969
1969
|
list_terms: (params: {
|
|
1970
1970
|
taxonomy: string;
|
|
1971
|
+
search?: string | undefined;
|
|
1971
1972
|
page?: number | undefined;
|
|
1972
1973
|
per_page?: number | undefined;
|
|
1973
|
-
search?: string | undefined;
|
|
1974
1974
|
slug?: string | undefined;
|
|
1975
1975
|
parent?: number | undefined;
|
|
1976
|
-
orderby?: "
|
|
1976
|
+
orderby?: "id" | "slug" | "description" | "name" | "include" | "term_group" | "count" | undefined;
|
|
1977
1977
|
order?: "asc" | "desc" | undefined;
|
|
1978
1978
|
_embed?: boolean | undefined;
|
|
1979
1979
|
_fields?: string | undefined;
|
|
@@ -2078,9 +2078,9 @@ export declare const toolHandlers: {
|
|
|
2078
2078
|
}>;
|
|
2079
2079
|
list_content: (params: {
|
|
2080
2080
|
content_type: string;
|
|
2081
|
+
search?: string | undefined;
|
|
2081
2082
|
page?: number | undefined;
|
|
2082
2083
|
per_page?: number | undefined;
|
|
2083
|
-
search?: string | undefined;
|
|
2084
2084
|
slug?: string | undefined;
|
|
2085
2085
|
status?: string | undefined;
|
|
2086
2086
|
author?: number | number[] | undefined;
|
|
@@ -2104,8 +2104,8 @@ export declare const toolHandlers: {
|
|
|
2104
2104
|
};
|
|
2105
2105
|
}>;
|
|
2106
2106
|
get_content: (params: {
|
|
2107
|
-
content_type: string;
|
|
2108
2107
|
id: number;
|
|
2108
|
+
content_type: string;
|
|
2109
2109
|
_embed?: boolean | undefined;
|
|
2110
2110
|
_fields?: string | undefined;
|
|
2111
2111
|
}) => Promise<{
|
|
@@ -2143,8 +2143,8 @@ export declare const toolHandlers: {
|
|
|
2143
2143
|
};
|
|
2144
2144
|
}>;
|
|
2145
2145
|
update_content: (params: {
|
|
2146
|
-
content_type: string;
|
|
2147
2146
|
id: number;
|
|
2147
|
+
content_type: string;
|
|
2148
2148
|
slug?: string | undefined;
|
|
2149
2149
|
status?: string | undefined;
|
|
2150
2150
|
author?: number | undefined;
|
|
@@ -2169,8 +2169,8 @@ export declare const toolHandlers: {
|
|
|
2169
2169
|
};
|
|
2170
2170
|
}>;
|
|
2171
2171
|
delete_content: (params: {
|
|
2172
|
-
content_type: string;
|
|
2173
2172
|
id: number;
|
|
2173
|
+
content_type: string;
|
|
2174
2174
|
force?: boolean | undefined;
|
|
2175
2175
|
}) => Promise<{
|
|
2176
2176
|
toolResult: {
|