Plugin Directory

Changeset 3446623


Ignore:
Timestamp:
01/25/2026 05:29:39 PM (2 months ago)
Author:
fahdi
Message:

Release v3.5.2 - HTTP Request Standardization: Fixes 'JSON links not working' customer issue with unified HTTP handling

Location:
tablecrafter-wp-data-tables
Files:
4 added
4 edited
14 copied

Legend:

Unmodified
Added
Removed
  • tablecrafter-wp-data-tables/tags/3.5.2/includes/class-tc-cache.php

    r3445250 r3446623  
    4141
    4242    /**
     43     * HTTP request handler
     44     * @var TC_HTTP_Request
     45     */
     46    private $http;
     47
     48    /**
    4349     * Get singleton instance
    4450     *
     
    5864    private function __construct()
    5965    {
     66        if (class_exists('TC_HTTP_Request')) {
     67            $this->http = TC_HTTP_Request::get_instance();
     68        }
    6069    }
    6170
     
    250259
    251260        foreach ($urls as $url) {
    252             $response = wp_remote_get($url, array('timeout' => 10));
    253             if (!is_wp_error($response)) {
    254                 $body = wp_remote_retrieve_body($response);
    255                 $data = json_decode($body, true);
    256                 if ($data && json_last_error() === JSON_ERROR_NONE) {
     261            if ($this->http) {
     262                $result = $this->http->request($url, TC_HTTP_Request::TYPE_CACHE_WARMUP);
     263                if (!is_wp_error($result)) {
    257264                    $cache_key = $this->get_data_cache_key($url);
    258                     $this->set_data_cache($cache_key, $data);
     265                    $this->set_data_cache($cache_key, $result);
    259266                    $warmed++;
    260267                }
     268            } else {
     269                // Fallback to wp_remote_get if HTTP handler not available
     270                $response = wp_remote_get($url, array('timeout' => 10));
     271                if (!is_wp_error($response)) {
     272                    $body = wp_remote_retrieve_body($response);
     273                    $data = json_decode($body, true);
     274                    if ($data && json_last_error() === JSON_ERROR_NONE) {
     275                        $cache_key = $this->get_data_cache_key($url);
     276                        $this->set_data_cache($cache_key, $data);
     277                        $warmed++;
     278                    }
     279                }
    261280            }
    262281        }
  • tablecrafter-wp-data-tables/tags/3.5.2/includes/class-tc-data-fetcher.php

    r3445250 r3446623  
    3838
    3939    /**
     40     * HTTP request handler
     41     * @var TC_HTTP_Request
     42     */
     43    private $http;
     44
     45    /**
    4046     * Get singleton instance
    4147     *
     
    5763        $this->security = TC_Security::get_instance();
    5864        $this->cache = TC_Cache::get_instance();
     65        $this->http = TC_HTTP_Request::get_instance();
    5966    }
    6067
     
    275282
    276283    /**
    277      * Fetch JSON data from remote URL
     284     * Fetch JSON data from remote URL using unified HTTP request handler
    278285     *
    279286     * @param string $url Remote URL
     
    282289    private function fetch_remote_json(string $url)
    283290    {
    284         $ch = curl_init();
    285         curl_setopt($ch, CURLOPT_URL, $url);
    286         curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    287         curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
    288         curl_setopt($ch, CURLOPT_TIMEOUT, 30);
    289         curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 10);
    290 
    291         // SSL verification enabled for security
    292         curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, true);
    293         curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
    294 
    295         // Use WordPress bundled CA certificates if available
    296         $ca_bundle = ABSPATH . WPINC . '/certificates/ca-bundle.crt';
    297         if (file_exists($ca_bundle)) {
    298             curl_setopt($ch, CURLOPT_CAINFO, $ca_bundle);
    299         }
    300 
    301         curl_setopt($ch, CURLOPT_USERAGENT, 'TableCrafter/' . TABLECRAFTER_VERSION . ' (WordPress Plugin)');
    302         curl_setopt($ch, CURLOPT_COOKIEFILE, "");
    303 
    304         $body = curl_exec($ch);
    305         $code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
    306         $error = curl_error($ch);
    307         curl_close($ch);
    308 
    309         if ($body === false) {
    310             $this->log_error('CURL Fetch Failed', array('url' => $url, 'error' => $error));
    311             return new WP_Error('http_error', 'CURL Error: ' . $error);
    312         }
    313 
    314         if ($code !== 200) {
    315             $this->log_error('HTTP Error Code', array('url' => $url, 'code' => $code));
    316             return new WP_Error('http_error', 'Source returned HTTP ' . $code);
    317         }
    318 
    319         $data = json_decode($body, true);
    320 
    321         if (json_last_error() !== JSON_ERROR_NONE) {
    322             $this->log_error('JSON Parse Error', array('url' => $url, 'error' => json_last_error_msg()));
    323             return new WP_Error('json_error', 'The source did not return a valid JSON structure.');
    324         }
    325 
    326         return $data;
     291        return $this->http->request($url, TC_HTTP_Request::TYPE_DATA_FETCH);
    327292    }
    328293
  • tablecrafter-wp-data-tables/tags/3.5.2/readme.txt

    r3445253 r3446623  
    44Requires at least: 5.0
    55Tested up to: 6.9
    6 Stable tag: 3.5.1
     6Stable tag: 3.5.2
    77Requires PHP: 7.4
    88License: GPLv2 or later
     
    1717[Try Live Demo](https://tastewp.org/plugins/tablecrafter-wp-data-tables)
    1818
    19 ### 🔮 NEW: Native Airtable Integration (v3.5+)
    20 
    21 **🔌 CONNECT DIRECTLY TO AIRTABLE** - Connect any Airtable Base using a secure Personal Access Token (PAT). No third-party connectors or Zapier needed! Simply enter your Base ID and Table Name to instantly visualize your data.
    22 
    23 **🔒 SECURE TOKEN HANDLING** - Enterprise-grade security ensures your API tokens are encrypted (using WordPress salts) and never exposed to the frontend. Data is fetched server-side via a secure proxy.
    24 
    25 **⚡ 5-MINUTE INTELLIGENT CACHING** - Built-in caching layer (5-minute TTL) ensures you never hit Airtable's 5 requests/second rate limit, guaranteeing 100% uptime for your data tables even under high traffic.
    26 
    27 **👆 AUTO-PAGINATION** - Automatically handles Airtable's 100-record pagination limit to fetch all your data seamlessly.
    28 
    29 ### 🛡️ Enterprise Security Architecture (v3.4.0)
    30 
    31 **🔒 BANK-GRADE PROTECTION** - Completely re-architected security layer with strict SSRF protection, preventing internal network scanning.
    32 **🔑 NONCE HARDENING** - All Admin & AJAX operations are protected by enhanced cryptographic nonces.
    33 **🛡️ XSS PREVENTION** - Advanced sanitization for all outputs (HTML, URLs, Attributes) ensures data safety.
    34 
    35 ### 📱 Mobile & Accessibility Core (v3.2.0)
    36 
    37 **🎯 RESPONSIVE DESIGN** - Mobile-first architecture adapts tables to card layouts on small screens.
    38 **👆 TOUCH GESTURES** - Native swipe interactions for mobile cards.
    39 **♿ WCAG 2.1 AA** - Full accessibility compliance for government/enterprise use.
    40 
    41 ### 🎨 Elementor Live Preview (v3.1.0)
    42 
    43 **👁️ TRUE WYSIWYG** - The *only* table plugin with real-time data preview inside Elementor.
    44 **⚡ INSTANT FEEDBACK** - See search, filters, and styles update instantly while you design.
     19### 📱 NEW: Mobile-First Excellence (v3.2.0)
     20
     21**🎯 MOBILE-FIRST RESPONSIVE DESIGN** - Complete mobile-first architecture with card-based layouts optimized for mobile devices. Seamlessly adapts from 320px mobile screens to 4K desktops with intelligent breakpoint system (≤768px mobile, 768-900px tablet, >900px desktop).
     22
     23**👆 TOUCH GESTURE SYSTEM** - Intuitive swipe gestures for mobile card interactions. Right swipe to expand/collapse, left swipe for quick actions, with visual feedback and haptic support on supported devices. The only WordPress table plugin with native touch gesture support.
     24
     25**♿ WCAG 2.1 AA ACCESSIBILITY COMPLIANCE** - Full accessibility compliance with 44px minimum touch targets, semantic ARIA labels, screen reader optimization, high contrast support, and comprehensive keyboard navigation. Perfect for enterprises and government organizations requiring strict accessibility standards compliance.
     26
     27**⚡ MOBILE PERFORMANCE OPTIMIZED** - 40%+ performance improvement on mobile devices with <150ms touch response times. Reduced memory footprint and optimized rendering for smooth 60fps interactions on all mobile devices.
    4528
    4629### 🚀 Why TableCrafter is the Best WordPress Table Plugin
     
    299282
    300283== Changelog ==
     284
     285= 3.5.2 - January 25, 2026 =
     286* **MAJOR FIX:** HTTP Request Standardization - Unified HTTP handling eliminates "JSON links not working" customer complaints
     287* **Improvement:** Consistent timeout values across all data sources (30s for data fetching, 10s for health checks)
     288* **Improvement:** Unified retry logic with exponential backoff for better reliability
     289* **Improvement:** Enhanced error handling and logging consistency
     290* **Enhancement:** Added comprehensive HTTP request statistics and monitoring
     291* **Developer:** New TC_HTTP_Request class provides standardized API for all HTTP operations
     292* **Testing:** Comprehensive test suite validates HTTP request reliability
     293* **Business Impact:** Resolves intermittent data fetching failures that caused customer churn
     294
    301295= 3.4.0 =
    302296* 🔒 **SECURITY & ARCHITECTURE IMPROVEMENTS**
  • tablecrafter-wp-data-tables/tags/3.5.2/tablecrafter.php

    r3445250 r3446623  
    44 * Plugin URI: https://github.com/TableCrafter/wp-data-tables
    55 * Description: Transform any data source into responsive WordPress tables. WCAG 2.1 compliant, advanced export (Excel/PDF), keyboard navigation, screen readers.
    6  * Version: 3.5.1
     6 * Version: 3.5.2
    77 * Author: TableCrafter Team
    88 * Author URI: https://github.com/fahdi
     
    1919 * Global Constants
    2020 */
    21 define('TABLECRAFTER_VERSION', '3.5.1');
     21define('TABLECRAFTER_VERSION', '3.5.2');
    2222define('TABLECRAFTER_URL', plugin_dir_url(__FILE__));
    2323define('TABLECRAFTER_PATH', plugin_dir_path(__FILE__));
     
    4040}
    4141
     42// HTTP Request handler (load before data fetcher as it depends on it)
     43if (file_exists(TABLECRAFTER_PATH . 'includes/class-tc-http-request.php')) {
     44    require_once TABLECRAFTER_PATH . 'includes/class-tc-http-request.php';
     45}
     46
    4247if (file_exists(TABLECRAFTER_PATH . 'includes/class-tc-data-fetcher.php')) {
    4348    require_once TABLECRAFTER_PATH . 'includes/class-tc-data-fetcher.php';
     
    8691     */
    8792    private static $instance = null;
     93
     94    /**
     95     * HTTP request handler
     96     * @var TC_HTTP_Request
     97     */
     98    private $http;
    8899
    89100
     
    15531564    {
    15541565        $urls = get_option('tc_tracked_urls', array());
     1566       
     1567        // Initialize HTTP handler if not already done
     1568        if (!$this->http && class_exists('TC_HTTP_Request')) {
     1569            $this->http = TC_HTTP_Request::get_instance();
     1570        }
     1571       
    15551572        foreach ($urls as $url) {
    1556             $response = wp_remote_get($url, array('timeout' => 10));
    1557             if (!is_wp_error($response)) {
    1558                 $body = wp_remote_retrieve_body($response);
    1559                 $data = json_decode($body);
    1560                 if ($data) {
    1561                     set_transient('tc_cache_' . md5($url), $data, HOUR_IN_SECONDS);
     1573            if ($this->http) {
     1574                $result = $this->http->request($url, TC_HTTP_Request::TYPE_CACHE_WARMUP);
     1575                if (!is_wp_error($result)) {
     1576                    set_transient('tc_cache_' . md5($url), $result, HOUR_IN_SECONDS);
     1577                }
     1578            } else {
     1579                // Fallback to wp_remote_get if HTTP handler not available
     1580                $response = wp_remote_get($url, array('timeout' => 10));
     1581                if (!is_wp_error($response)) {
     1582                    $body = wp_remote_retrieve_body($response);
     1583                    $data = json_decode($body);
     1584                    if ($data) {
     1585                        set_transient('tc_cache_' . md5($url), $data, HOUR_IN_SECONDS);
     1586                    }
    15621587                }
    15631588            }
  • tablecrafter-wp-data-tables/trunk/includes/class-tc-cache.php

    r3445250 r3446623  
    4141
    4242    /**
     43     * HTTP request handler
     44     * @var TC_HTTP_Request
     45     */
     46    private $http;
     47
     48    /**
    4349     * Get singleton instance
    4450     *
     
    5864    private function __construct()
    5965    {
     66        if (class_exists('TC_HTTP_Request')) {
     67            $this->http = TC_HTTP_Request::get_instance();
     68        }
    6069    }
    6170
     
    250259
    251260        foreach ($urls as $url) {
    252             $response = wp_remote_get($url, array('timeout' => 10));
    253             if (!is_wp_error($response)) {
    254                 $body = wp_remote_retrieve_body($response);
    255                 $data = json_decode($body, true);
    256                 if ($data && json_last_error() === JSON_ERROR_NONE) {
     261            if ($this->http) {
     262                $result = $this->http->request($url, TC_HTTP_Request::TYPE_CACHE_WARMUP);
     263                if (!is_wp_error($result)) {
    257264                    $cache_key = $this->get_data_cache_key($url);
    258                     $this->set_data_cache($cache_key, $data);
     265                    $this->set_data_cache($cache_key, $result);
    259266                    $warmed++;
    260267                }
     268            } else {
     269                // Fallback to wp_remote_get if HTTP handler not available
     270                $response = wp_remote_get($url, array('timeout' => 10));
     271                if (!is_wp_error($response)) {
     272                    $body = wp_remote_retrieve_body($response);
     273                    $data = json_decode($body, true);
     274                    if ($data && json_last_error() === JSON_ERROR_NONE) {
     275                        $cache_key = $this->get_data_cache_key($url);
     276                        $this->set_data_cache($cache_key, $data);
     277                        $warmed++;
     278                    }
     279                }
    261280            }
    262281        }
  • tablecrafter-wp-data-tables/trunk/includes/class-tc-data-fetcher.php

    r3445250 r3446623  
    3838
    3939    /**
     40     * HTTP request handler
     41     * @var TC_HTTP_Request
     42     */
     43    private $http;
     44
     45    /**
    4046     * Get singleton instance
    4147     *
     
    5763        $this->security = TC_Security::get_instance();
    5864        $this->cache = TC_Cache::get_instance();
     65        $this->http = TC_HTTP_Request::get_instance();
    5966    }
    6067
     
    275282
    276283    /**
    277      * Fetch JSON data from remote URL
     284     * Fetch JSON data from remote URL using unified HTTP request handler
    278285     *
    279286     * @param string $url Remote URL
     
    282289    private function fetch_remote_json(string $url)
    283290    {
    284         $ch = curl_init();
    285         curl_setopt($ch, CURLOPT_URL, $url);
    286         curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    287         curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
    288         curl_setopt($ch, CURLOPT_TIMEOUT, 30);
    289         curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 10);
    290 
    291         // SSL verification enabled for security
    292         curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, true);
    293         curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
    294 
    295         // Use WordPress bundled CA certificates if available
    296         $ca_bundle = ABSPATH . WPINC . '/certificates/ca-bundle.crt';
    297         if (file_exists($ca_bundle)) {
    298             curl_setopt($ch, CURLOPT_CAINFO, $ca_bundle);
    299         }
    300 
    301         curl_setopt($ch, CURLOPT_USERAGENT, 'TableCrafter/' . TABLECRAFTER_VERSION . ' (WordPress Plugin)');
    302         curl_setopt($ch, CURLOPT_COOKIEFILE, "");
    303 
    304         $body = curl_exec($ch);
    305         $code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
    306         $error = curl_error($ch);
    307         curl_close($ch);
    308 
    309         if ($body === false) {
    310             $this->log_error('CURL Fetch Failed', array('url' => $url, 'error' => $error));
    311             return new WP_Error('http_error', 'CURL Error: ' . $error);
    312         }
    313 
    314         if ($code !== 200) {
    315             $this->log_error('HTTP Error Code', array('url' => $url, 'code' => $code));
    316             return new WP_Error('http_error', 'Source returned HTTP ' . $code);
    317         }
    318 
    319         $data = json_decode($body, true);
    320 
    321         if (json_last_error() !== JSON_ERROR_NONE) {
    322             $this->log_error('JSON Parse Error', array('url' => $url, 'error' => json_last_error_msg()));
    323             return new WP_Error('json_error', 'The source did not return a valid JSON structure.');
    324         }
    325 
    326         return $data;
     291        return $this->http->request($url, TC_HTTP_Request::TYPE_DATA_FETCH);
    327292    }
    328293
  • tablecrafter-wp-data-tables/trunk/readme.txt

    r3445253 r3446623  
    44Requires at least: 5.0
    55Tested up to: 6.9
    6 Stable tag: 3.5.1
     6Stable tag: 3.5.2
    77Requires PHP: 7.4
    88License: GPLv2 or later
     
    1717[Try Live Demo](https://tastewp.org/plugins/tablecrafter-wp-data-tables)
    1818
    19 ### 🔮 NEW: Native Airtable Integration (v3.5+)
    20 
    21 **🔌 CONNECT DIRECTLY TO AIRTABLE** - Connect any Airtable Base using a secure Personal Access Token (PAT). No third-party connectors or Zapier needed! Simply enter your Base ID and Table Name to instantly visualize your data.
    22 
    23 **🔒 SECURE TOKEN HANDLING** - Enterprise-grade security ensures your API tokens are encrypted (using WordPress salts) and never exposed to the frontend. Data is fetched server-side via a secure proxy.
    24 
    25 **⚡ 5-MINUTE INTELLIGENT CACHING** - Built-in caching layer (5-minute TTL) ensures you never hit Airtable's 5 requests/second rate limit, guaranteeing 100% uptime for your data tables even under high traffic.
    26 
    27 **👆 AUTO-PAGINATION** - Automatically handles Airtable's 100-record pagination limit to fetch all your data seamlessly.
    28 
    29 ### 🛡️ Enterprise Security Architecture (v3.4.0)
    30 
    31 **🔒 BANK-GRADE PROTECTION** - Completely re-architected security layer with strict SSRF protection, preventing internal network scanning.
    32 **🔑 NONCE HARDENING** - All Admin & AJAX operations are protected by enhanced cryptographic nonces.
    33 **🛡️ XSS PREVENTION** - Advanced sanitization for all outputs (HTML, URLs, Attributes) ensures data safety.
    34 
    35 ### 📱 Mobile & Accessibility Core (v3.2.0)
    36 
    37 **🎯 RESPONSIVE DESIGN** - Mobile-first architecture adapts tables to card layouts on small screens.
    38 **👆 TOUCH GESTURES** - Native swipe interactions for mobile cards.
    39 **♿ WCAG 2.1 AA** - Full accessibility compliance for government/enterprise use.
    40 
    41 ### 🎨 Elementor Live Preview (v3.1.0)
    42 
    43 **👁️ TRUE WYSIWYG** - The *only* table plugin with real-time data preview inside Elementor.
    44 **⚡ INSTANT FEEDBACK** - See search, filters, and styles update instantly while you design.
     19### 📱 NEW: Mobile-First Excellence (v3.2.0)
     20
     21**🎯 MOBILE-FIRST RESPONSIVE DESIGN** - Complete mobile-first architecture with card-based layouts optimized for mobile devices. Seamlessly adapts from 320px mobile screens to 4K desktops with intelligent breakpoint system (≤768px mobile, 768-900px tablet, >900px desktop).
     22
     23**👆 TOUCH GESTURE SYSTEM** - Intuitive swipe gestures for mobile card interactions. Right swipe to expand/collapse, left swipe for quick actions, with visual feedback and haptic support on supported devices. The only WordPress table plugin with native touch gesture support.
     24
     25**♿ WCAG 2.1 AA ACCESSIBILITY COMPLIANCE** - Full accessibility compliance with 44px minimum touch targets, semantic ARIA labels, screen reader optimization, high contrast support, and comprehensive keyboard navigation. Perfect for enterprises and government organizations requiring strict accessibility standards compliance.
     26
     27**⚡ MOBILE PERFORMANCE OPTIMIZED** - 40%+ performance improvement on mobile devices with <150ms touch response times. Reduced memory footprint and optimized rendering for smooth 60fps interactions on all mobile devices.
    4528
    4629### 🚀 Why TableCrafter is the Best WordPress Table Plugin
     
    299282
    300283== Changelog ==
     284
     285= 3.5.2 - January 25, 2026 =
     286* **MAJOR FIX:** HTTP Request Standardization - Unified HTTP handling eliminates "JSON links not working" customer complaints
     287* **Improvement:** Consistent timeout values across all data sources (30s for data fetching, 10s for health checks)
     288* **Improvement:** Unified retry logic with exponential backoff for better reliability
     289* **Improvement:** Enhanced error handling and logging consistency
     290* **Enhancement:** Added comprehensive HTTP request statistics and monitoring
     291* **Developer:** New TC_HTTP_Request class provides standardized API for all HTTP operations
     292* **Testing:** Comprehensive test suite validates HTTP request reliability
     293* **Business Impact:** Resolves intermittent data fetching failures that caused customer churn
     294
    301295= 3.4.0 =
    302296* 🔒 **SECURITY & ARCHITECTURE IMPROVEMENTS**
  • tablecrafter-wp-data-tables/trunk/tablecrafter.php

    r3445250 r3446623  
    44 * Plugin URI: https://github.com/TableCrafter/wp-data-tables
    55 * Description: Transform any data source into responsive WordPress tables. WCAG 2.1 compliant, advanced export (Excel/PDF), keyboard navigation, screen readers.
    6  * Version: 3.5.1
     6 * Version: 3.5.2
    77 * Author: TableCrafter Team
    88 * Author URI: https://github.com/fahdi
     
    1919 * Global Constants
    2020 */
    21 define('TABLECRAFTER_VERSION', '3.5.1');
     21define('TABLECRAFTER_VERSION', '3.5.2');
    2222define('TABLECRAFTER_URL', plugin_dir_url(__FILE__));
    2323define('TABLECRAFTER_PATH', plugin_dir_path(__FILE__));
     
    4040}
    4141
     42// HTTP Request handler (load before data fetcher as it depends on it)
     43if (file_exists(TABLECRAFTER_PATH . 'includes/class-tc-http-request.php')) {
     44    require_once TABLECRAFTER_PATH . 'includes/class-tc-http-request.php';
     45}
     46
    4247if (file_exists(TABLECRAFTER_PATH . 'includes/class-tc-data-fetcher.php')) {
    4348    require_once TABLECRAFTER_PATH . 'includes/class-tc-data-fetcher.php';
     
    8691     */
    8792    private static $instance = null;
     93
     94    /**
     95     * HTTP request handler
     96     * @var TC_HTTP_Request
     97     */
     98    private $http;
    8899
    89100
     
    15531564    {
    15541565        $urls = get_option('tc_tracked_urls', array());
     1566       
     1567        // Initialize HTTP handler if not already done
     1568        if (!$this->http && class_exists('TC_HTTP_Request')) {
     1569            $this->http = TC_HTTP_Request::get_instance();
     1570        }
     1571       
    15551572        foreach ($urls as $url) {
    1556             $response = wp_remote_get($url, array('timeout' => 10));
    1557             if (!is_wp_error($response)) {
    1558                 $body = wp_remote_retrieve_body($response);
    1559                 $data = json_decode($body);
    1560                 if ($data) {
    1561                     set_transient('tc_cache_' . md5($url), $data, HOUR_IN_SECONDS);
     1573            if ($this->http) {
     1574                $result = $this->http->request($url, TC_HTTP_Request::TYPE_CACHE_WARMUP);
     1575                if (!is_wp_error($result)) {
     1576                    set_transient('tc_cache_' . md5($url), $result, HOUR_IN_SECONDS);
     1577                }
     1578            } else {
     1579                // Fallback to wp_remote_get if HTTP handler not available
     1580                $response = wp_remote_get($url, array('timeout' => 10));
     1581                if (!is_wp_error($response)) {
     1582                    $body = wp_remote_retrieve_body($response);
     1583                    $data = json_decode($body);
     1584                    if ($data) {
     1585                        set_transient('tc_cache_' . md5($url), $data, HOUR_IN_SECONDS);
     1586                    }
    15621587                }
    15631588            }
Note: See TracChangeset for help on using the changeset viewer.