=== Translate by WP Provider ===
Contributors: wpprovider
Tags: translation, multilingual, language, woocommerce
Requires at least: 6.5
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 0.1.9-dev.663
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Translate what visitors read. Translations are stored in your own database; page views never call an external service.

== Description ==

Connect the site, pick your languages, and each language gets its own address, such as /de/ or its own domain. Text is translated when content changes, not when visitors arrive, and the translations are stored in your own WordPress database. A page view never waits for or depends on an outside service.

What gets translated:

* Pages, posts and products, built with the block editor, Elementor, Divi, Beaver Builder, Bricks, WPBakery and other page builders.
* Page titles, menus, page addresses (slugs), image descriptions, meta tags and structured data.
* WooCommerce: cart, checkout, order confirmation and customer emails, in the language the customer ordered in.
* Text that appears after the page has loaded, such as "load more" lists and form messages.
* WordPress, theme and plugin texts that language packs do not cover.

For search engines: every language has its own addresses, with hreflang, canonical links and XML sitemaps per language. Works with Yoast SEO, Rank Math, All in One SEO, SEOPress, The SEO Framework and Slim SEO.

You stay in control: correct any translation for the whole site or for one page, edit translations on the page itself, and choose an image per language. Switching from WPML or TranslatePress keeps the translations you already have.

A language switcher comes as a block, a shortcode, a menu item and an optional floating button. Optionally, a small banner suggests the page in the visitor's browser language; visitors are never redirected.

== Installation ==

1. Install the plugin from Plugins → Add New, or upload the zip, and activate it.
2. Go to **WP Provider Translate → Settings** and click **Connect**. You log in or create an account with your email address; no payment details are needed.
3. Choose the languages to translate into. The first pages are translated within minutes; their progress shows next to each language.
4. Add the language switcher: the floating button is on by default, or use the block, the shortcode `[wpprovider_language_picker]` or a menu item.

== Frequently Asked Questions ==

= Does a translated page load slower? =

No. Translations are stored in your own database, and a page view never calls an outside service. Pages with all their texts translated can be cached like any other page.

= How does the translation work? =

When content changes, the plugin sends the new texts to the translation service in the background. The service translates them and checks that links, numbers and placeholders survived, and the plugin stores the result. A page appears in a language once its texts are translated; until then the language switcher and search engines do not list it in that language.

= Can I correct a translation? =

Yes. Under **Translations** you can change any translation, for the whole site or for one page, or use **Edit translations** in the admin bar to click a text on the page itself. The service never overwrites a translation you corrected; when its original text changes, it shows up for you to review.

= What does it cost? =

The plugin is free. Automatic translation is a paid service: connecting creates an account, without payment details, that starts with a free trial of the smallest plan. When the trial ends without a plan, new text is no longer translated automatically; everything already translated stays on your site, and the switcher, your corrections and translating by hand keep working. Plans go by the number of words and languages; you find them, with their prices, on your plan page and on wpptranslate.com. The plugin itself has no locked features: you can add any number of languages, and each of them works the same for your visitors. Languages beyond your plan are not translated automatically; you can translate them yourself.

= Can I use a separate domain per language? =

Yes. Point the domain to the same WordPress site and enter it next to the language in the settings. The plugin checks that the domain reaches the site before it uses it.

= I use WPML or TranslatePress. Can I switch? =

Yes. The plugin imports the translations you already have, so pages do not need to be translated again. You start the import from the command line with WP-CLI (`wp wpprovider-translate wpml-import` or `wp wpprovider-translate translatepress-import`); wp-admin has no button for it. On a large site both run in batches (`--limit` and `--offset`), so each command stays well within the time a host allows.

= Can a product feed or a search index use my translations? =

Yes, when the code that builds it asks for them. A feed or search plugin, or a few lines in your theme, can read the translations stored on your site through these filters:

`apply_filters( 'wppt_languages', array() )` gives your site's language and the chosen languages.
`apply_filters( 'wppt_translate', $text, 'de' )` gives a text or HTML in German.
`apply_filters( 'wppt_translate_post', null, $post_id, 'de' )` gives a post or product in German: its title, excerpt, content, categories, its German address, and whether all of its texts are translated.
`apply_filters( 'wppt_language_url', $url, 'de' )` gives an address on your site in German.

They only read what is stored. A text that is not translated yet comes back in your site's language, and nothing is sent for translation because a feed asked: products are translated through their pages, as usual. When the plugin is not active, each filter gives back what it was given, so the calling code keeps working.

= My site has few visitors: translations arrive late =

