close

Plugin Directory

Changeset 3536402


Ignore:
Timestamp:
05/18/2026 11:39:43 PM (9 days ago)
Author:
room34
Message:

Version 1.1.0

Location:
pending-status
Files:
14 added
5 edited

Legend:

Unmodified
Added
Removed
  • pending-status/trunk/class-pending-status.php

    r3281184 r3536402  
    11<?php
     2
     3// phpcs:disable WordPress.WP.I18n.MissingTranslatorsComment
    24
    35// Don't load directly
     
    5456    public function admin_page_callback() {
    5557        // Update settings
    56         if (isset($_POST['r34ps-nonce']) && wp_verify_nonce($_POST['r34ps-nonce'], 'r34ps-admin')) {
     58        if (isset($_POST['r34ps-nonce']) && wp_verify_nonce(sanitize_text_field(wp_unslash($_POST['r34ps-nonce'])), 'r34ps-admin')) {
    5759           
    5860            if (!empty($_POST['r34ps_notification_recipients'])) {
     61                // phpcs:disable WordPress.Security.ValidatedSanitizedInput.MissingUnslash
     62                // phpcs:disable WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
    5963                update_option('r34ps_notification_recipients', filter_var_array($_POST['r34ps_notification_recipients'], FILTER_SANITIZE_EMAIL));
     64                // phpcs:enable WordPress.Security.ValidatedSanitizedInput.MissingUnslash
     65                // phpcs:enable WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
    6066            }
    6167            else {
     
    7884
    7985            // Display admin notice
    80             echo '<div class="notice notice-success"><p>' . __('Settings updated.', 'pending-status') . '</p></div>';
     86            echo '<div class="notice notice-success"><p>' . esc_html__('Settings updated.', 'pending-status') . '</p></div>';
    8187        }
    8288       
     
    96102   
    97103    public function email_default_strings() {
    98         $this->default_subject = sprintf(__('A new post is pending review on %1$s', 'pending-review'), get_bloginfo('name'));
     104        $this->default_subject = sprintf(__('A new post is pending review on %1$s', 'pending-status'), get_bloginfo('name'));
    99105        $this->default_message = __('A post on your website has been set to "pending review." You can review the post at the link below.', 'pending-status');
    100106    }
  • pending-status/trunk/functions.php

    r2687787 r3536402  
    11<?php
     2
     3// phpcs:disable WordPress.WP.I18n.MissingTranslatorsComment
    24
    35// Don't load directly
     
    1315    $r34ps_status = array();
    1416    foreach ((array)$post_types as $post_type) {
    15         $sql =  'SELECT COUNT(`ID`) as count FROM `' . $wpdb->posts . '` ' .
    16                 'WHERE `post_type` = "' . esc_sql($post_type->name) . '" ' .
    17                 'AND `post_status` = "pending"';
    18         $r34ps_results = $wpdb->get_results($sql);
    19         $count = intval($r34ps_results[0]->count);
     17        $pending_posts = get_posts(array(
     18            'fields' => 'ids',
     19            'post_status' => 'pending',
     20            'post_type' => $post_type->name,
     21            'posts_per_page' => -1,
     22        ));
     23        $count = count($pending_posts);
    2024        if ($count > 0) {
    2125            $r34ps_status[] = array(
     
    2832    }
    2933    if (!empty($r34ps_status)) {
    30         echo '<p>' . __('You have one or more posts pending review.', 'pending-status') . '</p><table class="r34ps-table"><tbody>';
     34        echo '<p>' . esc_html__('You have one or more posts pending review.', 'pending-status') . '</p><table class="r34ps-table"><tbody>';
    3135        foreach ((array)$r34ps_status as $item) {
    3236            echo '<tr><td><strong>' . wp_kses_post($item['label']) . ':&nbsp;&nbsp;</strong></td><td>' . intval($item['count']);
     
    3943    }
    4044    else {
    41         echo '<p>' . __('You currently have no posts pending review.', 'pending-status') . '</p>';
     45        echo '<p>' . esc_html__('You currently have no posts pending review.', 'pending-status') . '</p>';
    4246    }
    4347    ?>
  • pending-status/trunk/pending-status.php

    r3281184 r3536402  
    44Plugin URI: https://room34.com
    55Description: Get notified when your site has posts pending review.
    6 Version: 1.0.4
     6Version: 1.1.0
    77Author: Room 34 Creative Services, LLC
    88Author URI: http://room34.com
     
    2727    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
    2828*/
     29
     30// phpcs:disable WordPress.WP.I18n.MissingTranslatorsComment
    2931
    3032
     
    7173    $notices = get_option('r34ps_deferred_admin_notices', array());
    7274    $notices[] = array(
    73         'content' => '<p>' . sprintf(__('Thank you for installing %1$sPending Status%2$s. If you would like to set up email notifications for pending posts, please visit the %3$sSettings%4$s page.'), '<strong>', '</strong>', '<a href="' . admin_url('options-general.php?page=pending-status') . '"><strong>', '</strong></a>') . '</p>',
     75        'content' => '<p>' . sprintf(__('Thank you for installing %1$sPending Status%2$s. If you would like to set up email notifications for pending posts, please visit the %3$sSettings%4$s page.', 'pending-status'), '<strong>', '</strong>', '<a href="' . admin_url('options-general.php?page=pending-status') . '"><strong>', '</strong></a>') . '</p>',
    7476        'status' => 'info'
    7577    );
  • pending-status/trunk/readme.txt

    r3281184 r3536402  
    55Requires at least: 4.9
    66Requires PHP: 7.0.0
    7 Tested up to: 6.8
    8 Stable tag: 1.0.4
     7Tested up to: 7.0
     8Stable tag: 1.1.0
    99License: GPLv2
    1010
     
    3737== Changelog ==
    3838
     39= 1.1.0 - 2026.05.18 =
     40
     41* Refactored `r34ps_dashboard_widget()` function to use `get_posts()` instead of direct SQL query.
     42* Additional code refactoring to pass [Plugin Check](https://wordpress.org/plugins/plugin-check/) tests.
     43* Bumped "tested up to" to 7.0.
     44
    3945= 1.0.4 - 2025.04.24 =
    4046
  • pending-status/trunk/templates/admin/r34ps-admin.php

    r3281184 r3536402  
    11<?php
     2// phpcs:disable WordPress.WP.I18n.MissingTranslatorsComment
     3
    24// Don't load directly
    35if (!defined('ABSPATH')) { exit; }
     
    810
    911<div class="wrap r34ps">
    10     <h2><?php echo get_admin_page_title(); ?></h2>
     12    <h2><?php echo wp_kses_post(get_admin_page_title()); ?></h2>
    1113
    1214    <div class="metabox-holder columns-2">
     
    2325                    ?>
    2426                   
    25                     <h3><?php _e('Email Notification Recipients', 'pending-status'); ?></h3>
     27                    <h3><?php esc_html_e('Email Notification Recipients', 'pending-status'); ?></h3>
    2628
    27                     <p><?php _e('Check the box next to the name of each administrator/editor you would like to receive an email notification when a post has been set to "pending review." Note: Your site must be properly configured to send emails.', 'pending-status'); ?></p>
     29                    <p><?php esc_html_e('Check the box next to the name of each administrator/editor you would like to receive an email notification when a post has been set to "pending review." Note: Your site must be properly configured to send emails.', 'pending-status'); ?></p>
    2830
    2931                    <table class="form-table"><tbody>
    3032                        <tr class="r34ps-table-header-row">
    3133                            <th style="width: 10%;"></th>
    32                             <th style="width: 30%;"><?php _e('Name', 'pending-status'); ?></th>
    33                             <th style="width: 30%;"><?php _e('Email', 'pending-status'); ?></th>
    34                             <th style="width: 30%;"><?php _e('Role', 'pending-status'); ?></th>
     34                            <th style="width: 30%;"><?php esc_html_e('Name', 'pending-status'); ?></th>
     35                            <th style="width: 30%;"><?php esc_html_e('Email', 'pending-status'); ?></th>
     36                            <th style="width: 30%;"><?php esc_html_e('Role', 'pending-status'); ?></th>
    3537                        </tr>
    3638                        <?php
     39                        // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound
    3740                        foreach ((array)$admins_and_editors as $user) {
    3841                            ?>
     
    4851                    </tbody></table>
    4952                   
    50                     <h3><?php _e('Email Notification Message', 'pending-status'); ?></h3>
     53                    <h3><?php esc_html_e('Email Notification Message', 'pending-status'); ?></h3>
    5154                   
    52                     <p><?php _e('Customize the message administrators and editors will receive. The URL to review the post will automatically be added to the end of the message.', 'pending-status'); ?></p>
     55                    <p><?php esc_html_e('Customize the message administrators and editors will receive. The URL to review the post will automatically be added to the end of the message.', 'pending-status'); ?></p>
    5356                   
    5457                    <table class="form-table"><tbody>
    5558                        <tr>
    56                             <td><strong><?php _e('Subject:', 'pending-status'); ?></strong></td>
     59                            <td><strong><?php esc_html_e('Subject:', 'pending-status'); ?></strong></td>
    5760                            <td><input type="text" style="width: 100%;" name="r34ps_notification_subject" value="<?php echo esc_attr($r34ps_notification_subject); ?>" /></td>
    5861                        </tr>
    5962                        <tr>
    60                             <td><strong><?php _e('Message:', 'pending-status'); ?></strong></td>
     63                            <td><strong><?php esc_html_e('Message:', 'pending-status'); ?></strong></td>
    6164                            <td><textarea name="r34ps_notification_message" style="width: 100%;"><?php echo esc_textarea(html_entity_decode($r34ps_notification_message)); ?></textarea></td>
    6265                        </tr>
     
    7982            <div class="postbox">
    8083
    81                 <h3 class="hndle"><span><?php _e('Pending Status Support', 'pending-status'); ?></span></h3>
     84                <h3 class="hndle"><span><?php esc_html_e('Pending Status Support', 'pending-status'); ?></span></h3>
    8285       
    8386                <div class="inside">
    8487   
    85                     <p><?php echo sprintf(__('For support with the %1$s plugin, please use the %2$sWordPress Support Forums%3$s or email %4$s.', 'pending-status'), '<strong>Pending Status</strong>', '<a href="https://wordpress.org/support/plugin/pending-status" target="_blank">', '</a>', '<a href="mailto:support@room34.com">support@room34.com</a>'); ?></p>
     88                    <p><?php echo sprintf(esc_html__('For support with the %1$s plugin, please use the %2$sWordPress Support Forums%3$s or email %4$s.', 'pending-status'), '<strong>Pending Status</strong>', '<a href="https://wordpress.org/support/plugin/pending-status" target="_blank">', '</a>', '<a href="mailto:support@room34.com">support@room34.com</a>'); ?></p>
    8689       
    8790                </div>
     
    9598                <div class="inside">
    9699   
    97                     <a href="https://room34.com/about/payments/?type=WordPress+Plugin&plugin=Pending+Status&amt=9" target="_blank"><img src="<?php echo dirname(dirname(plugin_dir_url(__FILE__))); ?>/assets/room34-logo-on-white.svg" alt="Room 34 Creative Services" style="display: block; height: auto; margin: 0 auto 0.5em auto; width: 200px;" /></a>
     100                    <a href="https://room34.com/about/payments/?type=WordPress+Plugin&plugin=Pending+Status&amt=9" target="_blank"><img src="<?php echo esc_url(dirname(dirname(plugin_dir_url(__FILE__)))); ?>/assets/room34-logo-on-white.svg" alt="Room 34 Creative Services" style="display: block; height: auto; margin: 0 auto 0.5em auto; width: 200px;" /></a>
    98101       
    99                     <p><?php _e('This plugin is free to use. However, if you find it to be of value, we welcome your donation (suggested amount: USD $9), to help fund future development.', 'pending-status'); ?></p>
     102                    <p><?php esc_html_e('This plugin is free to use. However, if you find it to be of value, we welcome your donation (suggested amount: USD $9), to help fund future development.', 'pending-status'); ?></p>
    100103
    101                     <p><a href="https://room34.com/about/payments/?type=WordPress+Plugin&plugin=Pending+Status&amt=9" target="_blank" class="button"><?php _e('Make a Donation', 'pending-status'); ?></a></p>
     104                    <p><a href="https://room34.com/about/payments/?type=WordPress+Plugin&plugin=Pending+Status&amt=9" target="_blank" class="button"><?php esc_html_e('Make a Donation', 'pending-status'); ?></a></p>
    102105                   
    103106                </div>
Note: See TracChangeset for help on using the changeset viewer.