Main/WordPress Fullstack/Blueprints/Gutenberg & FSE/Custom Gutenberg Editorial & SEO Sidebar (PluginSidebar)
Back to «Gutenberg & FSE» cards
Gutenberg & FSE(ТЗ 34 из 54)
Spec: Custom Gutenberg Editorial & SEO Sidebar (PluginSidebar)
Gutenberg & FSE5 шагов • +25 XP

Spec: Custom Gutenberg Editorial & SEO Sidebar (PluginSidebar)

Building custom editorial workflow tools in the Gutenberg editor: PluginSidebar, PluginSidebarMoreMenuItem, registering post meta with show_in_rest, reading and dispatching editor store actions via useSelect and useDispatch.

~10 ч работыУровень: Middle@wordpress/pluginsPluginSidebarPluginDocumentSettingPanel@wordpress/datauseEntityPropREST APIReact 19
+5 XP за шаг
Выполнено 0 из 5 шагов (0%)
Трудозатраты~10 рабочих часов
Фриланс вилка~$450 – $750 (€400 – €700)
Оценка веб-студии~$950 – $1,600 (€900 – €1500)

ТЗ заказчика (исходный бриф):

Our content editorial team needs a dedicated sidebar panel inside Gutenberg to manage SEO metadata, article review status, target keywords, and reading time estimation directly within the editor interface.
Ключевые требования:
  • •Custom PluginSidebar registered via @wordpress/plugins registerPlugin() API
  • •Sidebar icon and toggle item in More Menu (PluginSidebarMoreMenuItem)
  • •Read post content and statistics in real-time using @wordpress/data useSelect
  • •Update post meta fields directly via useDispatch('core/editor').editPost()
  • •Automated word count, reading time calculator, and SEO score checklist
Ограничения проекта:
  • •Compatible with Gutenberg in both Post and Page edit screens
  • •Strict permission checks: disable review status changes for author role
Критерии приёмки (KPI):
  • Real-time metadata updates without noticeable editor lag (< 16ms render cycle)
  • Zero manual saves required for sidebar meta fields (synced with main Save button)
  • 100% accessibility compliance for all sidebar form controls

Конфигурация блупринта под условия проекта

Выберите архитектуру и стек — шаги роадмапа, структура файлов и примеры кода переключатся автоматически:

Пошаговое практическое руководство по ТЗ

Подробный разбор архитектуры, код реализации и советы эксперта по каждому этапу:

1
Этап 1 из 5

Step 1: Custom post meta registration in PHP

~25 минЛегкий

Практическое руководство:

In functions.php, call register_post_meta('post', '_seo_focus_keyword', [ 'show_in_rest' => true, 'single' => true, 'type' => 'string' ]) and '_editorial_status'.

План и контрольные точки реализации:
1Зарегистрировать метаполя через register_post_meta
2Включить show_in_rest => true для всех полей
3Задать корректные типы данных
Важные технические нюансы и подводные камни:

Ensure auth_callback is defined if meta keys require restricted edit permissions.

Ожидаемый артефакт этапа:

Метаполя, доступные для Redux-хранилища Gutenberg.

PHP
<?php
// functions.php - Метаполя для PluginSidebar
declare(strict_types=1);

add_action('init', function (): void {
    $meta_fields = [
        '_seo_title'        => 'string',
        '_seo_description'  => 'string',
        '_telegram_preview' => 'string',
    ];

    foreach ($meta_fields as $field => $type) {
        register_post_meta('post', $field, [
            'show_in_rest'  => true,
            'single'        => true,
            'type'          => $type,
            'auth_callback' => fn() => current_user_can('edit_posts'),
        ]);
    }
});
2
Этап 2 из 5

Step 2: PluginSidebar component scaffolding

~35 минСредний
3
Этап 3 из 5

Step 3: State integration with useSelect & useDispatch

~20 минЛегкий
4
Этап 4 из 5

Step 4: Real-time reading time & keyword density calculator

~25 минЛегкий
5
Этап 5 из 5

Step 5: Enqueueing via enqueue_block_editor_assets & QA

~20 минЛегкий

Типичные грабли на этом ТЗ

2 антипаттерна

Инструменты экосистемы Fullstack AI Lab для этого ТЗ

Интеграция