diff --git a/assets/css/about.css b/assets/css/about.css old mode 100755 new mode 100644 diff --git a/assets/css/admin.css b/assets/css/admin.css old mode 100755 new mode 100644 diff --git a/assets/css/checkout.css b/assets/css/checkout.css old mode 100755 new mode 100644 diff --git a/assets/css/dashboard.css b/assets/css/dashboard.css old mode 100755 new mode 100644 diff --git a/assets/css/view-subscription.css b/assets/css/view-subscription.css old mode 100755 new mode 100644 diff --git a/assets/css/wcs-upgrade.css b/assets/css/wcs-upgrade.css old mode 100755 new mode 100644 diff --git a/assets/images/add-edit-subscription-screen.png b/assets/images/add-edit-subscription-screen.png old mode 100755 new mode 100644 diff --git a/assets/images/admin-change-payment-method.jpg b/assets/images/admin-change-payment-method.jpg old mode 100755 new mode 100644 diff --git a/assets/images/ajax-loader.gif b/assets/images/ajax-loader.gif old mode 100755 new mode 100644 diff --git a/assets/images/ajax-loader@2x.gif b/assets/images/ajax-loader@2x.gif old mode 100755 new mode 100644 diff --git a/assets/images/billing-schedules-meta-box.png b/assets/images/billing-schedules-meta-box.png old mode 100755 new mode 100644 diff --git a/assets/images/checkout-recurring-totals.png b/assets/images/checkout-recurring-totals.png old mode 100755 new mode 100644 diff --git a/assets/images/drip-downloadable-content.jpg b/assets/images/drip-downloadable-content.jpg old mode 100755 new mode 100644 diff --git a/assets/images/gift-subscription.png b/assets/images/gift-subscription.png old mode 100755 new mode 100644 diff --git a/assets/images/renewal-retry-settings.png b/assets/images/renewal-retry-settings.png old mode 100755 new mode 100644 diff --git a/assets/images/subscribe-all-the-things.png b/assets/images/subscribe-all-the-things.png old mode 100755 new mode 100644 diff --git a/assets/images/subscription-reports.png b/assets/images/subscription-reports.png old mode 100755 new mode 100644 diff --git a/assets/images/subscription-suspended-email.jpg b/assets/images/subscription-suspended-email.jpg old mode 100755 new mode 100644 diff --git a/assets/images/subscriptions-importer-exporter.png b/assets/images/subscriptions-importer-exporter.png old mode 100755 new mode 100644 diff --git a/assets/images/view-subscription.png b/assets/images/view-subscription.png old mode 100755 new mode 100644 diff --git a/assets/images/woocommerce_subscriptions_logo.png b/assets/images/woocommerce_subscriptions_logo.png old mode 100755 new mode 100644 diff --git a/assets/js/admin/admin-pointers.js b/assets/js/admin/admin-pointers.js old mode 100755 new mode 100644 diff --git a/assets/js/admin/admin.js b/assets/js/admin/admin.js old mode 100755 new mode 100644 diff --git a/assets/js/admin/jquery.flot.axislabels.js b/assets/js/admin/jquery.flot.axislabels.js old mode 100755 new mode 100644 diff --git a/assets/js/admin/jquery.flot.axislabels.min.js b/assets/js/admin/jquery.flot.axislabels.min.js old mode 100755 new mode 100644 diff --git a/assets/js/admin/jquery.flot.orderBars.js b/assets/js/admin/jquery.flot.orderBars.js old mode 100755 new mode 100644 diff --git a/assets/js/admin/jquery.flot.orderBars.min.js b/assets/js/admin/jquery.flot.orderBars.min.js old mode 100755 new mode 100644 diff --git a/assets/js/admin/jstz.js b/assets/js/admin/jstz.js old mode 100755 new mode 100644 diff --git a/assets/js/admin/jstz.min.js b/assets/js/admin/jstz.min.js old mode 100755 new mode 100644 diff --git a/assets/js/admin/meta-boxes-coupon.js b/assets/js/admin/meta-boxes-coupon.js old mode 100755 new mode 100644 diff --git a/assets/js/admin/meta-boxes-subscription.js b/assets/js/admin/meta-boxes-subscription.js old mode 100755 new mode 100644 diff --git a/assets/js/admin/moment.js b/assets/js/admin/moment.js old mode 100755 new mode 100644 diff --git a/assets/js/admin/moment.min.js b/assets/js/admin/moment.min.js old mode 100755 new mode 100644 diff --git a/assets/js/admin/reports.js b/assets/js/admin/reports.js old mode 100755 new mode 100644 diff --git a/assets/js/admin/wcs-meta-boxes-order.js b/assets/js/admin/wcs-meta-boxes-order.js old mode 100755 new mode 100644 diff --git a/assets/js/wcs-upgrade.js b/assets/js/wcs-upgrade.js old mode 100755 new mode 100644 diff --git a/changelog.txt b/changelog.txt old mode 100755 new mode 100644 index 2f45175..f3431d4 --- a/changelog.txt +++ b/changelog.txt @@ -1,5 +1,23 @@ *** WooCommerce Subscriptions Changelog *** +2018.08.10 - version 2.3.4 +* New: Add filter to bypass coupon removal for recurring carts. PR#2832 +* Fix: Check if subscription is payable before populating the cart with a renewal order. PR#2838 +* Fix: Add a margin to the bottom of subscription information email table to better align with other sections of the email. PR#2853 +* Fix: Prevent infinite loops which can occur while trying to repair PayPal Standard subscriptions with `S-****` Profile IDs. PR#2848 +* Fix: [WC3.4.4] Check refunded order totals in a WC version compatible way. Fixes an issue where limited coupons weren't removed after reaching their limit. PR#2850 +* Tweak: Require payment for recurring carts which contain limited coupons which will expire and then require payment. PR#2850 + +2018.07.24 - version 2.3.3 +* Fix: Prevent infinite loops while generating variable product min and max data. PR#2810 +* Fix: Filter renewal order cart shipping packages, removing one time shipping products from shipping calculations. PR#2811 +* Fix: Only generate persistent related order and customer subscription caches via the Transients API to avoid the possibility of retrieving out of date data stored in the option. PR#2823 +* Fix: Update WC_Subscriptions_Order::maybe_autocomplete_order() to allow for it to handle orders before they have an ID (before they are inserted). PR#2784 +* Fix: Adjust for possible differences in billing cycles because of rounding when calculating prorated totals for switch requests. PR#2617 +* Tweak: Improve UX for variation selection when limited variable product is in cart. PR#2683 +* Tweak: Remove code which supported for WC 2.5. PR#2806 +* Tweak: Enforce array return value for `pre_get_users_subscriptions` filter. PR#2814 + 2018.07.10 - version 2.3.2 * Fix: Extend the next payment date after early renewal if there's no end date. PR#2804 * Fix: Prevent throwing type hinting errors when getting related orders from cache. RR#2805 diff --git a/composer.lock b/composer.lock new file mode 100644 index 0000000..51054e4 --- /dev/null +++ b/composer.lock @@ -0,0 +1,1252 @@ +{ + "_readme": [ + "This file locks the dependencies of your project to a known state", + "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", + "This file is @generated automatically" + ], + "content-hash": "021c140a843bd5b969f18f6e06902332", + "packages": [ + { + "name": "composer/installers", + "version": "v1.4.0", + "source": { + "type": "git", + "url": "https://github.com/composer/installers.git", + "reference": "9ce17fb70e9a38dd8acff0636a29f5cf4d575c1b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/installers/zipball/9ce17fb70e9a38dd8acff0636a29f5cf4d575c1b", + "reference": "9ce17fb70e9a38dd8acff0636a29f5cf4d575c1b", + "shasum": "" + }, + "require": { + "composer-plugin-api": "^1.0" + }, + "replace": { + "roundcube/plugin-installer": "*", + "shama/baton": "*" + }, + "require-dev": { + "composer/composer": "1.0.*@dev", + "phpunit/phpunit": "4.1.*" + }, + "type": "composer-plugin", + "extra": { + "class": "Composer\\Installers\\Plugin", + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "psr-4": { + "Composer\\Installers\\": "src/Composer/Installers" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Kyle Robinson Young", + "email": "kyle@dontkry.com", + "homepage": "https://github.com/shama" + } + ], + "description": "A multi-framework Composer library installer", + "homepage": "https://composer.github.io/installers/", + "keywords": [ + "Craft", + "Dolibarr", + "Eliasis", + "Hurad", + "ImageCMS", + "Kanboard", + "Lan Management System", + "MODX Evo", + "Mautic", + "Maya", + "OXID", + "Plentymarkets", + "Porto", + "RadPHP", + "SMF", + "Thelia", + "WolfCMS", + "agl", + "aimeos", + "annotatecms", + "attogram", + "bitrix", + "cakephp", + "chef", + "cockpit", + "codeigniter", + "concrete5", + "croogo", + "dokuwiki", + "drupal", + "eZ Platform", + "elgg", + "expressionengine", + "fuelphp", + "grav", + "installer", + "itop", + "joomla", + "kohana", + "laravel", + "lavalite", + "lithium", + "magento", + "mako", + "mediawiki", + "modulework", + "moodle", + "osclass", + "phpbb", + "piwik", + "ppi", + "puppet", + "reindex", + "roundcube", + "shopware", + "silverstripe", + "sydes", + "symfony", + "typo3", + "wordpress", + "yawik", + "zend", + "zikula" + ], + "time": "2017-08-09T07:53:48+00:00" + } + ], + "packages-dev": [ + { + "name": "doctrine/instantiator", + "version": "1.0.5", + "source": { + "type": "git", + "url": "https://github.com/doctrine/instantiator.git", + "reference": "8e884e78f9f0eb1329e445619e04456e64d8051d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/instantiator/zipball/8e884e78f9f0eb1329e445619e04456e64d8051d", + "reference": "8e884e78f9f0eb1329e445619e04456e64d8051d", + "shasum": "" + }, + "require": { + "php": ">=5.3,<8.0-DEV" + }, + "require-dev": { + "athletic/athletic": "~0.1.8", + "ext-pdo": "*", + "ext-phar": "*", + "phpunit/phpunit": "~4.0", + "squizlabs/php_codesniffer": "~2.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Marco Pivetta", + "email": "ocramius@gmail.com", + "homepage": "http://ocramius.github.com/" + } + ], + "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors", + "homepage": "https://github.com/doctrine/instantiator", + "keywords": [ + "constructor", + "instantiate" + ], + "time": "2015-06-14T21:17:01+00:00" + }, + { + "name": "phpdocumentor/reflection-common", + "version": "1.0", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/ReflectionCommon.git", + "reference": "144c307535e82c8fdcaacbcfc1d6d8eeb896687c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/144c307535e82c8fdcaacbcfc1d6d8eeb896687c", + "reference": "144c307535e82c8fdcaacbcfc1d6d8eeb896687c", + "shasum": "" + }, + "require": { + "php": ">=5.5" + }, + "require-dev": { + "phpunit/phpunit": "^4.6" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "phpDocumentor\\Reflection\\": [ + "src" + ] + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jaap van Otterdijk", + "email": "opensource@ijaap.nl" + } + ], + "description": "Common reflection classes used by phpdocumentor to reflect the code structure", + "homepage": "http://www.phpdoc.org", + "keywords": [ + "FQSEN", + "phpDocumentor", + "phpdoc", + "reflection", + "static analysis" + ], + "time": "2015-12-27T11:43:31+00:00" + }, + { + "name": "phpdocumentor/reflection-docblock", + "version": "3.2.2", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", + "reference": "4aada1f93c72c35e22fb1383b47fee43b8f1d157" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/4aada1f93c72c35e22fb1383b47fee43b8f1d157", + "reference": "4aada1f93c72c35e22fb1383b47fee43b8f1d157", + "shasum": "" + }, + "require": { + "php": ">=5.5", + "phpdocumentor/reflection-common": "^1.0@dev", + "phpdocumentor/type-resolver": "^0.3.0", + "webmozart/assert": "^1.0" + }, + "require-dev": { + "mockery/mockery": "^0.9.4", + "phpunit/phpunit": "^4.4" + }, + "type": "library", + "autoload": { + "psr-4": { + "phpDocumentor\\Reflection\\": [ + "src/" + ] + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Mike van Riel", + "email": "me@mikevanriel.com" + } + ], + "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", + "time": "2017-08-08T06:39:58+00:00" + }, + { + "name": "phpdocumentor/type-resolver", + "version": "0.3.0", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/TypeResolver.git", + "reference": "fb3933512008d8162b3cdf9e18dba9309b7c3773" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/fb3933512008d8162b3cdf9e18dba9309b7c3773", + "reference": "fb3933512008d8162b3cdf9e18dba9309b7c3773", + "shasum": "" + }, + "require": { + "php": "^5.5 || ^7.0", + "phpdocumentor/reflection-common": "^1.0" + }, + "require-dev": { + "mockery/mockery": "^0.9.4", + "phpunit/phpunit": "^5.2||^4.8.24" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "phpDocumentor\\Reflection\\": [ + "src/" + ] + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Mike van Riel", + "email": "me@mikevanriel.com" + } + ], + "time": "2017-06-03T08:32:36+00:00" + }, + { + "name": "phpspec/prophecy", + "version": "v1.7.0", + "source": { + "type": "git", + "url": "https://github.com/phpspec/prophecy.git", + "reference": "93d39f1f7f9326d746203c7c056f300f7f126073" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpspec/prophecy/zipball/93d39f1f7f9326d746203c7c056f300f7f126073", + "reference": "93d39f1f7f9326d746203c7c056f300f7f126073", + "shasum": "" + }, + "require": { + "doctrine/instantiator": "^1.0.2", + "php": "^5.3|^7.0", + "phpdocumentor/reflection-docblock": "^2.0|^3.0.2", + "sebastian/comparator": "^1.1|^2.0", + "sebastian/recursion-context": "^1.0|^2.0|^3.0" + }, + "require-dev": { + "phpspec/phpspec": "^2.5|^3.2", + "phpunit/phpunit": "^4.8 || ^5.6.5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.6.x-dev" + } + }, + "autoload": { + "psr-0": { + "Prophecy\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Konstantin Kudryashov", + "email": "ever.zet@gmail.com", + "homepage": "http://everzet.com" + }, + { + "name": "Marcello Duarte", + "email": "marcello.duarte@gmail.com" + } + ], + "description": "Highly opinionated mocking framework for PHP 5.3+", + "homepage": "https://github.com/phpspec/prophecy", + "keywords": [ + "Double", + "Dummy", + "fake", + "mock", + "spy", + "stub" + ], + "time": "2017-03-02T20:05:34+00:00" + }, + { + "name": "phpunit/php-code-coverage", + "version": "2.2.4", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-code-coverage.git", + "reference": "eabf68b476ac7d0f73793aada060f1c1a9bf8979" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/eabf68b476ac7d0f73793aada060f1c1a9bf8979", + "reference": "eabf68b476ac7d0f73793aada060f1c1a9bf8979", + "shasum": "" + }, + "require": { + "php": ">=5.3.3", + "phpunit/php-file-iterator": "~1.3", + "phpunit/php-text-template": "~1.2", + "phpunit/php-token-stream": "~1.3", + "sebastian/environment": "^1.3.2", + "sebastian/version": "~1.0" + }, + "require-dev": { + "ext-xdebug": ">=2.1.4", + "phpunit/phpunit": "~4" + }, + "suggest": { + "ext-dom": "*", + "ext-xdebug": ">=2.2.1", + "ext-xmlwriter": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.2.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sb@sebastian-bergmann.de", + "role": "lead" + } + ], + "description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.", + "homepage": "https://github.com/sebastianbergmann/php-code-coverage", + "keywords": [ + "coverage", + "testing", + "xunit" + ], + "time": "2015-10-06T15:47:00+00:00" + }, + { + "name": "phpunit/php-file-iterator", + "version": "1.4.2", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-file-iterator.git", + "reference": "3cc8f69b3028d0f96a9078e6295d86e9bf019be5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/3cc8f69b3028d0f96a9078e6295d86e9bf019be5", + "reference": "3cc8f69b3028d0f96a9078e6295d86e9bf019be5", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.4.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sb@sebastian-bergmann.de", + "role": "lead" + } + ], + "description": "FilterIterator implementation that filters files based on a list of suffixes.", + "homepage": "https://github.com/sebastianbergmann/php-file-iterator/", + "keywords": [ + "filesystem", + "iterator" + ], + "time": "2016-10-03T07:40:28+00:00" + }, + { + "name": "phpunit/php-text-template", + "version": "1.2.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-text-template.git", + "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/31f8b717e51d9a2afca6c9f046f5d69fc27c8686", + "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Simple template engine.", + "homepage": "https://github.com/sebastianbergmann/php-text-template/", + "keywords": [ + "template" + ], + "time": "2015-06-21T13:50:34+00:00" + }, + { + "name": "phpunit/php-timer", + "version": "1.0.9", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-timer.git", + "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/3dcf38ca72b158baf0bc245e9184d3fdffa9c46f", + "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f", + "shasum": "" + }, + "require": { + "php": "^5.3.3 || ^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sb@sebastian-bergmann.de", + "role": "lead" + } + ], + "description": "Utility class for timing", + "homepage": "https://github.com/sebastianbergmann/php-timer/", + "keywords": [ + "timer" + ], + "time": "2017-02-26T11:10:40+00:00" + }, + { + "name": "phpunit/php-token-stream", + "version": "1.4.11", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-token-stream.git", + "reference": "e03f8f67534427a787e21a385a67ec3ca6978ea7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/e03f8f67534427a787e21a385a67ec3ca6978ea7", + "reference": "e03f8f67534427a787e21a385a67ec3ca6978ea7", + "shasum": "" + }, + "require": { + "ext-tokenizer": "*", + "php": ">=5.3.3" + }, + "require-dev": { + "phpunit/phpunit": "~4.2" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.4-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Wrapper around PHP's tokenizer extension.", + "homepage": "https://github.com/sebastianbergmann/php-token-stream/", + "keywords": [ + "tokenizer" + ], + "time": "2017-02-27T10:12:30+00:00" + }, + { + "name": "phpunit/phpunit", + "version": "4.8.36", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/phpunit.git", + "reference": "46023de9a91eec7dfb06cc56cb4e260017298517" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/46023de9a91eec7dfb06cc56cb4e260017298517", + "reference": "46023de9a91eec7dfb06cc56cb4e260017298517", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-json": "*", + "ext-pcre": "*", + "ext-reflection": "*", + "ext-spl": "*", + "php": ">=5.3.3", + "phpspec/prophecy": "^1.3.1", + "phpunit/php-code-coverage": "~2.1", + "phpunit/php-file-iterator": "~1.4", + "phpunit/php-text-template": "~1.2", + "phpunit/php-timer": "^1.0.6", + "phpunit/phpunit-mock-objects": "~2.3", + "sebastian/comparator": "~1.2.2", + "sebastian/diff": "~1.2", + "sebastian/environment": "~1.3", + "sebastian/exporter": "~1.2", + "sebastian/global-state": "~1.0", + "sebastian/version": "~1.0", + "symfony/yaml": "~2.1|~3.0" + }, + "suggest": { + "phpunit/php-invoker": "~1.1" + }, + "bin": [ + "phpunit" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.8.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "The PHP Unit Testing framework.", + "homepage": "https://phpunit.de/", + "keywords": [ + "phpunit", + "testing", + "xunit" + ], + "time": "2017-06-21T08:07:12+00:00" + }, + { + "name": "phpunit/phpunit-mock-objects", + "version": "2.3.8", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git", + "reference": "ac8e7a3db35738d56ee9a76e78a4e03d97628983" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/ac8e7a3db35738d56ee9a76e78a4e03d97628983", + "reference": "ac8e7a3db35738d56ee9a76e78a4e03d97628983", + "shasum": "" + }, + "require": { + "doctrine/instantiator": "^1.0.2", + "php": ">=5.3.3", + "phpunit/php-text-template": "~1.2", + "sebastian/exporter": "~1.2" + }, + "require-dev": { + "phpunit/phpunit": "~4.4" + }, + "suggest": { + "ext-soap": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.3.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sb@sebastian-bergmann.de", + "role": "lead" + } + ], + "description": "Mock Object library for PHPUnit", + "homepage": "https://github.com/sebastianbergmann/phpunit-mock-objects/", + "keywords": [ + "mock", + "xunit" + ], + "time": "2015-10-02T06:51:40+00:00" + }, + { + "name": "sebastian/comparator", + "version": "1.2.4", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/comparator.git", + "reference": "2b7424b55f5047b47ac6e5ccb20b2aea4011d9be" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/2b7424b55f5047b47ac6e5ccb20b2aea4011d9be", + "reference": "2b7424b55f5047b47ac6e5ccb20b2aea4011d9be", + "shasum": "" + }, + "require": { + "php": ">=5.3.3", + "sebastian/diff": "~1.2", + "sebastian/exporter": "~1.2 || ~2.0" + }, + "require-dev": { + "phpunit/phpunit": "~4.4" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.2.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Volker Dusch", + "email": "github@wallbash.com" + }, + { + "name": "Bernhard Schussek", + "email": "bschussek@2bepublished.at" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Provides the functionality to compare PHP values for equality", + "homepage": "http://www.github.com/sebastianbergmann/comparator", + "keywords": [ + "comparator", + "compare", + "equality" + ], + "time": "2017-01-29T09:50:25+00:00" + }, + { + "name": "sebastian/diff", + "version": "1.4.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/diff.git", + "reference": "7f066a26a962dbe58ddea9f72a4e82874a3975a4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/7f066a26a962dbe58ddea9f72a4e82874a3975a4", + "reference": "7f066a26a962dbe58ddea9f72a4e82874a3975a4", + "shasum": "" + }, + "require": { + "php": "^5.3.3 || ^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.4-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Kore Nordmann", + "email": "mail@kore-nordmann.de" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Diff implementation", + "homepage": "https://github.com/sebastianbergmann/diff", + "keywords": [ + "diff" + ], + "time": "2017-05-22T07:24:03+00:00" + }, + { + "name": "sebastian/environment", + "version": "1.3.8", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/environment.git", + "reference": "be2c607e43ce4c89ecd60e75c6a85c126e754aea" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/be2c607e43ce4c89ecd60e75c6a85c126e754aea", + "reference": "be2c607e43ce4c89ecd60e75c6a85c126e754aea", + "shasum": "" + }, + "require": { + "php": "^5.3.3 || ^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.8 || ^5.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.3.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Provides functionality to handle HHVM/PHP environments", + "homepage": "http://www.github.com/sebastianbergmann/environment", + "keywords": [ + "Xdebug", + "environment", + "hhvm" + ], + "time": "2016-08-18T05:49:44+00:00" + }, + { + "name": "sebastian/exporter", + "version": "1.2.2", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/exporter.git", + "reference": "42c4c2eec485ee3e159ec9884f95b431287edde4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/42c4c2eec485ee3e159ec9884f95b431287edde4", + "reference": "42c4c2eec485ee3e159ec9884f95b431287edde4", + "shasum": "" + }, + "require": { + "php": ">=5.3.3", + "sebastian/recursion-context": "~1.0" + }, + "require-dev": { + "ext-mbstring": "*", + "phpunit/phpunit": "~4.4" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.3.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Volker Dusch", + "email": "github@wallbash.com" + }, + { + "name": "Bernhard Schussek", + "email": "bschussek@2bepublished.at" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Adam Harvey", + "email": "aharvey@php.net" + } + ], + "description": "Provides the functionality to export PHP variables for visualization", + "homepage": "http://www.github.com/sebastianbergmann/exporter", + "keywords": [ + "export", + "exporter" + ], + "time": "2016-06-17T09:04:28+00:00" + }, + { + "name": "sebastian/global-state", + "version": "1.1.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/global-state.git", + "reference": "bc37d50fea7d017d3d340f230811c9f1d7280af4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/bc37d50fea7d017d3d340f230811c9f1d7280af4", + "reference": "bc37d50fea7d017d3d340f230811c9f1d7280af4", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "phpunit/phpunit": "~4.2" + }, + "suggest": { + "ext-uopz": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Snapshotting of global state", + "homepage": "http://www.github.com/sebastianbergmann/global-state", + "keywords": [ + "global state" + ], + "time": "2015-10-12T03:26:01+00:00" + }, + { + "name": "sebastian/recursion-context", + "version": "1.0.5", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/recursion-context.git", + "reference": "b19cc3298482a335a95f3016d2f8a6950f0fbcd7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/b19cc3298482a335a95f3016d2f8a6950f0fbcd7", + "reference": "b19cc3298482a335a95f3016d2f8a6950f0fbcd7", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "phpunit/phpunit": "~4.4" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Adam Harvey", + "email": "aharvey@php.net" + } + ], + "description": "Provides functionality to recursively process PHP variables", + "homepage": "http://www.github.com/sebastianbergmann/recursion-context", + "time": "2016-10-03T07:41:43+00:00" + }, + { + "name": "sebastian/version", + "version": "1.0.6", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/version.git", + "reference": "58b3a85e7999757d6ad81c787a1fbf5ff6c628c6" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/58b3a85e7999757d6ad81c787a1fbf5ff6c628c6", + "reference": "58b3a85e7999757d6ad81c787a1fbf5ff6c628c6", + "shasum": "" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library that helps with managing the version number of Git-hosted PHP projects", + "homepage": "https://github.com/sebastianbergmann/version", + "time": "2015-06-21T13:59:46+00:00" + }, + { + "name": "symfony/yaml", + "version": "v3.3.6", + "source": { + "type": "git", + "url": "https://github.com/symfony/yaml.git", + "reference": "ddc23324e6cfe066f3dd34a37ff494fa80b617ed" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/yaml/zipball/ddc23324e6cfe066f3dd34a37ff494fa80b617ed", + "reference": "ddc23324e6cfe066f3dd34a37ff494fa80b617ed", + "shasum": "" + }, + "require": { + "php": ">=5.5.9" + }, + "require-dev": { + "symfony/console": "~2.8|~3.0" + }, + "suggest": { + "symfony/console": "For validating YAML files using the lint command" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.3-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Yaml\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Yaml Component", + "homepage": "https://symfony.com", + "time": "2017-07-23T12:43:26+00:00" + }, + { + "name": "webmozart/assert", + "version": "1.2.0", + "source": { + "type": "git", + "url": "https://github.com/webmozart/assert.git", + "reference": "2db61e59ff05fe5126d152bd0655c9ea113e550f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/webmozart/assert/zipball/2db61e59ff05fe5126d152bd0655c9ea113e550f", + "reference": "2db61e59ff05fe5126d152bd0655c9ea113e550f", + "shasum": "" + }, + "require": { + "php": "^5.3.3 || ^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.6", + "sebastian/version": "^1.0.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.3-dev" + } + }, + "autoload": { + "psr-4": { + "Webmozart\\Assert\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Bernhard Schussek", + "email": "bschussek@gmail.com" + } + ], + "description": "Assertions to validate method input/output with nice error messages.", + "keywords": [ + "assert", + "check", + "validate" + ], + "time": "2016-11-23T20:04:58+00:00" + } + ], + "aliases": [], + "minimum-stability": "stable", + "stability-flags": [], + "prefer-stable": false, + "prefer-lowest": false, + "platform": [], + "platform-dev": [] +} diff --git a/includes/abstracts/abstract-wcs-background-updater.php b/includes/abstracts/abstract-wcs-background-updater.php old mode 100755 new mode 100644 diff --git a/includes/abstracts/abstract-wcs-background-upgrader.php b/includes/abstracts/abstract-wcs-background-upgrader.php old mode 100755 new mode 100644 diff --git a/includes/abstracts/abstract-wcs-cache-manager.php b/includes/abstracts/abstract-wcs-cache-manager.php old mode 100755 new mode 100644 diff --git a/includes/abstracts/abstract-wcs-customer-store.php b/includes/abstracts/abstract-wcs-customer-store.php old mode 100755 new mode 100644 diff --git a/includes/abstracts/abstract-wcs-debug-tool-cache-updater.php b/includes/abstracts/abstract-wcs-debug-tool-cache-updater.php old mode 100755 new mode 100644 diff --git a/includes/abstracts/abstract-wcs-debug-tool.php b/includes/abstracts/abstract-wcs-debug-tool.php old mode 100755 new mode 100644 diff --git a/includes/abstracts/abstract-wcs-dynamic-hook-deprecator.php b/includes/abstracts/abstract-wcs-dynamic-hook-deprecator.php old mode 100755 new mode 100644 diff --git a/includes/abstracts/abstract-wcs-hook-deprecator.php b/includes/abstracts/abstract-wcs-hook-deprecator.php old mode 100755 new mode 100644 diff --git a/includes/abstracts/abstract-wcs-related-order-store.php b/includes/abstracts/abstract-wcs-related-order-store.php old mode 100755 new mode 100644 diff --git a/includes/abstracts/abstract-wcs-retry-store.php b/includes/abstracts/abstract-wcs-retry-store.php old mode 100755 new mode 100644 diff --git a/includes/abstracts/abstract-wcs-scheduler.php b/includes/abstracts/abstract-wcs-scheduler.php old mode 100755 new mode 100644 diff --git a/includes/admin/class-wc-subscriptions-admin.php b/includes/admin/class-wc-subscriptions-admin.php old mode 100755 new mode 100644 diff --git a/includes/admin/class-wcs-admin-meta-boxes.php b/includes/admin/class-wcs-admin-meta-boxes.php old mode 100755 new mode 100644 diff --git a/includes/admin/class-wcs-admin-notice.php b/includes/admin/class-wcs-admin-notice.php old mode 100755 new mode 100644 diff --git a/includes/admin/class-wcs-admin-post-types.php b/includes/admin/class-wcs-admin-post-types.php old mode 100755 new mode 100644 diff --git a/includes/admin/class-wcs-admin-reports.php b/includes/admin/class-wcs-admin-reports.php old mode 100755 new mode 100644 diff --git a/includes/admin/class-wcs-admin-system-status.php b/includes/admin/class-wcs-admin-system-status.php old mode 100755 new mode 100644 diff --git a/includes/admin/debug-tools/class-wcs-debug-tool-cache-background-updater.php b/includes/admin/debug-tools/class-wcs-debug-tool-cache-background-updater.php old mode 100755 new mode 100644 diff --git a/includes/admin/debug-tools/class-wcs-debug-tool-cache-eraser.php b/includes/admin/debug-tools/class-wcs-debug-tool-cache-eraser.php old mode 100755 new mode 100644 diff --git a/includes/admin/debug-tools/class-wcs-debug-tool-cache-generator.php b/includes/admin/debug-tools/class-wcs-debug-tool-cache-generator.php old mode 100755 new mode 100644 diff --git a/includes/admin/debug-tools/class-wcs-debug-tool-factory.php b/includes/admin/debug-tools/class-wcs-debug-tool-factory.php old mode 100755 new mode 100644 diff --git a/includes/admin/meta-boxes/class-wcs-meta-box-payment-retries.php b/includes/admin/meta-boxes/class-wcs-meta-box-payment-retries.php old mode 100755 new mode 100644 diff --git a/includes/admin/meta-boxes/class-wcs-meta-box-related-orders.php b/includes/admin/meta-boxes/class-wcs-meta-box-related-orders.php old mode 100755 new mode 100644 diff --git a/includes/admin/meta-boxes/class-wcs-meta-box-subscription-data.php b/includes/admin/meta-boxes/class-wcs-meta-box-subscription-data.php old mode 100755 new mode 100644 diff --git a/includes/admin/meta-boxes/class-wcs-meta-box-subscription-schedule.php b/includes/admin/meta-boxes/class-wcs-meta-box-subscription-schedule.php old mode 100755 new mode 100644 diff --git a/includes/admin/meta-boxes/views/html-related-orders-row.php b/includes/admin/meta-boxes/views/html-related-orders-row.php old mode 100755 new mode 100644 diff --git a/includes/admin/meta-boxes/views/html-related-orders-table.php b/includes/admin/meta-boxes/views/html-related-orders-table.php old mode 100755 new mode 100644 diff --git a/includes/admin/meta-boxes/views/html-retries-table.php b/includes/admin/meta-boxes/views/html-retries-table.php old mode 100755 new mode 100644 diff --git a/includes/admin/meta-boxes/views/html-subscription-schedule.php b/includes/admin/meta-boxes/views/html-subscription-schedule.php old mode 100755 new mode 100644 diff --git a/includes/admin/reports/class-wcs-report-cache-manager.php b/includes/admin/reports/class-wcs-report-cache-manager.php old mode 100755 new mode 100644 diff --git a/includes/admin/reports/class-wcs-report-dashboard.php b/includes/admin/reports/class-wcs-report-dashboard.php old mode 100755 new mode 100644 diff --git a/includes/admin/reports/class-wcs-report-retention-rate.php b/includes/admin/reports/class-wcs-report-retention-rate.php old mode 100755 new mode 100644 diff --git a/includes/admin/reports/class-wcs-report-subscription-by-customer.php b/includes/admin/reports/class-wcs-report-subscription-by-customer.php old mode 100755 new mode 100644 diff --git a/includes/admin/reports/class-wcs-report-subscription-by-product.php b/includes/admin/reports/class-wcs-report-subscription-by-product.php old mode 100755 new mode 100644 diff --git a/includes/admin/reports/class-wcs-report-subscription-events-by-date.php b/includes/admin/reports/class-wcs-report-subscription-events-by-date.php old mode 100755 new mode 100644 diff --git a/includes/admin/reports/class-wcs-report-subscription-payment-retry.php b/includes/admin/reports/class-wcs-report-subscription-payment-retry.php old mode 100755 new mode 100644 diff --git a/includes/admin/reports/class-wcs-report-upcoming-recurring-revenue.php b/includes/admin/reports/class-wcs-report-upcoming-recurring-revenue.php old mode 100755 new mode 100644 diff --git a/includes/admin/views/html-report-by-period.php b/includes/admin/views/html-report-by-period.php old mode 100755 new mode 100644 diff --git a/includes/admin/wcs-admin-functions.php b/includes/admin/wcs-admin-functions.php old mode 100755 new mode 100644 diff --git a/includes/api/class-wc-rest-subscription-notes-controller.php b/includes/api/class-wc-rest-subscription-notes-controller.php old mode 100755 new mode 100644 diff --git a/includes/api/class-wc-rest-subscriptions-controller.php b/includes/api/class-wc-rest-subscriptions-controller.php old mode 100755 new mode 100644 diff --git a/includes/api/legacy/class-wc-api-subscriptions-customers.php b/includes/api/legacy/class-wc-api-subscriptions-customers.php old mode 100755 new mode 100644 diff --git a/includes/api/legacy/class-wc-api-subscriptions.php b/includes/api/legacy/class-wc-api-subscriptions.php old mode 100755 new mode 100644 diff --git a/includes/api/legacy/class-wc-rest-subscription-notes-controller.php b/includes/api/legacy/class-wc-rest-subscription-notes-controller.php old mode 100755 new mode 100644 diff --git a/includes/api/legacy/class-wc-rest-subscriptions-controller.php b/includes/api/legacy/class-wc-rest-subscriptions-controller.php old mode 100755 new mode 100644 diff --git a/includes/class-wc-order-item-pending-switch.php b/includes/class-wc-order-item-pending-switch.php old mode 100755 new mode 100644 diff --git a/includes/class-wc-product-subscription-variation.php b/includes/class-wc-product-subscription-variation.php old mode 100755 new mode 100644 diff --git a/includes/class-wc-product-subscription.php b/includes/class-wc-product-subscription.php old mode 100755 new mode 100644 diff --git a/includes/class-wc-product-variable-subscription.php b/includes/class-wc-product-variable-subscription.php old mode 100755 new mode 100644 diff --git a/includes/class-wc-subscription.php b/includes/class-wc-subscription.php old mode 100755 new mode 100644 index 2be8f59..dcd1fd5 --- a/includes/class-wc-subscription.php +++ b/includes/class-wc-subscription.php @@ -731,7 +731,7 @@ class WC_Subscription extends WC_Order { /** * Get suspension count. * - * @return string + * @return int * @since 2.2.0 */ public function get_suspension_count( $context = 'view' ) { diff --git a/includes/class-wc-subscriptions-addresses.php b/includes/class-wc-subscriptions-addresses.php old mode 100755 new mode 100644 diff --git a/includes/class-wc-subscriptions-cart.php b/includes/class-wc-subscriptions-cart.php old mode 100755 new mode 100644 index 7e98fe6..e7f6313 --- a/includes/class-wc-subscriptions-cart.php +++ b/includes/class-wc-subscriptions-cart.php @@ -846,29 +846,26 @@ class WC_Subscriptions_Cart { * @return bool */ public static function cart_needs_payment( $needs_payment, $cart ) { - if ( false === $needs_payment && self::cart_contains_subscription() && $cart->total == 0 && false === WC_Subscriptions_Switcher::cart_contains_switches() && 'yes' !== get_option( WC_Subscriptions_Admin::$option_prefix . '_turn_off_automatic_payments', 'no' ) ) { - $recurring_total = 0; $is_one_period = true; - $is_synced = false; + $contains_synced = false; + $contains_expiring_limited_coupon = false; - foreach ( WC()->cart->recurring_carts as $cart ) { + foreach ( WC()->cart->recurring_carts as $recurring_cart ) { + $recurring_total += $recurring_cart->total; + $subscription_length = wcs_cart_pluck( $recurring_cart, 'subscription_length' ); + $contains_synced = $contains_synced || (bool) WC_Subscriptions_Synchroniser::cart_contains_synced_subscription( $recurring_cart ); + $contains_expiring_limited_coupon = $contains_expiring_limited_coupon || WC_Subscriptions_Coupon::recurring_cart_contains_expiring_coupon( $recurring_cart ); - $recurring_total += $cart->total; - - $cart_length = wcs_cart_pluck( $cart, 'subscription_length' ); - - if ( 0 == $cart_length || wcs_cart_pluck( $cart, 'subscription_period_interval' ) != $cart_length ) { + if ( 0 == $subscription_length || wcs_cart_pluck( $recurring_cart, 'subscription_period_interval' ) != $subscription_length ) { $is_one_period = false; } - - $is_synced = ( $is_synced || false != WC_Subscriptions_Synchroniser::cart_contains_synced_subscription( $cart ) ) ? true : false; } $has_trial = self::cart_contains_free_trial(); - if ( $recurring_total > 0 && ( false === $is_one_period || true === $has_trial || ( false !== $is_synced && false == WC_Subscriptions_Synchroniser::is_today( WC_Subscriptions_Synchroniser::calculate_first_payment_date( $is_synced['data'], 'timestamp' ) ) ) ) ) { + if ( $contains_expiring_limited_coupon || $recurring_total > 0 && ( ! $is_one_period || $has_trial || $contains_synced ) ) { $needs_payment = true; } } diff --git a/includes/class-wc-subscriptions-change-payment-gateway.php b/includes/class-wc-subscriptions-change-payment-gateway.php old mode 100755 new mode 100644 diff --git a/includes/class-wc-subscriptions-checkout.php b/includes/class-wc-subscriptions-checkout.php old mode 100755 new mode 100644 diff --git a/includes/class-wc-subscriptions-coupon.php b/includes/class-wc-subscriptions-coupon.php old mode 100755 new mode 100644 index 7980c2f..353a6d8 --- a/includes/class-wc-subscriptions-coupon.php +++ b/includes/class-wc-subscriptions-coupon.php @@ -196,8 +196,8 @@ class WC_Subscriptions_Coupon { if ( ! wcs_cart_contains_renewal() && ! WC_Subscriptions_Product::is_subscription( $cart_item['data'] ) ) { return $discount; } - // But if cart contains a renewal, we need to handle both subscription products and manually added non-susbscription products that could be part of a subscription - if ( wcs_cart_contains_renewal() && ! self::is_subsbcription_renewal_line_item( $cart_item['data'], $cart_item ) ) { + // But if cart contains a renewal, we need to handle both subscription products and manually added non-subscription products that could be part of a subscription + if ( wcs_cart_contains_renewal() && ! self::is_subscription_renewal_line_item( $cart_item['data'], $cart_item ) ) { return $discount; } @@ -552,6 +552,19 @@ class WC_Subscriptions_Coupon { foreach ( $applied_coupons as $coupon_code ) { $coupon = new WC_Coupon( $coupon_code ); $coupon_type = wcs_get_coupon_property( $coupon, 'discount_type' ); + + /** + * Filters whether the coupon should be allowed to be removed. + * + * @param bool $bypass_removal Whether to bypass removing the coupon. + * @param WC_Coupon $coupon The coupon object. + * @param string $coupon_type The coupon's discount_type property. + * @param string $calculation_type The current calculation type. + */ + if ( apply_filters( 'wcs_bypass_coupon_removal', false, $coupon, $coupon_type, $calculation_type ) ) { + continue; + } + if ( ! isset( self::$recurring_coupons[ $coupon_type ] ) ) { $cart->remove_coupon( $coupon_code ); continue; @@ -625,15 +638,14 @@ class WC_Subscriptions_Coupon { } /** - * Check if a product is a renewal order line item (rather than a "susbscription") - to pick up non-subsbcription products added a subscription manually + * Check if a product is a renewal order line item (rather than a "subscription") - to pick up non-subscription products added to a subscription manually * * @param int|WC_Product $product_id * @param array $cart_item - * @param WC_Cart $cart The WooCommerce cart object. * @return boolean whether a product is a renewal order line item * @since 2.0.10 */ - private static function is_subsbcription_renewal_line_item( $product_id, $cart_item ) { + private static function is_subscription_renewal_line_item( $product_id, $cart_item ) { $is_subscription_line_item = false; @@ -732,6 +744,43 @@ class WC_Subscriptions_Coupon { return $has_coupon; } + /** + * Determine if a given recurring cart contains a limited use coupon which when applied to a subscription will reach its usage limit within the subscription's length. + * + * @param WC_Cart $recurring_cart The recurring cart object. + * @return bool + */ + public static function recurring_cart_contains_expiring_coupon( $recurring_cart ) { + $limited_recurring_coupons = array(); + + if ( isset( $recurring_cart->applied_coupons ) ) { + $limited_recurring_coupons = array_filter( $recurring_cart->applied_coupons, array( __CLASS__, 'coupon_is_limited' ) ); + } + + // Bail early if there are no limited coupons applied to the recurring cart or if there is no discount provided. + if ( empty( $limited_recurring_coupons ) || ! $recurring_cart->discount_cart ) { + return false; + } + + $has_expiring_coupon = false; + $subscription_length = wcs_cart_pluck( $recurring_cart, 'subscription_length' ); + $subscription_payments = $subscription_length / wcs_cart_pluck( $recurring_cart, 'subscription_period_interval' ); + + // Limited recurring coupons will always expire at some point on subscriptions with no length. + if ( empty( $subscription_length ) ) { + $has_expiring_coupon = true; + } else { + foreach ( $limited_recurring_coupons as $code ) { + if ( WC_Subscriptions_Coupon::get_coupon_limit( $code ) < $subscription_payments ) { + $has_expiring_coupon = true; + break; + } + } + } + + return $has_expiring_coupon; + } + /** * Determine if a given coupon is limited to a certain number of renewals. * @@ -951,7 +1000,7 @@ class WC_Subscriptions_Coupon { */ $refunded = $order->get_total_refunded(); $total = $order->get_total(); - if ( null !== $refunded && $total == $refunded ) { + if ( $refunded && $total == $refunded ) { continue; } @@ -1046,12 +1095,7 @@ class WC_Subscriptions_Coupon { $coupon_type = wcs_get_coupon_property( $coupon, 'discount_type' ); $coupon_amount = wcs_get_coupon_property( $coupon, 'coupon_amount' ); - // Pre 2.5 is_valid_for_product() does not use wc_get_product_coupon_types() - if ( WC_Subscriptions::is_woocommerce_pre( '2.5' ) ) { - $is_valid_for_product = true; - } else { - $is_valid_for_product = $coupon->is_valid_for_product( $cart_item['data'], $cart_item ); - } + $is_valid_for_product = $coupon->is_valid_for_product( $cart_item['data'], $cart_item ); if ( $coupon->apply_before_tax() && $coupon->is_valid() && $is_valid_for_product ) { diff --git a/includes/class-wc-subscriptions-email.php b/includes/class-wc-subscriptions-email.php old mode 100755 new mode 100644 index c00cb09..722b0d3 --- a/includes/class-wc-subscriptions-email.php +++ b/includes/class-wc-subscriptions-email.php @@ -237,31 +237,23 @@ class WC_Subscriptions_Email { } if ( is_a( $order, 'WC_Abstract_Order' ) ) { + $show_download_links_callback = ( isset( $args['show_download_links'] ) && $args['show_download_links'] ) ? '__return_true' : '__return_false'; + $show_purchase_note_callback = ( isset( $args['show_purchase_note'] ) && $args['show_purchase_note'] ) ? '__return_true' : '__return_false'; - if ( WC_Subscriptions::is_woocommerce_pre( '2.5' ) ) { + unset( $args['show_download_links'] ); + unset( $args['show_purchase_note'] ); - $items_table = call_user_func_array( array( $order, 'email_order_items_table' ), $args ); + add_filter( 'woocommerce_order_is_download_permitted', $show_download_links_callback ); + add_filter( 'woocommerce_order_is_paid', $show_purchase_note_callback ); + + if ( function_exists( 'wc_get_email_order_items' ) ) { // WC 3.0+ + $items_table = wc_get_email_order_items( $order, $args ); } else { - - // 2.5 doesn't support both the show_download_links or show_purchase_note parameters but uses $order->is_download_permitted and $order->is_paid instead - $show_download_links_callback = ( isset( $args['show_download_links'] ) && $args['show_download_links'] ) ? '__return_true' : '__return_false'; - $show_purchase_note_callback = ( isset( $args['show_purchase_note'] ) && $args['show_purchase_note'] ) ? '__return_true' : '__return_false'; - - unset( $args['show_download_links'] ); - unset( $args['show_purchase_note'] ); - - add_filter( 'woocommerce_order_is_download_permitted', $show_download_links_callback ); - add_filter( 'woocommerce_order_is_paid', $show_purchase_note_callback ); - - if ( function_exists( 'wc_get_email_order_items' ) ) { // WC 3.0+ - $items_table = wc_get_email_order_items( $order, $args ); - } else { - $items_table = $order->email_order_items_table( $args ); - } - - remove_filter( 'woocommerce_order_is_download_permitted', $show_download_links_callback ); - remove_filter( 'woocommerce_order_is_paid', $show_purchase_note_callback ); + $items_table = $order->email_order_items_table( $args ); } + + remove_filter( 'woocommerce_order_is_download_permitted', $show_download_links_callback ); + remove_filter( 'woocommerce_order_is_paid', $show_purchase_note_callback ); } return $items_table; diff --git a/includes/class-wc-subscriptions-manager.php b/includes/class-wc-subscriptions-manager.php old mode 100755 new mode 100644 diff --git a/includes/class-wc-subscriptions-order.php b/includes/class-wc-subscriptions-order.php old mode 100755 new mode 100644 index a4cd33d..7cbb5b3 --- a/includes/class-wc-subscriptions-order.php +++ b/includes/class-wc-subscriptions-order.php @@ -67,13 +67,12 @@ class WC_Subscriptions_Order { add_filter( 'woocommerce_my_account_my_orders_actions', __CLASS__ . '::maybe_remove_pay_action', 10, 2 ); - add_action( 'woocommerce_order_partially_refunded', __CLASS__ . '::maybe_cancel_subscription_on_partial_refund' ); add_action( 'woocommerce_order_fully_refunded', __CLASS__ . '::maybe_cancel_subscription_on_full_refund' ); add_filter( 'woocommerce_order_needs_shipping_address', __CLASS__ . '::maybe_display_shipping_address', 10, 3 ); // Autocomplete subscription orders when they only contain a synchronised subscription or a resubscribe - add_filter( 'woocommerce_payment_complete_order_status', __CLASS__ . '::maybe_autocomplete_order', 10, 2 ); + add_filter( 'woocommerce_payment_complete_order_status', __CLASS__ . '::maybe_autocomplete_order', 10, 3 ); add_filter( 'woocommerce_order_data_store_cpt_get_orders_query', array( __CLASS__, 'add_subscription_order_query_args' ), 10, 2 ); } @@ -981,27 +980,10 @@ class WC_Subscriptions_Order { * @param $order_id * * @since 2.0 + * @deprecated 2.3.3 */ public static function maybe_cancel_subscription_on_partial_refund( $order_id ) { - - if ( WC_Subscriptions::is_woocommerce_pre( '2.5' ) && wcs_order_contains_subscription( $order_id, array( 'parent', 'renewal' ) ) ) { - - $order = wc_get_order( $order_id ); - $remaining_order_total = wc_format_decimal( $order->get_total() - $order->get_total_refunded() ); - $remaining_order_items = absint( $order->get_item_count() - $order->get_item_count_refunded() ); - $order_has_free_item = false; - - foreach ( $order->get_items() as $item ) { - if ( ! $item['line_total'] ) { - $order_has_free_item = true; - break; - } - } - - if ( ! ( $remaining_order_total > 0 || ( $order_has_free_item && $remaining_order_items > 0 ) ) ) { - self::maybe_cancel_subscription_on_full_refund( $order ); - } - } + wcs_deprecated_function( __METHOD__, '2.3.3' ); } /** @@ -1041,51 +1023,61 @@ class WC_Subscriptions_Order { * Automatically set the order's status to complete if the order total is zero and all the subscriptions * in an order are synced or the order contains a resubscribe. * - * @param string $new_order_status - * @param int $order_id + * @param string $new_order_status + * @param int $order_id + * @param WC_Order $order + * * @return string $new_order_status * * @since 2.1.3 */ - public static function maybe_autocomplete_order( $new_order_status, $order_id ) { + public static function maybe_autocomplete_order( $new_order_status, $order_id, $order = null ) { + // Exit early if the order has no ID, or if the new order status is not 'processing'. + if ( 0 === $order_id || 'processing' !== $new_order_status ) { + return $new_order_status; + } // Guard against infinite loops in WC 3.0+ where woocommerce_payment_complete_order_status is called while instantiating WC_Order objects - remove_filter( 'woocommerce_payment_complete_order_status', __METHOD__, 10 ); - $order = wc_get_order( $order_id ); - add_filter( 'woocommerce_payment_complete_order_status', __METHOD__, 10, 2 ); + if ( null === $order ) { + remove_filter( 'woocommerce_payment_complete_order_status', __METHOD__, 10 ); + $order = wc_get_order( $order_id ); + add_filter( 'woocommerce_payment_complete_order_status', __METHOD__, 10, 3 ); + } - if ( 'processing' == $new_order_status && $order->get_subtotal() == 0 && wcs_order_contains_subscription( $order ) ) { + // Exit early if the order subtotal is not zero, or if the order does not contain a subscription. + if ( 0 != $order->get_subtotal() || ! wcs_order_contains_subscription( $order ) ) { + return $new_order_status; + } - if ( wcs_order_contains_resubscribe( $order ) ) { + if ( wcs_order_contains_resubscribe( $order ) ) { + $new_order_status = 'completed'; + } elseif ( wcs_order_contains_switch( $order ) ) { + $all_switched = true; + + foreach ( $order->get_items() as $item ) { + if ( ! isset( $item['switched_subscription_price_prorated'] ) ) { + $all_switched = false; + break; + } + } + + if ( $all_switched || 1 == count( $order->get_items() ) ) { $new_order_status = 'completed'; - } elseif ( wcs_order_contains_switch( $order ) ) { - $all_switched = true; + } + } else { + $subscriptions = wcs_get_subscriptions_for_order( $order_id ); + $all_synced = true; - foreach ( $order->get_items() as $item ) { - if ( ! isset( $item['switched_subscription_price_prorated'] ) ) { - $all_switched = false; - break; - } + foreach ( $subscriptions as $subscription_id => $subscription ) { + + if ( ! WC_Subscriptions_Synchroniser::subscription_contains_synced_product( $subscription_id ) ) { + $all_synced = false; + break; } + } - if ( $all_switched || 1 == count( $order->get_items() ) ) { - $new_order_status = 'completed'; - } - } else { - $subscriptions = wcs_get_subscriptions_for_order( $order_id ); - $all_synced = true; - - foreach ( $subscriptions as $subscription_id => $subscription ) { - - if ( ! WC_Subscriptions_Synchroniser::subscription_contains_synced_product( $subscription_id ) ) { - $all_synced = false; - break; - } - } - - if ( $all_synced ) { - $new_order_status = 'completed'; - } + if ( $all_synced ) { + $new_order_status = 'completed'; } } diff --git a/includes/class-wc-subscriptions-product.php b/includes/class-wc-subscriptions-product.php old mode 100755 new mode 100644 index 284808e..ea6905b --- a/includes/class-wc-subscriptions-product.php +++ b/includes/class-wc-subscriptions-product.php @@ -887,11 +887,6 @@ class WC_Subscriptions_Product { if ( ! isset( $data['value'] ) ) { return; - } elseif ( WC_Subscriptions::is_woocommerce_pre( '2.5' ) ) { - // Pre 2.5 we don't have the product type information available so we have to check if it is a subscription - downside here is this only works if the product has already been saved - if ( ! self::is_subscription( $variable_product_id ) ) { - return; - } } else { // Since 2.5 we have the product type information available so we don't have to wait for the product to be saved to check if it is a subscription if ( empty( $_POST['security'] ) || ! wp_verify_nonce( $_POST['security'], 'bulk-edit-variations' ) || 'variable-subscription' !== $_POST['product_type'] ) { diff --git a/includes/class-wc-subscriptions-renewal-order.php b/includes/class-wc-subscriptions-renewal-order.php old mode 100755 new mode 100644 diff --git a/includes/class-wc-subscriptions-switcher.php b/includes/class-wc-subscriptions-switcher.php old mode 100755 new mode 100644 index c9a2aa3..436d1fc --- a/includes/class-wc-subscriptions-switcher.php +++ b/includes/class-wc-subscriptions-switcher.php @@ -1372,16 +1372,12 @@ class WC_Subscriptions_Switcher { // Find the $price per day for the old subscription's recurring total $old_price_per_day = $days_in_old_cycle > 0 ? $old_recurring_total / $days_in_old_cycle : $old_recurring_total; - // Find the price per day for the new subscription's recurring total - // If the subscription uses the same billing interval & cycle as the old subscription, - if ( WC_Subscriptions_Product::get_period( $item_data ) == $subscription->get_billing_period() && WC_Subscriptions_Product::get_interval( $item_data ) == $subscription->get_billing_interval() ) { + // Find the price per day for the new subscription's recurring total based on billing schedule + $days_in_new_cycle = wcs_get_days_in_cycle( WC_Subscriptions_Product::get_period( $item_data ), WC_Subscriptions_Product::get_interval( $item_data ) ); - $days_in_new_cycle = $days_in_old_cycle; // Use $days_in_old_cycle to make sure they're consistent - - } else { - - // We need to figure out the price per day for the new subscription based on its billing schedule - $days_in_new_cycle = wcs_get_days_in_cycle( WC_Subscriptions_Product::get_period( $item_data ), WC_Subscriptions_Product::get_interval( $item_data ) ); + // Set days in new cycle to days in old if it only differs because of rounding + if ( ceil( $days_in_new_cycle ) == $days_in_old_cycle || floor( $days_in_new_cycle ) == $days_in_old_cycle ) { + $days_in_new_cycle = $days_in_old_cycle; } // We need to use the cart items price to ensure we include extras added by extensions like Product Add-ons, but we don't want the sign-up fee accounted for in the price, so make sure WC_Subscriptions_Cart::set_subscription_prices_for_calculation() isn't adding that. @@ -1410,12 +1406,7 @@ class WC_Subscriptions_Switcher { // Find out how many days at the new price per day the customer would receive for the total amount already paid // (e.g. if the customer paid $10 / month previously, and was switching to a $5 / week subscription, she has pre-paid 14 days at the new price) - $pre_paid_days = $new_total_paid = 0; - - while ( $new_total_paid < $old_recurring_total ) { - $pre_paid_days++; - $new_total_paid = $pre_paid_days * $new_price_per_day; - } + $pre_paid_days = self::calculate_pre_paid_days( $old_recurring_total, $new_price_per_day ); // If the total amount the customer has paid entitles her to more days at the new price than she has received, there is no gap payment, just shorten the pre-paid term the appropriate number of days if ( $days_since_last_payment < $pre_paid_days ) { @@ -1461,15 +1452,12 @@ class WC_Subscriptions_Switcher { } elseif ( $old_price_per_day > $new_price_per_day && $new_price_per_day > 0 ) { $old_total_paid = $old_price_per_day * $days_until_next_payment; - $new_total_paid = $new_price_per_day; // if downgrades are apportioned, extend the next payment date for n more days if ( in_array( $apportion_recurring_price, array( 'virtual', 'yes' ) ) ) { // Find how many more days at the new lower price it takes to exceed the amount already paid - for ( $days_to_add = 0; $new_total_paid <= $old_total_paid; $days_to_add++ ) { - $new_total_paid = $days_to_add * $new_price_per_day; - } + $days_to_add = self::calculate_pre_paid_days( $old_total_paid, $new_price_per_day ); $days_to_add -= $days_until_next_payment; } else { @@ -1501,6 +1489,21 @@ class WC_Subscriptions_Switcher { } } + /** + * Calculate the number of days that have already been paid + * + * @param int $old_total_paid The amount paid previously, such as the old recurring total + * @param int $new_price_per_day The amount per day price for the new subscription + * @return int $pre_paid_days The number of days paid for already + */ + private static function calculate_pre_paid_days( $old_total_paid, $new_price_per_day ) { + $pre_paid_days = 0; + if ( 0 != $new_price_per_day ) { + $pre_paid_days = ceil( $old_total_paid / $new_price_per_day ); + } + return $pre_paid_days; + } + /** * Make sure when displaying the first payment date for a switched subscription, the date takes into * account the switch (i.e. prepaid days and possibly a downgrade). diff --git a/includes/class-wc-subscriptions-synchroniser.php b/includes/class-wc-subscriptions-synchroniser.php old mode 100755 new mode 100644 diff --git a/includes/class-wcs-action-scheduler.php b/includes/class-wcs-action-scheduler.php old mode 100755 new mode 100644 diff --git a/includes/class-wcs-api.php b/includes/class-wcs-api.php old mode 100755 new mode 100644 diff --git a/includes/class-wcs-auth.php b/includes/class-wcs-auth.php old mode 100755 new mode 100644 diff --git a/includes/class-wcs-cached-data-manager.php b/includes/class-wcs-cached-data-manager.php old mode 100755 new mode 100644 diff --git a/includes/class-wcs-cart-initial-payment.php b/includes/class-wcs-cart-initial-payment.php old mode 100755 new mode 100644 diff --git a/includes/class-wcs-cart-renewal.php b/includes/class-wcs-cart-renewal.php old mode 100755 new mode 100644 index 3d884ee..883ad36 --- a/includes/class-wcs-cart-renewal.php +++ b/includes/class-wcs-cart-renewal.php @@ -51,6 +51,9 @@ class WCS_Cart_Renewal { // Remove non-recurring fees from renewal carts. Hooked in late (priority 1000), to ensure we handle all fees added by third-parties. add_action( 'woocommerce_cart_calculate_fees', array( $this, 'remove_non_recurring_fees' ), 1000 ); + + // Remove subscription products with "one time shipping" from shipping packages. + add_filter( 'woocommerce_cart_shipping_packages', array( $this, 'maybe_update_shipping_packages' ), 0, 1 ); } /** @@ -190,11 +193,16 @@ class WCS_Cart_Renewal { do_action( 'wcs_before_renewal_setup_cart_subscription', $subscription, $order ); - // Add the existing subscription items to the cart - $this->setup_cart( $order, array( - 'subscription_id' => $subscription->get_id(), - 'renewal_order_id' => $order_id, - ) ); + // Check if order/subscription can be paid for + if ( empty( $subscription ) || ! $subscription->has_status( array( 'on-hold', 'pending' ) ) ) { + wc_add_notice( __( 'This order can no longer be paid because the corresponding subscription does not require payment at this time.', 'woocommerce-subscriptions' ), 'error' ); + } else { + // Add the existing subscription items to the cart + $this->setup_cart( $order, array( + 'subscription_id' => $subscription->get_id(), + 'renewal_order_id' => $order_id, + ) ); + } do_action( 'wcs_after_renewal_setup_cart_subscription', $subscription, $order ); } @@ -386,9 +394,7 @@ class WCS_Cart_Renewal { if ( ! empty( $coupon_code ) ) { // Set renewal order products as the product ids on the coupon - if ( ! WC_Subscriptions::is_woocommerce_pre( '2.5' ) ) { - wcs_set_coupon_property( $coupon, 'product_ids', $this->get_products( $order ) ); - } + wcs_set_coupon_property( $coupon, 'product_ids', $this->get_products( $order ) ); // Store the coupon info for later $this->store_coupon( wcs_get_objects_property( $order, 'id' ), $coupon ); @@ -409,9 +415,7 @@ class WCS_Cart_Renewal { wcs_set_coupon_property( $coupon, 'coupon_amount', $order_discount ); // Set renewal order products as the product ids on the coupon - if ( ! WC_Subscriptions::is_woocommerce_pre( '2.5' ) ) { - wcs_set_coupon_property( $coupon, 'product_ids', $this->get_products( $order ) ); - } + wcs_set_coupon_property( $coupon, 'product_ids', $this->get_products( $order ) ); // Store the coupon info for later $this->store_coupon( wcs_get_objects_property( $order, 'id' ), $coupon ); @@ -1304,6 +1308,33 @@ class WCS_Cart_Renewal { } } + /** + * Filters the shipping packages to remove subscriptions that have "one time shipping" enabled and, as such, + * shouldn't have a shipping amount associated during a renewal. + * + * @since 2.3.3 + */ + public function maybe_update_shipping_packages( $packages ) { + if ( ! $this->cart_contains() ) { + return $packages; + } + + foreach ( $packages as $index => $package ) { + foreach ( $package['contents'] as $cart_item_key => $cart_item ) { + if ( WC_Subscriptions_Product::needs_one_time_shipping( $cart_item['data'] ) ) { + $packages[ $index ]['contents_cost'] -= $cart_item['line_total']; + unset( $packages[ $index ]['contents'][ $cart_item_key ] ); + } + } + + if ( empty( $packages[ $index ]['contents'] ) ) { + unset( $packages[ $index ] ); + } + } + + return $packages; + } + /* Deprecated */ /** diff --git a/includes/class-wcs-cart-resubscribe.php b/includes/class-wcs-cart-resubscribe.php old mode 100755 new mode 100644 diff --git a/includes/class-wcs-cart-switch.php b/includes/class-wcs-cart-switch.php old mode 100755 new mode 100644 diff --git a/includes/class-wcs-change-payment-method-admin.php b/includes/class-wcs-change-payment-method-admin.php old mode 100755 new mode 100644 diff --git a/includes/class-wcs-download-handler.php b/includes/class-wcs-download-handler.php old mode 100755 new mode 100644 diff --git a/includes/class-wcs-failed-scheduled-action-manager.php b/includes/class-wcs-failed-scheduled-action-manager.php old mode 100755 new mode 100644 diff --git a/includes/class-wcs-limiter.php b/includes/class-wcs-limiter.php old mode 100755 new mode 100644 index 13255b5..1808b97 --- a/includes/class-wcs-limiter.php +++ b/includes/class-wcs-limiter.php @@ -76,12 +76,19 @@ class WCS_Limiter { break; case 'subscription_variation' : $variable_product = wc_get_product( $product->get_parent_id() ); + if ( 'no' != wcs_get_product_limitation( $variable_product ) && ! empty( WC()->cart->cart_contents ) && ! wcs_is_order_received_page() && ! wcs_is_paypal_api_page() ) { - foreach ( WC()->cart->cart_contents as $cart_item ) { - // If the variable product is limited, it can't be purchased if its the same variation - if ( $product->get_parent_id() == wcs_get_objects_property( $cart_item['data'], 'parent_id' ) && $product->get_id() != $cart_item['data']->get_id() ) { - $purchasable = false; - break; + + // When mixed checkout is disabled, the variation is replaceable + if ( 'no' === get_option( WC_Subscriptions_Admin::$option_prefix . '_multiple_purchase', 'no' ) ) { + $purchasable = true; + } else { // When mixed checkout is enabled + foreach ( WC()->cart->cart_contents as $cart_item ) { + // If the variable product is limited, it can't be purchased if it is the same variation + if ( $product->get_parent_id() == wcs_get_objects_property( $cart_item['data'], 'parent_id' ) && $product->get_id() != $cart_item['data']->get_id() ) { + $purchasable = false; + break; + } } } } diff --git a/includes/class-wcs-my-account-payment-methods.php b/includes/class-wcs-my-account-payment-methods.php old mode 100755 new mode 100644 diff --git a/includes/class-wcs-post-meta-cache-manager-many-to-one.php b/includes/class-wcs-post-meta-cache-manager-many-to-one.php old mode 100755 new mode 100644 diff --git a/includes/class-wcs-post-meta-cache-manager.php b/includes/class-wcs-post-meta-cache-manager.php old mode 100755 new mode 100644 diff --git a/includes/class-wcs-query.php b/includes/class-wcs-query.php old mode 100755 new mode 100644 diff --git a/includes/class-wcs-remove-item.php b/includes/class-wcs-remove-item.php old mode 100755 new mode 100644 diff --git a/includes/class-wcs-retry-manager.php b/includes/class-wcs-retry-manager.php old mode 100755 new mode 100644 diff --git a/includes/class-wcs-select2.php b/includes/class-wcs-select2.php old mode 100755 new mode 100644 diff --git a/includes/class-wcs-staging.php b/includes/class-wcs-staging.php old mode 100755 new mode 100644 diff --git a/includes/class-wcs-template-loader.php b/includes/class-wcs-template-loader.php old mode 100755 new mode 100644 diff --git a/includes/class-wcs-user-change-status-handler.php b/includes/class-wcs-user-change-status-handler.php old mode 100755 new mode 100644 diff --git a/includes/class-wcs-webhooks.php b/includes/class-wcs-webhooks.php old mode 100755 new mode 100644 diff --git a/includes/data-stores/class-wcs-customer-store-cached-cpt.php b/includes/data-stores/class-wcs-customer-store-cached-cpt.php old mode 100755 new mode 100644 index c5ae060..af67207 --- a/includes/data-stores/class-wcs-customer-store-cached-cpt.php +++ b/includes/data-stores/class-wcs-customer-store-cached-cpt.php @@ -76,7 +76,7 @@ class WCS_Customer_Store_Cached_CPT extends WCS_Customer_Store_CPT implements WC $transient_key = "wcs_user_subscriptions_{$user_id}"; // We do this here rather than in get_users_subscription_ids_from_cache(), because we want to make sure the new persistent cache is updated too - $subscription_ids = wcs_get_transient_even_if_expired( $transient_key ); + $subscription_ids = get_transient( $transient_key ); if ( false === $subscription_ids ) { $subscription_ids = parent::get_users_subscription_ids( $user_id ); // no data in transient, query directly diff --git a/includes/data-stores/class-wcs-customer-store-cpt.php b/includes/data-stores/class-wcs-customer-store-cpt.php old mode 100755 new mode 100644 diff --git a/includes/data-stores/class-wcs-product-variable-data-store-cpt.php b/includes/data-stores/class-wcs-product-variable-data-store-cpt.php old mode 100755 new mode 100644 index 9b1de73..620a68c --- a/includes/data-stores/class-wcs-product-variable-data-store-cpt.php +++ b/includes/data-stores/class-wcs-product-variable-data-store-cpt.php @@ -11,6 +11,14 @@ if ( ! defined( 'ABSPATH' ) ) { */ class WCS_Product_Variable_Data_Store_CPT extends WC_Product_Variable_Data_Store_CPT { + /** + * A cache of products having their min and max variation data read. + * Used as a circuit breaker to prevent multiple object reads causing infinite loops. + * + * @var array + */ + protected static $reading_min_max_variation_data = array(); + /** * Method to read a product from the database. * @@ -28,11 +36,14 @@ class WCS_Product_Variable_Data_Store_CPT extends WC_Product_Variable_Data_Store * @param WC_Product_Variable_Subscription $product Product object. */ protected function read_min_max_variation_data( &$product ) { - if ( ! $product->meta_exists( '_min_max_variation_ids_hash' ) ) { + if ( ! isset( self::$reading_min_max_variation_data[ $product->get_id() ] ) && ! $product->meta_exists( '_min_max_variation_ids_hash' ) ) { + self::$reading_min_max_variation_data[ $product->get_id() ] = ''; + $product->set_min_and_max_variation_data(); update_post_meta( $product->get_id(), '_min_max_variation_data', $product->get_meta( '_min_max_variation_data', true ), true ); update_post_meta( $product->get_id(), '_min_max_variation_ids_hash', $product->get_meta( '_min_max_variation_ids_hash', true ), true ); + unset( self::$reading_min_max_variation_data[ $product->get_id() ] ); } } } diff --git a/includes/data-stores/class-wcs-related-order-store-cached-cpt.php b/includes/data-stores/class-wcs-related-order-store-cached-cpt.php old mode 100755 new mode 100644 index 355ed15..49b9b2a --- a/includes/data-stores/class-wcs-related-order-store-cached-cpt.php +++ b/includes/data-stores/class-wcs-related-order-store-cached-cpt.php @@ -95,7 +95,7 @@ class WCS_Related_Order_Store_Cached_CPT extends WCS_Related_Order_Store_CPT imp $transient_key = "wcs-related-orders-to-{$subscription_id}"; // despite the name, this transient only stores renewal orders, not all related orders, so we can only use it for finding renewal orders // We do this here rather than in get_related_order_ids_from_cache(), because we want to make sure the new persistent cache is updated too - $related_order_ids = wcs_get_transient_even_if_expired( $transient_key ); + $related_order_ids = get_transient( $transient_key ); } else { $related_order_ids = false; } diff --git a/includes/data-stores/class-wcs-related-order-store-cpt.php b/includes/data-stores/class-wcs-related-order-store-cpt.php old mode 100755 new mode 100644 diff --git a/includes/data-stores/class-wcs-subscription-data-store-cpt.php b/includes/data-stores/class-wcs-subscription-data-store-cpt.php old mode 100755 new mode 100644 diff --git a/includes/deprecated/class-wcs-action-deprecator.php b/includes/deprecated/class-wcs-action-deprecator.php old mode 100755 new mode 100644 diff --git a/includes/deprecated/class-wcs-deprecated-filter-hooks.php b/includes/deprecated/class-wcs-deprecated-filter-hooks.php old mode 100755 new mode 100644 diff --git a/includes/deprecated/class-wcs-dynamic-action-deprecator.php b/includes/deprecated/class-wcs-dynamic-action-deprecator.php old mode 100755 new mode 100644 diff --git a/includes/deprecated/class-wcs-dynamic-filter-deprecator.php b/includes/deprecated/class-wcs-dynamic-filter-deprecator.php old mode 100755 new mode 100644 diff --git a/includes/deprecated/class-wcs-filter-deprecator.php b/includes/deprecated/class-wcs-filter-deprecator.php old mode 100755 new mode 100644 diff --git a/includes/early-renewal/class-wcs-cart-early-renewal.php b/includes/early-renewal/class-wcs-cart-early-renewal.php old mode 100755 new mode 100644 diff --git a/includes/early-renewal/class-wcs-early-renewal-manager.php b/includes/early-renewal/class-wcs-early-renewal-manager.php old mode 100755 new mode 100644 diff --git a/includes/early-renewal/wcs-early-renewal-functions.php b/includes/early-renewal/wcs-early-renewal-functions.php old mode 100755 new mode 100644 diff --git a/includes/emails/class-wcs-email-cancelled-subscription.php b/includes/emails/class-wcs-email-cancelled-subscription.php old mode 100755 new mode 100644 diff --git a/includes/emails/class-wcs-email-customer-completed-renewal-order.php b/includes/emails/class-wcs-email-customer-completed-renewal-order.php old mode 100755 new mode 100644 diff --git a/includes/emails/class-wcs-email-customer-completed-switch-order.php b/includes/emails/class-wcs-email-customer-completed-switch-order.php old mode 100755 new mode 100644 diff --git a/includes/emails/class-wcs-email-customer-payment-retry.php b/includes/emails/class-wcs-email-customer-payment-retry.php old mode 100755 new mode 100644 diff --git a/includes/emails/class-wcs-email-customer-processing-renewal-order.php b/includes/emails/class-wcs-email-customer-processing-renewal-order.php old mode 100755 new mode 100644 diff --git a/includes/emails/class-wcs-email-customer-renewal-invoice.php b/includes/emails/class-wcs-email-customer-renewal-invoice.php old mode 100755 new mode 100644 diff --git a/includes/emails/class-wcs-email-expired-subscription.php b/includes/emails/class-wcs-email-expired-subscription.php old mode 100755 new mode 100644 diff --git a/includes/emails/class-wcs-email-new-renewal-order.php b/includes/emails/class-wcs-email-new-renewal-order.php old mode 100755 new mode 100644 diff --git a/includes/emails/class-wcs-email-new-switch-order.php b/includes/emails/class-wcs-email-new-switch-order.php old mode 100755 new mode 100644 diff --git a/includes/emails/class-wcs-email-on-hold-subscription.php b/includes/emails/class-wcs-email-on-hold-subscription.php old mode 100755 new mode 100644 diff --git a/includes/emails/class-wcs-email-payment-retry.php b/includes/emails/class-wcs-email-payment-retry.php old mode 100755 new mode 100644 diff --git a/includes/gateways/class-wc-subscriptions-payment-gateways.php b/includes/gateways/class-wc-subscriptions-payment-gateways.php old mode 100755 new mode 100644 diff --git a/includes/gateways/paypal/class-wcs-paypal.php b/includes/gateways/paypal/class-wcs-paypal.php old mode 100755 new mode 100644 diff --git a/includes/gateways/paypal/includes/abstracts/abstract-wcs-sv-api-base.php b/includes/gateways/paypal/includes/abstracts/abstract-wcs-sv-api-base.php old mode 100755 new mode 100644 diff --git a/includes/gateways/paypal/includes/admin/class-wcs-paypal-admin.php b/includes/gateways/paypal/includes/admin/class-wcs-paypal-admin.php old mode 100755 new mode 100644 diff --git a/includes/gateways/paypal/includes/admin/class-wcs-paypal-change-payment-method-admin.php b/includes/gateways/paypal/includes/admin/class-wcs-paypal-change-payment-method-admin.php old mode 100755 new mode 100644 diff --git a/includes/gateways/paypal/includes/class-wcs-paypal-reference-transaction-api-request.php b/includes/gateways/paypal/includes/class-wcs-paypal-reference-transaction-api-request.php old mode 100755 new mode 100644 diff --git a/includes/gateways/paypal/includes/class-wcs-paypal-reference-transaction-api-response-billing-agreement.php b/includes/gateways/paypal/includes/class-wcs-paypal-reference-transaction-api-response-billing-agreement.php old mode 100755 new mode 100644 diff --git a/includes/gateways/paypal/includes/class-wcs-paypal-reference-transaction-api-response-checkout.php b/includes/gateways/paypal/includes/class-wcs-paypal-reference-transaction-api-response-checkout.php old mode 100755 new mode 100644 diff --git a/includes/gateways/paypal/includes/class-wcs-paypal-reference-transaction-api-response-payment.php b/includes/gateways/paypal/includes/class-wcs-paypal-reference-transaction-api-response-payment.php old mode 100755 new mode 100644 diff --git a/includes/gateways/paypal/includes/class-wcs-paypal-reference-transaction-api-response-recurring-payment.php b/includes/gateways/paypal/includes/class-wcs-paypal-reference-transaction-api-response-recurring-payment.php old mode 100755 new mode 100644 diff --git a/includes/gateways/paypal/includes/class-wcs-paypal-reference-transaction-api-response.php b/includes/gateways/paypal/includes/class-wcs-paypal-reference-transaction-api-response.php old mode 100755 new mode 100644 diff --git a/includes/gateways/paypal/includes/class-wcs-paypal-reference-transaction-api.php b/includes/gateways/paypal/includes/class-wcs-paypal-reference-transaction-api.php old mode 100755 new mode 100644 diff --git a/includes/gateways/paypal/includes/class-wcs-paypal-reference-transaction-ipn-handler.php b/includes/gateways/paypal/includes/class-wcs-paypal-reference-transaction-ipn-handler.php old mode 100755 new mode 100644 diff --git a/includes/gateways/paypal/includes/class-wcs-paypal-standard-change-payment-method.php b/includes/gateways/paypal/includes/class-wcs-paypal-standard-change-payment-method.php old mode 100755 new mode 100644 diff --git a/includes/gateways/paypal/includes/class-wcs-paypal-standard-ipn-failure-handler.php b/includes/gateways/paypal/includes/class-wcs-paypal-standard-ipn-failure-handler.php old mode 100755 new mode 100644 diff --git a/includes/gateways/paypal/includes/class-wcs-paypal-standard-ipn-handler.php b/includes/gateways/paypal/includes/class-wcs-paypal-standard-ipn-handler.php old mode 100755 new mode 100644 diff --git a/includes/gateways/paypal/includes/class-wcs-paypal-standard-request.php b/includes/gateways/paypal/includes/class-wcs-paypal-standard-request.php old mode 100755 new mode 100644 diff --git a/includes/gateways/paypal/includes/class-wcs-paypal-standard-switcher.php b/includes/gateways/paypal/includes/class-wcs-paypal-standard-switcher.php old mode 100755 new mode 100644 diff --git a/includes/gateways/paypal/includes/class-wcs-paypal-status-manager.php b/includes/gateways/paypal/includes/class-wcs-paypal-status-manager.php old mode 100755 new mode 100644 diff --git a/includes/gateways/paypal/includes/class-wcs-paypal-supports.php b/includes/gateways/paypal/includes/class-wcs-paypal-supports.php old mode 100755 new mode 100644 diff --git a/includes/gateways/paypal/includes/deprecated/class-wc-paypal-standard-subscriptions.php b/includes/gateways/paypal/includes/deprecated/class-wc-paypal-standard-subscriptions.php old mode 100755 new mode 100644 diff --git a/includes/gateways/paypal/includes/templates/admin-notices.php b/includes/gateways/paypal/includes/templates/admin-notices.php old mode 100755 new mode 100644 diff --git a/includes/gateways/paypal/includes/wcs-paypal-functions.php b/includes/gateways/paypal/includes/wcs-paypal-functions.php old mode 100755 new mode 100644 diff --git a/includes/interfaces/interface-wcs-cache-updater.php b/includes/interfaces/interface-wcs-cache-updater.php old mode 100755 new mode 100644 diff --git a/includes/legacy/class-wc-product-subscription-legacy.php b/includes/legacy/class-wc-product-subscription-legacy.php old mode 100755 new mode 100644 diff --git a/includes/legacy/class-wc-product-subscription-variation-legacy.php b/includes/legacy/class-wc-product-subscription-variation-legacy.php old mode 100755 new mode 100644 diff --git a/includes/legacy/class-wc-product-variable-subscription-legacy.php b/includes/legacy/class-wc-product-variable-subscription-legacy.php old mode 100755 new mode 100644 diff --git a/includes/legacy/class-wc-subscription-legacy.php b/includes/legacy/class-wc-subscription-legacy.php old mode 100755 new mode 100644 diff --git a/includes/legacy/class-wcs-array-property-post-meta-black-magic.php b/includes/legacy/class-wcs-array-property-post-meta-black-magic.php old mode 100755 new mode 100644 diff --git a/includes/legacy/class-wcs-product-legacy.php b/includes/legacy/class-wcs-product-legacy.php old mode 100755 new mode 100644 diff --git a/includes/libraries/action-scheduler/action-scheduler.php b/includes/libraries/action-scheduler/action-scheduler.php old mode 100755 new mode 100644 diff --git a/includes/libraries/action-scheduler/classes/ActionScheduler.php b/includes/libraries/action-scheduler/classes/ActionScheduler.php old mode 100755 new mode 100644 diff --git a/includes/libraries/action-scheduler/classes/ActionScheduler_Abstract_ListTable.php b/includes/libraries/action-scheduler/classes/ActionScheduler_Abstract_ListTable.php old mode 100755 new mode 100644 diff --git a/includes/libraries/action-scheduler/classes/ActionScheduler_Abstract_QueueRunner.php b/includes/libraries/action-scheduler/classes/ActionScheduler_Abstract_QueueRunner.php old mode 100755 new mode 100644 diff --git a/includes/libraries/action-scheduler/classes/ActionScheduler_Action.php b/includes/libraries/action-scheduler/classes/ActionScheduler_Action.php old mode 100755 new mode 100644 diff --git a/includes/libraries/action-scheduler/classes/ActionScheduler_ActionClaim.php b/includes/libraries/action-scheduler/classes/ActionScheduler_ActionClaim.php old mode 100755 new mode 100644 diff --git a/includes/libraries/action-scheduler/classes/ActionScheduler_ActionFactory.php b/includes/libraries/action-scheduler/classes/ActionScheduler_ActionFactory.php old mode 100755 new mode 100644 diff --git a/includes/libraries/action-scheduler/classes/ActionScheduler_AdminView.php b/includes/libraries/action-scheduler/classes/ActionScheduler_AdminView.php old mode 100755 new mode 100644 diff --git a/includes/libraries/action-scheduler/classes/ActionScheduler_AdminView_Deprecated.php b/includes/libraries/action-scheduler/classes/ActionScheduler_AdminView_Deprecated.php old mode 100755 new mode 100644 diff --git a/includes/libraries/action-scheduler/classes/ActionScheduler_CanceledAction.php b/includes/libraries/action-scheduler/classes/ActionScheduler_CanceledAction.php old mode 100755 new mode 100644 diff --git a/includes/libraries/action-scheduler/classes/ActionScheduler_CronSchedule.php b/includes/libraries/action-scheduler/classes/ActionScheduler_CronSchedule.php old mode 100755 new mode 100644 diff --git a/includes/libraries/action-scheduler/classes/ActionScheduler_DateTime.php b/includes/libraries/action-scheduler/classes/ActionScheduler_DateTime.php old mode 100755 new mode 100644 diff --git a/includes/libraries/action-scheduler/classes/ActionScheduler_FatalErrorMonitor.php b/includes/libraries/action-scheduler/classes/ActionScheduler_FatalErrorMonitor.php old mode 100755 new mode 100644 diff --git a/includes/libraries/action-scheduler/classes/ActionScheduler_FinishedAction.php b/includes/libraries/action-scheduler/classes/ActionScheduler_FinishedAction.php old mode 100755 new mode 100644 diff --git a/includes/libraries/action-scheduler/classes/ActionScheduler_IntervalSchedule.php b/includes/libraries/action-scheduler/classes/ActionScheduler_IntervalSchedule.php old mode 100755 new mode 100644 diff --git a/includes/libraries/action-scheduler/classes/ActionScheduler_ListTable.php b/includes/libraries/action-scheduler/classes/ActionScheduler_ListTable.php old mode 100755 new mode 100644 diff --git a/includes/libraries/action-scheduler/classes/ActionScheduler_LogEntry.php b/includes/libraries/action-scheduler/classes/ActionScheduler_LogEntry.php old mode 100755 new mode 100644 diff --git a/includes/libraries/action-scheduler/classes/ActionScheduler_Logger.php b/includes/libraries/action-scheduler/classes/ActionScheduler_Logger.php old mode 100755 new mode 100644 diff --git a/includes/libraries/action-scheduler/classes/ActionScheduler_NullAction.php b/includes/libraries/action-scheduler/classes/ActionScheduler_NullAction.php old mode 100755 new mode 100644 diff --git a/includes/libraries/action-scheduler/classes/ActionScheduler_NullLogEntry.php b/includes/libraries/action-scheduler/classes/ActionScheduler_NullLogEntry.php old mode 100755 new mode 100644 diff --git a/includes/libraries/action-scheduler/classes/ActionScheduler_NullSchedule.php b/includes/libraries/action-scheduler/classes/ActionScheduler_NullSchedule.php old mode 100755 new mode 100644 diff --git a/includes/libraries/action-scheduler/classes/ActionScheduler_QueueCleaner.php b/includes/libraries/action-scheduler/classes/ActionScheduler_QueueCleaner.php old mode 100755 new mode 100644 diff --git a/includes/libraries/action-scheduler/classes/ActionScheduler_QueueRunner.php b/includes/libraries/action-scheduler/classes/ActionScheduler_QueueRunner.php old mode 100755 new mode 100644 diff --git a/includes/libraries/action-scheduler/classes/ActionScheduler_Schedule.php b/includes/libraries/action-scheduler/classes/ActionScheduler_Schedule.php old mode 100755 new mode 100644 diff --git a/includes/libraries/action-scheduler/classes/ActionScheduler_SimpleSchedule.php b/includes/libraries/action-scheduler/classes/ActionScheduler_SimpleSchedule.php old mode 100755 new mode 100644 diff --git a/includes/libraries/action-scheduler/classes/ActionScheduler_Store.php b/includes/libraries/action-scheduler/classes/ActionScheduler_Store.php old mode 100755 new mode 100644 diff --git a/includes/libraries/action-scheduler/classes/ActionScheduler_TimezoneHelper.php b/includes/libraries/action-scheduler/classes/ActionScheduler_TimezoneHelper.php old mode 100755 new mode 100644 diff --git a/includes/libraries/action-scheduler/classes/ActionScheduler_Versions.php b/includes/libraries/action-scheduler/classes/ActionScheduler_Versions.php old mode 100755 new mode 100644 diff --git a/includes/libraries/action-scheduler/classes/ActionScheduler_WPCLI_QueueRunner.php b/includes/libraries/action-scheduler/classes/ActionScheduler_WPCLI_QueueRunner.php old mode 100755 new mode 100644 diff --git a/includes/libraries/action-scheduler/classes/ActionScheduler_WPCLI_Scheduler_command.php b/includes/libraries/action-scheduler/classes/ActionScheduler_WPCLI_Scheduler_command.php old mode 100755 new mode 100644 diff --git a/includes/libraries/action-scheduler/classes/ActionScheduler_wpCommentLogger.php b/includes/libraries/action-scheduler/classes/ActionScheduler_wpCommentLogger.php old mode 100755 new mode 100644 diff --git a/includes/libraries/action-scheduler/classes/ActionScheduler_wpPostStore.php b/includes/libraries/action-scheduler/classes/ActionScheduler_wpPostStore.php old mode 100755 new mode 100644 diff --git a/includes/libraries/action-scheduler/classes/ActionScheduler_wpPostStore_PostStatusRegistrar.php b/includes/libraries/action-scheduler/classes/ActionScheduler_wpPostStore_PostStatusRegistrar.php old mode 100755 new mode 100644 diff --git a/includes/libraries/action-scheduler/classes/ActionScheduler_wpPostStore_PostTypeRegistrar.php b/includes/libraries/action-scheduler/classes/ActionScheduler_wpPostStore_PostTypeRegistrar.php old mode 100755 new mode 100644 diff --git a/includes/libraries/action-scheduler/classes/ActionScheduler_wpPostStore_TaxonomyRegistrar.php b/includes/libraries/action-scheduler/classes/ActionScheduler_wpPostStore_TaxonomyRegistrar.php old mode 100755 new mode 100644 diff --git a/includes/libraries/action-scheduler/composer.json b/includes/libraries/action-scheduler/composer.json old mode 100755 new mode 100644 diff --git a/includes/libraries/action-scheduler/composer.lock b/includes/libraries/action-scheduler/composer.lock old mode 100755 new mode 100644 diff --git a/includes/libraries/action-scheduler/functions.php b/includes/libraries/action-scheduler/functions.php old mode 100755 new mode 100644 diff --git a/includes/libraries/action-scheduler/license.txt b/includes/libraries/action-scheduler/license.txt old mode 100755 new mode 100644 diff --git a/includes/libraries/class-wc-datetime.php b/includes/libraries/class-wc-datetime.php old mode 100755 new mode 100644 diff --git a/includes/payment-retry/class-wcs-retry-admin.php b/includes/payment-retry/class-wcs-retry-admin.php old mode 100755 new mode 100644 diff --git a/includes/payment-retry/class-wcs-retry-email.php b/includes/payment-retry/class-wcs-retry-email.php old mode 100755 new mode 100644 index fece963..3aeb68c --- a/includes/payment-retry/class-wcs-retry-email.php +++ b/includes/payment-retry/class-wcs-retry-email.php @@ -41,11 +41,8 @@ class WCS_Retry_Email { $email_classes['WCS_Email_Customer_Payment_Retry'] = new WCS_Email_Customer_Payment_Retry(); - // the WCS_Email_Payment_Retry extends WC_Email_Failed_Order which is only available in WC 2.5+ - if ( ! WC_Subscriptions::is_woocommerce_pre( '2.5' ) ) { - require_once( plugin_dir_path( WC_Subscriptions::$plugin_file ) . 'includes/emails/class-wcs-email-payment-retry.php' ); - $email_classes['WCS_Email_Payment_Retry'] = new WCS_Email_Payment_Retry(); - } + require_once( plugin_dir_path( WC_Subscriptions::$plugin_file ) . 'includes/emails/class-wcs-email-payment-retry.php' ); + $email_classes['WCS_Email_Payment_Retry'] = new WCS_Email_Payment_Retry(); return $email_classes; } diff --git a/includes/payment-retry/class-wcs-retry-post-store.php b/includes/payment-retry/class-wcs-retry-post-store.php old mode 100755 new mode 100644 diff --git a/includes/payment-retry/class-wcs-retry-rule.php b/includes/payment-retry/class-wcs-retry-rule.php old mode 100755 new mode 100644 diff --git a/includes/payment-retry/class-wcs-retry-rules.php b/includes/payment-retry/class-wcs-retry-rules.php old mode 100755 new mode 100644 diff --git a/includes/payment-retry/class-wcs-retry.php b/includes/payment-retry/class-wcs-retry.php old mode 100755 new mode 100644 diff --git a/includes/privacy/class-wcs-privacy-background-updater.php b/includes/privacy/class-wcs-privacy-background-updater.php old mode 100755 new mode 100644 diff --git a/includes/privacy/class-wcs-privacy-erasers.php b/includes/privacy/class-wcs-privacy-erasers.php old mode 100755 new mode 100644 diff --git a/includes/privacy/class-wcs-privacy-exporters.php b/includes/privacy/class-wcs-privacy-exporters.php old mode 100755 new mode 100644 diff --git a/includes/privacy/class-wcs-privacy.php b/includes/privacy/class-wcs-privacy.php old mode 100755 new mode 100644 diff --git a/includes/upgrades/class-wc-subscriptions-upgrader.php b/includes/upgrades/class-wc-subscriptions-upgrader.php old mode 100755 new mode 100644 index 333c6c7..c2e6cf8 --- a/includes/upgrades/class-wc-subscriptions-upgrader.php +++ b/includes/upgrades/class-wc-subscriptions-upgrader.php @@ -102,6 +102,7 @@ class WC_Subscriptions_Upgrader { add_action( 'init', array( __CLASS__, 'maybe_add_subscription_address_indexes' ), 2 ); add_action( 'admin_notices', array( __CLASS__, 'maybe_add_downgrade_notice' ) ); + add_action( 'admin_notices', array( __CLASS__, 'maybe_display_external_object_cache_warning' ) ); add_action( 'init', array( __CLASS__, 'initialise_background_updaters' ), 0 ); } @@ -222,6 +223,14 @@ class WC_Subscriptions_Upgrader { self::$background_updaters['2.3']['address_indexes_repair']->schedule_repair(); } + if ( version_compare( self::$active_version, '2.3.0', '>=' ) && version_compare( self::$active_version, '2.3.3', '<' ) && wp_using_ext_object_cache() ) { + $has_transient_cache = $wpdb->get_var( "SELECT option_id FROM {$wpdb->prefix}options WHERE option_name LIKE '_transient_wcs-related-orders-to%' OR option_name LIKE '_transient_wcs_user_subscriptions_%' LIMIT 1;" ); + + if ( ! empty( $has_transient_cache ) ) { + update_option( 'wcs_display_2_3_3_warning', 'yes' ); + } + } + self::upgrade_complete(); } @@ -847,6 +856,45 @@ class WC_Subscriptions_Upgrader { } } + /** + * Display an admin notice if the site had customer subscription and/or subscription renewal order cached data stored in the options table + * and was using an external object cache at the time of updating to 2.3.3. + * + * Under these circumstances, there is a chance that the persistent caches introduced in 2.3 could contain invalid data. + * + * @see https://github.com/Prospress/woocommerce-subscriptions/issues/2822 for more details. + * @since 2.3.3 + */ + public static function maybe_display_external_object_cache_warning() { + $option_name = 'wcs_display_2_3_3_warning'; + $nonce = '_wcsnonce'; + $action = 'wcs_external_cache_warning'; + + // First, check if the notice is being dismissed. + if ( isset( $_GET[ $action ], $_GET[ $nonce ] ) && wp_verify_nonce( $_GET[ $nonce ], $action ) ) { + delete_option( $option_name ); + return; + } + + if ( 'yes' !== get_option( $option_name ) ) { + return; + } + + $admin_notice = new WCS_Admin_Notice( 'error' ); + $admin_notice->set_simple_content( sprintf( esc_html__( '%1$sWarning!%2$s We discovered an issue in %1$sWooCommerce Subscriptions 2.3.0 - 2.3.2%2$s that may cause your subscription renewal order and customer subscription caches to contain invalid data. For information about how to update the cached data, please %3$sopen a new support ticket%4$s.', 'woocommerce-subscriptions' ), + '', '', + '', '' + ) ); + $admin_notice->set_actions( array( + array( + 'name' => 'Dismiss', + 'url' => wp_nonce_url( add_query_arg( $action, 'dismiss' ), $action, $nonce ), + ), + ) ); + + $admin_notice->display(); + } + /** * Used to check if a user ID is greater than the last user upgraded to version 1.4. * diff --git a/includes/upgrades/class-wcs-repair-2-0-2.php b/includes/upgrades/class-wcs-repair-2-0-2.php old mode 100755 new mode 100644 diff --git a/includes/upgrades/class-wcs-repair-2-0.php b/includes/upgrades/class-wcs-repair-2-0.php old mode 100755 new mode 100644 diff --git a/includes/upgrades/class-wcs-repair-subscription-address-indexes.php b/includes/upgrades/class-wcs-repair-subscription-address-indexes.php old mode 100755 new mode 100644 diff --git a/includes/upgrades/class-wcs-repair-suspended-paypal-subscriptions.php b/includes/upgrades/class-wcs-repair-suspended-paypal-subscriptions.php old mode 100755 new mode 100644 index bb149cc..e9b1631 --- a/includes/upgrades/class-wcs-repair-suspended-paypal-subscriptions.php +++ b/includes/upgrades/class-wcs-repair-suspended-paypal-subscriptions.php @@ -25,6 +25,7 @@ class WCS_Repair_Suspended_PayPal_Subscriptions extends WCS_Background_Upgrader * Constructor. * * @param WC_Logger $logger The WC Logger instance. + * * @since 2.3.0 */ public function __construct( WC_Logger $logger ) { @@ -46,10 +47,17 @@ class WCS_Repair_Suspended_PayPal_Subscriptions extends WCS_Background_Upgrader throw new Exception( 'Failed to instantiate subscription object' ); } + remove_filter( 'woocommerce_subscription_payment_gateway_supports', 'WCS_PayPal_Supports::add_feature_support_for_subscription', 10 ); $subscription->update_status( 'on-hold', __( 'Subscription suspended by Database repair script. This subscription was suspended via PayPal.', 'woocommerce-subscriptions' ) ); $this->log( sprintf( 'Subscription ID %d suspended from 2.3.0 PayPal database repair script.', $subscription_id ) ); } catch ( Exception $e ) { + if ( $subscription ) { + // Adds meta to subscription in order to avoid this being updated again. + $subscription->update_meta_data( 'wcs_repair_suspended_paypal_subscription_failed', true ); + $subscription->save(); + } + $this->log( sprintf( '--- Exception caught repairing subscription %d - exception message: %s ---', $subscription_id, $e->getMessage() ) ); } } @@ -82,6 +90,10 @@ class WCS_Repair_Suspended_PayPal_Subscriptions extends WCS_Background_Upgrader 'value' => 'B-%', 'compare' => 'NOT LIKE', ), + array( + 'key' => 'wcs_repair_suspended_paypal_subscription_failed', + 'compare' => 'NOT EXISTS', + ), ), ) ); } diff --git a/includes/upgrades/class-wcs-upgrade-1-2.php b/includes/upgrades/class-wcs-upgrade-1-2.php old mode 100755 new mode 100644 diff --git a/includes/upgrades/class-wcs-upgrade-1-3.php b/includes/upgrades/class-wcs-upgrade-1-3.php old mode 100755 new mode 100644 diff --git a/includes/upgrades/class-wcs-upgrade-1-4.php b/includes/upgrades/class-wcs-upgrade-1-4.php old mode 100755 new mode 100644 diff --git a/includes/upgrades/class-wcs-upgrade-1-5.php b/includes/upgrades/class-wcs-upgrade-1-5.php old mode 100755 new mode 100644 diff --git a/includes/upgrades/class-wcs-upgrade-2-0.php b/includes/upgrades/class-wcs-upgrade-2-0.php old mode 100755 new mode 100644 diff --git a/includes/upgrades/class-wcs-upgrade-2-1.php b/includes/upgrades/class-wcs-upgrade-2-1.php old mode 100755 new mode 100644 diff --git a/includes/upgrades/class-wcs-upgrade-2-2-7.php b/includes/upgrades/class-wcs-upgrade-2-2-7.php old mode 100755 new mode 100644 diff --git a/includes/upgrades/class-wcs-upgrade-2-2-9.php b/includes/upgrades/class-wcs-upgrade-2-2-9.php old mode 100755 new mode 100644 diff --git a/includes/upgrades/class-wcs-upgrade-logger.php b/includes/upgrades/class-wcs-upgrade-logger.php old mode 100755 new mode 100644 diff --git a/includes/upgrades/class-wcs-upgrade-notice-manager.php b/includes/upgrades/class-wcs-upgrade-notice-manager.php old mode 100755 new mode 100644 diff --git a/includes/upgrades/templates/update-welcome-notice.php b/includes/upgrades/templates/update-welcome-notice.php old mode 100755 new mode 100644 diff --git a/includes/upgrades/templates/wcs-about-2-0.php b/includes/upgrades/templates/wcs-about-2-0.php old mode 100755 new mode 100644 diff --git a/includes/upgrades/templates/wcs-about.php b/includes/upgrades/templates/wcs-about.php old mode 100755 new mode 100644 diff --git a/includes/upgrades/templates/wcs-upgrade-in-progress.php b/includes/upgrades/templates/wcs-upgrade-in-progress.php old mode 100755 new mode 100644 diff --git a/includes/upgrades/templates/wcs-upgrade.php b/includes/upgrades/templates/wcs-upgrade.php old mode 100755 new mode 100644 diff --git a/includes/wcs-cart-functions.php b/includes/wcs-cart-functions.php old mode 100755 new mode 100644 diff --git a/includes/wcs-compatibility-functions.php b/includes/wcs-compatibility-functions.php old mode 100755 new mode 100644 diff --git a/includes/wcs-conditional-functions.php b/includes/wcs-conditional-functions.php old mode 100755 new mode 100644 diff --git a/includes/wcs-deprecated-functions.php b/includes/wcs-deprecated-functions.php old mode 100755 new mode 100644 diff --git a/includes/wcs-formatting-functions.php b/includes/wcs-formatting-functions.php old mode 100755 new mode 100644 diff --git a/includes/wcs-helper-functions.php b/includes/wcs-helper-functions.php old mode 100755 new mode 100644 index 7a3bebc..f61c5b5 --- a/includes/wcs-helper-functions.php +++ b/includes/wcs-helper-functions.php @@ -208,6 +208,7 @@ function wcs_get_calling_function_name() { * @return mixed If data exists in a transient, the value of the transient, else boolean false. */ function wcs_get_transient_even_if_expired( $transient_key ) { + wcs_deprecated_function( __FUNCTION__, '2.3.3' ); // First, check if the transient exists via the Options API to access the value in the database without WordPress checking the transient's expiration time (and returning false if it's < now) $transient_value = get_option( sprintf( '_transient_%s', $transient_key ) ); diff --git a/includes/wcs-limit-functions.php b/includes/wcs-limit-functions.php old mode 100755 new mode 100644 diff --git a/includes/wcs-order-functions.php b/includes/wcs-order-functions.php old mode 100755 new mode 100644 diff --git a/includes/wcs-product-functions.php b/includes/wcs-product-functions.php old mode 100755 new mode 100644 diff --git a/includes/wcs-renewal-functions.php b/includes/wcs-renewal-functions.php old mode 100755 new mode 100644 diff --git a/includes/wcs-resubscribe-functions.php b/includes/wcs-resubscribe-functions.php old mode 100755 new mode 100644 diff --git a/includes/wcs-switch-functions.php b/includes/wcs-switch-functions.php old mode 100755 new mode 100644 diff --git a/includes/wcs-time-functions.php b/includes/wcs-time-functions.php old mode 100755 new mode 100644 diff --git a/includes/wcs-user-functions.php b/includes/wcs-user-functions.php old mode 100755 new mode 100644 index 93d3e3e..334e114 --- a/includes/wcs-user-functions.php +++ b/includes/wcs-user-functions.php @@ -178,7 +178,11 @@ function wcs_get_users_subscriptions( $user_id = 0 ) { if ( has_filter( 'wcs_pre_get_users_subscriptions' ) ) { wcs_deprecated_function( 'The "wcs_pre_get_users_subscriptions" hook should no longer be used. A persistent caching layer is now in place. Because of this, "wcs_pre_get_users_subscriptions"', '2.3.0' ); - $subscriptions = apply_filters( 'wcs_pre_get_users_subscriptions', $subscriptions, $user_id ); + $filtered_subscriptions = apply_filters( 'wcs_pre_get_users_subscriptions', $subscriptions, $user_id ); + + if ( is_array( $filtered_subscriptions ) ) { + $subscriptions = $filtered_subscriptions; + } } if ( empty( $subscriptions ) && 0 !== $user_id && ! empty( $user_id ) ) { diff --git a/languages/woocommerce-subscriptions.pot b/languages/woocommerce-subscriptions.pot old mode 100755 new mode 100644 index e951398..8ea1434 --- a/languages/woocommerce-subscriptions.pot +++ b/languages/woocommerce-subscriptions.pot @@ -2,10 +2,10 @@ # This file is distributed under the same license as the WooCommerce Subscriptions package. msgid "" msgstr "" -"Project-Id-Version: WooCommerce Subscriptions 2.3.2\n" +"Project-Id-Version: WooCommerce Subscriptions 2.3.4\n" "Report-Msgid-Bugs-To: " "https://github.com/Prospress/woocommerce-subscriptions/issues\n" -"POT-Creation-Date: 2018-07-10 05:08:52+00:00\n" +"POT-Creation-Date: 2018-08-10 04:58:51+00:00\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n" @@ -225,7 +225,7 @@ msgstr "" #: includes/class-wc-product-subscription.php:72 #: includes/class-wc-product-variable-subscription.php:73 #: includes/class-wc-subscriptions-product.php:99 -#: woocommerce-subscriptions.php:614 +#: woocommerce-subscriptions.php:608 msgid "Sign Up Now" msgstr "" @@ -362,7 +362,7 @@ msgstr "" #: includes/admin/class-wc-subscriptions-admin.php:1203 #: includes/upgrades/templates/wcs-about-2-0.php:35 #: includes/upgrades/templates/wcs-about.php:34 -#: woocommerce-subscriptions.php:1185 +#: woocommerce-subscriptions.php:1179 msgid "Settings" msgstr "" @@ -601,12 +601,12 @@ msgid "End Date" msgstr "" #: includes/admin/class-wcs-admin-post-types.php:458 -#: includes/wcs-user-functions.php:329 +#: includes/wcs-user-functions.php:333 msgid "Reactivate" msgstr "" #: includes/admin/class-wcs-admin-post-types.php:459 -#: includes/wcs-user-functions.php:324 +#: includes/wcs-user-functions.php:328 msgid "Suspend" msgstr "" @@ -1657,21 +1657,21 @@ msgstr "" msgid "Update the %1$s used for %2$sall%3$s of my active subscriptions" msgstr "" -#: includes/class-wc-subscriptions-cart.php:901 +#: includes/class-wc-subscriptions-cart.php:898 msgid "Please enter a valid postcode/ZIP." msgstr "" -#: includes/class-wc-subscriptions-cart.php:1072 +#: includes/class-wc-subscriptions-cart.php:1069 msgid "" "That subscription product can not be added to your cart as it already " "contains a subscription renewal." msgstr "" -#: includes/class-wc-subscriptions-cart.php:1160 +#: includes/class-wc-subscriptions-cart.php:1157 msgid "Invalid recurring shipping method." msgstr "" -#: includes/class-wc-subscriptions-cart.php:1983 +#: includes/class-wc-subscriptions-cart.php:1980 msgid "now" msgstr "" @@ -1818,52 +1818,52 @@ msgstr "" msgid "Sorry, only recurring coupons can only be applied to subscriptions." msgstr "" -#: includes/class-wc-subscriptions-coupon.php:669 +#: includes/class-wc-subscriptions-coupon.php:681 msgid "Renewal % discount" msgstr "" -#: includes/class-wc-subscriptions-coupon.php:670 +#: includes/class-wc-subscriptions-coupon.php:682 msgid "Renewal product discount" msgstr "" -#: includes/class-wc-subscriptions-coupon.php:671 +#: includes/class-wc-subscriptions-coupon.php:683 msgid "Renewal cart discount" msgstr "" -#: includes/class-wc-subscriptions-coupon.php:688 +#: includes/class-wc-subscriptions-coupon.php:700 msgid "Renewal Discount" msgstr "" -#: includes/class-wc-subscriptions-coupon.php:866 +#: includes/class-wc-subscriptions-coupon.php:915 msgid "" "Sorry, it seems there are no available payment methods which support the " "recurring coupon you are using. Please contact us if you require assistance " "or wish to make alternate arrangements." msgstr "" -#: includes/class-wc-subscriptions-coupon.php:881 +#: includes/class-wc-subscriptions-coupon.php:930 msgid "Active for x payments" msgstr "" -#: includes/class-wc-subscriptions-coupon.php:882 +#: includes/class-wc-subscriptions-coupon.php:931 msgid "Unlimited payments" msgstr "" -#: includes/class-wc-subscriptions-coupon.php:883 +#: includes/class-wc-subscriptions-coupon.php:932 msgid "" "Coupon will be limited to the given number of payments. It will then be " "automatically removed from the subscription. \"Payments\" also includes the " "initial subscription payment." msgstr "" -#: includes/class-wc-subscriptions-coupon.php:1015 +#: includes/class-wc-subscriptions-coupon.php:1064 #. translators: %d refers to the number of payments the coupon can be used for. msgid "Active for %d payment" msgid_plural "Active for %d payments" msgstr[0] "" msgstr[1] "" -#: includes/class-wc-subscriptions-coupon.php:1019 +#: includes/class-wc-subscriptions-coupon.php:1068 msgid "Active for unlimited payments" msgstr "" @@ -1955,40 +1955,40 @@ msgstr "" msgid "Date Changed" msgstr "" -#: includes/class-wc-subscriptions-order.php:373 +#: includes/class-wc-subscriptions-order.php:372 msgid "Your subscription will be activated when payment clears." msgid_plural "Your subscriptions will be activated when payment clears." msgstr[0] "" msgstr[1] "" -#: includes/class-wc-subscriptions-order.php:382 +#: includes/class-wc-subscriptions-order.php:381 #. translators: placeholders are opening and closing link tags msgid "View the status of your subscription in %syour account%s." msgid_plural "View the status of your subscriptions in %syour account%s." msgstr[0] "" msgstr[1] "" -#: includes/class-wc-subscriptions-order.php:430 +#: includes/class-wc-subscriptions-order.php:429 msgid "Subscription Relationship" msgstr "" -#: includes/class-wc-subscriptions-order.php:450 +#: includes/class-wc-subscriptions-order.php:449 msgid "Renewal Order" msgstr "" -#: includes/class-wc-subscriptions-order.php:452 +#: includes/class-wc-subscriptions-order.php:451 msgid "Resubscribe Order" msgstr "" -#: includes/class-wc-subscriptions-order.php:454 +#: includes/class-wc-subscriptions-order.php:453 msgid "Parent Order" msgstr "" -#: includes/class-wc-subscriptions-order.php:677 +#: includes/class-wc-subscriptions-order.php:676 msgid "All orders types" msgstr "" -#: includes/class-wc-subscriptions-order.php:972 +#: includes/class-wc-subscriptions-order.php:971 #. translators: $1: opening link tag, $2: order number, $3: closing link tag msgid "Subscription cancelled for refunded order %1$s#%2$s%3$s." msgstr "" @@ -2093,7 +2093,7 @@ msgstr "" msgid "%1$s and a %2$s sign-up fee" msgstr "" -#: includes/class-wc-subscriptions-product.php:952 +#: includes/class-wc-subscriptions-product.php:947 msgid "" "This variation can not be removed because it is associated with active " "subscriptions. To remove this variation, please cancel and delete the " @@ -2212,7 +2212,7 @@ msgstr "" #: includes/class-wc-subscriptions-switcher.php:421 #: includes/class-wc-subscriptions-switcher.php:447 -#: includes/class-wc-subscriptions-switcher.php:2439 +#: includes/class-wc-subscriptions-switcher.php:2442 msgid "Upgrade or Downgrade" msgstr "" @@ -2250,16 +2250,16 @@ msgstr "" msgid "There was an error locating the switch details." msgstr "" -#: includes/class-wc-subscriptions-switcher.php:1889 -#: includes/class-wc-subscriptions-switcher.php:2233 +#: includes/class-wc-subscriptions-switcher.php:1892 +#: includes/class-wc-subscriptions-switcher.php:2236 msgid "The original subscription item being switched cannot be found." msgstr "" -#: includes/class-wc-subscriptions-switcher.php:1891 +#: includes/class-wc-subscriptions-switcher.php:1894 msgid "The item on the switch order cannot be found." msgstr "" -#: includes/class-wc-subscriptions-switcher.php:2270 +#: includes/class-wc-subscriptions-switcher.php:2273 msgid "Failed to update the subscription shipping method." msgstr "" @@ -2373,27 +2373,33 @@ msgid "Weekly" msgstr "" #: includes/class-wcs-cart-initial-payment.php:59 -#: includes/class-wcs-cart-renewal.php:179 +#: includes/class-wcs-cart-renewal.php:182 msgid "That doesn't appear to be your order." msgstr "" -#: includes/class-wcs-cart-renewal.php:207 +#: includes/class-wcs-cart-renewal.php:198 +msgid "" +"This order can no longer be paid because the corresponding subscription " +"does not require payment at this time." +msgstr "" + +#: includes/class-wcs-cart-renewal.php:215 msgid "Complete checkout to renew your subscription." msgstr "" -#: includes/class-wcs-cart-renewal.php:288 +#: includes/class-wcs-cart-renewal.php:296 #. translators: placeholder is an item name msgid "" "The %s product has been deleted and can no longer be renewed. Please choose " "a new product or contact us for assistance." msgstr "" -#: includes/class-wcs-cart-renewal.php:322 +#: includes/class-wcs-cart-renewal.php:330 #. translators: %s is subscription's number msgid "Subscription #%s has not been added to the cart." msgstr "" -#: includes/class-wcs-cart-renewal.php:455 +#: includes/class-wcs-cart-renewal.php:459 msgid "" "We couldn't find the original subscription for an item in your cart. The " "item was removed." @@ -2403,7 +2409,7 @@ msgid_plural "" msgstr[0] "" msgstr[1] "" -#: includes/class-wcs-cart-renewal.php:462 +#: includes/class-wcs-cart-renewal.php:466 msgid "" "We couldn't find the original renewal order for an item in your cart. The " "item was removed." @@ -2413,7 +2419,7 @@ msgid_plural "" msgstr[0] "" msgstr[1] "" -#: includes/class-wcs-cart-renewal.php:737 +#: includes/class-wcs-cart-renewal.php:741 msgid "All linked subscription items have been removed from the cart." msgstr "" @@ -3371,13 +3377,13 @@ msgstr "" msgid "N/A" msgstr "" -#: includes/upgrades/class-wc-subscriptions-upgrader.php:314 +#: includes/upgrades/class-wc-subscriptions-upgrader.php:323 #. translators: placeholder is a list of version numbers (e.g. "1.3 & 1.4 & #. 1.5") msgid "Database updated to version %s" msgstr "" -#: includes/upgrades/class-wc-subscriptions-upgrader.php:337 +#: includes/upgrades/class-wc-subscriptions-upgrader.php:346 #. translators: 1$: number of action scheduler hooks upgraded, 2$: #. "{execution_time}", will be replaced on front end with actual time msgid "" @@ -3385,28 +3391,28 @@ msgid "" "seconds)." msgstr "" -#: includes/upgrades/class-wc-subscriptions-upgrader.php:353 +#: includes/upgrades/class-wc-subscriptions-upgrader.php:362 #. translators: 1$: number of subscriptions upgraded, 2$: "{execution_time}", #. will be replaced on front end with actual time it took msgid "Migrated %1$s subscriptions to the new structure (in %2$s seconds)." msgstr "" -#: includes/upgrades/class-wc-subscriptions-upgrader.php:366 +#: includes/upgrades/class-wc-subscriptions-upgrader.php:375 #. translators: 1$: error message, 2$: opening link tag, 3$: closing link tag msgid "" "Unable to upgrade subscriptions.
Error: %1$s
Please refresh the " "page and try again. If problem persists, %2$scontact support%3$s." msgstr "" -#: includes/upgrades/class-wc-subscriptions-upgrader.php:621 +#: includes/upgrades/class-wc-subscriptions-upgrader.php:630 msgid "Welcome to WooCommerce Subscriptions 2.1" msgstr "" -#: includes/upgrades/class-wc-subscriptions-upgrader.php:621 +#: includes/upgrades/class-wc-subscriptions-upgrader.php:630 msgid "About WooCommerce Subscriptions" msgstr "" -#: includes/upgrades/class-wc-subscriptions-upgrader.php:804 +#: includes/upgrades/class-wc-subscriptions-upgrader.php:813 msgid "" "%1$sWarning!%2$s It appears that you have downgraded %1$sWooCommerce " "Subscriptions%2$s from %3$s to %4$s. Downgrading the plugin in this way may " @@ -3414,7 +3420,15 @@ msgid "" "ticket%6$s for further assistance." msgstr "" -#: includes/upgrades/class-wcs-repair-suspended-paypal-subscriptions.php:49 +#: includes/upgrades/class-wc-subscriptions-upgrader.php:884 +msgid "" +"%1$sWarning!%2$s We discovered an issue in %1$sWooCommerce Subscriptions " +"2.3.0 - 2.3.2%2$s that may cause your subscription renewal order and " +"customer subscription caches to contain invalid data. For information about " +"how to update the cached data, please %3$sopen a new support ticket%4$s." +msgstr "" + +#: includes/upgrades/class-wcs-repair-suspended-paypal-subscriptions.php:51 msgid "" "Subscription suspended by Database repair script. This subscription was " "suspended via PayPal." @@ -4295,7 +4309,7 @@ msgid_plural "a %s-year" msgstr[0] "" msgstr[1] "" -#: includes/wcs-user-functions.php:336 +#: includes/wcs-user-functions.php:340 #: templates/single-product/add-to-cart/subscription.php:43 #: templates/single-product/add-to-cart/variable-subscription.php:29 msgid "Resubscribe" @@ -4586,7 +4600,11 @@ msgstr "" msgid "This product is currently out of stock and unavailable." msgstr "" -#: templates/single-product/add-to-cart/variable-subscription.php:43 +#: templates/single-product/add-to-cart/variable-subscription.php:35 +msgid "You have added a variation of this product to the cart already." +msgstr "" + +#: templates/single-product/add-to-cart/variable-subscription.php:46 msgid "Clear" msgstr "" @@ -4649,28 +4667,28 @@ msgid "" "can not be purchased at the same time." msgstr "" -#: woocommerce-subscriptions.php:683 woocommerce-subscriptions.php:700 +#: woocommerce-subscriptions.php:677 woocommerce-subscriptions.php:694 #. translators: placeholder is a number, this is for the teens #. translators: placeholder is a number, numbers ending in 4-9, 0 msgid "%sth" msgstr "" -#: woocommerce-subscriptions.php:688 +#: woocommerce-subscriptions.php:682 #. translators: placeholder is a number, numbers ending in 1 msgid "%sst" msgstr "" -#: woocommerce-subscriptions.php:692 +#: woocommerce-subscriptions.php:686 #. translators: placeholder is a number, numbers ending in 2 msgid "%snd" msgstr "" -#: woocommerce-subscriptions.php:696 +#: woocommerce-subscriptions.php:690 #. translators: placeholder is a number, numbers ending in 3 msgid "%srd" msgstr "" -#: woocommerce-subscriptions.php:726 +#: woocommerce-subscriptions.php:720 #. translators: 1$-2$: opening and closing tags, 3$-4$: link tags, #. takes to woocommerce plugin on wp.org, 5$-6$: opening and closing link tags, #. leads to plugins.php in admin @@ -4680,7 +4698,7 @@ msgid "" "%5$sinstall & activate WooCommerce »%6$s" msgstr "" -#: woocommerce-subscriptions.php:733 +#: woocommerce-subscriptions.php:727 #. translators: 1$-2$: opening and closing tags, 3$-4$: opening and #. closing link tags, leads to plugin admin msgid "" @@ -4689,11 +4707,11 @@ msgid "" "WooCommerce to version 2.4 or newer »%4$s" msgstr "" -#: woocommerce-subscriptions.php:759 +#: woocommerce-subscriptions.php:753 msgid "Variable Subscription" msgstr "" -#: woocommerce-subscriptions.php:902 +#: woocommerce-subscriptions.php:896 msgid "" "%1$sWarning!%2$s We can see the %1$sWooCommerce Subscriptions Early " "Renewal%2$s plugin is active. Version %3$s of %1$sWooCommerce " @@ -4702,11 +4720,11 @@ msgid "" "avoid any conflicts." msgstr "" -#: woocommerce-subscriptions.php:905 +#: woocommerce-subscriptions.php:899 msgid "Installed Plugins" msgstr "" -#: woocommerce-subscriptions.php:978 +#: woocommerce-subscriptions.php:972 #. translators: 1$-2$: opening and closing tags, 3$-4$: opening and #. closing link tags. Leads to duplicate site article on docs msgid "" @@ -4716,19 +4734,19 @@ msgid "" "environment. %3$sLearn more »%4$s." msgstr "" -#: woocommerce-subscriptions.php:980 +#: woocommerce-subscriptions.php:974 msgid "Quit nagging me (but don't enable automatic payments)" msgstr "" -#: woocommerce-subscriptions.php:981 +#: woocommerce-subscriptions.php:975 msgid "Enable automatic payments" msgstr "" -#: woocommerce-subscriptions.php:1187 +#: woocommerce-subscriptions.php:1181 msgid "Support" msgstr "" -#: woocommerce-subscriptions.php:1272 +#: woocommerce-subscriptions.php:1266 #. translators: placeholders are opening and closing tags. Leads to docs on #. version 2 msgid "" @@ -4739,14 +4757,14 @@ msgid "" "2.0 »%s" msgstr "" -#: woocommerce-subscriptions.php:1287 +#: woocommerce-subscriptions.php:1281 msgid "" "Warning! You are running version %s of WooCommerce Subscriptions plugin " "code but your database has been upgraded to Subscriptions version 2.0. This " "will cause major problems on your store." msgstr "" -#: woocommerce-subscriptions.php:1288 +#: woocommerce-subscriptions.php:1282 msgid "" "Please upgrade the WooCommerce Subscriptions plugin to version 2.0 or newer " "immediately. If you need assistance, after upgrading to Subscriptions v2.0, " @@ -4883,7 +4901,7 @@ msgstr "" #: includes/admin/class-wcs-admin-post-types.php:247 #: includes/admin/class-wcs-admin-post-types.php:460 #: includes/class-wc-subscriptions-manager.php:1829 -#: includes/wcs-user-functions.php:345 +#: includes/wcs-user-functions.php:349 #: templates/myaccount/related-orders.php:73 msgctxt "an action on a subscription" msgid "Cancel" @@ -5207,7 +5225,7 @@ msgctxt "Subscription status" msgid "On-hold" msgstr "" -#: includes/class-wc-subscriptions-switcher.php:2580 wcs-functions.php:228 +#: includes/class-wc-subscriptions-switcher.php:2583 wcs-functions.php:228 msgctxt "Subscription status" msgid "Switched" msgstr "" @@ -5229,32 +5247,32 @@ msgctxt "used in a select box" msgid "%1$s-%2$s" msgstr "" -#: includes/class-wc-subscriptions-order.php:680 +#: includes/class-wc-subscriptions-order.php:679 msgctxt "An order type" msgid "Original" msgstr "" -#: includes/class-wc-subscriptions-order.php:681 +#: includes/class-wc-subscriptions-order.php:680 msgctxt "An order type" msgid "Subscription Parent" msgstr "" -#: includes/class-wc-subscriptions-order.php:682 +#: includes/class-wc-subscriptions-order.php:681 msgctxt "An order type" msgid "Subscription Renewal" msgstr "" -#: includes/class-wc-subscriptions-order.php:683 +#: includes/class-wc-subscriptions-order.php:682 msgctxt "An order type" msgid "Subscription Resubscribe" msgstr "" -#: includes/class-wc-subscriptions-order.php:684 +#: includes/class-wc-subscriptions-order.php:683 msgctxt "An order type" msgid "Subscription Switch" msgstr "" -#: includes/class-wc-subscriptions-order.php:685 +#: includes/class-wc-subscriptions-order.php:684 msgctxt "An order type" msgid "Non-subscription" msgstr "" @@ -5338,30 +5356,30 @@ msgctxt "when to prorate first payment / subscription length" msgid "Never (charge the full recurring amount at sign-up)" msgstr "" -#: includes/class-wc-subscriptions-switcher.php:1775 +#: includes/class-wc-subscriptions-switcher.php:1778 msgctxt "a switch order" msgid "Downgrade" msgstr "" -#: includes/class-wc-subscriptions-switcher.php:1778 +#: includes/class-wc-subscriptions-switcher.php:1781 msgctxt "a switch order" msgid "Upgrade" msgstr "" -#: includes/class-wc-subscriptions-switcher.php:1781 +#: includes/class-wc-subscriptions-switcher.php:1784 msgctxt "a switch order" msgid "Crossgrade" msgstr "" -#: includes/class-wc-subscriptions-switcher.php:1786 +#: includes/class-wc-subscriptions-switcher.php:1789 #. translators: %1: product subtotal, %2: HTML span tag, %3: direction #. (upgrade, downgrade, crossgrade), %4: closing HTML span tag msgctxt "product subtotal string" msgid "%1$s %2$s(%3$s)%4$s" msgstr "" -#: includes/class-wc-subscriptions-switcher.php:1902 -#: includes/class-wc-subscriptions-switcher.php:2244 +#: includes/class-wc-subscriptions-switcher.php:1905 +#: includes/class-wc-subscriptions-switcher.php:2247 #. translators: 1$: old item, 2$: new item when switching msgctxt "used in order notes" msgid "Customer switched from: %1$s to %2$s." @@ -5392,7 +5410,7 @@ msgctxt "input field placeholder for day field for annual subscriptions" msgid "Day" msgstr "" -#: includes/class-wcs-cart-renewal.php:766 +#: includes/class-wcs-cart-renewal.php:770 msgctxt "" "Used in WooCommerce by removed item notification: \"_All linked " "subscription items were_ removed. Undo?\" Filter for item title." @@ -5664,21 +5682,21 @@ msgctxt "Admin menu name" msgid "Renewal Payment Retries" msgstr "" -#: includes/upgrades/class-wc-subscriptions-upgrader.php:325 +#: includes/upgrades/class-wc-subscriptions-upgrader.php:334 #. translators: placeholder is number of upgraded subscriptions msgctxt "used in the subscriptions upgrader" msgid "Marked %s subscription products as \"sold individually\"." msgstr "" -#: includes/upgrades/class-wc-subscriptions-upgrader.php:356 -#: includes/upgrades/class-wc-subscriptions-upgrader.php:406 +#: includes/upgrades/class-wc-subscriptions-upgrader.php:365 +#: includes/upgrades/class-wc-subscriptions-upgrader.php:415 #. translators: placeholder is "{time_left}", will be replaced on front end #. with actual time msgctxt "Message that gets sent to front end." msgid "Estimated time left (minutes:seconds): %s" msgstr "" -#: includes/upgrades/class-wc-subscriptions-upgrader.php:385 +#: includes/upgrades/class-wc-subscriptions-upgrader.php:394 #. translators: placeholder is the number of subscriptions repaired msgctxt "Repair message that gets sent to front end." msgid "" @@ -5686,7 +5704,7 @@ msgid "" "customer notes." msgstr "" -#: includes/upgrades/class-wc-subscriptions-upgrader.php:391 +#: includes/upgrades/class-wc-subscriptions-upgrader.php:400 #. translators: placeholder is number of subscriptions that were checked and #. did not need repairs. There's a space at the beginning! msgctxt "Repair message that gets sent to front end." @@ -5695,14 +5713,14 @@ msgid_plural "%d other subscriptions were checked and did not need any repairs." msgstr[0] "" msgstr[1] "" -#: includes/upgrades/class-wc-subscriptions-upgrader.php:395 +#: includes/upgrades/class-wc-subscriptions-upgrader.php:404 #. translators: placeholder is "{execution_time}", which will be replaced on #. front end with actual time msgctxt "Repair message that gets sent to front end." msgid "(in %s seconds)" msgstr "" -#: includes/upgrades/class-wc-subscriptions-upgrader.php:398 +#: includes/upgrades/class-wc-subscriptions-upgrader.php:407 #. translators: $1: "Repaired x subs with incorrect dates...", $2: "X others #. were checked and no repair needed", $3: "(in X seconds)". Ordering for RTL #. languages. @@ -5710,7 +5728,7 @@ msgctxt "The assembled repair message that gets sent to front end." msgid "%1$s%2$s %3$s" msgstr "" -#: includes/upgrades/class-wc-subscriptions-upgrader.php:417 +#: includes/upgrades/class-wc-subscriptions-upgrader.php:426 #. translators: 1$: error message, 2$: opening link tag, 3$: closing link tag msgctxt "Error message that gets sent to front end when upgrading Subscriptions" msgid "" @@ -5724,7 +5742,7 @@ msgid "2.3" msgstr "" #: includes/upgrades/templates/wcs-about-2-0.php:36 -#: woocommerce-subscriptions.php:1186 +#: woocommerce-subscriptions.php:1180 msgctxt "short for documents" msgid "Docs" msgstr "" diff --git a/readme.txt b/readme.txt old mode 100755 new mode 100644 diff --git a/templates/admin/deprecated/html-variation-price.php b/templates/admin/deprecated/html-variation-price.php old mode 100755 new mode 100644 diff --git a/templates/admin/deprecated/html-variation-synchronisation.php b/templates/admin/deprecated/html-variation-synchronisation.php old mode 100755 new mode 100644 diff --git a/templates/admin/deprecated/order-shipping-html.php b/templates/admin/deprecated/order-shipping-html.php old mode 100755 new mode 100644 diff --git a/templates/admin/deprecated/order-tax-html.php b/templates/admin/deprecated/order-tax-html.php old mode 100755 new mode 100644 diff --git a/templates/admin/html-admin-notice.php b/templates/admin/html-admin-notice.php old mode 100755 new mode 100644 diff --git a/templates/admin/html-variation-price.php b/templates/admin/html-variation-price.php old mode 100755 new mode 100644 diff --git a/templates/admin/html-variation-synchronisation.php b/templates/admin/html-variation-synchronisation.php old mode 100755 new mode 100644 diff --git a/templates/admin/status.php b/templates/admin/status.php old mode 100755 new mode 100644 diff --git a/templates/cart/cart-recurring-shipping.php b/templates/cart/cart-recurring-shipping.php old mode 100755 new mode 100644 diff --git a/templates/checkout/form-change-payment-method.php b/templates/checkout/form-change-payment-method.php old mode 100755 new mode 100644 diff --git a/templates/checkout/recurring-totals.php b/templates/checkout/recurring-totals.php old mode 100755 new mode 100644 diff --git a/templates/emails/admin-new-renewal-order.php b/templates/emails/admin-new-renewal-order.php old mode 100755 new mode 100644 diff --git a/templates/emails/admin-new-switch-order.php b/templates/emails/admin-new-switch-order.php old mode 100755 new mode 100644 diff --git a/templates/emails/admin-payment-retry.php b/templates/emails/admin-payment-retry.php old mode 100755 new mode 100644 diff --git a/templates/emails/cancelled-subscription.php b/templates/emails/cancelled-subscription.php old mode 100755 new mode 100644 diff --git a/templates/emails/customer-completed-renewal-order.php b/templates/emails/customer-completed-renewal-order.php old mode 100755 new mode 100644 diff --git a/templates/emails/customer-completed-switch-order.php b/templates/emails/customer-completed-switch-order.php old mode 100755 new mode 100644 diff --git a/templates/emails/customer-payment-retry.php b/templates/emails/customer-payment-retry.php old mode 100755 new mode 100644 diff --git a/templates/emails/customer-processing-renewal-order.php b/templates/emails/customer-processing-renewal-order.php old mode 100755 new mode 100644 diff --git a/templates/emails/customer-renewal-invoice.php b/templates/emails/customer-renewal-invoice.php old mode 100755 new mode 100644 diff --git a/templates/emails/email-order-details.php b/templates/emails/email-order-details.php old mode 100755 new mode 100644 diff --git a/templates/emails/expired-subscription.php b/templates/emails/expired-subscription.php old mode 100755 new mode 100644 diff --git a/templates/emails/on-hold-subscription.php b/templates/emails/on-hold-subscription.php old mode 100755 new mode 100644 diff --git a/templates/emails/plain/admin-new-renewal-order.php b/templates/emails/plain/admin-new-renewal-order.php old mode 100755 new mode 100644 diff --git a/templates/emails/plain/admin-new-switch-order.php b/templates/emails/plain/admin-new-switch-order.php old mode 100755 new mode 100644 diff --git a/templates/emails/plain/admin-payment-retry.php b/templates/emails/plain/admin-payment-retry.php old mode 100755 new mode 100644 diff --git a/templates/emails/plain/cancelled-subscription.php b/templates/emails/plain/cancelled-subscription.php old mode 100755 new mode 100644 diff --git a/templates/emails/plain/customer-completed-renewal-order.php b/templates/emails/plain/customer-completed-renewal-order.php old mode 100755 new mode 100644 diff --git a/templates/emails/plain/customer-completed-switch-order.php b/templates/emails/plain/customer-completed-switch-order.php old mode 100755 new mode 100644 diff --git a/templates/emails/plain/customer-payment-retry.php b/templates/emails/plain/customer-payment-retry.php old mode 100755 new mode 100644 diff --git a/templates/emails/plain/customer-processing-renewal-order.php b/templates/emails/plain/customer-processing-renewal-order.php old mode 100755 new mode 100644 diff --git a/templates/emails/plain/customer-renewal-invoice.php b/templates/emails/plain/customer-renewal-invoice.php old mode 100755 new mode 100644 diff --git a/templates/emails/plain/email-order-details.php b/templates/emails/plain/email-order-details.php old mode 100755 new mode 100644 diff --git a/templates/emails/plain/expired-subscription.php b/templates/emails/plain/expired-subscription.php old mode 100755 new mode 100644 diff --git a/templates/emails/plain/on-hold-subscription.php b/templates/emails/plain/on-hold-subscription.php old mode 100755 new mode 100644 diff --git a/templates/emails/plain/subscription-info.php b/templates/emails/plain/subscription-info.php old mode 100755 new mode 100644 diff --git a/templates/emails/subscription-info.php b/templates/emails/subscription-info.php old mode 100755 new mode 100644 index 4242222..e1f55d2 --- a/templates/emails/subscription-info.php +++ b/templates/emails/subscription-info.php @@ -12,7 +12,7 @@ if ( ! defined( 'ABSPATH' ) ) { ?>

- +
diff --git a/templates/myaccount/my-subscriptions.php b/templates/myaccount/my-subscriptions.php old mode 100755 new mode 100644 diff --git a/templates/myaccount/related-orders.php b/templates/myaccount/related-orders.php old mode 100755 new mode 100644 diff --git a/templates/myaccount/related-subscriptions.php b/templates/myaccount/related-subscriptions.php old mode 100755 new mode 100644 diff --git a/templates/myaccount/subscription-details.php b/templates/myaccount/subscription-details.php old mode 100755 new mode 100644 diff --git a/templates/myaccount/subscription-totals.php b/templates/myaccount/subscription-totals.php old mode 100755 new mode 100644 diff --git a/templates/myaccount/subscriptions.php b/templates/myaccount/subscriptions.php old mode 100755 new mode 100644 diff --git a/templates/myaccount/view-subscription.php b/templates/myaccount/view-subscription.php old mode 100755 new mode 100644 diff --git a/templates/single-product/add-to-cart/subscription.php b/templates/single-product/add-to-cart/subscription.php old mode 100755 new mode 100644 diff --git a/templates/single-product/add-to-cart/variable-subscription.php b/templates/single-product/add-to-cart/variable-subscription.php old mode 100755 new mode 100644 index bb77575..ecb55cd --- a/templates/single-product/add-to-cart/variable-subscription.php +++ b/templates/single-product/add-to-cart/variable-subscription.php @@ -31,6 +31,9 @@ do_action( 'woocommerce_before_add_to_cart_form' ); ?>

+ false ) ) ) ) : ?> +

