-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #58 from IONOS-WordPress/feature/mu-plugin-support
Feature/mu plugin support
- Loading branch information
Showing
18 changed files
with
370 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"name": "@ionos-wordpress/test-mu-plugin", | ||
"private": true, | ||
"version": "0.0.1", | ||
"dependencies": { | ||
"@ionos-wordpress/test-lib": "workspace:*" | ||
}, | ||
"devDependencies": { | ||
"@wordpress/components": "catalog:", | ||
"@ionos-wordpress/rector-php": "workspace:*", | ||
"@ionos-wordpress/ecs-php": "workspace:*", | ||
"@ionos-wordpress/dennis-i18n": "workspace:*" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
<?php | ||
|
||
/** | ||
* Plugin Name: ionos-wordpress/test-mu-plugin | ||
* Description: a test mu plugin | ||
* Requires at least: 6.6 | ||
* Requires Plugins: | ||
* Requires PHP: 8.3 | ||
* Version: 0.0.1 | ||
* License: GPL-2.0-or-later | ||
* Author: IONOS Group | ||
* Author URI: https://www.ionos-group.com/brands.html | ||
* Domain Path: /languages | ||
*/ | ||
|
||
namespace ionos_wordpress\test_mu_plugin; | ||
|
||
defined('ABSPATH') || exit(); | ||
|
||
const PLUGIN_FILE = __FILE__; | ||
|
||
\add_action('init', function (): void { | ||
\load_muplugin_textdomain( | ||
domain: 'test-mu-plugin', | ||
mu_plugin_rel_path: basename(__DIR__) . '/test-mu-plugin/languages/' | ||
); | ||
|
||
$translated_text = \__('hello.world', 'test-mu-plugin'); | ||
// phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_error_log | ||
error_log($translated_text); | ||
}); | ||
|
||
\add_action('admin_enqueue_scripts', function (): void { | ||
$assets = include_once __DIR__ . '/test-mu-plugin/build/index.asset.php'; | ||
\wp_enqueue_script( | ||
handle: 'test-mu-plugin-index', | ||
src: \plugins_url('/test-mu-plugin/build/index.js', __FILE__), | ||
deps: $assets['dependencies'], | ||
ver: $assets['version'], | ||
args: [ | ||
'in_footer' => true, | ||
], | ||
); | ||
\wp_set_script_translations( | ||
handle : 'test-test-mu-plugin-index', | ||
domain : 'test-mu-plugin', | ||
path : basename(__DIR__) . '/test-mu-plugin/languages' | ||
); | ||
}); | ||
|
||
require_once __DIR__ . '/test-mu-plugin/inc/feature-1.php'; | ||
require_once __DIR__ . '/test-mu-plugin/build/feature-2/index.php'; |
11 changes: 11 additions & 0 deletions
11
packages/wp-mu-plugin/test-mu-plugin/test-mu-plugin/inc/feature-1.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<?php | ||
|
||
namespace ionos_wordpress\test_mu_plugin\feature_1; | ||
|
||
function feature_1(): void | ||
{ | ||
// phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_error_log | ||
error_log('hello from ionos_wordpress\test_mu_plugin\feature_1'); | ||
} | ||
|
||
feature_1(); |
47 changes: 47 additions & 0 deletions
47
packages/wp-mu-plugin/test-mu-plugin/test-mu-plugin/languages/test-mu-plugin-de_DE.po
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
msgid "" | ||
msgstr "" | ||
"Content-Transfer-Encoding: 8bit\n" | ||
"Content-Type: text/plain; charset=UTF-8\n" | ||
"Language: de\n" | ||
"Language-Team: none\n" | ||
"Last-Translator: Automatically generated\n" | ||
"MIME-Version: 1.0\n" | ||
"PO-Revision-Date: 2025-02-05T12:26:16+00:00\n" | ||
"POT-Creation-Date: 2025-02-05T12:26:16+00:00\n" | ||
"Plural-Forms: nplurals=2; plural=(n != 1);\n" | ||
"Project-Id-Version: ionos-wordpress/test-mu-plugin 0.0.1\n" | ||
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/html\n" | ||
"X-Domain: test-mu-plugin\n" | ||
"X-Generator: WP-CLI 2.11.0\n" | ||
|
||
#. Plugin Name of the plugin | ||
#: test-mu-plugin.php | ||
msgid "ionos-wordpress/test-mu-plugin" | ||
msgstr "ionos-wordpress/test-mu-plugin" | ||
|
||
#. Description of the plugin | ||
#: test-mu-plugin.php | ||
msgid "a test mu plugin" | ||
msgstr "ein Test-Mu-Plugin" | ||
|
||
#. Author of the plugin | ||
#: test-mu-plugin.php | ||
msgid "IONOS Group" | ||
msgstr "IONOS-Gruppe" | ||
|
||
#. Author URI of the plugin | ||
#: test-mu-plugin.php | ||
msgid "https://www.ionos-group.com/brands.html" | ||
msgstr "https://www.ionos-group.com/brands.html" | ||
|
||
#: test-mu-plugin.php:25 | ||
msgid "hello.world" | ||
msgstr "hallo.welt" | ||
|
||
#: test-mu-plugin/build/feature-2/index.js:1 | ||
msgid "hello from packages/wp-mu-plugin/test-mu-plugin/src/feature-2/index.js" | ||
msgstr "hallo von packages/wp-mu-plugin/test-mu-plugin/src/feature-2/index.js" | ||
|
||
#: test-mu-plugin/build/index.js:1 | ||
msgid "hello from packages/wp-mu-plugin/test-mu-plugin/src/index.js" | ||
msgstr "hallo von packages/wp-mu-plugin/test-mu-plugin/src/index.js" |
47 changes: 47 additions & 0 deletions
47
packages/wp-mu-plugin/test-mu-plugin/test-mu-plugin/languages/test-mu-plugin-en_US.po
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
msgid "" | ||
msgstr "" | ||
"Content-Transfer-Encoding: 8bit\n" | ||
"Content-Type: text/plain; charset=UTF-8\n" | ||
"Language: en_US\n" | ||
"Language-Team: none\n" | ||
"Last-Translator: Automatically generated\n" | ||
"MIME-Version: 1.0\n" | ||
"PO-Revision-Date: 2025-02-05T12:26:16+00:00\n" | ||
"POT-Creation-Date: 2025-02-05T12:26:16+00:00\n" | ||
"Plural-Forms: nplurals=2; plural=(n != 1);\n" | ||
"Project-Id-Version: ionos-wordpress/test-mu-plugin 0.0.1\n" | ||
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/html\n" | ||
"X-Domain: test-mu-plugin\n" | ||
"X-Generator: WP-CLI 2.11.0\n" | ||
|
||
#. Plugin Name of the plugin | ||
#: test-mu-plugin.php | ||
msgid "ionos-wordpress/test-mu-plugin" | ||
msgstr "ionos-wordpress/test-mu-plugin" | ||
|
||
#. Description of the plugin | ||
#: test-mu-plugin.php | ||
msgid "a test mu plugin" | ||
msgstr "a test mu plugin" | ||
|
||
#. Author of the plugin | ||
#: test-mu-plugin.php | ||
msgid "IONOS Group" | ||
msgstr "IONOS Group" | ||
|
||
#. Author URI of the plugin | ||
#: test-mu-plugin.php | ||
msgid "https://www.ionos-group.com/brands.html" | ||
msgstr "https://www.ionos-group.com/brands.html" | ||
|
||
#: test-mu-plugin.php:25 | ||
msgid "hello.world" | ||
msgstr "hello.world" | ||
|
||
#: test-mu-plugin/build/feature-2/index.js:1 | ||
msgid "hello from packages/wp-mu-plugin/test-mu-plugin/src/feature-2/index.js" | ||
msgstr "hello from packages/wp-mu-plugin/test-mu-plugin/src/feature-2/index.js" | ||
|
||
#: test-mu-plugin/build/index.js:1 | ||
msgid "hello from packages/wp-mu-plugin/test-mu-plugin/src/index.js" | ||
msgstr "hello from packages/wp-mu-plugin/test-mu-plugin/src/index.js" |
47 changes: 47 additions & 0 deletions
47
packages/wp-mu-plugin/test-mu-plugin/test-mu-plugin/languages/test-mu-plugin.pot
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
# Copyright (C) 2025 IONOS Group | ||
# This file is distributed under the GPL-2.0-or-later. | ||
msgid "" | ||
msgstr "" | ||
"Project-Id-Version: ionos-wordpress/test-mu-plugin 0.0.1\n" | ||
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/html\n" | ||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" | ||
"Language-Team: LANGUAGE <[email protected]>\n" | ||
"MIME-Version: 1.0\n" | ||
"Content-Type: text/plain; charset=UTF-8\n" | ||
"Content-Transfer-Encoding: 8bit\n" | ||
"POT-Creation-Date: 2025-02-05T14:52:37+00:00\n" | ||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" | ||
"X-Generator: WP-CLI 2.11.0\n" | ||
"X-Domain: test-mu-plugin\n" | ||
|
||
#. Plugin Name of the plugin | ||
#: test-mu-plugin.php | ||
msgid "ionos-wordpress/test-mu-plugin" | ||
msgstr "" | ||
|
||
#. Description of the plugin | ||
#: test-mu-plugin.php | ||
msgid "a test mu plugin" | ||
msgstr "" | ||
|
||
#. Author of the plugin | ||
#: test-mu-plugin.php | ||
msgid "IONOS Group" | ||
msgstr "" | ||
|
||
#. Author URI of the plugin | ||
#: test-mu-plugin.php | ||
msgid "https://www.ionos-group.com/brands.html" | ||
msgstr "" | ||
|
||
#: test-mu-plugin.php:25 | ||
msgid "hello.world" | ||
msgstr "" | ||
|
||
#: test-mu-plugin/build/feature-2/index.js:1 | ||
msgid "hello from packages/wp-mu-plugin/test-mu-plugin/src/feature-2/index.js" | ||
msgstr "" | ||
|
||
#: test-mu-plugin/build/index.js:1 | ||
msgid "hello from packages/wp-mu-plugin/test-mu-plugin/src/index.js" | ||
msgstr "" |
3 changes: 3 additions & 0 deletions
3
packages/wp-mu-plugin/test-mu-plugin/test-mu-plugin/src/feature-2/index.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import { __ } from '@wordpress/i18n'; | ||
// eslint-disable-next-line no-console | ||
console.log(__('hello from packages/wp-mu-plugin/test-mu-plugin/src/feature-2/index.js', 'test-mu-plugin')); |
27 changes: 27 additions & 0 deletions
27
packages/wp-mu-plugin/test-mu-plugin/test-mu-plugin/src/feature-2/index.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<?php | ||
|
||
namespace ionos_wordpress\test_mu_plugin\feature_2; | ||
|
||
use const ionos_wordpress\test_mu_plugin\PLUGIN_FILE; | ||
|
||
function feature_2(): void | ||
{ | ||
// phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_error_log | ||
error_log('hello from ionos_wordpress\test_mu_plugin\feature_2'); | ||
} | ||
|
||
feature_2(); | ||
|
||
\add_action('admin_enqueue_scripts', function (): void { | ||
$assets = include_once __DIR__ . '/index.asset.php'; | ||
\wp_enqueue_script( | ||
handle: 'test-mu-plugin-feature-2-index', | ||
src: \plugins_url('test-mu-plugin/build/feature-2/index.js', PLUGIN_FILE), | ||
deps: $assets['dependencies'], | ||
ver: $assets['version'], | ||
args: [ | ||
'in_footer' => true, | ||
], | ||
); | ||
\wp_set_script_translations('test-mu-plugin-feature-2-index', 'test-mu-plugin', PLUGIN_FILE . '/languages'); | ||
}); |
3 changes: 3 additions & 0 deletions
3
packages/wp-mu-plugin/test-mu-plugin/test-mu-plugin/src/index.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import { __ } from '@wordpress/i18n'; | ||
// eslint-disable-next-line no-console | ||
console.log(__('hello from packages/wp-mu-plugin/test-mu-plugin/src/index.js', 'test-mu-plugin')); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.