Commit Graph

13828 Commits

Author SHA1 Message Date
Mike Jolley b474dcb879 Use WC_Cache_Helper for session class prefixes 2015-11-13 23:12:44 +00:00
Mike Jolley 851fc2a442 Use get_cache_prefix in orders class 2015-11-13 23:11:05 +00:00
Mike Jolley e6859dc0f4 Change get_coupon_id_from_code to use wp_cache instead of transient
Persistent caching is more relevant here. Smaller stores won’t see much
gain from using the transient.

This commit also removes the woocommerce_coupon_code_query filter due
to limitations of it being within a prepare() call. Checked github and
no plugins appear to use this filter so should have minimal impact.
woocommerce_get_coupon_id_from_code filter added in place.
2015-11-13 23:09:35 +00:00
Mike Jolley 78ec168429 Use transient name directly 2015-11-13 23:06:51 +00:00
Mike Jolley 9ba5b7ee26 Add helpers to get and increment cache prefixes
Allows wp_cache to be invalidated with 1 call
2015-11-13 23:06:38 +00:00
Mike Jolley bc6fedd000 Space missing 2015-11-13 21:20:30 +00:00
Mike Jolley 3082c5bba6 wc_related_ and get_related method tweaks
Remove use of multiple expiring transients. See function docblock for
explanation.
2015-11-13 21:14:42 +00:00
Mike Jolley 18e98d8b20 Store shipping rates in session
Rather than use a session which is independent of customer sessions,
store the rates in the session itself to avoid multiple transients.
2015-11-13 20:53:44 +00:00
Mike Jolley 3ceed757bd Store rating and reviews in postmeta rather than transients
These don’t change often, and as long as we listen for comment count
update events will be kept in sync.
2015-11-13 20:41:20 +00:00
Mike Jolley 70d9f58811 Version not needed for wc_var_prices
This transient doesn’t need to expire often because the hashes will be
unique if taxes change.

This change means a variable product will only use 1 transient rather
than many.
2015-11-13 20:01:42 +00:00
Claudio Sanches 770f6793fc Check if WC_Logger exists before try to use in WC_Geo_IP class 2015-11-09 22:08:22 -02:00
Claudio Sanches 98abbf0184 Fixed fseek check in WC_Geo_IP class 2015-11-09 22:03:22 -02:00
Mike Jolley ced46ad92b Merge pull request #9545 from DavidAnderson684/patch-1
Prevent PHP notice
2015-11-09 13:27:34 +00:00
David Anderson b022769c2a Prevent PHP notice
Prevents this PHP notice (on my localhost/testing setup):

PHP Notice:  Undefined offset: -16776960 in wp
-content/plugins/woocommerce/includes/class-wc-geo-ip.php on line 1608

