Plugin Directory

Changeset 3114618


Ignore:
Timestamp:
07/09/2024 01:08:03 AM (21 months ago)
Author:
expantours
Message:

api fix

Location:
expan-pro
Files:
13 added
2 edited

Legend:

Unmodified
Added
Removed
  • expan-pro/trunk/index.php

    r3077847 r3114618  
    44 * Plugin URI: https://www.expan.cl
    55 * Description: This plugin is designed to use the Expan Pro service associated with your user account created by Expan Tours.
    6  * Version: 2.4
     6 * Version: 2.5
    77 * Author: Expan Team
    88 * Text Domain: expanpro
     
    5252    {
    5353      $remote = wp_remote_get($url . '/api/share/trip_plan_api', $args);
    54       if(is_array( $remote ) && ! is_wp_error( $remote )){
    55         set_transient('expanpro-'.$attsstring, $remote, 3600*12);
     54      if(is_array($remote) && !is_wp_error($remote)){
     55          $body = wp_remote_retrieve_body($remote);
     56          $json_body = json_decode($body, true);
     57
     58          // Verificar que el cuerpo es un JSON válido
     59          if(json_last_error() === JSON_ERROR_NONE) {
     60              set_transient('expanpro-'.$attsstring, $remote, 3600*12);
     61          }
    5662      }
    5763      $response = $remote;
  • expan-pro/trunk/readme.txt

    r3077847 r3114618  
    8787== Changelog ==
    8888
     89= 2.5 =
     90* Fixed transcient when api fails
     91
    8992= 2.4 =
    9093* visual improvements (added vertical option)
Note: See TracChangeset for help on using the changeset viewer.