Changeset 3792925
- Timestamp:
- 11/09/2026 05:11:47 PM (2 hours ago)
- Location:
- lionrapid-translation
- Files:
-
- 1 added
- 7 edited
-
assets/banner-1544x500.png (modified) ( previous)
-
assets/banner-772x250.png (modified) ( previous)
-
trunk/languages/lionrapid-translation.pot (modified) (4 diffs)
-
trunk/lionrapid.php (modified) (4 diffs)
-
trunk/readme.txt (modified) (4 diffs)
-
trunk/src/Config/Version.php (modified) (1 diff)
-
trunk/src/Core/OtherCopies.php (added)
-
trunk/src/Core/Plugin.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
lionrapid-translation/trunk/languages/lionrapid-translation.pot
r3792328 r3792925 3 3 msgid "" 4 4 msgstr "" 5 "Project-Id-Version: Lionrapid Translation 1.4. 1\n"5 "Project-Id-Version: Lionrapid Translation 1.4.2\n" 6 6 "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/lionrapid-translation\n" 7 7 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" … … 10 10 "Content-Type: text/plain; charset=UTF-8\n" 11 11 "Content-Transfer-Encoding: 8bit\n" 12 "POT-Creation-Date: 2026-11-09T1 1:17:26+00:00\n"12 "POT-Creation-Date: 2026-11-09T17:11:36+00:00\n" 13 13 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 14 14 "X-Generator: WP-CLI 2.12.0\n" … … 42 42 msgstr "" 43 43 44 #: lionrapid.php: 4544 #: lionrapid.php:63 45 45 msgid "Lionrapid Translation needs PHP 8.1 or newer and is not running. Ask your host to update PHP." 46 46 msgstr "" … … 603 603 #: src/Config/LanguageConfig.php:49 604 604 msgid "French" 605 msgstr "" 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 610 msgid "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." 611 msgstr "" 612 613 #. translators: 1: the old copy's version, 2: its folder. 614 #: src/Core/OtherCopies.php:186 615 #, php-format 616 msgid "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." 617 msgstr "" 618 619 #: src/Core/OtherCopies.php:190 620 msgid "Go to Plugins" 605 621 msgstr "" 606 622 -
lionrapid-translation/trunk/lionrapid.php
r3792328 r3792925 5 5 * Plugin URI: https://www.lionrapid.com/integrations/wordpress 6 6 * 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. 17 * Version: 1.4.2 8 8 * Requires at least: 6.0 9 9 * Requires PHP: 8.1 … … 29 29 if (!defined('ABSPATH')) { 30 30 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. 41 if (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; 31 49 } 32 50 … … 138 156 // Core 139 157 require_once LIONRAPID_PLUGIN_DIR . 'src/Core/HookRegistrar.php'; 158 require_once LIONRAPID_PLUGIN_DIR . 'src/Core/OtherCopies.php'; 140 159 require_once LIONRAPID_PLUGIN_DIR . 'src/Core/Plugin.php'; 141 160 } … … 147 166 * Initialize plugin 148 167 */ 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. 170 if (!function_exists(__NAMESPACE__ . '\\lionrapid')) { 171 function lionrapid(): Plugin 172 { 173 return Plugin::boot(); 174 } 152 175 } 153 176 -
lionrapid-translation/trunk/readme.txt
r3792328 r3792925 5 5 Tested up to: 7.1 6 6 Requires PHP: 8.1 7 Stable tag: 1.4. 17 Stable tag: 1.4.2 8 8 License: MIT 9 9 License URI: https://opensource.org/licenses/MIT … … 104 104 ZIP 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. 105 105 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. 106 Install 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 108 Before 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 110 ZIP 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. 109 111 110 112 = Where is the source code of the bundled JavaScript? = … … 125 127 126 128 == 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. 127 139 128 140 = 1.4.1 = … … 369 381 == Upgrade Notice == 370 382 383 = 1.4.2 = 384 385 Moving from an older copy installed from a ZIP now keeps your settings, and the old 386 copy can be deleted safely. Your connection and settings are kept. 387 371 388 = 1.4.1 = 372 389 -
lionrapid-translation/trunk/src/Config/Version.php
r3792328 r3792925 21 21 * Current plugin version 22 22 */ 23 public const NUMBER = '1.4. 1';23 public const NUMBER = '1.4.2'; 24 24 25 25 /** -
lionrapid-translation/trunk/src/Core/Plugin.php
r3792328 r3792925 21 21 use Hatamoto\LionRapid\WordPress\Assets\ClientLocaleRedirect; 22 22 use Hatamoto\LionRapid\WordPress\Config\PluginConfig; 23 use Hatamoto\LionRapid\WordPress\Config\Version; 23 24 use Hatamoto\LionRapid\WordPress\Contracts\HookRegistrarInterface; 24 25 use Hatamoto\LionRapid\WordPress\Integrations\IntegrationFactory; … … 47 48 final class Plugin 48 49 { 50 /** The plugin version that last ran on this site (see boot()). */ 51 public const VERSION_OPTION = 'lionrapid_plugin_version'; 52 49 53 private static ?self $instance = null; 50 54 … … 70 74 $settingsRepository = new SettingsRepository(); 71 75 $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(); 72 90 73 91 // === Assets ===
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)