} $sug_width = DGWT_WCAS()->settings->getOption( 'sug_width' ); if ( !empty($sug_width) && is_numeric( $sug_width ) && $sug_width > 100 ) { $localize['sug_width'] = absint( $sug_width ); } // Show/hide Details panel if ( DGWT_WCAS()->settings->getOption( 'show_details_box' ) === 'on' ) { $localize['show_details_box'] = true; } // Show/hide images if ( DGWT_WCAS()->settings->getOption( 'show_product_image' ) === 'on' ) { $localize['show_images'] = true; } // Show/hide price if ( DGWT_WCAS()->settings->getOption( 'show_product_price' ) === 'on' ) { $localize['show_price'] = true; } // Show/hide description if ( DGWT_WCAS()->settings->getOption( 'show_product_desc' ) === 'on' ) { $localize['show_desc'] = true; } // Show/hide description if ( DGWT_WCAS()->settings->getOption( 'show_product_sku' ) === 'on' ) { $localize['show_sku'] = true; } // Show/hide sale badge if ( DGWT_WCAS()->settings->getOption( 'show_sale_badge' ) === 'on' ) { $localize['show_sale_badge'] = true; } // Show/hide featured badge if ( DGWT_WCAS()->settings->getOption( 'show_featured_badge' ) === 'on' ) { $localize['show_featured_badge'] = true; } // Set preloader if ( DGWT_WCAS()->settings->getOption( 'show_preloader' ) === 'on' ) { $localize['show_preloader'] = true; $localize['preloader_url'] = esc_url( trim( DGWT_WCAS()->settings->getOption( 'preloader_url' ) ) ); } // Show/hide autocomplete headings if ( DGWT_WCAS()->settings->getOption( 'show_grouped_results' ) === 'on' ) { $localize['show_headings'] = true; } return apply_filters( 'dgwt/wcas/scripts/localize', $localize ); } /** * Get endpoint URL * * @param string $type * * @return string */ public static function getEndpointUrl( $type = '' ) { $url = ''; if ( !in_array( $type, array( 'search', 'details', 'prices' ) ) ) { return $url; } switch ( $type ) { case 'search': $url = \WC_AJAX::get_endpoint( DGWT_WCAS_SEARCH_ACTION ); break; case 'details': $url = \WC_AJAX::get_endpoint( DGWT_WCAS_RESULT_DETAILS_ACTION ); break; case 'prices': $url = \WC_AJAX::get_endpoint( DGWT_WCAS_GET_PRICES_ACTION ); break; default: break; } return apply_filters( "dgwt/wcas/endpoint/{$type}", $url ); } /** * Checking the current code is run by the object of the given class * * @param string $class_name Class name * @param int $backtrace_limit The number of stack frames that is tested backwards. * * @return bool */ public static function is_running_inside_class( $class_name, $backtrace_limit = 10 ) { if ( empty($class_name) ) { return false; } if ( intval( $backtrace_limit ) <= 0 ) { $backtrace_limit = 10; } $result = false; $backtrace = self::debugBacktrace( 0, $backtrace_limit ); if ( !empty($backtrace) ) { foreach ( $backtrace as $item ) { if ( isset( $item['class'] ) && $item['class'] === $class_name ) { $result = true; break; } } } return $result; } private static function debugBacktrace( $options, $limit ) { return debug_backtrace( $options, $limit ); } /** * Search products with native engine * * @param $phrase * * @return int[] */ public static function searchProducts( $phrase ) { $postIn = array(); $urlPhrase = str_replace( "\\'", "'", $phrase ); $urlPhrase = str_replace( '\\"', '"', $urlPhrase ); $args = array( 's' => urlencode( $urlPhrase ), 'remote' => 1, ); if ( Multilingual::isMultilingual() ) { $args['l'] = Multilingual::getCurrentLanguage(); } $url = add_query_arg( $args, Helpers::getAjaxSearchEndpointUrl() ); $r = wp_remote_retrieve_body( wp_remote_get( $url, array( 'timeout' => 120, ) ) ); $decR = json_decode( $r ); if ( json_last_error() == JSON_ERROR_NONE ) { if ( is_object( $decR ) && property_exists( $decR, 'suggestions' ) && is_array( $decR->suggestions ) ) { $postIn = wp_list_pluck( $decR->suggestions, 'ID' ); } } return $postIn; } /** * Get all post types used in search * * @param string $filter 'no-products' returns post types not related to products * 'only-products' returns post types related to products * * @return array */ public static function getAllowedPostTypes( $filter = '' ) { $types = array(); if ( $filter !== 'no-products' ) { $types[] = 'product'; $types[] = 'product-variation'; } if ( $filter !== 'only-products' ) { if ( DGWT_WCAS()->settings->getOption( 'show_matching_posts' ) === 'on' ) { $types[] = 'post'; } if ( DGWT_WCAS()->settings->getOption( 'show_matching_pages' ) === 'on' ) { $types[] = 'page'; } } return apply_filters( 'dgwt/wcas/allowed_post_types', $types, $filter ); } /** * Get Basic Auth header from dedicated constants or from current request * * @return string */ public static function getBasicAuthHeader() { $authorization = ''; if ( defined( 'DGWT_WCAS_BA_USERNAME' ) && defined( 'DGWT_WCAS_BA_PASSWORD' ) ) { $authorization = 'Basic ' . base64_encode( wp_unslash( DGWT_WCAS_BA_USERNAME ) . ':' . wp_unslash( DGWT_WCAS_BA_PASSWORD ) ); } elseif ( isset( $_SERVER['PHP_AUTH_USER'] ) && isset( $_SERVER['PHP_AUTH_PW'] ) ) { $authorization = 'Basic ' . base64_encode( wp_unslash( $_SERVER['PHP_AUTH_USER'] ) . ':' . wp_unslash( $_SERVER['PHP_AUTH_PW'] ) ); } return $authorization; } /** * Get plugin version * * @return string */ public static function getPluginVersion() { global $wpdb ; $version = $wpdb->get_var( "SELECT option_value FROM {$wpdb->options} WHERE option_name = 'dgwt_wcas_version_pro'" ); return ( empty($version) ? '' : $version ); } /** * Get AJAX search endpoint URL * * @param null $scheme * * @return string * * @see \WC_AJAX::get_endpoint() - Almost the same, but you can choose a scheme */ public static function getAjaxSearchEndpointUrl( $scheme = null ) { return esc_url_raw( apply_filters( 'woocommerce_ajax_get_endpoint', add_query_arg( 'wc-ajax', DGWT_WCAS_SEARCH_ACTION, remove_query_arg( array( 'remove_item', 'add-to-cart', 'added-to-cart', 'order_again', '_wpnonce' ), home_url( '/', $scheme ) ) ), DGWT_WCAS_SEARCH_ACTION ) ); } /** * Check that the AMP version of the page is displayed * * @return bool */ public static function isAMPEndpoint() { return function_exists( 'is_amp_endpoint' ) && is_amp_endpoint(); } /** * Get the path to the fibo directory in the theme or child theme * * @param string $path * @param array $vars * * @return void */ public static function loadTemplate( $template = '', $vars = array() ) { $path = ''; // Load default partials from the plugin $file = DGWT_WCAS_DIR . 'partials/' . $template; if ( file_exists( $file ) ) { $path = $file; } // Load a partial if it is localized in the child-theme $file = get_stylesheet_directory() . '/fibosearch/' . $template; if ( file_exists( $file ) ) { $path = $file; } $path = apply_filters( 'dgwt/wcas/template', $path, $template, $vars ); if ( file_exists( $path ) ) { include $path; } } /** * Add "No results" if suggestions are empty * * @param array $output * * @return array */ public static function noResultsSuggestion( $output ) { if ( empty($output['suggestions']) ) { $output['suggestions'][] = array( 'value' => '', 'type' => 'no-results', ); } return $output; } /** * Get default collate * * @param string $context * * @return string */ public static function getCollate( $context = '' ) { global $wpdb ; $sql = ''; $collate = ''; $charset = ''; if ( $wpdb->has_cap( 'collation' ) ) { if ( !empty($wpdb->charset) ) { $charset = $wpdb->charset; } if ( !empty($wpdb->collate) ) { $collate = $wpdb->collate; } } $charset = apply_filters( 'dgwt/wcas/db/charset', $charset, $context ); $collate = apply_filters( 'dgwt/wcas/db/collation', $collate, $context ); if ( !empty($charset) ) { $sql .= " DEFAULT CHARACTER SET " . $charset; } if ( !empty($collate) ) { $sql .= " COLLATE " . $collate; } return apply_filters( 'dgwt/wcas/db/collation/sql', $sql, $context ); } }
Fatal error: Uncaught Error: Class 'DgoraWcas\Helpers' not found in /home3/zebrang1/public_html/wp-content/plugins/ajax-search-for-woocommerce/includes/Integrations/Plugins/WooCommerce/WooCommerce.php:23 Stack trace: #0 /home3/zebrang1/public_html/wp-content/plugins/ajax-search-for-woocommerce/includes/Integrations/Plugins/PluginsCompatibility.php(37): DgoraWcas\Integrations\Plugins\WooCommerce\WooCommerce->init() #1 /home3/zebrang1/public_html/wp-content/plugins/ajax-search-for-woocommerce/includes/Integrations/Plugins/PluginsCompatibility.php(13): DgoraWcas\Integrations\Plugins\PluginsCompatibility->loadCompatibilities() #2 /home3/zebrang1/public_html/wp-content/plugins/ajax-search-for-woocommerce/ajax-search-for-woocommerce.php(76): DgoraWcas\Integrations\Plugins\PluginsCompatibility->__construct() #3 /home3/zebrang1/public_html/wp-content/plugins/ajax-search-for-woocommerce/ajax-search-for-woocommerce.php(343): DGWT_WC_Ajax_Search::getInstance() #4 /home3/zebrang1/public_html/wp-includes/class-wp-hook.php(307): DGWT_W in /home3/zebrang1/public_html/wp-content/plugins/ajax-search-for-woocommerce/includes/Integrations/Plugins/WooCommerce/WooCommerce.php on line 23