Skip to content
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
## 2.10.1
* Fix: Deprecated function warning pointed to non-existent function.
* Documentation: update README.md code snippets to reflect new function names.

## 2.10.0

* Add prefixed public helper functions (msls_get_*, msls_the_msls) with deprecation shims for legacy names to satisfy WPCS while staying backward compatible.
* Expose action hook names as constants for safer programmatic use.
* Accessibility: add aria-current="page" on the active language link.
* Fix: resolve path-related issue affecting asset/loader resolution.
* Internal: reorganized folders for clearer structure; include composer.json in release artifacts.
* Maintenance: numerous dependency updates (WordPress build tooling, Playwright/e2e utils, Node types, security bumps such as tar-fs, dotenv, js-yaml, express).

## 2.9.6
* Alternate links are now printed without the title attribute.
* Fix in ImportCoordinates
Expand Down
4 changes: 2 additions & 2 deletions MultisiteLanguageSwitcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Multisite Language Switcher Plugin
*
* Plugin Name: Multisite Language Switcher
* Version: 2.9.6
* Version: 2.10.1
* Plugin URI: http://msls.co/
* Description: A simple but powerful plugin that will help you to manage the relations of your contents in a multilingual multisite-installation.
* Author: Dennis Ploetner
Expand Down Expand Up @@ -41,7 +41,7 @@
* @author Dennis Ploetner <re@lloc.de>
*/
if ( ! defined( 'MSLS_PLUGIN_VERSION' ) ) {
define( 'MSLS_PLUGIN_VERSION', '2.9.6' );
define( 'MSLS_PLUGIN_VERSION', '2.10.1' );
define( 'MSLS_PLUGIN_PATH', plugin_basename( __FILE__ ) );
define( 'MSLS_PLUGIN__FILE__', __FILE__ );

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ If you plan to use the GitHub repository on a server, don't forget to run `compo
* Optional Theme Integration:
* Insert the following PHP code directly into your theme files to display language switcher links:
```php
if ( function_exists( 'the_msls' ) ) {
the_msls();
if ( function_exists( 'msls_the_switcher' ) ) {
msls_the_switcher();
}
```
Review the [Multisite Language Switcher Website](http://msls.co/) for more information. Some [diagrams](https://github.com/lloc/Multisite-Language-Switcher/blob/master/Diagrams.md) are also available.
Expand Down
30 changes: 15 additions & 15 deletions assets/css-flags/flags.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
// Unhandled language: kir (Kyrgyz)
// Unhandled language: snd (Sindhi)
// Unhandled language: sw (Swahili)
return $className = array(
return array(
'af' => 'flag-icon-za',
'ary' => 'flag-icon-ma',
'as' => 'flag-icon-in',
Expand All @@ -31,40 +31,40 @@
'cs_CZ' => 'flag-icon-cz',
'cy' => 'flag-icon-gb-wls',
'da_DK' => 'flag-icon-dk',
'de_CH' => 'flag-icon-ch',
'de_AT' => 'flag-icon-at',
'de_DE' => 'flag-icon-de',
'de_DE_formal' => 'flag-icon-de',
'de_CH' => 'flag-icon-ch',
'de_CH_informal' => 'flag-icon-ch',
'de_AT' => 'flag-icon-at',
'dzo' => 'flag-icon-bt',
'el' => 'flag-icon-gr',
'en_ZA' => 'flag-icon-za',
'en_AU' => 'flag-icon-au',
'en_NZ' => 'flag-icon-nz',
'en_GB' => 'flag-icon-gb',
'en_CA' => 'flag-icon-ca',
'en_GB' => 'flag-icon-gb',
'en_ZA' => 'flag-icon-za',
'en_AU' => 'flag-icon-au',
'eo' => 'flag-icon-eu',
'es_PE' => 'flag-icon-pe',
'es_AR' => 'flag-icon-ar',
'es_CL' => 'flag-icon-cl',
'es_ES' => 'flag-icon-es',
'es_CO' => 'flag-icon-co',
'es_PE' => 'flag-icon-pe',
'es_CR' => 'flag-icon-cr',
'es_VE' => 'flag-icon-ve',
'es_EC' => 'flag-icon-ec',
'es_DO' => 'flag-icon-do',
'es_UY' => 'flag-icon-uy',
'es_PR' => 'flag-icon-pr',
'es_GT' => 'flag-icon-gt',
'es_CR' => 'flag-icon-cr',
'es_MX' => 'flag-icon-mx',
'es_GT' => 'flag-icon-gt',
'es_CO' => 'flag-icon-co',
'et' => 'flag-icon-ee',
'eu' => 'flag-icon-es',
'fa_AF' => 'flag-icon-af',
'fa_IR' => 'flag-icon-ir',
'fa_AF' => 'flag-icon-af',
'fi' => 'flag-icon-fi',
'fr_CA' => 'flag-icon-ca',
'fr_FR' => 'flag-icon-fr',
'fr_BE' => 'flag-icon-be',
'fr_FR' => 'flag-icon-fr',
'fur' => 'flag-icon-it',
'gd' => 'flag-icon-gb-sct',
'gl_ES' => 'flag-icon-es',
Expand Down Expand Up @@ -97,18 +97,18 @@
'my_MM' => 'flag-icon-mm',
'nb_NO' => 'flag-icon-no',
'ne_NP' => 'flag-icon-np',
'nl_NL' => 'flag-icon-nl',
'nl_BE' => 'flag-icon-be',
'nl_NL' => 'flag-icon-nl',
'nl_NL_formal' => 'flag-icon-nl',
'nn_NO' => 'flag-icon-no',
'oci' => 'flag-icon-es-ca',
'pa_IN' => 'flag-icon-in',
'pl_PL' => 'flag-icon-pl',
'ps' => 'flag-icon-af',
'pt_PT_ao90' => 'flag-icon-90',
'pt_AO' => 'flag-icon-ao',
'pt_BR' => 'flag-icon-br',
'pt_PT' => 'flag-icon-pt',
'pt_PT_ao90' => 'flag-icon-90',
'pt_AO' => 'flag-icon-ao',
'ro_RO' => 'flag-icon-ro',
'ru_RU' => 'flag-icon-ru',
'sah' => 'flag-icon-ru',
Expand Down
30 changes: 15 additions & 15 deletions assets/flags/flags.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
// Unhandled language: kir (Kyrgyz)
// Unhandled language: snd (Sindhi)
// Unhandled language: sw (Swahili)
return $flags = array(
return array(
'af' => 'za.png',
'ar' => 'arableague.png',
'ary' => 'ma.png',
Expand All @@ -31,40 +31,40 @@
'cs_CZ' => 'cz.png',
'cy' => 'wales.png',
'da_DK' => 'dk.png',
'de_CH' => 'ch.png',
'de_AT' => 'at.png',
'de_DE' => 'de.png',
'de_DE_formal' => 'de.png',
'de_CH' => 'ch.png',
'de_CH_informal' => 'ch.png',
'de_AT' => 'at.png',
'dzo' => 'bt.png',
'el' => 'gr.png',
'en_ZA' => 'za.png',
'en_AU' => 'au.png',
'en_NZ' => 'nz.png',
'en_GB' => 'gb.png',
'en_CA' => 'ca.png',
'en_GB' => 'gb.png',
'en_ZA' => 'za.png',
'en_AU' => 'au.png',
'eo' => 'europeanunion.png',
'es_PE' => 'pe.png',
'es_AR' => 'ar.png',
'es_CL' => 'cl.png',
'es_ES' => 'es.png',
'es_CO' => 'co.png',
'es_PE' => 'pe.png',
'es_CR' => 'cr.png',
'es_VE' => 've.png',
'es_EC' => 'ec.png',
'es_DO' => 'do.png',
'es_UY' => 'uy.png',
'es_PR' => 'pr.png',
'es_GT' => 'gt.png',
'es_CR' => 'cr.png',
'es_MX' => 'mx.png',
'es_GT' => 'gt.png',
'es_CO' => 'co.png',
'et' => 'ee.png',
'eu' => 'es.png',
'fa_AF' => 'af.png',
'fa_IR' => 'ir.png',
'fa_AF' => 'af.png',
'fi' => 'fi.png',
'fr_CA' => 'ca.png',
'fr_FR' => 'fr.png',
'fr_BE' => 'be.png',
'fr_FR' => 'fr.png',
'fur' => 'it.png',
'gd' => 'scotland.png',
'gl_ES' => 'es.png',
Expand Down Expand Up @@ -97,18 +97,18 @@
'my_MM' => 'mm.png',
'nb_NO' => 'no.png',
'ne_NP' => 'np.png',
'nl_NL' => 'nl.png',
'nl_BE' => 'be.png',
'nl_NL' => 'nl.png',
'nl_NL_formal' => 'nl.png',
'nn_NO' => 'no.png',
'oci' => 'catalonia.png',
'pa_IN' => 'in.png',
'pl_PL' => 'pl.png',
'ps' => 'af.png',
'pt_PT_ao90' => '90.png',
'pt_AO' => 'ao.png',
'pt_BR' => 'br.png',
'pt_PT' => 'pt.png',
'pt_PT_ao90' => '90.png',
'pt_AO' => 'ao.png',
'ro_RO' => 'ro.png',
'ru_RU' => 'ru.png',
'sah' => 'ru.png',
Expand Down
2 changes: 1 addition & 1 deletion bin/flags-png.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@
$count = count( $json->translations );

echo '/**', PHP_EOL, ' * File is auto-generated', PHP_EOL, ' * ', PHP_EOL;
echo "* {$count} translations-teams for WordPress found", PHP_EOL, ' */', PHP_EOL;
echo " * {$count} translations-teams for WordPress found", PHP_EOL, ' */', PHP_EOL;

foreach ( $json->translations as $item ) {
if ( isset( $exceptions[ $item->language ] ) ) {
Expand Down
2 changes: 1 addition & 1 deletion bin/flags-svg.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@
$count = count( $json->translations );

echo '/**', PHP_EOL, ' * File is auto-generated', PHP_EOL, ' * ', PHP_EOL;
echo "* {$count} translations-teams for WordPress found", PHP_EOL, ' */', PHP_EOL;
echo " * {$count} translations-teams for WordPress found", PHP_EOL, ' */', PHP_EOL;

foreach ( $json->translations as $item ) {
if ( isset( $exceptions[ $item->language ] ) ) {
Expand Down
2 changes: 1 addition & 1 deletion build/translations.json

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions includes/MslsPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -206,9 +206,9 @@ public static function activate(): void {
* The plugin data in all blogs of the current network will be
* deleted after the uninstall procedure.
*
* @return boolean
* @return void
*/
public static function uninstall() {
public static function uninstall(): void {
/**
* We want to be sure that the user has not deactivated the
* multisite because we need to use switch_to_blog and
Expand All @@ -225,7 +225,7 @@ public static function uninstall() {
}
}

return self::cleanup();
self::cleanup();
}

/**
Expand Down
20 changes: 10 additions & 10 deletions includes/deprectated.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,52 +5,52 @@
/**
* Deprecated: Get the output for using the links to the translations in your code.
*
* @deprecated 2.9.7 Use msls_get_the_msls()
* @deprecated 2.10.1 Use msls_get_switcher()
*
* @param mixed $attr
*
* @return string
*/
// phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedFunctionFound
function get_the_msls( $attr ): string {
_deprecated_function( __FUNCTION__, '2.9.7', 'msls_get_the_msls' );
_deprecated_function( __FUNCTION__, '2.10.1', 'msls_get_switcher' );

return msls_get_switcher( $attr );
}

/**
* Deprecated: Output the links to the translations in your template.
*
* @deprecated 2.9.7 Use msls_the_msls()
* @deprecated 2.10.1 Use msls_the_switcher()
*
* @param string[] $arr
*/
// phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedFunctionFound
function the_msls( array $arr = array() ): void {
_deprecated_function( __FUNCTION__, '2.9.7', 'msls_the_msls' );
_deprecated_function( __FUNCTION__, '2.10.1', 'msls_the_switcher' );
msls_the_switcher( $arr );
}

/**
* Deprecated: Gets the URL of the country flag-icon for a specific locale.
*
* @deprecated 2.9.7 Use msls_get_flag_url()
* @deprecated 2.10.1 Use msls_get_flag_url()
*
* @param string $locale
*
* @return string
*/
// phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedFunctionFound
function get_msls_flag_url( string $locale ): string {
_deprecated_function( __FUNCTION__, '2.9.7', 'msls_get_flag_url' );
_deprecated_function( __FUNCTION__, '2.10.1', 'msls_get_flag_url' );

return msls_get_flag_url( $locale );
}

/**
* Deprecated: Gets the description for a blog for a specific locale.
*
* @deprecated 2.9.7 Use msls_get_blog_description()
* @deprecated 2.10.1 Use msls_get_blog_description()
*
* @param string $locale
* @param string $preset
Expand All @@ -59,15 +59,15 @@ function get_msls_flag_url( string $locale ): string {
*/
// phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedFunctionFound
function get_msls_blog_description( string $locale, string $preset = '' ): string {
_deprecated_function( __FUNCTION__, '2.9.7', 'msls_get_blog_description' );
_deprecated_function( __FUNCTION__, '2.10.1', 'msls_get_blog_description' );

return msls_get_blog_description( $locale, $preset );
}

/**
* Deprecated: Gets the permalink for a translation of the current post in a given language.
*
* @deprecated 2.9.7 Use msls_get_permalink()
* @deprecated 2.10.1 Use msls_get_permalink()
*
* @param string $locale
* @param string $preset
Expand All @@ -76,7 +76,7 @@ function get_msls_blog_description( string $locale, string $preset = '' ): strin
*/
// phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedFunctionFound
function get_msls_permalink( string $locale, string $preset = '' ): string {
_deprecated_function( __FUNCTION__, '2.9.7', 'msls_get_permalink' );
_deprecated_function( __FUNCTION__, '2.10.1', 'msls_get_permalink' );

return msls_get_permalink( $locale, $preset );
}
4 changes: 2 additions & 2 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ Contributors: realloc, lucatume
Donate link: https://www.greenpeace.org/international/
Tags: multilingual, multisite, language, switcher, localization
Requires at least: 6.1
Tested up to: 6.8
Tested up to: 6.9
Requires PHP: 7.4
Stable tag: 2.9.6
Stable tag: 2.10.1
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html

Expand Down
2 changes: 1 addition & 1 deletion src/msls-widget-block/block.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"icon": "translation",
"category": "widgets",
"name": "lloc/msls-widget-block",
"version": "2.9.6",
"version": "2.10.1",
"description": "Review the settings for the Multisite Language Switcher plugin, as the block utilizes the API function `the_msls()` for its output.",
"example": {},
"supports": {
Expand Down
Loading