WP Manifestindependent plugin directory
manifest / i18n / sync-post-with-language-addon

Sync Post with Language Addon

An add-on for the existing WordPress plugin "Sync Post with Other Site" by incorporating OpenAI's translation capabilities. This add-on should automatically translate posts from English to multiple languages including Italian, Spanish, and German, while maintaining the HTML structure.

★ 0stars

Install

Download source zip No release zip yet

This is the repository archive. It installs, but the folder name will carry the branch suffix and updates will not flow.

Install straight from GitHub with WP-CLI:

wp plugin install https://github.com/sagarlakhani024/sync-post-with-language-addon/archive/refs/heads/main.zip
No built-in updater. New versions won't appear under Dashboard → Updates. Install new releases yourself, or let Git Updater track the repository.

This WordPress plugin is an add-on for the Sync Post With Other Site plugin. It uses the OpenAI GPT-4o model to automatically translate Gutenberg block-based content into different languages while preserving the original HTML structure and block hierarchy.


🧩 Features

  • 🧠 Translates full post content using OpenAI GPT-4o
  • 🔤 Supports multiple languages (Italian, German, Spanish, French, Dutch)
  • 🧱 Maintains original Gutenberg block structure
  • 🌐 Language selection via WordPress admin settings
  • 📤 Integrates with the "Sync Post With Other Site" plugin to sync translated content
  • 🔐 Secures API access using stored OpenAI API Key

⚙️ Requirements


🛠️ Installation

  1. Upload the plugin to your /wp-content/plugins/ directory or install via the Plugins menu.
  2. Activate the plugin through the Plugins menu in WordPress.
  3. Go to Settings > OpenAI Translation Settings to:
    • Enter your OpenAI API key
    • Choose the target translation language
  4. Posts synced via "Sync Post With Other Site" will now be translated before sending.

🧪 Supported Block Types

All block types that use innerHTML or innerContent, including:

  • Paragraphs
  • Headings
  • HTML blocks
  • Lists
  • Custom blocks with textual content

🔒 Security

  • Uses WordPress nonces for settings forms
  • Sanitizes and validates all inputs
  • API key is stored securely via update_option

📦 Customization

You can extend or customize:

  • The list of supported languages
  • The translation model used (currently gpt-4o)
  • Filters/hooks to modify how blocks are processed

🛠 Development

This plugin adheres to WordPress coding standards. To check coding quality:


composer install
vendor/bin/phpcs --standard=WordPress .
vendor/bin/phpcbf --standard=WordPress .