Plugin Directory

Changeset 3792925


Ignore:
Timestamp:
11/09/2026 05:11:47 PM (2 hours ago)
Author:
lionrapid
Message:

Deploying version 1.4.2

Location:
lionrapid-translation
Files:
1 added
7 edited

Legend:

Unmodified
Added
Removed
  • lionrapid-translation/trunk/languages/lionrapid-translation.pot

    r3792328 r3792925  
    33msgid ""
    44msgstr ""
    5 "Project-Id-Version: Lionrapid Translation 1.4.1\n"
     5"Project-Id-Version: Lionrapid Translation 1.4.2\n"
    66"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/lionrapid-translation\n"
    77"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
    … …  
    1010"Content-Type: text/plain; charset=UTF-8\n"
    1111"Content-Transfer-Encoding: 8bit\n"
    12 "POT-Creation-Date: 2026-11-09T11:17:26+00:00\n"
     12"POT-Creation-Date: 2026-11-09T17:11:36+00:00\n"
    1313"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
    1414"X-Generator: WP-CLI 2.12.0\n"
    … …  
    4242msgstr ""
    4343
    44 #: lionrapid.php:45
     44#: lionrapid.php:63
    4545msgid "Lionrapid Translation needs PHP 8.1 or newer and is not running. Ask your host to update PHP."
    4646msgstr ""
    … …  
    603603#: src/Config/LanguageConfig.php:49
    604604msgid "French"
     605msgstr ""
     606
     607#. translators: 1: the old copy's version, 2: its folder, 3: the version in use.
     608#: src/Core/OtherCopies.php:164
     609#, php-format
     610msgid "This is an older copy of Lionrapid Translation (version %1$s, in plugins/%2$s/). It does not run while this site uses Lionrapid Translation %3$s, and it gets no updates. You can delete it; your settings stay."
     611msgstr ""
     612
     613#. translators: 1: the old copy's version, 2: its folder.
     614#: src/Core/OtherCopies.php:186
     615#, php-format
     616msgid "An older copy of Lionrapid Translation (version %1$s, in plugins/%2$s/) is still installed. It does not run and gets no updates. You can delete it on the Plugins screen; your settings stay."
     617msgstr ""
     618
     619#: src/Core/OtherCopies.php:190
     620msgid "Go to Plugins"
    605621msgstr ""
    606622
  • lionrapid-translation/trunk/lionrapid.php

    r3792328 r3792925  
    55 * Plugin URI: https://www.lionrapid.com/integrations/wordpress
    66 * Description: Translates your site on the server, before the page reaches the browser. Languages and settings come from your Lionrapid dashboard.
    7  * Version: 1.4.1
     7 * Version: 1.4.2
    88 * Requires at least: 6.0
    99 * Requires PHP: 8.1
    … …  
    2929if (!defined('ABSPATH')) {
    3030    exit;
     31}
     32
     33// Another copy of this plugin has loaded already in this request: an old ZIP
     34// install in plugins/lionrapid/ (up to 1.3.0) is active, and this copy is being
     35// activated on top of it — installing from the plugin directory without
     36// deactivating the old copy first. Loading on would declare the same functions
     37// twice; until 1.4.2 that activation died with "Cannot redeclare lionrapid()".
     38// Load nothing here and take over on activation: deactivate the other copy. The
     39// two share their settings (lionrapid_*), so the next request runs this copy with
     40// the same key and languages. Core\OtherCopies handles deleting the old copy.
     41if (defined('LIONRAPID_PLUGIN_FILE') && LIONRAPID_PLUGIN_FILE !== __FILE__) {
     42    register_activation_hook(
     43        __FILE__,
     44        static function (): void {
     45            deactivate_plugins(plugin_basename(LIONRAPID_PLUGIN_FILE), true);
     46        }
     47    );
     48    return;
    3149}
    3250
    … …  
    138156    // Core
    139157    require_once LIONRAPID_PLUGIN_DIR . 'src/Core/HookRegistrar.php';
     158    require_once LIONRAPID_PLUGIN_DIR . 'src/Core/OtherCopies.php';
    140159    require_once LIONRAPID_PLUGIN_DIR . 'src/Core/Plugin.php';
    141160}
    … …  
    147166 * Initialize plugin
    148167 */
    149 function lionrapid(): Plugin
    150 {
    151     return Plugin::boot();
     168// Declared conditionally on purpose: PHP binds an unconditional top-level
     169// function when it compiles the file, before the other-copy check above runs.
     170if (!function_exists(__NAMESPACE__ . '\\lionrapid')) {
     171    function lionrapid(): Plugin
     172    {
     173        return Plugin::boot();
     174    }
    152175}
    153176
  • lionrapid-translation/trunk/readme.txt

    r3792328 r3792925  
    55Tested up to: 7.1
    66Requires PHP: 8.1
    7 Stable tag: 1.4.1
     7Stable tag: 1.4.2
    88License: MIT
    99License URI: https://opensource.org/licenses/MIT
    … …  
    104104ZIP files before 1.3.1 installed into the folder `lionrapid`; the directory version installs into `lionrapid-translation`. WordPress treats them as two plugins, but they share one set of settings.
    105105
    106 Deactivate and delete the old one first, then install Lionrapid Translation from the directory and enter your site key again. Do not delete the old one after installing the new one: deleting the old copy removes the shared settings, so the new install loses its site key too.
    107 
    108 To keep your settings instead: deactivate the old one, install and activate Lionrapid Translation, then remove the folder `wp-content/plugins/lionrapid` with your host's file manager or FTP rather than from the Plugins screen.
     106Install Lionrapid Translation from the directory and activate it. If the old copy is still active, the new one deactivates it and takes over with your site key and settings. Then delete the old copy from **Plugins**; your settings stay. The Plugins screen and Settings → Lionrapid point out the old copy while it is still installed.
     107
     108Before 1.4.2, deleting the old copy removed the shared settings. If you installed an earlier version from the directory and still have the old copy, update to 1.4.2 first, then delete it.
     109
     110ZIP files from 1.3.1 on install into `lionrapid-translation`, the directory's own folder, so WordPress treats a ZIP install and a directory install as the same plugin: updates from the directory arrive in **Dashboard → Updates** either way, and your settings are kept.
    109111
    110112= Where is the source code of the bundled JavaScript? =
    … …  
    125127
    126128== Changelog ==
     129
     130= 1.4.2 =
     131
     132* Fixed: activating Lionrapid Translation while an older copy installed from a ZIP
     133  (in plugins/lionrapid/) is still active no longer fails with a fatal error. The new
     134  copy takes over and deactivates the old one; your connection and settings carry over.
     135* Fixed: deleting that older copy no longer deletes your settings. Its uninstall used to
     136  remove the settings the two copies share, which disconnected the site.
     137* New: the Plugins screen and Settings → Lionrapid say when an older copy is still
     138  installed, and that it can be deleted.
    127139
    128140= 1.4.1 =
    … …  
    369381== Upgrade Notice ==
    370382
     383= 1.4.2 =
     384
     385Moving from an older copy installed from a ZIP now keeps your settings, and the old
     386copy can be deleted safely. Your connection and settings are kept.
     387
    371388= 1.4.1 =
    372389
  • lionrapid-translation/trunk/src/Config/Version.php

    r3792328 r3792925  
    2121     * Current plugin version
    2222     */
    23     public const NUMBER = '1.4.1';
     23    public const NUMBER = '1.4.2';
    2424
    2525    /**
  • lionrapid-translation/trunk/src/Core/Plugin.php

    r3792328 r3792925  
    2121use Hatamoto\LionRapid\WordPress\Assets\ClientLocaleRedirect;
    2222use Hatamoto\LionRapid\WordPress\Config\PluginConfig;
     23use Hatamoto\LionRapid\WordPress\Config\Version;
    2324use Hatamoto\LionRapid\WordPress\Contracts\HookRegistrarInterface;
    2425use Hatamoto\LionRapid\WordPress\Integrations\IntegrationFactory;
    … …  
    4748final class Plugin
    4849{
     50    /** The plugin version that last ran on this site (see boot()). */
     51    public const VERSION_OPTION = 'lionrapid_plugin_version';
     52
    4953    private static ?self $instance = null;
    5054
    … …  
    7074        $settingsRepository = new SettingsRepository();
    7175        $config = $settingsRepository->get();
     76
     77        // The version that last ran on this site. WordPress runs no activation
     78        // hook on an update (directory or ZIP alike), so anything an update needs
     79        // happens here, on load, compared against this stamp — and settings
     80        // change additively (new keys with defaults), never renamed or
     81        // repurposed, so an older copy can still read them after a downgrade.
     82        if (get_option(self::VERSION_OPTION) !== Version::NUMBER) {
     83            update_option(self::VERSION_OPTION, Version::NUMBER, true);
     84        }
     85
     86        // An old copy of the plugin (plugins/lionrapid/, the GitHub ZIP up to
     87        // 1.3.0) shares these settings: deleting it must not delete them, and the
     88        // admin screens say it can go.
     89        (new OtherCopies(LIONRAPID_PLUGIN_BASENAME))->register();
    7290
    7391        // === Assets ===
Note: See TracChangeset for help on using the changeset viewer.