Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
7 changes: 7 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,11 @@ jobs:
test ! -e "$BUILD_DIR/$forbidden" || { echo "::error::$BUILD_DIR/$forbidden must not be shipped"; exit 1; }
done
echo "Build directory holds $(find "$BUILD_DIR" -type f | wc -l) files."
# composer build also leaves a mslsmenu.zip here. The deploy action below runs
# "zip -r" on that very path, which merges into an existing archive instead of
# replacing it - the attestation would then compare a zip that still carries
# entries from the local build. Drop it so the action starts from scratch.
rm -f "$BUILD_DIR.zip"
- name: WordPress Plugin Deploy
uses: 10up/action-wordpress-plugin-deploy@stable
id: deploy
Expand All @@ -56,4 +61,6 @@ jobs:
- name: Attest build provenance
uses: johnbillion/action-wordpress-plugin-attestation@0.7.3
with:
# Defaults to the repository name ("MslsMenu"); the wp.org slug is lowercase.
plugin: mslsmenu
zip-path: ${{ steps.deploy.outputs.zip-path }}
4 changes: 3 additions & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,6 @@
## Release Packaging Tips
- Bump the plugin header version in `MslsMenu.php` and the `Stable tag` in `readme.txt` to the same value, and add the matching `= x.y.z =` entry to the `readme.txt` changelog. WordPress.org rejects the release if header and stable tag disagree.
- Run `composer build` locally only to inspect the result. The shipped artifact is built in CI: `.github/workflows/deploy.yml` runs the same `composer build`, verifies the contents and deploys them through `BUILD_DIR: mslsmenu`.
- Tag without a `v` prefix (`3.0.1`) and push the tag — that push is what triggers the deploy workflow.
- Tag without a `v` prefix (`3.0.2`) and push the tag — that push is what triggers the deploy workflow.
- **Never move a tag that has already been pushed.** WordPress.org refuses to overwrite an existing `tags/<version>` directory (`deploy.sh` logs "was already published" and skips the SVN write), so a re-pointed tag silently leaves the wrong code online. This is how 3.0.1 ended up shipping the 3.0.0 code. A botched release needs a new version number, not a corrected tag.
- Tag the merge commit on `master`, never a branch head, and check that its `Version:` header is the one you intend to release.
40 changes: 30 additions & 10 deletions MslsMenu.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
*
* Plugin Name: MslsMenu
* Requires Plugins: multisite-language-switcher
* Version: 3.0.1
* Version: 3.0.2
* Plugin URI: https://wordpress.org/plugins/mslsmenu/
* Description: Adds the Multisite Language Switcher to the primary-nav-menu
* Author: Dennis Ploetner
Expand Down Expand Up @@ -82,10 +82,6 @@ public static function init( $options ): MslsMenu {
return $obj;
}

private function get_msls_output(): lloc\Msls\Frontend\Output {
return msls_output();
}

/**
* Callback for wp_nav_menu_items
*
Expand All @@ -101,7 +97,7 @@ public function nav_item( string $items, \stdClass $args ): string {
if ( is_array( $menu_locations ) && in_array( $theme_location, $menu_locations, true ) ) {
$menu = '';

$obj = $this->get_msls_output();
$obj = msls_output();
foreach ( $obj->get( (int) $this->options->mslsmenu_display, false, (bool) $this->options->only_with_translation ) as $item ) {
$menu .= $this->options->mslsmenu_before_item . $item . $this->options->mslsmenu_after_item;
}
Expand Down Expand Up @@ -206,17 +202,41 @@ public function input( array $args ) {
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
echo ( new lloc\Msls\Component\Input\Text( $key, $value ) )->render();
}

/**
* Callback for admin_notices, telling the administrator why MslsMenu does nothing.
*
* "Requires Plugins" cannot express a minimum version, so without this notice an
* outdated Multisite Language Switcher would make the menu links disappear without
* any explanation.
*/
public static function requirements_notice(): void {
if ( ! current_user_can( 'activate_plugins' ) ) {
return;
}

printf(
'<div class="notice notice-warning"><p>%s</p></div>',
esc_html__( 'MslsMenu is inactive: it requires Multisite Language Switcher 3.0 or newer.', 'mslsmenu' )
);
}
}

