Skip to content

Commit

Permalink
2.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
WooThemes authored and remcotolsma committed Apr 20, 2017
1 parent d855ed6 commit f857eaf
Show file tree
Hide file tree
Showing 12 changed files with 875 additions and 2,549 deletions.
24 changes: 24 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# This file is for unifying the coding style for different editors and IDEs
# editorconfig.org

# WordPress Coding Standards
# https://make.wordpress.org/core/handbook/coding-standards/

root = true

[*]
charset = utf-8
end_of_line = lf
indent_size = 4
tab_width = 4
indent_style = tab
insert_final_newline = true
trim_trailing_whitespace = true

[*.txt]
trim_trailing_whitespace = false

[*.{md,json,yml}]
trim_trailing_whitespace = false
indent_style = space
indent_size = 2
10 changes: 0 additions & 10 deletions assets/css/eu-vat.css

This file was deleted.

84 changes: 46 additions & 38 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,63 +1,71 @@
*** EU VAT Number Changelog ***

2017.01.25 - version 2.1.14
2017-04-13 - version 2.2.0
* Renamed main file.
* PHP 7.1 compatibility.
* Stopped saving legacy VAT Number meta key - use _vat_number.
* Tweaked display of numbers in backend.
* Fix - error message shown when validation fails.
* Fix - Translation wrong gettext function used.

2017-01-25 - version 2.1.14
* Fix - Increase validation request timeout from 5 to 30 seconds.

2016.10.08 - version 2.1.13
2016-10-08 - version 2.1.13
* Fix - Issue where My Account endpoint doesn't initially work after activation.
* Fix - Issue where my VAT number is cleared when billing country is changed.

2016.06.09 - version 2.1.12
2016-06-09 - version 2.1.12
* Tweak - Support for tabbed My Account page introduced in WooCommerce 2.6
* Tweak - Include VAT Number in order endpoints responses within REST API

2016.04.13 - version 2.1.11
2016-04-13 - version 2.1.11
* Fix issue where VAT number is not saved to user meta after checkout
* Fix issue of missing text domain in plugin header
* Tweak - Added filter to alter translation file location

2016.03.02 - version 2.1.10
2016-03-02 - version 2.1.10
* Fix incorrect IP address to display when IP is validated. This change also
introduces `wc_eu_vat_self_declared_ip_address` hook to filter the IP
address.

2015.09.21 - version 2.1.9
2015-09-21 - version 2.1.9
* Add VAT number field to My Account page
* Add Switzerland to list of VAT countries

2015.08.06 - version 2.1.8
2015-08-06 - version 2.1.8
* run vat_number_is_valid if the cached result was 0 or false.

2015.03.12 - version 2.1.7
2015-03-12 - version 2.1.7
* Add report for non-eu VAT taxes in the same format as the EU VAT report. Useful for accounting.

2015.03.12 - version 2.1.6
2015-03-12 - version 2.1.6
* Fix report ranges.

2015.03.12 - version 2.1.5
2015-03-12 - version 2.1.5
* Fix textdomain

2015.03.08 - version 2.1.4
2015-03-08 - version 2.1.4
* Textdomain and POT update.

2015.01.08 - version 2.1.3
2015-01-08 - version 2.1.3
* Fix localisation support.
* Tweaked what data gets saved when dealing with regular products to avoid showing IP info when not required.

2015.01.08 - version 2.1.2
2015-01-08 - version 2.1.2
* Set excemption regardless of base country (maybe_set_vat_excempt method).

2015.01.01 - version 2.1.1
2015-01-01 - version 2.1.1
* Updated geolocation class for CloudFlare support.
* When dealing with digital goods, validate users who state that they are outside of the EU, if the IP address is inside the EU.
* Fix options when saving other tax settings.

2014.12.30 - version 2.1.0
2014-12-30 - version 2.1.0
* Added new geolocation class with more reliable GeoIP functionality.
* Only collect IP when dealing with digital goods in the cart.
* Force total refresh so checkbox is displayed.

2014.10.28 - version 2.0.0
2014-10-28 - version 2.0.0
* Refactored the plugin.
* Added additonal options for handling of orders with non-validated VAT numbers.
* Added IP validation option for orders with digital goods (in preperation for the EU place of supply laws in January).
Expand All @@ -70,70 +78,70 @@
* Mixed carts - force digital goods to use taxable billing address (must use tax class named 'Digital Goods')
* Added requirement for WC 2.2.9 to support the EU VAT rates.

2014.09.01 - version 1.7.2
2014-09-01 - version 1.7.2
* Handle SERVER_BUSY responses.
* Use transient instead of wp_cache.

2014.09.01 - version 1.7.1
2014-09-01 - version 1.7.1
* Base excemption on configured tax address in tax settings.

