Plugin Directory

Changeset 2608162


Ignore:
Timestamp:
10/02/2021 05:44:12 AM (5 years ago)
Author:
UDSSL
Message:

Adding version 1.0.2 of Time Tracker.

Location:
udssl-time-tracker/trunk
Files:
1 deleted
5 edited

Legend:

Unmodified
Added
Removed
  • udssl-time-tracker/trunk/admin/class-udssl-tt-admin.php

    r2607725 r2608162  
    109109    function udssl_settings_tabs(){
    110110        if ( isset ( $_GET['tab'] ) ) :
    111             $current = esc_attr( $_GET['tab'] );
     111            $current = sanitize_text_field( $_GET['tab'] );
    112112        else:
    113113            $current = 'presets';
     
    135135        echo '<h2 class="nav-tab-wrapper">';
    136136            foreach ( $links as $link ):
    137                 echo $link; // All links are escaped above.
     137                echo wp_kses($link, array('a' =>
     138                    array(
     139                        'href' => array(),
     140                        'class' => array()
     141                    )
     142                ));
    138143            endforeach;
    139144        echo '</h2>';
     
    174179            echo '<form action="options.php" method="post">';
    175180                if ( isset ( $_GET['tab'] ) ) :
    176                     $tab = esc_html( $_GET['tab'] );
     181                    $tab = sanitize_text_field( $_GET['tab'] );
    177182                else:
    178183                    $tab = 'presets';
  • udssl-time-tracker/trunk/inc/class-udssl-tt-db-interface.php

    r2607725 r2608162  
    9393            't_end'         => strtotime($data->t_end),
    9494            't_duration'    => strtotime($data->t_end) - strtotime($data->t_start),
    95             't_category'    => esc_sql( $data->t_category ),
    96             't_project'     => esc_sql( $data->t_project ),
    97             't_task'        => esc_sql( $data->t_task ),
    98             't_description' => esc_sql( $data->t_description )
     95            't_category'    => sanitize_text_field( $data->t_category ),
     96            't_project'     => sanitize_text_field( $data->t_project ),
     97            't_task'        => sanitize_text_field( $data->t_task ),
     98            't_description' => sanitize_text_field( $data->t_description )
    9999        );
    100100
     
    131131        $data = array(
    132132            'c_id'          => null,
    133             'c_name'    => esc_sql( $data->c_name ),
    134             'c_description' => esc_sql( $data->c_description )
     133            'c_name'    => sanitize_text_field( $data->c_name ),
     134            'c_description' => sanitize_text_field( $data->c_description )
    135135        );
    136136
     
    143143     */
    144144    function get_project_list(){
     145        global $wpdb;
     146        $project_table = $wpdb->prefix . $this->project_table;
     147        $project_table = sanitize_text_field($project_table);
     148        $projects = $wpdb->get_results(
     149            "
     150            SELECT *
     151            FROM $project_table
     152            LIMIT 100
     153            ", ARRAY_A
     154        );
     155
     156        return $projects;
     157    }
     158
     159    /**
     160     * Add Project
     161     */
     162    function add_project($data){
    145163        global $wpdb;
    146164        $project_table = $wpdb->prefix . $this->project_table;
    147165        $project_table = esc_sql($project_table);
    148         $projects = $wpdb->get_results(
    149             "
    150             SELECT *
    151             FROM $project_table
    152             LIMIT 100
    153             ", ARRAY_A
    154         );
    155 
    156         return $projects;
    157     }
    158 
    159     /**
    160      * Add Project
    161      */
    162     function add_project($data){
    163         global $wpdb;
    164         $project_table = $wpdb->prefix . $this->project_table;
    165         $project_table = esc_sql($project_table);
    166166
    167167        $data = array(
    168168            'p_id'          => null,
    169             'p_category'    => esc_sql( $data->p_category ),
    170             'p_name'    => esc_sql( $data->p_name ),
    171             'p_description' => esc_sql( $data->p_description )
     169            'p_category'    => sanitize_text_field( $data->p_category ),
     170            'p_name'    => sanitize_text_field( $data->p_name ),
     171            'p_description' => sanitize_text_field( $data->p_description )
    172172        );
    173173
     
    180180     */
    181181    function get_task_list(){
     182        global $wpdb;
     183        $task_table = $wpdb->prefix . $this->task_table;
     184        $task_table = sanitize_text_field($task_table);
     185        $tasks = $wpdb->get_results(
     186            "
     187            SELECT *
     188            FROM $task_table
     189            WHERE ta_state != 2 or ta_state is null
     190            LIMIT 100
     191            ", ARRAY_A
     192        );
     193
     194        return $tasks;
     195    }
     196
     197    /**
     198     * Add Task
     199     */
     200    function add_task($data){
     201        global $wpdb;
     202        $task_table = $wpdb->prefix . $this->task_table;
     203        $task_table = sanitize_text_field($task_table);
     204
     205        $data = array(
     206            'ta_id'          => null,
     207            'ta_project'    => sanitize_text_field( $data->ta_project ),
     208            'ta_name'    => sanitize_text_field( $data->ta_name ),
     209            'ta_description' => sanitize_text_field( $data->ta_description ),
     210            'ta_state' => 0,
     211            'ta_price' => 0
     212        );
     213
     214        $r = $wpdb->insert( $task_table, $data );
     215        return $r;
     216    }
     217
     218    /**
     219     * Update Task
     220     */
     221    function update_task($data){
    182222        global $wpdb;
    183223        $task_table = $wpdb->prefix . $this->task_table;
    184224        $task_table = esc_sql($task_table);
    185         $tasks = $wpdb->get_results(
    186             "
    187             SELECT *
    188             FROM $task_table
    189             WHERE ta_state != 2 or ta_state is null
    190             LIMIT 100
    191             ", ARRAY_A
    192         );
    193 
    194         return $tasks;
    195     }
    196 
    197     /**
    198      * Add Task
    199      */
    200     function add_task($data){
    201         global $wpdb;
    202         $task_table = $wpdb->prefix . $this->task_table;
    203         $task_table = esc_sql($task_table);
    204225
    205226        $data = array(
    206227            'ta_id'          => null,
    207             'ta_project'    => esc_sql( $data->ta_project ),
    208             'ta_name'    => esc_sql( $data->ta_name ),
    209             'ta_description' => esc_sql( $data->ta_description ),
    210             'ta_state' => 0,
     228            'ta_project'    => sanitize_text_field( $data->ta_project ),
     229            'ta_name'    => sanitize_text_field( $data->ta_name ),
     230            'ta_description' => sanitize_text_field( $data->ta_description ),
    211231            'ta_price' => 0
    212232        );
    213233
    214         $r = $wpdb->insert( $task_table, $data );
    215         return $r;
    216     }
    217 
    218     /**
    219      * Update Task
    220      */
    221     function update_task($data){
    222         global $wpdb;
    223         $task_table = $wpdb->prefix . $this->task_table;
    224         $task_table = esc_sql($task_table);
    225 
    226         $data = array(
    227             'ta_id'          => null,
    228             'ta_project'    => esc_sql( $data->ta_project ),
    229             'ta_name'    => esc_sql( $data->ta_name ),
    230             'ta_description' => esc_sql( $data->ta_description ),
    231             'ta_price' => 0
    232         );
    233 
    234234        $r = $wpdb->update( $task_table, $data );
    235235        return $r;
     
    242242        global $wpdb;
    243243        $payment_table = $wpdb->prefix . $this->payment_table;
    244         $payment_table = esc_sql($payment_table);
     244        $payment_table = sanitize_text_field($payment_table);
    245245        $payments = $wpdb->get_results(
    246246            "
     
    260260        global $wpdb;
    261261        $payment_table = $wpdb->prefix . $this->payment_table;
    262         $payment_table = esc_sql($payment_table);
     262        $payment_table = sanitize_text_field($payment_table);
    263263
    264264        $data = array(
    265265            'id' => null,
    266266            'time' => strtotime($data->time),
    267             'category' => esc_sql( $data->category ),
    268             'project' => esc_sql( $data->project ),
    269             'task' => esc_sql( $data->task ),
    270             'paid' => esc_sql( $data->paid * 100 ),
    271             'charges' => esc_sql( $data->charges * 100 ),
    272             'effective' => esc_sql( $data->effective * 100 )
     267            'category' => sanitize_text_field( $data->category ),
     268            'project' => sanitize_text_field( $data->project ),
     269            'task' => sanitize_text_field( $data->task ),
     270            'paid' => sanitize_text_field( $data->paid * 100 ),
     271            'charges' => sanitize_text_field( $data->charges * 100 ),
     272            'effective' => sanitize_text_field( $data->effective * 100 )
    273273        );
    274274
     
    283283        global $wpdb;
    284284        $task_table = $wpdb->prefix . $this->task_table;
    285         $task_table = esc_sql($task_table);
     285        $task_table = sanitize_text_field($task_table);
    286286        $where = array( 'ta_project' => $data->project,
    287             'ta_name' => esc_sql( $data->task ));
    288 
    289         $data = array(
    290             'ta_price' => esc_sql( $data->paid * 100),
     287            'ta_name' => sanitize_text_field( $data->task ));
     288
     289        $data = array(
     290            'ta_price' => sanitize_text_field( $data->paid * 100),
    291291            'ta_state' => 2
    292292        );
     
    304304         */
    305305        $table_name  = $wpdb->prefix . $this->time_table;
    306         $table_name = esc_sql($table_name);
     306        $table_name = sanitize_text_field($table_name);
    307307        $sql = "DROP TABLE IF EXISTS $table_name";
    308308        $e = $wpdb->query( $wpdb->prepare($sql));
  • udssl-time-tracker/trunk/inc/class-udssl-tt-enqueues.php

    r2606695 r2608162  
    1414
    1515        /**
    16          * Backbone and Underscore
     16         * Moment, Backbone and Underscore
    1717         */
     18        add_action('wp_enqueue_scripts', array($this, 'moment'));
    1819        add_action('wp_enqueue_scripts', array($this, 'underscore'));
    1920        add_action('wp_enqueue_scripts', array($this, 'backbone'));
     
    2324         */
    2425        add_action('wp_enqueue_scripts', array($this, 'charts_js'));
    25         add_action('wp_enqueue_scripts', array($this, 'moment'));
    2626        add_action('wp_enqueue_scripts', array($this, 'app'));
    2727    }
     
    5454     */
    5555    function charts_js(){
    56         wp_enqueue_script('charts-js', 'https://cdnjs.cloudflare.com/ajax/libs/Chart.js/3.5.1/chart.min.js', array(), null, true);
     56        wp_enqueue_script('charts-js', UDSSL_TT_URL . 'lib/chartjs/chart.min.js', array(), null, true);
    5757    }
    5858
     
    6161     */
    6262    function moment(){
    63         wp_enqueue_script('moment-js', UDSSL_TT_URL . 'lib/moment/moment.min.js', array('jquery'), null, true);
     63        wp_enqueue_script('moment');
    6464    }
    6565
  • udssl-time-tracker/trunk/index.php

    r2607725 r2608162  
    44 * Plugin URI: http://udssl.com/udssl-time-tracker/
    55 * Description: UDSSL Time Tracker. Track your time easily. View graphs of time data.
    6  * Version: 1.0.1
     6 * Version: 1.0.2
    77 * Author: UDSSL
    88 * Author URI: http://udssl.com/udssl-time-tracker/
  • udssl-time-tracker/trunk/readme.txt

    r2607725 r2608162  
    66Requires PHP: 5.6
    77Tested up to: 5.8.1
    8 Stable tag: 1.0.1
     8Stable tag: 1.0.2
    99Text Domain: udssl
    1010Domain Path: /languages
     
    7777== Changelog ==
    7878
     79= 1.0.2 =
     80
     81* Using sanitization functions in db class and other inputs.
     82
     83* Removed calling chartjs remotely.
     84* Using chartjs in SVN.
     85
     86* Moment js files deleted from SVN.
     87* Using WordPress packaged 'moment'.
     88
     89* Using wp_kses() to echo html.
     90
    7991= 1.0.1 =
    8092
Note: See TracChangeset for help on using the changeset viewer.