### Mod_Security Log Error Example Source: https://support.yithemes.com/hc/en-us/related/click?data=BAh7CjobZGVzdGluYXRpb25fYXJ0aWNsZV9pZGwrCCURdNJTADoYcmVmZXJyZXJfYXJ0aWNsZV9pZGkEhNoeDToLbG9jYWxlSSIKZW4tdXMGOgZFVDoIdXJsSSI%2FL2hjL2VuLXVzL2FydGljbGVzLzM2MDAxMzEwNzQ5My1Tb2NpYWwtTG9naW4tZG9lcy1ub3Qtd29yawY7CFQ6CXJhbmtpCA%3D%3D--bd2986e137f8433a4d6c28251f8886c21d8ba394 Example of a Mod_Security false positive log entry. ```text `[Fri Sep 06 15:08:18.322666 2019] [:error] [pid 31404:tid 47047375914752] [client 127.0.0.1:50660] [client 127.0.0.1] ModSecurity: Access denied with code 403 (phase 2). Matched phrase ".profile" at ARGS:scope. [file "/etc/apache2/conf.d/modsec_vendor_configs/comodo_apache/08_Global_Other.conf"] [line "57"] [id "210580"] [rev "2"] [msg "COMODO WAF: OS File Access Attempt||www.mysite.com|F|2"] [data "Matched Data: .profile found within ARGS:scope: email profile openid https:/www.googleapis.com/auth/userinfo.profile https:/www.googleapis.com/auth/userinfo.email"] [severity "CRITICAL"] [tag "CWAF"] [tag "Other"] [hostname "www.mysite.com"] [uri "/"] [unique_id "XXJaQt8wFaN5k3mICQg0egAAAJg"]` ``` -------------------------------- ### Initialize YITH WooCommerce Multi-Vendor Email Hack Source: https://support.yithemes.com/hc/en-us/article_attachments/115001955833 This is the main initialization file for the plugin. It includes necessary setup and hooks for the plugin's functionality. ```php includes(); // Initialize plugin add_action( 'init', array( $this, 'init_plugin' ) ); } /** * Load plugin text domain * @since 1.0.0 */ public function load_plugin_textdomain() { load_plugin_textdomain( 'yith-woocommerce-multi-vendor-email-hack', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' ); } /** * Include required files * @since 1.0.0 */ public function includes() { require_once YITH_WCMVEH_DIR . 'includes/functions.php'; } /** * Initialize plugin * @since 1.0.0 */ public function init_plugin() { // Add plugin action links add_filter( 'plugin_action_links_' . plugin_basename( __FILE__ ), array( $this, 'add_action_links' ) ); } /** * Add action links * @param array $links * @return array * @since 1.0.0 */ public function add_action_links( $links ) { $plugin_links = array(); $plugin_links['settings'] = '' . __( 'Settings', 'yith-woocommerce-multi-vendor-email-hack' ) . ''; return array_merge( $links, $plugin_links ); } } } /** * Unique identifier for this plugin. * @since 1.0.0 */ if ( ! function_exists( 'yith_wcmveh_install' ) ) { function yith_wcmveh_install() { global $yith_wcmveh_email_hack; if ( ! isset( $yith_wcmveh_email_hack ) ) { $yith_wcmveh_email_hack = new YITH_WCMVEH_Email_Hack(); } return $yith_wcmveh_email_hack; } } /** * Initialize the plugin * @since 1.0.0 */ yith_wcmveh_install(); ``` -------------------------------- ### Initialize YITH Plugin Panel WC Source: https://support.yithemes.com/hc/en-us/article_attachments/115000309574 This snippet initializes the YITH Plugin Panel Web Component. It's typically used in plugin setup or initialization routines. ```php get_role_name(), $user->roles ) ){ remove_action( 'init', array( storefront_powerpack(), 'includes' ), 0 ); } } ``` -------------------------------- ### Use YITH WooCommerce Ajax Search Shortcode Source: https://support.yithemes.com/hc/en-us/related/click?data=BAh7CjobZGVzdGluYXRpb25fYXJ0aWNsZV9pZGkE4fIHDToYcmVmZXJyZXJfYXJ0aWNsZV9pZGwrCJ3hKAQ6EDoLbG9jYWxlSSIKZW4tdXMGOgZFVDoIdXJsSSJTL2hjL2VuLXVzL2FydGljbGVzLzIxODYyNDczNy1Ib3ctdG8tcmVwbGFjZS10aGUtc3RhbmRhcmQtc2VhcmNoLW9uLW91ci13ZWJzaXRlBjsIVDoJcmFua2kI--52608d78da8b8c9ccfc5bf467ee072dba978e7a5 This shortcode can be used in posts, pages, or widget areas to display the YITH WooCommerce Ajax Search form. No additional setup is required beyond plugin activation. ```shortcode [yith_woocommerce_ajax_search] ``` -------------------------------- ### Customize Variable Product Price Display in WooCommerce Source: https://support.yithemes.com/hc/en-us/related/click?data=BAh7CjobZGVzdGluYXRpb25fYXJ0aWNsZV9pZGwrCGZqjsYaADoYcmVmZXJyZXJfYXJ0aWNsZV9pZGwrCKnp89JTADoLbG9jYWxlSSIKZW4tdXMGOgZFVDoIdXJsSSJrL2hjL2VuLXVzL2FydGljbGVzLzExNTAwMDM3MTgxNC1Sb2xlLUJhc2VkLVByaWNlLUhvdy10by1jaGFuZ2UtdGhlLXByaWNlLWRpc3BsYXktZm9yLXZhcmlhYmxlLXByb2R1Y3RzBjsIVDoJcmFua2kG--5fe65482cba5a83881a604c335d1239b251fbec6 Add this PHP code to your theme's functions.php file to change how variable product prices are displayed. It formats prices from a range to show a starting price, like 'From: $100'. Ensure the YITH Role Based Prices plugin is active. ```php if ( defined( 'YWCRBP_PREMIUM' ) && function_exists( 'YITH_Role_Based_Prices_Product' ) ) { add_filter( 'ywcrbp_variable_regular_price_html', 'ywcrbp_my_wc_custom_variable_price_html', 10, 4 ); add_filter( 'ywcrbp_variable_sale_price_html', 'ywcrbp_my_wc_custom_variable_price_html', 10, 4 ); add_filter( 'ywcrbp_variable_your_price_html', 'ywcrbp_my_wc_custom_variable_price_html', 10, 4 ); /** * @param string $price * @param WC_Product_Variable $product * @return string */ function ywcrbp_my_wc_custom_variable_price_html( $price, $product, $min, $max ) { if ( $product->get_type() === 'variable' ) { $suffix = YITH_Role_Based_Prices_Product()->get_price_suffix( $product ); $current_filter = current_filter(); $price_html = sprintf( __( 'From %s', 'your-text-domain' ), wc_price( $min ) . $suffix ); if ( 'ywcrbp_variable_regular_price_html' === $current_filter || 'ywcrbp_variable_sale_price_html' === $current_filter ) { $rule_price = YITH_Role_Based_Prices_Product()->get_variable_product_rule_price( $product ); if ( ! empty( $rule_price['rules']['min'] ) ) { $price_html = '' . $price_html . ''; } } // Return price if min is equal to max. if ( $min === $max ) { return $price; } return $price_html; } return $price; } } ```