2014.06.10 - version 1.7.0
2014-06-10 - version 1.7.0
* Croatia
* Set meta data when validated, so times when the API fails can be tracked.

2014.04.02 - version 1.6.0
2014-04-02 - version 1.6.0
* Use our own woo api

2014.02.23 - version 1.5.9
2014-02-23 - version 1.5.9
* Option to store unvalidated numbers as-is

2014.02.14 - version 1.5.8
2014-02-14 - version 1.5.8
* Only add errors when you press the checkout process button

2014.02.14 - version 1.5.7
2014-02-14 - version 1.5.7
* Fix notices after success

2014.02.13 - version 1.5.6
2014-02-13 - version 1.5.6
* Clear notices before adding new ones

2014.01.17 - version 1.5.5
2014-01-17 - version 1.5.5
* 2.1 Compat

2013.08.07 - version 1.5.4
2013-08-07 - version 1.5.4
* Pass saved strings though __()

2013.03.15 - version 1.5.3
2013-03-15 - version 1.5.3
* Greece uses EL instead of GR

2013.03.15 - version 1.5.1
2013-03-15 - version 1.5.1
* Update on change field

2013.01.11 - version 1.5.0
2013-01-11 - version 1.5.0
* WC 2.0 Compat
* General cleanup

2012.12.04 - version 1.4.1
2012-12-04 - version 1.4.1
* New updater

2012.04.10 - version 1.4
2012-04-10 - version 1.4
* Added option to optionally deduct tax for shop base country if a valid number is added

2012.04.10 - version 1.3
2012-04-10 - version 1.3
* Option to show field when the customer is in the base country
* Handling for if isvat service is down - allow vat number through.

2012.03.11 - version 1.2.2
2012-03-11 - version 1.2.2
* Add inline JS for scripts

2012.03.01 - version 1.2.1
2012-03-01 - version 1.2.1
* Fixed check after removing the number
* Remove full stops from number

2012.01.26 - version 1.2
2012-01-26 - version 1.2
* WC 1.4 Compatibility
* Added Woo Updater

2011.11.15 - version 1.1.1
2011-11-15 - version 1.1.1
* Changed textdomain

1.1
Expand All @@ -142,10 +150,10 @@
* If user is in the same country then don't allow zero rate
* VAT Number added to emails

2011.10.26 - version 1.0.1
2011-10-26 - version 1.0.1
* Added form-row-wide class
* Added heading + option for title
* Moved to shipping column, below order details

2011.09.27 - version 1.0
2011-09-27 - version 1.0
* First Release
129 changes: 10 additions & 119 deletions eu-vat-number.php
Original file line number Diff line number Diff line change
@@ -1,128 +1,19 @@
<?php
/*
Plugin Name: WooCommerce EU VAT Number
Plugin URI: http://www.woothemes.com/products/eu-vat-number/
Description: The EU VAT Number extension lets you collect and validate EU VAT numbers during checkout to identify B2B transactions verses B2C. IP Addresses can also be validated to ensure they match the billing address. EU businesses with a valid VAT number can have their VAT removed prior to payment.
Version: 2.1.14
Author: WooThemes
Author URI: http://woothemes.com/
Text Domain: woocommerce-eu-vat-number
Domain Path: /languages
Requires at least: 4.0
Tested up to: 4.1
Copyright: © 2009-2017 WooThemes.
License: GNU General Public License v3.0
License URI: http://www.gnu.org/licenses/gpl-3.0.html
*/

/**
* Required functions
*/
if ( ! function_exists( 'woothemes_queue_update' ) ) {
require_once( 'woo-includes/woo-functions.php' );
}

/**
* Requires WooCommerce
*/
if ( ! is_woocommerce_active() ) {
return;
}

define( 'WC_EU_VAT_VERSION', '2.1.13' );
define( 'WC_EU_VAT_FILE', __FILE__ );
define( 'WC_EU_VAT_PLUGIN_URL', untrailingslashit( plugins_url( basename( plugin_dir_path( __FILE__ ) ), basename( __FILE__ ) ) ) );

/**
* Init the extension
*/
function __wc_eu_vat_number_init() {
woothemes_queue_update( plugin_basename( __FILE__ ), 'd2720c4b4bb8d6908e530355b7a2d734', '18592' );

if ( ! class_exists( 'WC_EU_VAT_Number' ) ) {
include_once( 'includes/class-wc-eu-vat-number.php' );
include_once( 'includes/class-wc-eu-vat-my-account.php' );
}

if ( ! class_exists( 'WC_EU_VAT_Admin' ) && is_admin() ) {
include_once( 'includes/class-wc-eu-vat-admin.php' );
include_once( 'includes/class-wc-eu-vat-reports.php' );
}

if ( version_compare( get_option( 'woocommerce_eu_vat_version', 0 ), WC_EU_VAT_VERSION, '<' ) ) {
__wc_eu_vat_number_install();
}

if ( ! class_exists( 'WC_Geolocation' ) ) {
include_once( 'includes/class-wc-geolocation.php' );
}
}
add_action( 'plugins_loaded', '__wc_eu_vat_number_init' );