+
$options ) : ?> @@ -44,7 +47,7 @@ do_action( 'woocommerce_before_add_to_cart_form' ); ?> ?> - +
diff --git a/wcs-functions.php b/wcs-functions.php old mode 100755 new mode 100644 diff --git a/woo-includes/class-wc-dependencies.php b/woo-includes/class-wc-dependencies.php old mode 100755 new mode 100644 diff --git a/woo-includes/woo-functions.php b/woo-includes/woo-functions.php old mode 100755 new mode 100644 diff --git a/woocommerce-subscriptions.php b/woocommerce-subscriptions.php old mode 100755 new mode 100644 index d0959a7..40ee52b --- a/woocommerce-subscriptions.php +++ b/woocommerce-subscriptions.php @@ -5,7 +5,7 @@ * Description: Sell products and services with recurring payments in your WooCommerce Store. * Author: Prospress Inc. * Author URI: http://prospress.com/ - * Version: 2.3.2 + * Version: 2.3.4 * * WC requires at least: 2.6 * WC tested up to: 3.4 @@ -170,7 +170,7 @@ class WC_Subscriptions { public static $plugin_file = __FILE__; - public static $version = '2.3.2'; + public static $version = '2.3.4'; private static $total_subscription_count = null; @@ -590,12 +590,6 @@ class WC_Subscriptions { } $url = wc_get_checkout_url(); - - // Redirect to the same page (if the customer wouldn't be redirected to the cart) to ensure the cart widget loads correctly - } elseif ( 'yes' != get_option( 'woocommerce_cart_redirect_after_add' ) && self::is_woocommerce_pre( '2.5' ) ) { - - $url = remove_query_arg( 'add-to-cart' ); - } }