Plugin Directory

Changeset 2034567


Ignore:
Timestamp:
02/19/2019 10:59:07 PM (7 years ago)
Author:
recombee
Message:

2.6.5

Location:
recombee-recommendation-engine/trunk
Files:
1 added
7 edited

Legend:

Unmodified
Added
Removed
  • recombee-recommendation-engine/trunk/includes/assets/js/min/min.settings.js

    r1971748 r2034567  
    77try{if(server.data.message.data.statusCode===201){Recombee.ajaxCall(e,action,nonce,post_data,onSuccess,onError,false);return;}
    88onSuccess($(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));}
     9catch(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);}}
    1010if(Recombee.ajaxProcess.status===0&&Recombee.ajaxProcess.statusText=='abort'){return;}
    1111else{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  
    148148                   
    149149                    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                        }
    151155                    }
    152156                    if ( Recombee.ajaxProcess.status === 0 && Recombee.ajaxProcess.statusText == 'abort' ){
  • recombee-recommendation-engine/trunk/includes/class-RecombeeRe.php

    r2028160 r2034567  
    2828    public $communicator    = null;
    2929    public $menu            = null;
    30     public $ajaxErrors      = array();
    3130    public $productStatuses = array();
    3231    public $recommsDefault  = array();
     
    853852        $this->setupCommunicator();
    854853        $this->checkDbConnect();
    855         $this->setupErrHandling();
    856854       
    857855        (object)$this->rre_ajax_interface = RecombeeReAjaxSetup::instance();
     
    10761074    }
    10771075   
    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
    11831077}
  • recombee-recommendation-engine/trunk/includes/class-RecombeeReAjaxSetup.php

    r1971748 r2034567  
    5959    }
    6060   
    61     public static function  do_virtual_page($template){
     61    public static function do_virtual_page($template){
    6262       
    6363        global $wp_query;
     
    108108                define( 'WP_DOING_AJAX', true );
    109109            }
     110           
     111            RecombeeReAjaxErrors::setupErrHandling();
    110112        }
    111113       
  • recombee-recommendation-engine/trunk/includes/class-RecombeeReBlogSettingsDb.php

    r1962791 r2034567  
    562562                }
    563563               
    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);
    566569                   
    567570                    if(isset($prop_set['rejected'])){
     
    936939    /* PSEUDO DATA */
    937940    private function getCustomerPurchaseValuePseudo($customer_data){
    938        
     941        global $wpdb;
    939942        $return = false;
    940943        ( (int)$customer_data['user_id'] === 0 ) ? $customer_id = $customer_data['billing_email_hash'] : $customer_id = (int)$customer_data['user_id'];
     
    22132216        $return->message->recombee = $log;
    22142217       
    2215         if( !empty( $this->recombee->ajaxErrors ) ){
    2216             $return->message->errors = $this->recombee->ajaxErrors;
     2218        if( !empty( RecombeeReAjaxErrors::$ajaxErrors ) ){
     2219            $return->message->errors = RecombeeReAjaxErrors::$ajaxErrors;
    22172220        }
    22182221        if($type == 'nonce_true'){
  • recombee-recommendation-engine/trunk/readme.txt

    r2028164 r2034567  
    44Requires at least: 4.9
    55Tested up to: 4.9
    6 Stable tag: 2.6.4
     6Stable tag: 2.6.5
    77Requires PHP: 5.5
    88WC requires at least: 3.3
     
    6060
    6161== 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
    6265= 2.6.4 - 10-02-2019 =
    6366* Fix - Error in default value of shortcode for setting page fixed
  • recombee-recommendation-engine/trunk/recombee-re.php

    r2028164 r2034567  
    55 * Author: Recombee
    66 * Author URI: https://recombee.com
    7  * Version: 2.6.4
     7 * Version: 2.6.5
    88 * License: GPLv3
    99 * Text Domain: recombee-recommendation-engine
Note: See TracChangeset for help on using the changeset viewer.