Changeset 3310464
- Timestamp:
- 06/12/2025 11:31:26 AM (10 months ago)
- Location:
- recras
- Files:
-
- 22 edited
- 1 copied
-
tags/6.3.6 (copied) (copied from recras/trunk)
-
tags/6.3.6/changelog.md (modified) (1 diff)
-
tags/6.3.6/readme.txt (modified) (2 diffs)
-
tags/6.3.6/recras-wordpress-plugin.php (modified) (1 diff)
-
tags/6.3.6/src/Arrangement.php (modified) (6 diffs)
-
tags/6.3.6/src/Bookprocess.php (modified) (3 diffs)
-
tags/6.3.6/src/ContactForm.php (modified) (7 diffs)
-
tags/6.3.6/src/Plugin.php (modified) (4 diffs)
-
tags/6.3.6/src/Products.php (modified) (3 diffs)
-
tags/6.3.6/src/Settings.php (modified) (3 diffs)
-
tags/6.3.6/src/Transient.php (modified) (3 diffs)
-
tags/6.3.6/src/Vouchers.php (modified) (3 diffs)
-
trunk/changelog.md (modified) (1 diff)
-
trunk/readme.txt (modified) (2 diffs)
-
trunk/recras-wordpress-plugin.php (modified) (1 diff)
-
trunk/src/Arrangement.php (modified) (6 diffs)
-
trunk/src/Bookprocess.php (modified) (3 diffs)
-
trunk/src/ContactForm.php (modified) (7 diffs)
-
trunk/src/Plugin.php (modified) (4 diffs)
-
trunk/src/Products.php (modified) (3 diffs)
-
trunk/src/Settings.php (modified) (3 diffs)
-
trunk/src/Transient.php (modified) (3 diffs)
-
trunk/src/Vouchers.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
recras/tags/6.3.6/changelog.md
r3306911 r3310464 1 1 # Changelog 2 3 ## 6.3.6 (2025-06-12) 4 * Fix errors when using WP CLI for certain things 2 5 3 6 ## 6.3.5 (2025-06-05) -
recras/tags/6.3.6/readme.txt
r3306911 r3310464 3 3 Tags: recras, recreation, reservation, booking, voucher 4 4 Tested up to: 6.8 5 Stable tag: 6.3. 55 Stable tag: 6.3.6 6 6 License: GPLv2 or later 7 7 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 75 75 == Changelog == 76 76 77 = 6.3.6 = 78 * Fix errors when using WP CLI for certain things 79 77 80 = 6.3.5 = 78 81 * Fix warning when using PHP 8.4 -
recras/tags/6.3.6/recras-wordpress-plugin.php
r3306911 r3310464 3 3 Plugin Name: Recras WordPress Plugin 4 4 Plugin URI: https://www.recras.nl/ 5 Version: 6.3. 55 Version: 6.3.6 6 6 Description: Easily integrate your Recras data into your own site 7 7 Requires at least: 6.6 -
recras/tags/6.3.6/src/Arrangement.php
r3217607 r3310464 96 96 public static function clearCache(): int 97 97 { 98 global $recrasPlugin;99 100 98 $subdomain = get_option('recras_subdomain'); 101 99 $errors = 0; … … 104 102 foreach ($packages as $id) { 105 103 $name = $subdomain . '_arrangement_' . $id; 106 if ( $recrasPlugin->transients->get($name)) {107 $errors += $recrasPlugin->transients->delete($name);108 } 109 } 110 $errors += $recrasPlugin->transients->delete($subdomain . '_arrangements');104 if (Transient::get($name)) { 105 $errors += Transient::delete($name); 106 } 107 } 108 $errors += Transient::delete($subdomain . '_arrangements'); 111 109 112 110 return $errors; … … 238 236 public static function getPackages(string $subdomain, bool $onlyOnline = false, bool $includeEmpty = true) 239 237 { 240 global $recrasPlugin; 241 242 $json = $recrasPlugin->transients->get($subdomain . '_arrangements'); 238 $json = Transient::get($subdomain . '_arrangements'); 243 239 if ($json === false) { 244 240 try { … … 247 243 return $e->getMessage(); 248 244 } 249 $recrasPlugin->transients->set($subdomain . '_arrangements', $json);245 Transient::set($subdomain . '_arrangements', $json); 250 246 } 251 247 … … 364 360 public static function getPackage(string $subdomain, int $id) 365 361 { 366 global $recrasPlugin; 367 368 $json = $recrasPlugin->transients->get($subdomain . '_arrangement_' . $id); 362 $json = Transient::get($subdomain . '_arrangement_' . $id); 369 363 if ($json === false) { 370 364 try { … … 373 367 return $e->getMessage(); 374 368 } 375 $recrasPlugin->transients->set($subdomain . '_arrangement_' . $id, $json);369 Transient::set($subdomain . '_arrangement_' . $id, $json); 376 370 } 377 371 return $json; -
recras/tags/6.3.6/src/Bookprocess.php
r3268913 r3310464 11 11 public static function clearCache(): int 12 12 { 13 global $recrasPlugin;14 15 13 $subdomain = get_option('recras_subdomain'); 16 return $recrasPlugin->transients->delete($subdomain . '_bookprocesses_v2');14 return Transient::delete($subdomain . '_bookprocesses_v2'); 17 15 } 18 16 … … 38 36 public static function getProcesses(string $subdomain) 39 37 { 40 global $recrasPlugin; 41 42 $json = $recrasPlugin->transients->get($subdomain . '_bookprocesses_v2'); 38 $json = Transient::get($subdomain . '_bookprocesses_v2'); 43 39 if ($json === false) { 44 40 try { … … 47 43 return $e->getMessage(); 48 44 } 49 $recrasPlugin->transients->set($subdomain . '_bookprocesses_v2', $json);45 Transient::set($subdomain . '_bookprocesses_v2', $json); 50 46 } 51 47 -
recras/tags/6.3.6/src/ContactForm.php
r3217607 r3310464 26 26 public static function getForm(string $subdomain, int $id) 27 27 { 28 global $recrasPlugin; 29 30 $form = $recrasPlugin->transients->get($subdomain . '_contactform_' . $id . '_v2'); 28 $form = Transient::get($subdomain . '_contactform_' . $id . '_v2'); 31 29 if ($form === false) { 32 30 try { … … 38 36 return $form->message; 39 37 } 40 $recrasPlugin->transients->set($subdomain . '_contactform_' . $id . '_v2', $form);38 Transient::set($subdomain . '_contactform_' . $id . '_v2', $form); 41 39 } 42 40 return $form; … … 151 149 public static function clearCache(): int 152 150 { 153 global $recrasPlugin;154 155 151 $subdomain = get_option('recras_subdomain'); 156 152 $errors = 0; … … 160 156 $errors += self::deleteTransients($subdomain, $id); 161 157 } 162 if ( $recrasPlugin->transients->get($subdomain . '_contactforms')) {163 $errors += $recrasPlugin->transients->delete($subdomain . '_contactforms');158 if (Transient::get($subdomain . '_contactforms')) { 159 $errors += Transient::delete($subdomain . '_contactforms'); 164 160 } 165 161 … … 173 169 private static function deleteTransients(string $subdomain, int $formID): int 174 170 { 175 global $recrasPlugin;176 177 171 $errors = 0; 178 172 179 173 $name = $subdomain . '_contactform_' . $formID . '_v2'; 180 if ( $recrasPlugin->transients->get($name)) {181 $errors += $recrasPlugin->transients->delete($name);174 if (Transient::get($name)) { 175 $errors += Transient::delete($name); 182 176 } 183 177 … … 635 629 public static function getForms(string $subdomain) 636 630 { 637 global $recrasPlugin; 638 639 $json = $recrasPlugin->transients->get($subdomain . '_contactforms'); 631 $json = Transient::get($subdomain . '_contactforms'); 640 632 if ($json === false) { 641 633 try { … … 644 636 return $e->getMessage(); 645 637 } 646 $recrasPlugin->transients->set($subdomain . '_contactforms', $json);638 Transient::set($subdomain . '_contactforms', $json); 647 639 } 648 640 -
recras/tags/6.3.6/src/Plugin.php
r3306911 r3310464 16 16 { 17 17 $this->setBaseUrl(); 18 $this->transients = new Transient();19 18 20 19 // Needs to run before: Gutenberg::addBlocks, self::loadAdminScripts … … 144 143 } 145 144 146 $setting = $this->transients->get($subdomain . '_show_old_online_booking');145 $setting = Transient::get($subdomain . '_show_old_online_booking'); 147 146 if ($setting === false) { 148 147 try { … … 152 151 } 153 152 if (is_object($setting) && property_exists($setting, 'waarde')) { 154 $this->transients->set($subdomain . '_show_old_online_booking', $setting->waarde, DAY_IN_SECONDS);155 } 156 } 157 158 $setting = $this->transients->get($subdomain . '_show_old_voucher_sales');153 Transient::set($subdomain . '_show_old_online_booking', $setting->waarde, DAY_IN_SECONDS); 154 } 155 } 156 157 $setting = Transient::get($subdomain . '_show_old_voucher_sales'); 159 158 if ($setting === false) { 160 159 try { … … 164 163 } 165 164 if (is_object($setting) && property_exists($setting, 'waarde')) { 166 $this->transients->set($subdomain . '_show_old_voucher_sales', $setting->waarde, DAY_IN_SECONDS);165 Transient::set($subdomain . '_show_old_voucher_sales', $setting->waarde, DAY_IN_SECONDS); 167 166 } 168 167 } -
recras/tags/6.3.6/src/Products.php
r3217607 r3310464 78 78 public static function clearCache(): int 79 79 { 80 global $recrasPlugin;81 82 80 $subdomain = get_option('recras_subdomain'); 83 81 $errors = 0; 84 if ( $recrasPlugin->transients->get($subdomain . '_products_v2')) {85 $errors = $recrasPlugin->transients->delete($subdomain . '_products_v2');82 if (Transient::get($subdomain . '_products_v2')) { 83 $errors = Transient::delete($subdomain . '_products_v2'); 86 84 } 87 85 … … 125 123 public static function getProducts(string $subdomain) 126 124 { 127 global $recrasPlugin; 128 129 $json = $recrasPlugin->transients->get($subdomain . '_products_v2'); 125 $json = Transient::get($subdomain . '_products_v2'); 130 126 if ($json === false) { 131 127 try { … … 135 131 } 136 132 137 $recrasPlugin->transients->set($subdomain . '_products_v2', $json);133 Transient::set($subdomain . '_products_v2', $json); 138 134 } 139 135 -
recras/tags/6.3.6/src/Settings.php
r3250273 r3310464 115 115 public static function allowOnlinePackageBooking(): bool 116 116 { 117 global $recrasPlugin;118 119 117 $subdomain = get_option('recras_subdomain'); 120 118 if (!$subdomain) { 121 119 return true; 122 120 } 123 $setting = $recrasPlugin->transients->get($subdomain . '_show_old_online_booking');121 $setting = Transient::get($subdomain . '_show_old_online_booking'); 124 122 // if getting the transient fails, we want to show the button to be sure, so comparing with 'no' is safest 125 123 return ($setting === 'no') ? false : true; … … 129 127 public static function allowOldVoucherSales(): bool 130 128 { 131 global $recrasPlugin;132 133 129 $subdomain = get_option('recras_subdomain'); 134 130 if (!$subdomain) { 135 131 return true; 136 132 } 137 $setting = $recrasPlugin->transients->get($subdomain . '_show_old_voucher_sales');133 $setting = Transient::get($subdomain . '_show_old_voucher_sales'); 138 134 // if getting the transient fails, we want to show the button to be sure, so comparing with 'no' is safest 139 135 return ($setting === 'no') ? false : true; … … 145 141 public static function clearCache(): int 146 142 { 147 global $recrasPlugin;148 149 143 $subdomain = get_option('recras_subdomain'); 150 144 $errors = 0; 151 if ( $recrasPlugin->transients->get($subdomain . '_show_old_online_booking')) {152 $errors = $recrasPlugin->transients->delete($subdomain . '_show_old_online_booking');153 } 154 if ( $recrasPlugin->transients->get($subdomain . '_show_old_voucher_sales')) {155 $errors = $recrasPlugin->transients->delete($subdomain . '_show_old_voucher_sales');145 if (Transient::get($subdomain . '_show_old_online_booking')) { 146 $errors = Transient::delete($subdomain . '_show_old_online_booking'); 147 } 148 if (Transient::get($subdomain . '_show_old_voucher_sales')) { 149 $errors = Transient::delete($subdomain . '_show_old_voucher_sales'); 156 150 } 157 151 -
recras/tags/6.3.6/src/Transient.php
r3221428 r3310464 9 9 * Delete a transient. Returns 0 for success/not existing, 1 for error for easy error counting 10 10 */ 11 public function delete(string $name): int11 public static function delete(string $name): int 12 12 { 13 if (! $this->get($name)) {13 if (!self::get($name)) { 14 14 return 0; 15 15 } … … 20 20 * @return mixed 21 21 */ 22 public function get(string $name)22 public static function get(string $name) 23 23 { 24 24 return get_transient(self::BASE . $name); … … 26 26 27 27 // HOUR_IN_SECONDS is defined by WordPress 28 public function set(string $name, $value, int $expiration = HOUR_IN_SECONDS): bool28 public static function set(string $name, $value, int $expiration = HOUR_IN_SECONDS): bool 29 29 { 30 30 return set_transient(self::BASE . $name, $value, $expiration); -
recras/tags/6.3.6/src/Vouchers.php
r3268913 r3310464 127 127 public static function clearCache(): int 128 128 { 129 global $recrasPlugin;130 131 129 $subdomain = get_option('recras_subdomain'); 132 130 $errors = 0; 133 if ( $recrasPlugin->transients->get($subdomain . '_voucher_templates')) {134 $errors = $recrasPlugin->transients->delete($subdomain . '_voucher_templates');131 if (Transient::get($subdomain . '_voucher_templates')) { 132 $errors = Transient::delete($subdomain . '_voucher_templates'); 135 133 } 136 134 … … 144 142 public function getTemplates(string $subdomain): array 145 143 { 146 global $recrasPlugin; 147 148 $json = $recrasPlugin->transients->get($subdomain . '_voucher_templates'); 144 $json = Transient::get($subdomain . '_voucher_templates'); 149 145 if ($json === false) { 150 146 try { … … 153 149 return $e->getMessage(); 154 150 } 155 $recrasPlugin->transients->set($subdomain . '_voucher_templates', $json);151 Transient::set($subdomain . '_voucher_templates', $json); 156 152 } 157 153 -
recras/trunk/changelog.md
r3306911 r3310464 1 1 # Changelog 2 3 ## 6.3.6 (2025-06-12) 4 * Fix errors when using WP CLI for certain things 2 5 3 6 ## 6.3.5 (2025-06-05) -
recras/trunk/readme.txt
r3306911 r3310464 3 3 Tags: recras, recreation, reservation, booking, voucher 4 4 Tested up to: 6.8 5 Stable tag: 6.3. 55 Stable tag: 6.3.6 6 6 License: GPLv2 or later 7 7 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 75 75 == Changelog == 76 76 77 = 6.3.6 = 78 * Fix errors when using WP CLI for certain things 79 77 80 = 6.3.5 = 78 81 * Fix warning when using PHP 8.4 -
recras/trunk/recras-wordpress-plugin.php
r3306911 r3310464 3 3 Plugin Name: Recras WordPress Plugin 4 4 Plugin URI: https://www.recras.nl/ 5 Version: 6.3. 55 Version: 6.3.6 6 6 Description: Easily integrate your Recras data into your own site 7 7 Requires at least: 6.6 -
recras/trunk/src/Arrangement.php
r3217607 r3310464 96 96 public static function clearCache(): int 97 97 { 98 global $recrasPlugin;99 100 98 $subdomain = get_option('recras_subdomain'); 101 99 $errors = 0; … … 104 102 foreach ($packages as $id) { 105 103 $name = $subdomain . '_arrangement_' . $id; 106 if ( $recrasPlugin->transients->get($name)) {107 $errors += $recrasPlugin->transients->delete($name);108 } 109 } 110 $errors += $recrasPlugin->transients->delete($subdomain . '_arrangements');104 if (Transient::get($name)) { 105 $errors += Transient::delete($name); 106 } 107 } 108 $errors += Transient::delete($subdomain . '_arrangements'); 111 109 112 110 return $errors; … … 238 236 public static function getPackages(string $subdomain, bool $onlyOnline = false, bool $includeEmpty = true) 239 237 { 240 global $recrasPlugin; 241 242 $json = $recrasPlugin->transients->get($subdomain . '_arrangements'); 238 $json = Transient::get($subdomain . '_arrangements'); 243 239 if ($json === false) { 244 240 try { … … 247 243 return $e->getMessage(); 248 244 } 249 $recrasPlugin->transients->set($subdomain . '_arrangements', $json);245 Transient::set($subdomain . '_arrangements', $json); 250 246 } 251 247 … … 364 360 public static function getPackage(string $subdomain, int $id) 365 361 { 366 global $recrasPlugin; 367 368 $json = $recrasPlugin->transients->get($subdomain . '_arrangement_' . $id); 362 $json = Transient::get($subdomain . '_arrangement_' . $id); 369 363 if ($json === false) { 370 364 try { … … 373 367 return $e->getMessage(); 374 368 } 375 $recrasPlugin->transients->set($subdomain . '_arrangement_' . $id, $json);369 Transient::set($subdomain . '_arrangement_' . $id, $json); 376 370 } 377 371 return $json; -
recras/trunk/src/Bookprocess.php
r3268913 r3310464 11 11 public static function clearCache(): int 12 12 { 13 global $recrasPlugin;14 15 13 $subdomain = get_option('recras_subdomain'); 16 return $recrasPlugin->transients->delete($subdomain . '_bookprocesses_v2');14 return Transient::delete($subdomain . '_bookprocesses_v2'); 17 15 } 18 16 … … 38 36 public static function getProcesses(string $subdomain) 39 37 { 40 global $recrasPlugin; 41 42 $json = $recrasPlugin->transients->get($subdomain . '_bookprocesses_v2'); 38 $json = Transient::get($subdomain . '_bookprocesses_v2'); 43 39 if ($json === false) { 44 40 try { … … 47 43 return $e->getMessage(); 48 44 } 49 $recrasPlugin->transients->set($subdomain . '_bookprocesses_v2', $json);45 Transient::set($subdomain . '_bookprocesses_v2', $json); 50 46 } 51 47 -
recras/trunk/src/ContactForm.php
r3217607 r3310464 26 26 public static function getForm(string $subdomain, int $id) 27 27 { 28 global $recrasPlugin; 29 30 $form = $recrasPlugin->transients->get($subdomain . '_contactform_' . $id . '_v2'); 28 $form = Transient::get($subdomain . '_contactform_' . $id . '_v2'); 31 29 if ($form === false) { 32 30 try { … … 38 36 return $form->message; 39 37 } 40 $recrasPlugin->transients->set($subdomain . '_contactform_' . $id . '_v2', $form);38 Transient::set($subdomain . '_contactform_' . $id . '_v2', $form); 41 39 } 42 40 return $form; … … 151 149 public static function clearCache(): int 152 150 { 153 global $recrasPlugin;154 155 151 $subdomain = get_option('recras_subdomain'); 156 152 $errors = 0; … … 160 156 $errors += self::deleteTransients($subdomain, $id); 161 157 } 162 if ( $recrasPlugin->transients->get($subdomain . '_contactforms')) {163 $errors += $recrasPlugin->transients->delete($subdomain . '_contactforms');158 if (Transient::get($subdomain . '_contactforms')) { 159 $errors += Transient::delete($subdomain . '_contactforms'); 164 160 } 165 161 … … 173 169 private static function deleteTransients(string $subdomain, int $formID): int 174 170 { 175 global $recrasPlugin;176 177 171 $errors = 0; 178 172 179 173 $name = $subdomain . '_contactform_' . $formID . '_v2'; 180 if ( $recrasPlugin->transients->get($name)) {181 $errors += $recrasPlugin->transients->delete($name);174 if (Transient::get($name)) { 175 $errors += Transient::delete($name); 182 176 } 183 177 … … 635 629 public static function getForms(string $subdomain) 636 630 { 637 global $recrasPlugin; 638 639 $json = $recrasPlugin->transients->get($subdomain . '_contactforms'); 631 $json = Transient::get($subdomain . '_contactforms'); 640 632 if ($json === false) { 641 633 try { … … 644 636 return $e->getMessage(); 645 637 } 646 $recrasPlugin->transients->set($subdomain . '_contactforms', $json);638 Transient::set($subdomain . '_contactforms', $json); 647 639 } 648 640 -
recras/trunk/src/Plugin.php
r3306911 r3310464 16 16 { 17 17 $this->setBaseUrl(); 18 $this->transients = new Transient();19 18 20 19 // Needs to run before: Gutenberg::addBlocks, self::loadAdminScripts … … 144 143 } 145 144 146 $setting = $this->transients->get($subdomain . '_show_old_online_booking');145 $setting = Transient::get($subdomain . '_show_old_online_booking'); 147 146 if ($setting === false) { 148 147 try { … … 152 151 } 153 152 if (is_object($setting) && property_exists($setting, 'waarde')) { 154 $this->transients->set($subdomain . '_show_old_online_booking', $setting->waarde, DAY_IN_SECONDS);155 } 156 } 157 158 $setting = $this->transients->get($subdomain . '_show_old_voucher_sales');153 Transient::set($subdomain . '_show_old_online_booking', $setting->waarde, DAY_IN_SECONDS); 154 } 155 } 156 157 $setting = Transient::get($subdomain . '_show_old_voucher_sales'); 159 158 if ($setting === false) { 160 159 try { … … 164 163 } 165 164 if (is_object($setting) && property_exists($setting, 'waarde')) { 166 $this->transients->set($subdomain . '_show_old_voucher_sales', $setting->waarde, DAY_IN_SECONDS);165 Transient::set($subdomain . '_show_old_voucher_sales', $setting->waarde, DAY_IN_SECONDS); 167 166 } 168 167 } -
recras/trunk/src/Products.php
r3217607 r3310464 78 78 public static function clearCache(): int 79 79 { 80 global $recrasPlugin;81 82 80 $subdomain = get_option('recras_subdomain'); 83 81 $errors = 0; 84 if ( $recrasPlugin->transients->get($subdomain . '_products_v2')) {85 $errors = $recrasPlugin->transients->delete($subdomain . '_products_v2');82 if (Transient::get($subdomain . '_products_v2')) { 83 $errors = Transient::delete($subdomain . '_products_v2'); 86 84 } 87 85 … … 125 123 public static function getProducts(string $subdomain) 126 124 { 127 global $recrasPlugin; 128 129 $json = $recrasPlugin->transients->get($subdomain . '_products_v2'); 125 $json = Transient::get($subdomain . '_products_v2'); 130 126 if ($json === false) { 131 127 try { … … 135 131 } 136 132 137 $recrasPlugin->transients->set($subdomain . '_products_v2', $json);133 Transient::set($subdomain . '_products_v2', $json); 138 134 } 139 135 -
recras/trunk/src/Settings.php
r3250273 r3310464 115 115 public static function allowOnlinePackageBooking(): bool 116 116 { 117 global $recrasPlugin;118 119 117 $subdomain = get_option('recras_subdomain'); 120 118 if (!$subdomain) { 121 119 return true; 122 120 } 123 $setting = $recrasPlugin->transients->get($subdomain . '_show_old_online_booking');121 $setting = Transient::get($subdomain . '_show_old_online_booking'); 124 122 // if getting the transient fails, we want to show the button to be sure, so comparing with 'no' is safest 125 123 return ($setting === 'no') ? false : true; … … 129 127 public static function allowOldVoucherSales(): bool 130 128 { 131 global $recrasPlugin;132 133 129 $subdomain = get_option('recras_subdomain'); 134 130 if (!$subdomain) { 135 131 return true; 136 132 } 137 $setting = $recrasPlugin->transients->get($subdomain . '_show_old_voucher_sales');133 $setting = Transient::get($subdomain . '_show_old_voucher_sales'); 138 134 // if getting the transient fails, we want to show the button to be sure, so comparing with 'no' is safest 139 135 return ($setting === 'no') ? false : true; … … 145 141 public static function clearCache(): int 146 142 { 147 global $recrasPlugin;148 149 143 $subdomain = get_option('recras_subdomain'); 150 144 $errors = 0; 151 if ( $recrasPlugin->transients->get($subdomain . '_show_old_online_booking')) {152 $errors = $recrasPlugin->transients->delete($subdomain . '_show_old_online_booking');153 } 154 if ( $recrasPlugin->transients->get($subdomain . '_show_old_voucher_sales')) {155 $errors = $recrasPlugin->transients->delete($subdomain . '_show_old_voucher_sales');145 if (Transient::get($subdomain . '_show_old_online_booking')) { 146 $errors = Transient::delete($subdomain . '_show_old_online_booking'); 147 } 148 if (Transient::get($subdomain . '_show_old_voucher_sales')) { 149 $errors = Transient::delete($subdomain . '_show_old_voucher_sales'); 156 150 } 157 151 -
recras/trunk/src/Transient.php
r3221428 r3310464 9 9 * Delete a transient. Returns 0 for success/not existing, 1 for error for easy error counting 10 10 */ 11 public function delete(string $name): int11 public static function delete(string $name): int 12 12 { 13 if (! $this->get($name)) {13 if (!self::get($name)) { 14 14 return 0; 15 15 } … … 20 20 * @return mixed 21 21 */ 22 public function get(string $name)22 public static function get(string $name) 23 23 { 24 24 return get_transient(self::BASE . $name); … … 26 26 27 27 // HOUR_IN_SECONDS is defined by WordPress 28 public function set(string $name, $value, int $expiration = HOUR_IN_SECONDS): bool28 public static function set(string $name, $value, int $expiration = HOUR_IN_SECONDS): bool 29 29 { 30 30 return set_transient(self::BASE . $name, $value, $expiration); -
recras/trunk/src/Vouchers.php
r3268913 r3310464 127 127 public static function clearCache(): int 128 128 { 129 global $recrasPlugin;130 131 129 $subdomain = get_option('recras_subdomain'); 132 130 $errors = 0; 133 if ( $recrasPlugin->transients->get($subdomain . '_voucher_templates')) {134 $errors = $recrasPlugin->transients->delete($subdomain . '_voucher_templates');131 if (Transient::get($subdomain . '_voucher_templates')) { 132 $errors = Transient::delete($subdomain . '_voucher_templates'); 135 133 } 136 134 … … 144 142 public function getTemplates(string $subdomain): array 145 143 { 146 global $recrasPlugin; 147 148 $json = $recrasPlugin->transients->get($subdomain . '_voucher_templates'); 144 $json = Transient::get($subdomain . '_voucher_templates'); 149 145 if ($json === false) { 150 146 try { … … 153 149 return $e->getMessage(); 154 150 } 155 $recrasPlugin->transients->set($subdomain . '_voucher_templates', $json);151 Transient::set($subdomain . '_voucher_templates', $json); 156 152 } 157 153
Note: See TracChangeset
for help on using the changeset viewer.