Plugin Directory

Changeset 1032108


Ignore:
Timestamp:
11/24/2014 09:15:38 PM (11 years ago)
Author:
bcole808
Message:

Release of v1.3.3

Location:
social-metrics-tracker
Files:
160 added
1 deleted
4 edited

Legend:

Unmodified
Added
Removed
  • social-metrics-tracker/trunk/readme.txt

    r1027510 r1032108  
    55Requires at least: 3.5
    66Tested up to: 4.0
    7 Stable tag: 1.3.2
     7Stable tag: 1.3.3
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    8484
    8585== Changelog ==
     86
     87= 1.3.3 =
     88* Optimize reporting dashboard load speed
     89* Improved pagination on reporting dashboard (fixes an issue where only 30 posts were displayed)
    8690
    8791= 1.3.2 =
     
    145149== Upgrade Notice ==
    146150
     151= 1.3.3 =
     152Optimize pagination on reporting dashboard
     153
    147154= 1.3.2 =
    148155Hotfix for specific server configurations
  • social-metrics-tracker/trunk/settings/smt-general.php

    r1001451 r1032108  
    11<?php
    22
    3 $smt_post_types = get_post_types( array('public'=>true, 'show_ui'=>true), 'names' ); 
     3$smt_post_types = get_post_types( array('public'=>true, 'show_ui'=>true), 'names' );
    44
    55// Do not allow attachments
     
    9696        ),
    9797        array(
     98            'id'    => 'default_posts_per_page',
     99            'title' => 'Default Posts per Page',
     100            'desc'  => 'Number of posts per page to display in reports',
     101            'type'  => 'select',
     102            'std'   => '10',
     103            'choices' => array(
     104                '10'  => '10',
     105                '20'  => '20',
     106                '30'  => '30',
     107                '40'  => '40',
     108                '50'  => '50',
     109                '100' => '100'
     110            )
     111        ),
     112        array(
    98113            'id'    => 'debug_mode',
    99114            'title' => 'Enable Debug Mode',
  • social-metrics-tracker/trunk/smt-dashboard.php

    r1026007 r1032108  
    213213        global $wpdb; //This is used only if making any database queries
    214214
    215         $per_page = 10;
     215        $per_page = empty( $this->smt->options[ 'smt_options_default_posts_per_page' ] ) ? 10 : $this->smt->options[ 'smt_options_default_posts_per_page' ];
    216216
    217217        $columns = $this->get_columns();
     
    226226        $post_types = $this->smt->tracked_post_types();
    227227
    228         $limit = 30;
    229 
    230228        // Filter our query results
    231229        add_filter( 'posts_where', array($this, 'date_range_filter') );
     
    233231
    234232        $querydata = new WP_Query(array(
    235             'posts_per_page'=> $limit,
     233            'posts_per_page'=> $per_page,
     234            'offset'        => ($this->get_pagenum()-1) * $per_page,
    236235            'post_status'   => 'publish',
    237236            'post_type'     => $post_types
     
    273272
    274273           array_push($data, $item);
     274
    275275        endwhile;
    276276        endif;
    277277
    278         /**
    279          * REQUIRED for pagination.
    280          */
    281         $current_page = $this->get_pagenum();
    282 
    283         $total_items = count($data);
    284 
    285         $data = array_slice($data,(($current_page-1)*$per_page),$per_page);
    286 
    287278        $this->items = $data;
    288279
    289         $this->set_pagination_args( array(
    290             'total_items' => $total_items,                  //WE have to calculate the total number of items
    291             'per_page'    => $per_page,                     //WE have to determine how many items to show on a page
    292             'total_pages' => ceil($total_items/$per_page)   //WE have to calculate the total number of pages
    293         ) );
     280        // Pagination
     281        $this->set_pagination_args(array(
     282            'total_items' => $querydata->found_posts,                  // Calculate the total number of items
     283            'per_page'    => $per_page,                                // Determine how many items to show on a page
     284            'total_pages' => ceil($querydata->found_posts/$per_page)   // Calculate the total number of pages
     285        ));
    294286    }
    295287
  • social-metrics-tracker/trunk/social-metrics-tracker.php

    r1027453 r1032108  
    44Plugin URI: https://github.com/ChapmanU/wp-social-metrics-tracker
    55Description: Collect and display social network shares, likes, tweets, and view counts of posts.
    6 Version: 1.3.2
     6Version: 1.3.3
    77Author: Ben Cole, Chapman University
    88Author URI: http://www.bencole.net
     
    3030include_once('SocialMetricsTrackerWidget.class.php');
    3131include_once('SocialMetricsDebugger.class.php');
     32require_once('lib/Mustache/Autoloader.php');
     33
    3234
    3335class SocialMetricsTracker {
    3436
    35     public $version = '1.3.2'; // for db upgrade comparison
     37    public $version = '1.3.3'; // for db upgrade comparison
    3638    public $updater;
    3739    public $options;
     
    7779    }
    7880
     81    /***************************************************
     82    * Renders a template using the Mustache Engine
     83    ***************************************************/
     84    public function renderTemplate($tpl, $data) {
     85
     86        if (!isset($this->mustache_engine)) {
     87            Mustache_Autoloader::register();
     88            $this->mustache_engine = new Mustache_Engine(array(
     89                'loader' => new Mustache_Loader_FilesystemLoader(dirname(__FILE__).'/templates'),
     90            ));
     91        }
     92
     93        return $this->mustache_engine->render($tpl, $data);
     94    }
     95
    7996    // Determines if we are on a development or staging environment
    8097    public function is_development_server() {
     
    109126    public function adminHeaderScripts() {
    110127
    111         wp_register_style( 'smt-css', plugins_url( 'css/social_metrics.css' , __FILE__ ), false, $this->version );
     128        wp_register_style( 'smt-css', plugins_url( 'css/social-metrics-tracker.min.css' , __FILE__ ), false, $this->version );
    112129        wp_enqueue_style( 'smt-css' );
    113130
    114         wp_register_script( 'smt-js', plugins_url( 'js/social-metrics-tracker.js' , __FILE__ ), 'jquery', $this->version );
     131        wp_register_script( 'smt-js', plugins_url( 'js/social-metrics-tracker.min.js' , __FILE__ ), 'jquery', $this->version );
    115132        wp_enqueue_script( 'smt-js' );
    116133
Note: See TracChangeset for help on using the changeset viewer.