=== 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.13 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.13 = * Fixed: Content detection now matches `am-article` as substring instead of exact `class="am-article"`, fixing CSS/JS not loading on posts with compound class attributes like `am-article am-article-type-*` = 2.11.12 = * Fixed: Asset version now uses VECTORON_VERSION constant for proper cache busting on plugin updates = 2.11.11 = * Fixed: Plugin CSS now uses @layer so theme styles always take precedence over plugin defaults = 2.11.10 = * Fixed: DIVI posts now inherit the site's configured page layout (sidebar, full-width, etc.) instead of always using full-width * Fixed: DIVI Visual Builder now recognizes Vectoron-published posts for visual editing (VB|Divi| version prefix) * Fixed: Re-publishing a post now repairs incorrect DIVI metadata (layout, version, gutter width) * Added: `vectoron_repair_divi_post_meta()` function for retroactive repair of existing posts * Added: Supplementary DIVI meta fields (gutter_width, built_for_post_type) for full native DIVI parity * Fixed: Exception handler now catches PHP 7+ Errors (Throwable) in DIVI sync = 2.11.8 = * Internal improvements to content formatting structural integrity checks = 2.11.7 = * Fixed: Multiple JSON-LD schema tags (e.g. FAQPage + ItemList for listicle articles) now all render in `` * Previously only the first schema tag was extracted; the second was left in the content body as visible text * The `wp_head` output now emits one `