Title: Yard DeepL
Author: Yard | Digital Agency
Published: <strong>7 Gennaio 2025</strong>
Last modified: 6 Novembre 2026

---

Ricerca i plugin

![](https://ps.w.org/yard-deepl/assets/icon-128x128.png?rev=3218515)

# Yard DeepL

 Di [Yard | Digital Agency](https://profiles.wordpress.org/yarddigitalagency/)

[Scarica](https://downloads.wordpress.org/plugin/yard-deepl.2.2.0.zip)

 * [Dettagli](https://it.wordpress.org/plugins/yard-deepl/#description)
 * [Recensioni](https://it.wordpress.org/plugins/yard-deepl/#reviews)
 *  [Installazione](https://it.wordpress.org/plugins/yard-deepl/#installation)
 * [Sviluppo](https://it.wordpress.org/plugins/yard-deepl/#developers)

 [Supporto](https://wordpress.org/support/plugin/yard-deepl/)

## Descrizione

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: Translations are cached per text. If a cached translation
   is newer than the `post_modified` date of the object, every requested text found
   in the cache is served from it. Texts that are not cached yet (for example a 
   changed menu or footer) are fetched from DeepL and merged into the cache. The
   response contains exactly the requested texts.
 * 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.
 * Cache Authorization: Only logged-in users with the `edit_posts` capability (or
   a custom capability configured via the `yard::deepl/cache_capability` filter)
   are permitted to create new cache entries. Requests from users without this capability
   never write to the cache: texts missing from the cache are translated by DeepL
   and returned together with the cached texts, without storing the result. When
   the rate limit is reached, only the cached texts are returned.

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

#### Admin: Cache Metabox

A metabox labeled Yard DeepL is displayed on the edit screen of supported post types(
default: all public post types except attachment). It provides two options:

 * Disable translation cache: When checked, the cache is bypassed for this object.
   Useful for posts with dynamic content that should always be translated fresh.
 * Clear translation cache: When checked and the post is saved, all cached translations
   for this object are deleted.

#### Admin: Translation Cache Column

A Translation cache column is added to the post list screen of all supported post
types. Its purpose is to notify editors which posts should be cached as soon as 
possible to avoid unnecessary DeepL API costs.

 * Green badge per language (e.g. NL, EN-US): a valid, up-to-date cached translation
   exists for that language. Visitor requests are served from cache at no cost.
 * Yellow badge with a count per language (e.g. EN-US 3): a cached translation exists,
   but that many visitor requests received only part of their texts because the 
   rest is missing from the cache. Hovering the badge shows the full count as a 
   tooltip. An editor visiting the page translates the missing texts, stores them
   and resets the count.
 * Grey badge with a count per language (e.g. EN-US 42): no cache exists for that
   language and visitors have triggered that many live DeepL API calls. Hovering
   the badge shows the full count as a tooltip. These posts are the most urgent 
   to cache.
 * —: the post has never been requested for translation, or caching is disabled 
   for this post.

The uncached call count is only incremented for visitor requests (users without 
cache-write capability) and is automatically reset per language once a cache entry
is stored. The same applies to the incomplete response count, which is also removed
when the cache is cleared. Posts with the Disable translation cache option enabled
are excluded from the column entirely.

### 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](https://www.deepl.com/privacy)
 * **Terms of Service:** [DeepL Terms of Service](https://www.deepl.com/pro-license)

The API base URL defaults to `https://api.deepl.com/v2/translate` and can be overridden
on the plugin’s settings page, for example to use a DeepL Free API account (`https://
api-free.deepl.com/v2/translate`).

### 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 `X-WP-Nonce`, and it should contain a nonce 
created with the `wp_rest` action (available via `ydpl.ydpl_api_request_nonce` on
the front-end).

Rate limiting: Unauthenticated requests (or requests from users without the cache
capability) are limited to 9 requests per 60 seconds per IP address. Authenticated
users with the required cache capability (default: edit_posts) are exempt from this
rate limit. Requests that are fully served from cache do not count towards the limit.
When the cache contains any of the requested texts, users without the cache capability
are served the cached texts only; DeepL is not called for the missing texts.

Cache capability: Only users with the `edit_posts` capability can trigger cache 
creation. This can be customized using the `yard::deepl/cache_capability` filter.

#### 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('X-WP-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!"
        }
    ]<h3>Filters</h3>
    ```

* `yard::deepl/cache_capability` (default: `edit_posts`) — The WordPress capability
required to create cache entries. Users without this capability receive translations
but results are not cached.
 * `yard::deepl/cache_metabox_post_types` (default: 
all public post types except `attachment`) — Post types on which the Yard DeepL 
cache metabox is displayed. * `yard::deepl/disable_cache_metabox_post_types` — Deprecated.
Use `yard::deepl/cache_metabox_post_types` instead.

## Installazione

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

## Recensioni

Non ci sono recensioni per questo plugin.

## Contributi e sviluppo

“Yard DeepL” è un software open source. Le persone che hanno contribuito allo sviluppo
di questo plugin sono indicate di seguito.

Collaboratori

 *   [ Yard | Digital Agency ](https://profiles.wordpress.org/yarddigitalagency/)
 *   [ Mike van den Hoek ](https://profiles.wordpress.org/mvdhoek1/)

“Yard DeepL” è stato tradotto in 1 lingua. Grazie a [chi traduce](https://translate.wordpress.org/projects/wp-plugins/yard-deepl/contributors)
per il contributo.

[Traduci “Yard DeepL” nella tua lingua.](https://translate.wordpress.org/projects/wp-plugins/yard-deepl)

### Ti interessa lo sviluppo?

[Esplora il codice](https://plugins.trac.wordpress.org/browser/yard-deepl/) segui
il [repository SVN](https://plugins.svn.wordpress.org/yard-deepl/), segui il [log delle modifiche](https://plugins.trac.wordpress.org/log/yard-deepl/)
tramite [RSS](https://plugins.trac.wordpress.org/log/yard-deepl/?limit=100&mode=stop_on_copy&format=rss).

## Changelog

#### 2.2.0: Nov 06, 2026

 * Fix: cache translations per text and fetch texts missing from the cache from 
   DeepL instead of serving a stale page snapshot
 * Change: users without the cache capability receive texts missing from the cache
   from DeepL without storing them; when rate limited they receive the cached texts
   only
 * Change: raise the rate limit from 3 to 9 requests per 60 seconds
 * Fix: requests from users with the cache capability no longer count towards the
   visitor rate limit
 * Add: yellow badge in the translation cache column for cached languages where 
   visitors received only part of their texts
 * Fix: clearing the translation cache also resets the uncached call count
 * Change: the cache metabox and translation cache column are shown on all public
   post types except `attachment` by default

#### 2.1.0: Aug 03, 2026

 * Add: configurable DeepL API base URL setting, defaulting to `https://api.deepl.
   com/v2/translate`

#### 2.0.0: June 04, 2026

 * Add: same-origin check for REST API requests
 * Add: rate limiting for unauthenticated / low-privilege requests (3 req / 60 s
   per IP)
 * Add: cache creation restricted to users with `edit_posts` capability (configurable
   via filter)
 * Add: `yard::deepl/cache_capability` filter
 * Add: Translation cache column on post list screens showing cached languages and
   per-language uncached call counts, to help editors prioritise which posts to 
   cache
 * Change: deprecated `yard::deepl/disable_cache_metabox_post_types` in favour of`
   yard::deepl/cache_metabox_post_types`
 * Change: nonce validation now also accepts the standard `wp_rest` nonce action
   as a fallback

#### 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!

## Meta

 *  Versione **2.2.0**
 *  Ultimo aggiornamento **6 giorni fa**
 *  Installazioni attive **20+**
 *  Versione WordPress ** 6.0 o superiore **
 *  Testato fino alla versione **7.0.8**
 *  Versione PHP ** 8.0 o superiore **
 *  Lingue
 * [Dutch](https://nl.wordpress.org/plugins/yard-deepl/) e [English (US)](https://wordpress.org/plugins/yard-deepl/).
 *  [Traduci nella tua lingua](https://translate.wordpress.org/projects/wp-plugins/yard-deepl)
 * Tag
 * [deepl](https://it.wordpress.org/plugins/tags/deepl/)[secure](https://it.wordpress.org/plugins/tags/secure/)
   [translating](https://it.wordpress.org/plugins/tags/translating/)
 *  [Visualizzazione avanzata](https://it.wordpress.org/plugins/yard-deepl/advanced/)

## Valutazioni

Non sono state ancora inviate recensioni.

[La tua recensione](https://wordpress.org/support/plugin/yard-deepl/reviews/#new-post)

[Vedi tutte le recensioni](https://wordpress.org/support/plugin/yard-deepl/reviews/)

## Collaboratori

 *   [ Yard | Digital Agency ](https://profiles.wordpress.org/yarddigitalagency/)
 *   [ Mike van den Hoek ](https://profiles.wordpress.org/mvdhoek1/)

## Supporto

Hai qualcosa da dire? Ti serve aiuto?

 [Chiedi nel forum di supporto](https://wordpress.org/support/plugin/yard-deepl/)