diff --git a/.github/workflows/pr-build.yml b/.github/workflows/pr-build.yml new file mode 100644 index 00000000000..445317ac548 --- /dev/null +++ b/.github/workflows/pr-build.yml @@ -0,0 +1,21 @@ +name: Build zip for PR +on: + pull_request +jobs: + build: + name: Build zip for PR + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v2 + - name: Build + id: build + uses: woocommerce/action-build@v2 + - name: Upload PR zip + uses: actions/upload-artifact@v2 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + name: woocommerce.zip + path: ${{ steps.build.outputs.zip_path }} + retention-days: 7 diff --git a/.github/workflows/pr-unit-tests.yml b/.github/workflows/pr-unit-tests.yml new file mode 100644 index 00000000000..6563779641f --- /dev/null +++ b/.github/workflows/pr-unit-tests.yml @@ -0,0 +1,70 @@ +name: Run unit tests on PR +on: + pull_request +jobs: + test: + name: PHP ${{ matrix.php }} WP ${{ matrix.wp }} + timeout-minutes: 15 + runs-on: ubuntu-latest + strategy: + matrix: + php: [ '7.0', '7.1', '7.2', '7.3', '7.4', '8.0' ] + wp: [ "latest" ] + include: + - wp: nightly + php: '7.4' + - wp: '5.5' + php: 7.2 + - wp: '5.4' + php: 7.2 + services: + database: + image: mysql:5.6 + env: + MYSQL_ROOT_PASSWORD: root + ports: + - 3306:3306 + options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=5 + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php }} + tools: composer + extensions: mysql + coverage: none + + - name: Tool versions + run: | + php --version + composer --version + + - name: Get cached composer directories + uses: actions/cache@v2 + with: + path: | + ./packages + ./vendor + key: ${{ runner.os }}-${{ hashFiles('./composer.lock') }} + + - name: Setup and install composer + run: composer install + + - name: Add PHP8 Compatibility. + run: | + if [ "$(php -r "echo version_compare(PHP_VERSION,'8.0','>=');")" ]; then + curl -L https://github.com/woocommerce/phpunit/archive/add-compatibility-with-php8-to-phpunit-7.zip -o /tmp/phpunit-7.5-fork.zip + unzip -d /tmp/phpunit-7.5-fork /tmp/phpunit-7.5-fork.zip + composer bin phpunit config --unset platform + composer bin phpunit config repositories.0 '{"type": "path", "url": "/tmp/phpunit-7.5-fork/phpunit-add-compatibility-with-php8-to-phpunit-7", "options": {"symlink": false}}' + composer bin phpunit require --dev -W phpunit/phpunit:@dev --ignore-platform-reqs + fi + + - name: Init DB and WP + run: ./tests/bin/install.sh woo_test root root 127.0.0.1 ${{ matrix.wp }} + + - name: Run tests + run: ./vendor/bin/phpunit -c ./phpunit.xml diff --git a/.travis.yml b/.travis.yml index 3bac1469de0..e637ca63572 100644 --- a/.travis.yml +++ b/.travis.yml @@ -36,9 +36,9 @@ jobs: - npm install - composer install --no-dev script: - - travis_retry npm run build:assets - - travis_retry npm run docker:up - - travis_retry npm run test:e2e + - npm run build:assets + - npm run docker:up + - npm run test:e2e after_script: - npm run docker:down - name: "WP Nightly" diff --git a/assets/css/_variables.scss b/assets/css/_variables.scss index e2c3d1b29b1..494001ffd85 100644 --- a/assets/css/_variables.scss +++ b/assets/css/_variables.scss @@ -8,7 +8,7 @@ $red: #a00 !default; $orange: #ffba00 !default; $blue: #2ea2cc !default; -$primary: #a46497 !default; // Primary color for buttons (alt) +$primary: #a46497 !default; // Primary color for buttons (alt) $primarytext: desaturate(lighten($primary, 50%), 18%) !default; // Text on primary color bg $secondary: desaturate(lighten($primary, 40%), 21%) !default; // Secondary buttons @@ -17,5 +17,22 @@ $secondarytext: desaturate(darken($secondary, 60%), 21%) !default; // Text $highlight: adjust-hue($primary, 150deg) !default; // Prices, In stock labels, sales flash $highlightext: desaturate(lighten($highlight, 50%), 18%) !default; // Text on highlight color bg -$contentbg: #fff !default; // Content BG - Tabs (active state) -$subtext: #767676 !default; // small, breadcrumbs etc +$contentbg: #fff !default; // Content BG - Tabs (active state) +$subtext: #767676 !default; // small, breadcrumbs etc + +// export vars as CSS vars +:root { + --woocommerce: $woocommerce; + --wc-green: $green; + --wc-red: $red; + --wc-orange: $orange; + --wc-blue: $blue; + --wc-primary: $primary; + --wc-primary-text: $primarytext; + --wc-secondary: $secondary; + --wc-secondary-text: $secondarytext; + --wc-highlight: $highlight; + --wc-highligh-text: $highlightext; + --wc-content-bg: $contentbg; + --wc-subtext: $subtext; +} diff --git a/assets/css/twenty-twenty-one.scss b/assets/css/twenty-twenty-one.scss index c8fbba84047..ad542d5e7fd 100644 --- a/assets/css/twenty-twenty-one.scss +++ b/assets/css/twenty-twenty-one.scss @@ -126,12 +126,18 @@ a.button { } } -.woocommerce-breadcrumb { - margin-bottom: 5rem; - font-size: 0.88889em; - font-family: $headings; +.site-main { + .woocommerce-breadcrumb { + margin-bottom: var(--global--spacing-vertical); + font-size: 0.88889em; + font-family: $headings; + } + .woocommerce-products-header { + margin-top: var(--global--spacing-vertical); + } } + .woocommerce-pagination { font-family: $headings; font-size: 0.88889em; @@ -350,6 +356,10 @@ a.button { border-left: none; border-right: none; } + + .product-thumbnail { + max-width: 120px; + } } } @@ -537,11 +547,16 @@ dl.variation, display: none; } - .entry-title { - margin: 0 0 2.5rem; - &::before { - margin-top: 0; + &.singular { // Needed for higher specificity to target the entry title font size + .entry-title { + font-size: var(--global--font-size-xl); + font-weight: normal; + margin: 0 0 2.5rem; + + &::before { + margin-top: 0; + } } } @@ -829,7 +844,7 @@ a.reset_variations { } h2:first-of-type { - font-size: 3rem; + font-size: var(--global--font-size-lg); margin: 0 0 2rem !important; } } @@ -1424,10 +1439,6 @@ a.reset_variations { #main { - .entry-header { - padding: 3vw 0 1.5vw; - } - .woocommerce { max-width: var(--responsive--alignwide-width); margin: 0 auto; @@ -1860,6 +1871,10 @@ a.reset_variations { } } } + + tfoot { + text-align: left; + } } .woocommerce-order-received { @@ -2788,11 +2803,6 @@ a.reset_variations { .woocommerce-account { - .entry-header { - - padding-bottom: 20px !important; - } - .woocommerce-MyAccount-content { p:first-of-type { diff --git a/bin/composer/phpcs/composer.lock b/bin/composer/phpcs/composer.lock index 363928fcb9a..5a70d30ff7e 100644 --- a/bin/composer/phpcs/composer.lock +++ b/bin/composer/phpcs/composer.lock @@ -71,10 +71,6 @@ "stylecheck", "tests" ], - "support": { - "issues": "https://github.com/dealerdirect/phpcodesniffer-composer-installer/issues", - "source": "https://github.com/dealerdirect/phpcodesniffer-composer-installer" - }, "time": "2020-06-25T14:57:39+00:00" }, { @@ -133,10 +129,6 @@ "phpcs", "standards" ], - "support": { - "issues": "https://github.com/PHPCompatibility/PHPCompatibility/issues", - "source": "https://github.com/PHPCompatibility/PHPCompatibility" - }, "time": "2019-12-27T09:44:58+00:00" }, { @@ -189,10 +181,6 @@ "polyfill", "standards" ], - "support": { - "issues": "https://github.com/PHPCompatibility/PHPCompatibilityParagonie/issues", - "source": "https://github.com/PHPCompatibility/PHPCompatibilityParagonie" - }, "time": "2019-11-04T15:17:54+00:00" }, { @@ -243,10 +231,6 @@ "standards", "wordpress" ], - "support": { - "issues": "https://github.com/PHPCompatibility/PHPCompatibilityWP/issues", - "source": "https://github.com/PHPCompatibility/PHPCompatibilityWP" - }, "time": "2019-08-28T14:22:28+00:00" }, { @@ -343,10 +327,6 @@ "woocommerce", "wordpress" ], - "support": { - "issues": "https://github.com/woocommerce/woocommerce-sniffs/issues", - "source": "https://github.com/woocommerce/woocommerce-sniffs/tree/master" - }, "time": "2020-08-06T18:23:45+00:00" }, { @@ -393,11 +373,6 @@ "standards", "wordpress" ], - "support": { - "issues": "https://github.com/WordPress/WordPress-Coding-Standards/issues", - "source": "https://github.com/WordPress/WordPress-Coding-Standards", - "wiki": "https://github.com/WordPress/WordPress-Coding-Standards/wiki" - }, "time": "2020-05-13T23:57:56+00:00" } ], @@ -411,5 +386,5 @@ "platform-overrides": { "php": "7.0" }, - "plugin-api-version": "2.0.0" + "plugin-api-version": "1.1.0" } diff --git a/bin/composer/phpunit/composer.lock b/bin/composer/phpunit/composer.lock index 0f86a7f43fe..fe06e30dd0d 100644 --- a/bin/composer/phpunit/composer.lock +++ b/bin/composer/phpunit/composer.lock @@ -332,10 +332,6 @@ } ], "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", - "support": { - "issues": "https://github.com/phpDocumentor/ReflectionDocBlock/issues", - "source": "https://github.com/phpDocumentor/ReflectionDocBlock/tree/release/4.x" - }, "time": "2019-12-28T18:55:12+00:00" }, { @@ -448,10 +444,6 @@ "spy", "stub" ], - "support": { - "issues": "https://github.com/phpspec/prophecy/issues", - "source": "https://github.com/phpspec/prophecy/tree/v1.10.3" - }, "time": "2020-03-05T15:02:03+00:00" }, { @@ -612,10 +604,6 @@ "keywords": [ "template" ], - "support": { - "issues": "https://github.com/sebastianbergmann/php-text-template/issues", - "source": "https://github.com/sebastianbergmann/php-text-template/tree/1.2.1" - }, "time": "2015-06-21T13:50:34+00:00" }, { @@ -1236,10 +1224,6 @@ "keywords": [ "global state" ], - "support": { - "issues": "https://github.com/sebastianbergmann/global-state/issues", - "source": "https://github.com/sebastianbergmann/global-state/tree/2.0.0" - }, "time": "2017-04-27T15:39:26+00:00" }, { @@ -1504,10 +1488,6 @@ ], "description": "Library that helps with managing the version number of Git-hosted PHP projects", "homepage": "https://github.com/sebastianbergmann/version", - "support": { - "issues": "https://github.com/sebastianbergmann/version/issues", - "source": "https://github.com/sebastianbergmann/version/tree/master" - }, "time": "2016-10-03T07:35:21+00:00" }, { @@ -1627,10 +1607,6 @@ } ], "description": "A small library for converting tokenized PHP source code into XML and potentially other formats", - "support": { - "issues": "https://github.com/theseer/tokenizer/issues", - "source": "https://github.com/theseer/tokenizer/tree/master" - }, "time": "2019-06-13T22:48:21+00:00" }, { @@ -1680,10 +1656,6 @@ "check", "validate" ], - "support": { - "issues": "https://github.com/webmozart/assert/issues", - "source": "https://github.com/webmozart/assert/tree/master" - }, "time": "2020-07-08T17:02:28+00:00" } ], @@ -1697,5 +1669,5 @@ "platform-overrides": { "php": "7.0" }, - "plugin-api-version": "2.0.0" + "plugin-api-version": "1.1.0" } diff --git a/bin/composer/wp/composer.lock b/bin/composer/wp/composer.lock index ed08b92c203..24fdbbf28cb 100644 --- a/bin/composer/wp/composer.lock +++ b/bin/composer/wp/composer.lock @@ -133,24 +133,20 @@ "translations", "unicode" ], - "support": { - "issues": "https://github.com/php-gettext/Languages/issues", - "source": "https://github.com/php-gettext/Languages/tree/2.6.0" - }, "time": "2019-11-13T10:30:21+00:00" }, { "name": "mck89/peast", - "version": "v1.11.0", + "version": "v1.12.0", "source": { "type": "git", "url": "https://github.com/mck89/peast.git", - "reference": "2a2bc6826114c46ff0bc1359208b7083a17f7a99" + "reference": "833be7a294627a8c5b1c482cbf489f73bf9b8086" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/mck89/peast/zipball/2a2bc6826114c46ff0bc1359208b7083a17f7a99", - "reference": "2a2bc6826114c46ff0bc1359208b7083a17f7a99", + "url": "https://api.github.com/repos/mck89/peast/zipball/833be7a294627a8c5b1c482cbf489f73bf9b8086", + "reference": "833be7a294627a8c5b1c482cbf489f73bf9b8086", "shasum": "" }, "require": { @@ -162,7 +158,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.11.0-dev" + "dev-master": "1.12.0-dev" } }, "autoload": { @@ -182,11 +178,7 @@ } ], "description": "Peast is PHP library that generates AST for JavaScript code", - "support": { - "issues": "https://github.com/mck89/peast/issues", - "source": "https://github.com/mck89/peast/tree/v1.11.0" - }, - "time": "2020-10-09T15:12:13+00:00" + "time": "2021-01-08T15:16:19+00:00" }, { "name": "mustache/mustache", @@ -232,10 +224,6 @@ "mustache", "templating" ], - "support": { - "issues": "https://github.com/bobthecow/mustache.php/issues", - "source": "https://github.com/bobthecow/mustache.php/tree/master" - }, "time": "2019-11-23T21:40:31+00:00" }, { @@ -285,10 +273,6 @@ "iri", "sockets" ], - "support": { - "issues": "https://github.com/rmccue/Requests/issues", - "source": "https://github.com/rmccue/Requests/tree/master" - }, "time": "2016-10-13T00:11:37+00:00" }, { @@ -398,10 +382,6 @@ ], "description": "Provides internationalization tools for WordPress projects.", "homepage": "https://github.com/wp-cli/i18n-command", - "support": { - "issues": "https://github.com/wp-cli/i18n-command/issues", - "source": "https://github.com/wp-cli/i18n-command/tree/v2.2.6" - }, "time": "2020-12-07T19:28:27+00:00" }, { @@ -450,9 +430,6 @@ ], "description": "A simple YAML loader/dumper class for PHP (WP-CLI fork)", "homepage": "https://github.com/mustangostang/spyc/", - "support": { - "source": "https://github.com/wp-cli/spyc/tree/autoload" - }, "time": "2017-04-25T11:26:20+00:00" }, { @@ -503,10 +480,6 @@ "cli", "console" ], - "support": { - "issues": "https://github.com/wp-cli/php-cli-tools/issues", - "source": "https://github.com/wp-cli/php-cli-tools/tree/master" - }, "time": "2018-09-04T13:28:00+00:00" }, { @@ -569,11 +542,6 @@ "cli", "wordpress" ], - "support": { - "docs": "https://make.wordpress.org/cli/handbook/", - "issues": "https://github.com/wp-cli/wp-cli/issues", - "source": "https://github.com/wp-cli/wp-cli" - }, "time": "2020-02-18T08:15:37+00:00" } ], @@ -587,5 +555,5 @@ "platform-overrides": { "php": "7.0" }, - "plugin-api-version": "2.0.0" + "plugin-api-version": "1.1.0" } diff --git a/changelog.txt b/changelog.txt index 44e4695e3dd..5bb4adee9e1 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,6 +1,14 @@ == Changelog == -= 4.9.0 = += 4.9.2 2021-01-25 = + +* Tweak - Disable untested plugin's notice from System Status and Plugin's page. #28840 + += 4.9.1 2021-01-19 = + +* Fix - Reverts #28204 to ensure compatibility with extensions using legacy do_action calls. #28835 + += 4.9.0 2021-01-12 = **WooCommerce** * Localization - Add 'Ladakh' to the list of Indian states. #28458 @@ -28,6 +36,9 @@ * Fix - Better error messages when usage limit are reached. #28592 * Fix - Adjust stock items only for statuses which reduces the stock. #28620 * Fix - Named parameter to fix DB update routine on PHP8. #28537 +* Fix - Add protection around func_get_args_call for backwards compatibility. #28677 +* Fix - Restore stock_status in REST API V3 response. #28731 +* Fix - Revert some of the changes related to perf enhancements (27735) as it was breaking stock_status filter. #28745 * Dev - Hook for intializing price slider in frontend. #28014 * Dev - Add support for running a custom initialization script for tests. #28041 * Dev - Use the coenjacobs/mozart package to renamespace vendor packages. #28147 @@ -70,6 +81,7 @@ * Fix - Preventing desktop-sized navigation placeholder from appearing on mobile during load. #5616 * Fix - Completed tasks tracking causing infinite loop #5941 * Fix - Remove Navigation access #5940 +* Fix - Compile the debug module so it can be used in older browsers like IE11. #5968 * Tweak - Fix inconsistent REST API parameter name for customer type filtering. #5823 * Tweak - Improve styles of the tax task. #5709 * Tweak - Do not show store setup link on the homescreen. #5801 diff --git a/composer.json b/composer.json index 130063f3882..65792a01784 100644 --- a/composer.json +++ b/composer.json @@ -21,7 +21,7 @@ "pelago/emogrifier": "3.1.0", "psr/container": "1.0.0", "woocommerce/action-scheduler": "3.1.6", - "woocommerce/woocommerce-admin": "1.8.3", + "woocommerce/woocommerce-admin": "1.9.0-rc.3", "woocommerce/woocommerce-blocks": "4.0.0" }, "require-dev": { diff --git a/composer.lock b/composer.lock index 254877de3a7..1a0ffd4d455 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "758b097c13e89200b28bf3a3b5fc2752", + "content-hash": "5fac5fbdbcff552de109cd95d469e975", "packages": [ { "name": "automattic/jetpack-autoloader", @@ -77,23 +77,20 @@ "GPL-2.0-or-later" ], "description": "A wrapper for defining constants in a more testable way.", - "support": { - "source": "https://github.com/Automattic/jetpack-constants/tree/v1.5.1" - }, "time": "2020-10-28T19:00:31+00:00" }, { "name": "composer/installers", - "version": "v1.9.0", + "version": "v1.10.0", "source": { "type": "git", "url": "https://github.com/composer/installers.git", - "reference": "b93bcf0fa1fccb0b7d176b0967d969691cd74cca" + "reference": "1a0357fccad9d1cc1ea0c9a05b8847fbccccb78d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/installers/zipball/b93bcf0fa1fccb0b7d176b0967d969691cd74cca", - "reference": "b93bcf0fa1fccb0b7d176b0967d969691cd74cca", + "url": "https://api.github.com/repos/composer/installers/zipball/1a0357fccad9d1cc1ea0c9a05b8847fbccccb78d", + "reference": "1a0357fccad9d1cc1ea0c9a05b8847fbccccb78d", "shasum": "" }, "require": { @@ -104,17 +101,18 @@ "shama/baton": "*" }, "require-dev": { - "composer/composer": "1.6.* || 2.0.*@dev", - "composer/semver": "1.0.* || 2.0.*@dev", - "phpunit/phpunit": "^4.8.36", - "sebastian/comparator": "^1.2.4", + "composer/composer": "1.6.* || ^2.0", + "composer/semver": "^1 || ^3", + "phpstan/phpstan": "^0.12.55", + "phpstan/phpstan-phpunit": "^0.12.16", + "symfony/phpunit-bridge": "^4.2 || ^5", "symfony/process": "^2.3" }, "type": "composer-plugin", "extra": { "class": "Composer\\Installers\\Plugin", "branch-alias": { - "dev-master": "1.0-dev" + "dev-main": "1.x-dev" } }, "autoload": { @@ -152,6 +150,7 @@ "Porto", "RadPHP", "SMF", + "Starbug", "Thelia", "Whmcs", "WolfCMS", @@ -192,6 +191,7 @@ "phpbb", "piwik", "ppi", + "processwire", "puppet", "pxcms", "reindex", @@ -207,21 +207,21 @@ "zend", "zikula" ], - "support": { - "issues": "https://github.com/composer/installers/issues", - "source": "https://github.com/composer/installers/tree/v1.9.0" - }, "funding": [ { "url": "https://packagist.com", "type": "custom" }, + { + "url": "https://github.com/composer", + "type": "github" + }, { "url": "https://tidelift.com/funding/github/packagist/composer/composer", "type": "tidelift" } ], - "time": "2020-04-07T06:57:05+00:00" + "time": "2021-01-14T11:07:16+00:00" }, { "name": "maxmind-db/reader", @@ -281,10 +281,6 @@ "geolocation", "maxmind" ], - "support": { - "issues": "https://github.com/maxmind/MaxMind-DB-Reader-php/issues", - "source": "https://github.com/maxmind/MaxMind-DB-Reader-php/tree/v1.6.0" - }, "time": "2019-12-19T22:59:03+00:00" }, { @@ -359,10 +355,6 @@ "email", "pre-processing" ], - "support": { - "issues": "https://github.com/MyIntervals/emogrifier/issues", - "source": "https://github.com/MyIntervals/emogrifier" - }, "time": "2019-12-26T19:37:31+00:00" }, { @@ -412,10 +404,6 @@ "container-interop", "psr" ], - "support": { - "issues": "https://github.com/php-fig/container/issues", - "source": "https://github.com/php-fig/container/tree/master" - }, "time": "2017-02-14T16:28:37+00:00" }, { @@ -507,24 +495,20 @@ ], "description": "Action Scheduler for WordPress and WooCommerce", "homepage": "https://actionscheduler.org/", - "support": { - "issues": "https://github.com/woocommerce/action-scheduler/issues", - "source": "https://github.com/woocommerce/action-scheduler/tree/master" - }, "time": "2020-05-12T16:22:33+00:00" }, { "name": "woocommerce/woocommerce-admin", - "version": "1.8.3", + "version": "1.9.0-rc.3", "source": { "type": "git", "url": "https://github.com/woocommerce/woocommerce-admin.git", - "reference": "534442980c34369f711efdb8e85fdcb1363be712" + "reference": "8c5b20cb6347959daf5403ee30e47061f335240b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/woocommerce/woocommerce-admin/zipball/534442980c34369f711efdb8e85fdcb1363be712", - "reference": "534442980c34369f711efdb8e85fdcb1363be712", + "url": "https://api.github.com/repos/woocommerce/woocommerce-admin/zipball/8c5b20cb6347959daf5403ee30e47061f335240b", + "reference": "8c5b20cb6347959daf5403ee30e47061f335240b", "shasum": "" }, "require": { @@ -556,11 +540,7 @@ ], "description": "A modern, javascript-driven WooCommerce Admin experience.", "homepage": "https://github.com/woocommerce/woocommerce-admin", - "support": { - "issues": "https://github.com/woocommerce/woocommerce-admin/issues", - "source": "https://github.com/woocommerce/woocommerce-admin/tree/v1.8.3" - }, - "time": "2021-01-06T00:00:42+00:00" + "time": "2021-01-22T10:23:29+00:00" }, { "name": "woocommerce/woocommerce-blocks", @@ -659,10 +639,6 @@ "isolation", "tool" ], - "support": { - "issues": "https://github.com/bamarni/composer-bin-plugin/issues", - "source": "https://github.com/bamarni/composer-bin-plugin/tree/master" - }, "time": "2020-05-03T08:27:20+00:00" } ], @@ -678,5 +654,5 @@ "platform-overrides": { "php": "7.0" }, - "plugin-api-version": "2.0.0" + "plugin-api-version": "1.1.0" } diff --git a/i18n/states.php b/i18n/states.php index cda1e51e4aa..6065e0771f8 100644 --- a/i18n/states.php +++ b/i18n/states.php @@ -306,6 +306,40 @@ return array( 'CZ' => array(), 'DE' => array(), 'DK' => array(), + 'DO' => array( // Dominican Republic. + 'DO-01' => __( 'Distrito Nacional', 'woocommerce' ), + 'DO-02' => __( 'Azua', 'woocommerce' ), + 'DO-03' => __( 'Baoruco', 'woocommerce' ), + 'DO-04' => __( 'Barahona', 'woocommerce' ), + 'DO-05' => __( 'Dajabón', 'woocommerce' ), + 'DO-06' => __( 'Duarte', 'woocommerce' ), + 'DO-07' => __( 'Elías Piña', 'woocommerce' ), + 'DO-08' => __( 'El Seibo', 'woocommerce' ), + 'DO-09' => __( 'Espaillat', 'woocommerce' ), + 'DO-10' => __( 'Independencia', 'woocommerce' ), + 'DO-11' => __( 'La Altagracia', 'woocommerce' ), + 'DO-12' => __( 'La Romana', 'woocommerce' ), + 'DO-13' => __( 'La Vega', 'woocommerce' ), + 'DO-14' => __( 'María Trinidad Sánchez', 'woocommerce' ), + 'DO-15' => __( 'Monte Cristi', 'woocommerce' ), + 'DO-16' => __( 'Pedernales', 'woocommerce' ), + 'DO-17' => __( 'Peravia', 'woocommerce' ), + 'DO-18' => __( 'Puerto Plata', 'woocommerce' ), + 'DO-19' => __( 'Hermanas Mirabal', 'woocommerce' ), + 'DO-20' => __( 'Samaná', 'woocommerce' ), + 'DO-21' => __( 'San Cristóbal', 'woocommerce' ), + 'DO-22' => __( 'San Juan', 'woocommerce' ), + 'DO-23' => __( 'San Pedro de Macorís', 'woocommerce' ), + 'DO-24' => __( 'Sánchez Ramírez', 'woocommerce' ), + 'DO-25' => __( 'Santiago', 'woocommerce' ), + 'DO-26' => __( 'Santiago Rodríguez', 'woocommerce' ), + 'DO-27' => __( 'Valverde', 'woocommerce' ), + 'DO-28' => __( 'Monseñor Nouel', 'woocommerce' ), + 'DO-29' => __( 'Monte Plata', 'woocommerce' ), + 'DO-30' => __( 'Hato Mayor', 'woocommerce' ), + 'DO-31' => __( 'San José de Ocoa', 'woocommerce' ), + 'DO-32' => __( 'Santo Domingo', 'woocommerce' ), + ), 'DZ' => array( 'DZ-01' => __( 'Adrar', 'woocommerce' ), 'DZ-02' => __( 'Chlef', 'woocommerce' ), @@ -442,6 +476,7 @@ return array( ), 'FI' => array(), 'FR' => array(), + 'GF' => array(), 'GH' => array( // Ghanaian Regions. 'AF' => __( 'Ahafo', 'woocommerce' ), 'AH' => __( 'Ashanti', 'woocommerce' ), @@ -477,7 +512,30 @@ return array( 'L' => __( 'South Aegean', 'woocommerce' ), 'M' => __( 'Crete', 'woocommerce' ), ), - 'GF' => array(), + 'GT' => array( // Guatemalan states. + 'AV' => __( 'Alta Verapaz', 'woocommerce' ), + 'BV' => __( 'Baja Verapaz', 'woocommerce' ), + 'CM' => __( 'Chimaltenango', 'woocommerce' ), + 'CQ' => __( 'Chiquimula', 'woocommerce' ), + 'PR' => __( 'El Progreso', 'woocommerce' ), + 'ES' => __( 'Escuintla', 'woocommerce' ), + 'GU' => __( 'Guatemala', 'woocommerce' ), + 'HU' => __( 'Huehuetenango', 'woocommerce' ), + 'IZ' => __( 'Izabal', 'woocommerce' ), + 'JA' => __( 'Jalapa', 'woocommerce' ), + 'JU' => __( 'Jutiapa', 'woocommerce' ), + 'PE' => __( 'Petén', 'woocommerce' ), + 'QZ' => __( 'Quetzaltenango', 'woocommerce' ), + 'QC' => __( 'Quiché', 'woocommerce' ), + 'RE' => __( 'Retalhuleu', 'woocommerce' ), + 'SA' => __( 'Sacatepéquez', 'woocommerce' ), + 'SM' => __( 'San Marcos', 'woocommerce' ), + 'SR' => __( 'Santa Rosa', 'woocommerce' ), + 'SO' => __( 'Sololá', 'woocommerce' ), + 'SU' => __( 'Suchitepéquez', 'woocommerce' ), + 'TO' => __( 'Totonicapán', 'woocommerce' ), + 'ZA' => __( 'Zacapa', 'woocommerce' ) + ), 'HK' => array( // Hong Kong states. 'HONG KONG' => __( 'Hong Kong Island', 'woocommerce' ), 'KOWLOON' => __( 'Kowloon', 'woocommerce' ), @@ -1304,7 +1362,6 @@ return array( 'VS' => __( 'Vaslui', 'woocommerce' ), 'VN' => __( 'Vrancea', 'woocommerce' ), ), - 'RS' => array(), 'SG' => array(), 'SK' => array(), 'SI' => array(), diff --git a/includes/admin/class-wc-admin-notices.php b/includes/admin/class-wc-admin-notices.php index 70c76ee6120..fa9716cc498 100644 --- a/includes/admin/class-wc-admin-notices.php +++ b/includes/admin/class-wc-admin-notices.php @@ -64,6 +64,51 @@ class WC_Admin_Notices { } } + /** + * Parses query to create nonces when available. + * + * @param object $response The WP_REST_Response we're working with. + * @return object $response The prepared WP_REST_Response object. + */ + public static function prepare_note_with_nonce( $response ) { + if ( 'wc-update-db-reminder' !== $response->data['name'] || ! isset( $response->data['actions'] ) ) { + return $response; + } + + foreach ( $response->data['actions'] as $action_key => $action ) { + $url_parts = ! empty( $action->query ) ? wp_parse_url( $action->query ) : ''; + + if ( ! isset( $url_parts['query'] ) ) { + continue; + } + + wp_parse_str( $url_parts['query'], $params ); + + if ( array_key_exists( '_nonce_action', $params ) && array_key_exists( '_nonce_name', $params ) ) { + $org_params = $params; + + // Check to make sure we're acting on the whitelisted nonce actions. + if ( 'wc_db_update' !== $params['_nonce_action'] && 'woocommerce_hide_notices_nonce' !== $params['_nonce_action'] ) { + continue; + } + + unset( $org_params['_nonce_action'] ); + unset( $org_params['_nonce_name'] ); + + $url = $url_parts['scheme'] . '://' . $url_parts['host'] . $url_parts['path']; + + $nonce = array( $params['_nonce_name'] => wp_create_nonce( $params['_nonce_action'] ) ); + $merged_params = array_merge( $nonce, $org_params ); + $parsed_query = add_query_arg( $merged_params, $url ); + + $response->data['actions'][ $action_key ]->query = $parsed_query; + $response->data['actions'][ $action_key ]->url = $parsed_query; + } + } + + return $response; + } + /** * Store notices to DB */ diff --git a/includes/admin/class-wc-admin-status.php b/includes/admin/class-wc-admin-status.php index 1742531c8c3..0092b8b4383 100644 --- a/includes/admin/class-wc-admin-status.php +++ b/includes/admin/class-wc-admin-status.php @@ -377,7 +377,7 @@ class WC_Admin_Status { private static function output_plugins_info( $plugins, $untested_plugins ) { $wc_version = Constants::get_constant( 'WC_VERSION' ); - if ( 'major' === WC_SSR_PLUGIN_UPDATE_RELEASE_VERSION_TYPE ) { + if ( 'major' === Constants::get_constant( 'WC_SSR_PLUGIN_UPDATE_RELEASE_VERSION_TYPE' ) ) { // Since we're only testing against major, we don't need to show minor and patch version. $wc_version = $wc_version[0] . '.0'; } diff --git a/includes/admin/meta-boxes/class-wc-meta-box-order-actions.php b/includes/admin/meta-boxes/class-wc-meta-box-order-actions.php index 6e68d641740..092493b4a29 100644 --- a/includes/admin/meta-boxes/class-wc-meta-box-order-actions.php +++ b/includes/admin/meta-boxes/class-wc-meta-box-order-actions.php @@ -118,7 +118,9 @@ class WC_Meta_Box_Order_Actions { WC()->payment_gateways(); WC()->shipping(); - WC()->mailer()->emails['WC_Email_New_Order']->trigger( $order->get_id(), $order ); + add_filter( 'woocommerce_new_order_email_allows_resend', '__return_true' ); + WC()->mailer()->emails['WC_Email_New_Order']->trigger( $order->get_id(), $order, true ); + remove_filter( 'woocommerce_new_order_email_allows_resend', '__return_true' ); do_action( 'woocommerce_after_resend_order_email', $order, 'new_order' ); diff --git a/includes/admin/notes/class-wc-notes-run-db-update.php b/includes/admin/notes/class-wc-notes-run-db-update.php index c723d231d06..1fad100ff9e 100644 --- a/includes/admin/notes/class-wc-notes-run-db-update.php +++ b/includes/admin/notes/class-wc-notes-run-db-update.php @@ -110,10 +110,13 @@ class WC_Notes_Run_Db_Update { */ private static function update_needed_notice( $note_id = null ) { $update_url = html_entity_decode( - wp_nonce_url( - add_query_arg( 'do_update_woocommerce', 'true', wc_get_current_admin_url() ? wc_get_current_admin_url() : admin_url( 'admin.php?page=wc-settings' ) ), - 'wc_db_update', - 'wc_db_update_nonce' + add_query_arg( + array( + 'do_update_woocommerce' => 'true', + '_nonce_action' => 'wc_db_update', + '_nonce_name' => 'wc_db_update_nonce', + ), + wc_get_current_admin_url() ? wc_get_current_admin_url() : admin_url( 'admin.php?page=wc-settings' ) ) ); @@ -206,14 +209,13 @@ class WC_Notes_Run_Db_Update { */ private static function update_done_notice( $note_id ) { $hide_notices_url = html_entity_decode( // to convert &s to normal &, otherwise produces invalid link. - wp_nonce_url( - add_query_arg( - 'wc-hide-notice', - 'update', - wc_get_current_admin_url() ? wc_get_current_admin_url() : admin_url( 'admin.php?page=wc-settings' ) + add_query_arg( + array( + 'wc-hide-notice' => 'update', + '_nonce_action' => 'woocommerce_hide_notices_nonce', + '_nonce_name' => '_wc_notice_nonce', ), - 'woocommerce_hide_notices_nonce', - '_wc_notice_nonce' + wc_get_current_admin_url() ? remove_query_arg( 'do_update_woocommerce', wc_get_current_admin_url() ) : admin_url( 'admin.php?page=wc-settings' ) ) ); diff --git a/includes/admin/plugin-updates/class-wc-plugin-updates.php b/includes/admin/plugin-updates/class-wc-plugin-updates.php index 50ca0fc799d..bb8c40af460 100644 --- a/includes/admin/plugin-updates/class-wc-plugin-updates.php +++ b/includes/admin/plugin-updates/class-wc-plugin-updates.php @@ -150,10 +150,15 @@ class WC_Plugin_Updates { * with the $new_version. * * @param string $new_version WooCommerce version to test against. - * @param string $release 'major' or 'minor'. + * @param string $release 'major', 'minor', or 'none'. * @return array of plugin info arrays */ public function get_untested_plugins( $new_version, $release ) { + // Since 5.0 all versions are backwards compatible. + if ( 'none' === $release ) { + return array(); + } + $extensions = array_merge( $this->get_plugins_with_header( self::VERSION_TESTED_HEADER ), $this->get_plugins_for_woocommerce() ); $untested = array(); $new_version_parts = explode( '.', $new_version ); diff --git a/includes/admin/plugin-updates/class-wc-plugins-screen-updates.php b/includes/admin/plugin-updates/class-wc-plugins-screen-updates.php index ad24e66848e..5920fb52616 100644 --- a/includes/admin/plugin-updates/class-wc-plugins-screen-updates.php +++ b/includes/admin/plugin-updates/class-wc-plugins-screen-updates.php @@ -42,9 +42,14 @@ class WC_Plugins_Screen_Updates extends WC_Plugin_Updates { * @param stdClass $response Plugin update response. */ public function in_plugin_update_message( $args, $response ) { + $version_type = Constants::get_constant( 'WC_SSR_PLUGIN_UPDATE_RELEASE_VERSION_TYPE' ); + if ( ! is_string( $version_type ) ) { + $version_type = 'none'; + } + $this->new_version = $response->new_version; $this->upgrade_notice = $this->get_upgrade_notice( $response->new_version ); - $this->major_untested_plugins = $this->get_untested_plugins( $response->new_version, 'major' ); + $this->major_untested_plugins = $this->get_untested_plugins( $response->new_version, $version_type ); $current_version_parts = explode( '.', Constants::get_constant( 'WC_VERSION' ) ); $new_version_parts = explode( '.', $this->new_version ); diff --git a/includes/admin/plugin-updates/views/html-notice-untested-extensions-modal.php b/includes/admin/plugin-updates/views/html-notice-untested-extensions-modal.php index 23c1fe21a19..bb1c58468b1 100644 --- a/includes/admin/plugin-updates/views/html-notice-untested-extensions-modal.php +++ b/includes/admin/plugin-updates/views/html-notice-untested-extensions-modal.php @@ -18,7 +18,7 @@ $untested_plugins_msg = sprintf( ?>
-

