diff --git a/lang/obenland-wp-fr_FR.mo b/lang/obenland-wp-fr_FR.mo new file mode 100644 index 0000000..737ca7c Binary files /dev/null and b/lang/obenland-wp-fr_FR.mo differ diff --git a/lang/obenland-wp-fr_FR.po b/lang/obenland-wp-fr_FR.po new file mode 100644 index 0000000..7db9f57 --- /dev/null +++ b/lang/obenland-wp-fr_FR.po @@ -0,0 +1,226 @@ +msgid "" +msgstr "" +"Project-Id-Version: WP Approve User v2.2.2\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: \n" +"PO-Revision-Date: 2013-07-17 13:15:50+0000\n" +"Last-Translator: darrigan \n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=n>1;\n" +"X-Generator: CSL v1.x\n" +"X-Poedit-Language: French\n" +"X-Poedit-Country: FRANCE\n" +"X-Poedit-SourceCharset: utf-8\n" +"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" +"X-Poedit-Basepath: ../\n" +"X-Poedit-Bookmarks: \n" +"X-Poedit-SearchPath-0: .\n" +"X-Textdomain-Support: yes" + +#: obenland-wp-plugins.php:145 +#@ obenland-wp +msgid "Donate" +msgstr "Faites un don" + +#: obenland-wp-plugins.php:169 +#@ obenland-wp +msgid "Help spread the word!" +msgstr "Faites passer le message !" + +#: obenland-wp-plugins.php:171 +#, php-format +#@ obenland-wp +msgctxt "Plugin Name" +msgid "Want to help make this plugin even better? All donations are used to improve %1$s, so donate $20, $50 or $100 now!" +msgstr "Envie d'aider à améliorer cette extension ? Tous les dons seront utilisés pour améliorer %1$s, alors donnez $20, $50 ou $100 maintenant !" + +#: obenland-wp-plugins.php:178 +#@ obenland-wp +msgid "Or you could:" +msgstr "Ou bien vous pourriez :" + +#: obenland-wp-plugins.php:180 +#@ obenland-wp +msgid "Rate the plugin 5★ on WordPress.org" +msgstr "Evaluer l'extension 5★ sur WordPress.org" + +#: obenland-wp-plugins.php:181 +#@ obenland-wp +msgid "Blog about it & link to the plugin page" +msgstr "Bloguer à son sujet et faire un lien vers sa page" + +#: obenland-wp-plugins.php:224 +#@ obenland-wp +msgid "News from Konstantin" +msgstr "Nouvelles de Konstantin" + +#: obenland-wp-plugins.php:228 +#@ obenland-wp +msgid "No news items, feed might be broken..." +msgstr "Pas de nouvelles, le fil est peut être cassé…" + +#: obenland-wp-plugins.php:234 +#@ obenland-wp +msgid "Follow Konstantin on Twitter" +msgstr "Suivez Konstantin sur Twitter" + +#: obenland-wp-plugins.php:235 +#@ obenland-wp +msgid "Subscribe via RSS" +msgstr "Abonnez-vous au flux RSS" + +#. translators: plugin header field 'Name' +#: wp-approve-user.php:0 +#@ obenland-wp +msgid "WP Approve User" +msgstr "WP Approve User" + +#. translators: plugin header field 'PluginURI' +#: wp-approve-user.php:0 +#@ obenland-wp +msgid "http://en.wp.obenland.it/wp-approve-user/#utm_source=wordpress&utm_medium=plugin&utm_campaign=wp-approve-user" +msgstr "http://en.wp.obenland.it/wp-approve-user/#utm_source=wordpress&utm_medium=plugin&utm_campaign=wp-approve-user" + +#. translators: plugin header field 'Description' +#: wp-approve-user.php:0 +#@ obenland-wp +msgid "Adds action links to user table to approve or unapprove user registrations." +msgstr "Ajout de liens d'action à la table des utilisateurs pour approuver ou non des inscriptions." + +#. translators: plugin header field 'Author' +#: wp-approve-user.php:0 +#@ obenland-wp +msgid "Konstantin Obenland" +msgstr "Konstantin Obenland" + +#. translators: plugin header field 'AuthorURI' +#: wp-approve-user.php:0 +#@ obenland-wp +msgid "http://en.wp.obenland.it/#utm_source=wordpress&utm_medium=plugin&utm_campaign=wp-approve-user" +msgstr "http://en.wp.obenland.it/#utm_source=wordpress&utm_medium=plugin&utm_campaign=wp-approve-user" + +#. translators: plugin header field 'Version' +#: wp-approve-user.php:0 +#@ obenland-wp +msgid "2.2.2" +msgstr "2.2.2" + +#: wp-approve-user.php:199 +#: wp-approve-user.php:333 +#@ wp-approve-user +msgid "Approve" +msgstr "Approuver" + +#: wp-approve-user.php:200 +#: wp-approve-user.php:324 +#@ wp-approve-user +msgid "Unapprove" +msgstr "Désapprouver" + +#: wp-approve-user.php:268 +#@ wp-approve-users +msgid "Unapproved" +msgstr "Désapprouver" + +#: wp-approve-user.php:357 +#@ wp-approve-user +msgid "ERROR: Your account has to be confirmed by an administrator before you can login." +msgstr "ERREUR : Votre compte doit être approuvé par un administrateur avant de pouvoir vous connecter." + +#: wp-approve-user.php:452 +#, php-format +#@ wp-approve-user +msgid "User approved." +msgid_plural "%d users approved." +msgstr[0] "Utilisateur approuvé." +msgstr[1] "%d utilisateurs approuvés." + +#: wp-approve-user.php:456 +#, php-format +#@ wp-approve-user +msgid "User unapproved." +msgid_plural "%d users unapproved." +msgstr[0] "Utilisateur désapprouvé." +msgstr[1] "%d utilisateurs désapprouvés." + +#: wp-approve-user.php:520 +#: wp-approve-user.php:521 +#@ wp-approve-user +msgid "Approve User" +msgstr "Approve User" + +#: wp-approve-user.php:548 +#@ wp-approve-user +msgid "Email contents" +msgstr "Contenu du courriel" + +#: wp-approve-user.php:555 +#@ wp-approve-user +msgid "Send Approve Email" +msgstr "Envoyer un courriel d'approbation" + +#: wp-approve-user.php:561 +#@ wp-approve-user +msgid "Send email on approval." +msgstr "Envoyer un courriel lors de l'approbation." + +#: wp-approve-user.php:566 +#@ wp-approve-user +msgid "Approve Email" +msgstr "Courriel d'approbation" + +#: wp-approve-user.php:579 +#@ wp-approve-user +msgid "Send Unapprove Email" +msgstr "Envoyer un courriel de désapprobation" + +#: wp-approve-user.php:585 +#@ wp-approve-user +msgid "Send email on unapproval." +msgstr "Envoyer un courriel lors de la désapprobation." + +#: wp-approve-user.php:590 +#@ wp-approve-user +msgid "Unapprove Email" +msgstr "Email de désapprobation" + +#: wp-approve-user.php:616 +#@ wp-approve-user +msgid "Approve User Settings" +msgstr "Réglages de Approve User" + +#: wp-approve-user.php:657 +#, php-format +#@ wp-approve-user +msgctxt "Placeholders" +msgid "To take advantage of dynamic data, you can use the following placeholders: %s. Username will be the user login in most cases." +msgstr "Pour tirer partie des données dynamiques, vous pouvez utiliser les balises : %s. \\\"Username\\\" sera le login dans la plupart des cas." + +#: wp-approve-user.php:743 +#, php-format +#@ wp-approve-user +msgctxt "Blogname" +msgid "[%s] Registration approved" +msgstr "[%s] Inscription approuvée" + +#: wp-approve-user.php:774 +#, php-format +#@ wp-approve-user +msgctxt "Blogname" +msgid "[%s] Registration unapproved" +msgstr "[%s] Inscription désapprouvée" + +#: wp-approve-user.php:818 +#: wp-approve-user.php:851 +#@ default +msgid "You can’t edit that user." +msgstr "Vous ne pouvez pas modifier cet utilisateur." + +#: wp-approve-user.php:886 +#@ wp-approve-user +msgid "You can’t unapprove users." +msgstr "Vous ne pouvez pas désapprouver des utilisateurs." + diff --git a/lang/wp-approve-user-ar_AR.mo b/lang/wp-approve-user-ar_AR.mo new file mode 100644 index 0000000..8acdf52 Binary files /dev/null and b/lang/wp-approve-user-ar_AR.mo differ diff --git a/lang/wp-approve-user-ar_AR.po b/lang/wp-approve-user-ar_AR.po new file mode 100644 index 0000000..1d62c07 --- /dev/null +++ b/lang/wp-approve-user-ar_AR.po @@ -0,0 +1,226 @@ +msgid "" +msgstr "" +"Project-Id-Version: \n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: \n" +"PO-Revision-Date: \n" +"Last-Translator: Mehdi \n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=n != 1;\n" +"X-Poedit-SourceCharset: utf-8\n" +"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" +"X-Textdomain-Support: yes\n" +"X-Generator: Poedit 1.5.5\n" +"X-Poedit-SearchPath-0: .\n" + +# @ wp-approve-user +#: obenland-wp-plugins.php:130 +msgid "Donate" +msgstr "تبرع" + +# @ wp-approve-user +#. translators: plugin header field 'Name' +#: wp-approve-user.php:0 +msgid "WP Approve User" +msgstr "" + +# @ wp-approve-user +#. translators: plugin header field 'Description' +#: wp-approve-user.php:0 +msgid "" +"Adds action links to user table to approve or unapprove user registrations." +msgstr "تساعدك على قبول أو عدم قبول عضو عند تسجيله." + +# @ wp-approve-user +#. translators: plugin header field 'Author' +#: wp-approve-user.php:0 +msgid "Konstantin Obenland" +msgstr "" + +# @ wp-approve-user +#: wp-approve-user.php:173 wp-approve-user.php:226 +msgid "Unapprove" +msgstr "رفض" + +# @ wp-approve-user +#: wp-approve-user.php:172 wp-approve-user.php:234 +msgid "Approve" +msgstr "قبول" + +# @ wp-approve-user +#: wp-approve-user.php:258 +msgid "" +"ERROR: Your account has to be confirmed by an administrator " +"before you can login." +msgstr "خطأ: يجب أن تقبل عضويتك لتتمكن من الدخول." + +# @ default +#: wp-approve-user.php:707 wp-approve-user.php:739 +msgid "You can’t edit that user." +msgstr "لا يمكنك تعديل هذا العضو" + +# @ wp-approve-user +#: wp-approve-user.php:353 +#, php-format +msgid "User approved." +msgid_plural "%d users approved." +msgstr[0] "User approved." +msgstr[1] "أعضاء مقبولين%d" + +# @ wp-approve-user +#: wp-approve-user.php:357 +#, php-format +msgid "User unapproved." +msgid_plural "%d users unapproved." +msgstr[0] "عضو غير مقبول" +msgstr[1] "أعضاء غير مقبولين%d" + +# @ wp-approve-user +#: wp-approve-user.php:774 +msgid "You can’t unapprove users." +msgstr "لا يمكنك رفض هذا العضو" + +# @ obenland-wp +#: obenland-wp-plugins.php:154 +msgid "Help spread the word!" +msgstr "ساعدنا على تحسين الإضافة" + +# @ obenland-wp +#: obenland-wp-plugins.php:156 +#, php-format +msgctxt "Plugin Name" +msgid "" +"Want to help make this plugin even better? All donations are used to improve " +"%1$s, so donate $20, $50 or $100 now!" +msgstr "" + +# @ obenland-wp +#: obenland-wp-plugins.php:163 +msgid "Or you could:" +msgstr "أو يمكنك:" + +# @ obenland-wp +#: obenland-wp-plugins.php:165 +msgid "Rate the plugin 5★ on WordPress.org" +msgstr "قم بتقييم الإضافة بـ5 نجوم" + +# @ obenland-wp +#: obenland-wp-plugins.php:166 +msgid "Blog about it & link to the plugin page" +msgstr "اكتب حول الإضافة و ضع رابطا لها" + +# @ obenland-wp +#: obenland-wp-plugins.php:209 +msgid "News from Konstantin" +msgstr "أخبار من كونستانتن" + +# @ obenland-wp +#: obenland-wp-plugins.php:213 +msgid "No news items, feed might be broken..." +msgstr "ليس هناك جديد,ربما رابط الخلاصة خاطئ" + +# @ obenland-wp +#: obenland-wp-plugins.php:219 +msgid "Follow Konstantin on Twitter" +msgstr "تابع كونستانتن على تويتر" + +# @ obenland-wp +#: obenland-wp-plugins.php:220 +msgid "Subscribe via RSS" +msgstr "تسجل عبر الخلاصات" + +# @ wp-approve-user +#. translators: plugin header field 'PluginURI' +#: wp-approve-user.php:0 +msgid "" +"http://en.wp.obenland.it/wp-approve-user/" +"#utm_source=wordpress&utm_medium=plugin&utm_campaign=wp-approve-user" +msgstr "" + +# @ wp-approve-user +#. translators: plugin header field 'AuthorURI' +#: wp-approve-user.php:0 +msgid "" +"http://en.wp.obenland.it/" +"#utm_source=wordpress&utm_medium=plugin&utm_campaign=wp-approve-user" +msgstr "" + +# @ wp-approve-user +#. translators: plugin header field 'Version' +#: wp-approve-user.php:0 +msgid "2.0.0" +msgstr "" + +# @ wp-approve-user +#: wp-approve-user.php:420 wp-approve-user.php:421 +msgid "Approve User" +msgstr "قبول العضو" + +# @ wp-approve-user +#: wp-approve-user.php:448 +msgid "Email contents" +msgstr "محتوى الرسائل" + +# @ wp-approve-user +#: wp-approve-user.php:455 +msgid "Send Approve Email" +msgstr "إرسال رسالة القبول" + +# @ wp-approve-user +#: wp-approve-user.php:461 +msgid "Send email on approval." +msgstr "إرسال رسالة عند القبول" + +# @ wp-approve-user +#: wp-approve-user.php:466 +msgid "Approve Email" +msgstr "رسالة القبول" + +# @ wp-approve-user +#: wp-approve-user.php:479 +msgid "Send Unapprove Email" +msgstr "إرسال رسالة رفض." + +# @ wp-approve-user +#: wp-approve-user.php:485 +msgid "Send email on unapproval." +msgstr "إرسال رسالة عند الرفض." + +# @ wp-approve-user +#: wp-approve-user.php:490 +msgid "Unapprove Email" +msgstr "رسالة الرفض" + +# @ wp-approve-user +#: wp-approve-user.php:516 +msgid "Approve User Settings" +msgstr "إعدادات قبول العضو" + +# @ wp-approve-user +#: wp-approve-user.php:558 +#, php-format +msgctxt "Placeholders" +msgid "" +"To take advantage of dynamic data, you can use the following placeholders: " +"%s. Username will be the user login in most cases." +msgstr "" +"يمكنك استعمال الوسوم التالية وستم استبدالها حسب المعلومات :%s. وسم Username " +"سيتم استبداله باسم العضو" + +# @ wp-approve-user +#: wp-approve-user.php:646 +#, php-format +msgctxt "Blogname" +msgid "[%s] Registration approved" +msgstr "التسجيل مقبول[%s]" + +# @ wp-approve-user +#: wp-approve-user.php:677 +#, php-format +msgctxt "Blogname" +msgid "[%s] Registration unapproved" +msgstr "التسجيل لم يقبل[%s]" diff --git a/lang/wp-approve-user-fr_FR.mo b/lang/wp-approve-user-fr_FR.mo new file mode 100644 index 0000000..a04ee4f Binary files /dev/null and b/lang/wp-approve-user-fr_FR.mo differ diff --git a/lang/wp-approve-user-xx_XX.pot b/lang/wp-approve-user-xx_XX.pot new file mode 100644 index 0000000..f99e211 --- /dev/null +++ b/lang/wp-approve-user-xx_XX.pot @@ -0,0 +1 @@ +MIME-Version: 1.0\nContent-Type: text/plain; charset=UTF-8\nContent-Transfer-Encoding: 8bit \ No newline at end of file diff --git a/obenland-wp-plugins.php b/obenland-wp-plugins.php index 00e44c3..a258111 100644 --- a/obenland-wp-plugins.php +++ b/obenland-wp-plugins.php @@ -1,107 +1,103 @@ textdomain = $args['textdomain']; - $this->plugin_path = $args['plugin_path']; - $this->plugin_dir_path = plugin_dir_path( $args['plugin_path'] ); - $this->plugin_name = plugin_basename( $args['plugin_path'] ); + // Set class properties. + $this->textdomain = $args['textdomain']; + $this->plugin_path = $args['plugin_path']; + $this->plugin_dir_path = plugin_dir_path( $args['plugin_path'] ); + $this->plugin_name = plugin_basename( $args['plugin_path'] ); - load_plugin_textdomain( 'obenland-wp' , false, $this->textdomain . '/lang' ); + load_plugin_textdomain( 'obenland-wp', false, $this->textdomain . '/lang' ); $this->set_donate_link( $args['donate_link_id'] ); $this->hook( 'plugins_loaded', 'parent_plugins_loaded' ); @@ -111,14 +107,13 @@ public function __construct( $args = array() ) { /** * Hooks in all the hooks :) * - * @author Konstantin Obenland - * @since 2.0.0 - 12.04.2012 - * @access public - * - * @return void + * @author Konstantin Obenland + * @since 2.0.0 - 12.04.2012 + * @access public */ public function parent_plugins_loaded() { $this->hook( 'plugin_row_meta' ); + if ( ! has_action( 'obenland_side_info_column' ) ) { $this->hook( 'obenland_side_info_column', 'donate_box', 1 ); $this->hook( 'obenland_side_info_column', 'feed_box' ); @@ -127,20 +122,21 @@ public function parent_plugins_loaded() { /** + * Adds a Donate link to our plugin row. * - * @author Konstantin Obenland - * @since 1.0 - 23.03.2011 - * @access public + * @author Konstantin Obenland + * @since 1.0 - 23.03.2011 + * @access public * - * @param array $plugin_meta - * @param string $plugin_file + * @param array $plugin_meta Existing plugin meta. + * @param string $plugin_file Plugin slug. * - * @return string + * @return string */ public function plugin_row_meta( $plugin_meta, $plugin_file ) { - if ( $this->plugin_name == $plugin_file ) { - $plugin_meta[] = sprintf(' - %2$s', + if ( $this->plugin_name === $plugin_file ) { + $plugin_meta[] = sprintf( + '%2$s', $this->donate_link, __( 'Donate', 'obenland-wp' ) ); @@ -150,17 +146,18 @@ public function plugin_row_meta( $plugin_meta, $plugin_file ) { /** - * Displays a box with a donate button and call to action links + * Displays a box with a donate button and call to action links. * * Props Joost de Valk, as this is almost entirely from his awesome WordPress - * SEO Plugin - * @see http://plugins.svn.wordpress.org/wordpress-seo/tags/1.1.5/admin/class-config.php + * SEO Plugin. * - * @author Joost de Valk, Konstantin Obenland - * @since 2.0.0 - 31.03.2012 - * @access public + * @see http://plugins.svn.wordpress.org/wordpress-seo/tags/1.1.5/admin/class-config.php * - * @return void + * @author Joost de Valk, Konstantin Obenland + * @since 2.0.0 - 31.03.2012 + * @access public + * + * @return void */ public function donate_box() { $plugin_data = get_plugin_data( $this->plugin_path ); @@ -168,17 +165,27 @@ public function donate_box() {

