Plugin Directory

Changeset 2053454


Ignore:
Timestamp:
03/19/2019 02:21:23 PM (7 years ago)
Author:
windyjonas
Message:

Version bump and code cleanup

Location:
user-activity/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • user-activity/trunk/classes/class-bu-user-activity-table.php

    r1968832 r2053454  
    101101         * Handle request parameters
    102102         */
    103         $ptype     = ( isset( $_REQUEST['ptype'] ) && ! empty( $_REQUEST['ptype'] ) ? $_REQUEST['ptype'] : 'all' );
    104         $startdate = ( isset( $_REQUEST['startdate'] ) ? $_REQUEST['startdate'] : '' );
    105         $enddate   = ( isset( $_REQUEST['enddate'] ) ? $_REQUEST['enddate'] : '' );
    106         $username  = ( isset( $_REQUEST['s'] ) ? $_REQUEST['s'] : '' );
     103        $ptype     = ( isset( $_REQUEST['ptype'] ) && ! empty( $_REQUEST['ptype'] ) ? sanitize_text_field( wp_unslash( $_REQUEST['ptype'] ) ) : 'all' );
     104        $startdate = ( isset( $_REQUEST['startdate'] ) ? sanitize_text_field( wp_unslash( $_REQUEST['startdate'] ) ) : '' );
     105        $enddate   = ( isset( $_REQUEST['enddate'] ) ? sanitize_text_field( wp_unslash( $_REQUEST['enddate'] ) ) : '' );
     106        $username  = ( isset( $_REQUEST['s'] ) ? sanitize_text_field( wp_unslash( $_REQUEST['s'] ) ) : '' );
    107107
    108108        $prepare_vars = [];
     
    125125            $prepare_vars[] = $ptype;
    126126        } else {
    127             $args = [ 'public' => true ];
     127            $args         = [ 'public' => true ];
    128128            $post_types   = get_post_types( $args );
    129129            $ptype_clause = sprintf(
    130130                'and a.post_type IN (%s)',
    131                 implode( ',', array_map( function( $a ) { return "'" . $a . "'"; }, $post_types ) )
     131                implode(
     132                    ',',
     133                    array_map(
     134                        function( $a ) {
     135                            return "'" . $a . "'";
     136                        },
     137                        $post_types
     138                    )
     139                )
    132140            );
    133141        }
     
    251259            return;
    252260        }
    253         $ptype     = isset( $_GET['ptype'] ) ? $_GET['ptype'] : '';
    254         $startdate = isset( $_GET['startdate'] ) ? $_GET['startdate'] : '';
    255         $enddate   = isset( $_GET['enddate'] ) ? $_GET['enddate'] : '';
     261        $ptype     = isset( $_GET['ptype'] ) ? sanitize_text_field( wp_unslash( $_GET['ptype'] ) ) : '';
     262        $startdate = isset( $_GET['startdate'] ) ? sanitize_text_field( wp_unslash( $_GET['startdate'] ) ) : '';
     263        $enddate   = isset( $_GET['enddate'] ) ? sanitize_text_field( wp_unslash( $_GET['enddate'] ) ) : '';
    256264        ?>
    257265        <div class="alignleft actions">
    258             <label class="screen-reader-text" for="ptype"><?php _e( 'Post type&hellip;', 'buua' ) ?></label>
     266            <label class="screen-reader-text" for="ptype"><?php esc_html_e( 'Post type&hellip;', 'buua' ); ?></label>
    259267            <select name="ptype" id="ptype">
    260                 <option <?php selected( $ptype, '' ); ?> value=''><?php _e( 'Post type&hellip;', 'buua' ); ?></option>
     268                <option <?php selected( $ptype, '' ); ?> value=''><?php esc_html_e( 'Post type&hellip;', 'buua' ); ?></option>
    261269                <?php
    262270                $args       = [ 'public' => true ];
     
    266274                <?php endforeach ?>
    267275            </select>
    268             <input placeholder="<?php _e( 'Start date', 'buua' ); ?>" type="text" id="startdate" name="startdate" class="startdate datepicker" value="<?php echo esc_html( $startdate ); ?>" />
    269             <input placeholder="<?php _e( 'End date', 'buua' ); ?>" type="text" id="enddate" name ="enddate" class="enddate datepicker" value="<?php echo $enddate; ?>" />
     276            <input placeholder="<?php esc_attr_e( 'Start date', 'buua' ); ?>" type="text" id="startdate" name="startdate" class="startdate datepicker" value="<?php echo esc_html( $startdate ); ?>" />
     277            <input placeholder="<?php esc_attr_e( 'End date', 'buua' ); ?>" type="text" id="enddate" name ="enddate" class="enddate datepicker" value="<?php echo $enddate; ?>" />
    270278            <?php submit_button( __( 'Filter', 'buua' ), 'button', false, false, [ 'id' => 'post-query-submit' ] ); ?>
    271279        </div>
  • user-activity/trunk/readme.txt

    r1968832 r2053454  
    33Donate link: https://www.paypal.me/JonasNordstrom
    44Tags: users, list, admin
    5 Requires PHP: 5.4
     5Requires PHP: 5.6
    66Requires at least: 4.7.0
    7 Tested up to: 4.9.8
    8 Stable tag: 0.9.3
     7Tested up to: 5.1.1
     8Stable tag: 1.0.0
    99
    1010List number of posts per user. You can limit the search by date, post type and user name.
     
    1212== Description ==
    1313
    14 Get an overview over how active your users has been during a specified time period. This plugin will list all the users,
     14Get an overview of how active your users has been during a specified time period. This plugin will list all the users,
    1515the number of posts/pages they have created and when their latest post was created.
    1616
     
    3939== Changelog ==
    4040
     41= 1.0.0 =
     42Version bump and code cleanup
     43
     44= 0.9.4 =
     45
     46* WP version bump
     47
    4148= 0.9.3 =
    4249
  • user-activity/trunk/user-activity.php

    r1968832 r2053454  
    44Plugin URI: http://jonasnordstrom.se/plugins/
    55Description: List number of posts per user. You can limit the search by date, post type and user name.
    6 Version: 0.9.3
     6Version: 1.0.0
    77Author: Jonas Nordström
    88Author URI: http://jonasnordstrom.se/
Note: See TracChangeset for help on using the changeset viewer.