Plugin Directory

Changeset 3796150


Ignore:
Timestamp:
11/11/2026 11:15:20 AM (less than one hour ago)
Author:
conversell
Message:

Fix Plugin Check errors for version 1.0.0.

Location:
conversell-voice-shopping-builder
Files:
2 added
2 deleted
70 edited

Legend:

Unmodified
Added
Removed
  • conversell-voice-shopping-builder/tags/1.0.0/ModuleStaticData.php

    r3793880 r3796150  
    2121
    2222    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);
    2424        $this->rest_url = trailingslashit($rest_url);
    2525        self::$PLUGIN_PATH = rtrim(WP_PLUGIN_DIR, DIRECTORY_SEPARATOR) . '/' . $this->PLUGIN_NAME;
    … …  
    3838        //$this->generate_json_export();
    3939        //$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 );
    4049    }
    4150
    … …  
    5059
    5160        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)) {
    5762                error_log('Conversell: Could not create export directory: ' . $this->CATALOGUE_DIR_PATH);
    5863                return false;
    … …  
    6368
    6469    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()) {
    6671            error_log('Conversell: Export directory not available or not writable: ' . $this->CATALOGUE_DIR_PATH);
    6772            return;
    … …  
    260265    private function get_sale_from_date($product) {
    261266        $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) : '';
    263268    }
    264269
    265270    private function get_sale_to_date($product) {
    266271        $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) : '';
    268273    }
    269274
    … …  
    410415    private function get_product_date($product,$type='created'){
    411416        $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';
    413418    }
    414419
  • conversell-voice-shopping-builder/tags/1.0.0/classes/ConversellAjaxRequest.php

    r3793880 r3796150  
    11<?php
    22namespace conversell_conversational_shopping;
     3
     4if ( ! defined( 'ABSPATH' ) ) {
     5    exit;
     6}
     7
    38require_once __DIR__ . '../../ConversellFavizoneCommon.php';
    49require_once __DIR__ . '../../ConversellFavizoneCommon.php';
  • conversell-voice-shopping-builder/tags/1.0.0/classes/ConversellComfirmOrderAsync.php

    r3793880 r3796150  
    22use google_assistant as google_assistant;
    33use conversell_conversational_shopping as conversell;
     4
     5if ( ! defined( 'ABSPATH' ) ) {
     6    exit;
     7}
    48require_once __DIR__ . '/conversell/google_assistant/ConversellPayment.php';
    59require_once __DIR__ . '/ConversellFavizoneCommon.php';
  • conversell-voice-shopping-builder/tags/1.0.0/classes/ConversellFavizoneAccount.php

    r3793880 r3796150  
    109109        ){
    110110            $bot_data = array();
    111             $site_domaine = parse_url($site_url,PHP_URL_HOST);
     111            $site_domaine = wp_parse_url($site_url,PHP_URL_HOST);
    112112            $bot_data['botName'] = $bot_name;
    113113            $bot_data['botTitle'] = $bot_name;
    … …  
    120120            $bot_data['cmsShop'] =  $site_domaine;
    121121            $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");
    123123            $bot_data["catalog_name"] = $isAppActivate?$site_name.'-'.$lang.'-'
    124124                                        .get_option('woocommerce_currency')
  • conversell-voice-shopping-builder/tags/1.0.0/classes/ConversellFavizoneApi.php

    r3793880 r3796150  
    111111    public static function rewriteToActiveAppOrigin($uri)
    112112    {
    113         $parts = parse_url((string) $uri);
     113        $parts = wp_parse_url((string) $uri);
    114114        if (!is_array($parts) || empty($parts['host'])) {
    115115            return null;
  • conversell-voice-shopping-builder/tags/1.0.0/classes/ConversellFavizoneCommon.php

    r3793880 r3796150  
    6464            'language'          => get_locale(),
    6565            'shopUrl'           => site_url(),
    66             'shopName'          => $cmsShop ?: parse_url(site_url(), PHP_URL_HOST),
     66            'shopName'          => $cmsShop ?: wp_parse_url(site_url(), PHP_URL_HOST),
    6767            'connectedSince'    => $connectedSince,
    6868            'country_code'      => $countryCode,
    … …  
    8888     */
    8989    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);
    9191        $workspaceId = get_option('conversell_workspace_id');
    9292        $body = array(
    … …  
    222222    public function get_favizone_site_access_key(){
    223223        $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 );
    225225        $body         = array(
    226226            'cms'     => 'woocommerce',
    … …  
    320320     */
    321321    public function getWidgetChat($mode = 'float') {
    322         $shopName = parse_url(site_url(), PHP_URL_HOST);
     322        $shopName = wp_parse_url(site_url(), PHP_URL_HOST);
    323323        if (!$shopName) {
    324324            return false;
    … …  
    343343                    'cms' => 'woocommerce',
    344344                    '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),
    346346                )
    347347        );
    … …  
    361361    public function getConversellAppEntryUrl(){
    362362        $origin = ConversellFavizoneApi::getConversellAppOrigin();
    363         $shopName = parse_url(site_url(), PHP_URL_HOST);
     363        $shopName = wp_parse_url(site_url(), PHP_URL_HOST);
    364364        $signup = $origin . '/auth/signup?' . http_build_query(array(
    365365            'shopName' => $shopName,
    … …  
    375375        }
    376376        $query = array();
    377         $qs = parse_url($res->redirect_uri, PHP_URL_QUERY);
     377        $qs = wp_parse_url($res->redirect_uri, PHP_URL_QUERY);
    378378        if (is_string($qs)) {
    379379            parse_str($qs, $query);
    … …  
    401401            return ConversellFavizoneApi::rewriteToActiveAppOrigin($uri);
    402402        }
    403         $parts = parse_url((string) $uri);
     403        $parts = wp_parse_url((string) $uri);
    404404        if (!is_array($parts) || empty($parts['host'])) {
    405405            return null;
    … …  
    459459        $args = array();
    460460        $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'),
    462462        )));
    463463
    … …  
    489489        $args = array();
    490490        $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'),
    492492        )));
    493493        $breadcrumbs = new \WC_Breadcrumb();
    … …  
    523523        $hide_empty = false ;
    524524        $cat_args = array(
     525            'taxonomy'   => 'product_cat',
    525526            'orderby'    => $orderby,
    526527            'order'      => $order,
    527528            'hide_empty' => $hide_empty,
    528529        );
    529         $product_categories = get_terms( 'product_cat', $cat_args );
     530        $product_categories = get_terms( $cat_args );
    530531        foreach($product_categories as $product_categorie){
    531532            $categories_name = $this->fv_product->generate_categories($product_categorie);
    … …  
    559560        ConversellSettings::startExportCatalog();
    560561        $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));
    562563       
    563564        /**$initShopUrl = $this->initShopUrl(
    … …  
    578579    public function importCatalog(){
    579580        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));
    581582        $res = $this->fv_sender->favizone_post_request(
    582583            $this->fv_api->getFavizoneLinkingHost(),
    … …  
    10191020    }
    10201021    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));
    10221023        $result = $this->fv_sender->favizone_post_request(
    10231024            $this->fv_api->getFavizoneLinkingHost(),
  • conversell-voice-shopping-builder/tags/1.0.0/classes/ConversellFavizoneExport.php

    r3793880 r3796150  
    718718            $fileRes = $favizone_dom->save($favizone_file_xml);
    719719        } catch (Exception $e) {
    720             echo "$e";
     720            echo esc_html( $e->getMessage() );
    721721        }
    722722    }
  • conversell-voice-shopping-builder/tags/1.0.0/classes/ConversellFavizoneMetaProduct.php

    r3793880 r3796150  
    5656        $this->setProductData("shop_id", get_current_blog_id());
    5757            //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());
    6060            ($favizone_description !== '' ) ? $this->setProductData("description", $favizone_description) : true;
    6161            //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());
    6363            ($favizone_short_description !== '' ) ? $this->setProductData("shortDescription", $favizone_short_description) : true;
    6464            //price
    … …  
    129129            //isNew
    130130            $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'));
    132132            $dure = get_option("conversellGeneralSettings")['newProductNbrDate'];
    133133            $date_diff = $data_now->diff($favizone_date_created);
    … …  
    142142                $this->setProductData(
    143143                    "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"))
    145145                );
    146146            }
    … …  
    200200            $this->setProductData("reference", $favizone_product->get_sku());
    201201            //description
    202             $favizone_description = strip_tags($favizone_product->get_description());
     202            $favizone_description = wp_strip_all_tags($favizone_product->get_description());
    203203            ($favizone_description !== '' ) ? $this->setProductData("description", $favizone_description) : true;
    204204            //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());
    206206            ($favizone_short_description !== '' ) ? $this->setProductData("shortDescription", $favizone_short_description) : true;
    207207            //price
    … …  
    270270            //isNew
    271271            $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'));
    273273            $dure = get_option("conversellGeneralSettings")['newProductNbrDate'];
    274274            if( $data_now->diff($favizone_date_created)->d <= $dure ){
    … …  
    281281                $this->setProductData(
    282282                    "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"))
    284284                );
    285285            }
  • conversell-voice-shopping-builder/tags/1.0.0/classes/ConversellFavizoneOrder.php

    r3793880 r3796150  
    3232    }
    3333    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'));
    3636        $query = new \WC_Order_Query( array(
    3737            'orderby' => 'date',
    … …  
    5252        $favizone_pages = $this->get_count_orders_pages();
    5353        $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'));
    5656        $customers = $fvCommon->getConversellCustomers();
    5757        if(is_array($customers)){
    … …  
    115115    function favizone_send_customers_init_order($customersOrders){
    116116        $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));
    118118        $favizone_data_to_send = array(
    119119            "key" => $favizone_access_key,
    … …  
    146146            $favizone_pages = $this->get_count_orders_pages();
    147147            $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'));
    150150            while (
    151151                $this->favizone_offset <= $favizone_pages
  • conversell-voice-shopping-builder/tags/1.0.0/classes/ConversellFavizoneSender.php

    r3793880 r3796150  
    113113    private function favizone_post_by_fsock($favizone_url, $favizone_path, $favizone_body)
    114114    {
    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;
    136128        }
    137         return (isset($favizone_result) ? $favizone_result : false) ;
     129        return wp_remote_retrieve_body( $favizone_response );
    138130    }
    139131}
  • conversell-voice-shopping-builder/tags/1.0.0/classes/ConversellSettings.php

    r3793880 r3796150  
    1212            $this->canalTitle = $canal_title;
    1313            $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);
    1515        }
    1616        public static function uninstallPlugin($moduleStaticData){
    … …  
    8383                    'FilterCollections' => [],
    8484                    'newProductNbrDate' => $settings->defaultSettings->isNew,
    85                     'catalogLastUpdateDate' => date("Y/m/d"),
     85                    'catalogLastUpdateDate' => gmdate("Y/m/d"),
    8686                    'isVoicePayment' => false
    8787                ));
    8888                if(!file_exists($moduleStaticData->CATALOGUE_DIR_PATH))
    89                     mkdir($moduleStaticData->CATALOGUE_DIR_PATH, 0777, true);
     89                    wp_mkdir_p($moduleStaticData->CATALOGUE_DIR_PATH);
    9090                self::setAutoRedirect();
    9191            }else{
    … …  
    138138                do_action('logger',['autoRedirect in000000000000']);
    139139                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;
    141142            }
    142143        }
    … …  
    176177                'FilterCollections' => [],
    177178                'newProductNbrDate' => 30,
    178                 'catalogLastUpdateDate' => date("Y/m/d")
     179                'catalogLastUpdateDate' => gmdate("Y/m/d")
    179180            ));
    180181        }
    … …  
    231232        public function catalogLastUpdateDate(){
    232233            $settings = get_option("conversellGeneralSettings");
    233             $settings['catalogLastUpdateDate'] = date("Y/m/d");
     234            $settings['catalogLastUpdateDate'] = gmdate("Y/m/d");
    234235            update_option('conversellGeneralSettings',$settings);
    235236        }
  • conversell-voice-shopping-builder/tags/1.0.0/classes/ManageCrone.php

    r3793880 r3796150  
    6363        $schedules['favizone_schedules_now'] = array(
    6464            'interval' => 10,
    65             'display'  => esc_html__( 'Every Five Seconds' ), );
     65            'display'  => esc_html__( 'Every Five Seconds', 'conversell-voice-shopping-builder' ), );
    6666        return $schedules;
    6767    }
  • conversell-voice-shopping-builder/tags/1.0.0/classes/api/ConversationalGeneralApis.php

    r3793880 r3796150  
    136136                $body = [
    137137                    'urls' => [],
    138                     'shopName' => parse_url(site_url(),PHP_URL_HOST),
     138                    'shopName' => wp_parse_url(site_url(),PHP_URL_HOST),
    139139                    'shopUrl' => site_url(),
    140140                    'language' =>  get_locale(),
    … …  
    182182                        if (!$target) {
    183183                            $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))
    185185                                . '&cms=woocommerce';
    186186                        }
  • conversell-voice-shopping-builder/tags/1.0.0/classes/api/messenger/MessengerConversellFulfillment_Rest_Api.php

    r3793880 r3796150  
    239239        public function customerExists(\WP_REST_Request $request){
    240240                $email = $request['email'];
    241                 $user = get_user_by_email($email);
     241                $user = get_user_by('email', $email);
    242242        if($user)
    243243                return new \WP_REST_Response(['id' => $user->ID], 200 );
    … …  
    253253            header('Content-Type: text/xml');
    254254            $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.
    256257            exit;
    257258        }else {
    … …  
    310311                        'countryCode' => $shipping_address['postalAddress']['regionCode'],
    311312                );
    312                 do_action("logger", ['feyzfgtyue7878' => date("y/m/d h:i:s")]);
     313                do_action("logger", ['feyzfgtyue7878' => gmdate("y/m/d h:i:s")]);
    313314                do_action('wp_loaded');
    314315                WC()->frontend_includes();
    … …  
    317318                WC()->initialize_cart();
    318319                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);
    320321                $default_shipping = $this->conversellSettings->getSettings()['canalSettings']['defaultShipping'];
    321322                WC()->customer->set_shipping_city($shipping_address['postalAddress']['locality']);
    … …  
    325326                WC()->customer->set_shipping_first_name($shipping_address["first_name"]);
    326327                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")]);
    328329                $lineItems = array();
    329330                $index = 0;
    … …  
    351352                        $index ++;
    352353                }
    353                 do_action("logger", ['f87e9fpos' => date("y/m/d h:i:s")]);
     354                do_action("logger", ['f87e9fpos' => gmdate("y/m/d h:i:s")]);
    354355                $shipping = new WC_Shipping();
    355356                $package =  WC()->cart->get_shipping_packages()[0];
    … …  
    374375                                                                                ? $shipping_line : $shippingLineCollection[0];
    375376
    376                 do_action("logger", ['fzegufyze7854l' => date("y/m/d h:i:s")]);
     377                do_action("logger", ['fzegufyze7854l' => gmdate("y/m/d h:i:s")]);
    377378                \WC()->session->set('chosen_shipping_methods',array($chosen_shipping_methods));
    378379                \WC()->cart->calculate_totals();
    379380                \WC()->cart->calculate_shipping();
    380381                $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")]);
    382383            $data = array();
    383384                $data = [
    … …  
    404405            ];
    405406                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")]);
    407408            return new \WP_REST_Response($data,200);
    408409        }
    … …  
    686687                global $wpdb;
    687688                $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        }
    691698        return $order_status_config->type_status;               
    692699        }
    … …  
    696703                global $wpdb;
    697704                $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;
    701714        return $is_customer_traked;
    702715        }
  • conversell-voice-shopping-builder/tags/1.0.0/classes/conversell/messenger/ConversellAccount.php

    r3793880 r3796150  
    178178            global $wpdb;
    179179            $bot_data = array();
    180             $site_domaine = parse_url($site_url,PHP_URL_HOST);
     180            $site_domaine = wp_parse_url($site_url,PHP_URL_HOST);
    181181            $cv_common = new ConversellCommon();
    182182            $bot_data['botName'] = $bot_name;
    … …  
    190190            $bot_data['cmsShop'] =  $site_domaine;
    191191            $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");
    193193            $bot_data["catalog_name"] = $site_name.'-'.$lang.'-'
    194194                                        .get_option('woocommerce_currency');
  • conversell-voice-shopping-builder/tags/1.0.0/classes/conversell/messenger/ConversellCommon.php

    r3793880 r3796150  
    2121        global $wpdb;
    2222        $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;
    2635    }
    2736    /**
  • conversell-voice-shopping-builder/tags/1.0.0/classes/conversell/messenger/hook/AccountLinking.php

    r3793880 r3796150  
    1717  }
    1818  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;
    2020    $isConversellRequest = $redirect_uri !== null && in_array($redirect_uri, $this->whiteListDomain);
    2121    if($isConversellRequest){
    … …  
    3030  public function userAuthentification($user_login,$user){
    3131    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;
    3333    $isConversellRequest = $redirect_uri !== null && in_array($redirect_uri, $this->whiteListDomain);
    3434    if($isConversellRequest){
  • conversell-voice-shopping-builder/tags/1.0.0/classes/hook/ConversellAjaxRequest.php

    r3793880 r3796150  
    11<?php
    22namespace conversell_conversational_shopping;
     3
     4if ( ! defined( 'ABSPATH' ) ) {
     5    exit;
     6}
     7
    38require_once __DIR__ . '../../ConversellFavizoneCommon.php';
    49require_once __DIR__ . '../../ConversellFavizoneCommon.php';
  • conversell-voice-shopping-builder/tags/1.0.0/classes/hook/ConversellFavizoneDownloadHook.php

    r3793880 r3796150  
    77 */
    88namespace conversell_conversational_shopping;
     9
     10if ( ! defined( 'ABSPATH' ) ) {
     11    exit;
     12}
     13
    914require_once CONVERSELL_CSB_DIR . 'classes/ConversellFavizoneExport.php';
    1015
    … …  
    1924    $favizone_date = gmdate('D, d M Y H:i:s');
    2025    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' ) );
    2227        if (isset($favizone_export_site)) {
    2328            $favizone_local_file = CONVERSELL_CSB_DIR . 'ConversellFavizoneExport/favizone-export-cataloge-'.$favizone_export_site.'.xml';
    2429            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 );
    2637                // Vous voulez afficher un xml
    2738                header('Content-Type: text/xml');
    … …  
    3142                header('Expires: ' . $favizone_date);
    3243                // 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.
    3445                exit();
    3546            } else {
  • conversell-voice-shopping-builder/tags/1.0.0/classes/hook/ConversellFavizoneExportHook.php

    r3793880 r3796150  
    3434            $fz_export = new ConversellFavizoneExport($this->moduleStaticData);
    3535            $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 ) );
    3737            exit;
    3838        }
  • conversell-voice-shopping-builder/tags/1.0.0/classes/hook/ConversellFavizoneOpenHook.php

    r3793880 r3796150  
    3333                header('Content-Type: text/xml');
    3434                $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.
    3637                exit;
    3738            }else {
  • conversell-voice-shopping-builder/tags/1.0.0/classes/hook/FavizoneCatalogueTask.php

    r3793880 r3796150  
    1 <?php 
     1<?php
    22namespace conversell_conversational_shopping;
     3
     4if ( ! defined( 'ABSPATH' ) ) {
     5    exit;
     6}
     7
    38require_once __DIR__ . '../../ConversellFavizoneExport.php';
    49require_once __DIR__ . '../../ConversellFavizoneCommon.php';
    … …  
    1924        header('Content-Type: text/xml');
    2025        $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.
    2228        exit;
    2329    }
  • conversell-voice-shopping-builder/tags/1.0.0/classes/hook/FavizoneEvent.php

    r3793880 r3796150  
    3535                <script>
    3636                    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 ); ?>");
    3939                    });
    4040   
    … …  
    4949                <script>
    5050                    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 ); ?>");
    5353                    });
    5454   
    … …  
    102102                 <script>
    103103                     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 ); ?>");
    105105                     });
    106106                 </script>
    … …  
    114114                 <script>
    115115                     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 ); ?>");
    118118                     });
    119119                 </script>
    … …  
    135135        }
    136136        $favizone_html .="</section>";
    137         echo $favizone_html;
     137        echo wp_kses_post( $favizone_html );
    138138    }
    139139    function favizone_after_single_category(){
    … …  
    156156            (!empty($favizone_cat_obj->description)) ? $favizone_html .= "<span id='favizone_category_description'>" . $favizone_cat_obj->description . "</span>" : true;*/
    157157            $favizone_html .= "</section>";
    158             echo $favizone_html;
     158            echo wp_kses_post( $favizone_html );
    159159        }
    160160    }
    … …  
    183183        }
    184184        $favizone_html .= "</section>";
    185         echo $favizone_html;
     185        echo wp_kses_post( $favizone_html );
    186186    }
    187187    function favizone_before_shop_loop_item(){
    188188        global $product;
    189189        $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>";
    191191    }
    192192    function favizone_after_shop_loop_item(){
    … …  
    205205        $html .= "<span id='favizone_product_active'>".$fz_meta_prod['active']."</span>";
    206206        $html .= "</section>";
    207         echo $html;
     207        echo wp_kses_post( $html );
    208208    }
    209209    function searchHiddenProduct($query) {
    210210        if ($query->is_main_query() && !is_admin() && $query->is_search()) {
    211211            $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 );
    213213        }
    214214    }
    … …  
    216216            $favizone_current_user = wp_get_current_user();
    217217            global $woocommerce;
     218            $favizone_locale_parts = explode( '_', get_locale() );
    218219            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'>" . explode('_', get_locale())[0] . "</span>" . //default language
    225                 "<span id='favizone_price_currency_code'>" . get_woocommerce_currency() . "</span>" . //default currency
     220                "<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>" .
    226227                "</div>";
    227228    }
  • conversell-voice-shopping-builder/tags/1.0.0/classes/hook/adminhook/ConversellFavizoneCategoryHook.php

    r3793880 r3796150  
    77 */
    88namespace conversell_conversational_shopping;
     9
     10if ( ! defined( 'ABSPATH' ) ) {
     11    exit;
     12}
     13
    914add_action('create_product_cat', 'conversell_favizone_create_category_alexa', 10, 1);
    1015add_action("edited_product_cat", "conversell_favizone_edit_category_alexa");
  • conversell-voice-shopping-builder/tags/1.0.0/classes/hook/adminhook/ConversellFavizoneProductHook.php

    r3793880 r3796150  
    77 */
    88namespace conversell_conversational_shopping;
     9
     10if ( ! defined( 'ABSPATH' ) ) {
     11    exit;
     12}
     13
    914require_once(ABSPATH . 'wp-admin/includes/upgrade.php');
    1015
  • conversell-voice-shopping-builder/tags/1.0.0/classes/process_manager/ProcessManager.php

    r3793880 r3796150  
    127127                return;
    128128            }
    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.
    130131        }
    131132        /**
    … …  
    157158            $this->favizone_locale = get_locale();
    158159            $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);
    160161            $this->shop_currency = get_option('woocommerce_currency');
    161162            $this->cmsVersion = get_bloginfo('version', 'raw');
    … …  
    197198            conversell_install(
    198199                get_rest_url()."conversell/completeInstallation",
    199                 parse_url(site_url(),PHP_URL_HOST),
     200                wp_parse_url(site_url(),PHP_URL_HOST),
    200201                $email,
    201202                $isUserExist === "true",
  • conversell-voice-shopping-builder/tags/1.0.0/classes/process_manager/ProcessManagerMessenger.php

    r3793880 r3796150  
    7373            $this->favizone_locale = get_locale();
    7474            $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);
    7676            $this->shop_currency = get_option('woocommerce_currency');
    7777            $wc_countries = new \WC_Countries();
  • conversell-voice-shopping-builder/tags/1.0.0/conversell-conversational-shopping-builder.php

    r3793880 r3796150  
    99 * Developer: Conversell
    1010 * Developer URI: https://conversell.ai/
    11  * Text Domain: conversell-conversational-shopping-builder
     11 * Text Domain: conversell-voice-shopping-builder
    1212 * Requires at least: 6.5
    1313 * Requires PHP: 7.4
    … …  
    187187                return;
    188188            }
    189             $shop = parse_url(site_url(), PHP_URL_HOST);
     189            $shop = wp_parse_url(site_url(), PHP_URL_HOST);
    190190            if (get_option('conversell_pending_install')) {
    191191                delete_option('conversell_pending_install');
    … …  
    282282        public function conversell_uninstall(){
    283283            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);
    285285            try {
    286286                if (!$this->fvCommon) {
  • conversell-voice-shopping-builder/tags/1.0.0/view/conversell_bot_settings.php

    r3793880 r3796150  
    1 <?php
     1<?php
     2if ( ! defined( 'ABSPATH' ) ) {
     3    exit;
     4}
    25    require_once 'function.php';
    36    function conversell_bot_settings($conversellOrderStates,$settings,$favizone_config,$moduleStaticData,$conversellSettings,$isAppActivate){
    47?>
    58<header>
    6  <link rel="stylesheet" href="https://sdks.shopifycdn.com/polaris/3.21.0/polaris.min.css" />
    79<style>
    810    .info {
    … …  
    182184                                                    value="<?php echo esc_html($shippingMethod['id']) ?>"
    183185                                                    selected>
    184                                                     <?php echo $shippingMethod['label'] ?>
     186                                                    <?php echo esc_html( $shippingMethod['label'] ); ?>
    185187                                                </option>
    186188                                            <?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
     2if ( ! defined( 'ABSPATH' ) ) {
     3    exit;
     4}
     5function conversell_install($email,$is_user_exist,$favizone_config,$moduleStaticData){ ?>
    26<html>
    37<header>
    4  <link rel="stylesheet" href="https://sdks.shopifycdn.com/polaris/3.21.0/polaris.min.css" />
    58</header>
    69<body>
  • conversell-voice-shopping-builder/tags/1.0.0/view/conversell_settings.php

    r3793880 r3796150  
    11<?php
     2if ( ! defined( 'ABSPATH' ) ) {
     3    exit;
     4}
    25require_once 'function.php';
    36?>
    … …  
    58<html>
    69<header>
    7  <link rel="stylesheet" href="https://sdks.shopifycdn.com/polaris/3.21.0/polaris.min.css" />
    810   <style>
    911       .btn-group .btn-default {
    … …  
    552554                                            $categoriesLevel3 = get_categories($catLevel3Args);
    553555                                            if(empty($categoriesLevel3)){
    554                                                 echo $categorieLevel2->name;
     556                                                echo esc_html( $categorieLevel2->name );
    555557                                            }else{
    556558                                                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
     2if ( ! defined( 'ABSPATH' ) ) {
     3    exit;
     4}
     5?>
    16<strong>
    27NO BOT
  • conversell-voice-shopping-builder/tags/1.0.0/view/function.php

    r3793880 r3796150  
    11<?php
     2if ( ! defined( 'ABSPATH' ) ) {
     3    exit;
     4}
    25/**
    36 * return array
    … …  
    2023    $hide_empty = false ;
    2124    $cat_args = array(
     25        'taxonomy'   => 'product_cat',
    2226        'orderby'    => $orderby,
    2327        'order'      => $order,
    2428        'hide_empty' => $hide_empty,
    2529    );
    26     $product_categories = get_terms( 'product_cat', $cat_args );
     30    $product_categories = get_terms( $cat_args );
    2731    return $product_categories;
    2832}
  • conversell-voice-shopping-builder/tags/1.0.0/view/order_states_config.php

    r3793880 r3796150  
    11<?php
     2if ( ! defined( 'ABSPATH' ) ) {
     3    exit;
     4}
    25function orderStatesConfig(
    36        $wc_states,
    … …  
    119122                        <!-- shop order states -->
    120123                    <th>
    121                         <?php echo $wc_value ?>
     124                        <?php echo esc_html( $wc_value ); ?>   
    122125                    </th>
    123126                    <th>
  • conversell-voice-shopping-builder/tags/1.0.0/view/verify_email.php

    r3793880 r3796150  
    11<?php
     2if ( ! defined( 'ABSPATH' ) ) {
     3    exit;
     4}
    25/**
    36 * Installation & Email Verification – Conversell
    … …  
    69function conversell_install($callback,$shopDomain,$favizone_config = null, $moduleStaticData = null) {
    710    $cmsUtilitiesHost = \conversell_conversational_shopping\ConversellFavizoneApi::getCmsUtilitiesHost();
     11    $conversell_logo  = defined( 'CONVERSELL_CSB_FILE' )
     12        ? plugins_url( 'assets/img/conv.png', CONVERSELL_CSB_FILE )
     13        : '';
    814?>
    915<html>
    … …  
    1218    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    1319    <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     <link
    18         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" />
    2620    <style>
    2721    body {
    28         font-family: 'Montserrat', sans-serif;
     22        font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    2923        background-color: #f9fafb;
    3024    }
     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); } }
    3158
    3259    .box {
    … …  
    115142    <div id="loader" style="display: none; text-align: center; margin: auto;">
    116143        <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>
    119145        </div>
    120146    </div>
    … …  
    128154    <div class="container mt-5">
    129155        <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"
    131157                style="width:180px;">
    132158        </div>
    … …  
    182208    </div>
    183209
    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>
    187215    <script>
    188216    function ValidateEmail(mail) {
    … …  
    197225    function startModal() {
    198226        console.log('startModal.................')
    199         $('#exampleModal').modal();
     227        $('#exampleModal').addClass('show').show();
    200228    }
    201229    $(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 ); ?>";
    204232        let shopId = $(this).attr('data-id');
    205233        var index = $('.shop_item').index(this);
    … …  
    306334                       </div>
    307335                       <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">&#10003;</span>
    309337                        <p>
    310338                            <strong>
    … …  
    329357                });
    330358               
    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                }
    333364            },
    334365            error: function(xhr, status, error) {
    … …  
    517548        echo '<html><head><title>Select Shop</title>
    518549
    519         <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/css/bootstrap.min.css" rel="stylesheet" />
    520 
    521550        <style>
    522551
  • conversell-voice-shopping-builder/trunk/ModuleStaticData.php

    r3793880 r3796150  
    2121
    2222    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);
    2424        $this->rest_url = trailingslashit($rest_url);
    2525        self::$PLUGIN_PATH = rtrim(WP_PLUGIN_DIR, DIRECTORY_SEPARATOR) . '/' . $this->PLUGIN_NAME;
    … …  
    3838        //$this->generate_json_export();
    3939        //$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 );
    4049    }
    4150
    … …  
    5059
    5160        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)) {
    5762                error_log('Conversell: Could not create export directory: ' . $this->CATALOGUE_DIR_PATH);
    5863                return false;
    … …  
    6368
    6469    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()) {
    6671            error_log('Conversell: Export directory not available or not writable: ' . $this->CATALOGUE_DIR_PATH);
    6772            return;
    … …  
    260265    private function get_sale_from_date($product) {
    261266        $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) : '';
    263268    }
    264269
    265270    private function get_sale_to_date($product) {
    266271        $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) : '';
    268273    }
    269274
    … …  
    410415    private function get_product_date($product,$type='created'){
    411416        $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';
    413418    }
    414419
  • conversell-voice-shopping-builder/trunk/classes/ConversellAjaxRequest.php

    r3793880 r3796150  
    11<?php
    22namespace conversell_conversational_shopping;
     3
     4if ( ! defined( 'ABSPATH' ) ) {
     5    exit;
     6}
     7
    38require_once __DIR__ . '../../ConversellFavizoneCommon.php';
    49require_once __DIR__ . '../../ConversellFavizoneCommon.php';
  • conversell-voice-shopping-builder/trunk/classes/ConversellComfirmOrderAsync.php

    r3793880 r3796150  
    22use google_assistant as google_assistant;
    33use conversell_conversational_shopping as conversell;
     4
     5if ( ! defined( 'ABSPATH' ) ) {
     6    exit;
     7}
    48require_once __DIR__ . '/conversell/google_assistant/ConversellPayment.php';
    59require_once __DIR__ . '/ConversellFavizoneCommon.php';
  • conversell-voice-shopping-builder/trunk/classes/ConversellFavizoneAccount.php

    r3793880 r3796150  
    109109        ){
    110110            $bot_data = array();
    111             $site_domaine = parse_url($site_url,PHP_URL_HOST);
     111            $site_domaine = wp_parse_url($site_url,PHP_URL_HOST);
    112112            $bot_data['botName'] = $bot_name;
    113113            $bot_data['botTitle'] = $bot_name;
    … …  
    120120            $bot_data['cmsShop'] =  $site_domaine;
    121121            $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");
    123123            $bot_data["catalog_name"] = $isAppActivate?$site_name.'-'.$lang.'-'
    124124                                        .get_option('woocommerce_currency')
  • conversell-voice-shopping-builder/trunk/classes/ConversellFavizoneApi.php

    r3793880 r3796150  
    111111    public static function rewriteToActiveAppOrigin($uri)
    112112    {
    113         $parts = parse_url((string) $uri);
     113        $parts = wp_parse_url((string) $uri);
    114114        if (!is_array($parts) || empty($parts['host'])) {
    115115            return null;
  • conversell-voice-shopping-builder/trunk/classes/ConversellFavizoneCommon.php

    r3793880 r3796150  
    6464            'language'          => get_locale(),
    6565            'shopUrl'           => site_url(),
    66             'shopName'          => $cmsShop ?: parse_url(site_url(), PHP_URL_HOST),
     66            'shopName'          => $cmsShop ?: wp_parse_url(site_url(), PHP_URL_HOST),
    6767            'connectedSince'    => $connectedSince,
    6868            'country_code'      => $countryCode,
    … …  
    8888     */
    8989    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);
    9191        $workspaceId = get_option('conversell_workspace_id');
    9292        $body = array(
    … …  
    222222    public function get_favizone_site_access_key(){
    223223        $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 );
    225225        $body         = array(
    226226            'cms'     => 'woocommerce',
    … …  
    320320     */
    321321    public function getWidgetChat($mode = 'float') {
    322         $shopName = parse_url(site_url(), PHP_URL_HOST);
     322        $shopName = wp_parse_url(site_url(), PHP_URL_HOST);
    323323        if (!$shopName) {
    324324            return false;
    … …  
    343343                    'cms' => 'woocommerce',
    344344                    '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),
    346346                )
    347347        );
    … …  
    361361    public function getConversellAppEntryUrl(){
    362362        $origin = ConversellFavizoneApi::getConversellAppOrigin();
    363         $shopName = parse_url(site_url(), PHP_URL_HOST);
     363        $shopName = wp_parse_url(site_url(), PHP_URL_HOST);
    364364        $signup = $origin . '/auth/signup?' . http_build_query(array(
    365365            'shopName' => $shopName,
    … …  
    375375        }
    376376        $query = array();
    377         $qs = parse_url($res->redirect_uri, PHP_URL_QUERY);
     377        $qs = wp_parse_url($res->redirect_uri, PHP_URL_QUERY);
    378378        if (is_string($qs)) {
    379379            parse_str($qs, $query);
    … …  
    401401            return ConversellFavizoneApi::rewriteToActiveAppOrigin($uri);
    402402        }
    403         $parts = parse_url((string) $uri);
     403        $parts = wp_parse_url((string) $uri);
    404404        if (!is_array($parts) || empty($parts['host'])) {
    405405            return null;
    … …  
    459459        $args = array();
    460460        $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'),
    462462        )));
    463463
    … …  
    489489        $args = array();
    490490        $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'),
    492492        )));
    493493        $breadcrumbs = new \WC_Breadcrumb();
    … …  
    523523        $hide_empty = false ;
    524524        $cat_args = array(
     525            'taxonomy'   => 'product_cat',
    525526            'orderby'    => $orderby,
    526527            'order'      => $order,
    527528            'hide_empty' => $hide_empty,
    528529        );
    529         $product_categories = get_terms( 'product_cat', $cat_args );
     530        $product_categories = get_terms( $cat_args );
    530531        foreach($product_categories as $product_categorie){
    531532            $categories_name = $this->fv_product->generate_categories($product_categorie);
    … …  
    559560        ConversellSettings::startExportCatalog();
    560561        $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));
    562563       
    563564        /**$initShopUrl = $this->initShopUrl(
    … …  
    578579    public function importCatalog(){
    579580        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));
    581582        $res = $this->fv_sender->favizone_post_request(
    582583            $this->fv_api->getFavizoneLinkingHost(),
    … …  
    10191020    }
    10201021    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));
    10221023        $result = $this->fv_sender->favizone_post_request(
    10231024            $this->fv_api->getFavizoneLinkingHost(),
  • conversell-voice-shopping-builder/trunk/classes/ConversellFavizoneExport.php

    r3793880 r3796150  
    718718            $fileRes = $favizone_dom->save($favizone_file_xml);
    719719        } catch (Exception $e) {
    720             echo "$e";
     720            echo esc_html( $e->getMessage() );
    721721        }
    722722    }
  • conversell-voice-shopping-builder/trunk/classes/ConversellFavizoneMetaProduct.php

    r3793880 r3796150  
    5656        $this->setProductData("shop_id", get_current_blog_id());
    5757            //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());
    6060            ($favizone_description !== '' ) ? $this->setProductData("description", $favizone_description) : true;
    6161            //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());
    6363            ($favizone_short_description !== '' ) ? $this->setProductData("shortDescription", $favizone_short_description) : true;
    6464            //price
    … …  
    129129            //isNew
    130130            $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'));
    132132            $dure = get_option("conversellGeneralSettings")['newProductNbrDate'];
    133133            $date_diff = $data_now->diff($favizone_date_created);
    … …  
    142142                $this->setProductData(
    143143                    "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"))
    145145                );
    146146            }
    … …  
    200200            $this->setProductData("reference", $favizone_product->get_sku());
    201201            //description
    202             $favizone_description = strip_tags($favizone_product->get_description());
     202            $favizone_description = wp_strip_all_tags($favizone_product->get_description());
    203203            ($favizone_description !== '' ) ? $this->setProductData("description", $favizone_description) : true;
    204204            //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());
    206206            ($favizone_short_description !== '' ) ? $this->setProductData("shortDescription", $favizone_short_description) : true;
    207207            //price
    … …  
    270270            //isNew
    271271            $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'));
    273273            $dure = get_option("conversellGeneralSettings")['newProductNbrDate'];
    274274            if( $data_now->diff($favizone_date_created)->d <= $dure ){
    … …  
    281281                $this->setProductData(
    282282                    "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"))
    284284                );
    285285            }
  • conversell-voice-shopping-builder/trunk/classes/ConversellFavizoneOrder.php

    r3793880 r3796150  
    3232    }
    3333    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'));
    3636        $query = new \WC_Order_Query( array(
    3737            'orderby' => 'date',
    … …  
    5252        $favizone_pages = $this->get_count_orders_pages();
    5353        $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'));
    5656        $customers = $fvCommon->getConversellCustomers();
    5757        if(is_array($customers)){
    … …  
    115115    function favizone_send_customers_init_order($customersOrders){
    116116        $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));
    118118        $favizone_data_to_send = array(
    119119            "key" => $favizone_access_key,
    … …  
    146146            $favizone_pages = $this->get_count_orders_pages();
    147147            $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'));
    150150            while (
    151151                $this->favizone_offset <= $favizone_pages
  • conversell-voice-shopping-builder/trunk/classes/ConversellFavizoneSender.php

    r3793880 r3796150  
    113113    private function favizone_post_by_fsock($favizone_url, $favizone_path, $favizone_body)
    114114    {
    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;
    136128        }
    137         return (isset($favizone_result) ? $favizone_result : false) ;
     129        return wp_remote_retrieve_body( $favizone_response );
    138130    }
    139131}
  • conversell-voice-shopping-builder/trunk/classes/ConversellSettings.php

    r3793880 r3796150  
    1212            $this->canalTitle = $canal_title;
    1313            $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);
    1515        }
    1616        public static function uninstallPlugin($moduleStaticData){
    … …  
    8383                    'FilterCollections' => [],
    8484                    'newProductNbrDate' => $settings->defaultSettings->isNew,
    85                     'catalogLastUpdateDate' => date("Y/m/d"),
     85                    'catalogLastUpdateDate' => gmdate("Y/m/d"),
    8686                    'isVoicePayment' => false
    8787                ));
    8888                if(!file_exists($moduleStaticData->CATALOGUE_DIR_PATH))
    89                     mkdir($moduleStaticData->CATALOGUE_DIR_PATH, 0777, true);
     89                    wp_mkdir_p($moduleStaticData->CATALOGUE_DIR_PATH);
    9090                self::setAutoRedirect();
    9191            }else{
    … …  
    138138                do_action('logger',['autoRedirect in000000000000']);
    139139                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;
    141142            }
    142143        }
    … …  
    176177                'FilterCollections' => [],
    177178                'newProductNbrDate' => 30,
    178                 'catalogLastUpdateDate' => date("Y/m/d")
     179                'catalogLastUpdateDate' => gmdate("Y/m/d")
    179180            ));
    180181        }
    … …  
    231232        public function catalogLastUpdateDate(){
    232233            $settings = get_option("conversellGeneralSettings");
    233             $settings['catalogLastUpdateDate'] = date("Y/m/d");
     234            $settings['catalogLastUpdateDate'] = gmdate("Y/m/d");
    234235            update_option('conversellGeneralSettings',$settings);
    235236        }
  • conversell-voice-shopping-builder/trunk/classes/ManageCrone.php

    r3793880 r3796150  
    6363        $schedules['favizone_schedules_now'] = array(
    6464            'interval' => 10,
    65             'display'  => esc_html__( 'Every Five Seconds' ), );
     65            'display'  => esc_html__( 'Every Five Seconds', 'conversell-voice-shopping-builder' ), );
    6666        return $schedules;
    6767    }
  • conversell-voice-shopping-builder/trunk/classes/api/ConversationalGeneralApis.php

    r3793880 r3796150  
    136136                $body = [
    137137                    'urls' => [],
    138                     'shopName' => parse_url(site_url(),PHP_URL_HOST),
     138                    'shopName' => wp_parse_url(site_url(),PHP_URL_HOST),
    139139                    'shopUrl' => site_url(),
    140140                    'language' =>  get_locale(),
    … …  
    182182                        if (!$target) {
    183183                            $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))
    185185                                . '&cms=woocommerce';
    186186                        }
  • conversell-voice-shopping-builder/trunk/classes/api/messenger/MessengerConversellFulfillment_Rest_Api.php

    r3793880 r3796150  
    239239        public function customerExists(\WP_REST_Request $request){
    240240                $email = $request['email'];
    241                 $user = get_user_by_email($email);
     241                $user = get_user_by('email', $email);
    242242        if($user)
    243243                return new \WP_REST_Response(['id' => $user->ID], 200 );
    … …  
    253253            header('Content-Type: text/xml');
    254254            $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.
    256257            exit;
    257258        }else {
    … …  
    310311                        'countryCode' => $shipping_address['postalAddress']['regionCode'],
    311312                );
    312                 do_action("logger", ['feyzfgtyue7878' => date("y/m/d h:i:s")]);
     313                do_action("logger", ['feyzfgtyue7878' => gmdate("y/m/d h:i:s")]);
    313314                do_action('wp_loaded');
    314315                WC()->frontend_includes();
    … …  
    317318                WC()->initialize_cart();
    318319                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);
    320321                $default_shipping = $this->conversellSettings->getSettings()['canalSettings']['defaultShipping'];
    321322                WC()->customer->set_shipping_city($shipping_address['postalAddress']['locality']);
    … …  
    325326                WC()->customer->set_shipping_first_name($shipping_address["first_name"]);
    326327                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")]);
    328329                $lineItems = array();
    329330                $index = 0;
    … …  
    351352                        $index ++;
    352353                }
    353                 do_action("logger", ['f87e9fpos' => date("y/m/d h:i:s")]);
     354                do_action("logger", ['f87e9fpos' => gmdate("y/m/d h:i:s")]);
    354355                $shipping = new WC_Shipping();
    355356                $package =  WC()->cart->get_shipping_packages()[0];
    … …  
    374375                                                                                ? $shipping_line : $shippingLineCollection[0];
    375376
    376                 do_action("logger", ['fzegufyze7854l' => date("y/m/d h:i:s")]);
     377                do_action("logger", ['fzegufyze7854l' => gmdate("y/m/d h:i:s")]);
    377378                \WC()->session->set('chosen_shipping_methods',array($chosen_shipping_methods));
    378379                \WC()->cart->calculate_totals();
    379380                \WC()->cart->calculate_shipping();
    380381                $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")]);
    382383            $data = array();
    383384                $data = [
    … …  
    404405            ];
    405406                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")]);
    407408            return new \WP_REST_Response($data,200);
    408409        }
    … …  
    686687                global $wpdb;
    687688                $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        }
    691698        return $order_status_config->type_status;               
    692699        }
    … …  
    696703                global $wpdb;
    697704                $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;
    701714        return $is_customer_traked;
    702715        }
  • conversell-voice-shopping-builder/trunk/classes/conversell/messenger/ConversellAccount.php

    r3793880 r3796150  
    178178            global $wpdb;
    179179            $bot_data = array();
    180             $site_domaine = parse_url($site_url,PHP_URL_HOST);
     180            $site_domaine = wp_parse_url($site_url,PHP_URL_HOST);
    181181            $cv_common = new ConversellCommon();
    182182            $bot_data['botName'] = $bot_name;
    … …  
    190190            $bot_data['cmsShop'] =  $site_domaine;
    191191            $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");
    193193            $bot_data["catalog_name"] = $site_name.'-'.$lang.'-'
    194194                                        .get_option('woocommerce_currency');
  • conversell-voice-shopping-builder/trunk/classes/conversell/messenger/ConversellCommon.php

    r3793880 r3796150  
    2121        global $wpdb;
    2222        $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;
    2635    }
    2736    /**
  • conversell-voice-shopping-builder/trunk/classes/conversell/messenger/hook/AccountLinking.php

    r3793880 r3796150  
    1717  }
    1818  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;
    2020    $isConversellRequest = $redirect_uri !== null && in_array($redirect_uri, $this->whiteListDomain);
    2121    if($isConversellRequest){
    … …  
    3030  public function userAuthentification($user_login,$user){
    3131    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;
    3333    $isConversellRequest = $redirect_uri !== null && in_array($redirect_uri, $this->whiteListDomain);
    3434    if($isConversellRequest){
  • conversell-voice-shopping-builder/trunk/classes/hook/ConversellAjaxRequest.php

    r3793880 r3796150  
    11<?php
    22namespace conversell_conversational_shopping;
     3
     4if ( ! defined( 'ABSPATH' ) ) {
     5    exit;
     6}
     7
    38require_once __DIR__ . '../../ConversellFavizoneCommon.php';
    49require_once __DIR__ . '../../ConversellFavizoneCommon.php';
  • conversell-voice-shopping-builder/trunk/classes/hook/ConversellFavizoneDownloadHook.php

    r3793880 r3796150  
    77 */
    88namespace conversell_conversational_shopping;
     9
     10if ( ! defined( 'ABSPATH' ) ) {
     11    exit;
     12}
     13
    914require_once CONVERSELL_CSB_DIR . 'classes/ConversellFavizoneExport.php';
    1015
    … …  
    1924    $favizone_date = gmdate('D, d M Y H:i:s');
    2025    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' ) );
    2227        if (isset($favizone_export_site)) {
    2328            $favizone_local_file = CONVERSELL_CSB_DIR . 'ConversellFavizoneExport/favizone-export-cataloge-'.$favizone_export_site.'.xml';
    2429            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 );
    2637                // Vous voulez afficher un xml
    2738                header('Content-Type: text/xml');
    … …  
    3142                header('Expires: ' . $favizone_date);
    3243                // 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.
    3445                exit();
    3546            } else {
  • conversell-voice-shopping-builder/trunk/classes/hook/ConversellFavizoneExportHook.php

    r3793880 r3796150  
    3434            $fz_export = new ConversellFavizoneExport($this->moduleStaticData);
    3535            $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 ) );
    3737            exit;
    3838        }
  • conversell-voice-shopping-builder/trunk/classes/hook/ConversellFavizoneOpenHook.php

    r3793880 r3796150  
    3333                header('Content-Type: text/xml');
    3434                $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.
    3637                exit;
    3738            }else {
  • conversell-voice-shopping-builder/trunk/classes/hook/FavizoneCatalogueTask.php

    r3793880 r3796150  
    1 <?php 
     1<?php
    22namespace conversell_conversational_shopping;
     3
     4if ( ! defined( 'ABSPATH' ) ) {
     5    exit;
     6}
     7
    38require_once __DIR__ . '../../ConversellFavizoneExport.php';
    49require_once __DIR__ . '../../ConversellFavizoneCommon.php';
    … …  
    1924        header('Content-Type: text/xml');
    2025        $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.
    2228        exit;
    2329    }
  • conversell-voice-shopping-builder/trunk/classes/hook/FavizoneEvent.php

    r3793880 r3796150  
    3535                <script>
    3636                    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 ); ?>");
    3939                    });
    4040   
    … …  
    4949                <script>
    5050                    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 ); ?>");
    5353                    });
    5454   
    … …  
    102102                 <script>
    103103                     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 ); ?>");
    105105                     });
    106106                 </script>
    … …  
    114114                 <script>
    115115                     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 ); ?>");
    118118                     });
    119119                 </script>
    … …  
    135135        }
    136136        $favizone_html .="</section>";
    137         echo $favizone_html;
     137        echo wp_kses_post( $favizone_html );
    138138    }
    139139    function favizone_after_single_category(){
    … …  
    156156            (!empty($favizone_cat_obj->description)) ? $favizone_html .= "<span id='favizone_category_description'>" . $favizone_cat_obj->description . "</span>" : true;*/
    157157            $favizone_html .= "</section>";
    158             echo $favizone_html;
     158            echo wp_kses_post( $favizone_html );
    159159        }
    160160    }
    … …  
    183183        }
    184184        $favizone_html .= "</section>";
    185         echo $favizone_html;
     185        echo wp_kses_post( $favizone_html );
    186186    }
    187187    function favizone_before_shop_loop_item(){
    188188        global $product;
    189189        $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>";
    191191    }
    192192    function favizone_after_shop_loop_item(){
    … …  
    205205        $html .= "<span id='favizone_product_active'>".$fz_meta_prod['active']."</span>";
    206206        $html .= "</section>";
    207         echo $html;
     207        echo wp_kses_post( $html );
    208208    }
    209209    function searchHiddenProduct($query) {
    210210        if ($query->is_main_query() && !is_admin() && $query->is_search()) {
    211211            $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 );
    213213        }
    214214    }
    … …  
    216216            $favizone_current_user = wp_get_current_user();
    217217            global $woocommerce;
     218            $favizone_locale_parts = explode( '_', get_locale() );
    218219            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'>" . explode('_', get_locale())[0] . "</span>" . //default language
    225                 "<span id='favizone_price_currency_code'>" . get_woocommerce_currency() . "</span>" . //default currency
     220                "<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>" .
    226227                "</div>";
    227228    }
  • conversell-voice-shopping-builder/trunk/classes/hook/adminhook/ConversellFavizoneCategoryHook.php

    r3793880 r3796150  
    77 */
    88namespace conversell_conversational_shopping;
     9
     10if ( ! defined( 'ABSPATH' ) ) {
     11    exit;
     12}
     13
    914add_action('create_product_cat', 'conversell_favizone_create_category_alexa', 10, 1);
    1015add_action("edited_product_cat", "conversell_favizone_edit_category_alexa");
  • conversell-voice-shopping-builder/trunk/classes/hook/adminhook/ConversellFavizoneProductHook.php

    r3793880 r3796150  
    77 */
    88namespace conversell_conversational_shopping;
     9
     10if ( ! defined( 'ABSPATH' ) ) {
     11    exit;
     12}
     13
    914require_once(ABSPATH . 'wp-admin/includes/upgrade.php');
    1015
  • conversell-voice-shopping-builder/trunk/classes/process_manager/ProcessManager.php

    r3793880 r3796150  
    127127                return;
    128128            }
    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.
    130131        }
    131132        /**
    … …  
    157158            $this->favizone_locale = get_locale();
    158159            $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);
    160161            $this->shop_currency = get_option('woocommerce_currency');
    161162            $this->cmsVersion = get_bloginfo('version', 'raw');
    … …  
    197198            conversell_install(
    198199                get_rest_url()."conversell/completeInstallation",
    199                 parse_url(site_url(),PHP_URL_HOST),
     200                wp_parse_url(site_url(),PHP_URL_HOST),
    200201                $email,
    201202                $isUserExist === "true",
  • conversell-voice-shopping-builder/trunk/classes/process_manager/ProcessManagerMessenger.php

    r3793880 r3796150  
    7373            $this->favizone_locale = get_locale();
    7474            $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);
    7676            $this->shop_currency = get_option('woocommerce_currency');
    7777            $wc_countries = new \WC_Countries();
  • conversell-voice-shopping-builder/trunk/conversell-conversational-shopping-builder.php

    r3793880 r3796150  
    99 * Developer: Conversell
    1010 * Developer URI: https://conversell.ai/
    11  * Text Domain: conversell-conversational-shopping-builder
     11 * Text Domain: conversell-voice-shopping-builder
    1212 * Requires at least: 6.5
    1313 * Requires PHP: 7.4
    … …  
    187187                return;
    188188            }
    189             $shop = parse_url(site_url(), PHP_URL_HOST);
     189            $shop = wp_parse_url(site_url(), PHP_URL_HOST);
    190190            if (get_option('conversell_pending_install')) {
    191191                delete_option('conversell_pending_install');
    … …  
    282282        public function conversell_uninstall(){
    283283            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);
    285285            try {
    286286                if (!$this->fvCommon) {
  • conversell-voice-shopping-builder/trunk/view/conversell_bot_settings.php

    r3793880 r3796150  
    1 <?php
     1<?php
     2if ( ! defined( 'ABSPATH' ) ) {
     3    exit;
     4}
    25    require_once 'function.php';
    36    function conversell_bot_settings($conversellOrderStates,$settings,$favizone_config,$moduleStaticData,$conversellSettings,$isAppActivate){
    47?>
    58<header>
    6  <link rel="stylesheet" href="https://sdks.shopifycdn.com/polaris/3.21.0/polaris.min.css" />
    79<style>
    810    .info {
    … …  
    182184                                                    value="<?php echo esc_html($shippingMethod['id']) ?>"
    183185                                                    selected>
    184                                                     <?php echo $shippingMethod['label'] ?>
     186                                                    <?php echo esc_html( $shippingMethod['label'] ); ?>
    185187                                                </option>
    186188                                            <?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
     2if ( ! defined( 'ABSPATH' ) ) {
     3    exit;
     4}
     5function conversell_install($email,$is_user_exist,$favizone_config,$moduleStaticData){ ?>
    26<html>
    37<header>
    4  <link rel="stylesheet" href="https://sdks.shopifycdn.com/polaris/3.21.0/polaris.min.css" />
    58</header>
    69<body>
  • conversell-voice-shopping-builder/trunk/view/conversell_settings.php

    r3793880 r3796150  
    11<?php
     2if ( ! defined( 'ABSPATH' ) ) {
     3    exit;
     4}
    25require_once 'function.php';
    36?>
    … …  
    58<html>
    69<header>
    7  <link rel="stylesheet" href="https://sdks.shopifycdn.com/polaris/3.21.0/polaris.min.css" />
    810   <style>
    911       .btn-group .btn-default {
    … …  
    552554                                            $categoriesLevel3 = get_categories($catLevel3Args);
    553555                                            if(empty($categoriesLevel3)){
    554                                                 echo $categorieLevel2->name;
     556                                                echo esc_html( $categorieLevel2->name );
    555557                                            }else{
    556558                                                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
     2if ( ! defined( 'ABSPATH' ) ) {
     3    exit;
     4}
     5?>
    16<strong>
    27NO BOT
  • conversell-voice-shopping-builder/trunk/view/function.php

    r3793880 r3796150  
    11<?php
     2if ( ! defined( 'ABSPATH' ) ) {
     3    exit;
     4}
    25/**
    36 * return array
    … …  
    2023    $hide_empty = false ;
    2124    $cat_args = array(
     25        'taxonomy'   => 'product_cat',
    2226        'orderby'    => $orderby,
    2327        'order'      => $order,
    2428        'hide_empty' => $hide_empty,
    2529    );
    26     $product_categories = get_terms( 'product_cat', $cat_args );
     30    $product_categories = get_terms( $cat_args );
    2731    return $product_categories;
    2832}
  • conversell-voice-shopping-builder/trunk/view/order_states_config.php

    r3793880 r3796150  
    11<?php
     2if ( ! defined( 'ABSPATH' ) ) {
     3    exit;
     4}
    25function orderStatesConfig(
    36        $wc_states,
    … …  
    119122                        <!-- shop order states -->
    120123                    <th>
    121                         <?php echo $wc_value ?>
     124                        <?php echo esc_html( $wc_value ); ?>   
    122125                    </th>
    123126                    <th>
  • conversell-voice-shopping-builder/trunk/view/verify_email.php

    r3793880 r3796150  
    11<?php
     2if ( ! defined( 'ABSPATH' ) ) {
     3    exit;
     4}
    25/**
    36 * Installation & Email Verification – Conversell
    … …  
    69function conversell_install($callback,$shopDomain,$favizone_config = null, $moduleStaticData = null) {
    710    $cmsUtilitiesHost = \conversell_conversational_shopping\ConversellFavizoneApi::getCmsUtilitiesHost();
     11    $conversell_logo  = defined( 'CONVERSELL_CSB_FILE' )
     12        ? plugins_url( 'assets/img/conv.png', CONVERSELL_CSB_FILE )
     13        : '';
    814?>
    915<html>
    … …  
    1218    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    1319    <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     <link
    18         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" />
    2620    <style>
    2721    body {
    28         font-family: 'Montserrat', sans-serif;
     22        font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    2923        background-color: #f9fafb;
    3024    }
     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); } }
    3158
    3259    .box {
    … …  
    115142    <div id="loader" style="display: none; text-align: center; margin: auto;">
    116143        <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>
    119145        </div>
    120146    </div>
    … …  
    128154    <div class="container mt-5">
    129155        <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"
    131157                style="width:180px;">
    132158        </div>
    … …  
    182208    </div>
    183209
    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>
    187215    <script>
    188216    function ValidateEmail(mail) {
    … …  
    197225    function startModal() {
    198226        console.log('startModal.................')
    199         $('#exampleModal').modal();
     227        $('#exampleModal').addClass('show').show();
    200228    }
    201229    $(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 ); ?>";
    204232        let shopId = $(this).attr('data-id');
    205233        var index = $('.shop_item').index(this);
    … …  
    306334                       </div>
    307335                       <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">&#10003;</span>
    309337                        <p>
    310338                            <strong>
    … …  
    329357                });
    330358               
    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                }
    333364            },
    334365            error: function(xhr, status, error) {
    … …  
    517548        echo '<html><head><title>Select Shop</title>
    518549
    519         <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/css/bootstrap.min.css" rel="stylesheet" />
    520 
    521550        <style>
    522551
Note: See TracChangeset for help on using the changeset viewer.