-

+

+ + + +

- +
-

+

    -
  • -
  • +
  • +
@@ -187,36 +194,38 @@ public function donate_box() { /** - * Displays a box with feed items and social media links + * Displays a box with feed items and social media links. * * Props Joost de Valk, as this is almost entirely from his awesome WordPress - * SEO Plugin - * @see http://plugins.svn.wordpress.org/wordpress-seo/tags/1.1.5/admin/yst_plugin_tools.php + * SEO Plugin. + * + * @see http://plugins.svn.wordpress.org/wordpress-seo/tags/1.1.5/admin/yst_plugin_tools.php * - * @author Joost de Valk, Konstantin Obenland - * @since 2.0.0 - 31.03.2012 - * @access public + * @author Joost de Valk, Konstantin Obenland + * @since 2.0.0 - 31.03.2012 + * @access public * - * @return void + * @return void */ public function feed_box() { - include_once( ABSPATH . WPINC . '/feed.php' ); + include_once ABSPATH . WPINC . '/feed.php'; $feed_url = 'http://en.wp.obenland.it/feed/'; - $rss = fetch_feed( $feed_url ); + $rss = fetch_feed( $feed_url ); - // Bail if feed doesn't work - if ( is_wp_error($rss) ) - return false; + // Bail if feed doesn't work. + if ( is_wp_error( $rss ) ) { + return; + } $rss_items = $rss->get_items( 0, $rss->get_item_quantity( 5 ) ); - // If the feed was erroneously + // If the feed was erroneously. if ( ! $rss_items ) { $md5 = md5( $feed_url ); delete_transient( 'feed_' . $md5 ); delete_transient( 'feed_mod_' . $md5 ); - $rss = fetch_feed( 'http://en.wp.obenland.it/feed/' ); + $rss = fetch_feed( $feed_url ); $rss_items = $rss->get_items( 0, $rss->get_item_quantity( 5 ) ); } ?> @@ -225,14 +234,19 @@ public function feed_box() {
@@ -240,87 +254,72 @@ public function feed_box() { } - /////////////////////////////////////////////////////////////////////////// - // METHODS, PROTECTED - /////////////////////////////////////////////////////////////////////////// - /** - * Hooks methods their WordPress Actions and Filters + * Hooks methods to their WordPress Actions and Filters. * * @example: * $this->hook( 'the_title' ); * $this->hook( 'init', 5 ); * $this->hook( 'omg', 'is_really_tedious', 3 ); * - * @author Mark Jaquith - * @see http://sliwww.slideshare.net/markjaquith/creating-and-maintaining-wordpress-plugins - * @since 1.5 - 12.02.2012 - * @access protected + * @author Mark Jaquith + * @see http://sliwww.slideshare.net/markjaquith/creating-and-maintaining-wordpress-plugins + * @since 1.5 - 12.02.2012 + * @access protected * - * @param string $hook Action or Filter Hook name + * @param string $hook Action or Filter Hook name. * - * @return boolean true + * @return boolean true */ protected function hook( $hook ) { - $priority = 10; - $method = $this->sanitize_method( $hook ); - $args = func_get_args(); - unset( $args[0] ); // Filter name + $priority = 10; + $method = $this->sanitize_method( $hook ); + $args = func_get_args(); + unset( $args[0] ); // Filter name. foreach ( (array) $args as $arg ) { if ( is_int( $arg ) ) { - $priority = $arg; - } - else { - $method = $arg; - + $priority = $arg; + } else { + $method = $arg; } } - return add_action( $hook, array( $this, $method ), $priority , 999 ); + return add_action( $hook, array( $this, $method ), $priority, 999 ); } /** - * Sets the donate link - * - * @author Konstantin Obenland - * @since 1.1 - 03.04.2011 - * @access protected + * Sets the donate link. * - * @param string $donate_link_id + * @author Konstantin Obenland + * @since 1.1 - 03.04.2011 + * @access protected * - * @return void + * @param string $donate_link_id Donate link ID. */ protected function set_donate_link( $donate_link_id ) { - $this->donate_link = add_query_arg( array( - 'cmd' => '_s-xclick', - 'hosted_button_id' => $donate_link_id + $this->donate_link = add_query_arg( array( + 'cmd' => '_s-xclick', + 'hosted_button_id' => $donate_link_id, ), 'https://www.paypal.com/cgi-bin/webscr' ); } - /////////////////////////////////////////////////////////////////////////// - // METHODS, PRIVATE - /////////////////////////////////////////////////////////////////////////// /** - * Sanitizes method names + * Sanitizes method names. * - * @author Mark Jaquith - * @see http://sliwww.slideshare.net/markjaquith/creating-and-maintaining-wordpress-plugins - * @since 1.5 - 12.02.2012 - * @access private + * @author Mark Jaquith + * @see http://sliwww.slideshare.net/markjaquith/creating-and-maintaining-wordpress-plugins + * @since 1.5 - 12.02.2012 + * @access private * - * @param string $method Method name to be sanitized + * @param string $method Method name to be sanitized. * - * @return string Sanitized method name + * @return string Sanitized method name */ private function sanitize_method( $method ) { return str_replace( array( '.', '-' ), '_', $method ); } -} // End of class Obenland_Wp_Plugins - - -/* End of file obenland-wp-plugins.php */ -/* Location: ./wp-content/plugins/{obenland-plugin}/obenland-wp-plugins.php */ \ No newline at end of file +} // End of class Obenland_Wp_Plugins. diff --git a/phpcs.xml.dist b/phpcs.xml.dist new file mode 100644 index 0000000..db70a24 --- /dev/null +++ b/phpcs.xml.dist @@ -0,0 +1,43 @@ + + + . + + + *.[s]?css + *.js + + + + + + + + + + + + + + + + + + wp-approve-user.php + + + + diff --git a/readme.txt b/readme.txt index 237cf46..f6a9771 100644 --- a/readme.txt +++ b/readme.txt @@ -1,19 +1,20 @@ === WP Approve User === -Contributors: kobenland +Contributors: obenland Tags: admin, user, login, approve, user management, plugin Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=G65Y5CM3HVRNY Requires at least: 3.1 -Tested up to: 3.6 -Stable tag: 2.2.0 +Tested up to: 5.0 +Stable tag: 3 Adds action links to user table to approve or unapprove user registrations. == Description == This plugin lets you approve or reject user registrations. -While a user is unapproved, he/she can't access the WordPress Admin. +While a user is unapproved, they can't access the WordPress Admin. -On activation of the plugin, all existing users will automatically be flagged Approved. The blog admin will never experience restricted access and does not need approval. +On activation of the plugin, all existing users will automatically be flagged Approved. The site admin will never experience restricted access and does not need approval. +This plugin is probably not compatible with WooCommerce. = Translations = @@ -72,6 +73,28 @@ Yes! Under Settings > Approve User, you can choose when to send an email and cus == Changelog == += 3 = +* Maintenance release. +* Better multisite compatibility. +* Now maintains role selection on batch modification. +* Added some more sanitization. +* Updated code to adhere to WordPress Coding Standards. +* Tested for WordPress 5.0. + += 2.3 = +* Added French translation. Props Clovis Darrigan. +* Added Arabic translation. Props Mehdi Bounya. + += 2.2.3 = +* Fixes a bug where administrators where locked out of their site if user registration was enabled after the plugin was. + += 2.2.2 = +* Adds backwards compatibility for WordPress versions pre-3.5 for the user list filter. +* Removes unused development versions of scripts and styles. + += 2.2.1 = +* Updated utility class. + = 2.2.0 = * Added a way to filter for unapproved users in the admin user list. * Fixed a bug where currently active users would not be flagged as approved on activation if user registration was disabled. diff --git a/uninstall.php b/uninstall.php index a590acd..0b03d5b 100644 --- a/uninstall.php +++ b/uninstall.php @@ -1,13 +1,19 @@ '', - 'fields' => 'ID' -)); +$user_ids = get_users( array( + 'blog_id' => '', + 'fields' => 'ID', +) ); foreach ( $user_ids as $user_id ) { delete_user_meta( $user_id, 'wp-approve-user' ); @@ -18,7 +24,3 @@ /* Goodbye! Thank you for having me! */ - - -/* End of file uninstall.php */ -/* Location: ./wp-content/plugins/wp-approve-user/uninstall.php */ \ No newline at end of file diff --git a/wp-approve-user.php b/wp-approve-user.php index 3b5436f..7843d24 100644 --- a/wp-approve-user.php +++ b/wp-approve-user.php @@ -1,36 +1,56 @@ '', + 'fields' => 'ID', + ) ); + + foreach ( $user_ids as $user_id ) { + update_user_meta( $user_id, 'wp-approve-user', true ); + update_user_meta( $user_id, 'wp-approve-user-mail-sent', true ); + } + } + } + add_filter( 'pre_update_option_users_can_register', 'wpau_whitelist_users' ); return; } -if ( ! class_exists( 'Obenland_Wp_Plugins_v300' ) ) { - require_once( 'obenland-wp-plugins.php' ); +if ( ! class_exists( 'Obenland_Wp_Plugins_V4' ) ) { + require_once 'obenland-wp-plugins.php'; } - -class Obenland_Wp_Approve_User extends Obenland_Wp_Plugins_v300 { - - - /////////////////////////////////////////////////////////////////////////// - // PROPERTIES, PUBLIC - /////////////////////////////////////////////////////////////////////////// +/** + * Class Obenland_Wp_Approve_User. + */ +class Obenland_Wp_Approve_User extends Obenland_Wp_Plugins_V4 { /** + * Class instance. * * @since 1.1.0 - 12.02.2012 * @access public @@ -40,15 +60,9 @@ class Obenland_Wp_Approve_User extends Obenland_Wp_Plugins_v300 { */ public static $instance; - - /////////////////////////////////////////////////////////////////////////// - // PROPERTIES, PROTECTED - /////////////////////////////////////////////////////////////////////////// - /** * The plugin options. * - * * @author Konstantin Obenland * @since 2.0.0 - 31.03.2012 * @access protected @@ -68,10 +82,21 @@ class Obenland_Wp_Approve_User extends Obenland_Wp_Plugins_v300 { */ protected $unapproved_users = array(); - - /////////////////////////////////////////////////////////////////////////// - // METHODS, PUBLIC - /////////////////////////////////////////////////////////////////////////// + /** + * Main Obenland_Wp_Approve_User instance. + * + * Ensures only one instance of Obenland_Wp_Approve_User is loaded or can be loaded. + * + * @since 3.1 + * + * @return Obenland_Wp_Approve_User single instance. + */ + public static function get_instance() { + if ( is_null( self::$instance ) ) { + self::$instance = new self(); + } + return self::$instance; + } /** * Constructor @@ -83,14 +108,12 @@ class Obenland_Wp_Approve_User extends Obenland_Wp_Plugins_v300 { * @return Obenland_Wp_Approve_User */ public function __construct() { - parent::__construct( array( 'textdomain' => 'wp-approve-user', 'plugin_path' => __FILE__, 'donate_link_id' => 'G65Y5CM3HVRNY', - )); + ) ); - self::$instance = $this; $this->options = wp_parse_args( get_option( $this->textdomain, array() ), $this->default_options() @@ -98,12 +121,12 @@ public function __construct() { if ( is_admin() ) { $this->unapproved_users = get_users( array( - 'meta_key' => 'wp-approve-user', - 'meta_value' => false, + 'meta_key' => 'wp-approve-user', + 'meta_value' => false, ) ); } - load_plugin_textdomain( 'wp-approve-user' , false, 'wp-approve-user/lang' ); + load_plugin_textdomain( 'wp-approve-user', false, 'wp-approve-user/lang' ); $this->hook( 'plugins_loaded' ); } @@ -122,7 +145,7 @@ public function __construct() { public function activation() { $user_ids = get_users( array( 'blog_id' => '', - 'fields' => 'ID' + 'fields' => 'ID', ) ); foreach ( $user_ids as $user_id ) { @@ -142,18 +165,20 @@ public function activation() { * @return void */ public function plugins_loaded() { - $this->hook( 'update_option_users_can_register' ); - $this->hook( 'user_row_actions' ); $this->hook( 'ms_user_row_actions', 'user_row_actions' ); $this->hook( 'wp_authenticate_user' ); $this->hook( 'user_register' ); $this->hook( 'shake_error_codes' ); $this->hook( 'admin_menu' ); + $this->hook( 'network_admin_menu', 'admin_menu' ); $this->hook( 'admin_print_scripts-users.php' ); $this->hook( 'admin_print_scripts-site-users.php', 'admin_print_scripts_users_php' ); $this->hook( 'admin_print_styles-settings_page_wp-approve-user' ); + + $this->hook( 'load-users.php', 'map_action2' ); + $this->hook( 'load-site-users.php', 'map_action2' ); $this->hook( 'admin_action_wpau_approve' ); $this->hook( 'admin_action_wpau_bulk_approve' ); $this->hook( 'admin_action_wpau_unapprove' ); @@ -166,6 +191,8 @@ public function plugins_loaded() { if ( is_admin() ) { $this->hook( 'views_users' ); + $this->hook( 'views_users-network', 'views_users' ); + $this->hook( 'views_site-users-network', 'views_users' ); $this->hook( 'pre_user_query' ); } } @@ -182,7 +209,7 @@ public function plugins_loaded() { */ public function admin_print_scripts_users_php() { $plugin_data = get_plugin_data( __FILE__, false, false ); - $suffix = ( defined( 'SCRIPT_DEBUG' ) AND SCRIPT_DEBUG ) ? '' : '.min'; + $suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min'; wp_enqueue_script( $this->textdomain, @@ -196,7 +223,7 @@ public function admin_print_scripts_users_php() { $this->textdomain, 'wp_approve_user', array( - 'approve' => __( 'Approve', 'wp-approve-user' ), + 'approve' => __( 'Approve', 'wp-approve-user' ), 'unapprove' => __( 'Unapprove', 'wp-approve-user' ), ) ); @@ -214,7 +241,7 @@ public function admin_print_scripts_users_php() { */ public function admin_print_styles_settings_page_wp_approve_user() { $plugin_data = get_plugin_data( __FILE__, false, false ); - $suffix = ( defined( 'SCRIPT_DEBUG' ) AND SCRIPT_DEBUG ) ? '' : '.min'; + $suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min'; wp_enqueue_style( $this->textdomain, @@ -226,47 +253,29 @@ public function admin_print_styles_settings_page_wp_approve_user() { /** - * Re-runs the activation hook when registration is activated. - * - * If the plugin is activated and user registration is disabled, the plugin - * activation hook never gets added, let alone fired. This a secondary - * measure to make sure all existing users are approved on activation. + * Adds a link to a list view of unapproved users. * * @author Konstantin Obenland * @since 2.2.0 - 30.03.2013 * @access public * - * @param string $old Old settings value. - * @param int $new New settings value. - * - * @return void - */ - public function update_option_users_can_register( $old, $new ) { - if ( $new ) - $this->activation(); - } - - - - /** - * @author Konstantin Obenland - * @since 2.2.0 - 30.03.2013 - * @access public - * - * @param array $views + * @param array $views List of registered user list views. * * @return array */ public function views_users( $views ) { if ( $this->unapproved_users ) { + // phpcs:ignore WordPress.CSRF.NonceVerification.NoNonceVerification $site_id = isset( $_REQUEST['id'] ) ? intval( $_REQUEST['id'] ) : 0; - $url = ( 'site-users-network' == get_current_screen()->id ) ? add_query_arg( array( 'id' => $site_id ), 'site-users.php' ) : 'users.php'; - - $views['unapproved'] = sprintf( '%3$s (%4$s)', - add_query_arg( array( 'role' => 'wpau_unapproved' ), $url ), - ( isset( $_REQUEST['role'] ) AND 'wpau_unapproved' == $_REQUEST['role'] ) ? 'current' : '', - __( 'Unapproved', 'wp-approve-users' ), - count( $this->unapproved_users ) + $url = 'site-users-network' === get_current_screen()->id ? add_query_arg( array( 'id' => $site_id ), 'site-users.php' ) : 'users.php'; + + $views['unapproved'] = sprintf( + '%3$s (%4$s)', + esc_url( add_query_arg( array( 'role' => 'wpau_unapproved' ), $url ) ), + // phpcs:ignore WordPress.CSRF.NonceVerification.NoNonceVerification + 'wpau_unapproved' === $this->get_role() ? 'current' : '', + esc_html__( 'Unapproved', 'wp-approve-users' ), + count( $this->unapproved_users ) ); } @@ -281,16 +290,21 @@ public function views_users( $views ) { * @since 2.2.0 - 30.03.2013 * @access public * - * @param WP_User_Query $query + * @param WP_User_Query $query User query object. * * @return void */ public function pre_user_query( $query ) { - if ( 'wpau_unapproved' == $query->query_vars['role'] ) { - unset( $query->query_vars['meta_query'][0] ); - $query->set( 'role', '' ); - $query->set( 'meta_key', 'wp-approve-user' ); - $query->set( 'meta_value', false ); + // phpcs:ignore WordPress.CSRF.NonceVerification.NoNonceVerification, WordPress.VIP.ValidatedSanitizedInput + $role = empty( $query->query_vars['role'] ) && isset( $_REQUEST['role'] ) ? $_REQUEST['role'] : $query->query_vars['role']; + + if ( 'wpau_unapproved' === $role ) { + unset( $query->query_vars['meta_query'] ); + $query->query_vars['role'] = ''; + $query->query_vars['meta_key'] = 'wp-approve-user'; + $query->query_vars['meta_value'] = false; + + remove_filter( 'pre_user_query', array( $this, 'pre_user_query' ) ); $query->prepare_query(); } } @@ -303,17 +317,16 @@ public function pre_user_query( $query ) { * @since 1.0 - 29.01.2012 * @access public * - * @param array $actions - * @param WP_User $user_object + * @param array $actions User action links. + * @param WP_User $user_object User object. * * @return array */ public function user_row_actions( $actions, $user_object ) { - - if ( ( get_current_user_id() != $user_object->ID ) AND current_user_can( 'edit_user', $user_object->ID ) ) { - + if ( get_current_user_id() !== $user_object->ID && current_user_can( 'edit_user', $user_object->ID ) ) { + // phpcs:ignore WordPress.CSRF.NonceVerification.NoNonceVerification $site_id = isset( $_REQUEST['id'] ) ? intval( $_REQUEST['id'] ) : 0; - $url = ( 'site-users-network' == get_current_screen()->id ) ? add_query_arg( array( 'id' => $site_id ), 'site-users.php' ) : 'users.php'; + $url = 'site-users-network' === get_current_screen()->id ? add_query_arg( array( 'id' => $site_id ), 'site-users.php' ) : 'users.php'; if ( get_user_meta( $user_object->ID, 'wp-approve-user', true ) ) { $url = wp_nonce_url( add_query_arg( array( @@ -321,16 +334,16 @@ public function user_row_actions( $actions, $user_object ) { 'user' => $user_object->ID, ), $url ), 'wpau-unapprove-users' ); - $actions['wpau-unapprove'] = sprintf( '%2$s', $url, __( 'Unapprove', 'wp-approve-user' ) ); + $actions['wpau-unapprove'] = sprintf( '%2$s', esc_url( $url ), esc_html__( 'Unapprove', 'wp-approve-user' ) ); } else { $url = wp_nonce_url( add_query_arg( array( 'action' => 'wpau_approve', 'user' => $user_object->ID, - 'role' => isset( $_REQUEST['role'] ) ? $_REQUEST['role'] : '', + 'role' => $this->get_role(), ), $url ), 'wpau-approve-users' ); - $actions['wpau-approve'] = sprintf( '%2$s', $url, __( 'Approve', 'wp-approve-user' ) ); + $actions['wpau-approve'] = sprintf( '%2$s', esc_url( $url ), esc_html__( 'Approve', 'wp-approve-user' ) ); } } @@ -345,16 +358,15 @@ public function user_row_actions( $actions, $user_object ) { * @since 1.0 - 29.01.2012 * @access public * - * @param WP_User|WP_Error $userdata + * @param WP_User|WP_Error $userdata User object. * * @return WP_User|WP_Error */ public function wp_authenticate_user( $userdata ) { - - if ( ! is_wp_error( $userdata ) AND ! get_user_meta( $userdata->ID, 'wp-approve-user', true ) AND $userdata->user_email != get_bloginfo( 'admin_email' ) ) { + if ( ! is_wp_error( $userdata ) && ! get_user_meta( $userdata->ID, 'wp-approve-user', true ) && get_bloginfo( 'admin_email' ) !== $userdata->user_email ) { $userdata = new WP_Error( 'wpau_confirmation_error', - __('ERROR: Your account has to be confirmed by an administrator before you can login.', 'wp-approve-user') + wp_kses_post( __( 'ERROR: Your account has to be confirmed by an administrator before you can login.', 'wp-approve-user' ) ) ); } @@ -369,12 +381,31 @@ public function wp_authenticate_user( $userdata ) { * @since 1.1 - 12.02.2012 * @access public * + * @param int $id User ID. + * * @return void */ public function user_register( $id ) { update_user_meta( $id, 'wp-approve-user', current_user_can( 'create_users' ) ); } + /** + * Calls actions that depend on the `action` parameter. + * + * @author Konstantin Obenland + * @since 3 - 21.12.2017 + * @access public + */ + public function map_action2() { + // phpcs:disable WordPress.CSRF.NonceVerification.NoNonceVerification, WordPress.VIP.ValidatedSanitizedInput + + if ( ! empty( $_REQUEST['action2'] ) && false !== stripos( $_REQUEST['action2'], 'wpau_' ) ) { + do_action( "admin_action_{$_REQUEST['action2']}" ); + } + + // phpcs:enable WordPress.CSRF.NonceVerification.NoNonceVerification, WordPress.VIP.ValidatedSanitizedInput + } + /** * Updates user_meta to approve user. @@ -401,7 +432,10 @@ public function admin_action_wpau_approve() { * @return void */ public function admin_action_wpau_bulk_approve() { - check_admin_referer( 'bulk-users' ); + $action = 'users-network' === get_current_screen()->id ? 'bulk-users-network' : 'bulk-users'; + check_admin_referer( $action ); + + $this->set_up_role_context(); $this->approve(); } @@ -431,13 +465,16 @@ public function admin_action_wpau_unapprove() { * @return void */ public function admin_action_wpau_bulk_unapprove() { - check_admin_referer( 'bulk-users' ); + $action = 'users-network' === get_current_screen()->id ? 'bulk-users-network' : 'bulk-users'; + check_admin_referer( $action ); + + $this->set_up_role_context(); $this->unapprove(); } /** - * Adds the update message to the admin notices queue + * Adds the update message to the admin notices queue. * * @author Konstantin Obenland * @since 1.1 - 12.02.2012 @@ -446,15 +483,20 @@ public function admin_action_wpau_bulk_unapprove() { * @return void */ public function admin_action_wpau_update() { + // phpcs:disable WordPress.VIP.ValidatedSanitizedInput, WordPress.CSRF.NonceVerification.NoNonceVerification + $count = absint( $_REQUEST['count'] ); - switch( $_REQUEST['update'] ) { + switch ( $_REQUEST['update'] ) { case 'wpau-approved': - $message = _n( 'User approved.', '%d users approved.', $_REQUEST['count'], 'wp-approve-user' ); + /* translators: Number of users. */ + $message = esc_html( _n( '%d User approved.', '%d users approved.', $count, 'wp-approve-user' ) ); break; case 'wpau-unapproved': - $message = _n( 'User unapproved.', '%d users unapproved.', $_REQUEST['count'], 'wp-approve-user' ); + /* translators: Number of users. */ + $message = esc_html( _n( '%d User unapproved.', '%d users unapproved.', $count, 'wp-approve-user' ) ); break; + default: $message = apply_filters( 'wpau_update_message_handler', '', $_REQUEST['update'] ); } @@ -463,7 +505,7 @@ public function admin_action_wpau_update() { add_settings_error( $this->textdomain, esc_attr( $_REQUEST['update'] ), - sprintf( $message, $_REQUEST['count'] ), + sprintf( $message, $count ), 'updated' ); @@ -472,6 +514,8 @@ public function admin_action_wpau_update() { // Prevent other admin action handlers from trying to handle our action. $_REQUEST['action'] = -1; + + // phpcs:enable WordPress.VIP.ValidatedSanitizedInput, WordPress.CSRF.NonceVerification.NoNonceVerification } @@ -482,10 +526,13 @@ public function admin_action_wpau_update() { * @since 1.0 - 29.01.2012 * @access public * - * @return void + * @param array $shake_error_codes Error codes that trigger form shaking. + * + * @return array Shake error codes */ public function shake_error_codes( $shake_error_codes ) { $shake_error_codes[] = 'wpau_confirmation_error'; + return $shake_error_codes; } @@ -500,28 +547,29 @@ public function shake_error_codes( $shake_error_codes ) { * @return void */ public function admin_menu() { - - if ( current_user_can( 'list_users' ) AND version_compare( get_bloginfo( 'version' ), '3.2', '>=' ) ) { + if ( current_user_can( 'list_users' ) && version_compare( get_bloginfo( 'version' ), '3.2', '>=' ) ) { global $menu; foreach ( $menu as $key => $menu_item ) { - if ( array_search( 'users.php', $menu_item ) ) { + if ( array_search( 'users.php', $menu_item, true ) ) { - // No need for number formatting, count() always returns an integer + // No need for number formatting, count() always returns an integer. $awaiting_mod = count( $this->unapproved_users ); + + // phpcs:ignore WordPress.Variables.GlobalVariables.OverrideProhibited $menu[ $key ][0] .= " {$awaiting_mod}"; - break; // Bail on success + break; // Bail on success. } } } add_options_page( - __( 'Approve User', 'wp-approve-user' ), // Page Title - __( 'Approve User', 'wp-approve-user' ), // Menu Title - 'promote_users', // Capability - $this->textdomain, // Menu Slug - array( &$this, 'settings_page' ) // Function + esc_html__( 'Approve User', 'wp-approve-user' ), // Page Title. + esc_html__( 'Approve User', 'wp-approve-user' ), // Menu Title. + 'promote_users', // Capability. + $this->textdomain, // Menu Slug. + array( $this, 'settings_page' ) // Function. ); } @@ -536,7 +584,6 @@ public function admin_menu() { * return void */ public function admin_init() { - register_setting( $this->textdomain, 'wp-approve-user', @@ -545,15 +592,15 @@ public function admin_init() { add_settings_section( $this->textdomain, - __( 'Email contents', 'wp-approve-user' ), - array( &$this, 'section_description_cb' ), + esc_html__( 'Email contents', 'wp-approve-user' ), + array( $this, 'section_description_cb' ), $this->textdomain ); add_settings_field( 'wp-approve-user[send-approve-email]', - __( 'Send Approve Email', 'wp-approve-user' ), - array( &$this, 'checkbox_cb' ), + esc_html__( 'Send Approve Email', 'wp-approve-user' ), + array( $this, 'checkbox_cb' ), $this->textdomain, $this->textdomain, array( @@ -561,10 +608,11 @@ public function admin_init() { 'description' => __( 'Send email on approval.', 'wp-approve-user' ), ) ); + add_settings_field( 'wp-approve-user[approve-email]', - __( 'Approve Email', 'wp-approve-user' ), - array( &$this, 'textarea_cb' ), + esc_html__( 'Approve Email', 'wp-approve-user' ), + array( $this, 'textarea_cb' ), $this->textdomain, $this->textdomain, array( @@ -576,8 +624,8 @@ public function admin_init() { add_settings_field( 'wp-approve-user[send-unapprove-email]', - __( 'Send Unapprove Email', 'wp-approve-user' ), - array( &$this, 'checkbox_cb' ), + esc_html__( 'Send Unapprove Email', 'wp-approve-user' ), + array( $this, 'checkbox_cb' ), $this->textdomain, $this->textdomain, array( @@ -587,8 +635,8 @@ public function admin_init() { ); add_settings_field( 'wp-approve-user[unapprove-email]', - __( 'Unapprove Email', 'wp-approve-user' ), - array( &$this, 'textarea_cb' ), + esc_html__( 'Unapprove Email', 'wp-approve-user' ), + array( $this, 'textarea_cb' ), $this->textdomain, $this->textdomain, array( @@ -612,7 +660,6 @@ public function admin_init() { public function settings_page() { ?>
-

@@ -620,9 +667,9 @@ public function settings_page() {
textdomain ); - do_settings_sections( $this->textdomain ); - submit_button(); + settings_fields( $this->textdomain ); + do_settings_sections( $this->textdomain ); + submit_button(); ?>
@@ -648,14 +695,15 @@ public function settings_page() { * @return void */ public function section_description_cb() { - $tags = array( 'USERNAME', 'BLOG_TITLE', 'BLOG_URL', 'LOGINLINK' ); + $tags = array( 'USERNAME', 'DISPLAYNAME', 'FIRSTNAME', 'BLOG_TITLE', 'BLOG_URL', 'LOGINLINK', 'RESETLINK' ); if ( is_multisite() ) { $tags[] = 'SITE_NAME'; } printf( - _x( 'To take advantage of dynamic data, you can use the following placeholders: %s. Username will be the user login in most cases.', 'Placeholders', 'wp-approve-user' ), - sprintf( '%s', implode( ', ', $tags ) ) + /* translators: Placeholders. */ + esc_html_x( 'To take advantage of dynamic data, you can use the following placeholders: %s. Username will be the user login in most cases.', 'Placeholders', 'wp-approve-user' ), + sprintf( '%s', implode( ', ', $tags ) ) // phpcs:ignore WordPress.XSS.EscapeOutput.OutputNotEscaped ); } @@ -667,12 +715,15 @@ public function section_description_cb() { * @since 2.0.0 - 31.03.2012 * @access public * + * @param array $option Settings option. + * * @return void */ public function checkbox_cb( $option ) { - $option = (object) $option; ?> -