+

@@ -41,7 +41,7 @@ $untested_plugins_msg = sprintf(
-

+

diff --git a/includes/admin/settings/class-wc-settings-emails.php b/includes/admin/settings/class-wc-settings-emails.php index 9b4c524ebc5..a3da4c3f514 100644 --- a/includes/admin/settings/class-wc-settings-emails.php +++ b/includes/admin/settings/class-wc-settings-emails.php @@ -191,6 +191,22 @@ class WC_Settings_Emails extends WC_Settings_Page { 'id' => 'email_template_options', ), + array( + 'title' => __( 'Store management insights', 'woocommerce' ), + 'type' => 'title', + 'id' => 'email_merchant_notes', + ), + + array( + 'title' => __( 'Enable email insights', 'woocommerce' ), + 'desc' => __( 'Receive email notifications with additional guidance to complete the basic store setup and helpful insights', 'woocommerce' ), + 'id' => 'woocommerce_merchant_email_notifications', + 'type' => 'checkbox', + 'checkboxgroup' => 'start', + 'default' => 'yes', + 'autoload' => false, + ), + ) ); diff --git a/includes/admin/views/html-admin-page-reports.php b/includes/admin/views/html-admin-page-reports.php index a5ef713ee1a..8eb38322a06 100644 --- a/includes/admin/views/html-admin-page-reports.php +++ b/includes/admin/views/html-admin-page-reports.php @@ -9,6 +9,16 @@ if ( ! defined( 'ABSPATH' ) ) { ?>
+
+

+ + WooCommerce Analytics or learn more about the new experience in the WooCommerce Analytics documentation.', 'woocommerce' ), esc_url( wc_admin_url( '&path=/analytics/overview' ) ) ) ); + ?> + +

+