Plugin Directory

Changeset 2809054


Ignore:
Timestamp:
11/01/2022 07:07:18 PM (3 years ago)
Author:
bompus
Message:

3.6.5

Location:
wp-customer-reviews/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • wp-customer-reviews/trunk/changelog.txt

    r2791146 r2809054  
     1= 3.6.5 =
     2* 11/01/2022
     3* [Update] Compatibility with WP 6.1
     4* [Bugfix] Prevent division by zero error.
     5
    16= 3.6.4 =
    27* 09/27/2022
  • wp-customer-reviews/trunk/readme.txt

    r2791146 r2809054  
    44Tags: business, google, hcard, schema.org, hproduct, hreview, microformat, microformats, mu, places, plugin, product, rating, ratings, rdfa, review, review box, review widget, reviews, seo, service, snippet, snippets, testimonial, testimonials, widget, wordpressmu, wpmu
    55Requires at least: 3.0.0
    6 Tested up to: 6.0
    7 Stable tag: 3.6.4
     6Tested up to: 6.1
     7Stable tag: 3.6.5
    88License: MIT
    99License URI: http://opensource.org/licenses/MIT
     
    6363== Changelog ==
    6464
     65= 3.6.5 =
     66* 11/01/2022
     67* [Update] Compatibility with WP 6.1
     68* [Bugfix] Prevent division by zero error.
     69
    6570= 3.6.4 =
    6671* 09/27/2022
  • wp-customer-reviews/trunk/wp-customer-reviews-3.php

    r2791146 r2809054  
    44 * Plugin URI: https://wordpress.org/plugins/wp-customer-reviews/
    55 * Description: Allows your visitors to leave business / product reviews. Testimonials are in Microdata / Microformat and may display star ratings in search results.
    6  * Version: 3.6.4
     6 * Version: 3.6.5
    77 * Author: Aaron Queen
    88 * Author URI: https://wordpress.org/plugins/wp-customer-reviews/
     
    1010 * License: MIT
    1111 *
    12  * Copyright (c) 2021 Aaron Queen
     12 * Copyright (c) 2022 Aaron Queen
    1313 *
    1414 * Permission is hereby granted, free of charge, to any person obtaining a copy
     
    422422    }
    423423
    424     function iso8601($time=false) {
    425         if ($time === false) { $time = time(); }
    426         $date = date('Y-m-d\TH:i:sO', $time);
    427         return (substr($date, 0, strlen($date) - 2) . ':' . substr($date, -2));
    428     }
    429 
    430     function pagination($opts, $thispage, $total_results) {
    431         $rtn = false;
     424    function iso8601($time=false) {
     425            if ($time === false) { $time = time(); }
     426            $date = date('Y-m-d\TH:i:sO', $time);
     427            return (substr($date, 0, strlen($date) - 2) . ':' . substr($date, -2));
     428    }
     429
     430    function pagination($opts, $thispage, $total_results) {
     431        $rtn = false;
    432432        $thispage = intval($thispage);
    433         if ($thispage == 0) { $thispage = 1; }
    434         $pages = intval(ceil($total_results / $opts->perpage));
    435        
    436         if ($pages > 1) {
     433        if ($thispage == 0) { $thispage = 1; }
     434        $pages = intval(ceil($total_results / $opts->perpage));
     435
     436        if ($pages > 1) {
    437437            $rtn = array();
    438438            $rtn['pageOpts'] = htmlspecialchars(json_encode($opts), ENT_QUOTES);
     
    447447
    448448            $rtn['hasPrev'] = false;
    449             if ($thispage !== 1) {
    450                 $rtn['hasPrev'] = true;
    451             }
    452 
    453             for ($i = 1; $i <= $pages; $i++) {
    454                 if ($i === $thispage) {
     449            if ($thispage !== 1) {
     450                    $rtn['hasPrev'] = true;
     451            }
     452
     453            for ($i = 1; $i <= $pages; $i++) {
     454                if ($i === $thispage) {
    455455                    $tmp = array();
    456456                    $tmp['pageNum'] = $i;
    457457                    $tmp['current'] = true;
    458458                    $rtn['pages'][] = $tmp;
    459                 } else if (!($i >= ($thispage + $range + 1) || $i <= ($thispage - $range - 1)) || $pages <= $showitems) {
    460                     $tmp = array();
    461                     $tmp['pageNum'] = $i;
    462                     $tmp['current'] = false;
    463                     $rtn['pages'][] = $tmp;
    464                 }
    465             }
    466            
     459                    } else if (!($i >= ($thispage + $range + 1) || $i <= ($thispage - $range - 1)) || $pages <= $showitems) {
     460                        $tmp = array();
     461                        $tmp['pageNum'] = $i;
     462                        $tmp['current'] = false;
     463                        $rtn['pages'][] = $tmp;
     464                    }
     465            }
     466       
    467467            $rtn['hasNext'] = false;
    468             if ($thispage !== $pages) {
    469                 $rtn['hasNext'] = true;
    470             }
    471         }
    472        
     468            if ($thispage !== $pages) {
     469                    $rtn['hasNext'] = true;
     470            }
     471        }
     472   
    473473        return $rtn;
    474     }
     474    }
    475475   
    476476    function get_meta_or_default($metaArr, $key, $default) {
     
    566566        if ($opts->thispage < 1) { $opts->thispage = 1; }
    567567        if ($opts->perpage < 1) { $opts->perpage = intval($this->options['reviews_per_page']); }
     568        if ($opts->perpage < 1) { $opts->perpage = 10; }
    568569       
    569570        $postid = $opts->postid;
    570         $thispage = $opts->thispage;
     571        $thispage = $opts->thispage;
    571572       
    572573        if ($opts->num > 0 && $opts->num < $opts->perpage) {
Note: See TracChangeset for help on using the changeset viewer.