Plugin Directory

Changeset 636700


Ignore:
Timestamp:
12/10/2012 06:58:14 PM (13 years ago)
Author:
AHWEBDEV
Message:

Fix comments cache

File:
1 edited

Legend:

Unmodified
Added
Removed
  • facebook-awd-seo-comments/trunk/inc/classes/class.AWD_facebook_comments_base.php

    r633274 r636700  
    183183    {
    184184        $this->comments_infos = get_transient($this->AWD_facebook->plugin_option_pref . 'cache_fb_comments_infos_' . $this->wp_post_id);
     185       
    185186        $this->comments_count = $this->comments_infos['comments_count'] > 0 ? $this->comments_infos['comments_count'] : 0;
     187       
    186188        $this->comments_id = $this->comments_infos['comments_id'] > 0 ? $this->comments_infos['comments_id'] : 0;
     189       
    187190        $this->comments_array = get_transient($this->AWD_facebook->plugin_option_pref . 'cache_fb_comments_array' . $this->wp_post_id);
    188         $this->comments_array = count($this->comments_array) > 0 ? $this->comments_array : array();
     191        $this->comments_array = count($this->comments_array) > 0 && is_array($this->comments_array) ? $this->comments_array : array();
     192
    189193        $this->comments_status = get_transient($this->AWD_facebook->plugin_option_pref . 'cache_fb_comments_status' . $this->wp_post_id);
    190194        $this->comments_status = $this->comments_status > 0 ? $this->comments_status : 0;
     
    203207            $action = $_REQUEST['action'];
    204208        if ($this->comments_url != '') {
    205             if ($this->wp_post_id != '') {
     209            if ($this->wp_post_id != '') {             
    206210                //know if we want cache comments or not
    207                 if ($this->AWD_facebook->options['seo_comments']['cache'] != "0" && $action != 'clear_fb_cache') {
     211                if ($this->AWD_facebook->options['seo_comments']['cache'] != "0" && $action != 'clear_fb_cache') {                     
    208212                    $this->get_comments_from_cache();
    209                     $must_fetch = $this->comments_status != 1 || ($this->comments_count > 0 && count($this->comments_array)) == 0;
     213                    $must_fetch = $this->comments_status != 1 || ($this->comments_count > 0  && count($this->comments_array)  == 0);
    210214                    if ($must_fetch) {
    211215                        $response = $this->get_comments_by_url();
Note: See TracChangeset for help on using the changeset viewer.