alleyinteractive / alleyinteractive/wp-seo

Meta Description Generator: CLI Command

未关闭
#166 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
php
主要语言
PHP
星标
45
派生
13
平均合并
12 天 16 小时
30 天内合并 PR
5

描述

### Description

>[!TIP]
>[Meta Description Generator feature reference document for Alley devs](https://l.alley.dev/0e3715e20a)

Set up a CLI command to generate meta descriptions for posts in bulk. It should loop through posts, find any without a meta description (meta key is not set or empty), generate them, and update the post.

The CLI command:
- Should have a **query parameter** to allow the user to configure the WP_Query for posts it should query. By default, it will query all public post types with show_ui true. This should be filterable (this same functionality is used in the post admin component).
- Should have a **limit parameter** that defaults to 100, so that posts are processed in batches, not all at once. Only a number value should be allowed (e.g. no "all"). This should also be filterable.
- Should have a **fault tolerance parameter** (default 5%) which is filterable. Utilize it and the limit command parameter to check how many errors occurred in a batch of requests. If a certain number of bad responses are received, the command exits and the user is notified.
- Should prompt the LLM for one description, and if the response is good, it should update the post meta description and move on.
- Should handle a warning/error response from the LLM query and prevent bad data from being written to the database. If bad data is received (empty response, bad status code, timeout, over quota, too many characters, etc.), log the post and warning/error and continue without updating the post.
- If the AI Connector reports that the user is over quota or has made too many requests in too short a period, the command should exit rather than trying to process additional posts.

### Use Case

When a developer would like to generate meta descriptions for a posts without them, they should be able to do so via the CLI.

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。