WordPress runs its scheduled tasks, such as storing translations that came back, only when someone opens a page. On a quiet site they wait for the next visit. Let your server run them instead: add `define( 'DISABLE_WP_CRON', true );` to wp-config.php, and add a cron job on your server that runs every 5 minutes, either `wp cron event run --due-now --path=/path/to/wordpress` (WP-CLI) or `curl -s https://example.com/wp-cron.php?doing_wp_cron` (with your own address). The settings page shows a notice when the tasks have not run for some hours while translations wait.

= What happens when I delete the plugin? =

Deleting the plugin (not deactivating it) removes everything it stored in your database. Your translations remain with the translation service, so connecting again later brings them back.

== Screenshots ==

1. Settings: connect the site, choose the languages and where the language switcher appears.
2. A translated page on the site, with the language switcher in the menu.
3. The Translations page: every text of a page with its translation, which you can edit and mark as reviewed.
4. Setup takes three steps: connect, choose languages, and see the translated home page.
5. The Pages screen: which pages are live in each language, with links to translate a page first or leave it out.
6. Editing on the page itself: click a text on the translated page to see the original and change the translation.
7. The same home page in the site's own language, with the floating language switcher in the corner.
8. Connecting: you log in with your email address and a code that is sent to it. No password or payment details are needed.

== External services ==

This plugin uses the WP Provider Translate translation service, run by WP Provider (https://wpprovider.nl), to translate your site. It uses two addresses: `api.wpptranslate.com` for the plugin's requests and `app.wpptranslate.com` for the pages you see in your browser (logging in, your account). Nothing is sent before an administrator clicks **Connect** on the plugin's settings page.

* **Connecting:** your browser goes to the service, where you log in with your email address. The service then asks this site (at /wp-json/wp-provider-translate/v1/verify) to confirm the request came from it. The service stores your email address, your account name and this site's address.
* **Translating:** the site sends the published text of its pages (including product, cart and checkout pages), texts you saved in settings that visitors see (for example WooCommerce email texts), the site's address and the chosen languages. This happens in the background when content changes, and after a visitor sees text that has no translation yet. It never happens during the page view itself.
* **Plan:** the site asks how much of its plan is used and which of its languages the plan includes, when you open one of the plugin's screens in wp-admin (the answer is kept for five minutes) and in the background.
* **Waiting pages:** for pages that are not translated yet, the site sends their addresses and the texts that still need a translation, with the site's language and the language they wait for (at most 200 pages per language at a time). The service answers how many words each page needs and which pages fit your plan; the Pages screen shows that. This is sent in the background once an hour, when you open the Pages screen (at most once every five minutes) or change a page there (translate it first, leave it out, or take it back in), and when you come back from the plan page.
* **Page counts:** how many pages are translated, how many wait for room in your plan and how many words those waiting pages need, your site's language and the languages you chose. The counts are numbers and language codes only: no addresses, no text. They are sent in the background when they changed (at most once every ten minutes), when you click the plan button and when you come back from the plan page, so your account page can show what your plan means for your site.
* **Texts in use:** about once a day, in the background, the site tells the service which of the texts the service translated for it are still in use: the texts on its pages and the texts from settings that visitors see (for example WooCommerce email texts). It sends a list of fingerprints of those texts, not the texts themselves and no page addresses. A fingerprint is a code worked out from a text (a hash), the same code the site sends along with a text when it asks for its translation. First only the number of fingerprints and one fingerprint of the whole list are sent; the list itself follows only when it changed. The service uses it so that texts that are no longer on your site stop counting toward your plan. A staging or local copy of the site does not send it.
* **Plan button:** when you click it, the site asks the service for a one-time link to your plan page. It sends which message the plan strip showed, the plan and the language the button was about, and the wp-admin address of the plugin screen you were on, so the service can bring you back there.
* **Switching from WPML:** when you start the import, the original and translated texts of the imported pages are sent, so the service can match the sentences the site could not match itself.
* **Report a problem:** when you send a report from the plugin, the service receives your message, your contact email, the page and language, and, if you leave the box ticked, the WordPress and PHP versions, the theme, the active plugins and this plugin's state. No keys, passwords or visitors' data.
* **Disconnecting:** disconnecting or deleting the plugin tells the service that this site is no longer connected.
* **Never sent:** what visitors type, customer names or addresses, order pages, and anything shown only to logged-in users.

Translations of text that other sites share are reused for everyone.

Terms of use: https://app.wpptranslate.com/terms
Privacy policy: https://app.wpptranslate.com/privacy

Language packs for WordPress, themes and plugins are installed from WordPress.org itself, as WordPress does.

== Credits ==

Flag icons: [flag-icons](https://github.com/lipis/flag-icons) by Panayiotis Lipiridis, MIT license.