Note that the geoip_country_code_by_addr() method, a few lines further down, already makes a similar check to this one which is being added for IPv6.
2015-11-09 12:17:55 +00:00
Mike Jolley cf972273c4 Version 2015-11-09 11:44:43 +00:00
Mike Jolley ed9b44ae2f Changelog update 2015-11-09 11:43:55 +00:00
Claudio Sanches 1f24a22de6 Escape price.php template 2015-11-09 00:57:36 -02:00
Claudio Sanches 89de396709 [2.4] Allow bulk edit sale_prices as 0 2015-11-06 14:42:51 -02:00
Claudio Sanches 5c54aae2c2 Minify again 2015-11-06 13:54:47 -02:00
Claudio Sanches 7201bacf27 [2.4] Fixed products menu icon for wp 4.4 2015-11-06 13:54:31 -02:00
Claudio Sanches d66427bd8a [2.4] Fixed product type select in wp 4.4 2015-11-06 13:51:17 -02:00
Claudio Sanches 7d251cb449 [2.4] Fixed reports styles for wp 4.4 2015-11-06 13:32:33 -02:00
Claudio Sanches 7bbfd3534e Minify 2015-11-06 13:25:00 -02:00
Claudio Sanches 5e1cc5cdaa [2.4] Fixed button text-shandow and colors to support wp 4.4 2015-11-06 13:24:45 -02:00
Mike Jolley df75d2f617 Merge pull request #9534 from SiR-DanieL/abspath
[2.4] Check if ABSPATH is defined
2015-11-06 10:44:42 +00:00
Nicola Mustone c9da4f928a check if ABSPATH is defined 2015-11-06 10:22:19 +01:00
Claudio Sanches 6f4851c497 Merge pull request #9532 from woothemes/cli-taxes
CLI tax commands, closes #9509
2015-11-06 02:51:59 -02:00
Claudio Sanches 9adb04d612 [CLI] Created command to update tax rate 2015-11-06 02:50:07 -02:00
Claudio Sanches 394342c287 [API] Fixed action and removed transient functions from taxes PUT endpoint 2015-11-06 02:44:02 -02:00
Claudio Sanches 74d1492fe7 [CLI] Created command to get tax rate 2015-11-06 02:31:58 -02:00
Claudio Sanches 1b54117a8b [API] Created commands to delete tax rates and tax classes and fixed the list_class command name 2015-11-06 02:19:47 -02:00
Claudio Sanches 18cf62ed66 [API] Created commands to create tax rates and tax classes 2015-11-06 01:58:08 -02:00
Claudio Sanches 647a2e7498 [API] Created commands to list tax rates and tax classes 2015-11-06 01:37:57 -02:00
Claudio Sanches ef7046ea76 [CLI] Created initial tax command class 2015-11-06 00:23:46 -02:00
Claudio Sanches af89582251 Merge pull request #9526 from shivapoudel/nepal-data
Update Nepali Districts with Zones
2015-11-05 19:42:40 -02:00
Mike Jolley d0b7335e33 Merge pull request #9528 from shivapoudel/typo
Typo fix in tools for uninstall
2015-11-05 19:10:47 +00:00
Shiva Poudel 592c7aee02 Typo fix in tools for uninstall 2015-11-06 00:10:14 +05:45
Shiva Poudel 8300192bf7 Zone and postal code updated 2015-11-05 23:25:30 +05:45
Shiva Poudel a1550fab77 Updated Nepal local settings 2015-11-05 23:06:15 +05:45
Shiva Poudel 7b25629020 Nepal states (Zones) Updated 2015-11-05 22:56:42 +05:45
Mike Jolley 0172e14d70 Merge pull request #9525 from woothemes/scrutinizer-patch-1
Scrutinizer Auto-Fixes
2015-11-05 16:05:45 +00:00
Scrutinizer Auto-Fixer 08efaf84df Scrutinizer Auto-Fixes
This commit consists of patches automatically generated for this project on https://scrutinizer-ci.com
2015-11-05 16:05:03 +00:00
Mike Jolley 4f0cc137cc Enable SQL_BIG_SELECTS in reports
@claudiosmweb
2015-11-05 15:45:19 +00:00
Mike Jolley 4e5baf23aa Cache get_item_meta_array for better performance
Closes #8810 @claudiosmweb
2015-11-05 15:21:28 +00:00
Mike Jolley cb0e61bd4e Set prefix_num first time 2015-11-05 15:21:06 +00:00
Mike Jolley 5e62143767 Update tools text Closes #9512 2015-11-05 14:44:05 +00:00
Mike Jolley af4f775ff0 Minify 2015-11-05 14:37:23 +00:00
Mike Jolley d2aae50a84 Merge pull request #9523 from om4james/duplicatekeyerror
Fix duplicate key errors during db upgrade/install
2015-11-05 12:53:22 +00:00
James Collins 45972cf92b Fix duplicate key errors during db upgrade/install
Running phpunit tests currently outputs the following errors/warnings:

WordPress database error Duplicate key name 'session_id' for query ALTER TABLE wptests_woocommerce_sessions ADD UNIQUE KEY  session_id (session_id) made by PHPUnit_TextUI_Command::main, PHPUnit_TextUI_Command->run, PHPUnit_TextUI_Command->handleArguments, PHPUnit_TextUI_Command->handleBootstrap, PHPUnit_Util_Fileloader::checkAndLoad, PHPUnit_Util_Fileloader::load, include_once('/srv/www/woocommerce/htdocs/wp-content/plugins/woocommerce/tests/bootstrap.php'), WC_Unit_Tests_Bootstrap::instance, WC_Unit_Tests_Bootstrap->__construct, require_once('/srv/www/wordpress-develop/tests/phpunit/includes/bootstrap.php'), require_once('wp-settings.php'), do_action('setup_theme'), call_user_func_array, WC_Unit_Tests_Bootstrap->install_wc, WC_Install::install, WC_Install::create_tables, dbDelta
WordPress database error Multiple primary key defined for query ALTER TABLE wptests_woocommerce_sessions ADD PRIMARY KEY  session_key (session_key) made by PHPUnit_TextUI_Command::main, PHPUnit_TextUI_Command->run, PHPUnit_TextUI_Command->handleArguments, PHPUnit_TextUI_Command->handleBootstrap, PHPUnit_Util_Fileloader::checkAndLoad, PHPUnit_Util_Fileloader::load, include_once('/srv/www/woocommerce/htdocs/wp-content/plugins/woocommerce/tests/bootstrap.php'), WC_Unit_Tests_Bootstrap::instance, WC_Unit_Tests_Bootstrap->__construct, require_once('/srv/www/wordpress-develop/tests/phpunit/includes/bootstrap.php'), require_once('wp-settings.php'), do_action('setup_theme'), call_user_func_array, WC_Unit_Tests_Bootstrap->install_wc, WC_Install::install, WC_Install::create_tables, dbDelta

