Changeset 3279299
- Timestamp:
- 04/22/2025 05:23:20 PM (11 months ago)
- Location:
- pitchprint/trunk
- Files:
-
- 1 added
- 3 edited
-
functions/general/customization.php (modified) (1 diff)
-
functions/general/emails.php (added)
-
pitchprint.php (modified) (2 diffs)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
pitchprint/trunk/functions/general/customization.php
r3275461 r3279299 26 26 function save_customization_data($product_id, $customization_data) { 27 27 $user_token = get_user_token(); 28 $transient_key = 'pitchprint_' . $user_token . '_' . $product_id; 29 30 delete_transient($transient_key); 31 $result = set_transient($transient_key, $customization_data, PITCHPRINT_CUSTOMIZATION_DURATION); 32 return $result !== FALSE ? $transient_key : FALSE; 28 $key = 'pitchprint_' . $user_token . '_' . $product_id; 29 30 // Try saving to transient first 31 delete_transient($key); 32 $transient_result = set_transient($key, $customization_data, PITCHPRINT_CUSTOMIZATION_DURATION); 33 34 // Also save to session as a backup 35 if (session_status() === PHP_SESSION_NONE) { 36 session_start(); 37 } 38 $_SESSION[$key] = $customization_data; 39 40 // Return the key if transient save was successful, otherwise FALSE 41 return $transient_result !== FALSE ? $key : FALSE; 33 42 } 34 43 35 44 function get_customization_data($product_id) { 36 45 $user_token = get_user_token(); 37 $ transient_key = 'pitchprint_' . $user_token . '_' . $product_id;46 $key = 'pitchprint_' . $user_token . '_' . $product_id; 38 47 39 return get_transient($transient_key); 48 // Try getting from transient first 49 $data = get_transient($key); 50 51 if ($data !== false) { 52 return $data; 53 } 54 55 // If transient failed or expired, try getting from session 56 if (session_status() === PHP_SESSION_NONE) { 57 session_start(); 58 } 59 60 if (isset($_SESSION[$key])) { 61 // Optionally, restore the transient if found in session 62 // set_transient($key, $_SESSION[$key], PITCHPRINT_CUSTOMIZATION_DURATION); 63 return $_SESSION[$key]; 64 } 65 66 return false; // Return false if not found in either 40 67 } 41 68 42 69 function delete_customization_data($product_id) { 43 70 $user_token = get_user_token(); 44 $transient_key = 'pitchprint_' . $user_token . '_' . $product_id; 45 46 delete_transient($transient_key); 71 $key = 'pitchprint_' . $user_token . '_' . $product_id; 72 73 // Delete from transient 74 delete_transient($key); 75 76 // Delete from session 77 if (session_status() === PHP_SESSION_NONE) { 78 session_start(); 79 } 80 if (isset($_SESSION[$key])) { 81 unset($_SESSION[$key]); 82 } 83 47 84 return TRUE; 48 85 } -
pitchprint/trunk/pitchprint.php
r3275740 r3279299 6 6 * Description: A beautiful web based print customization app for your online store. Integrates with WooCommerce. 7 7 * Author: PitchPrint, Inc. 8 * Version: 11.0. 68 * Version: 11.0.7 9 9 * Author URI: https://pitchprint.com 10 10 * Requires at least: 3.8 … … 47 47 * @var string 48 48 */ 49 public $version = '11.0. 6';49 public $version = '11.0.7'; 50 50 51 51 /** -
pitchprint/trunk/readme.txt
r3275740 r3279299 4 4 Requires at least: 3.8 5 5 Tested up to: 6.7 6 Stable tag: 11.0. 66 Stable tag: 11.0.7 7 7 License: GPLv2 or later 8 8 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 172 172 173 173 == Changelog == 174 175 == 11.0.7 = 176 Added session as backup for saving and retrieving customizations for sites where other plugins resets transient data 177 SVN now includes functions/general/email.php file 174 178 175 179 == 11.0.6 =
Note: See TracChangeset
for help on using the changeset viewer.