' . sprintf( __( 'WooCommerce Advance Flate Rate Shipping requires %s to be installed and active.', 'woocommerce-shipping-afr' ), 'WooCommerce' ) . '

'; } /** * WooCommerce incompatible version notice * * @access public * @since 1.0.0 * @return mixed raw html * */ public function wc_incompitable_version() { echo '

' . sprintf( __( 'WooCommerce Advance Flate Rate Shipping requires %s version %s to be installed and active.', 'woocommerce-shipping-afr' ), 'WooCommerce',WC_SHIPPING_AFR_MINIMUM_WC_VERSION ) . '

'; } /** * WordPress incompatible version notice * * @access public * @since 1.0.0 * @return mixed raw html */ public function wp_incompitable_version() { echo '

' . sprintf( __( 'WooCommerce Advance Flate Rate Shipping requires %s version %s or greater to be installed and active.', 'woocommerce-shipping-afr' ), 'WordPress',WC_SHIPPING_AFR_MINIMUM_WP_VERSION ) . '

'; } /** * installation * * @access public * @since 1.0.0 * @version 1.0.1 */ public function install() { global $wp_version; if ( version_compare( $wp_version, WC_SHIPPING_AFR_MINIMUM_WP_VERSION, '<' ) ) : add_action( 'admin_notices', array( $this, 'wp_incompitable_version' ) ); elseif ( version_compare( WC_VERSION, WC_SHIPPING_AFR_MINIMUM_WC_VERSION, '<' ) ): add_action( 'admin_notices', array( $this, 'wc_incompitable_version' ) ); endif; return true; } /** * Localisation * * @access public * @since 1.0.0 * */ public function load_textdomain() { load_plugin_textdomain( 'woocommerce-shipping-afr', false, basename( dirname( __FILE__ ) ) . '/languages' ); } /** * Plugin page links. * * @access public * @since 1.0.0 * @param mixed $links plugin links * @return mixed $links plugin links */ public function plugin_links( $links ) { $plugin_links = array( '' . __( 'Settings', 'woocommerce-shipping-afr' ) . '', '' . __( 'Support', 'woocommerce-shipping-afr' ) . '', ); return array_merge( $plugin_links, $links ); } /** * woocommerce_init_shipping_table_rate function. * * @access public * @since 1.0.0 * */ public function includes() { include_once( WC_SHIPPING_AFR_PLUGIN_DIR . '/includes/class-wc-shipping-afr.php' ); } /** * Add AFR shipping method to WC * * @access public * @since 1.0.0 * @param mixed $methods shipping methods * @return mixed $methods shipping methods */ public function add_method( $methods ) { $methods['afr'] = 'WC_Shipping_AFR'; return $methods; } /** * Show the user a notice for plugin updates * * @access public * @since 1.0.0 * @return string raw html/javascript */ public function upgrade_notice() { $show_notice = get_option( 'wc_shipping_afr_show_upgrade_notice' ); if ( 'yes' !== $show_notice ): return; endif; $query_args = array( 'page' => 'wc-settings', 'tab' => 'shipping' ); $zones_admin_url = add_query_arg( $query_args, get_admin_url() . 'admin.php' ); ?>

','' ); ?>