Changeset 2389057
- Timestamp:
- 09/27/2020 07:34:57 AM (6 years ago)
- Location:
- robera/trunk
- Files:
-
- 7 edited
-
core/background_order_item_copy.php (modified) (1 diff)
-
core/background_product_copy.php (modified) (1 diff)
-
core/background_user_copy.php (modified) (1 diff)
-
core/recommender-admin.php (modified) (1 diff)
-
libraries/recommender-background-process.php (modified) (2 diffs)
-
readme.txt (modified) (1 diff)
-
recommender.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
robera/trunk/core/background_order_item_copy.php
r2387003 r2389057 69 69 $order->get_date_modified(), $anonymous_id, "order_item_id_".$order_id, $properties 70 70 ); 71 if (!get_option('recommender_progress_completed_' . $this->action, 0)) {72 $order_arr = get_option('recommender_api_orders_sent', []);73 if (!in_array($order->get_id(), $order_arr)) {74 $order_arr[] = $order->get_id();75 update_option('recommender_api_orders_sent', $order_arr);76 update_option(77 'recommender_api_progress_' . $this->action,78 get_option('recommender_api_progress_' . $this->action, 0) + 179 );80 update_option(81 'recommender_progress_completed_' . $this->action,82 get_option('recommender_api_progress_' . $this->action) == get_option('recommender_api_target_orders')83 );84 }85 }86 71 87 72 return $this->checkResponse($item, $response); -
robera/trunk/core/background_product_copy.php
r2387003 r2389057 94 94 $properties 95 95 ); 96 if (!get_option('recommender_progress_completed_' . $this->action, 0)) {97 update_option(98 'recommender_api_progress_' . $this->action,99 get_option('recommender_api_progress_' . $this->action, 0) + 1100 );101 update_option(102 'recommender_progress_completed_' . $this->action,103 get_option('recommender_api_progress_' . $this->action) == get_option('recommender_api_target_products')104 );105 }106 96 return $this->checkResponse($item, $response); 107 97 } -
robera/trunk/core/background_user_copy.php
r2387003 r2389057 44 44 $properties 45 45 ); 46 if (!get_option('recommender_progress_completed_' . $this->action, 0)) {47 update_option(48 'recommender_api_progress_' . $this->action,49 get_option('recommender_api_progress_' . $this->action, 0) + 150 );51 update_option(52 'recommender_progress_completed_' . $this->action,53 get_option('recommender_api_progress_' . $this->action) == get_option('recommender_api_target_users')54 );55 }56 46 return $this->checkResponse($item, $response); 57 47 } -
robera/trunk/core/recommender-admin.php
r2387003 r2389057 52 52 public function progressPercent($request) 53 53 { 54 if (!get_option('recommender_api_target_order_items', 0)){ 55 $query = new \WC_Order_Query(array( 56 'limit' => -1, 57 'offset' => 0, 58 )); 59 $count=0; 60 foreach (array_values($query->get_orders()) as $i => $order) { 61 $count+=count($order->get_items()); 62 } 63 update_option('recommender_api_target_order_items', $count); 64 } 54 65 $library_actions = ['order_item_copy', 'product_copy', 'user_copy']; 55 $target_actions = ['order s', 'products', 'users'];66 $target_actions = ['order_items', 'products', 'users']; 56 67 $result = 0; 57 68 $total = 0; 58 69 foreach ($library_actions as $i => $action) { 59 $ sent_option_key = 'recommender_api_progress_' . $library_actions[$i];60 $ target_key = 'recommender_api_target_' . $target_actions[$i];61 $result += get_option($sent_option_key, 0);62 $total += get_option($target_key, 0);70 $target = get_option('recommender_api_target_' . $target_actions[$i], 0); 71 $sent = get_option('recommender_api_progress_' . $library_actions[$i], 0); 72 $result += min($target, $sent); 73 $total += $target; 63 74 } 64 75 $total = ($total == 0) ? 1 : $total; -
robera/trunk/libraries/recommender-background-process.php
r2387003 r2389057 288 288 } else { 289 289 unset($batch->data[$key]); 290 if (!get_option($this->first_data_transfer_option)) { 291 $val = get_option('recommender_api_progress_' . $this->action, 0)+1; 292 update_option('recommender_api_progress_' . $this->action, $val); 293 } 290 294 } 291 295 if ($this->timeExceeded() || $this->memoryExceeded()) { … … 376 380 $this->client->changeState($this->action.'_done'); 377 381 update_option($this->first_data_transfer_option, true); 378 update_option('recommender_progress_completed_' . $this->action, true);379 update_option(380 'recommender_api_progress_' . $this->action,381 get_option('recommender_api_target_'. $this->parent_tag, 0)382 );383 382 } 384 383 // clear schedule of the cron healthCheck. -
robera/trunk/readme.txt
r2387003 r2389057 4 4 License: GPLv2 or later 5 5 License URI: https://www.gnu.org/licenses/gpl-2.0.html 6 Stable tag: 1.0.1 26 Stable tag: 1.0.13 7 7 Tested up to: 5.4.2 8 8 -
robera/trunk/recommender.php
r2387003 r2389057 12 12 * Description: This Plugins help you interact with your WooCommerce users smarter by recommend products and related-products to them according to their preferences. 13 13 * Text Domain: robera-recommender 14 * Version: 1.0.1 214 * Version: 1.0.13 15 15 */ 16 16
Note: See TracChangeset
for help on using the changeset viewer.