Advanced Rule Based Shipping for WooCommerce', 'PHP', ADVANCED_RULE_BASED_SHIPPING_PHP_MIN ); printf('

%1$s

', wp_kses_post($notice)); } /** * Admin notice for missing woocommerce * * @since 1.0.0 * @return void */ function advanced_rule_based_shipping_woocommerce_missing() { if (file_exists(WP_PLUGIN_DIR . '/woocommerce/woocommerce.php')) { $notice_title = __('Activate WooCommerce', 'advanced-rule-based-shipping'); $notice_url = wp_nonce_url('plugins.php?action=activate&plugin=woocommerce/woocommerce.php&plugin_status=all&paged=1', 'activate-plugin_woocommerce/woocommerce.php'); } else { $notice_title = __('Install WooCommerce', 'advanced-rule-based-shipping'); $notice_url = wp_nonce_url(self_admin_url('update.php?action=install-plugin&plugin=woocommerce'), 'install-plugin_woocommerce'); } $notice = sprintf( /* translators: 1 for plugin name, 2 for WooCommerce, 3 WooCommerce link */ esc_html__('%1$s need %2$s to be installed and activated to function properly. %3$s', 'advanced-rule-based-shipping'), 'Advanced Rule Based Shipping for WooCommerce', 'WooCommerce', '' . $notice_title . '' ); printf('

%1$s

', wp_kses_post($notice)); } /** * Load our plugin main file of pass our plugin requirement * * @since 1.0.0 * @return void */ function advanced_rule_based_shipping_load_plugin() { if (version_compare(PHP_VERSION, ADVANCED_RULE_BASED_SHIPPING_PHP_MIN, '<')) { return add_action('admin_notices', 'advanced_rule_based_shipping_php_missing_notice'); } //Check WooCommerce activate if (!class_exists('WooCommerce', false)) { return add_action('admin_notices', 'advanced_rule_based_shipping_woocommerce_missing'); } require_once ADVANCED_RULE_BASED_SHIPPING_PATH . 'inc/class-main.php'; } add_action('plugins_loaded', 'advanced_rule_based_shipping_load_plugin');