=== Vectoron === Contributors: vectoron Tags: rest-api, content-management, shortcode, ga4, analytics Requires at least: 5.6 Tested up to: 6.9 Requires PHP: 7.4 Stable tag: 2.11.3 License: GPLv2 or later License URI: https://www.gnu.org/licenses/gpl-2.0.html A WordPress REST API plugin for external content management with authenticated API endpoints, GA4 tracking shortcodes, and ACF integration. == Description == Vectoron provides three main features: **1. REST API Endpoints** Secure REST API endpoints for external content management, perfect for integrating with automation platforms like Superblocks, Zapier, or custom applications. * Create and update posts programmatically * Manage categories * Upload media (file upload, base64, or URL) * Full authentication support (Basic Auth or custom headers) **2. Content Shortcodes** The `[vectoron_article]` shortcode provides: * Automatic wpautop disabling for custom HTML content * Built-in GA4 event tracking * FAQ accordion styling support **3. ACF Integration** Automatically sync post content to Advanced Custom Fields: * Settings page under Settings > Vectoron * Auto-detect WYSIWYG fields in ACF field groups * Support for Flexible Content, Repeaters, and Groups * ACF sync triggered by Vectoron API or X-Vectoron-Sync header * Works with both custom Vectoron API and native WP REST API **4. Page Builder Integrations** Seamless integration with popular WordPress page builders: * **Elementor**: Auto-sync content to Elementor's text-editor widgets * **Beaver Builder**: Auto-sync content to Beaver Builder's rich-text modules * **DIVI**: Auto-sync content to DIVI's shortcode format (sections, rows, columns, text modules) * **WP Bakery**: Auto-sync content to WP Bakery's shortcode format (rows, columns, column_text) * Configurable sync modes: Auto (detect existing builder posts), Always (convert all posts), or Disabled * Cache clearing for immediate visual updates **5. SEO Plugin Integrations** Automatic SEO metadata sync with popular SEO plugins: * **Yoast SEO**: Sync meta description, SEO title, and focus keyword * **SEOpress**: Sync meta description, SEO title, and target keyword * **Rank Math**: Sync meta description, SEO title, and focus keyword * All SEO fields set via API are automatically synced to the active SEO plugin == API Endpoints == All endpoints use the namespace `vectoron/v1`: * `POST /wp-json/vectoron/v1/posts` - Create a new post * `PUT /wp-json/vectoron/v1/posts/{id}` - Update an existing post * `POST /wp-json/vectoron/v1/categories` - Create a category * `POST /wp-json/vectoron/v1/media` - Upload media * `GET /wp-json/vectoron/v1/status` - Health check (no auth required) == Authentication == Three authentication methods are supported: 1. **HTTP Basic Auth** - Standard username:password 2. **Authorization Header** - `Authorization: Basic ` 3. **Custom Headers** - `X-WP-Username` and `X-WP-Password` == ACF Sync Header == When using the native WordPress REST API (`/wp-json/wp/v2/posts`) instead of the Vectoron custom API, you can trigger ACF sync by adding the `X-Vectoron-Sync` header: `X-Vectoron-Sync: true` This is useful when: * You want to use WordPress's native post creation/update endpoints * Your integration already uses the WP REST API * You need features only available in the native API Without this header, native WP REST API requests will NOT trigger ACF sync, ensuring Gutenberg and other WordPress interfaces don't interfere with ACF content. == Security Features == * Rate limiting (60 requests/minute per IP) * Capability-based permission checks * SSRF protection for URL uploads * Input sanitization and validation * Protected meta key filtering == Installation == 1. Upload the `vectoron` folder to the `/wp-content/plugins/` directory 2. Activate the plugin through the 'Plugins' menu in WordPress 3. Test the API status at `/wp-json/vectoron/v1/status` == Frequently Asked Questions == = What permissions are required for API access? = * Creating posts: User must have `edit_posts` capability (or `edit_pages` for page post type) * Updating posts: User must have `edit_post` capability for the specific post being edited * Categories: User must have `manage_categories` capability * Media: User must have `upload_files` capability = What image formats are supported for media uploads? = JPEG, PNG, GIF, and WebP formats are supported, with a maximum file size of 10MB. = How do I use the shortcode? = Simply add `[vectoron_article]` to any post or page where you want to disable automatic paragraph formatting and enable GA4 tracking. (Note: The legacy `[marketing_visionary_article]` shortcode has been removed; please update any existing content to use `[vectoron_article]`.) = Is the API rate limited? = Yes, the API is rate limited to 60 requests per minute per IP address to prevent abuse. == Screenshots == 1. API status endpoint response 2. Shortcode usage in the editor == Changelog == = 2.11.3 = * Fixed: Draft posts now return pretty permalinks instead of `?p=NNN` ugly URLs * Added `get_pretty_permalink()` helper using WordPress's `get_sample_permalink()` technique * Applies to both create_post and update_post API responses = 2.11.2 = * Added Schema Sync integration: auto-extract JSON-LD from content body into `` * Fixes WPBakery/Elementor/Divi rendering `