Changeset 1586858
- Timestamp:
- 02/02/2017 12:01:01 AM (9 years ago)
- Location:
- pushpress-integration/trunk
- Files:
-
- 3 edited
-
inc/wp_pushpress_model.php (modified) (29 diffs)
-
pushpress.php (modified) (2 diffs)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
pushpress-integration/trunk/inc/wp_pushpress_model.php
r1580671 r1586858 8 8 9 9 public function get_client() { 10 $client = Pushpress_Client::retrieve('self'); 11 /* 10 12 if( !$client = get_transient( 'pp_client2' ) ){ 11 13 $client = Pushpress_Client::retrieve('self'); 12 14 set_transient( 'pp_client2', $client, 3600 ); // 1 hour cache 13 } 15 } 16 */ 14 17 return $client; 15 18 } … … 17 20 public function get_products() { 18 21 22 $params = array( 23 'active' => 1, 24 'show_on_wp' => 1 25 ); 26 //get products object 27 $productsObj = Pushpress_Product::all($params); 28 29 /* 19 30 $key = "pp_client_active_products"; 20 31 if (! $productsObj = get_transient($key)) { … … 27 38 28 39 set_transient( $key, $productsObj, 300 ); // 5m 29 } 30 40 } 41 */ 31 42 32 43 $productsList = array(); … … 54 65 55 66 56 67 //get preorder 68 $livePreorders = Pushpress_Preorder::all(array( 69 "closed" => 0, "completed" => 0, "cancelled" => 0 70 )); 71 72 /* 57 73 if (! $livePreorders = get_transient("pp_client_active_preorders")) { 58 74 //get preorder … … 62 78 set_transient( 'pp_client_active_preorders', $livePreorders, 600 ); // 5m 63 79 } 80 */ 64 81 /* 65 82 … … 100 117 $key = "pp_client_active_product_" . $id; 101 118 119 try { 120 $product = Pushpress_Product::retrieve($id); 121 } 122 catch (Exception $e) { 123 return array(); 124 } 125 126 $productsList[$product->category->uuid]['products'][$product->uuid]['slug'] = $product->slug; 127 $productsList[$product->category->uuid]['products'][$product->uuid]['name'] = $product->name; 128 $productsList[$product->category->uuid]['products'][$product->uuid]['description'] = $product->description; 129 $prices = array(); 130 $options = $product->options; 131 foreach ($options as $option) { 132 $prices[] = $option->price; 133 } 134 sort($prices); 135 $productsList[$product->category->uuid]['products'][$product->uuid]['price'] = $prices; 136 137 /* 102 138 if (! $product = get_transient($key)) { 103 139 … … 117 153 $productsList[$product->category->uuid]['products'][$product->uuid]['price'] = $prices; 118 154 } 155 */ 119 156 120 157 return $productsList; … … 126 163 $productsList = array(); 127 164 165 $params = array( 166 'active' => 1 167 ); 168 //get products object 169 $productsObj = Pushpress_Product::all($params); 170 171 /* 128 172 $key = "pp_client_active_products_" . $category; 129 173 … … 136 180 set_transient( $key, $productsObj, 300 ); // 5m 137 181 } 138 182 */ 139 183 140 184 foreach ($productsObj->data as $product) { … … 166 210 $plansList = array(); 167 211 212 $params = array( 213 'active' => 1, 214 'public' => 1, 215 'type' => 'P,N,R' 216 ); 217 //get all products object 218 $plans = Pushpress_Plan::all($params); 219 220 /* 168 221 if (!$plans = get_transient("pp_client_active_plans_pnr")) { 169 222 $params = array( … … 175 228 $plans = Pushpress_Plan::all($params); 176 229 set_transient("pp_client_active_plans_pnr", $plans, 600); 177 } 230 } 231 */ 178 232 179 233 $planType = array('R' => 'Recurring', 'N' => 'Non-Recurring', 'P' => 'Punchcards'); … … 203 257 } 204 258 } catch (Exception $e) { 205 return ;259 return array(); 206 260 } 207 261 return $plansList; … … 211 265 $plansList = array(); 212 266 267 $params = array( 268 'active' => 1, 269 'public' => 1, 270 ); 271 //get all products object 272 $plans = Pushpress_Plan::all($params); 273 274 /* 213 275 $key = "pp_client_plans_for_help"; 214 276 … … 221 283 $plans = Pushpress_Plan::all($params); 222 284 set_transient($key, $plans, 600); 223 } 285 } 286 */ 224 287 225 288 foreach ($plans->data as $plan) { … … 233 296 $categories = array(); 234 297 298 $params = array( 299 'active' => 1 300 ); 301 //get all products object 302 $items = Pushpress_ProductCategories::all($params); 303 304 /* 235 305 $key = "pp_client_product_categories_for_help"; 236 306 … … 243 313 set_transient($key, $items, 600); 244 314 } 315 */ 245 316 foreach ($items->data as $item) { 246 317 $categories[$item->uuid] = mb_convert_encoding($item->name, 'UTF-8', 'HTML-ENTITIES'); … … 261 332 $end = strtotime("today 00:00:00 +1 year"); // 1 year later 262 333 334 $calendar = Pushpress_Calendar::all(array( 335 'active' => 1, 336 'type' => $isEvent, 337 'start_time' => $start, 338 'end_time' => $end 339 )); 340 341 /* 263 342 $cache_key = "pp_client_calendar_" . $isEvent . "_" . $start . "_" . $end; 264 343 … … 273 352 set_transient($cache_key, $calendar, 600); 274 353 } 354 */ 275 355 $eventsList = array(); 276 356 … … 300 380 } 301 381 } catch (Exception $e) { 302 return ;382 return array(); 303 383 } 304 384 return $eventsList; … … 353 433 $cache_key = "pp_client_schedule_2" . $doy . "_" . $year . "_class"; 354 434 435 $calendar = Pushpress_Calendar::all(array( 436 'active' => 1, 437 'doy' => $doy, 438 'year' => $year, 439 'type' => 'Class', 440 )); 441 /* 355 442 if (! $calendar = get_transient($cache_key)){ 356 443 $calendar = Pushpress_Calendar::all(array( … … 362 449 set_transient($cache_key, $calendar, 600); 363 450 } 451 */ 364 452 365 453 foreach ($calendar->data as $item) { … … 412 500 ); 413 501 414 if (!$tracks = get_transient("pp_client_tracks")) {502 // if (!$tracks = get_transient("pp_client_tracks")) { 415 503 $tracks = Pushpress_Track::all(); 416 set_transient("pp_client_tracks", $tracks, 600); 417 } 418 504 // set_transient("pp_client_tracks", $tracks, 600); 505 // } 506 507 //var_dump($tracks); 419 508 420 509 $results = array(); … … 433 522 $params['track_id'] = $track->uuid; 434 523 524 $workouts = Pushpress_Track_Workout::all($params); 525 /* 435 526 if (!$workouts = get_transient("pp_track_workouts_" . $track->uuid)) { 436 527 $workouts = Pushpress_Track_Workout::all($params); 437 528 set_transient("pp_track_workouts_" . $track->uuid, $workouts, 600); 438 529 } 530 */ 439 531 440 532 $results[$key]['workouts'] = $this->filter_data_by_date($workouts, $timeNow, $client, $public_setting); … … 487 579 $client = $this->get_client(); 488 580 // get integration settings 581 $integration_settings = Pushpress_Client::settings('lead_capture'); 582 /* 489 583 if (!$integration_settings = get_transient("pp_settings_lead_capture")) { 490 584 $integration_settings = Pushpress_Client::settings('lead_capture'); 491 585 set_transient("pp_settings_lead_capture", $integration_settings, 300); // 5m 492 586 } 587 */ 493 588 494 589 foreach ($integration_settings as $item) { … … 496 591 } 497 592 593 $referral_sources = Pushpress_Client::referralSources(); 594 /* 498 595 if (!$referral_sources = get_transient("pp_settings_referral_sources")) { 499 596 $referral_sources = Pushpress_Client::referralSources(); 500 597 set_transient("pp_settings_referral_sources", $referral_sources, 3600); // 1 hour 501 } 598 } 599 */ 502 600 503 601 foreach ($referral_sources->data as $item) { … … 730 828 731 829 public function facebook_integrations() { 732 830 try { 831 $integration_settings = Pushpress_Client::settings('integration'); 832 } 833 catch (Exception $e) { 834 $integration_settings = array(); 835 } 836 /* 733 837 if( !$integration_settings = get_transient( 'pp_client_settings_integration' ) ){ 734 838 try { … … 740 844 set_transient( 'pp_client_settings_integration', $integration_settings, 600 ); // 10 minute cache 741 845 } 846 */ 742 847 743 848 … … 764 869 public function facebook_metrics() { 765 870 871 try { 872 $settingsObj = Pushpress_Client::settings('metrics'); 873 } 874 catch (Exception $e) { 875 $settingsObj = array(); 876 } 877 878 /* 766 879 if( !$settingsObj = get_transient( 'pp_client_settings_metrics' ) ){ 767 880 try { … … 773 886 set_transient( 'pp_client_settings_metrics', $settingsObj, 60 ); // 1 minute cache 774 887 } 888 */ 775 889 776 890 $metrics = array(); -
pushpress-integration/trunk/pushpress.php
r1580681 r1586858 2 2 /** 3 3 * @package WP-PushPress 4 * @version 1.5.1 34 * @version 1.5.14 5 5 */ 6 6 /* … … 9 9 Description: Easily integrate your workouts, calendar, products, membership plans, events and more with your Wordpress blog! This plugin is a free add-on for existing PushPress clients. See https://pushpress.com for more info. 10 10 Author: PushPress, Inc 11 Version: 1.5.1 311 Version: 1.5.14 12 12 Author URI: https://pushpress.com 13 13 */ 14 14 define('PUSHPRESS_LOCAL', FALSE); 15 15 define('PUSHPRESS_DEV', FALSE); 16 define( 'PP_PLUGIN_VERSION', '1.5.1 3');16 define( 'PP_PLUGIN_VERSION', '1.5.14'); 17 17 define( 'PUSHPRESS_ERROR_REPORT', 0 ); 18 18 define( 'PUSHPRESS_BUTTON_CLASS', 'pushpress-button-class-' . rand(0, 10000)); -
pushpress-integration/trunk/readme.txt
r1580681 r1586858 4 4 Requires at least: 3.0.1 5 5 Tested up to: 4.6.1 6 Stable tag: 1.5.1 36 Stable tag: 1.5.14 7 7 License: GPLv2 or later 8 8 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 129 129 = 1.5.12 = 130 130 Found an issue causing the workout page to not display workouts in some cases. 131 132 = 1.5.14 = 133 Updating caching strategies.
Note: See TracChangeset
for help on using the changeset viewer.