// @codeCoverageIgnoreStart
if ( function_exists( 'add_action' ) ) {
add_action(
'plugins_loaded',
function () {
// The namespaced class only exists from MSLS 3.0 on. Against an older MSLS the
// null object keeps every hook unregistered instead of fataling on a missing type.
$options = class_exists( lloc\Msls\Options\Options::class ) ? msls_options() : null;
MslsMenu::init( $options );
// The namespaced class exists from MSLS 3.0 on, the api.php helpers only once the
// MSLS plugin file itself was loaded - being autoloadable is not enough. Both have
// to hold, otherwise the null object keeps every hook unregistered.
$ready = class_exists( lloc\Msls\Options\Options::class ) && function_exists( 'msls_options' );

if ( ! $ready ) {
add_action( 'admin_notices', array( MslsMenu::class, 'requirements_notice' ) );
}

MslsMenu::init( $ready ? msls_options() : null );
}
);
}
Expand Down
7 changes: 5 additions & 2 deletions languages/mslsmenu-de_DE.l10n.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,20 @@
'domain' => null,
'plural-forms' => 'nplurals=2; plural=(n != 1);',
'language' => 'German (de_DE)',
'project-id-version' => 'MslsMenu 1.0',
'pot-creation-date' => '2015-05-04 17:04+0100',
'project-id-version' => 'MslsMenu 3.0.2',
'pot-creation-date' => '2026-08-23T08:54:39+00:00',
'po-revision-date' => '2015-05-04 17:06+0100',
'x-generator' => 'Poedit 1.5.4',
'messages' => array(
'Menu Settings' => 'Menü-Einstellungen',
'Theme Location' => 'Position im Theme',
'Display' => 'Anzeige',
'Text/HTML before the list' => 'Text/HTML vor der Liste',
'Text/HTML after the list' => 'Text/HTML nach der Liste',
'Text/HTML before each item' => 'Text/HTML vor jedem Element',
'Text/HTML after each item' => 'Text/HTML nach jedem Element',
'-- empty --' => '-- leer --',
'Adds the Multisite Language Switcher to the primary-nav-menu' => 'Fügt den Multisite Language Switcher zum Hauptmenü hinzu',
'MslsMenu is inactive: it requires Multisite Language Switcher 3.0 or newer.' => 'MslsMenu ist inaktiv: Es benötigt den Multisite Language Switcher 3.0 oder neuer.',
),
);
Binary file modified languages/mslsmenu-de_DE.mo
Binary file not shown.
36 changes: 16 additions & 20 deletions languages/mslsmenu-de_DE.po
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
msgid ""
msgstr ""
"Project-Id-Version: MslsMenu 1.0\n"
"Project-Id-Version: MslsMenu 3.0.2\n"
"Report-Msgid-Bugs-To: http://wordpress.org/tag/multisite-language-switcher\n"
"Last-Translator: Dennis Ploetner <dennis.ploetner@drivek.it>\n"
"Language-Team: Dennis Ploetner <re@lloc.de>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"POT-Creation-Date: 2015-05-04 17:04+0100\n"
"POT-Creation-Date: 2026-08-23T08:54:39+00:00\n"
"PO-Revision-Date: 2015-05-04 17:06+0100\n"
"Language: German (de_DE)\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
Expand All @@ -18,43 +18,35 @@ msgstr ""
"X-Poedit-SearchPath-0: .\n"
"X-Poedit-SearchPath-1: ..\n"

#: MslsMenu.php:121
#: mslsmenu/MslsMenu.php:121
#: MslsMenu.php:117
msgid "Menu Settings"
msgstr "Menü-Einstellungen"

#: MslsMenu.php:134
#: mslsmenu/MslsMenu.php:134
#: MslsMenu.php:128
msgid "Theme Location"
msgstr ""
msgstr "Position im Theme"

#: MslsMenu.php:138
#: mslsmenu/MslsMenu.php:138
#: MslsMenu.php:132
msgid "Display"
msgstr "Anzeige"

#: MslsMenu.php:143
#: mslsmenu/MslsMenu.php:143
#: MslsMenu.php:137
msgid "Text/HTML before the list"
msgstr "Text/HTML vor der Liste"

#: MslsMenu.php:144
#: mslsmenu/MslsMenu.php:144
#: MslsMenu.php:138
msgid "Text/HTML after the list"
msgstr "Text/HTML nach der Liste"

#: MslsMenu.php:145
#: mslsmenu/MslsMenu.php:145
#: MslsMenu.php:139
msgid "Text/HTML before each item"
msgstr "Text/HTML vor jedem Element"

