Skip to content

Commit 56d007a

Browse files
authored
Merge pull request #32 from WebDevStudios/bugfix/MAIN-184-fix-deprecation-errors
Bugfix/main 184 fix deprecation errors
2 parents 102919f + 7986a96 commit 56d007a

5 files changed

+102
-33
lines changed

README.md

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,12 @@ You will have to require it in e.g. `mu-plugins/wds-required-plugins-list.php`:
4141
require WPMU_PLUGIN_DIR . '/wds-required-plugins/wds-required-plugins.php';
4242

4343
function wds_required_plugins_add( $required ) {
44-
return array_merge( $required, array(
45-
'my-plugin/my-plugin.php`,
46-
) );
44+
return array_merge(
45+
$required,
46+
[
47+
'my-plugin/my-plugin.php',
48+
]
49+
);
4750
}
4851
add_filter( 'wds_network_required_plugins', 'wds_required_plugins_add' );
4952

@@ -62,13 +65,13 @@ add_filter( 'wds_network_required_plugins', 'wds_required_plugins_add' );
6265
* @return array Modified array of required plugins.
6366
*/
6467
function wds_required_plugins_add( $required ) {
65-
66-
$required = array_merge( $required, array(
67-
'jetpack/jetpack.php',
68-
'sample-plugin/sample-plugin.php',
69-
) );
70-
71-
return $required;
68+
return array_merge(
69+
$required,
70+
[
71+
'jetpack/jetpack.php',
72+
'sample-plugin/sample-plugin.php',
73+
]
74+
);
7275
}
7376
add_filter( 'wds_required_plugins', 'wds_required_plugins_add' );
7477
```
788 Bytes
Binary file not shown.

languages/wds-required-plugins-es_ES.po

Lines changed: 37 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,26 +2,49 @@ msgid ""
22
msgstr ""
33
"Project-Id-Version: WDS Required Plugins v0.1.0\n"
44
"Report-Msgid-Bugs-To: \n"
5-
"POT-Creation-Date: \n"
6-
"PO-Revision-Date: 2014-11-25 20:58:19+0000\n"
7-
"Last-Translator: Justin Sternberg <justin@dsgnwrks.pro>\n"
8-
"Language-Team: \n"
5+
"POT-Creation-Date: 2023-08-30 15:39+0000\n"
6+
"PO-Revision-Date: 2023-08-30 12:20-0400\n"
7+
"Last-Translator: Dave Romsey\n"
8+
"Language-Team: Spanish (Spain)\n"
9+
"Language: es_ES\n"
910
"MIME-Version: 1.0\n"
1011
"Content-Type: text/plain; charset=UTF-8\n"
1112
"Content-Transfer-Encoding: 8bit\n"
1213
"Plural-Forms: nplurals=2; plural=n != 1;\n"
13-
"X-Generator: Poedit 1.7beta3\n"
14-
"X-Poedit-Language: \n"
15-
"X-Poedit-Country: \n"
14+
"X-Generator: Poedit 3.1.1\n"
1615
"X-Poedit-SourceCharset: utf-8\n"
17-
"X-Poedit-KeywordsList: __;_e;__ngettext:1,2;_n:1,2;__ngettext_noop:1,2;_n_noop:1,2;_c,_nc:4c,1,2;_x:1,2c;_ex:1,2c;_nx:4c,1,2;_nx_noop:4c,1,2;\n"
18-
"X-Poedit-Basepath: \n"
19-
"X-Poedit-Bookmarks: \n"
16+
"X-Poedit-KeywordsList: __;_e;__ngettext:1,2;_n:1,2;__ngettext_noop:1,2;"
17+
"_n_noop:1,2;_c,_nc:4c,1,2;_x:1,2c;_ex:1,2c;_nx:4c,1,2;_nx_noop:4c,1,2\n"
18+
"X-Textdomain-Support: yes\n"
19+
"X-Loco-Version: 2.6.4; wp-6.3\n"
2020
"X-Poedit-SearchPath-0: .\n"
21-
"X-Textdomain-Support: yes"
2221

23-
#: wds-required-plugins.php:85
24-
#@ wds-required-plugins
25-
msgid "WDS Required Plugin"
22+
#. Description of the plugin
23+
msgid "Forcefully require specific plugins to be activated."
24+
msgstr "Requiere forzosamente que se activen plugins específicos."
25+
26+
#. Plugin URI of the plugin
27+
#. Author URI of the plugin
28+
msgid "http://webdevstudios.com"
29+
msgstr "http://webdevstudios.com"
30+
31+
#: wds-required-plugins.php:355
32+
msgid "Required Plugin"
33+
msgstr "Plugin Requerido"
34+
35+
#. translators: %1 and %2 are explained below. Set default log text.
36+
#: wds-required-plugins.php:317
37+
msgid "Required Plugin auto-activation failed for: %1$s, with message: %2$s"
38+
msgstr ""
39+
"La activación automática del plugin requerido falló para: %1$s, con mensaje: "
40+
"%2$s"
41+
42+
#. Plugin Name of the plugin
43+
#, fuzzy
44+
#| msgid "WDS Required Plugin"
45+
msgid "WDS Required Plugins"
2646
msgstr "WDS Plugin Obligatorio"
2747

48+
#. Author of the plugin
49+
msgid "WebDevStudios"
50+
msgstr "WebDevStudios"

languages/wds-required-plugins.pot

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# Copyright (C) 2023 WebDevStudios
2+
# This file is distributed under the GPLv2.
3+
msgid ""
4+
msgstr ""
5+
"Project-Id-Version: WDS Required Plugins 1.3.0\n"
6+
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/wds-required-plugins\n"
7+
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
8+
"Language-Team: LANGUAGE <LL@li.org>\n"
9+
"MIME-Version: 1.0\n"
10+
"Content-Type: text/plain; charset=UTF-8\n"
11+
"Content-Transfer-Encoding: 8bit\n"
12+
"POT-Creation-Date: 2023-08-30T15:17:01+00:00\n"
13+
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
14+
"X-Generator: WP-CLI 2.7.1\n"
15+
"X-Domain: wds-required-plugins\n"
16+
17+
#. Plugin Name of the plugin
18+
msgid "WDS Required Plugins"
19+
msgstr ""
20+
21+
#. Plugin URI of the plugin
22+
#. Author URI of the plugin
23+
msgid "http://webdevstudios.com"
24+
msgstr ""
25+
26+
#. Description of the plugin
27+
msgid "Forcefully require specific plugins to be activated."
28+
msgstr ""
29+
30+
#. Author of the plugin
31+
msgid "WebDevStudios"
32+
msgstr ""
33+
34+
#. translators: %1 and %2 are explained below. Set default log text.
35+
#: wds-required-plugins.php:317
36+
msgid "Required Plugin auto-activation failed for: %1$s, with message: %2$s"
37+
msgstr ""
38+
39+
#: wds-required-plugins.php:355
40+
msgid "Required Plugin"
41+
msgstr ""

wds-required-plugins.php

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@
55
* Description: Forcefully require specific plugins to be activated.
66
* Author: WebDevStudios
77
* Author URI: http://webdevstudios.com
8-
* Version: 1.2.1
9-
* Domain: wds-required-plugins
8+
* Version: 1.3.0
9+
* Text Domain: wds-required-plugins
10+
* Domain Path: /languages
1011
* License: GPLv2
11-
* Path: languages
1212
* Props: 1.0.0 - Patrick Garman, Justin Sternberg, Brad Parbs
1313
*
1414
* @package WDS_Required_Plugins
@@ -126,7 +126,7 @@ private function __construct() {
126126
add_filter( 'all_plugins', [ $this, 'maybe_remove_plugins_from_list' ] );
127127

128128
// Load text domain.
129-
add_action( 'plugins_loaded', [ $this, 'l10n' ] );
129+
add_action( 'init', [ $this, 'l10n' ] );
130130
}
131131

132132
/**
@@ -388,8 +388,8 @@ public function required_text_markup() {
388388
*
389389
* @return array
390390
*/
391-
public function filter_plugin_links( $actions = [], $plugin ) {
392-
391+
public function filter_plugin_links( $actions, $plugin ) {
392+
$actions = (array) $actions;
393393
// Get our required plugins for network + normal.
394394
$required_plugins = array_unique( array_merge( $this->get_required_plugins(), $this->get_network_required_plugins() ) );
395395

@@ -595,20 +595,22 @@ public function l10n() {
595595
return;
596596
}
597597

598+
$languages_path = dirname( plugin_basename( __FILE__ ) ) . DIRECTORY_SEPARATOR . 'languages';
599+
598600
// Try to load mu-plugin textdomain.
599-
if ( load_muplugin_textdomain( 'wds-required-plugins', '/languages/' ) ) {
601+
if ( load_muplugin_textdomain( 'wds-required-plugins', $languages_path ) ) {
600602
self::$l10n_done = true;
601603
return;
602604
}
603605

604606
// If we didn't load, load as a plugin.
605-
if ( load_plugin_textdomain( 'wds-required-plugins', false, '/languages/' ) ) {
607+
if ( load_plugin_textdomain( 'wds-required-plugins', false, $languages_path ) ) {
606608
self::$l10n_done = true;
607609
return;
608610
}
609611

610612
// If we didn't load yet, load as a theme.
611-
if ( load_theme_textdomain( 'wds-required-plugins', '/languages/' ) ) {
613+
if ( load_theme_textdomain( 'wds-required-plugins', dirname( __FILE__ ) . DIRECTORY_SEPARATOR . 'languages' ) ) {
612614
self::$l10n_done = true;
613615
return;
614616
}

0 commit comments

Comments
 (0)