WordPress database error Duplicate key name 'session_id' for query ALTER TABLE wptests_woocommerce_sessions ADD UNIQUE KEY  session_id (session_id) made by PHPUnit_TextUI_Command::main, PHPUnit_TextUI_Command->run, PHPUnit_TextUI_TestRunner->doRun, PHPUnit_Framework_TestSuite->run, PHPUnit_Framework_TestSuite->run, PHPUnit_Framework_TestCase->run, PHPUnit_Framework_TestResult->run, PHPUnit_Framework_TestCase->runBare, PHPUnit_Framework_TestCase->runTest, ReflectionMethod->invokeArgs, WooCommerce\Tests\Util\WC_Tests_Install->test_check_version, WC_Install::check_version, WC_Install::install, WC_Install::create_tables, dbDelta
WordPress database error Multiple primary key defined for query ALTER TABLE wptests_woocommerce_sessions ADD PRIMARY KEY  session_key (session_key) made by PHPUnit_TextUI_Command::main, PHPUnit_TextUI_Command->run, PHPUnit_TextUI_TestRunner->doRun, PHPUnit_Framework_TestSuite->run, PHPUnit_Framework_TestSuite->run, PHPUnit_Framework_TestCase->run, PHPUnit_Framework_TestResult->run, PHPUnit_Framework_TestCase->runBare, PHPUnit_Framework_TestCase->runTest, ReflectionMethod->invokeArgs, WooCommerce\Tests\Util\WC_Tests_Install->test_check_version, WC_Install::check_version, WC_Install::install, WC_Install::create_tables, dbDelta
.WordPress database error Duplicate key name 'session_id' for query ALTER TABLE wptests_woocommerce_sessions ADD UNIQUE KEY  session_id (session_id) made by PHPUnit_TextUI_Command::main, PHPUnit_TextUI_Command->run, PHPUnit_TextUI_TestRunner->doRun, PHPUnit_Framework_TestSuite->run, PHPUnit_Framework_TestSuite->run, PHPUnit_Framework_TestCase->run, PHPUnit_Framework_TestResult->run, PHPUnit_Framework_TestCase->runBare, PHPUnit_Framework_TestCase->runTest, ReflectionMethod->invokeArgs, WooCommerce\Tests\Util\WC_Tests_Install->test_install, WC_Install::install, WC_Install::create_tables, dbDelta
WordPress database error Multiple primary key defined for query ALTER TABLE wptests_woocommerce_sessions ADD PRIMARY KEY  session_key (session_key) made by PHPUnit_TextUI_Command::main, PHPUnit_TextUI_Command->run, PHPUnit_TextUI_TestRunner->doRun, PHPUnit_Framework_TestSuite->run, PHPUnit_Framework_TestSuite->run, PHPUnit_Framework_TestCase->run, PHPUnit_Framework_TestResult->run, PHPUnit_Framework_TestCase->runBare, PHPUnit_Framework_TestCase->runTest, ReflectionMethod->invokeArgs, WooCommerce\Tests\Util\WC_Tests_Install->test_install, WC_Install::install, WC_Install::create_tables, dbDelta

dbDelta requires very specific syntax (as per http://codex.wordpress.org/Creating_Tables_with_Plugins).
2015-11-05 13:43:56 +08:00
Claudio Sanches 66026ed36c Change old settings icon to Dashicons, closes #9517 2015-11-05 02:05:28 -02:00