#: MslsMenu.php:146
#: mslsmenu/MslsMenu.php:146
#: MslsMenu.php:140
msgid "Text/HTML after each item"
msgstr "Text/HTML nach jedem Element"

#: MslsMenu.php:165
#: mslsmenu/MslsMenu.php:165
#: MslsMenu.php:159
msgid "-- empty --"
msgstr "-- leer --"

Expand All @@ -71,7 +63,7 @@ msgstr ""
#. Description of the plugin
#: MslsMenu.php
msgid "Adds the Multisite Language Switcher to the primary-nav-menu"
msgstr ""
msgstr "Fügt den Multisite Language Switcher zum Hauptmenü hinzu"

#. Author of the plugin
#: MslsMenu.php
Expand All @@ -82,3 +74,7 @@ msgstr ""
#: MslsMenu.php
msgid "http://lloc.de/"
msgstr ""

#: MslsMenu.php:220
msgid "MslsMenu is inactive: it requires Multisite Language Switcher 3.0 or newer."
msgstr "MslsMenu ist inaktiv: Es benötigt den Multisite Language Switcher 3.0 oder neuer."
4 changes: 2 additions & 2 deletions languages/mslsmenu-es_ES.l10n.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
'domain' => null,
'plural-forms' => 'nplurals=2; plural=(n != 1);',
'language' => 'Spanish (es_ES)',
'project-id-version' => 'MslsMenu 1.0',
'pot-creation-date' => '2015-05-04 17:07+0100',
'project-id-version' => 'MslsMenu 3.0.2',
'pot-creation-date' => '2026-08-23T08:54:39+00:00',
'po-revision-date' => '2015-05-04 17:07+0100',
'x-generator' => 'Poedit 1.5.4',
'messages' => array(
Expand Down
Binary file modified languages/mslsmenu-es_ES.mo
Binary file not shown.
32 changes: 14 additions & 18 deletions languages/mslsmenu-es_ES.po
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
msgid ""
msgstr ""
"Project-Id-Version: MslsMenu 1.0\n"
"Project-Id-Version: MslsMenu 3.0.2\n"
"Report-Msgid-Bugs-To: http://wordpress.org/tag/multisite-language-switcher\n"
"Last-Translator: Dennis Ploetner <dennis.ploetner@drivek.it>\n"
"Language-Team: Andreas Breitschopp <a-breitschopp@ab-tools.com>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"POT-Creation-Date: 2015-05-04 17:07+0100\n"
"POT-Creation-Date: 2026-08-23T08:54:39+00:00\n"
"PO-Revision-Date: 2015-05-04 17:07+0100\n"
"Language: Spanish (es_ES)\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
Expand All @@ -18,43 +18,35 @@ msgstr ""
"X-Poedit-SearchPath-0: .\n"
"X-Poedit-SearchPath-1: ..\n"

#: MslsMenu.php:121
#: mslsmenu/MslsMenu.php:121
#: MslsMenu.php:117
msgid "Menu Settings"
msgstr ""

#: MslsMenu.php:134
#: mslsmenu/MslsMenu.php:134
#: MslsMenu.php:128
msgid "Theme Location"
msgstr ""

#: MslsMenu.php:138
#: mslsmenu/MslsMenu.php:138
#: MslsMenu.php:132
msgid "Display"
msgstr "Aspecto"

#: MslsMenu.php:143
#: mslsmenu/MslsMenu.php:143
#: MslsMenu.php:137
msgid "Text/HTML before the list"
msgstr "Texto/HTML antes de la lista"

#: MslsMenu.php:144
#: mslsmenu/MslsMenu.php:144
#: MslsMenu.php:138
msgid "Text/HTML after the list"
msgstr "Texto/HTML después de la lista"

#: MslsMenu.php:145
#: mslsmenu/MslsMenu.php:145
#: MslsMenu.php:139
msgid "Text/HTML before each item"
msgstr "Texto/HTML antes de cada ítem"

#: MslsMenu.php:146
#: mslsmenu/MslsMenu.php:146
#: MslsMenu.php:140
msgid "Text/HTML after each item"
msgstr "Texto/HTML después de cada ítem"

#: MslsMenu.php:165
#: mslsmenu/MslsMenu.php:165
#: MslsMenu.php:159
msgid "-- empty --"
msgstr ""

Expand Down Expand Up @@ -82,3 +74,7 @@ msgstr ""
#: MslsMenu.php
msgid "http://lloc.de/"
msgstr ""

#: MslsMenu.php:220
msgid "MslsMenu is inactive: it requires Multisite Language Switcher 3.0 or newer."
msgstr ""
4 changes: 2 additions & 2 deletions languages/mslsmenu-fr_FR.l10n.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
'domain' => null,
'plural-forms' => 'nplurals=2; plural=(n != 1);',
'language' => 'French (fr_FR)',
'project-id-version' => 'MslsMenu 1.0',
'pot-creation-date' => '2015-05-04 17:07+0100',
'project-id-version' => 'MslsMenu 3.0.2',
'pot-creation-date' => '2026-08-23T08:54:39+00:00',
'po-revision-date' => '2015-05-04 17:07+0100',
'x-generator' => 'Poedit 1.5.4',
'messages' => array(
Expand Down
Binary file modified languages/mslsmenu-fr_FR.mo
Binary file not shown.
32 changes: 14 additions & 18 deletions languages/mslsmenu-fr_FR.po
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
msgid ""
msgstr ""
"Project-Id-Version: MslsMenu 1.0\n"
"Project-Id-Version: MslsMenu 3.0.2\n"
"Report-Msgid-Bugs-To: http://wordpress.org/tag/multisite-language-switcher\n"
"Last-Translator: Dennis Ploetner <dennis.ploetner@drivek.it>\n"
"Language-Team: Andreas Breitschopp <a-breitschopp@ab-tools.com>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"POT-Creation-Date: 2015-05-04 17:07+0100\n"
"POT-Creation-Date: 2026-08-23T08:54:39+00:00\n"
"PO-Revision-Date: 2015-05-04 17:07+0100\n"
"Language: French (fr_FR)\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
Expand All @@ -18,43 +18,35 @@ msgstr ""
"X-Poedit-SearchPath-0: .\n"
"X-Poedit-SearchPath-1: ..\n"

#: MslsMenu.php:121
#: mslsmenu/MslsMenu.php:121
#: MslsMenu.php:117
msgid "Menu Settings"
msgstr ""

#: MslsMenu.php:134
#: mslsmenu/MslsMenu.php:134
#: MslsMenu.php:128
msgid "Theme Location"
msgstr ""

#: MslsMenu.php:138
#: mslsmenu/MslsMenu.php:138
#: MslsMenu.php:132
msgid "Display"
msgstr "Affichage"

#: MslsMenu.php:143
#: mslsmenu/MslsMenu.php:143
#: MslsMenu.php:137
msgid "Text/HTML before the list"
msgstr "Texte/HTML avant la liste"

#: MslsMenu.php:144
#: mslsmenu/MslsMenu.php:144
#: MslsMenu.php:138
msgid "Text/HTML after the list"
msgstr "Texte/HTML après la liste"

#: MslsMenu.php:145
#: mslsmenu/MslsMenu.php:145
#: MslsMenu.php:139
msgid "Text/HTML before each item"
msgstr "Texte/HTML avant chaque article"

#: MslsMenu.php:146
#: mslsmenu/MslsMenu.php:146
#: MslsMenu.php:140
msgid "Text/HTML after each item"
msgstr "Texte/HTML après chaque article"

#: MslsMenu.php:165
#: mslsmenu/MslsMenu.php:165
#: MslsMenu.php:159
msgid "-- empty --"
msgstr ""

Expand Down Expand Up @@ -82,3 +74,7 @@ msgstr ""
#: MslsMenu.php
msgid "http://lloc.de/"
msgstr ""

#: MslsMenu.php:220
msgid "MslsMenu is inactive: it requires Multisite Language Switcher 3.0 or newer."
msgstr ""
4 changes: 2 additions & 2 deletions languages/mslsmenu-it_IT.l10n.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
'domain' => null,
'plural-forms' => 'nplurals=2; plural=(n != 1);',
'language' => 'Italian (it_IT)',
'project-id-version' => 'MslsMenu 1.0',
'pot-creation-date' => '2015-05-04 17:07+0100',
'project-id-version' => 'MslsMenu 3.0.2',
'pot-creation-date' => '2026-08-23T08:54:39+00:00',
'po-revision-date' => '2015-05-04 17:07+0100',
'x-generator' => 'Poedit 1.5.4',
'messages' => array(
Expand Down
Binary file modified languages/mslsmenu-it_IT.mo
Binary file not shown.
Loading
Loading