Changeset 3404303
- Timestamp:
- 11/27/2025 05:29:06 PM (4 months ago)
- Location:
- gratisfaction-all-in-one-loyalty-contests-referral-program-for-woocommerce/trunk
- Files:
-
- 2 edited
-
grconnect.php (modified) (6 diffs)
-
readme.txt (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
gratisfaction-all-in-one-loyalty-contests-referral-program-for-woocommerce/trunk/grconnect.php
r3398568 r3404303 3 3 /** 4 4 * @package Gratisfaction Connect 5 * @version 4.5. 35 * @version 4.5.4 6 6 */ 7 7 /* … … 9 9 Plugin URI: http://appsmav.com 10 10 Description: Loyalty + Referral + Rewards + Birthdays and Anniversaries + Giveaways + Sweepstakes. 11 Version: 4.5. 311 Version: 4.5.4 12 12 Author: Appsmav 13 13 Author URI: http://appsmav.com … … 47 47 const REDEEM_COUPON = 'GRPAYPOINTS'; 48 48 49 public static $_plugin_version = '4.5. 3';49 public static $_plugin_version = '4.5.4'; 50 50 public static $_callback_url = 'https://gratisfaction.appsmav.com/'; 51 51 public static $_api_version = 'newapi/v2/'; … … 4034 4034 4035 4035 /** 4036 * Sanitize refund data to handle WC_DateTime objects and other non-serializable data 4036 * Sanitize refund data to handle WC_DateTime objects and other non-serializable data Works on PHP 5.4+ 4037 4037 */ 4038 4038 public static function sanitize_refund_data_for_api($data) { … … 4040 4040 foreach ($data as $key => $value) { 4041 4041 if (is_object($value)) { 4042 // Handle WC_DateTime objects 4043 if (is_a($value, 'WC_DateTime')) { 4044 $data[$key] = $value->format('c'); // ISO 8601 format 4045 } 4046 // Handle other WooCommerce objects 4047 elseif (method_exists($value, 'get_data')) { 4048 $data[$key] = self::sanitize_refund_data_for_api($value->get_data()); 4049 } 4050 // Handle other objects by converting to string 4051 else { 4052 $data[$key] = (string) $value; 4042 try { 4043 // Handle WC_DateTime objects 4044 if ($value instanceof WC_DateTime) { 4045 $data[$key] = $value->format('c'); // ISO 8601 format 4046 } 4047 // Handle stdClass objects 4048 elseif ($value instanceof stdClass) { 4049 $data[$key] = self::sanitize_refund_data_for_api(get_object_vars($value)); 4050 } 4051 // Handle WooCommerce data objects 4052 elseif (method_exists($value, 'get_data')) { 4053 $data[$key] = self::sanitize_refund_data_for_api($value->get_data()); 4054 } 4055 // Handle objects with __toString method 4056 elseif (method_exists($value, '__toString')) { 4057 $data[$key] = (string) $value; 4058 } 4059 // Fallback for any other object 4060 else { 4061 $data[$key] = '[Object: ' . get_class($value) . ']'; 4062 } 4063 } catch (Exception $e) { 4064 // Catches Exception in PHP 5.4+ 4065 $data[$key] = '[Object: ' . get_class($value) . ']'; 4066 } catch (Error $e) { 4067 // Catches Error in PHP 7.0+ (TypeError, etc.) 4068 $data[$key] = '[Object: ' . get_class($value) . ']'; 4053 4069 } 4054 4070 } … … 4058 4074 } 4059 4075 } 4076 4060 4077 return $data; 4061 4078 } 4079 4062 4080 }// END class GR_Connect 4063 4081 } // END if(!class_exists('GR_Connect')) -
gratisfaction-all-in-one-loyalty-contests-referral-program-for-woocommerce/trunk/readme.txt
r3398568 r3404303 5 5 Requires at least: 3.0.1 6 6 Tested up to: 6.8 7 Stable tag: 4.5. 37 Stable tag: 4.5.4 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 254 254 255 255 == Changelog == 256 = 4.5.4 = 257 Improvements and bug fixes 258 256 259 = 4.5.3 = 257 260 Improvements and bug fixes … … 623 626 624 627 == Upgrade Notice == 625 = 4.5. 3=626 Improvements and bug fixes 628 = 4.5.4 = 629 Improvements and bug fixes
Note: See TracChangeset
for help on using the changeset viewer.