Plugin Directory

Changeset 1749439


Ignore:
Timestamp:
10/19/2017 07:05:56 PM (8 years ago)
Author:
plugmize
Message:

Bug fix.

Location:
wp-ranking-pro/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • wp-ranking-pro/trunk/readme.txt

    r1686681 r1749439  
    44Tags: ranking, popular, Post, posts, popularity, widget, AJAX, shortcode, cache, top
    55Requires at least: 4.5
    6 Tested up to: 4.8.0
    7 Stable tag: 1.0.1
     6Tested up to: 4.8.2
     7Stable tag: 1.0.2
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    7676== Changelog ==
    7777
     78**1.0.2**
     79* Bug fix.
     80
    7881**1.0.1**
    7982* Bug fix.
  • wp-ranking-pro/trunk/wp-ranking-pro.php

    r1686681 r1749439  
    2424class WP_Ranking_PRO
    2525{
    26     const _DB_VERSION   = '0.12';
     26    const _DB_VERSION   = '0.13';
    2727    const TEXT_DOMAIN   = 'wp-ranking-pro';
    2828    const UA_MOBILE     = "iPhone\niPod\nAndroid\ndream\nCUPCAKE\nWindows Phone\nwebOS\nBB10\nBlackBerry8707\nBlackBerry9000\nBlackBerry9300\nBlackBerry9500\nBlackBerry9530\nBlackBerry9520\nBlackBerry9550\nBlackBerry9700\nBlackBerry 93\nBlackBerry 97\nBlackBerry 99\nBlackBerry 98\nDoCoMo\nSoftBank\nJ-PHONE\nVodafone\nKDDI\nUP.Browser\nWILLCOM\nemobile\nDDIPOCKET\nWindows CE\nBlackBerry\nSymbian\nPalmOS\nHuawei\nIAC\nNokia";
     
    102102
    103103        # $installed_db_version < 0.01
    104         if (strcmp($installed_db_version, '0.01') == -1) {
     104        if (strcmp($installed_db_version, '0.01') < 0) {
    105105            $this->_insert_default_rankings();
    106106
     
    110110
    111111        # $installed_db_version < 0.12
    112         if (strcmp($installed_db_version, '0.12') == -1) {
     112        if (strcmp($installed_db_version, '0.12') < 0) {
    113113            $this->_update_default_ranking_title();
     114        }
     115
     116        # $installed_db_version < 0.13
     117        if (strcmp($installed_db_version, '0.13') < 0) {
     118            $this->_check_default_rankings();
    114119        }
    115120
     
    232237    }
    233238
     239    private function _check_default_rankings() {
     240        global $wpdb;
     241
     242        $ranking_count = $wpdb->get_var("SELECT COUNT(id) FROM {$wpdb->prefix}wpr_ranking WHERE id BETWEEN 1 AND 6");
     243        if (!is_null($ranking_count) && $ranking_count == 0) {
     244            $this->_insert_default_rankings();
     245        }
     246    }
     247
    234248    private function _update_default_ranking_title() {
    235249        global $wpdb;
Note: See TracChangeset for help on using the changeset viewer.