Plugin info

Total downloads: 714
Active installs: 10
Total reviews: 0
Average rating: 0
Support threads opened: 0
Support threads resolved: 0 (0%)
Available in: 2 language(s)
Contributors: 2
Last updated: 1/31/2025 (334 days ago)
Added to WordPress: 1/7/2025 (0 years old)
Minimum WordPress version: 6.0
Tested up to WordPress version: 6.7.4
Minimum PHP version: 8.0

Maintenance & Compatibility

Maintenance score

Stale • Last updated 334 days ago

38/100

Is Yard DeepL abandoned?

Likely maintained (last update 334 days ago).

Compatibility

Requires WordPress: 6.0
Tested up to: 6.7.4
Requires PHP: 8.0

Similar & Alternatives

Explore plugins with similar tags, and compare key metrics like downloads, ratings, updates, support, and WP/PHP compatibility.

Magic Post Translate
Rating 1.0/5 (1 reviews)Active installs 10
Never POEDIT
Rating 0.0/5 (0 reviews)Active installs 10
WP Base Translate
Rating 0.0/5 (0 reviews)Active installs 10

Description

This plugin registers secure API endpoints that allow you to request translations directly from DeepL without exposing your Deepl API-key. These endpoints are only accessible when a valid nonce is provided. When providing translations to website visitors, you can configure which languages are supported for translation.

Caching Mechanism

Each object that is translated will store its cached translation in the wp_postmeta table within the database. This caching mechanism ensures that translations are efficiently reused, reducing unnecessary API requests to DeepL and saving costs.

  • Serving Cached Translations: If a cached translation is newer than the post_modified date of the object, the cached version is served.
  • Fetching New Translations: When the post_modified date of the object is more recent than the cached translation, a new translation is fetched from DeepL. Once retrieved, this translation is immediately cached for future use.

This approach minimizes the number of API calls to DeepL, ensuring translations are kept up to date only when necessary.

External Services

This plugin connects to the DeepL API to provide translations for content.

  • Service: DeepL API (https://www.deepl.com)
  • Purpose: To translate text from one language to another based on the provided target language.
  • Data Sent: Text content for translation, the target language code, and the DeepL API key (handled securely and never exposed to users).
  • Conditions: Data is sent when a request for translation is initiated.
  • Privacy Policy: DeepL Privacy Policy
  • Terms of Service: DeepL Terms of Service

Usage

Security

The API endpoints registered by this plugin are secured using a WordPress nonce. The nonce is passed to the front-end using the wp_localize_script function and is stored in a global JavaScript object ydpl which contains the following properties:

  • ydpl_translate_post_id: The ID of the post to be translated.
  • ydpl_rest_translate_url: The URL of the API endpoint for translation requests.
  • ydpl_supported_languages: The list of languages supported for translation.
  • ydpl_api_request_nonce: The nonce used for API validation.

When making requests to the API, ensure that the nonce is included in the request headers. The header should be named nonce, and it should contain the value of ydpl_api_request_nonce.

Example

Request

var xhr = new XMLHttpRequest();
xhr.open('POST', ydpl.ydpl_rest_translate_url, true);

// Set request headers
xhr.setRequestHeader('Content-Type', 'application/json');
xhr.setRequestHeader('nonce', ydpl.ydpl_api_request_nonce);

// Handle response
xhr.onreadystatechange = function () {
    if (xhr.readyState === 4 && xhr.status === 200) {
        console.log('Translation:', JSON.parse(xhr.responseText));
    } else if (xhr.readyState === 4) {
        console.error('Error:', xhr.statusText);
    }
};

// Prepare and send the request body
var data = JSON.stringify({
    text: ["Look another test"],
    target_lang: "DE"
});

xhr.send(data);

Response

[
    {
        "text": "Look another test!",
        "translation": "Sehen Sie sich einen weiteren Test an!"
    }
]

Installation

  1. Upload plugin directory to the /wp-content/plugins/ directory
  2. Activate the plugin through the ‘Plugins’ menu in WordPress

Frequently Asked Questions

No FAQ available

Review feed

No reviews available

Screenshots

No screenshots available

Changelog

1.1.0: Jan 31, 2025

  • Add: disable DeepL translation cache metabox
  • Change: use init hook in plugin bootstrap construct, fixes translations for WordPress 6.7

1.0.2: Jan 08, 2025

  • Change: update all occurrences of ‘deepl’ to ‘DeepL’ for consistency

1.0.1: Jan 07, 2025

  • Change: processed corrections

1.0.0: Oct 18, 2024

  • Init: first release!