/**
* Installer
*/
function __wc_eu_vat_number_install() {
if ( version_compare( WC_VERSION, '2.3', '<' ) ) {
wp_clear_scheduled_hook( 'woocommerce_geoip_updater' );
wp_schedule_single_event( time(), 'woocommerce_geoip_updater' );
wp_schedule_event( strtotime( 'first tuesday of next month' ), 'monthly', 'woocommerce_geoip_updater' );
}

update_option( 'woocommerce_eu_vat_version', WC_EU_VAT_VERSION );

add_rewrite_endpoint( 'vat-number', EP_ROOT | EP_PAGES );
flush_rewrite_rules();
}
register_activation_hook( __FILE__, '__wc_eu_vat_number_install' );

/**
* Load translation
*/
function __wc_eu_vat_number_localization() {
$locale = apply_filters( 'plugin_locale', get_locale(), 'woocommerce-eu-vat-number' );
$dir = trailingslashit( WP_LANG_DIR );

load_textdomain( 'woocommerce-eu-vat-number', $dir . 'woocommerce-eu-vat-number/woocommerce-eu-vat-number-' . $locale . '.mo' );
load_plugin_textdomain( 'woocommerce-eu-vat-number', false, dirname( plugin_basename( WC_EU_VAT_FILE ) ) . '/languages' );
}
add_action( 'plugins_loaded', '__wc_eu_vat_number_localization', 0 );

/**
* Add custom action links on the plugin screen.
* Backwards compatibility for old main file.
*
* @param mixed $actions Plugin Actions Links
* @return array
* @package woocommerce-eu-vat-number
*/
function __wc_eu_vat_number_plugin_action_links( $actions ) {

$custom_actions = array();

// settings
$custom_actions['settings'] = sprintf( '<a href="%s">%s</a>', admin_url( 'admin.php?page=wc-settings&tab=tax' ), __( 'Settings', 'woocommerce-eu-vat-number' ) );

// add the links to the front of the actions list
return array_merge( $custom_actions, $actions );
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
add_filter( 'plugin_action_links_' . plugin_basename( __FILE__ ), '__wc_eu_vat_number_plugin_action_links' );

/**
* Show row meta on the plugin screen.
*
* @param mixed $links Plugin Row Meta
* @param mixed $file Plugin Base file
* @return array
*/
function __wc_eu_vat_number_plugin_row_meta( $links, $file ) {
if ( $file == 'woocommerce-eu-vat-number/eu-vat-number.php' ) {
$row_meta = array(
'docs' => '<a href="' . esc_url( apply_filters( 'wc_eu_vat_number_docs_url', 'http://docs.woothemes.com/document/eu-vat-number-2/' ) ) . '" title="' . esc_attr( __( 'View Plugin Documentation', 'woocommerce-eu-vat-number' ) ) . '">' . __( 'Docs', 'woocommerce-eu-vat-number' ) . '</a>',
'changelog' => '<a href="' . esc_url( apply_filters( 'wc_eu_vat_number_changelog', 'http://www.woothemes.com/changelogs/extensions/woocommerce-eu-vat-number/changelog.txt' ) ) . '" title="' . esc_attr( __( 'View Plugin Changelog', 'woocommerce-eu-vat-number' ) ) . '">' . __( 'Changelog', 'woocommerce-eu-vat-number' ) . '</a>',
'support' => '<a href="' . esc_url( apply_filters( 'wc_eu_vat_number_support_url', 'http://support.woothemes.com/' ) ) . '" title="' . esc_attr( __( 'Support', 'woocommerce-eu-vat-number' ) ) . '">' . __( 'Support', 'woocommerce-eu-vat-number' ) . '</a>',
);
return array_merge( $links, $row_meta );
$active_plugins = get_option( 'active_plugins', array() );

foreach ( $active_plugins as $key => $active_plugin ) {
if ( strstr( $active_plugin, '/eu-vat-number.php' ) ) {
$active_plugins[ $key ] = str_replace( '/eu-vat-number.php', '/woocommerce-eu-vat-number.php', $active_plugin );
}
return (array) $links;
}
add_filter( 'plugin_row_meta', '__wc_eu_vat_number_plugin_row_meta', 10, 2 );
update_option( 'active_plugins', $active_plugins );
Loading

0 comments on commit f857eaf

Please sign in to comment.