Changeset 3796150
- Timestamp:
- 11/11/2026 11:15:20 AM (less than one hour ago)
- Location:
- conversell-voice-shopping-builder
- Files:
-
- 2 added
- 2 deleted
- 70 edited
-
tags/1.0.0/ModuleStaticData.php (modified) (6 diffs)
-
tags/1.0.0/assets/img/Asset 1.png (deleted)
-
tags/1.0.0/assets/img/asset-1.png (added)
-
tags/1.0.0/classes/ConversellAjaxRequest.php (modified) (1 diff)
-
tags/1.0.0/classes/ConversellComfirmOrderAsync.php (modified) (1 diff)
-
tags/1.0.0/classes/ConversellFavizoneAccount.php (modified) (2 diffs)
-
tags/1.0.0/classes/ConversellFavizoneApi.php (modified) (1 diff)
-
tags/1.0.0/classes/ConversellFavizoneCommon.php (modified) (14 diffs)
-
tags/1.0.0/classes/ConversellFavizoneExport.php (modified) (1 diff)
-
tags/1.0.0/classes/ConversellFavizoneMetaProduct.php (modified) (6 diffs)
-
tags/1.0.0/classes/ConversellFavizoneOrder.php (modified) (4 diffs)
-
tags/1.0.0/classes/ConversellFavizoneSender.php (modified) (1 diff)
-
tags/1.0.0/classes/ConversellSettings.php (modified) (5 diffs)
-
tags/1.0.0/classes/ManageCrone.php (modified) (1 diff)
-
tags/1.0.0/classes/api/ConversationalGeneralApis.php (modified) (2 diffs)
-
tags/1.0.0/classes/api/messenger/MessengerConversellFulfillment_Rest_Api.php (modified) (10 diffs)
-
tags/1.0.0/classes/conversell/messenger/ConversellAccount.php (modified) (2 diffs)
-
tags/1.0.0/classes/conversell/messenger/ConversellCommon.php (modified) (1 diff)
-
tags/1.0.0/classes/conversell/messenger/hook/AccountLinking.php (modified) (2 diffs)
-
tags/1.0.0/classes/hook/ConversellAjaxRequest.php (modified) (1 diff)
-
tags/1.0.0/classes/hook/ConversellFavizoneDownloadHook.php (modified) (3 diffs)
-
tags/1.0.0/classes/hook/ConversellFavizoneExportHook.php (modified) (1 diff)
-
tags/1.0.0/classes/hook/ConversellFavizoneOpenHook.php (modified) (1 diff)
-
tags/1.0.0/classes/hook/FavizoneCatalogueTask.php (modified) (2 diffs)
-
tags/1.0.0/classes/hook/FavizoneEvent.php (modified) (9 diffs)
-
tags/1.0.0/classes/hook/adminhook/ConversellFavizoneCategoryHook.php (modified) (1 diff)
-
tags/1.0.0/classes/hook/adminhook/ConversellFavizoneProductHook.php (modified) (1 diff)
-
tags/1.0.0/classes/process_manager/ProcessManager.php (modified) (3 diffs)
-
tags/1.0.0/classes/process_manager/ProcessManagerMessenger.php (modified) (1 diff)
-
tags/1.0.0/conversell-conversational-shopping-builder.php (modified) (3 diffs)
-
tags/1.0.0/view/conversell_bot_settings.php (modified) (2 diffs)
-
tags/1.0.0/view/conversell_install.php (modified) (1 diff)
-
tags/1.0.0/view/conversell_settings.php (modified) (3 diffs)
-
tags/1.0.0/view/create_bot.php (modified) (1 diff)
-
tags/1.0.0/view/function.php (modified) (2 diffs)
-
tags/1.0.0/view/order_states_config.php (modified) (2 diffs)
-
tags/1.0.0/view/verify_email.php (modified) (10 diffs)
-
trunk/ModuleStaticData.php (modified) (6 diffs)
-
trunk/assets/img/Asset 1.png (deleted)
-
trunk/assets/img/asset-1.png (added)
-
trunk/classes/ConversellAjaxRequest.php (modified) (1 diff)
-
trunk/classes/ConversellComfirmOrderAsync.php (modified) (1 diff)
-
trunk/classes/ConversellFavizoneAccount.php (modified) (2 diffs)
-
trunk/classes/ConversellFavizoneApi.php (modified) (1 diff)
-
trunk/classes/ConversellFavizoneCommon.php (modified) (14 diffs)
-
trunk/classes/ConversellFavizoneExport.php (modified) (1 diff)
-
trunk/classes/ConversellFavizoneMetaProduct.php (modified) (6 diffs)
-
trunk/classes/ConversellFavizoneOrder.php (modified) (4 diffs)
-
trunk/classes/ConversellFavizoneSender.php (modified) (1 diff)
-
trunk/classes/ConversellSettings.php (modified) (5 diffs)
-
trunk/classes/ManageCrone.php (modified) (1 diff)
-
trunk/classes/api/ConversationalGeneralApis.php (modified) (2 diffs)
-
trunk/classes/api/messenger/MessengerConversellFulfillment_Rest_Api.php (modified) (10 diffs)
-
trunk/classes/conversell/messenger/ConversellAccount.php (modified) (2 diffs)
-
trunk/classes/conversell/messenger/ConversellCommon.php (modified) (1 diff)
-
trunk/classes/conversell/messenger/hook/AccountLinking.php (modified) (2 diffs)
-
trunk/classes/hook/ConversellAjaxRequest.php (modified) (1 diff)
-
trunk/classes/hook/ConversellFavizoneDownloadHook.php (modified) (3 diffs)
-
trunk/classes/hook/ConversellFavizoneExportHook.php (modified) (1 diff)
-
trunk/classes/hook/ConversellFavizoneOpenHook.php (modified) (1 diff)
-
trunk/classes/hook/FavizoneCatalogueTask.php (modified) (2 diffs)
-
trunk/classes/hook/FavizoneEvent.php (modified) (9 diffs)
-
trunk/classes/hook/adminhook/ConversellFavizoneCategoryHook.php (modified) (1 diff)
-
trunk/classes/hook/adminhook/ConversellFavizoneProductHook.php (modified) (1 diff)
-
trunk/classes/process_manager/ProcessManager.php (modified) (3 diffs)
-
trunk/classes/process_manager/ProcessManagerMessenger.php (modified) (1 diff)
-
trunk/conversell-conversational-shopping-builder.php (modified) (3 diffs)
-
trunk/view/conversell_bot_settings.php (modified) (2 diffs)
-
trunk/view/conversell_install.php (modified) (1 diff)
-
trunk/view/conversell_settings.php (modified) (3 diffs)
-
trunk/view/create_bot.php (modified) (1 diff)
-
trunk/view/function.php (modified) (2 diffs)
-
trunk/view/order_states_config.php (modified) (2 diffs)
-
trunk/view/verify_email.php (modified) (10 diffs)
Legend:
- Unmodified
- Added
- Removed
-
conversell-voice-shopping-builder/tags/1.0.0/ModuleStaticData.php
r3793880 r3796150 21 21 22 22 public function __construct($rest_url){ 23 $this->cmsShop = parse_url(site_url(), PHP_URL_HOST);23 $this->cmsShop = wp_parse_url(site_url(), PHP_URL_HOST); 24 24 $this->rest_url = trailingslashit($rest_url); 25 25 self::$PLUGIN_PATH = rtrim(WP_PLUGIN_DIR, DIRECTORY_SEPARATOR) . '/' . $this->PLUGIN_NAME; … … 38 38 //$this->generate_json_export(); 39 39 //$this->initialize_channel_meta(); 40 } 41 42 private function catalogue_directory_is_writable() { 43 if ( ! class_exists( 'WP_Filesystem_Direct' ) ) { 44 require_once ABSPATH . 'wp-admin/includes/class-wp-filesystem-base.php'; 45 require_once ABSPATH . 'wp-admin/includes/class-wp-filesystem-direct.php'; 46 } 47 $filesystem = new \WP_Filesystem_Direct( false ); 48 return $filesystem->is_writable( $this->CATALOGUE_DIR_PATH ); 40 49 } 41 50 … … 50 59 51 60 if (!file_exists($this->CATALOGUE_DIR_PATH)) { 52 $created = wp_mkdir_p($this->CATALOGUE_DIR_PATH); 53 if (!$created) { 54 $created = @mkdir($this->CATALOGUE_DIR_PATH, 0755, true); 55 } 56 if (!$created) { 61 if (!wp_mkdir_p($this->CATALOGUE_DIR_PATH)) { 57 62 error_log('Conversell: Could not create export directory: ' . $this->CATALOGUE_DIR_PATH); 58 63 return false; … … 63 68 64 69 private function generate_json_export() { 65 if (!file_exists($this->CATALOGUE_DIR_PATH) || ! is_writable($this->CATALOGUE_DIR_PATH)) {70 if (!file_exists($this->CATALOGUE_DIR_PATH) || !$this->catalogue_directory_is_writable()) { 66 71 error_log('Conversell: Export directory not available or not writable: ' . $this->CATALOGUE_DIR_PATH); 67 72 return; … … 260 265 private function get_sale_from_date($product) { 261 266 $from_date = $product->get_meta('_sale_price_dates_from', true); 262 return $from_date ? date('Y-m-d H:i:s', (int)$from_date) : '';267 return $from_date ? gmdate('Y-m-d H:i:s', (int)$from_date) : ''; 263 268 } 264 269 265 270 private function get_sale_to_date($product) { 266 271 $to_date = $product->get_meta('_sale_price_dates_to', true); 267 return $to_date ? date('Y-m-d H:i:s', (int)$to_date) : '';272 return $to_date ? gmdate('Y-m-d H:i:s', (int)$to_date) : ''; 268 273 } 269 274 … … 410 415 private function get_product_date($product,$type='created'){ 411 416 $date = ($type==='created') ? $product->get_date_created() : $product->get_date_modified(); 412 return $date ? $date->format('Y-m-d H:i:s').'.0' : date('Y-m-d H:i:s').'.0';417 return $date ? $date->format('Y-m-d H:i:s').'.0' : gmdate('Y-m-d H:i:s').'.0'; 413 418 } 414 419 -
conversell-voice-shopping-builder/tags/1.0.0/classes/ConversellAjaxRequest.php
r3793880 r3796150 1 1 <?php 2 2 namespace conversell_conversational_shopping; 3 4 if ( ! defined( 'ABSPATH' ) ) { 5 exit; 6 } 7 3 8 require_once __DIR__ . '../../ConversellFavizoneCommon.php'; 4 9 require_once __DIR__ . '../../ConversellFavizoneCommon.php'; -
conversell-voice-shopping-builder/tags/1.0.0/classes/ConversellComfirmOrderAsync.php
r3793880 r3796150 2 2 use google_assistant as google_assistant; 3 3 use conversell_conversational_shopping as conversell; 4 5 if ( ! defined( 'ABSPATH' ) ) { 6 exit; 7 } 4 8 require_once __DIR__ . '/conversell/google_assistant/ConversellPayment.php'; 5 9 require_once __DIR__ . '/ConversellFavizoneCommon.php'; -
conversell-voice-shopping-builder/tags/1.0.0/classes/ConversellFavizoneAccount.php
r3793880 r3796150 109 109 ){ 110 110 $bot_data = array(); 111 $site_domaine = parse_url($site_url,PHP_URL_HOST);111 $site_domaine = wp_parse_url($site_url,PHP_URL_HOST); 112 112 $bot_data['botName'] = $bot_name; 113 113 $bot_data['botTitle'] = $bot_name; … … 120 120 $bot_data['cmsShop'] = $site_domaine; 121 121 $bot_data['userID'] = $config->userId; 122 $bot_data['timeStamp'] = date("Y-m-d H:i:s");122 $bot_data['timeStamp'] = gmdate("Y-m-d H:i:s"); 123 123 $bot_data["catalog_name"] = $isAppActivate?$site_name.'-'.$lang.'-' 124 124 .get_option('woocommerce_currency') -
conversell-voice-shopping-builder/tags/1.0.0/classes/ConversellFavizoneApi.php
r3793880 r3796150 111 111 public static function rewriteToActiveAppOrigin($uri) 112 112 { 113 $parts = parse_url((string) $uri);113 $parts = wp_parse_url((string) $uri); 114 114 if (!is_array($parts) || empty($parts['host'])) { 115 115 return null; -
conversell-voice-shopping-builder/tags/1.0.0/classes/ConversellFavizoneCommon.php
r3793880 r3796150 64 64 'language' => get_locale(), 65 65 'shopUrl' => site_url(), 66 'shopName' => $cmsShop ?: parse_url(site_url(), PHP_URL_HOST),66 'shopName' => $cmsShop ?: wp_parse_url(site_url(), PHP_URL_HOST), 67 67 'connectedSince' => $connectedSince, 68 68 'country_code' => $countryCode, … … 88 88 */ 89 89 public function uninstallPlugin($cmsShop){ 90 $shopName = $cmsShop ?: parse_url(site_url(), PHP_URL_HOST);90 $shopName = $cmsShop ?: wp_parse_url(site_url(), PHP_URL_HOST); 91 91 $workspaceId = get_option('conversell_workspace_id'); 92 92 $body = array( … … 222 222 public function get_favizone_site_access_key(){ 223 223 $workspace_id = get_option( 'conversell_workspace_id' ); 224 $shop_name = parse_url( site_url(), PHP_URL_HOST );224 $shop_name = wp_parse_url( site_url(), PHP_URL_HOST ); 225 225 $body = array( 226 226 'cms' => 'woocommerce', … … 320 320 */ 321 321 public function getWidgetChat($mode = 'float') { 322 $shopName = parse_url(site_url(), PHP_URL_HOST);322 $shopName = wp_parse_url(site_url(), PHP_URL_HOST); 323 323 if (!$shopName) { 324 324 return false; … … 343 343 'cms' => 'woocommerce', 344 344 'workspaceId' => get_option( 'conversell_workspace_id'), 345 'shopName' => parse_url(site_url(), PHP_URL_HOST),345 'shopName' => wp_parse_url(site_url(), PHP_URL_HOST), 346 346 ) 347 347 ); … … 361 361 public function getConversellAppEntryUrl(){ 362 362 $origin = ConversellFavizoneApi::getConversellAppOrigin(); 363 $shopName = parse_url(site_url(), PHP_URL_HOST);363 $shopName = wp_parse_url(site_url(), PHP_URL_HOST); 364 364 $signup = $origin . '/auth/signup?' . http_build_query(array( 365 365 'shopName' => $shopName, … … 375 375 } 376 376 $query = array(); 377 $qs = parse_url($res->redirect_uri, PHP_URL_QUERY);377 $qs = wp_parse_url($res->redirect_uri, PHP_URL_QUERY); 378 378 if (is_string($qs)) { 379 379 parse_str($qs, $query); … … 401 401 return ConversellFavizoneApi::rewriteToActiveAppOrigin($uri); 402 402 } 403 $parts = parse_url((string) $uri);403 $parts = wp_parse_url((string) $uri); 404 404 if (!is_array($parts) || empty($parts['host'])) { 405 405 return null; … … 459 459 $args = array(); 460 460 $args = wp_parse_args($args, apply_filters('woocommerce_breadcrumb_defaults', array( 461 'home' => _x('Home', 'breadcrumb', ' woocommerce'),461 'home' => _x('Home', 'breadcrumb', 'conversell-voice-shopping-builder'), 462 462 ))); 463 463 … … 489 489 $args = array(); 490 490 $args = wp_parse_args($args, apply_filters('woocommerce_breadcrumb_defaults', array( 491 'home' => _x('Home', 'breadcrumb', ' woocommerce'),491 'home' => _x('Home', 'breadcrumb', 'conversell-voice-shopping-builder'), 492 492 ))); 493 493 $breadcrumbs = new \WC_Breadcrumb(); … … 523 523 $hide_empty = false ; 524 524 $cat_args = array( 525 'taxonomy' => 'product_cat', 525 526 'orderby' => $orderby, 526 527 'order' => $order, 527 528 'hide_empty' => $hide_empty, 528 529 ); 529 $product_categories = get_terms( 'product_cat',$cat_args );530 $product_categories = get_terms( $cat_args ); 530 531 foreach($product_categories as $product_categorie){ 531 532 $categories_name = $this->fv_product->generate_categories($product_categorie); … … 559 560 ConversellSettings::startExportCatalog(); 560 561 $fz_export = new ConversellFavizoneExport($this->moduleStaticData); 561 $settings = $this->get_favizone_site_access_key( parse_url(site_url(),PHP_URL_HOST));562 $settings = $this->get_favizone_site_access_key(wp_parse_url(site_url(),PHP_URL_HOST)); 562 563 563 564 /**$initShopUrl = $this->initShopUrl( … … 578 579 public function importCatalog(){ 579 580 do_action('logger',['gfhgjrjeygfdhgjhdfkygrtrt']); 580 $settings = $this->get_favizone_site_access_key( parse_url(site_url(),PHP_URL_HOST));581 $settings = $this->get_favizone_site_access_key(wp_parse_url(site_url(),PHP_URL_HOST)); 581 582 $res = $this->fv_sender->favizone_post_request( 582 583 $this->fv_api->getFavizoneLinkingHost(), … … 1019 1020 } 1020 1021 public function getConversellCustomers(){ 1021 $settings = $this->get_favizone_site_access_key( parse_url(site_url(),PHP_URL_HOST));1022 $settings = $this->get_favizone_site_access_key(wp_parse_url(site_url(),PHP_URL_HOST)); 1022 1023 $result = $this->fv_sender->favizone_post_request( 1023 1024 $this->fv_api->getFavizoneLinkingHost(), -
conversell-voice-shopping-builder/tags/1.0.0/classes/ConversellFavizoneExport.php
r3793880 r3796150 718 718 $fileRes = $favizone_dom->save($favizone_file_xml); 719 719 } catch (Exception $e) { 720 echo "$e";720 echo esc_html( $e->getMessage() ); 721 721 } 722 722 } -
conversell-voice-shopping-builder/tags/1.0.0/classes/ConversellFavizoneMetaProduct.php
r3793880 r3796150 56 56 $this->setProductData("shop_id", get_current_blog_id()); 57 57 //description 58 do_action("logger",['hfeiuyfsydytrerzrze8745'=> strip_tags($favizone_product->get_description())]);59 $favizone_description = strip_tags($favizone_product->get_description());58 do_action("logger",['hfeiuyfsydytrerzrze8745'=>wp_strip_all_tags($favizone_product->get_description())]); 59 $favizone_description = wp_strip_all_tags($favizone_product->get_description()); 60 60 ($favizone_description !== '' ) ? $this->setProductData("description", $favizone_description) : true; 61 61 //shortDescription 62 $favizone_short_description = strip_tags($favizone_product->get_short_description());62 $favizone_short_description = wp_strip_all_tags($favizone_product->get_short_description()); 63 63 ($favizone_short_description !== '' ) ? $this->setProductData("shortDescription", $favizone_short_description) : true; 64 64 //price … … 129 129 //isNew 130 130 $favizone_date_created = new \DateTime($product_parent->get_date_created()->date("Y/m/d")); 131 $data_now = new \DateTime( date('Y/m/d'));131 $data_now = new \DateTime(gmdate('Y/m/d')); 132 132 $dure = get_option("conversellGeneralSettings")['newProductNbrDate']; 133 133 $date_diff = $data_now->diff($favizone_date_created); … … 142 142 $this->setProductData( 143 143 "isNew_to_date", 144 date('Y-d-m H:i:s', strtotime("+$dure day"))144 gmdate('Y-d-m H:i:s', strtotime("+$dure day")) 145 145 ); 146 146 } … … 200 200 $this->setProductData("reference", $favizone_product->get_sku()); 201 201 //description 202 $favizone_description = strip_tags($favizone_product->get_description());202 $favizone_description = wp_strip_all_tags($favizone_product->get_description()); 203 203 ($favizone_description !== '' ) ? $this->setProductData("description", $favizone_description) : true; 204 204 //shortDescription 205 $favizone_short_description = strip_tags($favizone_product->get_short_description());205 $favizone_short_description = wp_strip_all_tags($favizone_product->get_short_description()); 206 206 ($favizone_short_description !== '' ) ? $this->setProductData("shortDescription", $favizone_short_description) : true; 207 207 //price … … 270 270 //isNew 271 271 $favizone_date_created = new \DateTime($favizone_product->get_date_created()->date("Y/m/d")); 272 $data_now = new \DateTime( date('Y/m/d'));272 $data_now = new \DateTime(gmdate('Y/m/d')); 273 273 $dure = get_option("conversellGeneralSettings")['newProductNbrDate']; 274 274 if( $data_now->diff($favizone_date_created)->d <= $dure ){ … … 281 281 $this->setProductData( 282 282 "isNew_to_date", 283 date('Y-d-m H:i:s', strtotime("+$dure day"))283 gmdate('Y-d-m H:i:s', strtotime("+$dure day")) 284 284 ); 285 285 } -
conversell-voice-shopping-builder/tags/1.0.0/classes/ConversellFavizoneOrder.php
r3793880 r3796150 32 32 } 33 33 private function get_count_orders_pages(){ 34 $to_date = date('Y-m-d');35 $initial_date = date('Y-m-d', strtotime('-1 year'));34 $to_date = gmdate('Y-m-d'); 35 $initial_date = gmdate('Y-m-d', strtotime('-1 year')); 36 36 $query = new \WC_Order_Query( array( 37 37 'orderby' => 'date', … … 52 52 $favizone_pages = $this->get_count_orders_pages(); 53 53 $favizone_init_done = false; 54 $to_date = date('Y-m-d');55 $initial_date = date('Y-m-d', strtotime('-1 year'));54 $to_date = gmdate('Y-m-d'); 55 $initial_date = gmdate('Y-m-d', strtotime('-1 year')); 56 56 $customers = $fvCommon->getConversellCustomers(); 57 57 if(is_array($customers)){ … … 115 115 function favizone_send_customers_init_order($customersOrders){ 116 116 $fz_common = new ConversellFavizoneCommon(); 117 $settings = $this->get_favizone_site_access_key( parse_url(site_url(),PHP_URL_HOST));117 $settings = $this->get_favizone_site_access_key(wp_parse_url(site_url(),PHP_URL_HOST)); 118 118 $favizone_data_to_send = array( 119 119 "key" => $favizone_access_key, … … 146 146 $favizone_pages = $this->get_count_orders_pages(); 147 147 $favizone_init_done = false; 148 $to_date = date('Y-m-d');149 $initial_date = date('Y-m-d', strtotime('-1 year'));148 $to_date = gmdate('Y-m-d'); 149 $initial_date = gmdate('Y-m-d', strtotime('-1 year')); 150 150 while ( 151 151 $this->favizone_offset <= $favizone_pages -
conversell-voice-shopping-builder/tags/1.0.0/classes/ConversellFavizoneSender.php
r3793880 r3796150 113 113 private function favizone_post_by_fsock($favizone_url, $favizone_path, $favizone_body) 114 114 { 115 $favizone_url1 = parse_url($favizone_url) ; 116 $favizone_host = $favizone_url1['host'] ; 117 $favizone_port = $favizone_url1['port'] ; 118 $favizone_fp = fsockopen(gethostbyname($favizone_host), $favizone_port, $errno, $errstr, 1000) ; 119 if ($favizone_fp) { 120 socket_set_timeout($favizone_fp, 6) ; 121 $out = "POST ".$favizone_path." HTTP/1.0\r\n" ; 122 $out .= "Host: ".$favizone_host."\r\n" ; 123 //$out .= 'Content-Length: '.Tools::strlen($body)."\r\n" ; 124 $out .= 'Accept : application/json'."\r\n" ; 125 $out .= 'Origin : '.$_SERVER['SERVER_NAME']."\r\n" ; 126 $out .= 'Content-Type : application/json'."\r\n" ; 127 $out .= "Connection: Close\r\n\r\n" ; 128 $out .= 'Access-Control-Allow-Origin: *'; 129 @fwrite($favizone_fp, $out.$favizone_body) ; 130 $tmp = '' ; 131 while (!feof($favizone_fp)) { 132 $tmp .= trim(fgets($favizone_fp, 1024)) ; 133 } 134 $favizone_result = $tmp ; 135 fclose($favizone_fp) ; 115 $favizone_response = wp_remote_post( 116 $favizone_url . $favizone_path, 117 array( 118 'timeout' => 30, 119 'headers' => array( 120 'Content-Type' => 'application/json', 121 'Accept' => 'application/json', 122 ), 123 'body' => $favizone_body, 124 ) 125 ); 126 if ( is_wp_error( $favizone_response ) ) { 127 return false; 136 128 } 137 return (isset($favizone_result) ? $favizone_result : false);129 return wp_remote_retrieve_body( $favizone_response ); 138 130 } 139 131 } -
conversell-voice-shopping-builder/tags/1.0.0/classes/ConversellSettings.php
r3793880 r3796150 12 12 $this->canalTitle = $canal_title; 13 13 $this->fvCommon = new ConversellFavizoneCommon(); 14 $this->cmsShop = parse_url(site_url(),PHP_URL_HOST);14 $this->cmsShop = wp_parse_url(site_url(),PHP_URL_HOST); 15 15 } 16 16 public static function uninstallPlugin($moduleStaticData){ … … 83 83 'FilterCollections' => [], 84 84 'newProductNbrDate' => $settings->defaultSettings->isNew, 85 'catalogLastUpdateDate' => date("Y/m/d"),85 'catalogLastUpdateDate' => gmdate("Y/m/d"), 86 86 'isVoicePayment' => false 87 87 )); 88 88 if(!file_exists($moduleStaticData->CATALOGUE_DIR_PATH)) 89 mkdir($moduleStaticData->CATALOGUE_DIR_PATH, 0777, true);89 wp_mkdir_p($moduleStaticData->CATALOGUE_DIR_PATH); 90 90 self::setAutoRedirect(); 91 91 }else{ … … 138 138 do_action('logger',['autoRedirect in000000000000']); 139 139 delete_option('our_conversell_auto_redirect'); 140 exit( wp_redirect(admin_url("admin.php?page=conversell")) ); 140 wp_safe_redirect( admin_url( 'admin.php?page=conversell' ) ); 141 exit; 141 142 } 142 143 } … … 176 177 'FilterCollections' => [], 177 178 'newProductNbrDate' => 30, 178 'catalogLastUpdateDate' => date("Y/m/d")179 'catalogLastUpdateDate' => gmdate("Y/m/d") 179 180 )); 180 181 } … … 231 232 public function catalogLastUpdateDate(){ 232 233 $settings = get_option("conversellGeneralSettings"); 233 $settings['catalogLastUpdateDate'] = date("Y/m/d");234 $settings['catalogLastUpdateDate'] = gmdate("Y/m/d"); 234 235 update_option('conversellGeneralSettings',$settings); 235 236 } -
conversell-voice-shopping-builder/tags/1.0.0/classes/ManageCrone.php
r3793880 r3796150 63 63 $schedules['favizone_schedules_now'] = array( 64 64 'interval' => 10, 65 'display' => esc_html__( 'Every Five Seconds' ), );65 'display' => esc_html__( 'Every Five Seconds', 'conversell-voice-shopping-builder' ), ); 66 66 return $schedules; 67 67 } -
conversell-voice-shopping-builder/tags/1.0.0/classes/api/ConversationalGeneralApis.php
r3793880 r3796150 136 136 $body = [ 137 137 'urls' => [], 138 'shopName' => parse_url(site_url(),PHP_URL_HOST),138 'shopName' => wp_parse_url(site_url(),PHP_URL_HOST), 139 139 'shopUrl' => site_url(), 140 140 'language' => get_locale(), … … 182 182 if (!$target) { 183 183 $target = \conversell_conversational_shopping\ConversellFavizoneApi::getConversellAppOrigin() 184 . '/auth/signup?shopName=' . rawurlencode((string) parse_url(site_url(), PHP_URL_HOST))184 . '/auth/signup?shopName=' . rawurlencode((string) wp_parse_url(site_url(), PHP_URL_HOST)) 185 185 . '&cms=woocommerce'; 186 186 } -
conversell-voice-shopping-builder/tags/1.0.0/classes/api/messenger/MessengerConversellFulfillment_Rest_Api.php
r3793880 r3796150 239 239 public function customerExists(\WP_REST_Request $request){ 240 240 $email = $request['email']; 241 $user = get_user_by _email($email);241 $user = get_user_by('email', $email); 242 242 if($user) 243 243 return new \WP_REST_Response(['id' => $user->ID], 200 ); … … 253 253 header('Content-Type: text/xml'); 254 254 $fileString = implode('', $xml); 255 echo preg_replace('/^[ \t]*[\r\n]+/m', '',$fileString); 255 $catalogue_xml = preg_replace('/^[ \t]*[\r\n]+/m', '', $fileString); 256 echo $catalogue_xml; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Catalogue response is XML, not HTML. 256 257 exit; 257 258 }else { … … 310 311 'countryCode' => $shipping_address['postalAddress']['regionCode'], 311 312 ); 312 do_action("logger", ['feyzfgtyue7878' => date("y/m/d h:i:s")]);313 do_action("logger", ['feyzfgtyue7878' => gmdate("y/m/d h:i:s")]); 313 314 do_action('wp_loaded'); 314 315 WC()->frontend_includes(); … … 317 318 WC()->initialize_cart(); 318 319 do_action( 'woocommerce_load_cart_from_session' ); 319 WC()->customer = new WC_Customer(get_user_by _email($email)->ID);320 WC()->customer = new WC_Customer(get_user_by('email', $email)->ID); 320 321 $default_shipping = $this->conversellSettings->getSettings()['canalSettings']['defaultShipping']; 321 322 WC()->customer->set_shipping_city($shipping_address['postalAddress']['locality']); … … 325 326 WC()->customer->set_shipping_first_name($shipping_address["first_name"]); 326 327 WC()->customer->set_shipping_last_name($shipping_address["last_name"]); 327 do_action("logger", ['efeizyfihkjdhdksjfyui' => date("y/m/d h:i:s")]);328 do_action("logger", ['efeizyfihkjdhdksjfyui' => gmdate("y/m/d h:i:s")]); 328 329 $lineItems = array(); 329 330 $index = 0; … … 351 352 $index ++; 352 353 } 353 do_action("logger", ['f87e9fpos' => date("y/m/d h:i:s")]);354 do_action("logger", ['f87e9fpos' => gmdate("y/m/d h:i:s")]); 354 355 $shipping = new WC_Shipping(); 355 356 $package = WC()->cart->get_shipping_packages()[0]; … … 374 375 ? $shipping_line : $shippingLineCollection[0]; 375 376 376 do_action("logger", ['fzegufyze7854l' => date("y/m/d h:i:s")]);377 do_action("logger", ['fzegufyze7854l' => gmdate("y/m/d h:i:s")]); 377 378 \WC()->session->set('chosen_shipping_methods',array($chosen_shipping_methods)); 378 379 \WC()->cart->calculate_totals(); 379 380 \WC()->cart->calculate_shipping(); 380 381 $cart_totals = \WC()->cart->get_totals(); 381 do_action("logger", ['efeyftgxgsdfsdkfuyj' => date("y/m/d h:i:s")]);382 do_action("logger", ['efeyftgxgsdfsdkfuyj' => gmdate("y/m/d h:i:s")]); 382 383 $data = array(); 383 384 $data = [ … … 404 405 ]; 405 406 do_action('logger',['fghjgfyutzeyutgfds'=>$data]); 406 do_action("logger", ['fuytfeygdsf44578545' => date("y/m/d h:i:s")]);407 do_action("logger", ['fuytfeygdsf44578545' => gmdate("y/m/d h:i:s")]); 407 408 return new \WP_REST_Response($data,200); 408 409 } … … 686 687 global $wpdb; 687 688 $order_status_key = "wc-".$order_status; 688 $sql = "SELECT* FROM favizone_order_status_notify_config WHERE customer_status = '". 689 $order_status_key."'"; 690 $order_status_config = $wpdb->get_row($sql); 689 $order_status_config = $wpdb->get_row( 690 $wpdb->prepare( 691 'SELECT * FROM favizone_order_status_notify_config WHERE customer_status = %s', 692 $order_status_key 693 ) 694 ); 695 if ( ! $order_status_config ) { 696 return null; 697 } 691 698 return $order_status_config->type_status; 692 699 } … … 696 703 global $wpdb; 697 704 $traking_customers_table_name = $wpdb->prefix . 'conversell_fulfullment_customers_tracked'; 698 $sql = "SELECT count(*) as count FROM $traking_customers_table_name WHERE customer_id = " . $customer_id ." and shop_id = '".$shop_id."'"; 699 $res = $wpdb->get_row($sql); 700 $is_customer_traked = $res->count > 0; 705 $res = $wpdb->get_row( 706 $wpdb->prepare( 707 'SELECT COUNT(*) AS count FROM %i WHERE customer_id = %s AND shop_id = %s', 708 $traking_customers_table_name, 709 $customer_id, 710 $shop_id 711 ) 712 ); 713 $is_customer_traked = ( $res && isset( $res->count ) ) ? ( $res->count > 0 ) : false; 701 714 return $is_customer_traked; 702 715 } -
conversell-voice-shopping-builder/tags/1.0.0/classes/conversell/messenger/ConversellAccount.php
r3793880 r3796150 178 178 global $wpdb; 179 179 $bot_data = array(); 180 $site_domaine = parse_url($site_url,PHP_URL_HOST);180 $site_domaine = wp_parse_url($site_url,PHP_URL_HOST); 181 181 $cv_common = new ConversellCommon(); 182 182 $bot_data['botName'] = $bot_name; … … 190 190 $bot_data['cmsShop'] = $site_domaine; 191 191 $bot_data['userID'] = $config['user_id']; 192 $bot_data['timeStamp'] = date("Y-m-d H:i:s");192 $bot_data['timeStamp'] = gmdate("Y-m-d H:i:s"); 193 193 $bot_data["catalog_name"] = $site_name.'-'.$lang.'-' 194 194 .get_option('woocommerce_currency'); -
conversell-voice-shopping-builder/tags/1.0.0/classes/conversell/messenger/ConversellCommon.php
r3793880 r3796150 21 21 global $wpdb; 22 22 $favizone_table_name = $wpdb->prefix . 'conversell_favizone_voice_shopping_access_key'; 23 $sql = "SELECT * FROM $favizone_table_name WHERE sites_id = '" . $site_id ."' and lang = '".$lang."'"; 24 $conversell_favizone_voice_shopping_access_key = $wpdb->get_row($sql); 25 return $conversell_favizone_voice_shopping_access_key->bot_id!==null?true:false; 23 $conversell_favizone_voice_shopping_access_key = $wpdb->get_row( 24 $wpdb->prepare( 25 'SELECT * FROM %i WHERE sites_id = %s AND lang = %s', 26 $favizone_table_name, 27 $site_id, 28 $lang 29 ) 30 ); 31 if ( ! $conversell_favizone_voice_shopping_access_key ) { 32 return false; 33 } 34 return null !== $conversell_favizone_voice_shopping_access_key->bot_id; 26 35 } 27 36 /** -
conversell-voice-shopping-builder/tags/1.0.0/classes/conversell/messenger/hook/AccountLinking.php
r3793880 r3796150 17 17 } 18 18 public function userAuthentificationRedirectUri(){ 19 $redirect_uri = isset($_GET['redirect_uri'])? parse_url($_GET['redirect_uri'])['host']:null;19 $redirect_uri = isset($_GET['redirect_uri'])?wp_parse_url($_GET['redirect_uri'])['host']:null; 20 20 $isConversellRequest = $redirect_uri !== null && in_array($redirect_uri, $this->whiteListDomain); 21 21 if($isConversellRequest){ … … 30 30 public function userAuthentification($user_login,$user){ 31 31 do_action('logger',['gurdfxbugyieruyguyfugyuegtyhjrgfhyd'=>$_GET['redirect_uri']]); 32 $redirect_uri = isset($_GET['redirect_uri'])? parse_url($_GET['redirect_uri'])['host']:null;32 $redirect_uri = isset($_GET['redirect_uri'])?wp_parse_url($_GET['redirect_uri'])['host']:null; 33 33 $isConversellRequest = $redirect_uri !== null && in_array($redirect_uri, $this->whiteListDomain); 34 34 if($isConversellRequest){ -
conversell-voice-shopping-builder/tags/1.0.0/classes/hook/ConversellAjaxRequest.php
r3793880 r3796150 1 1 <?php 2 2 namespace conversell_conversational_shopping; 3 4 if ( ! defined( 'ABSPATH' ) ) { 5 exit; 6 } 7 3 8 require_once __DIR__ . '../../ConversellFavizoneCommon.php'; 4 9 require_once __DIR__ . '../../ConversellFavizoneCommon.php'; -
conversell-voice-shopping-builder/tags/1.0.0/classes/hook/ConversellFavizoneDownloadHook.php
r3793880 r3796150 7 7 */ 8 8 namespace conversell_conversational_shopping; 9 10 if ( ! defined( 'ABSPATH' ) ) { 11 exit; 12 } 13 9 14 require_once CONVERSELL_CSB_DIR . 'classes/ConversellFavizoneExport.php'; 10 15 … … 19 24 $favizone_date = gmdate('D, d M Y H:i:s'); 20 25 if(intval(get_query_var('favizone_download_trigger')) == 1){ 21 $favizone_export_site = get_query_var('favizone_export_download_site');26 $favizone_export_site = sanitize_file_name( (string) get_query_var( 'favizone_export_download_site' ) ); 22 27 if (isset($favizone_export_site)) { 23 28 $favizone_local_file = CONVERSELL_CSB_DIR . 'ConversellFavizoneExport/favizone-export-cataloge-'.$favizone_export_site.'.xml'; 24 29 if (file_exists($favizone_local_file) && is_file($favizone_local_file)) { 25 chmod($favizone_local_file, 0644); 30 if ( ! class_exists( 'WP_Filesystem_Direct' ) ) { 31 require_once ABSPATH . 'wp-admin/includes/class-wp-filesystem-base.php'; 32 require_once ABSPATH . 'wp-admin/includes/class-wp-filesystem-direct.php'; 33 } 34 $filesystem = new \WP_Filesystem_Direct( false ); 35 $filesystem->chmod( $favizone_local_file, 0644 ); 36 $catalogue_xml = $filesystem->get_contents( $favizone_local_file ); 26 37 // Vous voulez afficher un xml 27 38 header('Content-Type: text/xml'); … … 31 42 header('Expires: ' . $favizone_date); 32 43 // Le source du xml original.xml 33 readfile($favizone_local_file);44 echo $catalogue_xml; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Catalogue file download is XML, not HTML. 34 45 exit(); 35 46 } else { -
conversell-voice-shopping-builder/tags/1.0.0/classes/hook/ConversellFavizoneExportHook.php
r3793880 r3796150 34 34 $fz_export = new ConversellFavizoneExport($this->moduleStaticData); 35 35 $favizone_export = $fz_export->favizone_export($favizone_export_access_key, $favizone_export_site, $favizone_export_lang); 36 echo $favizone_export;36 echo esc_html( wp_json_encode( $favizone_export ) ); 37 37 exit; 38 38 } -
conversell-voice-shopping-builder/tags/1.0.0/classes/hook/ConversellFavizoneOpenHook.php
r3793880 r3796150 33 33 header('Content-Type: text/xml'); 34 34 $fileString = implode('', $xml); 35 echo preg_replace('/^[ \t]*[\r\n]+/m', '',$fileString); 35 $catalogue_xml = preg_replace('/^[ \t]*[\r\n]+/m', '', $fileString); 36 echo $catalogue_xml; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Catalogue response is XML, not HTML. 36 37 exit; 37 38 }else { -
conversell-voice-shopping-builder/tags/1.0.0/classes/hook/FavizoneCatalogueTask.php
r3793880 r3796150 1 <?php 1 <?php 2 2 namespace conversell_conversational_shopping; 3 4 if ( ! defined( 'ABSPATH' ) ) { 5 exit; 6 } 7 3 8 require_once __DIR__ . '../../ConversellFavizoneExport.php'; 4 9 require_once __DIR__ . '../../ConversellFavizoneCommon.php'; … … 19 24 header('Content-Type: text/xml'); 20 25 $fileString = implode('', $xml); 21 echo preg_replace('/^[ \t]*[\r\n]+/m', '',$fileString); 26 $catalogue_xml = preg_replace('/^[ \t]*[\r\n]+/m', '', $fileString); 27 echo $catalogue_xml; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Catalogue response is XML, not HTML. 22 28 exit; 23 29 } -
conversell-voice-shopping-builder/tags/1.0.0/classes/hook/FavizoneEvent.php
r3793880 r3796150 35 35 <script> 36 36 jQuery(document).ready(function(){ 37 console.log(jQuery('#<?php echo $favizone_content_id;?>'));38 jQuery('#<?php echo $favizone_content_id;?>').append("<?php echo $favizone_html;?>");37 console.log(jQuery('#<?php echo esc_js( $favizone_content_id ); ?>')); 38 jQuery('#<?php echo esc_js( $favizone_content_id ); ?>').append("<?php echo esc_js( $favizone_html ); ?>"); 39 39 }); 40 40 … … 49 49 <script> 50 50 jQuery(document).ready(function(){ 51 console.log(jQuery('.<?php echo $favizone_content_class;?>'));52 jQuery('.<?php echo $favizone_content_class;?>').append("<?php echo $favizone_html;?>");51 console.log(jQuery('.<?php echo esc_js( $favizone_content_class ); ?>')); 52 jQuery('.<?php echo esc_js( $favizone_content_class ); ?>').append("<?php echo esc_js( $favizone_html ); ?>"); 53 53 }); 54 54 … … 102 102 <script> 103 103 jQuery(document).ready(function () { 104 jQuery('#<?php echo $favizone_content_id;?>').append("<?php echo $favizone_html;?>");104 jQuery('#<?php echo esc_js( $favizone_content_id ); ?>').append("<?php echo esc_js( $favizone_html ); ?>"); 105 105 }); 106 106 </script> … … 114 114 <script> 115 115 jQuery(document).ready(function () { 116 console.log(jQuery('.<?php echo $favizone_content_class;?>'));117 jQuery("<?php echo $favizone_html;?>").insertAfter(".<?php echo $favizone_content_class;?>");116 console.log(jQuery('.<?php echo esc_js( $favizone_content_class ); ?>')); 117 jQuery("<?php echo esc_js( $favizone_html ); ?>").insertAfter(".<?php echo esc_js( $favizone_content_class ); ?>"); 118 118 }); 119 119 </script> … … 135 135 } 136 136 $favizone_html .="</section>"; 137 echo $favizone_html;137 echo wp_kses_post( $favizone_html ); 138 138 } 139 139 function favizone_after_single_category(){ … … 156 156 (!empty($favizone_cat_obj->description)) ? $favizone_html .= "<span id='favizone_category_description'>" . $favizone_cat_obj->description . "</span>" : true;*/ 157 157 $favizone_html .= "</section>"; 158 echo $favizone_html;158 echo wp_kses_post( $favizone_html ); 159 159 } 160 160 } … … 183 183 } 184 184 $favizone_html .= "</section>"; 185 echo $favizone_html;185 echo wp_kses_post( $favizone_html ); 186 186 } 187 187 function favizone_before_shop_loop_item(){ 188 188 global $product; 189 189 $favizone_id = $product->get_id(); 190 echo "<div class='favizone_product'><span class='favizone_product_loop_identifier' style='display: none'>" . $favizone_id. "</span>";190 echo "<div class='favizone_product'><span class='favizone_product_loop_identifier' style='display: none'>" . esc_html( $favizone_id ) . "</span>"; 191 191 } 192 192 function favizone_after_shop_loop_item(){ … … 205 205 $html .= "<span id='favizone_product_active'>".$fz_meta_prod['active']."</span>"; 206 206 $html .= "</section>"; 207 echo $html;207 echo wp_kses_post( $html ); 208 208 } 209 209 function searchHiddenProduct($query) { 210 210 if ($query->is_main_query() && !is_admin() && $query->is_search()) { 211 211 $favizone_html = "<span id='favizone_search_term' style='display: none'>" . get_search_query() . "</span>"; 212 echo $favizone_html;212 echo wp_kses_post( $favizone_html ); 213 213 } 214 214 } … … 216 216 $favizone_current_user = wp_get_current_user(); 217 217 global $woocommerce; 218 $favizone_locale_parts = explode( '_', get_locale() ); 218 219 echo "<div id='favizone_user_element' style='display:none'>" . 219 "<span id='favizone_customer_email'>" . $favizone_current_user->user_email. "</span>" .220 "<span id='favizone_customer_identifier'>" . $favizone_current_user->ID. "</span>" .221 "<span id='favizone_customer_first_name'>" . $favizone_current_user->first_name. "</span>" .222 "<span id='favizone_customer_last_name'>" . $favizone_current_user->last_name. "</span>" .223 "<span id='favizone_customer_country'>" . $woocommerce->customer->get_billing_country() . "</span>" .224 "<span id='favizone_customer_languages'>" . e xplode('_', get_locale())[0] . "</span>" . //default language225 "<span id='favizone_price_currency_code'>" . get_woocommerce_currency() . "</span>" . //default currency220 "<span id='favizone_customer_email'>" . esc_html( $favizone_current_user->user_email ) . "</span>" . 221 "<span id='favizone_customer_identifier'>" . esc_html( $favizone_current_user->ID ) . "</span>" . 222 "<span id='favizone_customer_first_name'>" . esc_html( $favizone_current_user->first_name ) . "</span>" . 223 "<span id='favizone_customer_last_name'>" . esc_html( $favizone_current_user->last_name ) . "</span>" . 224 "<span id='favizone_customer_country'>" . esc_html( $woocommerce->customer->get_billing_country() ) . "</span>" . 225 "<span id='favizone_customer_languages'>" . esc_html( $favizone_locale_parts[0] ) . "</span>" . 226 "<span id='favizone_price_currency_code'>" . esc_html( get_woocommerce_currency() ) . "</span>" . 226 227 "</div>"; 227 228 } -
conversell-voice-shopping-builder/tags/1.0.0/classes/hook/adminhook/ConversellFavizoneCategoryHook.php
r3793880 r3796150 7 7 */ 8 8 namespace conversell_conversational_shopping; 9 10 if ( ! defined( 'ABSPATH' ) ) { 11 exit; 12 } 13 9 14 add_action('create_product_cat', 'conversell_favizone_create_category_alexa', 10, 1); 10 15 add_action("edited_product_cat", "conversell_favizone_edit_category_alexa"); -
conversell-voice-shopping-builder/tags/1.0.0/classes/hook/adminhook/ConversellFavizoneProductHook.php
r3793880 r3796150 7 7 */ 8 8 namespace conversell_conversational_shopping; 9 10 if ( ! defined( 'ABSPATH' ) ) { 11 exit; 12 } 13 9 14 require_once(ABSPATH . 'wp-admin/includes/upgrade.php'); 10 15 -
conversell-voice-shopping-builder/tags/1.0.0/classes/process_manager/ProcessManager.php
r3793880 r3796150 127 127 return; 128 128 } 129 echo $this->conversell_widget_chat(array('mode' => 'float')); 129 $widget_markup = $this->conversell_widget_chat( array( 'mode' => 'float' ) ); 130 echo $widget_markup; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Chat embed includes a scoped style block and markup returned for the storefront widget. 130 131 } 131 132 /** … … 157 158 $this->favizone_locale = get_locale(); 158 159 $this->site_url = site_url(); 159 $this->site_domaine = parse_url($this->site_url,PHP_URL_HOST);160 $this->site_domaine = wp_parse_url($this->site_url,PHP_URL_HOST); 160 161 $this->shop_currency = get_option('woocommerce_currency'); 161 162 $this->cmsVersion = get_bloginfo('version', 'raw'); … … 197 198 conversell_install( 198 199 get_rest_url()."conversell/completeInstallation", 199 parse_url(site_url(),PHP_URL_HOST),200 wp_parse_url(site_url(),PHP_URL_HOST), 200 201 $email, 201 202 $isUserExist === "true", -
conversell-voice-shopping-builder/tags/1.0.0/classes/process_manager/ProcessManagerMessenger.php
r3793880 r3796150 73 73 $this->favizone_locale = get_locale(); 74 74 $this->site_url = site_url(); 75 $this->site_domaine = parse_url($this->site_url,PHP_URL_HOST);75 $this->site_domaine = wp_parse_url($this->site_url,PHP_URL_HOST); 76 76 $this->shop_currency = get_option('woocommerce_currency'); 77 77 $wc_countries = new \WC_Countries(); -
conversell-voice-shopping-builder/tags/1.0.0/conversell-conversational-shopping-builder.php
r3793880 r3796150 9 9 * Developer: Conversell 10 10 * Developer URI: https://conversell.ai/ 11 * Text Domain: conversell- conversational-shopping-builder11 * Text Domain: conversell-voice-shopping-builder 12 12 * Requires at least: 6.5 13 13 * Requires PHP: 7.4 … … 187 187 return; 188 188 } 189 $shop = parse_url(site_url(), PHP_URL_HOST);189 $shop = wp_parse_url(site_url(), PHP_URL_HOST); 190 190 if (get_option('conversell_pending_install')) { 191 191 delete_option('conversell_pending_install'); … … 282 282 public function conversell_uninstall(){ 283 283 update_option("is_app_installed",0); 284 $shop = parse_url(site_url(), PHP_URL_HOST);284 $shop = wp_parse_url(site_url(), PHP_URL_HOST); 285 285 try { 286 286 if (!$this->fvCommon) { -
conversell-voice-shopping-builder/tags/1.0.0/view/conversell_bot_settings.php
r3793880 r3796150 1 <?php 1 <?php 2 if ( ! defined( 'ABSPATH' ) ) { 3 exit; 4 } 2 5 require_once 'function.php'; 3 6 function conversell_bot_settings($conversellOrderStates,$settings,$favizone_config,$moduleStaticData,$conversellSettings,$isAppActivate){ 4 7 ?> 5 8 <header> 6 <link rel="stylesheet" href="https://sdks.shopifycdn.com/polaris/3.21.0/polaris.min.css" />7 9 <style> 8 10 .info { … … 182 184 value="<?php echo esc_html($shippingMethod['id']) ?>" 183 185 selected> 184 <?php echo $shippingMethod['label']?>186 <?php echo esc_html( $shippingMethod['label'] ); ?> 185 187 </option> 186 188 <?php }else{?> -
conversell-voice-shopping-builder/tags/1.0.0/view/conversell_install.php
r3793880 r3796150 1 <?php function conversell_install($email,$is_user_exist,$favizone_config,$moduleStaticData){ ?> 1 <?php 2 if ( ! defined( 'ABSPATH' ) ) { 3 exit; 4 } 5 function conversell_install($email,$is_user_exist,$favizone_config,$moduleStaticData){ ?> 2 6 <html> 3 7 <header> 4 <link rel="stylesheet" href="https://sdks.shopifycdn.com/polaris/3.21.0/polaris.min.css" />5 8 </header> 6 9 <body> -
conversell-voice-shopping-builder/tags/1.0.0/view/conversell_settings.php
r3793880 r3796150 1 1 <?php 2 if ( ! defined( 'ABSPATH' ) ) { 3 exit; 4 } 2 5 require_once 'function.php'; 3 6 ?> … … 5 8 <html> 6 9 <header> 7 <link rel="stylesheet" href="https://sdks.shopifycdn.com/polaris/3.21.0/polaris.min.css" />8 10 <style> 9 11 .btn-group .btn-default { … … 552 554 $categoriesLevel3 = get_categories($catLevel3Args); 553 555 if(empty($categoriesLevel3)){ 554 echo $categorieLevel2->name;556 echo esc_html( $categorieLevel2->name ); 555 557 }else{ 556 558 echo esc_html('<i class="fa fa-list-ul" aria-hidden="true"></i>'); -
conversell-voice-shopping-builder/tags/1.0.0/view/create_bot.php
r3793880 r3796150 1 <?php 2 if ( ! defined( 'ABSPATH' ) ) { 3 exit; 4 } 5 ?> 1 6 <strong> 2 7 NO BOT -
conversell-voice-shopping-builder/tags/1.0.0/view/function.php
r3793880 r3796150 1 1 <?php 2 if ( ! defined( 'ABSPATH' ) ) { 3 exit; 4 } 2 5 /** 3 6 * return array … … 20 23 $hide_empty = false ; 21 24 $cat_args = array( 25 'taxonomy' => 'product_cat', 22 26 'orderby' => $orderby, 23 27 'order' => $order, 24 28 'hide_empty' => $hide_empty, 25 29 ); 26 $product_categories = get_terms( 'product_cat',$cat_args );30 $product_categories = get_terms( $cat_args ); 27 31 return $product_categories; 28 32 } -
conversell-voice-shopping-builder/tags/1.0.0/view/order_states_config.php
r3793880 r3796150 1 1 <?php 2 if ( ! defined( 'ABSPATH' ) ) { 3 exit; 4 } 2 5 function orderStatesConfig( 3 6 $wc_states, … … 119 122 <!-- shop order states --> 120 123 <th> 121 <?php echo $wc_value?>124 <?php echo esc_html( $wc_value ); ?> 122 125 </th> 123 126 <th> -
conversell-voice-shopping-builder/tags/1.0.0/view/verify_email.php
r3793880 r3796150 1 1 <?php 2 if ( ! defined( 'ABSPATH' ) ) { 3 exit; 4 } 2 5 /** 3 6 * Installation & Email Verification – Conversell … … 6 9 function conversell_install($callback,$shopDomain,$favizone_config = null, $moduleStaticData = null) { 7 10 $cmsUtilitiesHost = \conversell_conversational_shopping\ConversellFavizoneApi::getCmsUtilitiesHost(); 11 $conversell_logo = defined( 'CONVERSELL_CSB_FILE' ) 12 ? plugins_url( 'assets/img/conv.png', CONVERSELL_CSB_FILE ) 13 : ''; 8 14 ?> 9 15 <html> … … 12 18 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 13 19 <meta name="viewport" content="width=device-width, initial-scale=1.0" /> 14 15 <!-- Polaris + Bootstrap + Fonts -->16 <link rel="stylesheet" href="https://sdks.shopifycdn.com/polaris/3.21.0/polaris.min.css" />17 <link18 href="https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700&family=Comfortaa:wght@400;500;700&display=swap"19 rel="stylesheet">20 <link rel="icon"21 href="https://us-central1-conversell-258914.cloudfunctions.net/shopifyVoiceNotifications/imgs/fav.png"22 type="image/x-icon" />23 <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">24 <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/css/bootstrap.min.css" rel="stylesheet" />25 <link rel="stylesheet" type="text/css" href="{{forwardAddress}}/css/signup.css" />26 20 <style> 27 21 body { 28 font-family: 'Montserrat', sans-serif;22 font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; 29 23 background-color: #f9fafb; 30 24 } 25 26 .container { width: min(960px, 100%); margin: 2rem auto; } 27 .row { display: flex; justify-content: center; } 28 .col-md-5 { width: min(420px, 100%); } 29 .text-center { text-align: center; } 30 .mb-2 { margin-bottom: .5rem; } 31 .mb-3 { margin-bottom: 1rem; } 32 .mb-4 { margin-bottom: 1.5rem; } 33 .mt-3 { margin-top: 1rem; } 34 .mt-5 { margin-top: 2rem; } 35 36 #exampleModal { 37 display: none; 38 position: fixed; 39 inset: 0; 40 background: rgba(0, 0, 0, .45); 41 z-index: 1000; 42 overflow: auto; 43 } 44 #exampleModal.show { display: block; } 45 .modal-dialog { max-width: 520px; margin: 8vh auto; } 46 .modal-content { background: #fff; border-radius: 12px; padding: 12px 16px 20px; } 47 48 .conversell-spinner { 49 width: 48px; 50 height: 48px; 51 border: 4px solid #e5e7eb; 52 border-top-color: #1d9ba4; 53 border-radius: 50%; 54 margin: 20vh auto 0; 55 animation: conversell-spin .8s linear infinite; 56 } 57 @keyframes conversell-spin { to { transform: rotate(360deg); } } 31 58 32 59 .box { … … 115 142 <div id="loader" style="display: none; text-align: center; margin: auto;"> 116 143 <div class="Polaris-Backdrop"> 117 <img src="https://us-central1-conversell-258914.cloudfunctions.net/shopifyVoiceNotifications/imgs/loading.gif" 118 style="margin: auto; width: 70px; z-index: 999999999999999 !important; display: block !important; margin-top: 20%;" /> 144 <div class="conversell-spinner" role="status" aria-label="Loading"></div> 119 145 </div> 120 146 </div> … … 128 154 <div class="container mt-5"> 129 155 <div class="text-center mb-4"> 130 <img src=" https://dev.conversell.ai/assets/images/conversell-logo.png" alt="Conversell Logo"156 <img src="<?php echo esc_url( $conversell_logo ); ?>" alt="Conversell Logo" 131 157 style="width:180px;"> 132 158 </div> … … 182 208 </div> 183 209 184 <!-- Scripts --> 185 <script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script> 186 <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/js/bootstrap.bundle.min.js"></script> 210 <?php 211 wp_enqueue_script( 'jquery' ); 212 wp_print_scripts( 'jquery' ); 213 ?> 214 <script>window.$ = window.jQuery;</script> 187 215 <script> 188 216 function ValidateEmail(mail) { … … 197 225 function startModal() { 198 226 console.log('startModal.................') 199 $('#exampleModal'). modal();227 $('#exampleModal').addClass('show').show(); 200 228 } 201 229 $(document).on('click', '.shop_item', function() { 202 let domain = "<?php echo $shopDomain; ?>";203 let callback = "<?php echo $callback?>";230 let domain = "<?php echo esc_js( $shopDomain ); ?>"; 231 let callback = "<?php echo esc_js( $callback ); ?>"; 204 232 let shopId = $(this).attr('data-id'); 205 233 var index = $('.shop_item').index(this); … … 306 334 </div> 307 335 <div style="text-align: center; display: none" class="success_html"> 308 < i style="font-size: 25px" class="fa fa-check-circle text-success"></i>336 <span style="font-size: 25px; color: #008060;" aria-hidden="true">✓</span> 309 337 <p> 310 338 <strong> … … 329 357 }); 330 358 331 var myModal = new bootstrap.Modal(document.getElementById('exampleModal')); 332 myModal.show(); 359 var shopModal = document.getElementById('exampleModal'); 360 if (shopModal) { 361 shopModal.style.display = 'block'; 362 shopModal.classList.add('show'); 363 } 333 364 }, 334 365 error: function(xhr, status, error) { … … 517 548 echo '<html><head><title>Select Shop</title> 518 549 519 <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/css/bootstrap.min.css" rel="stylesheet" />520 521 550 <style> 522 551 -
conversell-voice-shopping-builder/trunk/ModuleStaticData.php
r3793880 r3796150 21 21 22 22 public function __construct($rest_url){ 23 $this->cmsShop = parse_url(site_url(), PHP_URL_HOST);23 $this->cmsShop = wp_parse_url(site_url(), PHP_URL_HOST); 24 24 $this->rest_url = trailingslashit($rest_url); 25 25 self::$PLUGIN_PATH = rtrim(WP_PLUGIN_DIR, DIRECTORY_SEPARATOR) . '/' . $this->PLUGIN_NAME; … … 38 38 //$this->generate_json_export(); 39 39 //$this->initialize_channel_meta(); 40 } 41 42 private function catalogue_directory_is_writable() { 43 if ( ! class_exists( 'WP_Filesystem_Direct' ) ) { 44 require_once ABSPATH . 'wp-admin/includes/class-wp-filesystem-base.php'; 45 require_once ABSPATH . 'wp-admin/includes/class-wp-filesystem-direct.php'; 46 } 47 $filesystem = new \WP_Filesystem_Direct( false ); 48 return $filesystem->is_writable( $this->CATALOGUE_DIR_PATH ); 40 49 } 41 50 … … 50 59 51 60 if (!file_exists($this->CATALOGUE_DIR_PATH)) { 52 $created = wp_mkdir_p($this->CATALOGUE_DIR_PATH); 53 if (!$created) { 54 $created = @mkdir($this->CATALOGUE_DIR_PATH, 0755, true); 55 } 56 if (!$created) { 61 if (!wp_mkdir_p($this->CATALOGUE_DIR_PATH)) { 57 62 error_log('Conversell: Could not create export directory: ' . $this->CATALOGUE_DIR_PATH); 58 63 return false; … … 63 68 64 69 private function generate_json_export() { 65 if (!file_exists($this->CATALOGUE_DIR_PATH) || ! is_writable($this->CATALOGUE_DIR_PATH)) {70 if (!file_exists($this->CATALOGUE_DIR_PATH) || !$this->catalogue_directory_is_writable()) { 66 71 error_log('Conversell: Export directory not available or not writable: ' . $this->CATALOGUE_DIR_PATH); 67 72 return; … … 260 265 private function get_sale_from_date($product) { 261 266 $from_date = $product->get_meta('_sale_price_dates_from', true); 262 return $from_date ? date('Y-m-d H:i:s', (int)$from_date) : '';267 return $from_date ? gmdate('Y-m-d H:i:s', (int)$from_date) : ''; 263 268 } 264 269 265 270 private function get_sale_to_date($product) { 266 271 $to_date = $product->get_meta('_sale_price_dates_to', true); 267 return $to_date ? date('Y-m-d H:i:s', (int)$to_date) : '';272 return $to_date ? gmdate('Y-m-d H:i:s', (int)$to_date) : ''; 268 273 } 269 274 … … 410 415 private function get_product_date($product,$type='created'){ 411 416 $date = ($type==='created') ? $product->get_date_created() : $product->get_date_modified(); 412 return $date ? $date->format('Y-m-d H:i:s').'.0' : date('Y-m-d H:i:s').'.0';417 return $date ? $date->format('Y-m-d H:i:s').'.0' : gmdate('Y-m-d H:i:s').'.0'; 413 418 } 414 419 -
conversell-voice-shopping-builder/trunk/classes/ConversellAjaxRequest.php
r3793880 r3796150 1 1 <?php 2 2 namespace conversell_conversational_shopping; 3 4 if ( ! defined( 'ABSPATH' ) ) { 5 exit; 6 } 7 3 8 require_once __DIR__ . '../../ConversellFavizoneCommon.php'; 4 9 require_once __DIR__ . '../../ConversellFavizoneCommon.php'; -
conversell-voice-shopping-builder/trunk/classes/ConversellComfirmOrderAsync.php
r3793880 r3796150 2 2 use google_assistant as google_assistant; 3 3 use conversell_conversational_shopping as conversell; 4 5 if ( ! defined( 'ABSPATH' ) ) { 6 exit; 7 } 4 8 require_once __DIR__ . '/conversell/google_assistant/ConversellPayment.php'; 5 9 require_once __DIR__ . '/ConversellFavizoneCommon.php'; -
conversell-voice-shopping-builder/trunk/classes/ConversellFavizoneAccount.php
r3793880 r3796150 109 109 ){ 110 110 $bot_data = array(); 111 $site_domaine = parse_url($site_url,PHP_URL_HOST);111 $site_domaine = wp_parse_url($site_url,PHP_URL_HOST); 112 112 $bot_data['botName'] = $bot_name; 113 113 $bot_data['botTitle'] = $bot_name; … … 120 120 $bot_data['cmsShop'] = $site_domaine; 121 121 $bot_data['userID'] = $config->userId; 122 $bot_data['timeStamp'] = date("Y-m-d H:i:s");122 $bot_data['timeStamp'] = gmdate("Y-m-d H:i:s"); 123 123 $bot_data["catalog_name"] = $isAppActivate?$site_name.'-'.$lang.'-' 124 124 .get_option('woocommerce_currency') -
conversell-voice-shopping-builder/trunk/classes/ConversellFavizoneApi.php
r3793880 r3796150 111 111 public static function rewriteToActiveAppOrigin($uri) 112 112 { 113 $parts = parse_url((string) $uri);113 $parts = wp_parse_url((string) $uri); 114 114 if (!is_array($parts) || empty($parts['host'])) { 115 115 return null; -
conversell-voice-shopping-builder/trunk/classes/ConversellFavizoneCommon.php
r3793880 r3796150 64 64 'language' => get_locale(), 65 65 'shopUrl' => site_url(), 66 'shopName' => $cmsShop ?: parse_url(site_url(), PHP_URL_HOST),66 'shopName' => $cmsShop ?: wp_parse_url(site_url(), PHP_URL_HOST), 67 67 'connectedSince' => $connectedSince, 68 68 'country_code' => $countryCode, … … 88 88 */ 89 89 public function uninstallPlugin($cmsShop){ 90 $shopName = $cmsShop ?: parse_url(site_url(), PHP_URL_HOST);90 $shopName = $cmsShop ?: wp_parse_url(site_url(), PHP_URL_HOST); 91 91 $workspaceId = get_option('conversell_workspace_id'); 92 92 $body = array( … … 222 222 public function get_favizone_site_access_key(){ 223 223 $workspace_id = get_option( 'conversell_workspace_id' ); 224 $shop_name = parse_url( site_url(), PHP_URL_HOST );224 $shop_name = wp_parse_url( site_url(), PHP_URL_HOST ); 225 225 $body = array( 226 226 'cms' => 'woocommerce', … … 320 320 */ 321 321 public function getWidgetChat($mode = 'float') { 322 $shopName = parse_url(site_url(), PHP_URL_HOST);322 $shopName = wp_parse_url(site_url(), PHP_URL_HOST); 323 323 if (!$shopName) { 324 324 return false; … … 343 343 'cms' => 'woocommerce', 344 344 'workspaceId' => get_option( 'conversell_workspace_id'), 345 'shopName' => parse_url(site_url(), PHP_URL_HOST),345 'shopName' => wp_parse_url(site_url(), PHP_URL_HOST), 346 346 ) 347 347 ); … … 361 361 public function getConversellAppEntryUrl(){ 362 362 $origin = ConversellFavizoneApi::getConversellAppOrigin(); 363 $shopName = parse_url(site_url(), PHP_URL_HOST);363 $shopName = wp_parse_url(site_url(), PHP_URL_HOST); 364 364 $signup = $origin . '/auth/signup?' . http_build_query(array( 365 365 'shopName' => $shopName, … … 375 375 } 376 376 $query = array(); 377 $qs = parse_url($res->redirect_uri, PHP_URL_QUERY);377 $qs = wp_parse_url($res->redirect_uri, PHP_URL_QUERY); 378 378 if (is_string($qs)) { 379 379 parse_str($qs, $query); … … 401 401 return ConversellFavizoneApi::rewriteToActiveAppOrigin($uri); 402 402 } 403 $parts = parse_url((string) $uri);403 $parts = wp_parse_url((string) $uri); 404 404 if (!is_array($parts) || empty($parts['host'])) { 405 405 return null; … … 459 459 $args = array(); 460 460 $args = wp_parse_args($args, apply_filters('woocommerce_breadcrumb_defaults', array( 461 'home' => _x('Home', 'breadcrumb', ' woocommerce'),461 'home' => _x('Home', 'breadcrumb', 'conversell-voice-shopping-builder'), 462 462 ))); 463 463 … … 489 489 $args = array(); 490 490 $args = wp_parse_args($args, apply_filters('woocommerce_breadcrumb_defaults', array( 491 'home' => _x('Home', 'breadcrumb', ' woocommerce'),491 'home' => _x('Home', 'breadcrumb', 'conversell-voice-shopping-builder'), 492 492 ))); 493 493 $breadcrumbs = new \WC_Breadcrumb(); … … 523 523 $hide_empty = false ; 524 524 $cat_args = array( 525 'taxonomy' => 'product_cat', 525 526 'orderby' => $orderby, 526 527 'order' => $order, 527 528 'hide_empty' => $hide_empty, 528 529 ); 529 $product_categories = get_terms( 'product_cat',$cat_args );530 $product_categories = get_terms( $cat_args ); 530 531 foreach($product_categories as $product_categorie){ 531 532 $categories_name = $this->fv_product->generate_categories($product_categorie); … … 559 560 ConversellSettings::startExportCatalog(); 560 561 $fz_export = new ConversellFavizoneExport($this->moduleStaticData); 561 $settings = $this->get_favizone_site_access_key( parse_url(site_url(),PHP_URL_HOST));562 $settings = $this->get_favizone_site_access_key(wp_parse_url(site_url(),PHP_URL_HOST)); 562 563 563 564 /**$initShopUrl = $this->initShopUrl( … … 578 579 public function importCatalog(){ 579 580 do_action('logger',['gfhgjrjeygfdhgjhdfkygrtrt']); 580 $settings = $this->get_favizone_site_access_key( parse_url(site_url(),PHP_URL_HOST));581 $settings = $this->get_favizone_site_access_key(wp_parse_url(site_url(),PHP_URL_HOST)); 581 582 $res = $this->fv_sender->favizone_post_request( 582 583 $this->fv_api->getFavizoneLinkingHost(), … … 1019 1020 } 1020 1021 public function getConversellCustomers(){ 1021 $settings = $this->get_favizone_site_access_key( parse_url(site_url(),PHP_URL_HOST));1022 $settings = $this->get_favizone_site_access_key(wp_parse_url(site_url(),PHP_URL_HOST)); 1022 1023 $result = $this->fv_sender->favizone_post_request( 1023 1024 $this->fv_api->getFavizoneLinkingHost(), -
conversell-voice-shopping-builder/trunk/classes/ConversellFavizoneExport.php
r3793880 r3796150 718 718 $fileRes = $favizone_dom->save($favizone_file_xml); 719 719 } catch (Exception $e) { 720 echo "$e";720 echo esc_html( $e->getMessage() ); 721 721 } 722 722 } -
conversell-voice-shopping-builder/trunk/classes/ConversellFavizoneMetaProduct.php
r3793880 r3796150 56 56 $this->setProductData("shop_id", get_current_blog_id()); 57 57 //description 58 do_action("logger",['hfeiuyfsydytrerzrze8745'=> strip_tags($favizone_product->get_description())]);59 $favizone_description = strip_tags($favizone_product->get_description());58 do_action("logger",['hfeiuyfsydytrerzrze8745'=>wp_strip_all_tags($favizone_product->get_description())]); 59 $favizone_description = wp_strip_all_tags($favizone_product->get_description()); 60 60 ($favizone_description !== '' ) ? $this->setProductData("description", $favizone_description) : true; 61 61 //shortDescription 62 $favizone_short_description = strip_tags($favizone_product->get_short_description());62 $favizone_short_description = wp_strip_all_tags($favizone_product->get_short_description()); 63 63 ($favizone_short_description !== '' ) ? $this->setProductData("shortDescription", $favizone_short_description) : true; 64 64 //price … … 129 129 //isNew 130 130 $favizone_date_created = new \DateTime($product_parent->get_date_created()->date("Y/m/d")); 131 $data_now = new \DateTime( date('Y/m/d'));131 $data_now = new \DateTime(gmdate('Y/m/d')); 132 132 $dure = get_option("conversellGeneralSettings")['newProductNbrDate']; 133 133 $date_diff = $data_now->diff($favizone_date_created); … … 142 142 $this->setProductData( 143 143 "isNew_to_date", 144 date('Y-d-m H:i:s', strtotime("+$dure day"))144 gmdate('Y-d-m H:i:s', strtotime("+$dure day")) 145 145 ); 146 146 } … … 200 200 $this->setProductData("reference", $favizone_product->get_sku()); 201 201 //description 202 $favizone_description = strip_tags($favizone_product->get_description());202 $favizone_description = wp_strip_all_tags($favizone_product->get_description()); 203 203 ($favizone_description !== '' ) ? $this->setProductData("description", $favizone_description) : true; 204 204 //shortDescription 205 $favizone_short_description = strip_tags($favizone_product->get_short_description());205 $favizone_short_description = wp_strip_all_tags($favizone_product->get_short_description()); 206 206 ($favizone_short_description !== '' ) ? $this->setProductData("shortDescription", $favizone_short_description) : true; 207 207 //price … … 270 270 //isNew 271 271 $favizone_date_created = new \DateTime($favizone_product->get_date_created()->date("Y/m/d")); 272 $data_now = new \DateTime( date('Y/m/d'));272 $data_now = new \DateTime(gmdate('Y/m/d')); 273 273 $dure = get_option("conversellGeneralSettings")['newProductNbrDate']; 274 274 if( $data_now->diff($favizone_date_created)->d <= $dure ){ … … 281 281 $this->setProductData( 282 282 "isNew_to_date", 283 date('Y-d-m H:i:s', strtotime("+$dure day"))283 gmdate('Y-d-m H:i:s', strtotime("+$dure day")) 284 284 ); 285 285 } -
conversell-voice-shopping-builder/trunk/classes/ConversellFavizoneOrder.php
r3793880 r3796150 32 32 } 33 33 private function get_count_orders_pages(){ 34 $to_date = date('Y-m-d');35 $initial_date = date('Y-m-d', strtotime('-1 year'));34 $to_date = gmdate('Y-m-d'); 35 $initial_date = gmdate('Y-m-d', strtotime('-1 year')); 36 36 $query = new \WC_Order_Query( array( 37 37 'orderby' => 'date', … … 52 52 $favizone_pages = $this->get_count_orders_pages(); 53 53 $favizone_init_done = false; 54 $to_date = date('Y-m-d');55 $initial_date = date('Y-m-d', strtotime('-1 year'));54 $to_date = gmdate('Y-m-d'); 55 $initial_date = gmdate('Y-m-d', strtotime('-1 year')); 56 56 $customers = $fvCommon->getConversellCustomers(); 57 57 if(is_array($customers)){ … … 115 115 function favizone_send_customers_init_order($customersOrders){ 116 116 $fz_common = new ConversellFavizoneCommon(); 117 $settings = $this->get_favizone_site_access_key( parse_url(site_url(),PHP_URL_HOST));117 $settings = $this->get_favizone_site_access_key(wp_parse_url(site_url(),PHP_URL_HOST)); 118 118 $favizone_data_to_send = array( 119 119 "key" => $favizone_access_key, … … 146 146 $favizone_pages = $this->get_count_orders_pages(); 147 147 $favizone_init_done = false; 148 $to_date = date('Y-m-d');149 $initial_date = date('Y-m-d', strtotime('-1 year'));148 $to_date = gmdate('Y-m-d'); 149 $initial_date = gmdate('Y-m-d', strtotime('-1 year')); 150 150 while ( 151 151 $this->favizone_offset <= $favizone_pages -
conversell-voice-shopping-builder/trunk/classes/ConversellFavizoneSender.php
r3793880 r3796150 113 113 private function favizone_post_by_fsock($favizone_url, $favizone_path, $favizone_body) 114 114 { 115 $favizone_url1 = parse_url($favizone_url) ; 116 $favizone_host = $favizone_url1['host'] ; 117 $favizone_port = $favizone_url1['port'] ; 118 $favizone_fp = fsockopen(gethostbyname($favizone_host), $favizone_port, $errno, $errstr, 1000) ; 119 if ($favizone_fp) { 120 socket_set_timeout($favizone_fp, 6) ; 121 $out = "POST ".$favizone_path." HTTP/1.0\r\n" ; 122 $out .= "Host: ".$favizone_host."\r\n" ; 123 //$out .= 'Content-Length: '.Tools::strlen($body)."\r\n" ; 124 $out .= 'Accept : application/json'."\r\n" ; 125 $out .= 'Origin : '.$_SERVER['SERVER_NAME']."\r\n" ; 126 $out .= 'Content-Type : application/json'."\r\n" ; 127 $out .= "Connection: Close\r\n\r\n" ; 128 $out .= 'Access-Control-Allow-Origin: *'; 129 @fwrite($favizone_fp, $out.$favizone_body) ; 130 $tmp = '' ; 131 while (!feof($favizone_fp)) { 132 $tmp .= trim(fgets($favizone_fp, 1024)) ; 133 } 134 $favizone_result = $tmp ; 135 fclose($favizone_fp) ; 115 $favizone_response = wp_remote_post( 116 $favizone_url . $favizone_path, 117 array( 118 'timeout' => 30, 119 'headers' => array( 120 'Content-Type' => 'application/json', 121 'Accept' => 'application/json', 122 ), 123 'body' => $favizone_body, 124 ) 125 ); 126 if ( is_wp_error( $favizone_response ) ) { 127 return false; 136 128 } 137 return (isset($favizone_result) ? $favizone_result : false);129 return wp_remote_retrieve_body( $favizone_response ); 138 130 } 139 131 } -
conversell-voice-shopping-builder/trunk/classes/ConversellSettings.php
r3793880 r3796150 12 12 $this->canalTitle = $canal_title; 13 13 $this->fvCommon = new ConversellFavizoneCommon(); 14 $this->cmsShop = parse_url(site_url(),PHP_URL_HOST);14 $this->cmsShop = wp_parse_url(site_url(),PHP_URL_HOST); 15 15 } 16 16 public static function uninstallPlugin($moduleStaticData){ … … 83 83 'FilterCollections' => [], 84 84 'newProductNbrDate' => $settings->defaultSettings->isNew, 85 'catalogLastUpdateDate' => date("Y/m/d"),85 'catalogLastUpdateDate' => gmdate("Y/m/d"), 86 86 'isVoicePayment' => false 87 87 )); 88 88 if(!file_exists($moduleStaticData->CATALOGUE_DIR_PATH)) 89 mkdir($moduleStaticData->CATALOGUE_DIR_PATH, 0777, true);89 wp_mkdir_p($moduleStaticData->CATALOGUE_DIR_PATH); 90 90 self::setAutoRedirect(); 91 91 }else{ … … 138 138 do_action('logger',['autoRedirect in000000000000']); 139 139 delete_option('our_conversell_auto_redirect'); 140 exit( wp_redirect(admin_url("admin.php?page=conversell")) ); 140 wp_safe_redirect( admin_url( 'admin.php?page=conversell' ) ); 141 exit; 141 142 } 142 143 } … … 176 177 'FilterCollections' => [], 177 178 'newProductNbrDate' => 30, 178 'catalogLastUpdateDate' => date("Y/m/d")179 'catalogLastUpdateDate' => gmdate("Y/m/d") 179 180 )); 180 181 } … … 231 232 public function catalogLastUpdateDate(){ 232 233 $settings = get_option("conversellGeneralSettings"); 233 $settings['catalogLastUpdateDate'] = date("Y/m/d");234 $settings['catalogLastUpdateDate'] = gmdate("Y/m/d"); 234 235 update_option('conversellGeneralSettings',$settings); 235 236 } -
conversell-voice-shopping-builder/trunk/classes/ManageCrone.php
r3793880 r3796150 63 63 $schedules['favizone_schedules_now'] = array( 64 64 'interval' => 10, 65 'display' => esc_html__( 'Every Five Seconds' ), );65 'display' => esc_html__( 'Every Five Seconds', 'conversell-voice-shopping-builder' ), ); 66 66 return $schedules; 67 67 } -
conversell-voice-shopping-builder/trunk/classes/api/ConversationalGeneralApis.php
r3793880 r3796150 136 136 $body = [ 137 137 'urls' => [], 138 'shopName' => parse_url(site_url(),PHP_URL_HOST),138 'shopName' => wp_parse_url(site_url(),PHP_URL_HOST), 139 139 'shopUrl' => site_url(), 140 140 'language' => get_locale(), … … 182 182 if (!$target) { 183 183 $target = \conversell_conversational_shopping\ConversellFavizoneApi::getConversellAppOrigin() 184 . '/auth/signup?shopName=' . rawurlencode((string) parse_url(site_url(), PHP_URL_HOST))184 . '/auth/signup?shopName=' . rawurlencode((string) wp_parse_url(site_url(), PHP_URL_HOST)) 185 185 . '&cms=woocommerce'; 186 186 } -
conversell-voice-shopping-builder/trunk/classes/api/messenger/MessengerConversellFulfillment_Rest_Api.php
r3793880 r3796150 239 239 public function customerExists(\WP_REST_Request $request){ 240 240 $email = $request['email']; 241 $user = get_user_by _email($email);241 $user = get_user_by('email', $email); 242 242 if($user) 243 243 return new \WP_REST_Response(['id' => $user->ID], 200 ); … … 253 253 header('Content-Type: text/xml'); 254 254 $fileString = implode('', $xml); 255 echo preg_replace('/^[ \t]*[\r\n]+/m', '',$fileString); 255 $catalogue_xml = preg_replace('/^[ \t]*[\r\n]+/m', '', $fileString); 256 echo $catalogue_xml; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Catalogue response is XML, not HTML. 256 257 exit; 257 258 }else { … … 310 311 'countryCode' => $shipping_address['postalAddress']['regionCode'], 311 312 ); 312 do_action("logger", ['feyzfgtyue7878' => date("y/m/d h:i:s")]);313 do_action("logger", ['feyzfgtyue7878' => gmdate("y/m/d h:i:s")]); 313 314 do_action('wp_loaded'); 314 315 WC()->frontend_includes(); … … 317 318 WC()->initialize_cart(); 318 319 do_action( 'woocommerce_load_cart_from_session' ); 319 WC()->customer = new WC_Customer(get_user_by _email($email)->ID);320 WC()->customer = new WC_Customer(get_user_by('email', $email)->ID); 320 321 $default_shipping = $this->conversellSettings->getSettings()['canalSettings']['defaultShipping']; 321 322 WC()->customer->set_shipping_city($shipping_address['postalAddress']['locality']); … … 325 326 WC()->customer->set_shipping_first_name($shipping_address["first_name"]); 326 327 WC()->customer->set_shipping_last_name($shipping_address["last_name"]); 327 do_action("logger", ['efeizyfihkjdhdksjfyui' => date("y/m/d h:i:s")]);328 do_action("logger", ['efeizyfihkjdhdksjfyui' => gmdate("y/m/d h:i:s")]); 328 329 $lineItems = array(); 329 330 $index = 0; … … 351 352 $index ++; 352 353 } 353 do_action("logger", ['f87e9fpos' => date("y/m/d h:i:s")]);354 do_action("logger", ['f87e9fpos' => gmdate("y/m/d h:i:s")]); 354 355 $shipping = new WC_Shipping(); 355 356 $package = WC()->cart->get_shipping_packages()[0]; … … 374 375 ? $shipping_line : $shippingLineCollection[0]; 375 376 376 do_action("logger", ['fzegufyze7854l' => date("y/m/d h:i:s")]);377 do_action("logger", ['fzegufyze7854l' => gmdate("y/m/d h:i:s")]); 377 378 \WC()->session->set('chosen_shipping_methods',array($chosen_shipping_methods)); 378 379 \WC()->cart->calculate_totals(); 379 380 \WC()->cart->calculate_shipping(); 380 381 $cart_totals = \WC()->cart->get_totals(); 381 do_action("logger", ['efeyftgxgsdfsdkfuyj' => date("y/m/d h:i:s")]);382 do_action("logger", ['efeyftgxgsdfsdkfuyj' => gmdate("y/m/d h:i:s")]); 382 383 $data = array(); 383 384 $data = [ … … 404 405 ]; 405 406 do_action('logger',['fghjgfyutzeyutgfds'=>$data]); 406 do_action("logger", ['fuytfeygdsf44578545' => date("y/m/d h:i:s")]);407 do_action("logger", ['fuytfeygdsf44578545' => gmdate("y/m/d h:i:s")]); 407 408 return new \WP_REST_Response($data,200); 408 409 } … … 686 687 global $wpdb; 687 688 $order_status_key = "wc-".$order_status; 688 $sql = "SELECT* FROM favizone_order_status_notify_config WHERE customer_status = '". 689 $order_status_key."'"; 690 $order_status_config = $wpdb->get_row($sql); 689 $order_status_config = $wpdb->get_row( 690 $wpdb->prepare( 691 'SELECT * FROM favizone_order_status_notify_config WHERE customer_status = %s', 692 $order_status_key 693 ) 694 ); 695 if ( ! $order_status_config ) { 696 return null; 697 } 691 698 return $order_status_config->type_status; 692 699 } … … 696 703 global $wpdb; 697 704 $traking_customers_table_name = $wpdb->prefix . 'conversell_fulfullment_customers_tracked'; 698 $sql = "SELECT count(*) as count FROM $traking_customers_table_name WHERE customer_id = " . $customer_id ." and shop_id = '".$shop_id."'"; 699 $res = $wpdb->get_row($sql); 700 $is_customer_traked = $res->count > 0; 705 $res = $wpdb->get_row( 706 $wpdb->prepare( 707 'SELECT COUNT(*) AS count FROM %i WHERE customer_id = %s AND shop_id = %s', 708 $traking_customers_table_name, 709 $customer_id, 710 $shop_id 711 ) 712 ); 713 $is_customer_traked = ( $res && isset( $res->count ) ) ? ( $res->count > 0 ) : false; 701 714 return $is_customer_traked; 702 715 } -
conversell-voice-shopping-builder/trunk/classes/conversell/messenger/ConversellAccount.php
r3793880 r3796150 178 178 global $wpdb; 179 179 $bot_data = array(); 180 $site_domaine = parse_url($site_url,PHP_URL_HOST);180 $site_domaine = wp_parse_url($site_url,PHP_URL_HOST); 181 181 $cv_common = new ConversellCommon(); 182 182 $bot_data['botName'] = $bot_name; … … 190 190 $bot_data['cmsShop'] = $site_domaine; 191 191 $bot_data['userID'] = $config['user_id']; 192 $bot_data['timeStamp'] = date("Y-m-d H:i:s");192 $bot_data['timeStamp'] = gmdate("Y-m-d H:i:s"); 193 193 $bot_data["catalog_name"] = $site_name.'-'.$lang.'-' 194 194 .get_option('woocommerce_currency'); -
conversell-voice-shopping-builder/trunk/classes/conversell/messenger/ConversellCommon.php
r3793880 r3796150 21 21 global $wpdb; 22 22 $favizone_table_name = $wpdb->prefix . 'conversell_favizone_voice_shopping_access_key'; 23 $sql = "SELECT * FROM $favizone_table_name WHERE sites_id = '" . $site_id ."' and lang = '".$lang."'"; 24 $conversell_favizone_voice_shopping_access_key = $wpdb->get_row($sql); 25 return $conversell_favizone_voice_shopping_access_key->bot_id!==null?true:false; 23 $conversell_favizone_voice_shopping_access_key = $wpdb->get_row( 24 $wpdb->prepare( 25 'SELECT * FROM %i WHERE sites_id = %s AND lang = %s', 26 $favizone_table_name, 27 $site_id, 28 $lang 29 ) 30 ); 31 if ( ! $conversell_favizone_voice_shopping_access_key ) { 32 return false; 33 } 34 return null !== $conversell_favizone_voice_shopping_access_key->bot_id; 26 35 } 27 36 /** -
conversell-voice-shopping-builder/trunk/classes/conversell/messenger/hook/AccountLinking.php
r3793880 r3796150 17 17 } 18 18 public function userAuthentificationRedirectUri(){ 19 $redirect_uri = isset($_GET['redirect_uri'])? parse_url($_GET['redirect_uri'])['host']:null;19 $redirect_uri = isset($_GET['redirect_uri'])?wp_parse_url($_GET['redirect_uri'])['host']:null; 20 20 $isConversellRequest = $redirect_uri !== null && in_array($redirect_uri, $this->whiteListDomain); 21 21 if($isConversellRequest){ … … 30 30 public function userAuthentification($user_login,$user){ 31 31 do_action('logger',['gurdfxbugyieruyguyfugyuegtyhjrgfhyd'=>$_GET['redirect_uri']]); 32 $redirect_uri = isset($_GET['redirect_uri'])? parse_url($_GET['redirect_uri'])['host']:null;32 $redirect_uri = isset($_GET['redirect_uri'])?wp_parse_url($_GET['redirect_uri'])['host']:null; 33 33 $isConversellRequest = $redirect_uri !== null && in_array($redirect_uri, $this->whiteListDomain); 34 34 if($isConversellRequest){ -
conversell-voice-shopping-builder/trunk/classes/hook/ConversellAjaxRequest.php
r3793880 r3796150 1 1 <?php 2 2 namespace conversell_conversational_shopping; 3 4 if ( ! defined( 'ABSPATH' ) ) { 5 exit; 6 } 7 3 8 require_once __DIR__ . '../../ConversellFavizoneCommon.php'; 4 9 require_once __DIR__ . '../../ConversellFavizoneCommon.php'; -
conversell-voice-shopping-builder/trunk/classes/hook/ConversellFavizoneDownloadHook.php
r3793880 r3796150 7 7 */ 8 8 namespace conversell_conversational_shopping; 9 10 if ( ! defined( 'ABSPATH' ) ) { 11 exit; 12 } 13 9 14 require_once CONVERSELL_CSB_DIR . 'classes/ConversellFavizoneExport.php'; 10 15 … … 19 24 $favizone_date = gmdate('D, d M Y H:i:s'); 20 25 if(intval(get_query_var('favizone_download_trigger')) == 1){ 21 $favizone_export_site = get_query_var('favizone_export_download_site');26 $favizone_export_site = sanitize_file_name( (string) get_query_var( 'favizone_export_download_site' ) ); 22 27 if (isset($favizone_export_site)) { 23 28 $favizone_local_file = CONVERSELL_CSB_DIR . 'ConversellFavizoneExport/favizone-export-cataloge-'.$favizone_export_site.'.xml'; 24 29 if (file_exists($favizone_local_file) && is_file($favizone_local_file)) { 25 chmod($favizone_local_file, 0644); 30 if ( ! class_exists( 'WP_Filesystem_Direct' ) ) { 31 require_once ABSPATH . 'wp-admin/includes/class-wp-filesystem-base.php'; 32 require_once ABSPATH . 'wp-admin/includes/class-wp-filesystem-direct.php'; 33 } 34 $filesystem = new \WP_Filesystem_Direct( false ); 35 $filesystem->chmod( $favizone_local_file, 0644 ); 36 $catalogue_xml = $filesystem->get_contents( $favizone_local_file ); 26 37 // Vous voulez afficher un xml 27 38 header('Content-Type: text/xml'); … … 31 42 header('Expires: ' . $favizone_date); 32 43 // Le source du xml original.xml 33 readfile($favizone_local_file);44 echo $catalogue_xml; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Catalogue file download is XML, not HTML. 34 45 exit(); 35 46 } else { -
conversell-voice-shopping-builder/trunk/classes/hook/ConversellFavizoneExportHook.php
r3793880 r3796150 34 34 $fz_export = new ConversellFavizoneExport($this->moduleStaticData); 35 35 $favizone_export = $fz_export->favizone_export($favizone_export_access_key, $favizone_export_site, $favizone_export_lang); 36 echo $favizone_export;36 echo esc_html( wp_json_encode( $favizone_export ) ); 37 37 exit; 38 38 } -
conversell-voice-shopping-builder/trunk/classes/hook/ConversellFavizoneOpenHook.php
r3793880 r3796150 33 33 header('Content-Type: text/xml'); 34 34 $fileString = implode('', $xml); 35 echo preg_replace('/^[ \t]*[\r\n]+/m', '',$fileString); 35 $catalogue_xml = preg_replace('/^[ \t]*[\r\n]+/m', '', $fileString); 36 echo $catalogue_xml; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Catalogue response is XML, not HTML. 36 37 exit; 37 38 }else { -
conversell-voice-shopping-builder/trunk/classes/hook/FavizoneCatalogueTask.php
r3793880 r3796150 1 <?php 1 <?php 2 2 namespace conversell_conversational_shopping; 3 4 if ( ! defined( 'ABSPATH' ) ) { 5 exit; 6 } 7 3 8 require_once __DIR__ . '../../ConversellFavizoneExport.php'; 4 9 require_once __DIR__ . '../../ConversellFavizoneCommon.php'; … … 19 24 header('Content-Type: text/xml'); 20 25 $fileString = implode('', $xml); 21 echo preg_replace('/^[ \t]*[\r\n]+/m', '',$fileString); 26 $catalogue_xml = preg_replace('/^[ \t]*[\r\n]+/m', '', $fileString); 27 echo $catalogue_xml; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Catalogue response is XML, not HTML. 22 28 exit; 23 29 } -
conversell-voice-shopping-builder/trunk/classes/hook/FavizoneEvent.php
r3793880 r3796150 35 35 <script> 36 36 jQuery(document).ready(function(){ 37 console.log(jQuery('#<?php echo $favizone_content_id;?>'));38 jQuery('#<?php echo $favizone_content_id;?>').append("<?php echo $favizone_html;?>");37 console.log(jQuery('#<?php echo esc_js( $favizone_content_id ); ?>')); 38 jQuery('#<?php echo esc_js( $favizone_content_id ); ?>').append("<?php echo esc_js( $favizone_html ); ?>"); 39 39 }); 40 40 … … 49 49 <script> 50 50 jQuery(document).ready(function(){ 51 console.log(jQuery('.<?php echo $favizone_content_class;?>'));52 jQuery('.<?php echo $favizone_content_class;?>').append("<?php echo $favizone_html;?>");51 console.log(jQuery('.<?php echo esc_js( $favizone_content_class ); ?>')); 52 jQuery('.<?php echo esc_js( $favizone_content_class ); ?>').append("<?php echo esc_js( $favizone_html ); ?>"); 53 53 }); 54 54 … … 102 102 <script> 103 103 jQuery(document).ready(function () { 104 jQuery('#<?php echo $favizone_content_id;?>').append("<?php echo $favizone_html;?>");104 jQuery('#<?php echo esc_js( $favizone_content_id ); ?>').append("<?php echo esc_js( $favizone_html ); ?>"); 105 105 }); 106 106 </script> … … 114 114 <script> 115 115 jQuery(document).ready(function () { 116 console.log(jQuery('.<?php echo $favizone_content_class;?>'));117 jQuery("<?php echo $favizone_html;?>").insertAfter(".<?php echo $favizone_content_class;?>");116 console.log(jQuery('.<?php echo esc_js( $favizone_content_class ); ?>')); 117 jQuery("<?php echo esc_js( $favizone_html ); ?>").insertAfter(".<?php echo esc_js( $favizone_content_class ); ?>"); 118 118 }); 119 119 </script> … … 135 135 } 136 136 $favizone_html .="</section>"; 137 echo $favizone_html;137 echo wp_kses_post( $favizone_html ); 138 138 } 139 139 function favizone_after_single_category(){ … … 156 156 (!empty($favizone_cat_obj->description)) ? $favizone_html .= "<span id='favizone_category_description'>" . $favizone_cat_obj->description . "</span>" : true;*/ 157 157 $favizone_html .= "</section>"; 158 echo $favizone_html;158 echo wp_kses_post( $favizone_html ); 159 159 } 160 160 } … … 183 183 } 184 184 $favizone_html .= "</section>"; 185 echo $favizone_html;185 echo wp_kses_post( $favizone_html ); 186 186 } 187 187 function favizone_before_shop_loop_item(){ 188 188 global $product; 189 189 $favizone_id = $product->get_id(); 190 echo "<div class='favizone_product'><span class='favizone_product_loop_identifier' style='display: none'>" . $favizone_id. "</span>";190 echo "<div class='favizone_product'><span class='favizone_product_loop_identifier' style='display: none'>" . esc_html( $favizone_id ) . "</span>"; 191 191 } 192 192 function favizone_after_shop_loop_item(){ … … 205 205 $html .= "<span id='favizone_product_active'>".$fz_meta_prod['active']."</span>"; 206 206 $html .= "</section>"; 207 echo $html;207 echo wp_kses_post( $html ); 208 208 } 209 209 function searchHiddenProduct($query) { 210 210 if ($query->is_main_query() && !is_admin() && $query->is_search()) { 211 211 $favizone_html = "<span id='favizone_search_term' style='display: none'>" . get_search_query() . "</span>"; 212 echo $favizone_html;212 echo wp_kses_post( $favizone_html ); 213 213 } 214 214 } … … 216 216 $favizone_current_user = wp_get_current_user(); 217 217 global $woocommerce; 218 $favizone_locale_parts = explode( '_', get_locale() ); 218 219 echo "<div id='favizone_user_element' style='display:none'>" . 219 "<span id='favizone_customer_email'>" . $favizone_current_user->user_email. "</span>" .220 "<span id='favizone_customer_identifier'>" . $favizone_current_user->ID. "</span>" .221 "<span id='favizone_customer_first_name'>" . $favizone_current_user->first_name. "</span>" .222 "<span id='favizone_customer_last_name'>" . $favizone_current_user->last_name. "</span>" .223 "<span id='favizone_customer_country'>" . $woocommerce->customer->get_billing_country() . "</span>" .224 "<span id='favizone_customer_languages'>" . e xplode('_', get_locale())[0] . "</span>" . //default language225 "<span id='favizone_price_currency_code'>" . get_woocommerce_currency() . "</span>" . //default currency220 "<span id='favizone_customer_email'>" . esc_html( $favizone_current_user->user_email ) . "</span>" . 221 "<span id='favizone_customer_identifier'>" . esc_html( $favizone_current_user->ID ) . "</span>" . 222 "<span id='favizone_customer_first_name'>" . esc_html( $favizone_current_user->first_name ) . "</span>" . 223 "<span id='favizone_customer_last_name'>" . esc_html( $favizone_current_user->last_name ) . "</span>" . 224 "<span id='favizone_customer_country'>" . esc_html( $woocommerce->customer->get_billing_country() ) . "</span>" . 225 "<span id='favizone_customer_languages'>" . esc_html( $favizone_locale_parts[0] ) . "</span>" . 226 "<span id='favizone_price_currency_code'>" . esc_html( get_woocommerce_currency() ) . "</span>" . 226 227 "</div>"; 227 228 } -
conversell-voice-shopping-builder/trunk/classes/hook/adminhook/ConversellFavizoneCategoryHook.php
r3793880 r3796150 7 7 */ 8 8 namespace conversell_conversational_shopping; 9 10 if ( ! defined( 'ABSPATH' ) ) { 11 exit; 12 } 13 9 14 add_action('create_product_cat', 'conversell_favizone_create_category_alexa', 10, 1); 10 15 add_action("edited_product_cat", "conversell_favizone_edit_category_alexa"); -
conversell-voice-shopping-builder/trunk/classes/hook/adminhook/ConversellFavizoneProductHook.php
r3793880 r3796150 7 7 */ 8 8 namespace conversell_conversational_shopping; 9 10 if ( ! defined( 'ABSPATH' ) ) { 11 exit; 12 } 13 9 14 require_once(ABSPATH . 'wp-admin/includes/upgrade.php'); 10 15 -
conversell-voice-shopping-builder/trunk/classes/process_manager/ProcessManager.php
r3793880 r3796150 127 127 return; 128 128 } 129 echo $this->conversell_widget_chat(array('mode' => 'float')); 129 $widget_markup = $this->conversell_widget_chat( array( 'mode' => 'float' ) ); 130 echo $widget_markup; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Chat embed includes a scoped style block and markup returned for the storefront widget. 130 131 } 131 132 /** … … 157 158 $this->favizone_locale = get_locale(); 158 159 $this->site_url = site_url(); 159 $this->site_domaine = parse_url($this->site_url,PHP_URL_HOST);160 $this->site_domaine = wp_parse_url($this->site_url,PHP_URL_HOST); 160 161 $this->shop_currency = get_option('woocommerce_currency'); 161 162 $this->cmsVersion = get_bloginfo('version', 'raw'); … … 197 198 conversell_install( 198 199 get_rest_url()."conversell/completeInstallation", 199 parse_url(site_url(),PHP_URL_HOST),200 wp_parse_url(site_url(),PHP_URL_HOST), 200 201 $email, 201 202 $isUserExist === "true", -
conversell-voice-shopping-builder/trunk/classes/process_manager/ProcessManagerMessenger.php
r3793880 r3796150 73 73 $this->favizone_locale = get_locale(); 74 74 $this->site_url = site_url(); 75 $this->site_domaine = parse_url($this->site_url,PHP_URL_HOST);75 $this->site_domaine = wp_parse_url($this->site_url,PHP_URL_HOST); 76 76 $this->shop_currency = get_option('woocommerce_currency'); 77 77 $wc_countries = new \WC_Countries(); -
conversell-voice-shopping-builder/trunk/conversell-conversational-shopping-builder.php
r3793880 r3796150 9 9 * Developer: Conversell 10 10 * Developer URI: https://conversell.ai/ 11 * Text Domain: conversell- conversational-shopping-builder11 * Text Domain: conversell-voice-shopping-builder 12 12 * Requires at least: 6.5 13 13 * Requires PHP: 7.4 … … 187 187 return; 188 188 } 189 $shop = parse_url(site_url(), PHP_URL_HOST);189 $shop = wp_parse_url(site_url(), PHP_URL_HOST); 190 190 if (get_option('conversell_pending_install')) { 191 191 delete_option('conversell_pending_install'); … … 282 282 public function conversell_uninstall(){ 283 283 update_option("is_app_installed",0); 284 $shop = parse_url(site_url(), PHP_URL_HOST);284 $shop = wp_parse_url(site_url(), PHP_URL_HOST); 285 285 try { 286 286 if (!$this->fvCommon) { -
conversell-voice-shopping-builder/trunk/view/conversell_bot_settings.php
r3793880 r3796150 1 <?php 1 <?php 2 if ( ! defined( 'ABSPATH' ) ) { 3 exit; 4 } 2 5 require_once 'function.php'; 3 6 function conversell_bot_settings($conversellOrderStates,$settings,$favizone_config,$moduleStaticData,$conversellSettings,$isAppActivate){ 4 7 ?> 5 8 <header> 6 <link rel="stylesheet" href="https://sdks.shopifycdn.com/polaris/3.21.0/polaris.min.css" />7 9 <style> 8 10 .info { … … 182 184 value="<?php echo esc_html($shippingMethod['id']) ?>" 183 185 selected> 184 <?php echo $shippingMethod['label']?>186 <?php echo esc_html( $shippingMethod['label'] ); ?> 185 187 </option> 186 188 <?php }else{?> -
conversell-voice-shopping-builder/trunk/view/conversell_install.php
r3793880 r3796150 1 <?php function conversell_install($email,$is_user_exist,$favizone_config,$moduleStaticData){ ?> 1 <?php 2 if ( ! defined( 'ABSPATH' ) ) { 3 exit; 4 } 5 function conversell_install($email,$is_user_exist,$favizone_config,$moduleStaticData){ ?> 2 6 <html> 3 7 <header> 4 <link rel="stylesheet" href="https://sdks.shopifycdn.com/polaris/3.21.0/polaris.min.css" />5 8 </header> 6 9 <body> -
conversell-voice-shopping-builder/trunk/view/conversell_settings.php
r3793880 r3796150 1 1 <?php 2 if ( ! defined( 'ABSPATH' ) ) { 3 exit; 4 } 2 5 require_once 'function.php'; 3 6 ?> … … 5 8 <html> 6 9 <header> 7 <link rel="stylesheet" href="https://sdks.shopifycdn.com/polaris/3.21.0/polaris.min.css" />8 10 <style> 9 11 .btn-group .btn-default { … … 552 554 $categoriesLevel3 = get_categories($catLevel3Args); 553 555 if(empty($categoriesLevel3)){ 554 echo $categorieLevel2->name;556 echo esc_html( $categorieLevel2->name ); 555 557 }else{ 556 558 echo esc_html('<i class="fa fa-list-ul" aria-hidden="true"></i>'); -
conversell-voice-shopping-builder/trunk/view/create_bot.php
r3793880 r3796150 1 <?php 2 if ( ! defined( 'ABSPATH' ) ) { 3 exit; 4 } 5 ?> 1 6 <strong> 2 7 NO BOT -
conversell-voice-shopping-builder/trunk/view/function.php
r3793880 r3796150 1 1 <?php 2 if ( ! defined( 'ABSPATH' ) ) { 3 exit; 4 } 2 5 /** 3 6 * return array … … 20 23 $hide_empty = false ; 21 24 $cat_args = array( 25 'taxonomy' => 'product_cat', 22 26 'orderby' => $orderby, 23 27 'order' => $order, 24 28 'hide_empty' => $hide_empty, 25 29 ); 26 $product_categories = get_terms( 'product_cat',$cat_args );30 $product_categories = get_terms( $cat_args ); 27 31 return $product_categories; 28 32 } -
conversell-voice-shopping-builder/trunk/view/order_states_config.php
r3793880 r3796150 1 1 <?php 2 if ( ! defined( 'ABSPATH' ) ) { 3 exit; 4 } 2 5 function orderStatesConfig( 3 6 $wc_states, … … 119 122 <!-- shop order states --> 120 123 <th> 121 <?php echo $wc_value?>124 <?php echo esc_html( $wc_value ); ?> 122 125 </th> 123 126 <th> -
conversell-voice-shopping-builder/trunk/view/verify_email.php
r3793880 r3796150 1 1 <?php 2 if ( ! defined( 'ABSPATH' ) ) { 3 exit; 4 } 2 5 /** 3 6 * Installation & Email Verification – Conversell … … 6 9 function conversell_install($callback,$shopDomain,$favizone_config = null, $moduleStaticData = null) { 7 10 $cmsUtilitiesHost = \conversell_conversational_shopping\ConversellFavizoneApi::getCmsUtilitiesHost(); 11 $conversell_logo = defined( 'CONVERSELL_CSB_FILE' ) 12 ? plugins_url( 'assets/img/conv.png', CONVERSELL_CSB_FILE ) 13 : ''; 8 14 ?> 9 15 <html> … … 12 18 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 13 19 <meta name="viewport" content="width=device-width, initial-scale=1.0" /> 14 15 <!-- Polaris + Bootstrap + Fonts -->16 <link rel="stylesheet" href="https://sdks.shopifycdn.com/polaris/3.21.0/polaris.min.css" />17 <link18 href="https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700&family=Comfortaa:wght@400;500;700&display=swap"19 rel="stylesheet">20 <link rel="icon"21 href="https://us-central1-conversell-258914.cloudfunctions.net/shopifyVoiceNotifications/imgs/fav.png"22 type="image/x-icon" />23 <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">24 <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/css/bootstrap.min.css" rel="stylesheet" />25 <link rel="stylesheet" type="text/css" href="{{forwardAddress}}/css/signup.css" />26 20 <style> 27 21 body { 28 font-family: 'Montserrat', sans-serif;22 font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; 29 23 background-color: #f9fafb; 30 24 } 25 26 .container { width: min(960px, 100%); margin: 2rem auto; } 27 .row { display: flex; justify-content: center; } 28 .col-md-5 { width: min(420px, 100%); } 29 .text-center { text-align: center; } 30 .mb-2 { margin-bottom: .5rem; } 31 .mb-3 { margin-bottom: 1rem; } 32 .mb-4 { margin-bottom: 1.5rem; } 33 .mt-3 { margin-top: 1rem; } 34 .mt-5 { margin-top: 2rem; } 35 36 #exampleModal { 37 display: none; 38 position: fixed; 39 inset: 0; 40 background: rgba(0, 0, 0, .45); 41 z-index: 1000; 42 overflow: auto; 43 } 44 #exampleModal.show { display: block; } 45 .modal-dialog { max-width: 520px; margin: 8vh auto; } 46 .modal-content { background: #fff; border-radius: 12px; padding: 12px 16px 20px; } 47 48 .conversell-spinner { 49 width: 48px; 50 height: 48px; 51 border: 4px solid #e5e7eb; 52 border-top-color: #1d9ba4; 53 border-radius: 50%; 54 margin: 20vh auto 0; 55 animation: conversell-spin .8s linear infinite; 56 } 57 @keyframes conversell-spin { to { transform: rotate(360deg); } } 31 58 32 59 .box { … … 115 142 <div id="loader" style="display: none; text-align: center; margin: auto;"> 116 143 <div class="Polaris-Backdrop"> 117 <img src="https://us-central1-conversell-258914.cloudfunctions.net/shopifyVoiceNotifications/imgs/loading.gif" 118 style="margin: auto; width: 70px; z-index: 999999999999999 !important; display: block !important; margin-top: 20%;" /> 144 <div class="conversell-spinner" role="status" aria-label="Loading"></div> 119 145 </div> 120 146 </div> … … 128 154 <div class="container mt-5"> 129 155 <div class="text-center mb-4"> 130 <img src=" https://dev.conversell.ai/assets/images/conversell-logo.png" alt="Conversell Logo"156 <img src="<?php echo esc_url( $conversell_logo ); ?>" alt="Conversell Logo" 131 157 style="width:180px;"> 132 158 </div> … … 182 208 </div> 183 209 184 <!-- Scripts --> 185 <script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script> 186 <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/js/bootstrap.bundle.min.js"></script> 210 <?php 211 wp_enqueue_script( 'jquery' ); 212 wp_print_scripts( 'jquery' ); 213 ?> 214 <script>window.$ = window.jQuery;</script> 187 215 <script> 188 216 function ValidateEmail(mail) { … … 197 225 function startModal() { 198 226 console.log('startModal.................') 199 $('#exampleModal'). modal();227 $('#exampleModal').addClass('show').show(); 200 228 } 201 229 $(document).on('click', '.shop_item', function() { 202 let domain = "<?php echo $shopDomain; ?>";203 let callback = "<?php echo $callback?>";230 let domain = "<?php echo esc_js( $shopDomain ); ?>"; 231 let callback = "<?php echo esc_js( $callback ); ?>"; 204 232 let shopId = $(this).attr('data-id'); 205 233 var index = $('.shop_item').index(this); … … 306 334 </div> 307 335 <div style="text-align: center; display: none" class="success_html"> 308 < i style="font-size: 25px" class="fa fa-check-circle text-success"></i>336 <span style="font-size: 25px; color: #008060;" aria-hidden="true">✓</span> 309 337 <p> 310 338 <strong> … … 329 357 }); 330 358 331 var myModal = new bootstrap.Modal(document.getElementById('exampleModal')); 332 myModal.show(); 359 var shopModal = document.getElementById('exampleModal'); 360 if (shopModal) { 361 shopModal.style.display = 'block'; 362 shopModal.classList.add('show'); 363 } 333 364 }, 334 365 error: function(xhr, status, error) { … … 517 548 echo '<html><head><title>Select Shop</title> 518 549 519 <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/css/bootstrap.min.css" rel="stylesheet" />520 521 550 <style> 522 551
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)