Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the hostinger domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /home/u459467388/domains/calicoandcrane.com/public_html/wp-includes/functions.php on line 6121
/** * Compress HTML * * This is a heavy regex-based removal of whitespace, unnecessary comments and * tokens. IE conditional comments are preserved. There are also options to have * STYLE and SCRIPT blocks compressed by callback functions. * * A test suite is available. * * @package Minify * @author Stephen Clay */ namespace LiteSpeed\Lib; defined( 'WPINC' ) || exit; class HTML_MIN { /** * @var string */ protected $_html = ''; /** * @var boolean */ protected $_jsCleanComments = true; protected $_skipComments = array(); /** * "Minify" an HTML page * * @param string $html * * @param array $options * * 'cssMinifier' : (optional) callback function to process content of STYLE * elements. * * 'jsMinifier' : (optional) callback function to process content of SCRIPT * elements. Note: the type attribute is ignored. * * 'xhtml' : (optional boolean) should content be treated as XHTML1.0? If * unset, minify will sniff for an XHTML doctype. * * @return string */ public static function minify( $html, $options = array() ) { $min = new self( $html, $options ); return $min->process(); } /** * Create a minifier object * * @param string $html * * @param array $options * * 'cssMinifier' : (optional) callback function to process content of STYLE * elements. * * 'jsMinifier' : (optional) callback function to process content of SCRIPT * elements. Note: the type attribute is ignored. * * 'jsCleanComments' : (optional) whether to remove HTML comments beginning and end of script block * * 'xhtml' : (optional boolean) should content be treated as XHTML1.0? If * unset, minify will sniff for an XHTML doctype. */ public function __construct( $html, $options = array() ) { $this->_html = str_replace( "\r\n", "\n", trim( $html ) ); if ( isset( $options['xhtml'] ) ) { $this->_isXhtml = (bool) $options['xhtml']; } if ( isset( $options['cssMinifier'] ) ) { $this->_cssMinifier = $options['cssMinifier']; } if ( isset( $options['jsMinifier'] ) ) { $this->_jsMinifier = $options['jsMinifier']; } if ( isset( $options['jsCleanComments'] ) ) { $this->_jsCleanComments = (bool) $options['jsCleanComments']; } if ( isset( $options['skipComments'] ) ) { $this->_skipComments = $options['skipComments']; } } /** * Minify the markeup given in the constructor * * @return string */ public function process() { if ( $this->_isXhtml === null ) { $this->_isXhtml = ( false !== strpos( $this->_html, '_replacementHash = 'MINIFYHTML' . md5( $_SERVER['REQUEST_TIME'] ); $this->_placeholders = array(); // replace SCRIPTs (and minify) with placeholders $this->_html = preg_replace_callback( '/(\\s*)]*?>)([\\s\\S]*?)<\\/script>(\\s*)/i', array( $this, '_removeScriptCB' ), $this->_html ); // replace STYLEs (and minify) with placeholders $this->_html = preg_replace_callback( '/\\s*]*>)([\\s\\S]*?)<\\/style>\\s*/i', array( $this, '_removeStyleCB' ), $this->_html ); // remove HTML comments (not containing IE conditional comments). $this->_html = preg_replace_callback( '//', array( $this, '_commentCB' ), $this->_html ); // replace PREs with placeholders $this->_html = preg_replace_callback( '/\\s*]*?>[\\s\\S]*?<\\/pre>)\\s*/i', array( $this, '_removePreCB' ), $this->_html ); // replace TEXTAREAs with placeholders $this->_html = preg_replace_callback( '/\\s*]*?>[\\s\\S]*?<\\/textarea>)\\s*/i', array( $this, '_removeTextareaCB' ), $this->_html ); // trim each line. // @todo take into account attribute values that span multiple lines. $this->_html = preg_replace( '/^\\s+|\\s+$/m', '', $this->_html ); // remove ws around block/undisplayed elements $this->_html = preg_replace( '/\\s+(<\\/?(?:area|article|aside|base(?:font)?|blockquote|body' . '|canvas|caption|center|col(?:group)?|dd|dir|div|dl|dt|fieldset|figcaption|figure|footer|form' . '|frame(?:set)?|h[1-6]|head|header|hgroup|hr|html|legend|li|link|main|map|menu|meta|nav' . '|ol|opt(?:group|ion)|output|p|param|section|t(?:able|body|head|d|h||r|foot|itle)' . '|ul|video)\\b[^>]*>)/i', '$1', $this->_html ); // remove ws outside of all elements $this->_html = preg_replace( '/>(\\s(?:\\s*))?([^<]+)(\\s(?:\s*))?$1$2$3<', $this->_html ); // use newlines before 1st attribute in open tags (to limit line lengths) // $this->_html = preg_replace('/(<[a-z\\-]+)\\s+([^>]+>)/i', "$1\n$2", $this->_html); // fill placeholders $this->_html = str_replace( array_keys( $this->_placeholders ), array_values( $this->_placeholders ), $this->_html ); // issue 229: multi-pass to catch scripts that didn't get replaced in textareas $this->_html = str_replace( array_keys( $this->_placeholders ), array_values( $this->_placeholders ), $this->_html ); return $this->_html; } /** * From LSCWP 6.2: Changed the function to test for special comments that will be skipped. See: https://github.com/litespeedtech/lscache_wp/pull/622 */ protected function _commentCB( $m ) { // If is IE conditional comment return it. if ( 0 === strpos( $m[1], '[' ) || false !== strpos( $m[1], ' HTML Settings -> HTML Keep comments if ( count( $this->_skipComments ) > 0 ) { foreach ( $this->_skipComments as $comment ) { if ( $comment && strpos( $m[1], $comment ) !== false ) { return $m[0]; } } } // Comment can be removed. return ''; } protected function _reservePlace( $content ) { $placeholder = '%' . $this->_replacementHash . count( $this->_placeholders ) . '%'; $this->_placeholders[ $placeholder ] = $content; return $placeholder; } protected $_isXhtml = null; protected $_replacementHash = null; protected $_placeholders = array(); protected $_cssMinifier = null; protected $_jsMinifier = null; protected function _removePreCB( $m ) { return $this->_reservePlace( "_reservePlace( "\\s*$)/', '', $css ); // remove CDATA section markers $css = $this->_removeCdata( $css ); // minify $minifier = $this->_cssMinifier ? $this->_cssMinifier : 'trim'; $css = call_user_func( $minifier, $css ); return $this->_reservePlace( $this->_needsCdata( $css ) ? "{$openStyle}/**/" : "{$openStyle}{$css}" ); } protected function _removeScriptCB( $m ) { $openScript = "_jsCleanComments ) { $js = preg_replace( '/(?:^\\s*\\s*$)/', '', $js ); } // remove CDATA section markers $js = $this->_removeCdata( $js ); // minify /** * Added 2nd param by LiteSpeed * * @since 2.2.3 */ if ( $this->_jsMinifier ) { $js = call_user_func( $this->_jsMinifier, $js, trim( $m[2] ) ); } else { $js = trim( $js ); } return $this->_reservePlace( $this->_needsCdata( $js ) ? "{$ws1}{$openScript}/**/{$ws2}" : "{$ws1}{$openScript}{$js}{$ws2}" ); } protected function _removeCdata( $str ) { return ( false !== strpos( $str, '' ), '', $str ) : $str; } protected function _needsCdata( $str ) { return ( $this->_isXhtml && preg_match( '/(?:[<&]|\\-\\-|\\]\\]>)/', $str ) ); } }/** * The registry for Third Party Plugins Integration files. * * This file is only used to include the integration files/classes. * This works as an entry point for the initial add_action for the * detect function. * * It is not required to add all integration files here, this just provides * a common place for plugin authors to append their file to. */ defined('WPINC') || exit(); use LiteSpeed\API; $third_cls = array( 'Aelia_CurrencySwitcher', 'Autoptimize', 'Avada', 'BBPress', 'Beaver_Builder', 'Caldera_Forms', 'Divi_Theme_Builder', 'Facetwp', 'LiteSpeed_Check', 'Theme_My_Login', 'User_Switching', 'WCML', 'WooCommerce', 'WC_PDF_Product_Vouchers', 'Woo_Paypal', 'Wp_Polls', 'WP_PostRatings', 'Wpdiscuz', 'WPLister', 'WPML', 'WpTouch', 'Yith_Wishlist', ); foreach ($third_cls as $cls) { add_action('litespeed_load_thirdparty', 'LiteSpeed\Thirdparty\\' . $cls . '::detect'); } // Preload needed for certain thirdparty add_action('litespeed_init', 'LiteSpeed\Thirdparty\Divi_Theme_Builder::preload'); add_action('litespeed_init', 'LiteSpeed\Thirdparty\WooCommerce::preload'); add_action('litespeed_init', 'LiteSpeed\Thirdparty\NextGenGallery::preload'); add_action('litespeed_init', 'LiteSpeed\Thirdparty\AMP::preload'); add_action('litespeed_init', 'LiteSpeed\Thirdparty\Elementor::preload'); add_action('litespeed_init', 'LiteSpeed\Thirdparty\Gravity_Forms::preload'); add_action('litespeed_init', 'LiteSpeed\Thirdparty\Perfmatters::preload');/** * Class file for WCPay\Core\Server\Request\Update_Account. * * @package WooCommerce Payments */ namespace WCPay\Core\Server\Request; use WCPay\Core\Exceptions\Server\Request\Invalid_Request_Parameter_Exception; use WCPay\Core\Server\Request; use WC_Payments_API_Client; /** * Request class for updating account. */ class Update_Account extends Request { /** * Specifies the WordPress hook name that will be triggered upon calling the send() method. * * @var string */ protected $hook = 'wcpay_update_account_settings'; /** * Returns the request's API. * * @return string */ public function get_api(): string { return WC_Payments_API_Client::ACCOUNTS_API; } /** * Returns the request's HTTP method. */ public function get_method(): string { return 'POST'; } /** * If true, the request will be signed with the user token rather than blog token. * * @return bool */ public function should_use_user_token(): bool { return true; } /** * Used to prepare request from array account_settings. * * @param array $account_settings Account settings: key is the param name, value is the param value. * * @return static * @throws Invalid_Request_Parameter_Exception When either no account settings provided or no existing setter for provided parameter. */ public static function from_account_settings( array $account_settings ) { if ( 0 === count( $account_settings ) ) { throw new Invalid_Request_Parameter_Exception( esc_html__( 'No account settings provided', 'woocommerce-payments' ), 'wcpay_core_invalid_request_parameter_account_settings_empty' ); } $wcpay_request = static::create(); foreach ( $account_settings as $param_name => $value ) { $param_setter = 'set_' . $param_name; if ( method_exists( static::class, $param_setter ) ) { $wcpay_request->{$param_setter}( $value ); } } return $wcpay_request; } /** * Sets the account statement descriptor. * * @param string $statement_descriptor Statement descriptor. * * @return void */ public function set_statement_descriptor( string $statement_descriptor ) { $this->set_param( 'statement_descriptor', $statement_descriptor ); } /** * Sets the account statement descriptor kanji. * * @param string $statement_descriptor_kanji Statement descriptor kanji. * * @return void */ public function set_statement_descriptor_kanji( string $statement_descriptor_kanji ) { $this->set_param( 'statement_descriptor_kanji', $statement_descriptor_kanji ); } /** * Sets the account statement descriptor kana. * * @param string $statement_descriptor_kana Statement descriptor kana. * * @return void */ public function set_statement_descriptor_kana( string $statement_descriptor_kana ) { $this->set_param( 'statement_descriptor_kana', $statement_descriptor_kana ); } /** * Sets the account business name. * * @param string $business_name Business name. * * @return void */ public function set_business_name( string $business_name ) { $this->set_param( 'business_name', $business_name ); } /** * Sets the account business url. * * @param string $business_url Business url. * * @return void */ public function set_business_url( string $business_url ) { $this->set_param( 'business_url', $business_url ); } /** * Sets the account business support address. * * @param string $business_support_address Business support address. * * @return void */ public function set_business_support_address( string $business_support_address ) { $this->set_param( 'business_support_address', $business_support_address ); } /** * Sets the account business support email. * * @param string $business_support_email Business support email. * * @return void */ public function set_business_support_email( string $business_support_email ) { $this->set_param( 'business_support_email', $business_support_email ); } /** * Sets the account business support phone. * * @param string $business_support_phone Business support phone. * * @return void */ public function set_business_support_phone( string $business_support_phone ) { $this->set_param( 'business_support_phone', $business_support_phone ); } /** * Sets the account branding logo. * * @param string $branding_logo Branding logo. * * @return void */ public function set_branding_logo( string $branding_logo ) { $this->set_param( 'branding_logo', $branding_logo ); } /** * Sets the account branding icon. * * @param string $branding_icon Branding icon. * * @return void */ public function set_branding_icon( string $branding_icon ) { $this->set_param( 'branding_icon', $branding_icon ); } /** * Sets the account branding primary color. * * @param string $branding_primary_color Branding primary color. * * @return void */ public function set_branding_primary_color( string $branding_primary_color ) { $this->set_param( 'branding_primary_color', $branding_primary_color ); } /** * Sets the account branding secondary color. * * @param string $branding_secondary_color Branding secondary color. * * @return void */ public function set_branding_secondary_color( string $branding_secondary_color ) { $this->set_param( 'branding_secondary_color', $branding_secondary_color ); } /** * Sets the deposit schedule interval. * * @param string $deposit_schedule_interval Deposit schedule interval. * * @return void */ public function set_deposit_schedule_interval( string $deposit_schedule_interval ) { $this->set_param( 'deposit_schedule_interval', $deposit_schedule_interval ); } /** * Sets the deposit schedule weekly anchor. * * @param string $deposit_schedule_weekly_anchor Deposit schedule weekly anchor. * * @return void */ public function set_deposit_schedule_weekly_anchor( string $deposit_schedule_weekly_anchor ) { $this->set_param( 'deposit_schedule_weekly_anchor', $deposit_schedule_weekly_anchor ); } /** * Sets the deposit schedule monthly anchor. * * @param string $deposit_schedule_monthly_anchor Deposit schedule monthly anchor. * * @return void */ public function set_deposit_schedule_monthly_anchor( string $deposit_schedule_monthly_anchor ) { $this->set_param( 'deposit_schedule_monthly_anchor', $deposit_schedule_monthly_anchor ); } /** * Sets the account locale. * * @param string $locale Account locale. * * @return void */ public function set_locale( string $locale ) { $this->set_param( 'locale', $locale ); } }
Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the woocommerce-payments domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /home/u459467388/domains/calicoandcrane.com/public_html/wp-includes/functions.php on line 6121
/** * Customizer Site options importer class. * * @since 1.0.0 * @package Astra Addon */ namespace AiBuilder\Inc\Classes\Importer; use AiBuilder\Inc\Traits\Instance; /** * Customizer Site options importer class. * * @since 1.0.0 */ class Ai_Builder_Site_Options_Import { use Instance; } Ai_Builder_Site_Options_Import::Instance();
Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the woo-cart-abandonment-recovery domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /home/u459467388/domains/calicoandcrane.com/public_html/wp-includes/functions.php on line 6121
/** * Cart Abandonment * * @package Woocommerce-Cart-Abandonment-Recovery */ if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly. } /** * Cart abandonment tracking class. */ class Cartflows_Ca_Setting_Functions { /** * Member Variable * * @var object instance */ private static $instance; /** * Initiator */ public static function get_instance() { if ( ! isset( self::$instance ) ) { self::$instance = new self(); } return self::$instance; } /** * Constructor function that initializes required actions and hooks. */ public function __construct() { $page = Cartflows_Ca_Helper::get_instance()->sanitize_text_filter( 'page', 'GET' ); if ( WCF_CA_PAGE_NAME === $page ) { // Adding filter to add new button to add custom fields. add_filter( 'mce_buttons', array( $this, 'wcf_filter_mce_button' ) ); add_filter( 'mce_external_plugins', array( $this, 'wcf_filter_mce_plugin' ), 9 ); } // GDPR actions. add_action( 'wp_ajax_cartflows_skip_cart_tracking_gdpr', array( $this, 'skip_cart_tracking_by_gdpr' ) ); add_action( 'wp_ajax_nopriv_cartflows_skip_cart_tracking_gdpr', array( $this, 'skip_cart_tracking_by_gdpr' ) ); // Delete coupons. add_action( 'wp_ajax_wcf_ca_delete_garbage_coupons', array( $this, 'delete_used_and_expired_coupons' ) ); } /** * Register button. * * @param array $buttons mce buttons. * @return mixed */ public function wcf_filter_mce_button( $buttons ) { array_push( $buttons, 'cartflows_ac' ); return $buttons; } /** * Link JS to mce button. * * @param array $plugins mce pluggins. * @return mixed */ public function wcf_filter_mce_plugin( $plugins ) { $file_ext = Cartflows_Ca_Helper::get_instance()->get_js_file_ext(); $plugins['cartflows_ac'] = CARTFLOWS_CA_URL . 'admin/assets/' . $file_ext['folder'] . '/admin-mce.' . $file_ext['file_ext']; return $plugins; } /** * Delete tracked data and set cookie for the user. */ public function skip_cart_tracking_by_gdpr() { check_ajax_referer( 'cartflows_skip_cart_tracking_gdpr', 'security' ); global $wpdb; $cart_abandonment_table = $wpdb->prefix . CARTFLOWS_CA_CART_ABANDONMENT_TABLE; $session_id = WC()->session->get( 'wcf_session_id' ); if ( $session_id ) { $wpdb->delete( $cart_abandonment_table, array( 'session_id' => sanitize_key( $session_id ) ) ); // db call ok; no cache ok. } // Ignoring below rule as it need to replace the already build cookie logic to another logic. Can be update in future scope. setcookie( 'wcf_ca_skip_track_data', 'true', 0, '/' ); //phpcs:ignore WordPressVIPMinimum.Functions.RestrictedFunctions.cookies_setcookie wp_send_json_success(); } /** * Check if transient is set for delete garbage coupons. */ public function delete_used_and_expired_coupons() { $is_ajax_request = wp_doing_ajax(); $is_transient_set = false; global $wpdb; if ( $is_ajax_request ) { if ( ! current_user_can( 'manage_woocommerce' ) ) { wp_send_json_error( __( 'Permission denied.', 'woo-cart-abandonment-recovery' ) ); } check_ajax_referer( 'wcf_ca_delete_garbage_coupons', 'security' ); } else { $is_transient_set = get_transient( 'woocommerce_ca_delete_garbage_coupons' ); } if ( false === $is_transient_set || $is_ajax_request ) { $coupons = $this->delete_garbage_coupons(); $coupon_count = count( $coupons ); if ( $coupon_count ) { $coupons_post_ids = implode( ',', wp_list_pluck( $coupons, 'ID' ) ); // Can't use placeholders for table/column names, it will be wrapped by a single quote (') instead of a backquote (`). $wpdb->query( "DELETE FROM {$wpdb->prefix}postmeta WHERE post_id IN( $coupons_post_ids )" //phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared ); // db call ok; no cache ok. $wpdb->query( "DELETE FROM {$wpdb->prefix}posts WHERE ID IN( $coupons_post_ids )" //phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared ); // db call ok; no cache ok. } if ( ! $is_ajax_request ) { set_transient( 'woocommerce_ca_delete_garbage_coupons', $coupons, WEEK_IN_SECONDS ); return; } // translators: %1$s: Coupons Deleted, %2$s: Deleted coupons count'. wp_send_json_success( sprintf( __( '%1$s: %2$d', 'woo-cart-abandonment-recovery' ), 'Coupons Deleted', $coupon_count ) ); } } /** * Set transient and delete garbage coupons. */ public function delete_garbage_coupons() { global $wpdb; $coupon_generated_by = WCF_CA_COUPON_GENERATED_BY; $timestamp = time(); $post_type = 'shop_coupon'; $coupons = $wpdb->get_results( $wpdb->prepare( "SELECT ID, coupon_code, usage_limit, total_usaged, expiry_date FROM ( SELECT p.ID, p.post_title AS coupon_code, Max(CASE WHEN pm.meta_key = 'date_expires' AND p.`ID` = pm.`post_id` THEN pm.meta_value END) AS expiry_date, Max(CASE WHEN pm.meta_key = 'usage_limit' AND p.`ID` = pm.`post_id` THEN pm.meta_value END) AS usage_limit, Max(CASE WHEN pm.meta_key = 'usage_count' AND p.`ID` = pm.`post_id` THEN pm.meta_value END) AS total_usaged, Max(CASE WHEN pm.meta_key = 'coupon_generated_by' AND p.`ID` = pm.`post_id` THEN pm.meta_value END) AS coupon_generated_by FROM {$wpdb->prefix}posts AS p INNER JOIN {$wpdb->prefix}postmeta AS pm ON p.ID = pm.post_id WHERE p.`post_type` = %s GROUP BY p.ID ) AS final_res WHERE coupon_generated_by IS NOT NULL AND coupon_generated_by = %s AND ( ( usage_limit = total_usaged ) OR ( expiry_date <= %d AND expiry_date != '') )", $post_type, $coupon_generated_by, $timestamp ) ); // db call ok; no cache ok. return $coupons; } } Cartflows_Ca_Setting_Functions::get_instance();