Changeset 2034567
- Timestamp:
- 02/19/2019 10:59:07 PM (7 years ago)
- Location:
- recombee-recommendation-engine/trunk
- Files:
-
- 1 added
- 7 edited
-
includes/assets/js/min/min.settings.js (modified) (1 diff)
-
includes/assets/js/settings.js (modified) (1 diff)
-
includes/class-RecombeeRe.php (modified) (3 diffs)
-
includes/class-RecombeeReAjaxErrors.php (added)
-
includes/class-RecombeeReAjaxSetup.php (modified) (2 diffs)
-
includes/class-RecombeeReBlogSettingsDb.php (modified) (3 diffs)
-
readme.txt (modified) (2 diffs)
-
recombee-re.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
recombee-recommendation-engine/trunk/includes/assets/js/min/min.settings.js
r1971748 r2034567 7 7 try{if(server.data.message.data.statusCode===201){Recombee.ajaxCall(e,action,nonce,post_data,onSuccess,onError,false);return;} 8 8 onSuccess($(e.target),server);} 9 catch(err){$.fn.TabsPluginFrameWork('showMessage',err,'error');}});Recombee.updateCounters($(e.target).parent().find('.tip'),server.data.message.data.itemsPassed,server.data.message.data.loopErrors);},error:function(MLHttpRequest,textStatus,errorThrown){if(MLHttpRequest.responseText){ Recombee.consolLog(JSON.parse(MLHttpRequest.responseText));}9 catch(err){$.fn.TabsPluginFrameWork('showMessage',err,'error');}});Recombee.updateCounters($(e.target).parent().find('.tip'),server.data.message.data.itemsPassed,server.data.message.data.loopErrors);},error:function(MLHttpRequest,textStatus,errorThrown){if(MLHttpRequest.responseText){try{Recombee.consolLog(JSON.parse(MLHttpRequest.responseText));}catch(e){Recombee.consolLog(MLHttpRequest.responseText);}} 10 10 if(Recombee.ajaxProcess.status===0&&Recombee.ajaxProcess.statusText=='abort'){return;} 11 11 else{onError($(e.target),Recombee.ajaxProcess);}}});},updateCounters:function(operator,items,errors){if(typeof(items)=='undefined'||typeof(errors)=='undefined'){$(Recombee).trigger('countersAnimated');return;} -
recombee-recommendation-engine/trunk/includes/assets/js/settings.js
r1967402 r2034567 148 148 149 149 if(MLHttpRequest.responseText){ 150 Recombee.consolLog( JSON.parse(MLHttpRequest.responseText) ); 150 try { 151 Recombee.consolLog( JSON.parse(MLHttpRequest.responseText) ); 152 } catch (e) { 153 Recombee.consolLog( MLHttpRequest.responseText ); 154 } 151 155 } 152 156 if ( Recombee.ajaxProcess.status === 0 && Recombee.ajaxProcess.statusText == 'abort' ){ -
recombee-recommendation-engine/trunk/includes/class-RecombeeRe.php
r2028160 r2034567 28 28 public $communicator = null; 29 29 public $menu = null; 30 public $ajaxErrors = array();31 30 public $productStatuses = array(); 32 31 public $recommsDefault = array(); … … 853 852 $this->setupCommunicator(); 854 853 $this->checkDbConnect(); 855 $this->setupErrHandling();856 854 857 855 (object)$this->rre_ajax_interface = RecombeeReAjaxSetup::instance(); … … 1076 1074 } 1077 1075 1078 private function setupErrHandling(){ 1079 1080 if( !wp_doing_ajax() ){ 1081 return; 1082 } 1083 1084 if( ( 1085 isset($_POST['data']['AJAX_Marker']) && $_POST['data']['AJAX_Marker'] == RRE_PLUGIN_DIR) || 1086 isset($_POST['preset']) && $_POST['preset'] == RRE_BLOG_SETTINGS_PRESET_NAME || 1087 isset($_POST['preset']) && $_POST['preset'] == RRE_SITE_SETTINGS_PRESET_NAME ){ 1088 1089 if( WP_DEBUG && WP_DEBUG_DISPLAY ){ 1090 register_shutdown_function( array($this, '_shutdown_function')); 1091 set_error_handler( array($this, '_console_error_message')); 1092 } 1093 } 1094 } 1095 1096 public function _shutdown_function(){ 1097 1098 $this->_console_error_message( error_get_last() ); 1099 } 1100 1101 public function _console_error_message( $args ) { 1102 1103 // error_get_last() has NO error 1104 if( $args === null ) return; 1105 1106 $err_names = array( 1107 1108 // fatal errors 1109 E_ERROR => 'Fatal error', 1110 E_PARSE => 'Parse Error', 1111 E_CORE_ERROR => 'Core Error', 1112 E_CORE_WARNING => 'Core Warning', 1113 E_COMPILE_ERROR => 'Compile Error', 1114 E_COMPILE_WARNING => 'Compile Warning', 1115 1116 // other errors 1117 E_WARNING => 'Warning', 1118 E_NOTICE => 'Notice', 1119 E_STRICT => 'Strict Notice', 1120 E_RECOVERABLE_ERROR => 'Recoverable Error', 1121 E_DEPRECATED => 'Deprecated', 1122 E_USER_DEPRECATED => 'User Deprecated', 1123 1124 // user type errors 1125 E_USER_ERROR => 'User Error', 1126 E_USER_WARNING => 'User Warning', 1127 E_USER_NOTICE => 'User Notice', 1128 ); 1129 1130 // error_get_last() HAS error 1131 if( is_array($args) ){ 1132 list( $errno, $errstr, $errfile, $errline ) = array_values( $args ); 1133 1134 // Fatal errors 1135 if( ! in_array( $errno, array(E_ERROR, E_PARSE, E_CORE_ERROR, E_CORE_WARNING, E_COMPILE_ERROR, E_COMPILE_WARNING) ) ){ 1136 return; 1137 } 1138 else{ 1139 $this->_static_console( "PHP $err_names[$errno]: $errstr in $errfile on line $errline\n", 'fatal error' ); 1140 echo wp_json_encode( $this->ajaxErrors ); 1141 } 1142 } 1143 else { 1144 list( $errno, $errstr, $errfile, $errline ) = func_get_args(); 1145 } 1146 1147 // for @suppress 1148 $errno = $errno & error_reporting(); 1149 if( $errno == 0 ) return; 1150 1151 if( ! defined('E_STRICT') ) define('E_STRICT', 2048); 1152 if( ! defined('E_RECOVERABLE_ERROR') ) define('E_RECOVERABLE_ERROR', 4096); 1153 1154 $err_name = "Unknown error ($errno)"; 1155 if( isset($err_names[ $errno ]) ) 1156 $err_name = $err_names[ $errno ]; 1157 1158 static $once; 1159 if( ! $once ){ 1160 $once = 1; 1161 $this->_static_console( 'PHP errors:' ); // title for errors 1162 } 1163 1164 if( empty($console_type) ){ 1165 $console_type = 'log'; 1166 } 1167 elseif( in_array( $errno, array(E_WARNING, E_USER_WARNING) ) ){ 1168 $console_type = 'warn'; 1169 } 1170 1171 $this->_static_console( "PHP $err_name: $errstr in $errfile on line $errline\n", $console_type ); 1172 1173 return true; 1174 } 1175 1176 private function _static_console( $data, $type = 'log' ){ 1177 1178 if( is_array($data) || is_object($data) ){ 1179 $data = print_r( $data, true ); 1180 } 1181 $this->ajaxErrors[] = array( $data, $type ); 1182 } 1076 1183 1077 } -
recombee-recommendation-engine/trunk/includes/class-RecombeeReAjaxSetup.php
r1971748 r2034567 59 59 } 60 60 61 public static function do_virtual_page($template){61 public static function do_virtual_page($template){ 62 62 63 63 global $wp_query; … … 108 108 define( 'WP_DOING_AJAX', true ); 109 109 } 110 111 RecombeeReAjaxErrors::setupErrHandling(); 110 112 } 111 113 -
recombee-recommendation-engine/trunk/includes/class-RecombeeReBlogSettingsDb.php
r1962791 r2034567 562 562 } 563 563 564 foreach($customers as $customer){ 565 ( (int)$customer['user_id'] !== 0 ) ? $prop_set = $this->getCustomerPropertiesValue($customer['user_id']) : $prop_set = $this->getGuestPropertiesValue($customer); 564 foreach($customers as $customer){ 565 566 $wp_user = get_user_by( 'id', (int)$customer['user_id']); 567 568 ( (int)$customer['user_id'] !== 0 && is_object($wp_user) ) ? $prop_set = $this->getCustomerPropertiesValue($customer['user_id']) : $prop_set = $this->getGuestPropertiesValue($customer); 566 569 567 570 if(isset($prop_set['rejected'])){ … … 936 939 /* PSEUDO DATA */ 937 940 private function getCustomerPurchaseValuePseudo($customer_data){ 938 941 global $wpdb; 939 942 $return = false; 940 943 ( (int)$customer_data['user_id'] === 0 ) ? $customer_id = $customer_data['billing_email_hash'] : $customer_id = (int)$customer_data['user_id']; … … 2213 2216 $return->message->recombee = $log; 2214 2217 2215 if( !empty( $this->recombee->ajaxErrors ) ){2216 $return->message->errors = $this->recombee->ajaxErrors;2218 if( !empty( RecombeeReAjaxErrors::$ajaxErrors ) ){ 2219 $return->message->errors = RecombeeReAjaxErrors::$ajaxErrors; 2217 2220 } 2218 2221 if($type == 'nonce_true'){ -
recombee-recommendation-engine/trunk/readme.txt
r2028164 r2034567 4 4 Requires at least: 4.9 5 5 Tested up to: 4.9 6 Stable tag: 2.6. 46 Stable tag: 2.6.5 7 7 Requires PHP: 5.5 8 8 WC requires at least: 3.3 … … 60 60 61 61 == Changelog == 62 = 2.6.5 - 20-02-2019 = 63 * Fix - Error of initial synchronization of customers, in the case when the customer was registered in the store, but later deleted as a user of the WordPress 64 62 65 = 2.6.4 - 10-02-2019 = 63 66 * Fix - Error in default value of shortcode for setting page fixed -
recombee-recommendation-engine/trunk/recombee-re.php
r2028164 r2034567 5 5 * Author: Recombee 6 6 * Author URI: https://recombee.com 7 * Version: 2.6. 47 * Version: 2.6.5 8 8 * License: GPLv3 9 9 * Text Domain: recombee-recommendation-engine
Note: See TracChangeset
for help on using the changeset viewer.