=== EffortLess Multisite Language Switcher === Contributors: domclic Donate link: https://domclic.com/wordpress/plugins/effortless-multisite-language-switcher/donate Tags: multisite, language switcher, translation, network, multilingual Requires at least: 5.5 Tested up to: 6.8 Requires PHP: 7.4 Stable tag: 1.0.14 License: GPLv2 or later License URI: https://www.gnu.org/licenses/gpl-2.0.html Adds a floating globe icon to WordPress Multisite to switch between different languages or subsites easily. == Description == **EffortLess Multisite Language Switcher** is a lightweight plugin designed for WordPress Multisite networks. It adds a floating globe icon on the frontend, allowing users to quickly switch between subsites — each typically representing a different language or locale. The plugin detects each site's locale setting and displays an appropriate flag icon. Flags are automatically mapped using a JSON file and preloaded to enhance performance. Optimized caching ensures fast rendering of the switcher. This plugin is ideal for multilingual networks using subdirectories or subdomains. **Features:** - Automatically detects and displays flags for each site in the network. - Uses a floating, always-visible globe icon for an intuitive language switcher. - Smart caching using WordPress transients for flag mappings and site lists. - Fully compatible with subdirectory and subdomain multisite setups. - Optimized for performance with minimal resource usage. == Installation == 1. Upload the plugin folder to the `/wp-content/plugins/` directory. 2. Activate the plugin through the 'Plugins' menu in WordPress. 3. Ensure each subsite in your network has the proper `WPLANG` setting (via **Settings > General**). 4. (Optional) Customize translations and flag mappings in `/assets/flags/` and `locales_flags.json`. == Frequently Asked Questions == = Does this plugin work on single-site WordPress installations? = No. This plugin is designed exclusively for WordPress Multisite networks. = How does it detect the language for each subsite? = It uses the `WPLANG` setting from each site's options. = Can I customize the flags or locales? = Yes! Edit the `assets/flags/locales_flags.json` file to add or modify mappings. = Are the flags hosted locally? = Yes, all flag icons are SVG files stored in the plugin's `/assets/flags/1x1/` directory. == Screenshots == 1. Floating globe icon in the bottom-right corner. 2. Language switcher with site flags. 3. JSON mapping file for locales to flag codes. == Changelog == = 1.0.14 = * Fixed PHPCS errors: Renamed file to class-elmls-plugin.php, added @package tag. * Conditionalized error_log calls to reduce debug log clutter. * Justified file_get_contents for local file usage. = 1.0.13 = * Fixed PHPCS errors: Added docblocks, renamed file to class-elmls-plugin.php, removed short ternaries, and conditionalized debug logs. * Improved code compliance with WordPress coding standards. * Optimized flag rendering with explicit logic. = 1.0.12 = * Optimized performance: Added transient caching for flag URLs and site queries. * Improved flag rendering speed by simplifying image handling. * Fixed debug log clutter by conditionalizing error_log calls with WP_DEBUG. * Enhanced JavaScript for faster UI initialization. = 1.0.11 = * Fixed issue showing duplicate flags. = 0.3.0 = * Initial public release. * Added JSON-based flag mapping. * Implemented transient caching for site listing. * Included floating icon rendering logic. == Upgrade Notice == = 1.0.14 = * Fixed PHPCS errors: Renamed file to class-elmls-plugin.php, added @package tag. * Conditionalized error_log calls to reduce debug log clutter. * Justified file_get_contents for local file usage. == License == This plugin is released under the GPLv2 or later. You can use it freely in commercial or personal projects. == Donate == If you enjoy using this plugin, please consider supporting its development: 💖 [Buy me a coffee](https://domclic.com/wordpress/plugins/effortless-multisite-language-switcher/donate)