| 679 | | // shouldn't these be using get_option() ? |
|---|
| 680 | | if ( !$wpdb->get_var( $wpdb->prepare( "SELECT option_name FROM $wpdb->options WHERE option_name = %s", $cache_option ) ) ) |
|---|
| 681 | | add_option($cache_option, '', '', 'no'); |
|---|
| 682 | | if ( !$wpdb->get_var( $wpdb->prepare( "SELECT option_name FROM $wpdb->options WHERE option_name = %s", $cache_timestamp ) ) ) |
|---|
| 683 | | add_option($cache_timestamp, '', '', 'no'); |
|---|
| 684 | | |
|---|
| 685 | | update_option($cache_option, $rss); |
|---|
| 686 | | update_option($cache_timestamp, time() ); |
|---|
| | 679 | if( $wp_object_cache->cache_enabled ) { |
|---|
| | 680 | wp_cache_set( $cache_option, $rss, 'site-options' ); |
|---|
| | 681 | wp_cache_set( $cache_timestamp, $cache_timestamp, 'site-options' ); |
|---|
| | 682 | } else { |
|---|
| | 683 | if( !get_site_option( $cache_option ) ) |
|---|
| | 684 | add_site_option( $cache_option, $rss ); |
|---|
| | 685 | if( !get_site_option( $cache_timestamp ) ) |
|---|
| | 686 | add_site_option( $cache_timestamp, $cache_timestamp ); |
|---|
| | 687 | } |
|---|
| 701 | | if ( ! get_option( $cache_option ) ) { |
|---|
| 702 | | $this->debug( |
|---|
| 703 | | "Cache doesn't contain: $url (cache option: $cache_option)" |
|---|
| 704 | | ); |
|---|
| 705 | | return 0; |
|---|
| 706 | | } |
|---|
| 707 | | |
|---|
| 708 | | $rss = get_option( $cache_option ); |
|---|
| 709 | | |
|---|
| 710 | | return $rss; |
|---|
| | 703 | if( $wp_object_cache->cache_enabled ) { |
|---|
| | 704 | if( ! wp_cache_get( $cache_option, 'site-options' ) ) { |
|---|
| | 705 | $this->debug( "Cache doesn't contain: $url (cache option: $cache_option)" ); |
|---|
| | 706 | return 0; |
|---|
| | 707 | } |
|---|
| | 708 | return wp_cache_get( $cache_option, 'site-options' ); |
|---|
| | 709 | } else { |
|---|
| | 710 | if ( ! get_option( $cache_option ) ) { |
|---|
| | 711 | $this->debug( "Cache doesn't contain: $url (cache option: $cache_option)" ); |
|---|
| | 712 | return 0; |
|---|
| | 713 | } |
|---|
| | 714 | return get_option( $cache_option ); |
|---|
| | 715 | } |
|---|