Merge branch 'trunk' into add/e2e-implement-describe-each

This commit is contained in:
rodelgc 2021-08-31 19:36:51 +08:00 committed by GitHub
commit ecac17817b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
123 changed files with 4700 additions and 4746 deletions

View File

@ -31,3 +31,7 @@ Closes # .
### Changelog entry
> Enter a summary of all changes on this Pull Request. This will appear in the changelog if accepted.
### FOR PR REVIEWER ONLY:
* [ ] I have reviewed that everything is sanitized/escaped appropriately for any SQL or XSS injection possibilities. I made sure Linting is not ignored or disabled.

View File

@ -9,6 +9,7 @@ jobs:
name: PHP ${{ matrix.php }} WP ${{ matrix.wp }}
timeout-minutes: 15
runs-on: ubuntu-latest
continue-on-error: ${{ matrix.wp == 'nightly' }}
strategy:
fail-fast: false
matrix:
@ -17,9 +18,9 @@ jobs:
include:
- wp: nightly
php: '7.4'
- wp: '5.5'
- wp: '5.7'
php: 7.2
- wp: '5.4'
- wp: '5.6'
php: 7.2
services:
database:
@ -64,8 +65,10 @@ jobs:
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
composer bin phpunit require --dev -W phpunit/phpunit:@dev --ignore-platform-reqs
rm -rf ./vendor/phpunit/
composer dump-autoload
fi
- name: Init DB and WP
run: ./tests/bin/install.sh woo_test root root 127.0.0.1 ${{ matrix.wp }}

View File

@ -6,6 +6,7 @@ jobs:
name: PHP ${{ matrix.php }} WP ${{ matrix.wp }}
timeout-minutes: 15
runs-on: ubuntu-latest
continue-on-error: ${{ matrix.wp == 'nightly' }}
strategy:
fail-fast: false
matrix:
@ -14,9 +15,9 @@ jobs:
include:
- wp: nightly
php: '7.4'
- wp: '5.5'
- wp: '5.7'
php: 7.2
- wp: '5.4'
- wp: '5.6'
php: 7.2
services:
database:
@ -61,8 +62,10 @@ jobs:
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
composer bin phpunit require --dev -W phpunit/phpunit:@dev --ignore-platform-reqs
rm -rf ./vendor/phpunit/
composer dump-autoload
fi
- name: Init DB and WP
run: ./tests/bin/install.sh woo_test root root 127.0.0.1 ${{ matrix.wp }}

View File

@ -1,32 +1,42 @@
name: "Pull request post-merge processing"
on:
pull_request:
on:
pull_request_target:
types: [closed]
jobs:
assign-milestone:
name: "Assign milestone to merged pull request"
if: github.event.pull_request.merged == true && ! github.event.pull_request.milestone
process-pull-request-after-merge:
name: "Process a pull request after it's merged"
if: github.event.pull_request.merged == true
runs-on: ubuntu-latest
steps:
- name: "Get the milestone changer script"
run: |
curl \
--silent \
--fail \
--header 'Authorization: bearer ${{ secrets.GITHUB_TOKEN }}' \
--header 'User-Agent: GitHub action to set the milestone for a pull request' \
--header 'Accept: application/vnd.github.v3.raw' \
--remote-name \
--location $GITHUB_API_URL/repos/${{ github.repository }}/contents/.github/workflows/scripts/assign-milestone-to-merged-pr.php
env:
GITHUB_API_URL: ${{ env.GITHUB_API_URL }}
- name: "Install PHP"
uses: shivammathur/setup-php@v2
with:
php-version: '7.4'
- name: "Run the milestone changer script"
run: php assign-milestone-to-merged-pr.php
env:
PULL_REQUEST_ID: ${{ github.event.pull_request.node_id }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: "Get the action scripts"
run: |
scripts="assign-milestone-to-merged-pr.php add-post-merge-comment.php post-request-shared.php"
for script in $scripts
do
curl \
--silent \
--fail \
--header 'Authorization: bearer ${{ secrets.GITHUB_TOKEN }}' \
--header 'User-Agent: GitHub action to set the milestone for a pull request' \
--header 'Accept: application/vnd.github.v3.raw' \
--output $script \
--location "$GITHUB_API_URL/repos/${{ github.repository }}/contents/.github/workflows/scripts/$script?ref=${{ github.event.pull_request.base.ref }}"
done
env:
GITHUB_API_URL: ${{ env.GITHUB_API_URL }}
- name: "Install PHP"
uses: shivammathur/setup-php@v2
with:
php-version: '7.4'
- name: "Run the script to assign a milestone"
if: "!github.event.pull_request.milestone"
run: php assign-milestone-to-merged-pr.php
env:
PULL_REQUEST_ID: ${{ github.event.pull_request.node_id }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: "Run the script to post a comment with next steps hint"
run: php add-post-merge-comment.php
env:
PULL_REQUEST_ID: ${{ github.event.pull_request.node_id }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

View File

@ -0,0 +1,95 @@
<?php
/**
* Script to automatically add a comment to a pull request when it's merged.
*
* @package WooCommerce/GithubActions
*/
// phpcs:disable WordPress.Security.EscapeOutput.OutputNotEscaped, WordPress.WP.AlternativeFunctions
require_once __DIR__ . '/post-request-shared.php';
/*
* Get the merger login name.
*/
echo 'Retrieving the merger user name... ';
$get_pr_merged_username_query = "
node(id: \"$pr_id\") {
... on PullRequest {
timelineItems(first: 1, itemTypes: MERGED_EVENT) {
edges {
node {
... on MergedEvent {
actor {
login
}
}
}
}
}
}
}";
$result = do_graphql_api_request( $get_pr_merged_username_query );
if ( is_array( $result ) ) {
if ( empty( $result['errors'] ) ) {
echo "Ok!\n";
} else {
echo "\n*** Errors found while retrieving the merger user name:\n";
echo var_dump( $result['errors'] );
return;
}
} else {
echo "\n*** Error found while retrieving the merger user name: file_get_contents returned the following:\n";
echo var_dump( $result );
return;
}
$merger_user_name = $result['data']['node']['timelineItems']['edges'][0]['node']['actor']['login'];
echo "The pull request was merged by: $merger_user_name\n";
/*
* Post the comment.
*/
$comment_body = "Hi @$merger_user_name, thanks for merging this pull request. Please take a look at these follow-up tasks you may need to perform:
- [ ] Add the `status: needs changelog` label
- [ ] Add the `status: needs testing instructions` label";
$add_comment_mutation = "
addComment(input: {subjectId: \"$pr_id\", body: \"$comment_body\", clientMutationId: \"$github_token\"}) {
commentEdge {
node {
id
databaseId
url
}
}
}";
echo 'Publishing the comment... ';
$result = do_graphql_api_request( $add_comment_mutation, true );
if ( is_array( $result ) ) {
if ( empty( $result['errors'] ) ) {
echo "Ok!\n";
} else {
echo "\n*** Errors found while publishing the comment:\n";
echo var_dump( $result['errors'] );
return;
}
} else {
echo "\n*** Error found while publishing the comment: file_get_contents returned the following:\n";
echo var_dump( $result );
return;
}
$comment_url = $result['data']['addComment']['commentEdge']['node']['url'];
echo "Comment URL: $comment_url\n";
// phpcs:enable WordPress.Security.EscapeOutput.OutputNotEscaped, WordPress.WP.AlternativeFunctions

View File

@ -7,21 +7,9 @@
// phpcs:disable WordPress.Security.EscapeOutput.OutputNotEscaped, WordPress.WP.AlternativeFunctions
global $repo_owner, $repo_name, $github_token, $graphql_api_url;
require_once __DIR__ . '/post-request-shared.php';
/**
* Grab/process input.
*/
$repo_parts = explode( '/', getenv( 'GITHUB_REPOSITORY' ) );
$repo_owner = $repo_parts[0];
$repo_name = $repo_parts[1];
$pr_id = getenv( 'PULL_REQUEST_ID' );
$github_token = getenv( 'GITHUB_TOKEN' );
$graphql_api_url = getenv( 'GITHUB_GRAPHQL_URL' );
/**
/*
* Select the milestone to be added:
*
* 1. Get the first 10 milestones sorted by creation date descending.
@ -85,6 +73,7 @@ foreach ( $milestones as $milestone ) {
// If all the milestones have a release branch, just take the newest one.
if ( is_null( $chosen_milestone ) ) {
echo "WARNING: No milestone without release branch found, the newest one will be assigned.\n";
$chosen_milestone = $milestones[0];
}
@ -121,35 +110,4 @@ if ( is_array( $result ) ) {
echo var_dump( $result );
}
/**
* Function to query the GitHub GraphQL API.
*
* @param string $body The GraphQL-formatted request body, without "query" or "mutation" wrapper.
* @param bool $is_mutation True if the request is a mutation, false if it's a query.
* @return mixed The json-decoded response if a response is received, 'false' (or whatever file_get_contents returns) otherwise.
*/
function do_graphql_api_request( $body, $is_mutation = false ) {
global $github_token, $graphql_api_url;
$keyword = $is_mutation ? 'mutation' : 'query';
$data = array( 'query' => "$keyword { $body }" );
$context = stream_context_create(
array(
'http' => array(
'method' => 'POST',
'header' => array(
'Accept: application/json',
'Content-Type: application/json',
'User-Agent: GitHub action to set the milestone for a pull request',
'Authorization: bearer ' . $github_token,
),
'content' => json_encode( $data ),
),
)
);
$result = file_get_contents( $graphql_api_url, false, $context );
return is_string( $result ) ? json_decode( $result, true ) : $result;
}
// phpcs:enable WordPress.Security.EscapeOutput.OutputNotEscaped, WordPress.WP.AlternativeFunctions

View File

@ -0,0 +1,56 @@
<?php
/**
* Common code for the post-merge GitHub action scripts.
*
* @package WooCommerce/GithubActions
*/
// phpcs:disable WordPress.Security.EscapeOutput.OutputNotEscaped, WordPress.WP.AlternativeFunctions
global $repo_owner, $repo_name, $github_token, $graphql_api_url;
/*
* Grab/process input.
*/
$repo_parts = explode( '/', getenv( 'GITHUB_REPOSITORY' ) );
$repo_owner = $repo_parts[0];
$repo_name = $repo_parts[1];
$pr_id = getenv( 'PULL_REQUEST_ID' );
$github_token = getenv( 'GITHUB_TOKEN' );
$graphql_api_url = getenv( 'GITHUB_GRAPHQL_URL' );
/**
* Function to query the GitHub GraphQL API.
*
* @param string $body The GraphQL-formatted request body, without "query" or "mutation" wrapper.
* @param bool $is_mutation True if the request is a mutation, false if it's a query.
* @return mixed The json-decoded response if a response is received, 'false' (or whatever file_get_contents returns) otherwise.
*/
function do_graphql_api_request( $body, $is_mutation = false ) {
global $github_token, $graphql_api_url;
$keyword = $is_mutation ? 'mutation' : 'query';
$data = array( 'query' => "$keyword { $body }" );
$context = stream_context_create(
array(
'http' => array(
'method' => 'POST',
'header' => array(
'Accept: application/json',
'Content-Type: application/json',
'User-Agent: GitHub action to set the milestone for a pull request',
'Authorization: bearer ' . $github_token,
),
'content' => json_encode( $data ),
),
)
);
$result = file_get_contents( $graphql_api_url, false, $context );
return is_string( $result ) ? json_decode( $result, true ) : $result;
}
// phpcs:enable WordPress.Security.EscapeOutput.OutputNotEscaped, WordPress.WP.AlternativeFunctions

View File

@ -32,6 +32,7 @@ jobs:
SMOKE_TEST_URL: ${{ secrets.SMOKE_TEST_URL }}
SMOKE_TEST_ADMIN_USER: ${{ secrets.SMOKE_TEST_ADMIN_USER }}
SMOKE_TEST_ADMIN_PASSWORD: ${{ secrets.SMOKE_TEST_ADMIN_PASSWORD }}
SMOKE_TEST_ADMIN_USER_EMAIL: ${{ secrets.SMOKE_TEST_ADMIN_USER_EMAIL }}
SMOKE_TEST_CUSTOMER_USER: ${{ secrets.SMOKE_TEST_CUSTOMER_USER }}
SMOKE_TEST_CUSTOMER_PASSWORD: ${{ secrets.SMOKE_TEST_CUSTOMER_PASSWORD }}
WC_E2E_SCREENSHOTS: 1
@ -39,6 +40,7 @@ jobs:
E2E_SLACK_TOKEN: ${{ secrets.SMOKE_TEST_SLACK_TOKEN }}
E2E_SLACK_CHANNEL: ${{ secrets.SMOKE_TEST_SLACK_CHANNEL }}
UPDATE_WC: 1
DEFAULT_TIMEOUT_OVERRIDE: 120000
run: |
npx wc-e2e test:e2e ./tests/e2e/specs/smoke-tests/update-woocommerce.js
npx wc-e2e test:e2e

View File

@ -0,0 +1,47 @@
name: Smoke test release
on:
release:
types: [published]
jobs:
login-run:
name: Daily smoke test on release.
runs-on: ubuntu-18.04
steps:
- name: Create dirs.
run: |
mkdir -p code/woocommerce
mkdir -p package/woocommerce
mkdir -p tmp/woocommerce
mkdir -p node_modules
- name: Checkout code.
uses: actions/checkout@v2
with:
ref: trunk
- name: Install prerequisites.
run: |
npm install
composer install --no-dev
npm run build:assets
npm install jest
- name: Run smoke test.
env:
SMOKE_TEST_URL: ${{ secrets.RELEASE_TEST_URL }}
SMOKE_TEST_ADMIN_USER: ${{ secrets.RELEASE_TEST_ADMIN_USER }}
SMOKE_TEST_ADMIN_PASSWORD: ${{ secrets.RELEASE_TEST_ADMIN_PASSWORD }}
SMOKE_TEST_ADMIN_USER_EMAIL: ${{ secrets.RELEASE_TEST_ADMIN_USER_EMAIL }}
SMOKE_TEST_CUSTOMER_USER: ${{ secrets.RELEASE_TEST_CUSTOMER_USER }}
SMOKE_TEST_CUSTOMER_PASSWORD: ${{ secrets.RELEASE_TEST_CUSTOMER_PASSWORD }}
WC_E2E_SCREENSHOTS: 1
E2E_RETEST: 1
E2E_SLACK_TOKEN: ${{ secrets.SMOKE_TEST_SLACK_TOKEN }}
E2E_SLACK_CHANNEL: ${{ secrets.SMOKE_TEST_SLACK_CHANNEL }}
TEST_RELEASE: 1
UPDATE_WC: 1
DEFAULT_TIMEOUT_OVERRIDE: 120000
run: |
npx wc-e2e test:e2e ./tests/e2e/specs/smoke-tests/update-woocommerce.js
npx wc-e2e test:e2e

View File

@ -5,6 +5,8 @@ on:
jobs:
stale:
if: |
! contains(github.event.issue.labels.*.name, 'enhancement')
runs-on: ubuntu-latest
steps:
- uses: actions/stale@v3

View File

@ -1,4 +1,3 @@
/**
* admin.scss
* General WooCommerce admin styles. Settings, product data tabs, reports, etc.
@ -20,40 +19,190 @@
@include loader();
}
.wc_addons_wrap {
max-width: 1200px;
.wc-addons-wrap {
.marketplace-header {
background-image: url(../images/marketplace-header-bg@2x.png);
background-position: right;
background-size: cover;
box-sizing: border-box;
display: flex;
flex-direction: column;
justify-content: center;
min-height: 216px;
padding: 24px 16px;
width: 100%;
&__title {
color: #fff;
font-size: 32px;
font-style: normal;
font-weight: 400;
line-height: 1.15;
margin-bottom: 8px;
padding: 0;
}
&__description {
color: #fff;
font-size: 16px;
line-height: 24px;
margin-bottom: 24px;
margin-top: 0;
}
&__search-form {
clear: both;
display: block;
max-width: 318px;
position: relative;
input {
border: 1px solid #ddd;
box-shadow: none;
font-size: 13px;
height: 48px;
padding-left: 16px;
padding-right: 50px;
width: 100%;
margin: 0;
}
button {
background: none;
border: none;
cursor: pointer;
height: 48px;
position: absolute;
right: 0;
width: 53px;
}
}
}
.top-bar {
background: #fff;
box-shadow: inset 0 -1px 0 #ccc;
display: block;
height: 60px;
margin: 0 0 16px;
@media only screen and ( min-width: 768px ) {
margin-bottom: 24px;
}
.current-section-dropdown {
position: relative;
width: 100%;
@media only screen and ( min-width: 600px ) {
margin-left: 70px;
width: 288px;
}
}
.current-section-name {
cursor: pointer;
font-weight: 600;
font-size: 14px;
line-height: 20px;
padding: 20px 16px;
position: relative;
}
.current-section-name::after {
background-image: url(../images/icons/gridicons-chevron-down.svg);
background-size: contain;
content: "";
display: block;
height: 20px;
position: absolute;
right: 20px;
top: 20px;
width: 20px;
}
ul {
background: #fff;
border-radius: 2px;
display: none;
flex-direction: column;
justify-content: left;
left: 0;
margin: 0;
padding: 14px 0;
position: absolute;
top: 50px;
width: 100%;
z-index: 10;
@media only screen and ( min-width: 600px ) {
border: 1px solid #1e1e1e;
}
@media only screen and ( min-width: 1100px ) {
justify-content: center;
}
li {
font-size: 13px;
line-height: 16px;
margin: 0;
}
a,
a:visited,
a:hover,
a:focus {
border: none;
box-shadow: none;
box-sizing: border-box;
color: #1e1e1e;
display: inline-block;
text-decoration: none;
outline: none;
padding: 14px 18px;
position: relative;
width: 100%;
@media only screen and ( min-width: 600px ) {
padding: 10px 18px;
}
}
a.current::after {
background-image: url(../images/icons/gridicons-checkmark.svg);
content: "";
display: block;
height: 20px;
position: absolute;
right: 20px;
top: 7px;
width: 20px;
}
}
.current-section-dropdown:hover,
.current-section-dropdown.is-open {
ul {
display: flex;
}
.current-section-name::after {
transform: rotate(0.5turn);
}
}
}
h1.search-form-title {
clear: left;
font-size: 20px;
line-height: 1.2;
margin: 48px 0 16px;
padding: 0;
}
form.search-form {
clear: both;
display: block;
position: relative;
margin-top: 1em;
margin-bottom: 1em;
input {
border: 1px solid #ddd;
box-shadow: none;
height: 53px;
padding-left: 50px;
width: 100%;
margin: 0;
}
button {
background: none;
border: none;
cursor: pointer;
height: 53px;
position: absolute;
width: 53px;
}
}
.update-plugins .update-count {
background-color: #d54e21;
border-radius: 10px;
@ -83,6 +232,18 @@
content: "";
}
.addons-button {
border-radius: 3px;
cursor: pointer;
display: block;
height: 37px;
line-height: 37px;
margin-top: 16px;
text-align: center;
text-decoration: none;
width: 124px;
}
.addons-banner-block-item-icon,
.addons-column-block-item-icon {
align-items: center;
@ -149,6 +310,16 @@
align-items: center;
}
.addons-promotion-block {
display: flex;
padding: 20px;
.addons-img {
height: auto;
width: 200px;
}
}
.addons-wcs-banner-block-image {
background: #f7f7f7;
border: 1px solid #e6e6e6;
@ -173,16 +344,6 @@
}
}
.addons-promotion-block {
display: flex;
padding: 20px;
.addons-img {
height: auto;
width: 200px;
}
}
.addons-promotion-block-content {
display: flex;
flex-direction: column;
@ -343,11 +504,11 @@
display: none;
}
.addons-banner-block-item:nth-child(-n+3) {
.addons-banner-block-item:nth-child(-n + 3) {
display: block;
}
.addons-column-block-item:nth-of-type(-n+3) {
.addons-column-block-item:nth-of-type(-n + 3) {
display: flex;
}
@ -416,17 +577,6 @@
width: 48%;
}
.addons-button {
border-radius: 3px;
cursor: pointer;
display: block;
height: 37px;
line-height: 37px;
text-align: center;
text-decoration: none;
width: 124px;
}
.addons-button-solid {
background-color: #674399;
color: #fff;
@ -506,81 +656,105 @@
}
}
.marketplace-content-wrapper {
margin: 0 auto;
max-width: 1032px;
width: 100%;
}
.products {
overflow: hidden;
display: flex;
flex-flow: row;
flex-wrap: wrap;
margin: 0 -0.5em;
justify-content: space-between;
margin: 0;
max-width: 1032px;
overflow: hidden;
li {
float: left;
border: 1px solid #ddd;
margin: 0 0.5em 1em !important;
padding: 0;
vertical-align: top;
width: 25%;
background: #fff;
border: 1px solid #dcdcde;
border-radius: 2px;
display: flex;
flex: 1 0 auto;
flex-direction: column;
justify-content: space-between;
margin: 12px 0;
max-width: calc(50% - 12px);
min-width: 280px;
min-height: 220px;
flex: 1;
overflow: hidden;
background: #f5f5f5;
box-shadow:
inset 0 1px 0 rgba(255, 255, 255, 0.2),
inset 0 -1px 0 rgba(0, 0, 0, 0.1);
padding: 0;
vertical-align: top;
@media only screen and ( max-width: 768px ) {
max-width: none;
width: 100%;
}
a {
text-decoration: none;
color: inherit;
display: block;
height: 100%;
}
.product-details {
padding: 24px;
.product-img-wrap {
background: #fff;
display: block;
}
float: right;
margin-left: 24px;
img {
max-width: 258px;
max-height: 24px;
padding: 17px 20px;
display: block;
margin: 0;
background: #fff;
border-right: 260px solid #fff;
}
img.extension-thumb + h3 {
display: none;
}
.price {
display: none;
img {
border-radius: 3px;
display: block;
margin: 0;
max-width: 48px;
max-height: 48px;
}
}
h2,
h3 {
color: #007cba;
font-family:
HelveticaNeue-Light,
"Helvetica Neue Light",
"Helvetica Neue",
sans-serif;
font-size: 20px;
font-weight: 400;
line-height: 28px;
margin: 0 !important;
padding: 20px !important;
background: #fff;
}
p {
padding: 20px !important;
margin: 0 !important;
border-top: 1px solid #f1f1f1;
color: #2c3338;
margin: 14px 64px 0 0;
max-width: 389px;
}
}
.product-footer {
border-top: 1px solid #dcdcde;
padding: 24px;
.price {
font-size: 16px;
color: #1d2327;
}
&:hover,
&:focus {
.button {
background-color: #fff;
border-color: #007cba;
color: #007cba;
float: right;
}
}
}
}
.storefront {
background: url("../images/storefront-bg.jpg") bottom right #f6f6f6;
background: url(../images/storefront-bg.jpg) bottom right #f6f6f6;
border: 1px solid #ddd;
margin-top: 1em;
padding: 20px;
@ -601,6 +775,43 @@
}
}
.wc-subscriptions-wrap {
max-width: 1200px;
}
.woocommerce-page-wc-marketplace {
.notice {
margin-left: 20px;
margin-right: 20px;
}
&.woocommerce-page {
.wrap {
margin-top: 32px;
}
}
}
.woocommerce-page-wc-subscriptions {
#wpbody-content {
.screen-reader-text + .notice {
margin-top: 32px;
}
}
}
.woocommerce-embed-page.woocommerce-page-wc-marketplace {
#screen-meta-links {
position: absolute;
right: 0;
}
}
.woocommerce-message,
.woocommerce-BlankState {
@ -610,7 +821,11 @@
border-color: #a36597;
box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 1px 0 #a36597;
color: #fff;
text-shadow: 0 -1px 1px #a36597, 1px 0 1px #a36597, 0 1px 1px #a36597, -1px 0 1px #a36597;
text-shadow:
0 -1px 1px #a36597,
1px 0 1px #a36597,
0 1px 1px #a36597,
-1px 0 1px #a36597;
display: inline-block;
&:hover,
@ -719,7 +934,7 @@ mark.amount {
&::after {
@include icon_dashicons( "\f223" );
@include icon_dashicons("\f223");
cursor: help;
}
}
@ -845,7 +1060,6 @@ table.wc_status_table--tools {
}
}
/**
* DB log viewer
*/
@ -904,7 +1118,7 @@ table.wc_status_table--tools {
}
// Adjust log table columns only when table is not collapsed
@media screen and ( min-width: 783px ) {
@media screen and (min-width: 783px) {
.column-timestamp {
width: 18%;
@ -1095,7 +1309,7 @@ ul.wc_coupon_list {
&::before {
@include icon_dashicons( "\f158" );
@include icon_dashicons("\f158");
}
&:hover::before {
@ -1139,7 +1353,7 @@ ul.wc_coupon_list_block {
&::after {
@include icon_dashicons( "\f345" );
@include icon_dashicons("\f345");
line-height: 28px;
}
}
@ -1162,7 +1376,11 @@ ul.wc_coupon_list_block {
h2 {
margin: 0;
font-family: "HelveticaNeue-Light", "Helvetica Neue Light", "Helvetica Neue", sans-serif;
font-family:
"HelveticaNeue-Light",
"Helvetica Neue Light",
"Helvetica Neue",
sans-serif;
font-size: 21px;
font-weight: normal;
line-height: 1.2;
@ -1186,7 +1404,11 @@ ul.wc_coupon_list_block {
p.order_number {
margin: 0;
font-family: "HelveticaNeue-Light", "Helvetica Neue Light", "Helvetica Neue", sans-serif;
font-family:
"HelveticaNeue-Light",
"Helvetica Neue Light",
"Helvetica Neue",
sans-serif;
font-weight: normal;
line-height: 1.6em;
font-size: 16px;
@ -1663,7 +1885,7 @@ ul.wc_coupon_list_block {
&::before {
@include icon_dashicons( "\f128" );
@include icon_dashicons("\f128");
width: 38px;
line-height: 38px;
display: block;
@ -1911,7 +2133,7 @@ ul.wc_coupon_list_block {
&::before {
@include icon( "\e007" );
@include icon("\e007");
color: #ccc;
}
}
@ -1926,7 +2148,7 @@ ul.wc_coupon_list_block {
&::before {
@include icon( "\e014" );
@include icon("\e014");
color: #ccc;
}
}
@ -1943,7 +2165,7 @@ ul.wc_coupon_list_block {
&::before {
@include icon( "\e01a" );
@include icon("\e01a");
color: #ccc;
}
}
@ -1972,7 +2194,7 @@ ul.wc_coupon_list_block {
&::before {
@include icon_dashicons( "\f153" );
@include icon_dashicons("\f153");
color: #999;
}
@ -1994,7 +2216,7 @@ ul.wc_coupon_list_block {
&::before {
@include icon_dashicons( "\f171" );
@include icon_dashicons("\f171");
position: relative;
top: auto;
left: auto;
@ -2050,7 +2272,7 @@ ul.wc_coupon_list_block {
.edit-order-item::before {
@include icon_dashicons( "\f464" );
@include icon_dashicons("\f464");
position: relative;
}
@ -2059,7 +2281,7 @@ ul.wc_coupon_list_block {
&::before {
@include icon_dashicons( "\f158" );
@include icon_dashicons("\f158");
position: relative;
}
@ -2427,12 +2649,11 @@ ul.wc_coupon_list_block {
&::before {
@include icon( "\e010" );
@include icon("\e010");
line-height: 16px;
font-size: 14px;
vertical-align: middle;
top: 4px;
}
&:hover {
@ -2717,7 +2938,7 @@ ul.wc_coupon_list_block {
}
}
.wc_addons_wrap {
.wc-addons-wrap {
.addons-promotion-block {
flex-direction: column;
@ -2750,7 +2971,7 @@ ul.wc_coupon_list_block {
&::after {
@include icon( "\e026" );
@include icon("\e026");
line-height: 16px;
}
}
@ -2763,7 +2984,7 @@ ul.wc_coupon_list_block {
&::after {
@include icon( "\e027" );
@include icon("\e027");
line-height: 16px;
}
}
@ -3000,7 +3221,7 @@ table.wp-list-table {
&::before {
@include icon_dashicons( "\f128" );
@include icon_dashicons("\f128");
}
}
@ -3155,8 +3376,8 @@ table.wc_input_table {
background: #fff;
cursor: default;
input[type=text],
input[type=number] {
input[type="text"],
input[type="number"] {
width: 100% !important;
min-width: 100px;
padding: 8px 10px;
@ -3600,10 +3821,16 @@ table.wc-shipping-classes {
.button-primary {
background-color: #804877;
border-color: #804877;
box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 0 rgba(0, 0, 0, 0.15);
box-shadow:
inset 0 1px 0 rgba(255, 255, 255, 0.2),
0 1px 0 rgba(0, 0, 0, 0.15);
margin: 0;
opacity: 1;
text-shadow: 0 -1px 1px #8a4f7f, 1px 0 1px #8a4f7f, 0 1px 1px #8a4f7f, -1px 0 1px #8a4f7f;
text-shadow:
0 -1px 1px #8a4f7f,
1px 0 1px #8a4f7f,
0 1px 1px #8a4f7f,
-1px 0 1px #8a4f7f;
font-size: 1.5em;
padding: 0.75em 1em;
height: auto;
@ -3965,19 +4192,19 @@ img.help_tip {
.status-manual::before {
@include icon( "\e008" );
@include icon("\e008");
color: #999;
}
.status-enabled::before {
@include icon( "\e015" );
@include icon("\e015");
color: $woocommerce;
}
.status-disabled::before {
@include icon( "\e013" );
@include icon("\e013");
color: #ccc;
}
@ -4260,7 +4487,6 @@ img.help_tip {
}
table.form-table {
// Give regular settings inputs a standard width and padding.
textarea,
input[type="text"],
@ -4396,7 +4622,7 @@ img.help_tip {
&::after {
@include icon_dashicons( "\f161" );
@include icon_dashicons("\f161");
font-size: 2.618em;
line-height: 72px;
color: #ddd;
@ -4438,7 +4664,7 @@ img.help_tip {
&::before {
@include icon_dashicons( "\f153" );
@include icon_dashicons("\f153");
color: #999;
background: #fff;
border-radius: 50%;
@ -4625,7 +4851,7 @@ img.help_tip {
&::before {
@include iconbeforedashicons( "\f107" );
@include iconbeforedashicons("\f107");
}
}
@ -4692,8 +4918,8 @@ img.help_tip {
*/
.woocommerce_page_wc-settings {
input[type=url],
input[type=email] {
input[type="url"],
input[type="email"] {
direction: ltr;
}
@ -4709,7 +4935,7 @@ img.help_tip {
.add.button::before {
@include iconbefore( "\e007" );
@include iconbefore("\e007");
}
}
@ -4825,7 +5051,7 @@ img.help_tip {
&::before {
@include icon_dashicons( "\f153" );
@include icon_dashicons("\f153");
color: #999;
}
@ -5450,7 +5676,7 @@ img.help_tip {
padding: 4px 1em 2px 0;
}
input[type=checkbox] {
input[type="checkbox"] {
margin: 0 5px 0 0.5em !important;
vertical-align: middle;
}
@ -5549,7 +5775,6 @@ img.tips {
/*rtl:ignore*/
left: 0;
&.tip_top {
padding-bottom: 5px;
@ -5740,7 +5965,7 @@ img.ui-datepicker-trigger {
&::before {
@include iconbeforedashicons( "\f346" );
@include iconbeforedashicons("\f346");
margin-right: 4px;
}
}
@ -5867,7 +6092,7 @@ img.ui-datepicker-trigger {
&::after {
@include iconafter( "\e035" );
@include iconafter("\e035");
float: right;
font-size: 0.9em;
line-height: 1.618;
@ -5991,7 +6216,11 @@ img.ui-datepicker-trigger {
color: #464646;
font-weight: normal;
display: block;
font-family: "HelveticaNeue-Light", "Helvetica Neue Light", "Helvetica Neue", sans-serif;
font-family:
"HelveticaNeue-Light",
"Helvetica Neue Light",
"Helvetica Neue",
sans-serif;
del {
color: #e74c3c;
@ -6202,27 +6431,27 @@ table.bar_chart {
.post-type-shop_order .woocommerce-BlankState-message::before {
@include icon( "\e01d" );
@include icon("\e01d");
}
.post-type-shop_coupon .woocommerce-BlankState-message::before {
@include icon( "\e600" );
@include icon("\e600");
}
.post-type-product .woocommerce-BlankState-message::before {
@include icon( "\e006" );
@include icon("\e006");
}
.woocommerce-BlankState--api .woocommerce-BlankState-message::before {
@include icon( "\e01c" );
@include icon("\e01c");
}
.woocommerce-BlankState--webhooks .woocommerce-BlankState-message::before {
@include icon( "\e01b" );
@include icon("\e01b");
}
.woocommerce-BlankState {
@ -6238,7 +6467,9 @@ table.bar_chart {
&::before {
color: #ddd;
text-shadow: 0 -1px 1px rgba(0, 0, 0, 0.2), 0 1px 0 rgba(255, 255, 255, 0.8);
text-shadow:
0 -1px 1px rgba(0, 0, 0, 0.2),
0 1px 0 rgba(255, 255, 255, 0.8);
font-size: 8em;
display: block;
position: relative !important;
@ -6325,7 +6556,6 @@ table.bar_chart {
}
}
.woocommerce_variations,
.woocommerce_options_panel {
@ -6513,7 +6743,7 @@ table.bar_chart {
flex-direction: column;
}
.wc_addons_wrap {
.wc-addons-wrap {
.addons-wcs-banner-block {
padding: 40px;
@ -6911,7 +7141,9 @@ table.bar_chart {
right: 1px;
height: 28px;
width: 23px;
background: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M5%206l5%205%205-5%202%201-7%207-7-7%202-1z%22%20fill%3D%22%23555%22%2F%3E%3C%2Fsvg%3E") no-repeat right 5px top 55%;
background:
url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M5%206l5%205%205-5%202%201-7%207-7-7%202-1z%22%20fill%3D%22%23555%22%2F%3E%3C%2Fsvg%3E")
no-repeat right 5px top 55%;
background-size: 16px 16px;
@media only screen and (max-width: 782px) {
@ -6941,7 +7173,6 @@ table.bar_chart {
padding: 0 0 0 3px;
min-height: 28px;
}
}
.woocommerce table.form-table .select2-container {
@ -6980,11 +7211,10 @@ table.bar_chart {
midnight: #e14d43,
ocean: #9ebaa0,
sunrise: #dd823b,
light: #04a4cc
light: #04a4cc,
);
@each $name, $color in $wp_admin_colors {
&-#{$name}.wc-wp-version-gte-53 {
.select2-dropdown {
@ -7003,22 +7233,26 @@ table.bar_chart {
color: $color;
}
.select2-container.select2-container--focus .select2-selection--single,
.select2-container.select2-container--open .select2-selection--single,
.select2-container.select2-container--open .select2-selection--multiple {
.select2-container.select2-container--focus
.select2-selection--single,
.select2-container.select2-container--open
.select2-selection--single,
.select2-container.select2-container--open
.select2-selection--multiple {
border-color: $color;
box-shadow: 0 0 0 1px $color;
}
.select2-container--default .select2-results__option--highlighted[aria-selected],
.select2-container--default .select2-results__option--highlighted[data-selected] {
.select2-container--default
.select2-results__option--highlighted[aria-selected],
.select2-container--default
.select2-results__option--highlighted[data-selected] {
background-color: $color;
}
}
}
}
.post-type-product .tablenav,
.post-type-shop_order .tablenav {
@ -7117,9 +7351,15 @@ table.bar_chart {
border-radius: 4px;
background-color: #bb77ae;
border-color: #a36597;
-webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 1px 0 #a36597;
-webkit-box-shadow:
inset 0 1px 0 rgba(255, 255, 255, 0.25),
0 1px 0 #a36597;
box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 1px 0 #a36597;
text-shadow: 0 -1px 1px #a36597, 1px 0 1px #a36597, 0 1px 1px #a36597, -1px 0 1px #a36597;
text-shadow:
0 -1px 1px #a36597,
1px 0 1px #a36597,
0 1px 1px #a36597,
-1px 0 1px #a36597;
margin: 0;
opacity: 1;
@ -7128,7 +7368,9 @@ table.bar_chart {
&:active {
background: #a36597;
border-color: #a36597;
-webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 1px 0 #a36597;
-webkit-box-shadow:
inset 0 1px 0 rgba(255, 255, 255, 0.25),
0 1px 0 #a36597;
box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 1px 0 #a36597;
}
}
@ -7396,7 +7638,7 @@ table.bar_chart {
&::before {
@include icon( "\e015" );
@include icon("\e015");
color: #a16696;
position: static;
font-size: 100px;
@ -7423,3 +7665,13 @@ table.bar_chart {
color: darkred;
font-weight: bold;
}
@media screen and (min-width: 600px) {
.wc-addons-wrap {
.marketplace-header {
padding-left: 84px;
}
}
}

View File

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><rect x="0" fill="none" width="24" height="24"/><g><path d="M9 19.414l-6.707-6.707 1.414-1.414L9 16.586 20.293 5.293l1.414 1.414"/></g></svg>

After

Width:  |  Height:  |  Size: 201 B

View File

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><rect x="0" fill="none" width="24" height="24"/><g><path d="M20 9l-8 8-8-8 1.414-1.414L12 14.172l6.586-6.586"/></g></svg>

After

Width:  |  Height:  |  Size: 181 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 309 KiB

View File

@ -177,12 +177,22 @@ jQuery( function( $ ) {
*/
set_menu_order: function( event ) {
event.preventDefault();
var $menu_order = $( this ).closest( '.woocommerce_variation' ).find('.variation_menu_order');
var $menu_order = $( this ).closest( '.woocommerce_variation' ).find( '.variation_menu_order' );
var variation_id = $( this ).closest( '.woocommerce_variation' ).find( '.variable_post_id' ).val();
var value = window.prompt( woocommerce_admin_meta_boxes_variations.i18n_enter_menu_order, $menu_order.val() );
if ( value != null ) {
// Set value, save changes and reload view
$menu_order.val( parseInt( value, 10 ) ).trigger( 'change' );
$( this ).closest( '.woocommerce_variation' )
.append( '<input type="hidden" name="new_variation_menu_order_id" value="'
+ encodeURIComponent( variation_id ) + '" />' );
$( this ).closest( '.woocommerce_variation' )
.append( '<input type="hidden" name="new_variation_menu_order_value" value="'
+ encodeURIComponent( parseInt( value, 10 ) ) + '" />' );
wc_meta_boxes_product_variations_ajax.save_variations();
}
},

View File

@ -57,7 +57,7 @@ jQuery(
'select[name="_visibility"] option, ' +
'select[name="_stock_status"] option, ' +
'select[name="_backorders"] option'
).prop( 'selected', false );
).prop( 'selected', false ).removeAttr( 'selected' );
var is_variable_product = 'variable' === product_type;
$( 'select[name="_stock_status"] ~ .wc-quick-edit-warning', '.inline-edit-row' ).toggle( is_variable_product );

View File

@ -406,6 +406,43 @@
return window.confirm( woocommerce_admin.i18n_remove_personal_data_notice );
}
});
var marketplaceSectionDropdown = $( '#marketplace-current-section-dropdown' );
var marketplaceSectionName = $( '#marketplace-current-section-name' );
var marketplaceMenuIsOpen = false;
// Add event listener to toggle Marketplace menu on touch devices
if ( marketplaceSectionDropdown.length && isTouchDevice() ) {
marketplaceSectionName.on( 'click', function() {
marketplaceMenuIsOpen = ! marketplaceMenuIsOpen;
if ( marketplaceMenuIsOpen ) {
marketplaceSectionDropdown.addClass( 'is-open' );
$( document ).on( 'click', maybeToggleMarketplaceMenu );
} else {
marketplaceSectionDropdown.removeClass( 'is-open' );
$( document ).off( 'click', maybeToggleMarketplaceMenu );
}
} );
}
// Close menu if the user clicks outside it
function maybeToggleMarketplaceMenu( e ) {
if (
! marketplaceSectionDropdown.is( e.target )
&& marketplaceSectionDropdown.has( e.target ).length === 0
) {
marketplaceSectionDropdown.removeClass( 'is-open' );
marketplaceMenuIsOpen = false;
$( document ).off( 'click', maybeToggleMarketplaceMenu );
}
}
function isTouchDevice() {
return ( ( 'ontouchstart' in window ) ||
( navigator.maxTouchPoints > 0 ) ||
( navigator.msMaxTouchPoints > 0 ) );
}
});
})( jQuery, woocommerce_admin );

File diff suppressed because it is too large Load Diff

View File

@ -1,41 +1,27 @@
/*!
* SelectWoo 1.0.9
* https://github.com/woocommerce/selectWoo
* Select2 4.0.3
* https://select2.github.io
*
* Released under the MIT license
* https://github.com/woocommerce/selectWoo/blob/master/LICENSE.md
* https://github.com/select2/select2/blob/master/LICENSE.md
*/
(function (factory) {
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module.
define(['jquery'], factory);
} else if (typeof module === 'object' && module.exports) {
} else if (typeof exports === 'object') {
// Node/CommonJS
module.exports = function (root, jQuery) {
if (jQuery === undefined) {
// require('jQuery') returns a factory that requires window to
// build a jQuery instance, we normalize how we use modules
// that require this pattern but the window provided is a noop
// if it's defined (how jquery works)
if (typeof window !== 'undefined') {
jQuery = require('jquery');
}
else {
jQuery = require('jquery')(root);
}
}
factory(jQuery);
return jQuery;
};
factory(require('jquery'));
} else {
// Browser globals
factory(jQuery);
}
} (function (jQuery) {
}(function (jQuery) {
// This is needed so we can catch the AMD loader configuration and use it
// The inner file should be wrapped (by `banner.start.js`) in a function that
// returns the AMD loader references.
var S2 =(function () {
var S2 =
(function () {
// Restore the Select2 AMD loader so it can be used
// Needed mostly in the language files, where the loader is not inserted
if (jQuery && jQuery.fn && jQuery.fn.select2 && jQuery.fn.select2.amd) {
@ -44,11 +30,13 @@
var S2;(function () { if (!S2 || !S2.requirejs) {
if (!S2) { S2 = {}; } else { require = S2; }
/**
* @license almond 0.3.3 Copyright jQuery Foundation and other contributors.
* Released under MIT license, http://github.com/requirejs/almond/LICENSE
* @license almond 0.3.1 Copyright (c) 2011-2014, The Dojo Foundation All Rights Reserved.
* Available via the MIT or new BSD license.
* see: http://github.com/jrburke/almond for details
*/
//Going sloppy to avoid 'use strict' string cost, but strict practices should
//be followed.
/*jslint sloppy: true */
/*global setTimeout: false */
var requirejs, require, define;
@ -76,58 +64,60 @@ var requirejs, require, define;
*/
function normalize(name, baseName) {
var nameParts, nameSegment, mapValue, foundMap, lastIndex,
foundI, foundStarMap, starI, i, j, part, normalizedBaseParts,
foundI, foundStarMap, starI, i, j, part,
baseParts = baseName && baseName.split("/"),
map = config.map,
starMap = (map && map['*']) || {};
//Adjust any relative paths.
if (name) {
name = name.split('/');
lastIndex = name.length - 1;
if (name && name.charAt(0) === ".") {
//If have a base name, try to normalize against it,
//otherwise, assume it is a top-level require that will
//be relative to baseUrl in the end.
if (baseName) {
name = name.split('/');
lastIndex = name.length - 1;
// If wanting node ID compatibility, strip .js from end
// of IDs. Have to do this here, and not in nameToUrl
// because node allows either .js or non .js to map
// to same file.
if (config.nodeIdCompat && jsSuffixRegExp.test(name[lastIndex])) {
name[lastIndex] = name[lastIndex].replace(jsSuffixRegExp, '');
}
// Node .js allowance:
if (config.nodeIdCompat && jsSuffixRegExp.test(name[lastIndex])) {
name[lastIndex] = name[lastIndex].replace(jsSuffixRegExp, '');
}
// Starts with a '.' so need the baseName
if (name[0].charAt(0) === '.' && baseParts) {
//Convert baseName to array, and lop off the last part,
//so that . matches that 'directory' and not name of the baseName's
//module. For instance, baseName of 'one/two/three', maps to
//'one/two/three.js', but we want the directory, 'one/two' for
//this normalization.
normalizedBaseParts = baseParts.slice(0, baseParts.length - 1);
name = normalizedBaseParts.concat(name);
}
//Lop off the last part of baseParts, so that . matches the
//"directory" and not name of the baseName's module. For instance,
//baseName of "one/two/three", maps to "one/two/three.js", but we
//want the directory, "one/two" for this normalization.
name = baseParts.slice(0, baseParts.length - 1).concat(name);
//start trimDots
for (i = 0; i < name.length; i++) {
part = name[i];
if (part === '.') {
name.splice(i, 1);
i -= 1;
} else if (part === '..') {
// If at the start, or previous value is still ..,
// keep them so that when converted to a path it may
// still work when converted to a path, even though
// as an ID it is less than ideal. In larger point
// releases, may be better to just kick out an error.
if (i === 0 || (i === 1 && name[2] === '..') || name[i - 1] === '..') {
continue;
} else if (i > 0) {
name.splice(i - 1, 2);
i -= 2;
//start trimDots
for (i = 0; i < name.length; i += 1) {
part = name[i];
if (part === ".") {
name.splice(i, 1);
i -= 1;
} else if (part === "..") {
if (i === 1 && (name[2] === '..' || name[0] === '..')) {
//End of the line. Keep at least one non-dot
//path segment at the front so it can be mapped
//correctly to disk. Otherwise, there is likely
//no path mapping for a path starting with '..'.
//This can still fail, but catches the most reasonable
//uses of ..
break;
} else if (i > 0) {
name.splice(i - 1, 2);
i -= 2;
}
}
}
}
//end trimDots
//end trimDots
name = name.join('/');
name = name.join("/");
} else if (name.indexOf('./') === 0) {
// No baseName, so this is ID is resolved relative
// to baseUrl, pull off the leading dot.
name = name.substring(2);
}
}
//Apply map config if available.
@ -240,39 +230,32 @@ var requirejs, require, define;
return [prefix, name];
}
//Creates a parts array for a relName where first part is plugin ID,
//second part is resource ID. Assumes relName has already been normalized.
function makeRelParts(relName) {
return relName ? splitPrefix(relName) : [];
}
/**
* Makes a name map, normalizing the name, and using a plugin
* for normalization if necessary. Grabs a ref to plugin
* too, as an optimization.
*/
makeMap = function (name, relParts) {
makeMap = function (name, relName) {
var plugin,
parts = splitPrefix(name),
prefix = parts[0],
relResourceName = relParts[1];
prefix = parts[0];
name = parts[1];
if (prefix) {
prefix = normalize(prefix, relResourceName);
prefix = normalize(prefix, relName);
plugin = callDep(prefix);
}
//Normalize according
if (prefix) {
if (plugin && plugin.normalize) {
name = plugin.normalize(name, makeNormalize(relResourceName));
name = plugin.normalize(name, makeNormalize(relName));
} else {
name = normalize(name, relResourceName);
name = normalize(name, relName);
}
} else {
name = normalize(name, relResourceName);
name = normalize(name, relName);
parts = splitPrefix(name);
prefix = parts[0];
name = parts[1];
@ -319,14 +302,13 @@ var requirejs, require, define;
};
main = function (name, deps, callback, relName) {
var cjsModule, depName, ret, map, i, relParts,
var cjsModule, depName, ret, map, i,
args = [],
callbackType = typeof callback,
usingExports;
//Use name if no relName
relName = relName || name;
relParts = makeRelParts(relName);
//Call the callback to define the module, if necessary.
if (callbackType === 'undefined' || callbackType === 'function') {
@ -335,7 +317,7 @@ var requirejs, require, define;
//Default to [require, exports, module] if no deps
deps = !deps.length && callback.length ? ['require', 'exports', 'module'] : deps;
for (i = 0; i < deps.length; i += 1) {
map = makeMap(deps[i], relParts);
map = makeMap(deps[i], relName);
depName = map.f;
//Fast path CommonJS standard dependencies.
@ -391,7 +373,7 @@ var requirejs, require, define;
//deps arg is the module name, and second arg (if passed)
//is just the relName.
//Normalize module name, if it contains . or ..
return callDep(makeMap(deps, makeRelParts(callback)).f);
return callDep(makeMap(deps, callback).f);
} else if (!deps.splice) {
//deps is a config object, not an array.
config = deps;
@ -755,12 +737,6 @@ S2.define('select2/utils',[
});
};
Utils.entityDecode = function (html) {
var txt = document.createElement('textarea');
txt.innerHTML = html;
return txt.value;
}
// Append an array of jQuery nodes to a given element.
Utils.appendMany = function ($element, $nodes) {
// jQuery 1.7.x does not support $.fn.append() with an array
@ -778,14 +754,6 @@ S2.define('select2/utils',[
$element.append($nodes);
};
// Determine whether the browser is on a touchscreen device.
Utils.isTouchscreen = function() {
if ('undefined' === typeof Utils._isTouchscreenCache) {
Utils._isTouchscreenCache = 'ontouchstart' in document.documentElement;
}
return Utils._isTouchscreenCache;
}
return Utils;
});
@ -805,7 +773,7 @@ S2.define('select2/results',[
Results.prototype.render = function () {
var $results = $(
'<ul class="select2-results__options" role="listbox" tabindex="-1"></ul>'
'<ul class="select2-results__options" role="tree"></ul>'
);
if (this.options.get('multiple')) {
@ -828,7 +796,7 @@ S2.define('select2/results',[
this.hideLoading();
var $message = $(
'<li role="alert" aria-live="assertive"' +
'<li role="treeitem" aria-live="assertive"' +
' class="select2-results__option"></li>'
);
@ -890,9 +858,9 @@ S2.define('select2/results',[
Results.prototype.highlightFirstItem = function () {
var $options = this.$results
.find('.select2-results__option[data-selected]');
.find('.select2-results__option[aria-selected]');
var $selected = $options.filter('[data-selected=true]');
var $selected = $options.filter('[aria-selected=true]');
// Check if there are any selected options
if ($selected.length > 0) {
@ -916,7 +884,7 @@ S2.define('select2/results',[
});
var $options = self.$results
.find('.select2-results__option[data-selected]');
.find('.select2-results__option[aria-selected]');
$options.each(function () {
var $option = $(this);
@ -928,9 +896,9 @@ S2.define('select2/results',[
if ((item.element != null && item.element.selected) ||
(item.element == null && $.inArray(id, selectedIds) > -1)) {
$option.attr('data-selected', 'true');
$option.attr('aria-selected', 'true');
} else {
$option.attr('data-selected', 'false');
$option.attr('aria-selected', 'false');
}
});
@ -962,18 +930,17 @@ S2.define('select2/results',[
option.className = 'select2-results__option';
var attrs = {
'role': 'option',
'data-selected': 'false',
'tabindex': -1
'role': 'treeitem',
'aria-selected': 'false'
};
if (data.disabled) {
delete attrs['data-selected'];
delete attrs['aria-selected'];
attrs['aria-disabled'] = 'true';
}
if (data.id == null) {
delete attrs['data-selected'];
delete attrs['aria-selected'];
}
if (data._resultId != null) {
@ -985,8 +952,9 @@ S2.define('select2/results',[
}
if (data.children) {
attrs.role = 'group';
attrs['aria-label'] = data.text;
delete attrs['data-selected'];
delete attrs['aria-selected'];
}
for (var attr in attrs) {
@ -1003,7 +971,6 @@ S2.define('select2/results',[
var $label = $(label);
this.template(data, label);
$label.attr('role', 'presentation');
var $children = [];
@ -1016,11 +983,10 @@ S2.define('select2/results',[
}
var $childrenContainer = $('<ul></ul>', {
'class': 'select2-results__options select2-results__options--nested',
'role': 'listbox'
'class': 'select2-results__options select2-results__options--nested'
});
$childrenContainer.append($children);
$option.attr('role', 'list');
$option.append(label);
$option.append($childrenContainer);
@ -1116,7 +1082,7 @@ S2.define('select2/results',[
var data = $highlighted.data('data');
if ($highlighted.attr('data-selected') == 'true') {
if ($highlighted.attr('aria-selected') == 'true') {
self.trigger('close', {});
} else {
self.trigger('select', {
@ -1128,7 +1094,7 @@ S2.define('select2/results',[
container.on('results:previous', function () {
var $highlighted = self.getHighlightedResults();
var $options = self.$results.find('[data-selected]');
var $options = self.$results.find('[aria-selected]');
var currentIndex = $options.index($highlighted);
@ -1162,7 +1128,7 @@ S2.define('select2/results',[
container.on('results:next', function () {
var $highlighted = self.getHighlightedResults();
var $options = self.$results.find('[data-selected]');
var $options = self.$results.find('[aria-selected]');
var currentIndex = $options.index($highlighted);
@ -1190,8 +1156,7 @@ S2.define('select2/results',[
});
container.on('results:focus', function (params) {
params.element.addClass('select2-results__option--highlighted').attr('aria-selected', 'true');
self.$results.attr('aria-activedescendant', params.element.attr('id'));
params.element.addClass('select2-results__option--highlighted');
});
container.on('results:message', function (params) {
@ -1223,13 +1188,13 @@ S2.define('select2/results',[
});
}
this.$results.on('mouseup', '.select2-results__option[data-selected]',
this.$results.on('mouseup', '.select2-results__option[aria-selected]',
function (evt) {
var $this = $(this);
var data = $this.data('data');
if ($this.attr('data-selected') === 'true') {
if ($this.attr('aria-selected') === 'true') {
if (self.options.get('multiple')) {
self.trigger('unselect', {
originalEvent: evt,
@ -1248,13 +1213,12 @@ S2.define('select2/results',[
});
});
this.$results.on('mouseenter', '.select2-results__option[data-selected]',
this.$results.on('mouseenter', '.select2-results__option[aria-selected]',
function (evt) {
var data = $(this).data('data');
self.getHighlightedResults()
.removeClass('select2-results__option--highlighted')
.attr('aria-selected', 'false');
.removeClass('select2-results__option--highlighted');
self.trigger('results:focus', {
data: data,
@ -1281,7 +1245,7 @@ S2.define('select2/results',[
return;
}
var $options = this.$results.find('[data-selected]');
var $options = this.$results.find('[aria-selected]');
var currentIndex = $options.index($highlighted);
@ -1359,7 +1323,7 @@ S2.define('select2/selection/base',[
BaseSelection.prototype.render = function () {
var $selection = $(
'<span class="select2-selection" ' +
'<span class="select2-selection" role="combobox" ' +
' aria-haspopup="true" aria-expanded="false">' +
'</span>'
);
@ -1385,7 +1349,6 @@ S2.define('select2/selection/base',[
var id = container.id + '-container';
var resultsId = container.id + '-results';
var searchHidden = this.options.get('minimumResultsForSearch') === Infinity;
this.container = container;
@ -1427,11 +1390,7 @@ S2.define('select2/selection/base',[
self.$selection.removeAttr('aria-activedescendant');
self.$selection.removeAttr('aria-owns');
// This needs to be delayed as the active element is the body when the
// key is pressed.
window.setTimeout(function () {
self.$selection.trigger( 'focus' );
}, 1);
self.$selection.focus();
self._detachCloseHandler(container);
});
@ -1481,14 +1440,8 @@ S2.define('select2/selection/base',[
}
var $element = $this.data('element');
$element.select2('close');
// Remove any focus when dropdown is closed by clicking outside the select area.
// Timeout of 1 required for close to finish wrapping up.
setTimeout(function(){
$this.find('*:focus').blur();
$target.focus();
}, 1);
$element.select2('close');
});
});
};
@ -1547,21 +1500,8 @@ S2.define('select2/selection/single',[
var id = container.id + '-container';
this.$selection.find('.select2-selection__rendered')
.attr('id', id)
.attr('role', 'textbox')
.attr('aria-readonly', 'true');
var label = this.options.get( 'label' );
if ( typeof( label ) === 'string' ) {
this.$selection.attr( 'aria-label', label );
} else {
this.$selection.attr( 'aria-labelledby', id );
}
// This makes single non-search selects work in screen readers. If it causes problems elsewhere, remove.
this.$selection.attr('role', 'combobox');
this.$selection.find('.select2-selection__rendered').attr('id', id);
this.$selection.attr('aria-labelledby', id);
this.$selection.on('mousedown', function (evt) {
// Only respond to left clicks
@ -1578,20 +1518,13 @@ S2.define('select2/selection/single',[
// User focuses on the container
});
this.$selection.on('keydown', function (evt) {
// If user starts typing an alphanumeric key on the keyboard, open if not opened.
if (!container.isOpen() && evt.which >= 48 && evt.which <= 90) {
container.open();
}
});
this.$selection.on('blur', function (evt) {
// User exits the container
});
container.on('focus', function (evt) {
if (!container.isOpen()) {
self.$selection.trigger( 'focus' );
self.$selection.focus();
}
});
@ -1624,9 +1557,9 @@ S2.define('select2/selection/single',[
var selection = data[0];
var $rendered = this.$selection.find('.select2-selection__rendered');
var formatted = Utils.entityDecode(this.display(selection, $rendered));
var formatted = this.display(selection, $rendered);
$rendered.empty().text(formatted);
$rendered.empty().append(formatted);
$rendered.prop('title', selection.title || selection.text);
};
@ -1650,7 +1583,7 @@ S2.define('select2/selection/multiple',[
$selection.addClass('select2-selection--multiple');
$selection.html(
'<ul class="select2-selection__rendered" aria-live="polite" aria-relevant="additions removals" aria-atomic="true"></ul>'
'<ul class="select2-selection__rendered"></ul>'
);
return $selection;
@ -1687,18 +1620,6 @@ S2.define('select2/selection/multiple',[
});
}
);
this.$selection.on('keydown', function (evt) {
// If user starts typing an alphanumeric key on the keyboard, open if not opened.
if (!container.isOpen() && evt.which >= 48 && evt.which <= 90) {
container.open();
}
});
// Focus on the search field when the container is focused instead of the main container.
container.on( 'focus', function(){
self.focusOnSearch();
});
};
MultipleSelection.prototype.clear = function () {
@ -1715,7 +1636,7 @@ S2.define('select2/selection/multiple',[
MultipleSelection.prototype.selectionContainer = function () {
var $container = $(
'<li class="select2-selection__choice">' +
'<span class="select2-selection__choice__remove" role="presentation" aria-hidden="true">' +
'<span class="select2-selection__choice__remove" role="presentation">' +
'&times;' +
'</span>' +
'</li>'
@ -1724,24 +1645,6 @@ S2.define('select2/selection/multiple',[
return $container;
};
/**
* Focus on the search field instead of the main multiselect container.
*/
MultipleSelection.prototype.focusOnSearch = function() {
var self = this;
if ('undefined' !== typeof self.$search) {
// Needs 1 ms delay because of other 1 ms setTimeouts when rendering.
setTimeout(function(){
// Prevent the dropdown opening again when focused from this.
// This gets reset automatically when focus is triggered.
self._keyUpPrevented = true;
self.$search.focus();
}, 1);
}
}
MultipleSelection.prototype.update = function (data) {
this.clear();
@ -1755,14 +1658,9 @@ S2.define('select2/selection/multiple',[
var selection = data[d];
var $selection = this.selectionContainer();
var removeItemTag = $selection.html();
var formatted = this.display(selection, $selection);
if ('string' === typeof formatted) {
formatted = Utils.entityDecode(formatted.trim());
}
$selection.text(formatted);
$selection.prepend(removeItemTag);
$selection.append(formatted);
$selection.prop('title', selection.title || selection.text);
$selection.data('data', selection);
@ -1801,7 +1699,7 @@ S2.define('select2/selection/placeholder',[
Placeholder.prototype.createPlaceholder = function (decorated, placeholder) {
var $placeholder = this.selectionContainer();
$placeholder.text(Utils.entityDecode(this.display(placeholder)));
$placeholder.html(this.display(placeholder));
$placeholder.addClass('select2-selection__placeholder')
.removeClass('select2-selection__choice');
@ -1938,8 +1836,8 @@ S2.define('select2/selection/search',[
Search.prototype.render = function (decorated) {
var $search = $(
'<li class="select2-search select2-search--inline">' +
'<input class="select2-search__field" type="text" tabindex="-1"' +
' autocomplete="off" autocorrect="off" autocapitalize="none"' +
'<input class="select2-search__field" type="search" tabindex="-1"' +
' autocomplete="off" autocorrect="off" autocapitalize="off"' +
' spellcheck="false" role="textbox" aria-autocomplete="list" />' +
'</li>'
);
@ -1956,19 +1854,16 @@ S2.define('select2/selection/search',[
Search.prototype.bind = function (decorated, container, $container) {
var self = this;
var resultsId = container.id + '-results';
decorated.call(this, container, $container);
container.on('open', function () {
self.$search.attr('aria-owns', resultsId);
self.$search.trigger('focus');
});
container.on('close', function () {
self.$search.val('');
self.$search.removeAttr('aria-activedescendant');
self.$search.removeAttr('aria-owns');
self.$search.trigger('focus');
});
@ -1987,7 +1882,7 @@ S2.define('select2/selection/search',[
});
container.on('results:focus', function (params) {
self.$search.attr('aria-activedescendant', params.data._resultId);
self.$search.attr('aria-activedescendant', params.id);
});
this.$selection.on('focusin', '.select2-search--inline', function (evt) {
@ -2018,9 +1913,6 @@ S2.define('select2/selection/search',[
evt.preventDefault();
}
} else if (evt.which === KEYS.ENTER) {
container.open();
evt.preventDefault();
}
});
@ -2109,7 +2001,7 @@ S2.define('select2/selection/search',[
this.resizeSearch();
if (searchHadFocus) {
this.$search.trigger( 'focus' );
this.$search.focus();
}
};
@ -3112,15 +3004,8 @@ S2.define('select2/data/base',[
};
BaseAdapter.prototype.generateResultId = function (container, data) {
var id = '';
var id = container.id + '-result-';
if (container != null) {
id += container.id
} else {
id += Utils.generateChars(4);
}
id += '-result-';
id += Utils.generateChars(4);
if (data.id != null) {
@ -3306,7 +3191,7 @@ S2.define('select2/data/select',[
}
}
if (data.id !== undefined) {
if (data.id) {
option.value = data.id;
}
@ -3404,7 +3289,7 @@ S2.define('select2/data/select',[
item.text = item.text.toString();
}
if (item._resultId == null && item.id) {
if (item._resultId == null && item.id && this.container != null) {
item._resultId = this.generateResultId(this.container, item);
}
@ -3547,7 +3432,7 @@ S2.define('select2/data/ajax',[
if (this._request != null) {
// JSONP requests cannot always be aborted
if ( typeof this._request.abort === 'function' ) {
if ($.isFunction(this._request.abort)) {
this._request.abort();
}
@ -3572,7 +3457,7 @@ S2.define('select2/data/ajax',[
if (self.options.get('debug') && window.console && console.error) {
// Check to make sure that the response included a `results` key.
if (!results || !results.results || ! Array.isArray( results.results ) ) {
if (!results || !results.results || !$.isArray(results.results)) {
console.error(
'Select2: The AJAX results did not return an array in the ' +
'`results` key of the response.'
@ -3581,7 +3466,6 @@ S2.define('select2/data/ajax',[
}
callback(results);
self.container.focusOnActiveElement();
}, function () {
// Attempt to detect if a request was aborted
// Only works if the transport exposes a status property
@ -3631,7 +3515,7 @@ S2.define('select2/data/tags',[
decorated.call(this, $element, options);
if ( Array.isArray( tags ) ) {
if ($.isArray(tags)) {
for (var t = 0; t < tags.length; t++) {
var tag = tags[t];
var item = this._normalizeItem(tag);
@ -3666,10 +3550,7 @@ S2.define('select2/data/tags',[
}, true)
);
var optionText = (option.text || '').toUpperCase();
var paramsTerm = (params.term || '').toUpperCase();
var checkText = optionText === paramsTerm;
var checkText = option.text === params.term;
if (checkText || checkChildren) {
if (child) {
@ -3707,7 +3588,7 @@ S2.define('select2/data/tags',[
};
Tags.prototype.createTag = function (decorated, params) {
var term = ( params.term || 0 == params.term ) ? params.term.toString().trim() : '';
var term = $.trim(params.term);
if (term === '') {
return null;
@ -3800,7 +3681,7 @@ S2.define('select2/data/tokenizer',[
// Replace the search term if we have the search box
if (this.$search.length) {
this.$search.val(tokenData.term);
this.$search.trigger( 'focus' );
this.$search.focus();
}
params.term = tokenData.term;
@ -4006,9 +3887,9 @@ S2.define('select2/dropdown/search',[
var $search = $(
'<span class="select2-search select2-search--dropdown">' +
'<input class="select2-search__field" type="text" tabindex="-1"' +
' autocomplete="off" autocorrect="off" autocapitalize="none"' +
' spellcheck="false" role="combobox" aria-autocomplete="list" aria-expanded="true" />' +
'<input class="select2-search__field" type="search" tabindex="-1"' +
' autocomplete="off" autocorrect="off" autocapitalize="off"' +
' spellcheck="false" role="textbox" />' +
'</span>'
);
@ -4022,7 +3903,6 @@ S2.define('select2/dropdown/search',[
Search.prototype.bind = function (decorated, container, $container) {
var self = this;
var resultsId = container.id + '-results';
decorated.call(this, container, $container);
@ -4046,24 +3926,23 @@ S2.define('select2/dropdown/search',[
container.on('open', function () {
self.$search.attr('tabindex', 0);
self.$search.attr('aria-owns', resultsId);
self.$search.trigger( 'focus' );
self.$search.focus();
window.setTimeout(function () {
self.$search.trigger( 'focus' );
self.$search.focus();
}, 0);
});
container.on('close', function () {
self.$search.attr('tabindex', -1);
self.$search.removeAttr('aria-activedescendant');
self.$search.removeAttr('aria-owns');
self.$search.val('');
});
container.on('focus', function () {
if (!container.isOpen()) {
self.$search.trigger( 'focus' );
if (container.isOpen()) {
self.$search.focus();
}
});
@ -4078,10 +3957,6 @@ S2.define('select2/dropdown/search',[
}
}
});
container.on('results:focus', function (params) {
self.$search.attr('aria-activedescendant', params.data._resultId);
});
};
Search.prototype.handleSearch = function (evt) {
@ -4223,7 +4098,7 @@ S2.define('select2/dropdown/infiniteScroll',[
var $option = $(
'<li ' +
'class="select2-results__option select2-results__option--load-more"' +
'role="option" aria-disabled="true"></li>'
'role="treeitem" aria-disabled="true"></li>'
);
var message = this.options.get('translations').get('loadingMore');
@ -4878,7 +4753,7 @@ S2.define('select2/defaults',[
}
}
if ( Array.isArray( options.language ) ) {
if ($.isArray(options.language)) {
var languages = new Translation();
options.language.push('en');
@ -4941,7 +4816,7 @@ S2.define('select2/defaults',[
function matcher (params, data) {
// Always return the object if there is nothing to compare
if ( params.term == null || params.term.toString().trim() === '' ) {
if ($.trim(params.term) === '') {
return data;
}
@ -5469,22 +5344,16 @@ S2.define('select2/core',[
});
});
this.on('open', function(){
// Focus on the active element when opening dropdown.
// Needs 1 ms delay because of other 1 ms setTimeouts when rendering.
setTimeout(function(){
self.focusOnActiveElement();
}, 1);
});
$(document).on('keydown', function (evt) {
this.on('keypress', function (evt) {
var key = evt.which;
if (self.isOpen()) {
if (key === KEYS.ESC || (key === KEYS.UP && evt.altKey)) {
if (key === KEYS.ESC || key === KEYS.TAB ||
(key === KEYS.UP && evt.altKey)) {
self.close();
evt.preventDefault();
} else if (key === KEYS.ENTER || key === KEYS.TAB) {
} else if (key === KEYS.ENTER) {
self.trigger('results:select', {});
evt.preventDefault();
@ -5501,42 +5370,17 @@ S2.define('select2/core',[
evt.preventDefault();
}
var $searchField = self.$dropdown.find('.select2-search__field');
if (! $searchField.length) {
$searchField = self.$container.find('.select2-search__field');
}
// Move the focus to the selected element on keyboard navigation.
// Required for screen readers to work properly.
if (key === KEYS.DOWN || key === KEYS.UP) {
self.focusOnActiveElement();
} else {
// Focus on the search if user starts typing.
$searchField.focus();
// Focus back to active selection when finished typing.
// Small delay so typed character can be read by screen reader.
setTimeout(function(){
self.focusOnActiveElement();
}, 1000);
}
} else if (self.hasFocus()) {
} else {
if (key === KEYS.ENTER || key === KEYS.SPACE ||
key === KEYS.DOWN) {
(key === KEYS.DOWN && evt.altKey)) {
self.open();
evt.preventDefault();
}
}
});
};
Select2.prototype.focusOnActiveElement = function () {
// Don't mess with the focus on touchscreens because it causes havoc with on-screen keyboards.
if (this.isOpen() && ! Utils.isTouchscreen()) {
this.$results.find('li.select2-results__option--highlighted').focus();
}
};
Select2.prototype._syncAttributes = function () {
this.options.set('disabled', this.$element.prop('disabled'));
@ -5724,7 +5568,7 @@ S2.define('select2/core',[
var newVal = args[0];
if ( Array.isArray( newVal ) ) {
if ($.isArray(newVal)) {
newVal = $.map(newVal, function (obj) {
return obj.toString();
});
@ -5809,11 +5653,11 @@ S2.define('jquery.select2',[
'./select2/core',
'./select2/defaults'
], function ($, _, Select2, Defaults) {
if ($.fn.selectWoo == null) {
if ($.fn.select2 == null) {
// All methods that should return the element
var thisMethods = ['open', 'close', 'destroy'];
$.fn.selectWoo = function (options) {
$.fn.select2 = function (options) {
options = options || {};
if (typeof options === 'object') {
@ -5853,17 +5697,10 @@ S2.define('jquery.select2',[
};
}
if ($.fn.select2 != null && $.fn.select2.defaults != null) {
$.fn.selectWoo.defaults = $.fn.select2.defaults;
if ($.fn.select2.defaults == null) {
$.fn.select2.defaults = Defaults;
}
if ($.fn.selectWoo.defaults == null) {
$.fn.selectWoo.defaults = Defaults;
}
// Also register selectWoo under select2 if select2 is not already present.
$.fn.select2 = $.fn.select2 || $.fn.selectWoo;
return Select2;
});
@ -5882,7 +5719,6 @@ S2.define('jquery.select2',[
// This allows Select2 to use the internal loader outside of this file, such
// as in the language files.
jQuery.fn.select2.amd = S2;
jQuery.fn.selectWoo.amd = S2;
// Return the Select2 instance for anyone who is importing it.
return select2;

View File

@ -13,12 +13,12 @@
"source": {
"type": "git",
"url": "https://github.com/coenjacobs/mozart.git",
"reference": "3b1243ca8505fa6436569800dc34269178930f39"
"reference": "75ae1f91f04bbbd4b6edff282a483dfe611b2cea"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/coenjacobs/mozart/zipball/3b1243ca8505fa6436569800dc34269178930f39",
"reference": "3b1243ca8505fa6436569800dc34269178930f39",
"url": "https://api.github.com/repos/coenjacobs/mozart/zipball/75ae1f91f04bbbd4b6edff282a483dfe611b2cea",
"reference": "75ae1f91f04bbbd4b6edff282a483dfe611b2cea",
"shasum": ""
},
"require": {
@ -64,20 +64,20 @@
"type": "github"
}
],
"time": "2021-02-04T20:20:50+00:00"
"time": "2021-08-03T18:56:55+00:00"
},
{
"name": "league/flysystem",
"version": "1.1.4",
"version": "1.1.5",
"source": {
"type": "git",
"url": "https://github.com/thephpleague/flysystem.git",
"reference": "f3ad69181b8afed2c9edf7be5a2918144ff4ea32"
"reference": "18634df356bfd4119fe3d6156bdb990c414c14ea"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/thephpleague/flysystem/zipball/f3ad69181b8afed2c9edf7be5a2918144ff4ea32",
"reference": "f3ad69181b8afed2c9edf7be5a2918144ff4ea32",
"url": "https://api.github.com/repos/thephpleague/flysystem/zipball/18634df356bfd4119fe3d6156bdb990c414c14ea",
"reference": "18634df356bfd4119fe3d6156bdb990c414c14ea",
"shasum": ""
},
"require": {
@ -150,7 +150,7 @@
],
"support": {
"issues": "https://github.com/thephpleague/flysystem/issues",
"source": "https://github.com/thephpleague/flysystem/tree/1.1.4"
"source": "https://github.com/thephpleague/flysystem/tree/1.1.5"
},
"funding": [
{
@ -158,7 +158,7 @@
"type": "other"
}
],
"time": "2021-06-23T21:56:05+00:00"
"time": "2021-08-17T13:49:42+00:00"
},
{
"name": "league/mime-type-detection",
@ -266,16 +266,16 @@
},
{
"name": "symfony/console",
"version": "v5.3.2",
"version": "v5.3.7",
"source": {
"type": "git",
"url": "https://github.com/symfony/console.git",
"reference": "649730483885ff2ca99ca0560ef0e5f6b03f2ac1"
"reference": "8b1008344647462ae6ec57559da166c2bfa5e16a"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/console/zipball/649730483885ff2ca99ca0560ef0e5f6b03f2ac1",
"reference": "649730483885ff2ca99ca0560ef0e5f6b03f2ac1",
"url": "https://api.github.com/repos/symfony/console/zipball/8b1008344647462ae6ec57559da166c2bfa5e16a",
"reference": "8b1008344647462ae6ec57559da166c2bfa5e16a",
"shasum": ""
},
"require": {
@ -283,11 +283,12 @@
"symfony/deprecation-contracts": "^2.1",
"symfony/polyfill-mbstring": "~1.0",
"symfony/polyfill-php73": "^1.8",
"symfony/polyfill-php80": "^1.15",
"symfony/polyfill-php80": "^1.16",
"symfony/service-contracts": "^1.1|^2",
"symfony/string": "^5.1"
},
"conflict": {
"psr/log": ">=3",
"symfony/dependency-injection": "<4.4",
"symfony/dotenv": "<5.1",
"symfony/event-dispatcher": "<4.4",
@ -295,10 +296,10 @@
"symfony/process": "<4.4"
},
"provide": {
"psr/log-implementation": "1.0"
"psr/log-implementation": "1.0|2.0"
},
"require-dev": {
"psr/log": "~1.0",
"psr/log": "^1|^2",
"symfony/config": "^4.4|^5.0",
"symfony/dependency-injection": "^4.4|^5.0",
"symfony/event-dispatcher": "^4.4|^5.0",
@ -344,7 +345,7 @@
"terminal"
],
"support": {
"source": "https://github.com/symfony/console/tree/v5.3.2"
"source": "https://github.com/symfony/console/tree/v5.3.7"
},
"funding": [
{
@ -360,7 +361,7 @@
"type": "tidelift"
}
],
"time": "2021-06-12T09:42:48+00:00"
"time": "2021-08-25T20:02:16+00:00"
},
{
"name": "symfony/deprecation-contracts",
@ -431,20 +432,21 @@
},
{
"name": "symfony/finder",
"version": "v5.3.0",
"version": "v5.3.7",
"source": {
"type": "git",
"url": "https://github.com/symfony/finder.git",
"reference": "0ae3f047bed4edff6fd35b26a9a6bfdc92c953c6"
"reference": "a10000ada1e600d109a6c7632e9ac42e8bf2fb93"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/finder/zipball/0ae3f047bed4edff6fd35b26a9a6bfdc92c953c6",
"reference": "0ae3f047bed4edff6fd35b26a9a6bfdc92c953c6",
"url": "https://api.github.com/repos/symfony/finder/zipball/a10000ada1e600d109a6c7632e9ac42e8bf2fb93",
"reference": "a10000ada1e600d109a6c7632e9ac42e8bf2fb93",
"shasum": ""
},
"require": {
"php": ">=7.2.5"
"php": ">=7.2.5",
"symfony/polyfill-php80": "^1.16"
},
"type": "library",
"autoload": {
@ -472,7 +474,7 @@
"description": "Finds files and directories via an intuitive fluent interface",
"homepage": "https://symfony.com",
"support": {
"source": "https://github.com/symfony/finder/tree/v5.3.0"
"source": "https://github.com/symfony/finder/tree/v5.3.7"
},
"funding": [
{
@ -488,7 +490,7 @@
"type": "tidelift"
}
],
"time": "2021-05-26T12:52:38+00:00"
"time": "2021-08-04T21:20:46+00:00"
},
{
"name": "symfony/polyfill-ctype",
@ -571,16 +573,16 @@
},
{
"name": "symfony/polyfill-intl-grapheme",
"version": "v1.23.0",
"version": "v1.23.1",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-intl-grapheme.git",
"reference": "24b72c6baa32c746a4d0840147c9715e42bb68ab"
"reference": "16880ba9c5ebe3642d1995ab866db29270b36535"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/24b72c6baa32c746a4d0840147c9715e42bb68ab",
"reference": "24b72c6baa32c746a4d0840147c9715e42bb68ab",
"url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/16880ba9c5ebe3642d1995ab866db29270b36535",
"reference": "16880ba9c5ebe3642d1995ab866db29270b36535",
"shasum": ""
},
"require": {
@ -632,7 +634,7 @@
"shim"
],
"support": {
"source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.23.0"
"source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.23.1"
},
"funding": [
{
@ -648,7 +650,7 @@
"type": "tidelift"
}
],
"time": "2021-05-27T09:17:38+00:00"
"time": "2021-05-27T12:26:48+00:00"
},
{
"name": "symfony/polyfill-intl-normalizer",
@ -736,16 +738,16 @@
},
{
"name": "symfony/polyfill-mbstring",
"version": "v1.23.0",
"version": "v1.23.1",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-mbstring.git",
"reference": "2df51500adbaebdc4c38dea4c89a2e131c45c8a1"
"reference": "9174a3d80210dca8daa7f31fec659150bbeabfc6"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/2df51500adbaebdc4c38dea4c89a2e131c45c8a1",
"reference": "2df51500adbaebdc4c38dea4c89a2e131c45c8a1",
"url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/9174a3d80210dca8daa7f31fec659150bbeabfc6",
"reference": "9174a3d80210dca8daa7f31fec659150bbeabfc6",
"shasum": ""
},
"require": {
@ -796,7 +798,7 @@
"shim"
],
"support": {
"source": "https://github.com/symfony/polyfill-mbstring/tree/v1.23.0"
"source": "https://github.com/symfony/polyfill-mbstring/tree/v1.23.1"
},
"funding": [
{
@ -812,7 +814,7 @@
"type": "tidelift"
}
],
"time": "2021-05-27T09:27:20+00:00"
"time": "2021-05-27T12:26:48+00:00"
},
{
"name": "symfony/polyfill-php73",
@ -895,16 +897,16 @@
},
{
"name": "symfony/polyfill-php80",
"version": "v1.23.0",
"version": "v1.23.1",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-php80.git",
"reference": "eca0bf41ed421bed1b57c4958bab16aa86b757d0"
"reference": "1100343ed1a92e3a38f9ae122fc0eb21602547be"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/eca0bf41ed421bed1b57c4958bab16aa86b757d0",
"reference": "eca0bf41ed421bed1b57c4958bab16aa86b757d0",
"url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/1100343ed1a92e3a38f9ae122fc0eb21602547be",
"reference": "1100343ed1a92e3a38f9ae122fc0eb21602547be",
"shasum": ""
},
"require": {
@ -958,7 +960,7 @@
"shim"
],
"support": {
"source": "https://github.com/symfony/polyfill-php80/tree/v1.23.0"
"source": "https://github.com/symfony/polyfill-php80/tree/v1.23.1"
},
"funding": [
{
@ -974,7 +976,7 @@
"type": "tidelift"
}
],
"time": "2021-02-19T12:13:01+00:00"
"time": "2021-07-28T13:41:28+00:00"
},
{
"name": "symfony/service-contracts",
@ -1057,16 +1059,16 @@
},
{
"name": "symfony/string",
"version": "v5.3.3",
"version": "v5.3.7",
"source": {
"type": "git",
"url": "https://github.com/symfony/string.git",
"reference": "bd53358e3eccec6a670b5f33ab680d8dbe1d4ae1"
"reference": "8d224396e28d30f81969f083a58763b8b9ceb0a5"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/string/zipball/bd53358e3eccec6a670b5f33ab680d8dbe1d4ae1",
"reference": "bd53358e3eccec6a670b5f33ab680d8dbe1d4ae1",
"url": "https://api.github.com/repos/symfony/string/zipball/8d224396e28d30f81969f083a58763b8b9ceb0a5",
"reference": "8d224396e28d30f81969f083a58763b8b9ceb0a5",
"shasum": ""
},
"require": {
@ -1120,7 +1122,7 @@
"utf8"
],
"support": {
"source": "https://github.com/symfony/string/tree/v5.3.3"
"source": "https://github.com/symfony/string/tree/v5.3.7"
},
"funding": [
{
@ -1136,7 +1138,7 @@
"type": "tidelift"
}
],
"time": "2021-06-27T11:44:38+00:00"
"time": "2021-08-26T08:00:08+00:00"
}
],
"aliases": [],
@ -1151,5 +1153,5 @@
"platform-overrides": {
"php": "7.3"
},
"plugin-api-version": "2.0.0"
"plugin-api-version": "2.1.0"
}

View File

@ -9,22 +9,22 @@
"packages-dev": [
{
"name": "dealerdirect/phpcodesniffer-composer-installer",
"version": "v0.7.0",
"version": "v0.7.1",
"source": {
"type": "git",
"url": "https://github.com/Dealerdirect/phpcodesniffer-composer-installer.git",
"reference": "e8d808670b8f882188368faaf1144448c169c0b7"
"reference": "fe390591e0241955f22eb9ba327d137e501c771c"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/Dealerdirect/phpcodesniffer-composer-installer/zipball/e8d808670b8f882188368faaf1144448c169c0b7",
"reference": "e8d808670b8f882188368faaf1144448c169c0b7",
"url": "https://api.github.com/repos/Dealerdirect/phpcodesniffer-composer-installer/zipball/fe390591e0241955f22eb9ba327d137e501c771c",
"reference": "fe390591e0241955f22eb9ba327d137e501c771c",
"shasum": ""
},
"require": {
"composer-plugin-api": "^1.0 || ^2.0",
"php": ">=5.3",
"squizlabs/php_codesniffer": "^2 || ^3 || 4.0.x-dev"
"squizlabs/php_codesniffer": "^2.0 || ^3.0 || ^4.0"
},
"require-dev": {
"composer/composer": "*",
@ -75,7 +75,7 @@
"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"
"time": "2020-12-07T18:04:37+00:00"
},
{
"name": "phpcompatibility/php-compatibility",
@ -197,16 +197,16 @@
},
{
"name": "phpcompatibility/phpcompatibility-wp",
"version": "2.1.0",
"version": "2.1.2",
"source": {
"type": "git",
"url": "https://github.com/PHPCompatibility/PHPCompatibilityWP.git",
"reference": "41bef18ba688af638b7310666db28e1ea9158b2f"
"reference": "a792ab623069f0ce971b2417edef8d9632e32f75"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibilityWP/zipball/41bef18ba688af638b7310666db28e1ea9158b2f",
"reference": "41bef18ba688af638b7310666db28e1ea9158b2f",
"url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibilityWP/zipball/a792ab623069f0ce971b2417edef8d9632e32f75",
"reference": "a792ab623069f0ce971b2417edef8d9632e32f75",
"shasum": ""
},
"require": {
@ -214,10 +214,10 @@
"phpcompatibility/phpcompatibility-paragonie": "^1.0"
},
"require-dev": {
"dealerdirect/phpcodesniffer-composer-installer": "^0.5"
"dealerdirect/phpcodesniffer-composer-installer": "^0.7"
},
"suggest": {
"dealerdirect/phpcodesniffer-composer-installer": "^0.5 || This Composer plugin will sort out the PHP_CodeSniffer 'installed_paths' automatically.",
"dealerdirect/phpcodesniffer-composer-installer": "^0.7 || This Composer plugin will sort out the PHP_CodeSniffer 'installed_paths' automatically.",
"roave/security-advisories": "dev-master || Helps prevent installing dependencies with known security issues."
},
"type": "phpcodesniffer-standard",
@ -247,7 +247,7 @@
"issues": "https://github.com/PHPCompatibility/PHPCompatibilityWP/issues",
"source": "https://github.com/PHPCompatibility/PHPCompatibilityWP"
},
"time": "2019-08-28T14:22:28+00:00"
"time": "2021-07-21T11:09:57+00:00"
},
{
"name": "squizlabs/php_codesniffer",
@ -307,23 +307,23 @@
},
{
"name": "woocommerce/woocommerce-sniffs",
"version": "0.1.0",
"version": "0.1.1",
"source": {
"type": "git",
"url": "https://github.com/woocommerce/woocommerce-sniffs.git",
"reference": "b72b7dd2e70aa6aed16f80cdae5b1e6cce2e4c79"
"reference": "eb604d751b61c42f31ff1aa24113c7c0de438553"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/woocommerce/woocommerce-sniffs/zipball/b72b7dd2e70aa6aed16f80cdae5b1e6cce2e4c79",
"reference": "b72b7dd2e70aa6aed16f80cdae5b1e6cce2e4c79",
"url": "https://api.github.com/repos/woocommerce/woocommerce-sniffs/zipball/eb604d751b61c42f31ff1aa24113c7c0de438553",
"reference": "eb604d751b61c42f31ff1aa24113c7c0de438553",
"shasum": ""
},
"require": {
"dealerdirect/phpcodesniffer-composer-installer": "0.7.0",
"dealerdirect/phpcodesniffer-composer-installer": "^0.7.0",
"php": ">=7.0",
"phpcompatibility/phpcompatibility-wp": "2.1.0",
"wp-coding-standards/wpcs": "2.3.0"
"phpcompatibility/phpcompatibility-wp": "^2.1.0",
"wp-coding-standards/wpcs": "^2.3.0"
},
"type": "phpcodesniffer-standard",
"notification-url": "https://packagist.org/downloads/",
@ -345,9 +345,9 @@
],
"support": {
"issues": "https://github.com/woocommerce/woocommerce-sniffs/issues",
"source": "https://github.com/woocommerce/woocommerce-sniffs/tree/master"
"source": "https://github.com/woocommerce/woocommerce-sniffs/tree/0.1.1"
},
"time": "2020-08-06T18:23:45+00:00"
"time": "2021-07-29T17:25:16+00:00"
},
{
"name": "wp-coding-standards/wpcs",
@ -411,5 +411,5 @@
"platform-overrides": {
"php": "7.0"
},
"plugin-api-version": "2.0.0"
"plugin-api-version": "2.1.0"
}

View File

@ -1697,5 +1697,5 @@
"platform-overrides": {
"php": "7.0"
},
"plugin-api-version": "2.0.0"
"plugin-api-version": "2.1.0"
}

View File

@ -164,16 +164,16 @@
},
{
"name": "mck89/peast",
"version": "v1.13.2",
"version": "v1.13.6",
"source": {
"type": "git",
"url": "https://github.com/mck89/peast.git",
"reference": "ad912d4cf6ac682974058b6d49df4c2bf93d424d"
"reference": "67566e6d594ffb70057fee7adceac9300998cc95"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/mck89/peast/zipball/ad912d4cf6ac682974058b6d49df4c2bf93d424d",
"reference": "ad912d4cf6ac682974058b6d49df4c2bf93d424d",
"url": "https://api.github.com/repos/mck89/peast/zipball/67566e6d594ffb70057fee7adceac9300998cc95",
"reference": "67566e6d594ffb70057fee7adceac9300998cc95",
"shasum": ""
},
"require": {
@ -185,7 +185,7 @@
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.13.2-dev"
"dev-master": "1.13.6-dev"
}
},
"autoload": {
@ -207,9 +207,9 @@
"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.13.2"
"source": "https://github.com/mck89/peast/tree/v1.13.6"
},
"time": "2021-07-14T09:31:25+00:00"
"time": "2021-08-23T10:30:32+00:00"
},
{
"name": "mustache/mustache",
@ -624,5 +624,5 @@
"platform-overrides": {
"php": "7.0"
},
"plugin-api-version": "2.0.0"
"plugin-api-version": "2.1.0"
}

View File

@ -5,6 +5,8 @@
**WooCommerce**
* Enhancement - Product attributes lookup table synchronization when the table exists. #30041
* Enhancement - Add Refund and Returns Policy sample page. #30194
* Enhancement - Added support for Shipping Phone, in addition to Billing Phone in email templates and in the Order's edit screen. #30097
* Tweak - Copy changes on WCS extension banner to include DHL Express. #30081
* Tweak - Remove Canada Post from WCS extensions banner. #30082
* Tweak - For 2021 theme, use theme font, and allow font-family customization. #30111
@ -19,11 +21,11 @@
* Fix - Replace hardcoded frontend JS script versions with WC version to bust cached/staled JS scripts. #30301
* Fix - Variable product showing HTML content while granting access for downloadable product in orders. #30305
* Fix - Replaced wp.passwordStrength deprecated method. #30191
* Fix - `woocommerce_email_settings` filter being triggered twice. #30404
* Dev - Apply `woocommerce_logout_default_redirect_url` filter to logout for custom endpoint. #29967
* Dev - Added new `woocommerce_email_sent` hook. #30123
* Dev - Add Refund and Returns Policy sample page. #30194
**WooCommerce Admin - 2.5.0**
**WooCommerce Admin - 2.5.0 & 2.5.1**
- Add - Add a delete option to completed tasks #7300
- Add - Add unit tests around extended payment gateway controller #7133
@ -45,7 +47,7 @@
- Fix - Include onboarding settings on the analytic pages #7109
- Fix - Load Analytics API only when feature is turned on #7193
- Fix - Localize string for description #7219
- Fix - Filters: On update respect all other queries, not just persistedQueries #7155
- Fix - Filters. On update respect all other queries, not just persistedQueries #7155
- Fix - Use saved form values if available when switching tabs #7226
- Fix - Skip schedule customer data deletion on site deletion #7214
- Fix - WCPay not working in local payments task #7151
@ -60,22 +62,32 @@
- Fix - Fix missing translation strings for CES #7270
- Fix - Add missing translation strings in the business features section #7268
- Fix - Fix inbox note dismiss dropdown not closing on Safari #7278
- Fix - Fixed OBW - Business details style #7353
- Fix - Fixed OBW Business details style #7353
- Fix - Fix links on the dismiss dropdown are not clickable #7342
- Fix - Fix undefined method error when setting up WC Tax #7344
- Fix - Invalidate task status when enabling a payment gateway #7330
- Fix - Redirect to homescreen after payment gateway setup #7332
- Fix - Create workable defaults for Reports that dont have AdvancedFilters #7186
- Fix - Set default value for performanceIndicators variable #7343
- Fix - Sync the category lookup table when a new category gets created #7290
- Fix - Add limit clause to coupons data store query #7399
- Fix - Fix analytics filter Gutenberg CSS conflict #7410
- Fix - Fix Gutenberg CardBody styles for task card #7411
- Fix - Fix orders panel not displaying any orders when analytics is disabled #7395
- Fix - Fix recommended card Gutenberg CSS conflict #7409
- Fix - Update tooltip styling to fix new Gutenberg updates. #7414
- Fix - Allow super admins all capabilities within WooCommerce Admin
- Fix - Fix analytics overview re-arrangement on initial load. #7475
- Fix - Fixes action button mis-alignment within card footer. #7412
- Fix - Fix up onboarding profiler not working when opted out of tracking
- Fix - Fix blank screen by setting a default value #7506
- Tweak - Remove performance indicators when Analytics Flag disabled #7234
- Tweak - Change event name when installing Google Listings and Ads. #7276
- Tweak - Removed unused feature flags #7233 and #7273
- Tweak - Render a spinner while woocommerce_setup_jetpack_opted_in is being loaded #7269
- Tweak - Repurpose disable wc-admin filter to remove optional features #7232
- Update - Add additional countries to WCPay for business features and payment task fallback #7436
- Update - Notes to use a date range. #7222
- Update - Remove facebook extension from onboarding extensions fallback list #7287
- Performance - Add cache-control header to low stock REST API response #7364
- Performance - Add lazy loading by checking panel open status #7379
**WooCommerce Blocks - 5.4.1 & 5.5.1**

View File

@ -21,11 +21,12 @@
"pelago/emogrifier": "3.1.0",
"psr/container": "1.0.0",
"woocommerce/action-scheduler": "3.2.1",
"woocommerce/woocommerce-admin": "2.5.0-beta.2",
"woocommerce/woocommerce-blocks": "5.5.1"
"woocommerce/woocommerce-admin": "2.6.0-rc.2",
"woocommerce/woocommerce-blocks": "5.7.1"
},
"require-dev": {
"bamarni/composer-bin-plugin": "^1.4"
"bamarni/composer-bin-plugin": "^1.4",
"yoast/phpunit-polyfills": "^1.0"
},
"config": {
"optimize-autoloader": true,

1772
composer.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -667,8 +667,8 @@ return array(
'PY' => __( 'Pondicherry (Puducherry)', 'woocommerce' ),
),
'IR' => array( // Iran States.
'KHZ' => __( 'Khuzestan (خوزستان)', 'woocommerce' ),
'THR' => __( 'Tehran (تهران)', 'woocommerce' ),
'KHZ' => __( 'Khuzestan (خوزستان)', 'woocommerce' ),
'THR' => __( 'Tehran (تهران)', 'woocommerce' ),
'ILM' => __( 'Ilaam (ایلام)', 'woocommerce' ),
'BHR' => __( 'Bushehr (بوشهر)', 'woocommerce' ),
'ADL' => __( 'Ardabil (اردبیل)', 'woocommerce' ),
@ -1595,6 +1595,32 @@ return array(
'RSVO' => _x( 'Vojvodina', 'district', 'woocommerce' ),
),
'SE' => array(),
'UA' => array( // Ukraine. Ref: https://en.wikipedia.org/wiki/Oblasts_of_Ukraine.
'VN' => __( 'Vinnytsia Oblast', 'woocommerce' ),
'VL' => __( 'Volyn Oblast', 'woocommerce' ),
'DP' => __( 'Dnipropetrovsk Oblast', 'woocommerce' ),
'DT' => __( 'Donetsk Oblast', 'woocommerce' ),
'ZT' => __( 'Zhytomyr Oblast', 'woocommerce' ),
'ZK' => __( 'Zakarpattia Oblast', 'woocommerce' ),
'ZP' => __( 'Zaporizhzhia Oblast', 'woocommerce' ),
'IF' => __( 'Ivano-Frankivsk Oblast', 'woocommerce' ),
'KV' => __( 'Kyiv Oblast', 'woocommerce' ),
'KH' => __( 'Kirovohrad Oblast', 'woocommerce' ),
'LH' => __( 'Luhansk Oblast', 'woocommerce' ),
'LV' => __( 'Lviv Oblast', 'woocommerce' ),
'MY' => __( 'Mykolaiv Oblast', 'woocommerce' ),
'OD' => __( 'Odessa Oblast', 'woocommerce' ),
'PL' => __( 'Poltava Oblast', 'woocommerce' ),
'RV' => __( 'Rivne Oblast', 'woocommerce' ),
'SM' => __( 'Sumy Oblast', 'woocommerce' ),
'TP' => __( 'Ternopil Oblast', 'woocommerce' ),
'KK' => __( 'Kharkiv Oblast', 'woocommerce' ),
'KS' => __( 'Kherson Oblast', 'woocommerce' ),
'KM' => __( 'Khmelnytskyi Oblast', 'woocommerce' ),
'CK' => __( 'Cherkasy Oblast', 'woocommerce' ),
'CH' => __( 'Chernihiv Oblast', 'woocommerce' ),
'CV' => __( 'Chernivtsi Oblast', 'woocommerce' ),
),
'UG' => array( // Uganda districts. Ref: https://en.wikipedia.org/wiki/ISO_3166-2:UG.
'UG314' => __( 'Abim', 'woocommerce' ),
'UG301' => __( 'Adjumani', 'woocommerce' ),

View File

@ -723,6 +723,7 @@ class WC_Admin_Addons {
* Addon page view.
*
* @uses $addons
* @uses $search
* @uses $sections
* @uses $theme
* @uses $current_section
@ -794,4 +795,20 @@ class WC_Admin_Addons {
return true;
}
/**
* We're displaying page=wc-addons and page=wc-addons&section=helper as two separate pages.
* When we're on those pages, add body classes to distinguishe them.
*
* @param string $admin_body_class Unfiltered body class.
*
* @return string Body class with added class for Marketplace or My Subscriptions page.
*/
public static function filter_admin_body_classes( string $admin_body_class = '' ): string {
if ( isset( $_GET['section'] ) && 'helper' === $_GET['section'] ) {
return " $admin_body_class woocommerce-page-wc-subscriptions ";
}
return " $admin_body_class woocommerce-page-wc-marketplace ";
}
}

View File

@ -36,6 +36,8 @@ class WC_Admin_Menus {
add_filter( 'menu_order', array( $this, 'menu_order' ) );
add_filter( 'custom_menu_order', array( $this, 'custom_menu_order' ) );
add_filter( 'set-screen-option', array( $this, 'set_screen_option' ), 10, 3 );
add_filter( 'submenu_file', array( $this, 'update_menu_highlight' ), 10, 2 );
add_filter( 'admin_title', array( $this, 'update_my_subscriptions_title' ) );
// Add endpoints custom URLs in Appearance > Menus > Pages.
add_action( 'admin_head-nav-menus.php', array( $this, 'add_nav_menu_meta_boxes' ) );
@ -149,8 +151,9 @@ class WC_Admin_Menus {
public function addons_menu() {
$count_html = WC_Helper_Updater::get_updates_count_html();
/* translators: %s: extensions count */
$menu_title = sprintf( __( 'Extensions %s', 'woocommerce' ), $count_html );
add_submenu_page( 'woocommerce', __( 'WooCommerce extensions', 'woocommerce' ), $menu_title, 'manage_woocommerce', 'wc-addons', array( $this, 'addons_page' ) );
$menu_title = sprintf( __( 'My Subscriptions %s', 'woocommerce' ), $count_html );
add_submenu_page( 'woocommerce', __( 'WooCommerce Marketplace', 'woocommerce' ), __( 'Marketplace', 'woocommerce' ), 'manage_woocommerce', 'wc-addons', array( $this, 'addons_page' ) );
add_submenu_page( 'woocommerce', __( 'My WooCommerce.com Subscriptions', 'woocommerce' ), $menu_title, 'manage_woocommerce', 'wc-addons&section=helper', array( $this, 'addons_page' ) );
}
/**
@ -387,6 +390,39 @@ class WC_Admin_Menus {
)
);
}
/**
* Highlight the My Subscriptions menu item when on that page
*
* @param string $submenu_file The submenu file.
* @param string $parent_file currently opened page.
*
* @return string
*/
public function update_menu_highlight( $submenu_file, $parent_file ) {
if ( 'woocommerce' === $parent_file && isset( $_GET['section'] ) && 'helper' === $_GET['section'] ) {
$submenu_file = 'wc-addons&section=helper';
}
return $submenu_file;
}
/**
* Update the My Subscriptions document title when on that page.
* We want to maintain existing page URL but add it as a separate page,
* which requires updating it manually.
*
* @param string $admin_title existing page title.
* @return string
*/
public function update_my_subscriptions_title( $admin_title ) {
if (
isset( $_GET['page'] ) && 'wc-addons' === $_GET['page'] &&
isset( $_GET['section'] ) && 'helper' === $_GET['section']
) {
$admin_title = 'My WooCommerce.com Subscriptions';
}
return $admin_title;
}
}
return new WC_Admin_Menus();

View File

@ -35,6 +35,11 @@ class WC_Admin {
// Add body class for WP 5.3+ compatibility.
add_filter( 'admin_body_class', array( $this, 'include_admin_body_class' ), 9999 );
// Add body class for Marketplace and My Subscriptions pages.
if ( isset( $_GET['page'] ) && 'wc-addons' === $_GET['page'] ) {
add_filter( 'admin_body_class', array( 'WC_Admin_Addons', 'filter_admin_body_classes' ) );
}
}
/**

View File

@ -1,19 +1,46 @@
<?php defined( 'ABSPATH' ) or exit(); ?>
<?php
/**
* Helper main view
*
* @package WooCommerce\Helper
*/
<div class="wrap woocommerce wc_addons_wrap wc-helper">
<?php require WC_Helper::get_view_filename( 'html-section-nav.php' ); ?>
<h1 class="screen-reader-text"><?php _e( 'WooCommerce Extensions', 'woocommerce' ); ?></h1>
?>
<?php defined( 'ABSPATH' ) || exit(); ?>
<div class="wrap woocommerce wc-subscriptions-wrap wc-helper">
<h1 class="screen-reader-text"><?php esc_html_e( 'My Subscriptions', 'woocommerce' ); ?></h1>
<?php require WC_Helper::get_view_filename( 'html-section-notices.php' ); ?>
<div class="subscriptions-header">
<h2><?php _e( 'Subscriptions', 'woocommerce' ); ?></h2>
<h2><?php esc_html_e( 'Subscriptions', 'woocommerce' ); ?></h2>
<?php require WC_Helper::get_view_filename( 'html-section-account.php' ); ?>
<p><?php printf( __( 'Below is a list of extensions available on your WooCommerce.com account. To receive extension updates please make sure the extension is installed, and its subscription activated and connected to your WooCommerce.com account. Extensions can be activated from the <a href="%s">Plugins</a> screen.', 'woocommerce' ), admin_url( 'plugins.php' ) ); ?></p>
<p>
<?php
printf(
wp_kses(
/* translators: Introduction to list of WooCommerce.com extensions the merchant has subscriptions for. */
__(
'Below is a list of extensions available on your WooCommerce.com account. To receive extension updates please make sure the extension is installed, and its subscription activated and connected to your WooCommerce.com account. Extensions can be activated from the <a href="%s">Plugins</a> screen.',
'woocommerce'
),
array(
'a' => array(
'href' => array(),
),
)
),
esc_url(
admin_url( 'plugins.php' )
)
);
?>
</p>
</div>
<ul class="subscription-filter">
<label><?php _e( 'Sort by:', 'woocommerce' ); ?> <span class="chevron dashicons dashicons-arrow-up-alt2"></span></label>
<label><?php esc_html_e( 'Sort by:', 'woocommerce' ); ?> <span class="chevron dashicons dashicons-arrow-up-alt2"></span></label>
<?php
$filters = array_keys( WC_Helper::get_filters() );
$last_filter = array_pop( $filters );
@ -32,7 +59,7 @@
$class_html = $current_filter === $key ? 'class="current"' : '';
?>
<li>
<a <?php echo $class_html; ?> href="<?php echo esc_url( $url ); ?>">
<a <?php echo esc_html( $class_html ); ?> href="<?php echo esc_url( $url ); ?>">
<?php echo esc_html( $label ); ?>
<span class="count">(<?php echo absint( $counts[ $key ] ); ?>)</span>
</a>
@ -55,27 +82,27 @@
<div class="wp-list-table__ext-description">
<?php if ( $subscription['lifetime'] ) : ?>
<span class="renews">
<?php _e( 'Lifetime Subscription', 'woocommerce' ); ?>
<?php esc_html_e( 'Lifetime Subscription', 'woocommerce' ); ?>
</span>
<?php elseif ( $subscription['expired'] ) : ?>
<span class="renews">
<strong><?php _e( 'Expired :(', 'woocommerce' ); ?></strong>
<?php echo date_i18n( 'F jS, Y', $subscription['expires'] ); ?>
<strong><?php esc_html_e( 'Expired :(', 'woocommerce' ); ?></strong>
<?php echo esc_html( date_i18n( 'F jS, Y', $subscription['expires'] ) ); ?>
</span>
<?php elseif ( $subscription['autorenew'] ) : ?>
<span class="renews">
<?php _e( 'Auto renews on:', 'woocommerce' ); ?>
<?php echo date_i18n( 'F jS, Y', $subscription['expires'] ); ?>
<?php esc_html_e( 'Auto renews on:', 'woocommerce' ); ?>
<?php echo esc_html( date_i18n( 'F jS, Y', $subscription['expires'] ) ); ?>
</span>
<?php elseif ( $subscription['expiring'] ) : ?>
<span class="renews">
<strong><?php _e( 'Expiring soon!', 'woocommerce' ); ?></strong>
<?php echo date_i18n( 'F jS, Y', $subscription['expires'] ); ?>
<strong><?php esc_html_e( 'Expiring soon!', 'woocommerce' ); ?></strong>
<?php echo esc_html( date_i18n( 'F jS, Y', $subscription['expires'] ) ); ?>
</span>
<?php else : ?>
<span class="renews">
<?php _e( 'Expires on:', 'woocommerce' ); ?>
<?php echo date_i18n( 'F jS, Y', $subscription['expires'] ); ?>
<?php esc_html_e( 'Expires on:', 'woocommerce' ); ?>
<?php echo esc_html( date_i18n( 'F jS, Y', $subscription['expires'] ) ); ?>
</span>
<?php endif; ?>
@ -84,19 +111,21 @@
<?php
if ( ! $subscription['active'] && $subscription['maxed'] ) {
/* translators: %1$d: sites active, %2$d max sites active */
printf( __( 'Subscription: Not available - %1$d of %2$d already in use', 'woocommerce' ), absint( $subscription['sites_active'] ), absint( $subscription['sites_max'] ) );
printf( esc_html__( 'Subscription: Not available - %1$d of %2$d already in use', 'woocommerce' ), absint( $subscription['sites_active'] ), absint( $subscription['sites_max'] ) );
} elseif ( $subscription['sites_max'] > 0 ) {
/* translators: %1$d: sites active, %2$d max sites active */
printf( __( 'Subscription: Using %1$d of %2$d sites available', 'woocommerce' ), absint( $subscription['sites_active'] ), absint( $subscription['sites_max'] ) );
printf( esc_html__( 'Subscription: Using %1$d of %2$d sites available', 'woocommerce' ), absint( $subscription['sites_active'] ), absint( $subscription['sites_max'] ) );
} else {
_e( 'Subscription: Unlimited', 'woocommerce' );
esc_html_e( 'Subscription: Unlimited', 'woocommerce' );
}
// Check shared.
if ( ! empty( $subscription['is_shared'] ) && ! empty( $subscription['owner_email'] ) ) {
printf( '</br>' . __( 'Shared by %s', 'woocommerce' ), esc_html( $subscription['owner_email'] ) );
/* translators: Email address of person who shared the subscription. */
printf( '</br>' . esc_html__( 'Shared by %s', 'woocommerce' ), esc_html( $subscription['owner_email'] ) );
} elseif ( isset( $subscription['master_user_email'] ) ) {
printf( '</br>' . __( 'Shared by %s', 'woocommerce' ), esc_html( $subscription['master_user_email'] ) );
/* translators: Email address of person who shared the subscription. */
printf( '</br>' . esc_html__( 'Shared by %s', 'woocommerce' ), esc_html( $subscription['master_user_email'] ) );
}
?>
</span>
@ -104,35 +133,35 @@
</td>
<td class="wp-list-table__ext-actions">
<?php if ( ! $subscription['active'] && $subscription['maxed'] ) : ?>
<a class="button" href="https://woocommerce.com/my-account/my-subscriptions/" target="_blank"><?php _e( 'Upgrade', 'woocommerce' ); ?></a>
<a class="button" href="https://woocommerce.com/my-account/my-subscriptions/" target="_blank"><?php esc_html_e( 'Upgrade', 'woocommerce' ); ?></a>
<?php elseif ( ! $subscription['local']['installed'] && ! $subscription['expired'] ) : ?>
<a class="button <?php echo empty( $subscription['download_primary'] ) ? 'button-secondary' : ''; ?>" href="<?php echo esc_url( $subscription['download_url'] ); ?>" target="_blank"><?php _e( 'Download', 'woocommerce' ); ?></a>
<a class="button <?php echo empty( $subscription['download_primary'] ) ? 'button-secondary' : ''; ?>" href="<?php echo esc_url( $subscription['download_url'] ); ?>" target="_blank"><?php esc_html_e( 'Download', 'woocommerce' ); ?></a>
<?php elseif ( $subscription['active'] ) : ?>
<span class="form-toggle__wrapper">
<a href="<?php echo esc_url( $subscription['deactivate_url'] ); ?>" class="form-toggle active is-compact" role="link" aria-checked="true"><?php _e( 'Active', 'woocommerce' ); ?></a>
<a href="<?php echo esc_url( $subscription['deactivate_url'] ); ?>" class="form-toggle active is-compact" role="link" aria-checked="true"><?php esc_html_e( 'Active', 'woocommerce' ); ?></a>
<label class="form-toggle__label" for="activate-extension">
<span class="form-toggle__label-content">
<label for="activate-extension"><?php _e( 'Active', 'woocommerce' ); ?></label>
<label for="activate-extension"><?php esc_html_e( 'Active', 'woocommerce' ); ?></label>
</span>
<span class="form-toggle__switch"></span>
</label>
</span>
<?php elseif ( ! $subscription['expired'] ) : ?>
<span class="form-toggle__wrapper">
<a href="<?php echo esc_url( $subscription['activate_url'] ); ?>" class="form-toggle is-compact" role="link" aria-checked="false"><?php _e( 'Inactive', 'woocommerce' ); ?></a>
<a href="<?php echo esc_url( $subscription['activate_url'] ); ?>" class="form-toggle is-compact" role="link" aria-checked="false"><?php esc_html_e( 'Inactive', 'woocommerce' ); ?></a>
<label class="form-toggle__label" for="activate-extension">
<span class="form-toggle__label-content">
<label for="activate-extension"><?php _e( 'Inactive', 'woocommerce' ); ?></label>
<label for="activate-extension"><?php esc_html_e( 'Inactive', 'woocommerce' ); ?></label>
</span>
<span class="form-toggle__switch"></span>
</label>
</span>
<?php else : ?>
<span class="form-toggle__wrapper">
<span class="form-toggle disabled is-compact"><?php _e( 'Inactive', 'woocommerce' ); ?></span>
<span class="form-toggle disabled is-compact"><?php esc_html_e( 'Inactive', 'woocommerce' ); ?></span>
<label class="form-toggle__label" for="activate-extension">
<span class="form-toggle__label-content">
<label for="activate-extension"><?php _e( 'Inactive', 'woocommerce' ); ?></label>
<label for="activate-extension"><?php esc_html_e( 'Inactive', 'woocommerce' ); ?></label>
</span>
</label>
</span>
@ -140,16 +169,16 @@
</td>
</tr>
<?php foreach ( $subscription['actions'] as $action ) : ?>
<?php foreach ( $subscription['actions'] as $subscription_action ) : ?>
<tr class="wp-list-table__row wp-list-table__ext-updates">
<td class="wp-list-table__ext-status <?php echo sanitize_html_class( $action['status'] ); ?>">
<p><span class="dashicons <?php echo sanitize_html_class( $action['icon'] ); ?>"></span>
<?php echo $action['message']; ?>
<td class="wp-list-table__ext-status <?php echo sanitize_html_class( $subscription_action['status'] ); ?>">
<p><span class="dashicons <?php echo sanitize_html_class( $subscription_action['icon'] ); ?>"></span>
<?php echo wp_kses_post( $subscription_action['message'] ); ?>
</p>
</td>
<td class="wp-list-table__ext-actions">
<?php if ( ! empty( $action['button_label'] ) && ! empty( $action['button_url'] ) ) : ?>
<a class="button <?php echo empty( $action['primary'] ) ? 'button-secondary' : ''; ?>" href="<?php echo esc_url( $action['button_url'] ); ?>"><?php echo esc_html( $action['button_label'] ); ?></a>
<?php if ( ! empty( $subscription_action['button_label'] ) && ! empty( $subscription_action['button_url'] ) ) : ?>
<a class="button <?php echo empty( $subscription_action['primary'] ) ? 'button-secondary' : ''; ?>" href="<?php echo esc_url( $subscription_action['button_url'] ); ?>"><?php echo esc_html( $subscription_action['button_label'] ); ?></a>
<?php endif; ?>
</td>
</tr>
@ -159,14 +188,14 @@
<?php endforeach; ?>
<?php else : ?>
<tr>
<td colspan="3"><em><?php _e( 'Could not find any subscriptions on your WooCommerce.com account', 'woocommerce' ); ?></td>
<td colspan="3"><em><?php esc_html_e( 'Could not find any subscriptions on your WooCommerce.com account', 'woocommerce' ); ?></td>
</tr>
<?php endif; ?>
</tbody>
</table>
<?php if ( ! empty( $no_subscriptions ) ) : ?>
<h2><?php _e( 'Installed Extensions without a Subscription', 'woocommerce' ); ?></h2>
<h2><?php esc_html_e( 'Installed Extensions without a Subscription', 'woocommerce' ); ?></h2>
<p>Below is a list of WooCommerce.com products available on your site - but are either out-dated or do not have a valid subscription.</p>
<table class="wp-list-table widefat fixed striped">
@ -183,25 +212,25 @@
</td>
<td class="wp-list-table__ext-actions">
<span class="form-toggle__wrapper">
<span class="form-toggle disabled is-compact" ><?php _e( 'Inactive', 'woocommerce' ); ?></span>
<span class="form-toggle disabled is-compact" ><?php esc_html_e( 'Inactive', 'woocommerce' ); ?></span>
<label class="form-toggle__label" for="activate-extension">
<span class="form-toggle__label-content">
<label for="activate-extension"><?php _e( 'Inactive', 'woocommerce' ); ?></label>
<label for="activate-extension"><?php esc_html_e( 'Inactive', 'woocommerce' ); ?></label>
</span>
</label>
</span>
</td>
</tr>
<?php foreach ( $data['_actions'] as $action ) : ?>
<?php foreach ( $data['_actions'] as $subscription_action ) : ?>
<tr class="wp-list-table__row wp-list-table__ext-updates">
<td class="wp-list-table__ext-status <?php echo sanitize_html_class( $action['status'] ); ?>">
<p><span class="dashicons <?php echo sanitize_html_class( $action['icon'] ); ?>"></span>
<?php echo $action['message']; ?>
<td class="wp-list-table__ext-status <?php echo sanitize_html_class( $subscription_action['status'] ); ?>">
<p><span class="dashicons <?php echo sanitize_html_class( $subscription_action['icon'] ); ?>"></span>
<?php echo esc_html( $subscription_action['message'] ); ?>
</p>
</td>
<td class="wp-list-table__ext-actions">
<a class="button" href="<?php echo esc_url( $action['button_url'] ); ?>" target="_blank"><?php echo esc_html( $action['button_label'] ); ?></a>
<a class="button" href="<?php echo esc_url( $subscription_action['button_url'] ); ?>" target="_blank"><?php echo esc_html( $subscription_action['button_label'] ); ?></a>
</td>
</tr>
<?php endforeach; ?>

View File

@ -9,8 +9,7 @@ defined( 'ABSPATH' ) || exit();
?>
<div class="wrap woocommerce wc_addons_wrap wc-helper">
<?php require WC_Helper::get_view_filename( 'html-section-nav.php' ); ?>
<div class="wrap woocommerce wc-addons-wrap wc-helper">
<h1 class="screen-reader-text"><?php esc_html_e( 'WooCommerce Extensions', 'woocommerce' ); ?></h1>
<?php require WC_Helper::get_view_filename( 'html-section-notices.php' ); ?>

View File

@ -3,6 +3,8 @@
* Helper admin navigation.
*
* @package WooCommerce\Helper
*
* @deprecated 5.7.0
*/
defined( 'ABSPATH' ) || exit(); ?>

View File

@ -4,8 +4,6 @@
*
* Functions for displaying the order actions meta box.
*
* @author WooThemes
* @category Admin
* @package WooCommerce\Admin\Meta Boxes
* @version 2.1.0
*/
@ -28,18 +26,13 @@ class WC_Meta_Box_Order_Actions {
global $theorder;
// This is used by some callbacks attached to hooks such as woocommerce_order_actions which rely on the global to determine if actions should be displayed for certain orders.
// Avoid using this global with the `woocommerce_order_actions` filter, instead use the $order filter arg.
if ( ! is_object( $theorder ) ) {
$theorder = wc_get_order( $post->ID );
}
$order_actions = apply_filters(
'woocommerce_order_actions',
array(
'send_order_details' => __( 'Email invoice / order details to customer', 'woocommerce' ),
'send_order_details_admin' => __( 'Resend new order notification', 'woocommerce' ),
'regenerate_download_permissions' => __( 'Regenerate download permissions', 'woocommerce' ),
)
);
$theorder = $theorder instanceof WC_Order ? $theorder : null;
$order_actions = self::get_available_order_actions_for_order( $theorder );
?>
<ul class="order_actions submitbox">
@ -153,4 +146,33 @@ class WC_Meta_Box_Order_Actions {
public static function set_email_sent_message( $location ) {
return add_query_arg( 'message', 11, $location );
}
/**
* Get the available order actions for a given order.
*
* @since 5.8.0
*
* @param WC_Order|null $order The order object or null if no order is available.
*
* @return array
*/
private static function get_available_order_actions_for_order( $order ) {
$actions = array(
'send_order_details' => __( 'Email invoice / order details to customer', 'woocommerce' ),
'send_order_details_admin' => __( 'Resend new order notification', 'woocommerce' ),
'regenerate_download_permissions' => __( 'Regenerate download permissions', 'woocommerce' ),
);
/**
* Filter: woocommerce_order_actions
* Allows filtering of the available order actions for an order.
*
* @since 2.1.0 Filter was added.
* @since 5.8.0 The $order param was added.
*
* @param array $actions The available order actions for the order.
* @param WC_Order|null $order The order object or null if no order is available.
*/
return apply_filters( 'woocommerce_order_actions', $actions, $order );
}
}

View File

@ -607,6 +607,10 @@ class WC_Meta_Box_Order_Data {
$payment_method_title = $methods[ $payment_method ]->get_title();
}
if ( $payment_method == 'other') {
$payment_method_title = esc_html__( 'Other', 'woocommerce' );
}
$props['payment_method'] = $payment_method;
$props['payment_method_title'] = $payment_method_title;
}

View File

@ -437,6 +437,8 @@ class WC_Meta_Box_Product_Data {
* @param WP_Post $post Post object.
*/
public static function save_variations( $post_id, $post ) {
global $wpdb;
// phpcs:disable WordPress.Security.NonceVerification.Missing
if ( isset( $_POST['variable_post_id'] ) ) {
$parent = wc_get_product( $post_id );
@ -446,6 +448,26 @@ class WC_Meta_Box_Product_Data {
$max_loop = max( array_keys( wp_unslash( $_POST['variable_post_id'] ) ) ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
$data_store = $parent->get_data_store();
$data_store->sort_all_product_variations( $parent->get_id() );
$new_variation_menu_order_id = ! empty( $_POST['new_variation_menu_order_id'] ) ? wc_clean( wp_unslash( $_POST['new_variation_menu_order_id'] ) ) : false;
$new_variation_menu_order_value = ! empty( $_POST['new_variation_menu_order_value'] ) ? wc_clean( wp_unslash( $_POST['new_variation_menu_order_value'] ) ) : false;
// Only perform this operation if setting menu order via the prompt.
if ( $new_variation_menu_order_id && $new_variation_menu_order_value ) {
/*
* We need to gather all the variations with menu order that is
* equal or greater than the menu order that is newly set and
* increment them by one so that we can correctly insert the updated
* variation menu order.
*/
$wpdb->query(
$wpdb->prepare(
"UPDATE {$wpdb->posts} SET menu_order = menu_order + 1 WHERE post_type = 'product_variation' AND post_parent = %d AND post_status = 'publish' AND menu_order >= %d AND ID != %d",
$post_id,
$new_variation_menu_order_value,
$new_variation_menu_order_id
)
);
}
for ( $i = 0; $i <= $max_loop; $i++ ) {
@ -538,7 +560,6 @@ class WC_Meta_Box_Product_Data {
do_action( 'woocommerce_admin_process_variation_object', $variation, $i );
$variation->save();
do_action( 'woocommerce_save_product_variation', $variation_id, $i );
}
}

View File

@ -31,6 +31,8 @@ defined( 'ABSPATH' ) || exit;
'description' => __( 'This text will be shown on the button linking to the external product.', 'woocommerce' ),
)
);
do_action( 'woocommerce_product_options_external' );
?>
</div>

View File

@ -47,7 +47,7 @@ defined( 'ABSPATH' ) || exit;
<?php
}
?>
<input type="hidden" name="variable_post_id[<?php echo esc_attr( $loop ); ?>]" value="<?php echo esc_attr( $variation_id ); ?>" />
<input type="hidden" class="variable_post_id" name="variable_post_id[<?php echo esc_attr( $loop ); ?>]" value="<?php echo esc_attr( $variation_id ); ?>" />
<input type="hidden" class="variation_menu_order" name="variation_menu_order[<?php echo esc_attr( $loop ); ?>]" value="<?php echo esc_attr( $variation_object->get_menu_order( 'edit' ) ); ?>" />
<?php

View File

@ -51,8 +51,7 @@ class WC_Settings_Emails extends WC_Settings_Page {
'https://wordpress.org/plugins/wp-mail-logging/',
'https://docs.woocommerce.com/document/email-faq'
);
$settings = apply_filters(
'woocommerce_email_settings',
$settings =
array(
array(
'title' => __( 'Email notifications', 'woocommerce' ),
@ -217,8 +216,7 @@ class WC_Settings_Emails extends WC_Settings_Page {
'type' => 'sectionend',
'id' => 'email_merchant_notes',
),
)
);
);
return apply_filters( 'woocommerce_email_settings', $settings );
}

View File

@ -11,124 +11,148 @@ if ( ! defined( 'ABSPATH' ) ) {
exit;
}
$current_section_name = __( 'Browse Categories', 'woocommerce' );
?>
<div class="wrap woocommerce wc_addons_wrap">
<nav class="nav-tab-wrapper woo-nav-tab-wrapper">
<a href="<?php echo esc_url( admin_url( 'admin.php?page=wc-addons' ) ); ?>" class="nav-tab nav-tab-active"><?php esc_html_e( 'Browse Extensions', 'woocommerce' ); ?></a>
<?php
$count_html = WC_Helper_Updater::get_updates_count_html();
// translators: Count of updates for WooCommerce.com subscriptions.
$menu_title = sprintf( __( 'WooCommerce.com Subscriptions %s', 'woocommerce' ), $count_html );
?>
<a href="<?php echo esc_url( admin_url( 'admin.php?page=wc-addons&section=helper' ) ); ?>" class="nav-tab"><?php echo wp_kses_post( $menu_title ); ?></a>
</nav>
<h1 class="screen-reader-text"><?php esc_html_e( 'WooCommerce Extensions', 'woocommerce' ); ?></h1>
<div class="woocommerce wc-addons-wrap">
<h1 class="screen-reader-text"><?php esc_html_e( 'Marketplace', 'woocommerce' ); ?></h1>
<?php if ( $sections ) : ?>
<ul class="subsubsub">
<?php foreach ( $sections as $section ) : ?>
<li>
<a
class="<?php echo $current_section === $section->slug ? 'current' : ''; ?>"
href="<?php echo esc_url( admin_url( 'admin.php?page=wc-addons&section=' . esc_attr( $section->slug ) ) ); ?>">
<?php echo esc_html( $section->label ); ?>
</a>
</li>
<?php endforeach; ?>
</ul>
<?php if ( isset( $_GET['search'] ) ) : // phpcs:ignore WordPress.Security.NonceVerification.Recommended ?>
<h1 class="search-form-title" >
<?php // translators: search keyword. ?>
<?php printf( esc_html__( 'Showing search results for: %s', 'woocommerce' ), '<strong>' . esc_html( sanitize_text_field( wp_unslash( $_GET['search'] ) ) ) . '</strong>' ); // phpcs:ignore WordPress.Security.NonceVerification.Recommended ?>
</h1>
<?php endif; ?>
<form class="search-form" method="GET">
<button type="submit">
<span class="dashicons dashicons-search"></span>
</button>
<div class="marketplace-header">
<h1 class="marketplace-header__title"><?php esc_html_e( 'WooCommerce Marketplace', 'woocommerce' ); ?></h1>
<p class="marketplace-header__description"><?php esc_html_e( 'Grow your business with hundreds of free and paid WooCommerce extensions.', 'woocommerce' ); ?></p>
<form class="marketplace-header__search-form" method="GET">
<input
type="text"
name="search"
value="<?php echo esc_attr( isset( $_GET['search'] ) ? sanitize_text_field( wp_unslash( $_GET['search'] ) ) : '' ); // phpcs:ignore WordPress.Security.NonceVerification.Recommended ?>"
placeholder="<?php esc_attr_e( 'Enter a search term and press enter', 'woocommerce' ); ?>">
value="<?php echo esc_attr( ! empty( $search ) ? sanitize_text_field( wp_unslash( $search ) ) : '' ); ?>"
placeholder="<?php esc_attr_e( 'Search for extensions', 'woocommerce' ); ?>"
/>
<button type="submit">
<span class="dashicons dashicons-search"></span>
</button>
<input type="hidden" name="page" value="wc-addons">
<input type="hidden" name="section" value="_all">
</form>
<?php if ( '_featured' === $current_section ) : ?>
<div class="addons-featured">
<?php
</div>
<div class="top-bar">
<div id="marketplace-current-section-dropdown" class="current-section-dropdown">
<ul>
<?php foreach ( $sections as $section ) : ?>
<?php
if ( $current_section === $section->slug && '_featured' !== $section->slug ) {
$current_section_name = $section->label;
}
?>
<li>
<a
class="<?php echo $current_section === $section->slug ? 'current' : ''; ?>"
href="<?php echo esc_url( admin_url( 'admin.php?page=wc-addons&section=' . esc_attr( $section->slug ) ) ); ?>">
<?php echo esc_html( $section->label ); ?>
</a>
</li>
<?php endforeach; ?>
</ul>
<div id="marketplace-current-section-name" class="current-section-name"><?php echo esc_html( $current_section_name ); ?></div>
</div>
</div>
<div class="wp-header-end"></div>
<div class="wrap">
<div class="marketplace-content-wrapper">
<?php if ( ! empty( $search ) ) : ?>
<h1 class="search-form-title">
<?php // translators: search keyword. ?>
<?php printf( esc_html__( 'Search results for "%s"', 'woocommerce' ), esc_html( sanitize_text_field( wp_unslash( $search ) ) ) ); ?>
</h1>
<?php endif; ?>
<?php if ( '_featured' === $current_section ) : ?>
<div class="addons-featured">
<?php
$featured = WC_Admin_Addons::get_featured();
?>
?>
</div>
<?php endif; ?>
<?php if ( '_featured' !== $current_section && $addons ) : ?>
<?php if ( 'shipping_methods' === $current_section ) : ?>
<div class="addons-shipping-methods">
<?php WC_Admin_Addons::output_wcs_banner_block(); ?>
</div>
<?php endif; ?>
<?php if ( 'payment-gateways' === $current_section ) : ?>
<div class="addons-shipping-methods">
<?php WC_Admin_Addons::output_wcpay_banner_block(); ?>
</div>
<?php endif; ?>
<ul class="products">
<?php foreach ( $addons as $addon ) : ?>
<?php
if ( 'shipping_methods' === $current_section ) {
// Do not show USPS or Canada Post extensions for US and CA stores, respectively.
$country = WC()->countries->get_base_country();
if ( 'US' === $country
&& false !== strpos(
$addon->link,
'woocommerce.com/products/usps-shipping-method'
)
) {
continue;
}
if ( 'CA' === $country
&& false !== strpos(
$addon->link,
'woocommerce.com/products/canada-post-shipping-method'
)
) {
continue;
}
}
?>
<li class="product">
<div class="product-details">
<?php if ( ! empty( $addon->image ) ) : ?>
<span class="product-img-wrap"><img src="<?php echo esc_url( $addon->image ); ?>" /></span>
<?php endif; ?>
<a href="<?php echo esc_url( WC_Admin_Addons::add_in_app_purchase_url_params( $addon->link ) ); ?>">
<h2><?php echo esc_html( $addon->title ); ?></h2>
</a>
<p><?php echo wp_kses_post( $addon->excerpt ); ?></p>
</div>
<div class="product-footer">
<?php if ( '&#36;0.00' === $addon->price ) : ?>
<span class="price"><?php esc_html_e( 'Free', 'woocommerce' ); ?></span>
<?php else : ?>
<span class="price"><?php echo wp_kses_post( $addon->price ); ?></span>
<span class="price_suffix"><?php esc_html_e( 'per year', 'woocommerce' ); ?></span>
<?php endif; ?>
<a class="button" href="<?php echo esc_url( WC_Admin_Addons::add_in_app_purchase_url_params( $addon->link ) ); ?>">
<?php esc_html_e( 'View details', 'woocommerce' ); ?>
</a>
</div>
</li>
<?php endforeach; ?>
</ul>
<?php endif; ?>
</div>
<?php else : ?>
<?php /* translators: a url */ ?>
<p><?php printf( wp_kses_post( __( 'Our catalog of WooCommerce Extensions can be found on WooCommerce.com here: <a href="%s">WooCommerce Extensions Catalog</a>', 'woocommerce' ) ), 'https://woocommerce.com/product-category/woocommerce-extensions/' ); ?></p>
<?php endif; ?>
<?php if ( 'Storefront' !== $theme['Name'] && '_featured' !== $current_section ) : ?>
<div class="storefront">
<a href="<?php echo esc_url( 'https://woocommerce.com/storefront/' ); ?>" target="_blank"><img src="<?php echo esc_url( WC()->plugin_url() ); ?>/assets/images/storefront.png" alt="<?php esc_attr_e( 'Storefront', 'woocommerce' ); ?>" /></a>
<h2><?php esc_html_e( 'Looking for a WooCommerce theme?', 'woocommerce' ); ?></h2>
<p><?php echo wp_kses_post( __( 'We recommend Storefront, the <em>official</em> WooCommerce theme.', 'woocommerce' ) ); ?></p>
<p><?php echo wp_kses_post( __( 'Storefront is an intuitive, flexible and <strong>free</strong> WordPress theme offering deep integration with WooCommerce and many of the most popular customer-facing extensions.', 'woocommerce' ) ); ?></p>
<p>
<a href="https://woocommerce.com/storefront/" target="_blank" class="button"><?php esc_html_e( 'Read all about it', 'woocommerce' ); ?></a>
<a href="<?php echo esc_url( wp_nonce_url( self_admin_url( 'update.php?action=install-theme&theme=storefront' ), 'install-theme_storefront' ) ); ?>" class="button button-primary"><?php esc_html_e( 'Download &amp; install', 'woocommerce' ); ?></a>
</p>
</div>
<?php endif; ?>
<?php if ( '_featured' !== $current_section && $addons ) : ?>
<?php if ( 'shipping_methods' === $current_section ) : ?>
<div class="addons-shipping-methods">
<?php WC_Admin_Addons::output_wcs_banner_block(); ?>
</div>
<?php endif; ?>
<?php if ( 'payment-gateways' === $current_section ) : ?>
<div class="addons-shipping-methods">
<?php WC_Admin_Addons::output_wcpay_banner_block(); ?>
</div>
<?php endif; ?>
<ul class="products">
<?php foreach ( $addons as $addon ) : ?>
<?php
if ( 'shipping_methods' === $current_section ) {
// Do not show USPS or Canada Post extensions for US and CA stores, respectively.
$country = WC()->countries->get_base_country();
if ( 'US' === $country
&& false !== strpos(
$addon->link,
'woocommerce.com/products/usps-shipping-method'
)
) {
continue;
}
if ( 'CA' === $country
&& false !== strpos(
$addon->link,
'woocommerce.com/products/canada-post-shipping-method'
)
) {
continue;
}
}
?>
<li class="product">
<a href="<?php echo esc_attr( WC_Admin_Addons::add_in_app_purchase_url_params( $addon->link ) ); ?>">
<?php if ( ! empty( $addon->image ) ) : ?>
<span class="product-img-wrap"><img src="<?php echo esc_url( $addon->image ); ?>"/></span>
<?php else : ?>
<h2><?php echo esc_html( $addon->title ); ?></h2>
<?php endif; ?>
<span class="price"><?php echo wp_kses_post( $addon->price ); ?></span>
<p><?php echo wp_kses_post( $addon->excerpt ); ?></p>
</a>
</li>
<?php endforeach; ?>
</ul>
<?php endif; ?>
<?php else : ?>
<?php /* translators: a url */ ?>
<p><?php printf( wp_kses_post( __( 'Our catalog of WooCommerce Extensions can be found on WooCommerce.com here: <a href="%s">WooCommerce Extensions Catalog</a>', 'woocommerce' ) ), 'https://woocommerce.com/product-category/woocommerce-extensions/' ); ?></p>
<?php endif; ?>
<?php if ( 'Storefront' !== $theme['Name'] && '_featured' !== $current_section ) : ?>
<div class="storefront">
<a href="<?php echo esc_url( 'https://woocommerce.com/storefront/' ); ?>" target="_blank"><img src="<?php echo esc_url( WC()->plugin_url() ); ?>/assets/images/storefront.png" alt="<?php esc_attr_e( 'Storefront', 'woocommerce' ); ?>" /></a>
<h2><?php esc_html_e( 'Looking for a WooCommerce theme?', 'woocommerce' ); ?></h2>
<p><?php echo wp_kses_post( __( 'We recommend Storefront, the <em>official</em> WooCommerce theme.', 'woocommerce' ) ); ?></p>
<p><?php echo wp_kses_post( __( 'Storefront is an intuitive, flexible and <strong>free</strong> WordPress theme offering deep integration with WooCommerce and many of the most popular customer-facing extensions.', 'woocommerce' ) ); ?></p>
<p>
<a href="https://woocommerce.com/storefront/" target="_blank" class="button"><?php esc_html_e( 'Read all about it', 'woocommerce' ); ?></a>
<a href="<?php echo esc_url( wp_nonce_url( self_admin_url( 'update.php?action=install-theme&theme=storefront' ), 'install-theme_storefront' ) ); ?>" class="button button-primary"><?php esc_html_e( 'Download &amp; install', 'woocommerce' ); ?></a>
</p>
</div>
<?php endif; ?>
</div>
</div>

View File

@ -226,7 +226,7 @@ final class WC_Cart_Totals {
$item->taxable = 'taxable' === $cart_item['data']->get_tax_status();
$item->price_includes_tax = wc_prices_include_tax();
$item->quantity = $cart_item['quantity'];
$item->price = wc_add_number_precision_deep( $cart_item['data']->get_price() * $cart_item['quantity'] );
$item->price = wc_add_number_precision_deep( (float) $cart_item['data']->get_price() * (float) $cart_item['quantity'] );
$item->product = $cart_item['data'];
$item->tax_rates = $this->get_item_tax_rates( $item );
$this->items[ $cart_item_key ] = $item;

View File

@ -809,6 +809,7 @@ class WC_Countries {
'AF' => array(
'state' => array(
'required' => false,
'hidden' => true,
),
),
'AO' => array(
@ -826,6 +827,7 @@ class WC_Countries {
),
'state' => array(
'required' => false,
'hidden' => true,
),
),
'AU' => array(
@ -845,6 +847,7 @@ class WC_Countries {
),
'state' => array(
'required' => false,
'hidden' => true,
),
),
'BA' => array(
@ -871,7 +874,7 @@ class WC_Countries {
),
'state' => array(
'required' => false,
'label' => __( 'Province', 'woocommerce' ),
'hidden' => true,
),
),
'BH' => array(
@ -880,11 +883,13 @@ class WC_Countries {
),
'state' => array(
'required' => false,
'hidden' => true,
),
),
'BI' => array(
'state' => array(
'required' => false,
'hidden' => true,
),
),
'BO' => array(
@ -949,6 +954,7 @@ class WC_Countries {
'CZ' => array(
'state' => array(
'required' => false,
'hidden' => true,
),
),
'DE' => array(
@ -975,6 +981,7 @@ class WC_Countries {
),
'state' => array(
'required' => false,
'hidden' => true,
),
),
'FI' => array(
@ -983,6 +990,7 @@ class WC_Countries {
),
'state' => array(
'required' => false,
'hidden' => true,
),
),
'FR' => array(
@ -991,6 +999,7 @@ class WC_Countries {
),
'state' => array(
'required' => false,
'hidden' => true,
),
),
'GH' => array(
@ -1004,11 +1013,13 @@ class WC_Countries {
'GP' => array(
'state' => array(
'required' => false,
'hidden' => true,
),
),
'GF' => array(
'state' => array(
'required' => false,
'hidden' => true,
),
),
'GR' => array(
@ -1082,6 +1093,7 @@ class WC_Countries {
),
'state' => array(
'required' => false,
'hidden' => true,
),
),
'IL' => array(
@ -1090,11 +1102,13 @@ class WC_Countries {
),
'state' => array(
'required' => false,
'hidden' => true,
),
),
'IM' => array(
'state' => array(
'required' => false,
'hidden' => true,
),
),
'IN' => array(
@ -1158,11 +1172,13 @@ class WC_Countries {
'KR' => array(
'state' => array(
'required' => false,
'hidden' => true,
),
),
'KW' => array(
'state' => array(
'required' => false,
'hidden' => true,
),
),
'LV' => array(
@ -1174,16 +1190,19 @@ class WC_Countries {
'LB' => array(
'state' => array(
'required' => false,
'hidden' => true,
),
),
'MQ' => array(
'state' => array(
'required' => false,
'hidden' => true,
),
),
'MT' => array(
'state' => array(
'required' => false,
'hidden' => true,
),
),
'MZ' => array(
@ -1201,7 +1220,7 @@ class WC_Countries {
),
'state' => array(
'required' => false,
'label' => __( 'Province', 'woocommerce' ),
'hidden' => true,
),
),
'NG' => array(
@ -1229,6 +1248,7 @@ class WC_Countries {
),
'state' => array(
'required' => false,
'hidden' => true,
),
),
'NP' => array(
@ -1245,6 +1265,7 @@ class WC_Countries {
),
'state' => array(
'required' => false,
'hidden' => true,
),
),
'PR' => array(
@ -1259,11 +1280,13 @@ class WC_Countries {
'PT' => array(
'state' => array(
'required' => false,
'hidden' => true,
),
),
'RE' => array(
'state' => array(
'required' => false,
'hidden' => true,
),
),
'RO' => array(
@ -1287,6 +1310,7 @@ class WC_Countries {
'SG' => array(
'state' => array(
'required' => false,
'hidden' => true,
),
'city' => array(
'required' => false,
@ -1298,6 +1322,7 @@ class WC_Countries {
),
'state' => array(
'required' => false,
'hidden' => true,
),
),
'SI' => array(
@ -1306,6 +1331,7 @@ class WC_Countries {
),
'state' => array(
'required' => false,
'hidden' => true,
),
),
'SR' => array(
@ -1334,11 +1360,13 @@ class WC_Countries {
'LK' => array(
'state' => array(
'required' => false,
'hidden' => true,
),
),
'LU' => array(
'state' => array(
'required' => false,
'hidden' => true,
),
),
'MD' => array(
@ -1427,6 +1455,7 @@ class WC_Countries {
'YT' => array(
'state' => array(
'required' => false,
'hidden' => true,
),
),
'ZA' => array(

View File

@ -78,6 +78,14 @@ class WC_Customer extends WC_Legacy_Customer {
*/
protected $calculated_shipping = false;
/**
* This is the name of this object type.
*
* @since 5.6.0
* @var string
*/
protected $object_type = 'customer';
/**
* Load customer data based on how WC_Customer is called.
*
@ -118,16 +126,6 @@ class WC_Customer extends WC_Legacy_Customer {
}
}
/**
* Prefix for action and filter hooks on data.
*
* @since 3.0.0
* @return string
*/
protected function get_hook_prefix() {
return 'woocommerce_customer_get_';
}
/**
* Delete a customer and reassign posts..
*

View File

@ -84,7 +84,7 @@ class WC_Discounts {
$item->object = $cart_item;
$item->product = $cart_item['data'];
$item->quantity = $cart_item['quantity'];
$item->price = wc_add_number_precision_deep( $item->product->get_price() * $item->quantity );
$item->price = wc_add_number_precision_deep( (float) $item->product->get_price() * (float) $item->quantity );
$this->items[ $key ] = $item;
}

View File

@ -266,7 +266,7 @@ class WC_Post_Types {
if ( 1 === $tax->attribute_public && sanitize_title( $tax->attribute_name ) ) {
$taxonomy_data['rewrite'] = array(
'slug' => trailingslashit( $permalinks['attribute_rewrite_slug'] ) . sanitize_title( $tax->attribute_name ),
'slug' => trailingslashit( $permalinks['attribute_rewrite_slug'] ) . urldecode( sanitize_title( $tax->attribute_name ) ),
'with_front' => false,
'hierarchical' => true,
);
@ -344,7 +344,7 @@ class WC_Post_Types {
'item_link' => __( 'Product Link', 'woocommerce' ),
'item_link_description' => __( 'A link to a product.', 'woocommerce' ),
),
'description' => __( 'This is where you can add new products to your store.', 'woocommerce' ),
'description' => __( 'This is where you can browse products in this store.', 'woocommerce' ),
'public' => true,
'show_ui' => true,
'menu_icon' => 'dashicons-archive',

View File

@ -86,7 +86,7 @@ class WC_Privacy extends WC_Abstract_Privacy {
'<h2>' . __( 'What we collect and store', 'woocommerce' ) . '</h2>' .
'<p>' . __( 'While you visit our site, well track:', 'woocommerce' ) . '</p>' .
'<ul>' .
'<li>' . __( 'Products youve viewed: well use this to, for example, show you products youve recently viewed', 'woocommerce' ) . '</li>' .
'<li>' . __( 'Products youve viewed: well use this to, for example, show you products youve recently viewed', 'woocommerce' ) . '</li>' .
'<li>' . __( 'Location, IP address and browser type: well use this for purposes like estimating taxes and shipping', 'woocommerce' ) . '</li>' .
'<li>' . __( 'Shipping address: well ask you to enter this so we can, for instance, estimate shipping before you place an order, and send you the order!', 'woocommerce' ) . '</li>' .
'</ul>' .

View File

@ -160,9 +160,6 @@ class WC_Tracker {
// Template overrides.
$data['template_overrides'] = self::get_all_template_overrides();
// Template overrides.
$data['admin_user_agents'] = self::get_admin_user_agents();
// Cart & checkout tech (blocks or shortcodes).
$data['cart_checkout'] = self::get_cart_checkout_info();
@ -619,6 +616,8 @@ class WC_Tracker {
'version' => WC()->version,
'currency' => get_woocommerce_currency(),
'base_location' => WC()->countries->get_base_country(),
'base_state' => WC()->countries->get_base_state(),
'base_postcode' => WC()->countries->get_base_postcode(),
'selling_locations' => WC()->countries->get_allowed_countries(),
'api_enabled' => get_option( 'woocommerce_api_enabled' ),
'weight_unit' => get_option( 'woocommerce_weight_unit' ),
@ -675,15 +674,6 @@ class WC_Tracker {
return $override_data;
}
/**
* When an admin user logs in, there user agent is tracked in user meta and collected here.
*
* @return array
*/
private static function get_admin_user_agents() {
return array_filter( (array) get_option( 'woocommerce_tracker_ua', array() ) );
}
/**
* Search a specific post for text content.
*

View File

@ -27,7 +27,7 @@ final class WooCommerce {
*
* @var string
*/
public $version = '5.6.0';
public $version = '5.8.0';
/**
* WooCommerce Schema version.

View File

@ -362,7 +362,7 @@ class WC_Payment_Token_Data_Store extends WC_Data_Store_WP implements WC_Payment
global $wpdb;
$wpdb->update(
$wpdb->prefix . 'woocommerce_payment_tokens',
array( 'is_default' => $status ),
array( 'is_default' => (int) $status ),
array(
'token_id' => $token_id,
)

View File

@ -289,22 +289,40 @@ abstract class WC_REST_CRUD_Controller extends WC_REST_Posts_Controller {
$args['orderby'] = 'date ID';
}
$args['date_query'] = array();
// Set before into date query. Date query must be specified as an array of an array.
$date_query = array();
$use_gmt = $request['dates_are_gmt'];
if ( isset( $request['before'] ) ) {
$args['date_query'][0]['before'] = $request['before'];
$date_query[] = array(
'column' => $use_gmt ? 'post_date_gmt' : 'post_date',
'before' => $request['before'],
);
}
// Set after into date query. Date query must be specified as an array of an array.
if ( isset( $request['after'] ) ) {
$args['date_query'][0]['after'] = $request['after'];
$date_query[] = array(
'column' => $use_gmt ? 'post_date_gmt' : 'post_date',
'after' => $request['after'],
);
}
// Check flag to use post_date vs post_date_gmt.
if ( true === $request['dates_are_gmt'] ) {
if ( isset( $request['before'] ) || isset( $request['after'] ) ) {
$args['date_query'][0]['column'] = 'post_date_gmt';
}
if ( isset( $request['modified_before'] ) ) {
$date_query[] = array(
'column' => $use_gmt ? 'post_modified_gmt' : 'post_modified',
'before' => $request['modified_before'],
);
}
if ( isset( $request['modified_after'] ) ) {
$date_query[] = array(
'column' => $use_gmt ? 'post_modified_gmt' : 'post_modified',
'after' => $request['modified_after'],
);
}
if ( ! empty( $date_query ) ) {
$date_query['relation'] = 'AND';
$args['date_query'] = $date_query;
}
// Force the post_type argument, since it's not a user input variable.
@ -358,7 +376,10 @@ abstract class WC_REST_CRUD_Controller extends WC_REST_Posts_Controller {
* @return WP_Error|WP_REST_Response
*/
public function get_items( $request ) {
$query_args = $this->prepare_objects_query( $request );
$query_args = $this->prepare_objects_query( $request );
if ( is_wp_error( current( $query_args ) ) ) {
return current( $query_args );
}
$query_results = $this->get_objects( $query_args );
$objects = array();
@ -367,7 +388,7 @@ abstract class WC_REST_CRUD_Controller extends WC_REST_Posts_Controller {
continue;
}
$data = $this->prepare_object_for_response( $object, $request );
$data = $this->prepare_object_for_response( $object, $request );
$objects[] = $this->prepare_response_for_collection( $data );
}
@ -388,7 +409,7 @@ abstract class WC_REST_CRUD_Controller extends WC_REST_Posts_Controller {
$attrib_name_end = strpos( $attrib_name_match[0], '>', $attrib_name_match[1] );
$attrib_name = substr( $attrib_name_match[0], $beginning_offset, $attrib_name_end - $beginning_offset );
if ( isset( $request[ $attrib_name ] ) ) {
$base = str_replace( "(?P<$attrib_name>[\d]+)", $request[ $attrib_name ], $base );
$base = str_replace( "(?P<$attrib_name>[\d]+)", $request[ $attrib_name ], $base );
}
}
}
@ -513,7 +534,7 @@ abstract class WC_REST_CRUD_Controller extends WC_REST_Posts_Controller {
*/
protected function prepare_links( $object, $request ) {
$links = array(
'self' => array(
'self' => array(
'href' => rest_url( sprintf( '/%s/%s/%d', $this->namespace, $this->rest_base, $object->get_id() ) ),
),
'collection' => array(
@ -534,83 +555,95 @@ abstract class WC_REST_CRUD_Controller extends WC_REST_Posts_Controller {
$params['context'] = $this->get_context_param();
$params['context']['default'] = 'view';
$params['page'] = array(
'description' => __( 'Current page of the collection.', 'woocommerce' ),
'type' => 'integer',
'default' => 1,
'sanitize_callback' => 'absint',
'validate_callback' => 'rest_validate_request_arg',
'minimum' => 1,
$params['page'] = array(
'description' => __( 'Current page of the collection.', 'woocommerce' ),
'type' => 'integer',
'default' => 1,
'sanitize_callback' => 'absint',
'validate_callback' => 'rest_validate_request_arg',
'minimum' => 1,
);
$params['per_page'] = array(
'description' => __( 'Maximum number of items to be returned in result set.', 'woocommerce' ),
'type' => 'integer',
'default' => 10,
'minimum' => 1,
'maximum' => 100,
'sanitize_callback' => 'absint',
'validate_callback' => 'rest_validate_request_arg',
$params['per_page'] = array(
'description' => __( 'Maximum number of items to be returned in result set.', 'woocommerce' ),
'type' => 'integer',
'default' => 10,
'minimum' => 1,
'maximum' => 100,
'sanitize_callback' => 'absint',
'validate_callback' => 'rest_validate_request_arg',
);
$params['search'] = array(
'description' => __( 'Limit results to those matching a string.', 'woocommerce' ),
'type' => 'string',
'sanitize_callback' => 'sanitize_text_field',
'validate_callback' => 'rest_validate_request_arg',
$params['search'] = array(
'description' => __( 'Limit results to those matching a string.', 'woocommerce' ),
'type' => 'string',
'sanitize_callback' => 'sanitize_text_field',
'validate_callback' => 'rest_validate_request_arg',
);
$params['after'] = array(
'description' => __( 'Limit response to resources published after a given ISO8601 compliant date.', 'woocommerce' ),
'type' => 'string',
'format' => 'date-time',
'validate_callback' => 'rest_validate_request_arg',
$params['after'] = array(
'description' => __( 'Limit response to resources published after a given ISO8601 compliant date.', 'woocommerce' ),
'type' => 'string',
'format' => 'date-time',
'validate_callback' => 'rest_validate_request_arg',
);
$params['before'] = array(
'description' => __( 'Limit response to resources published before a given ISO8601 compliant date.', 'woocommerce' ),
'type' => 'string',
'format' => 'date-time',
'validate_callback' => 'rest_validate_request_arg',
$params['before'] = array(
'description' => __( 'Limit response to resources published before a given ISO8601 compliant date.', 'woocommerce' ),
'type' => 'string',
'format' => 'date-time',
'validate_callback' => 'rest_validate_request_arg',
);
$params['dates_are_gmt'] = array(
'description' => __( 'Whether to use GMT post dates.', 'woocommerce' ),
$params['modified_after'] = array(
'description' => __( 'Limit response to resources modified after a given ISO8601 compliant date.', 'woocommerce' ),
'type' => 'string',
'format' => 'date-time',
'validate_callback' => 'rest_validate_request_arg',
);
$params['modified_before'] = array(
'description' => __( 'Limit response to resources modified before a given ISO8601 compliant date.', 'woocommerce' ),
'type' => 'string',
'format' => 'date-time',
'validate_callback' => 'rest_validate_request_arg',
);
$params['dates_are_gmt'] = array(
'description' => __( 'Whether to consider GMT post dates when limiting response by published or modified date.', 'woocommerce' ),
'type' => 'boolean',
'default' => false,
'validate_callback' => 'rest_validate_request_arg',
);
$params['exclude'] = array(
$params['exclude'] = array(
'description' => __( 'Ensure result set excludes specific IDs.', 'woocommerce' ),
'type' => 'array',
'items' => array(
'type' => 'integer',
'type' => 'integer',
),
'default' => array(),
'sanitize_callback' => 'wp_parse_id_list',
);
$params['include'] = array(
$params['include'] = array(
'description' => __( 'Limit result set to specific ids.', 'woocommerce' ),
'type' => 'array',
'items' => array(
'type' => 'integer',
'type' => 'integer',
),
'default' => array(),
'sanitize_callback' => 'wp_parse_id_list',
);
$params['offset'] = array(
'description' => __( 'Offset the result set by a specific number of items.', 'woocommerce' ),
'type' => 'integer',
'sanitize_callback' => 'absint',
'validate_callback' => 'rest_validate_request_arg',
$params['offset'] = array(
'description' => __( 'Offset the result set by a specific number of items.', 'woocommerce' ),
'type' => 'integer',
'sanitize_callback' => 'absint',
'validate_callback' => 'rest_validate_request_arg',
);
$params['order'] = array(
'description' => __( 'Order sort attribute ascending or descending.', 'woocommerce' ),
'type' => 'string',
'default' => 'desc',
'enum' => array( 'asc', 'desc' ),
'validate_callback' => 'rest_validate_request_arg',
$params['order'] = array(
'description' => __( 'Order sort attribute ascending or descending.', 'woocommerce' ),
'type' => 'string',
'default' => 'desc',
'enum' => array( 'asc', 'desc' ),
'validate_callback' => 'rest_validate_request_arg',
);
$params['orderby'] = array(
'description' => __( 'Sort collection by object attribute.', 'woocommerce' ),
'type' => 'string',
'default' => 'date',
'enum' => array(
$params['orderby'] = array(
'description' => __( 'Sort collection by object attribute.', 'woocommerce' ),
'type' => 'string',
'default' => 'date',
'enum' => array(
'date',
'id',
'include',
@ -618,15 +651,15 @@ abstract class WC_REST_CRUD_Controller extends WC_REST_Posts_Controller {
'slug',
'modified',
),
'validate_callback' => 'rest_validate_request_arg',
'validate_callback' => 'rest_validate_request_arg',
);
if ( $this->hierarchical ) {
$params['parent'] = array(
$params['parent'] = array(
'description' => __( 'Limit result set to those of particular parent IDs.', 'woocommerce' ),
'type' => 'array',
'items' => array(
'type' => 'integer',
'type' => 'integer',
),
'sanitize_callback' => 'wp_parse_id_list',
'default' => array(),
@ -635,7 +668,7 @@ abstract class WC_REST_CRUD_Controller extends WC_REST_Posts_Controller {
'description' => __( 'Limit result set to all items except those of a particular parent ID.', 'woocommerce' ),
'type' => 'array',
'items' => array(
'type' => 'integer',
'type' => 'integer',
),
'sanitize_callback' => 'wp_parse_id_list',
'default' => array(),

View File

@ -29,11 +29,15 @@ class WC_Extensions_Tracking {
*/
public function track_extensions_page() {
// phpcs:disable WordPress.Security.NonceVerification.Recommended
$event = 'extensions_view';
$properties = array(
'section' => empty( $_REQUEST['section'] ) ? '_featured' : wc_clean( wp_unslash( $_REQUEST['section'] ) ),
);
$event = 'extensions_view';
if ( 'helper' === $properties['section'] ) {
$event = 'subscriptions_view';
}
if ( ! empty( $_REQUEST['search'] ) ) {
$event = 'extensions_view_search';
$properties['search_term'] = wc_clean( wp_unslash( $_REQUEST['search'] ) );

View File

@ -492,6 +492,19 @@ add_action( 'woocommerce_scheduled_sales', 'wc_scheduled_sales' );
* @return array
*/
function wc_get_attachment_image_attributes( $attr ) {
/*
* If the user can manage woocommerce, allow them to
* see the image content.
*/
if ( current_user_can( 'manage_woocommerce' ) ) {
return $attr;
}
/*
* If the user does not have the right capabilities,
* filter out the image source and replace with placeholder
* image.
*/
if ( isset( $attr['src'] ) && strstr( $attr['src'], 'woocommerce_uploads/' ) ) {
$attr['src'] = wc_placeholder_img_src();
@ -511,7 +524,19 @@ add_filter( 'wp_get_attachment_image_attributes', 'wc_get_attachment_image_attri
* @return array
*/
function wc_prepare_attachment_for_js( $response ) {
/*
* If the user can manage woocommerce, allow them to
* see the image content.
*/
if ( current_user_can( 'manage_woocommerce' ) ) {
return $response;
}
/*
* If the user does not have the right capabilities,
* filter out the image source and replace with placeholder
* image.
*/
if ( isset( $response['url'] ) && strstr( $response['url'], 'woocommerce_uploads/' ) ) {
$response['full']['url'] = wc_placeholder_img_src();
if ( isset( $response['sizes'] ) ) {

View File

@ -2273,7 +2273,22 @@ function wc_update_500_db_version() {
* See @link https://github.com/woocommerce/woocommerce/issues/29235.
*/
function wc_update_560_create_refund_returns_page() {
/**
* Filter on the pages created to return what we expect.
*
* @param array $pages The default WC pages.
*/
function filter_created_pages( $pages ) {
$page_to_create = array( 'refund_returns' );
return array_intersect_key( $pages, array_flip( $page_to_create ) );
}
add_filter( 'woocommerce_create_pages', 'filter_created_pages' );
WC_Install::create_pages();
remove_filter( 'woocommerce_create_pages', 'filter_created_pages' );
}
/**

812
package-lock.json generated
View File

@ -1,6 +1,6 @@
{
"name": "woocommerce",
"version": "5.7.0",
"version": "5.8.0",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
@ -2059,6 +2059,307 @@
"lolex": "^5.0.0"
}
},
"@jest/globals": {
"version": "26.6.2",
"resolved": "https://registry.npmjs.org/@jest/globals/-/globals-26.6.2.tgz",
"integrity": "sha512-85Ltnm7HlB/KesBUuALwQ68YTU72w9H2xW9FjZ1eL1U3lhtefjjl5c2MiUbpXt/i6LaPRvoOFJ22yCBSfQ0JIA==",
"dev": true,
"requires": {
"@jest/environment": "^26.6.2",
"@jest/types": "^26.6.2",
"expect": "^26.6.2"
},
"dependencies": {
"@jest/environment": {
"version": "26.6.2",
"resolved": "https://registry.npmjs.org/@jest/environment/-/environment-26.6.2.tgz",
"integrity": "sha512-nFy+fHl28zUrRsCeMB61VDThV1pVTtlEokBRgqPrcT1JNq4yRNIyTHfyht6PqtUvY9IsuLGTrbG8kPXjSZIZwA==",
"dev": true,
"requires": {
"@jest/fake-timers": "^26.6.2",
"@jest/types": "^26.6.2",
"@types/node": "*",
"jest-mock": "^26.6.2"
}
},
"@jest/fake-timers": {
"version": "26.6.2",
"resolved": "https://registry.npmjs.org/@jest/fake-timers/-/fake-timers-26.6.2.tgz",
"integrity": "sha512-14Uleatt7jdzefLPYM3KLcnUl1ZNikaKq34enpb5XG9i81JpppDb5muZvonvKyrl7ftEHkKS5L5/eB/kxJ+bvA==",
"dev": true,
"requires": {
"@jest/types": "^26.6.2",
"@sinonjs/fake-timers": "^6.0.1",
"@types/node": "*",
"jest-message-util": "^26.6.2",
"jest-mock": "^26.6.2",
"jest-util": "^26.6.2"
}
},
"@jest/types": {
"version": "26.6.2",
"resolved": "https://registry.npmjs.org/@jest/types/-/types-26.6.2.tgz",
"integrity": "sha512-fC6QCp7Sc5sX6g8Tvbmj4XUTbyrik0akgRy03yjXbQaBWWNWGE7SGtJk98m0N8nzegD/7SggrUlivxo5ax4KWQ==",
"dev": true,
"requires": {
"@types/istanbul-lib-coverage": "^2.0.0",
"@types/istanbul-reports": "^3.0.0",
"@types/node": "*",
"@types/yargs": "^15.0.0",
"chalk": "^4.0.0"
}
},
"@types/istanbul-reports": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/@types/istanbul-reports/-/istanbul-reports-3.0.1.tgz",
"integrity": "sha512-c3mAZEuK0lvBp8tmuL74XRKn1+y2dcwOUpH7x4WrF6gk1GIgiluDRgMYQtw2OFcBvAJWlt6ASU3tSqxp0Uu0Aw==",
"dev": true,
"requires": {
"@types/istanbul-lib-report": "*"
}
},
"@types/stack-utils": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/@types/stack-utils/-/stack-utils-2.0.1.tgz",
"integrity": "sha512-Hl219/BT5fLAaz6NDkSuhzasy49dwQS/DSdu4MdggFB8zcXv7vflBI3xp7FEmkmdDkBUI2bPUNeMttp2knYdxw==",
"dev": true
},
"ansi-styles": {
"version": "4.3.0",
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz",
"integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",
"dev": true,
"requires": {
"color-convert": "^2.0.1"
}
},
"braces": {
"version": "3.0.2",
"resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz",
"integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==",
"dev": true,
"requires": {
"fill-range": "^7.0.1"
}
},
"chalk": {
"version": "4.1.2",
"resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz",
"integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==",
"dev": true,
"requires": {
"ansi-styles": "^4.1.0",
"supports-color": "^7.1.0"
}
},
"color-convert": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz",
"integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
"dev": true,
"requires": {
"color-name": "~1.1.4"
}
},
"color-name": {
"version": "1.1.4",
"resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz",
"integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==",
"dev": true
},
"diff-sequences": {
"version": "26.6.2",
"resolved": "https://registry.npmjs.org/diff-sequences/-/diff-sequences-26.6.2.tgz",
"integrity": "sha512-Mv/TDa3nZ9sbc5soK+OoA74BsS3mL37yixCvUAQkiuA4Wz6YtwP/K47n2rv2ovzHZvoiQeA5FTQOschKkEwB0Q==",
"dev": true
},
"escape-string-regexp": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-2.0.0.tgz",
"integrity": "sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w==",
"dev": true
},
"expect": {
"version": "26.6.2",
"resolved": "https://registry.npmjs.org/expect/-/expect-26.6.2.tgz",
"integrity": "sha512-9/hlOBkQl2l/PLHJx6JjoDF6xPKcJEsUlWKb23rKE7KzeDqUZKXKNMW27KIue5JMdBV9HgmoJPcc8HtO85t9IA==",
"dev": true,
"requires": {
"@jest/types": "^26.6.2",
"ansi-styles": "^4.0.0",
"jest-get-type": "^26.3.0",
"jest-matcher-utils": "^26.6.2",
"jest-message-util": "^26.6.2",
"jest-regex-util": "^26.0.0"
}
},
"fill-range": {
"version": "7.0.1",
"resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz",
"integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==",
"dev": true,
"requires": {
"to-regex-range": "^5.0.1"
}
},
"has-flag": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz",
"integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==",
"dev": true
},
"is-number": {
"version": "7.0.0",
"resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz",
"integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==",
"dev": true
},
"jest-diff": {
"version": "26.6.2",
"resolved": "https://registry.npmjs.org/jest-diff/-/jest-diff-26.6.2.tgz",
"integrity": "sha512-6m+9Z3Gv9wN0WFVasqjCL/06+EFCMTqDEUl/b87HYK2rAPTyfz4ZIuSlPhY51PIQRWx5TaxeF1qmXKe9gfN3sA==",
"dev": true,
"requires": {
"chalk": "^4.0.0",
"diff-sequences": "^26.6.2",
"jest-get-type": "^26.3.0",
"pretty-format": "^26.6.2"
}
},
"jest-get-type": {
"version": "26.3.0",
"resolved": "https://registry.npmjs.org/jest-get-type/-/jest-get-type-26.3.0.tgz",
"integrity": "sha512-TpfaviN1R2pQWkIihlfEanwOXK0zcxrKEE4MlU6Tn7keoXdN6/3gK/xl0yEh8DOunn5pOVGKf8hB4R9gVh04ig==",
"dev": true
},
"jest-matcher-utils": {
"version": "26.6.2",
"resolved": "https://registry.npmjs.org/jest-matcher-utils/-/jest-matcher-utils-26.6.2.tgz",
"integrity": "sha512-llnc8vQgYcNqDrqRDXWwMr9i7rS5XFiCwvh6DTP7Jqa2mqpcCBBlpCbn+trkG0KNhPu/h8rzyBkriOtBstvWhw==",
"dev": true,
"requires": {
"chalk": "^4.0.0",
"jest-diff": "^26.6.2",
"jest-get-type": "^26.3.0",
"pretty-format": "^26.6.2"
}
},
"jest-message-util": {
"version": "26.6.2",
"resolved": "https://registry.npmjs.org/jest-message-util/-/jest-message-util-26.6.2.tgz",
"integrity": "sha512-rGiLePzQ3AzwUshu2+Rn+UMFk0pHN58sOG+IaJbk5Jxuqo3NYO1U2/MIR4S1sKgsoYSXSzdtSa0TgrmtUwEbmA==",
"dev": true,
"requires": {
"@babel/code-frame": "^7.0.0",
"@jest/types": "^26.6.2",
"@types/stack-utils": "^2.0.0",
"chalk": "^4.0.0",
"graceful-fs": "^4.2.4",
"micromatch": "^4.0.2",
"pretty-format": "^26.6.2",
"slash": "^3.0.0",
"stack-utils": "^2.0.2"
}
},
"jest-mock": {
"version": "26.6.2",
"resolved": "https://registry.npmjs.org/jest-mock/-/jest-mock-26.6.2.tgz",
"integrity": "sha512-YyFjePHHp1LzpzYcmgqkJ0nm0gg/lJx2aZFzFy1S6eUqNjXsOqTK10zNRff2dNfssgokjkG65OlWNcIlgd3zew==",
"dev": true,
"requires": {
"@jest/types": "^26.6.2",
"@types/node": "*"
}
},
"jest-regex-util": {
"version": "26.0.0",
"resolved": "https://registry.npmjs.org/jest-regex-util/-/jest-regex-util-26.0.0.tgz",
"integrity": "sha512-Gv3ZIs/nA48/Zvjrl34bf+oD76JHiGDUxNOVgUjh3j890sblXryjY4rss71fPtD/njchl6PSE2hIhvyWa1eT0A==",
"dev": true
},
"jest-util": {
"version": "26.6.2",
"resolved": "https://registry.npmjs.org/jest-util/-/jest-util-26.6.2.tgz",
"integrity": "sha512-MDW0fKfsn0OI7MS7Euz6h8HNDXVQ0gaM9uW6RjfDmd1DAFcaxX9OqIakHIqhbnmF08Cf2DLDG+ulq8YQQ0Lp0Q==",
"dev": true,
"requires": {
"@jest/types": "^26.6.2",
"@types/node": "*",
"chalk": "^4.0.0",
"graceful-fs": "^4.2.4",
"is-ci": "^2.0.0",
"micromatch": "^4.0.2"
}
},
"micromatch": {
"version": "4.0.4",
"resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.4.tgz",
"integrity": "sha512-pRmzw/XUcwXGpD9aI9q/0XOwLNygjETJ8y0ao0wdqprrzDa4YnxLcz7fQRZr8voh8V10kGhABbNcHVk5wHgWwg==",
"dev": true,
"requires": {
"braces": "^3.0.1",
"picomatch": "^2.2.3"
}
},
"picomatch": {
"version": "2.3.0",
"resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.0.tgz",
"integrity": "sha512-lY1Q/PiJGC2zOv/z391WOTD+Z02bCgsFfvxoXXf6h7kv9o+WmsmzYqrAwY63sNgOxE4xEdq0WyUnXfKeBrSvYw==",
"dev": true
},
"pretty-format": {
"version": "26.6.2",
"resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-26.6.2.tgz",
"integrity": "sha512-7AeGuCYNGmycyQbCqd/3PWH4eOoX/OiCa0uphp57NVTeAGdJGaAliecxwBDHYQCIvrW7aDBZCYeNTP/WX69mkg==",
"dev": true,
"requires": {
"@jest/types": "^26.6.2",
"ansi-regex": "^5.0.0",
"ansi-styles": "^4.0.0",
"react-is": "^17.0.1"
}
},
"react-is": {
"version": "17.0.2",
"resolved": "https://registry.npmjs.org/react-is/-/react-is-17.0.2.tgz",
"integrity": "sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w==",
"dev": true
},
"slash": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz",
"integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==",
"dev": true
},
"stack-utils": {
"version": "2.0.3",
"resolved": "https://registry.npmjs.org/stack-utils/-/stack-utils-2.0.3.tgz",
"integrity": "sha512-gL//fkxfWUsIlFL2Tl42Cl6+HFALEaB1FU76I/Fy+oZjRreP7OPMXFlGbxM7NQsI0ZpUfw76sHnv0WNYuTb7Iw==",
"dev": true,
"requires": {
"escape-string-regexp": "^2.0.0"
}
},
"supports-color": {
"version": "7.2.0",
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz",
"integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==",
"dev": true,
"requires": {
"has-flag": "^4.0.0"
}
},
"to-regex-range": {
"version": "5.0.1",
"resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz",
"integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==",
"dev": true,
"requires": {
"is-number": "^7.0.0"
}
}
}
},
"@jest/reporters": {
"version": "25.5.1",
"resolved": "https://registry.npmjs.org/@jest/reporters/-/reporters-25.5.1.tgz",
@ -4119,6 +4420,131 @@
"@types/istanbul-lib-report": "*"
}
},
"@types/jest": {
"version": "26.0.23",
"resolved": "https://registry.npmjs.org/@types/jest/-/jest-26.0.23.tgz",
"integrity": "sha512-ZHLmWMJ9jJ9PTiT58juykZpL7KjwJywFN3Rr2pTSkyQfydf/rk22yS7W8p5DaVUMQ2BQC7oYiU3FjbTM/mYrOA==",
"dev": true,
"requires": {
"jest-diff": "^26.0.0",
"pretty-format": "^26.0.0"
},
"dependencies": {
"@jest/types": {
"version": "26.6.2",
"resolved": "https://registry.npmjs.org/@jest/types/-/types-26.6.2.tgz",
"integrity": "sha512-fC6QCp7Sc5sX6g8Tvbmj4XUTbyrik0akgRy03yjXbQaBWWNWGE7SGtJk98m0N8nzegD/7SggrUlivxo5ax4KWQ==",
"dev": true,
"requires": {
"@types/istanbul-lib-coverage": "^2.0.0",
"@types/istanbul-reports": "^3.0.0",
"@types/node": "*",
"@types/yargs": "^15.0.0",
"chalk": "^4.0.0"
}
},
"@types/istanbul-reports": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/@types/istanbul-reports/-/istanbul-reports-3.0.1.tgz",
"integrity": "sha512-c3mAZEuK0lvBp8tmuL74XRKn1+y2dcwOUpH7x4WrF6gk1GIgiluDRgMYQtw2OFcBvAJWlt6ASU3tSqxp0Uu0Aw==",
"dev": true,
"requires": {
"@types/istanbul-lib-report": "*"
}
},
"ansi-styles": {
"version": "4.3.0",
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz",
"integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",
"dev": true,
"requires": {
"color-convert": "^2.0.1"
}
},
"chalk": {
"version": "4.1.2",
"resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz",
"integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==",
"dev": true,
"requires": {
"ansi-styles": "^4.1.0",
"supports-color": "^7.1.0"
}
},
"color-convert": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz",
"integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
"dev": true,
"requires": {
"color-name": "~1.1.4"
}
},
"color-name": {
"version": "1.1.4",
"resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz",
"integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==",
"dev": true
},
"diff-sequences": {
"version": "26.6.2",
"resolved": "https://registry.npmjs.org/diff-sequences/-/diff-sequences-26.6.2.tgz",
"integrity": "sha512-Mv/TDa3nZ9sbc5soK+OoA74BsS3mL37yixCvUAQkiuA4Wz6YtwP/K47n2rv2ovzHZvoiQeA5FTQOschKkEwB0Q==",
"dev": true
},
"has-flag": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz",
"integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==",
"dev": true
},
"jest-diff": {
"version": "26.6.2",
"resolved": "https://registry.npmjs.org/jest-diff/-/jest-diff-26.6.2.tgz",
"integrity": "sha512-6m+9Z3Gv9wN0WFVasqjCL/06+EFCMTqDEUl/b87HYK2rAPTyfz4ZIuSlPhY51PIQRWx5TaxeF1qmXKe9gfN3sA==",
"dev": true,
"requires": {
"chalk": "^4.0.0",
"diff-sequences": "^26.6.2",
"jest-get-type": "^26.3.0",
"pretty-format": "^26.6.2"
}
},
"jest-get-type": {
"version": "26.3.0",
"resolved": "https://registry.npmjs.org/jest-get-type/-/jest-get-type-26.3.0.tgz",
"integrity": "sha512-TpfaviN1R2pQWkIihlfEanwOXK0zcxrKEE4MlU6Tn7keoXdN6/3gK/xl0yEh8DOunn5pOVGKf8hB4R9gVh04ig==",
"dev": true
},
"pretty-format": {
"version": "26.6.2",
"resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-26.6.2.tgz",
"integrity": "sha512-7AeGuCYNGmycyQbCqd/3PWH4eOoX/OiCa0uphp57NVTeAGdJGaAliecxwBDHYQCIvrW7aDBZCYeNTP/WX69mkg==",
"dev": true,
"requires": {
"@jest/types": "^26.6.2",
"ansi-regex": "^5.0.0",
"ansi-styles": "^4.0.0",
"react-is": "^17.0.1"
}
},
"react-is": {
"version": "17.0.2",
"resolved": "https://registry.npmjs.org/react-is/-/react-is-17.0.2.tgz",
"integrity": "sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w==",
"dev": true
},
"supports-color": {
"version": "7.2.0",
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz",
"integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==",
"dev": true,
"requires": {
"has-flag": "^4.0.0"
}
}
}
},
"@types/json-schema": {
"version": "7.0.6",
"resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.6.tgz",
@ -4495,6 +4921,28 @@
"@xtuc/long": "4.2.2"
}
},
"@woocommerce/admin-e2e-tests": {
"version": "0.1.0",
"resolved": "https://registry.npmjs.org/@woocommerce/admin-e2e-tests/-/admin-e2e-tests-0.1.0.tgz",
"integrity": "sha512-QpKLiS6ShIMO0Eb7FbblMwyhYVzV29v+QWIslUizduuzVQxH9i1ow3IZ966xC8b+a1fF7hI/zQp4NNp1CaHNmw==",
"dev": true,
"requires": {
"@jest/globals": "^26.4.2",
"@types/jest": "26.0.23",
"config": "3.3.6"
},
"dependencies": {
"config": {
"version": "3.3.6",
"resolved": "https://registry.npmjs.org/config/-/config-3.3.6.tgz",
"integrity": "sha512-Hj5916C5HFawjYJat1epbyY2PlAgLpBtDUlr0MxGLgo3p5+7kylyvnRY18PqJHgnNWXcdd0eWDemT7eYWuFgwg==",
"dev": true,
"requires": {
"json5": "^2.1.1"
}
}
}
},
"@woocommerce/api": {
"version": "file:tests/e2e/api",
"dev": true,
@ -9227,7 +9675,7 @@
"@jest/test-sequencer": "^25.5.4",
"@slack/web-api": "^6.1.0",
"@woocommerce/api": "^0.2.0",
"@wordpress/e2e-test-utils": "^4.15.0",
"@wordpress/e2e-test-utils": "^4.16.1",
"@wordpress/jest-preset-default": "^6.4.0",
"app-root-path": "^3.0.0",
"jest": "^25.1.0",
@ -9319,7 +9767,7 @@
}
},
"prettier": {
"version": "npm:prettier@1.19.1",
"version": "npm:wp-prettier@1.19.1",
"resolved": "https://registry.npmjs.org/wp-prettier/-/wp-prettier-1.19.1.tgz",
"integrity": "sha512-mqAC2r1NDmRjG+z3KCJ/i61tycKlmADIjxnDhQab+KBxSAGbF/W7/zwB2guy/ypIeKrrftNsIYkNZZQKf3vJcg==",
"dev": true
@ -12210,64 +12658,6 @@
}
}
},
"@wordpress/e2e-test-utils": {
"version": "4.15.0",
"resolved": "https://registry.npmjs.org/@wordpress/e2e-test-utils/-/e2e-test-utils-4.15.0.tgz",
"integrity": "sha512-mCOlNDX/yERd7hIAFB+y9x56iCQ2XyDZkWNlQNMYRH0+EdrQ5H5zE7MSxzycideIC7grxKw/j4RcuyxUdSWGDw==",
"dev": true,
"requires": {
"@babel/runtime": "^7.11.2",
"@wordpress/keycodes": "^2.16.0",
"@wordpress/url": "^2.19.0",
"lodash": "^4.17.19",
"node-fetch": "^2.6.0"
},
"dependencies": {
"@wordpress/i18n": {
"version": "3.16.0",
"resolved": "https://registry.npmjs.org/@wordpress/i18n/-/i18n-3.16.0.tgz",
"integrity": "sha512-ZyRWplETgD90caVaBuGBFcnYVpcogji1g9Ctbb5AO2bGFeHpmPpjvWm0NE64iQTtLFEJoaCiq6oqUvAOPIQJpw==",
"dev": true,
"requires": {
"@babel/runtime": "^7.11.2",
"gettext-parser": "^1.3.1",
"lodash": "^4.17.19",
"memize": "^1.1.0",
"sprintf-js": "^1.1.1",
"tannin": "^1.2.0"
}
},
"@wordpress/keycodes": {
"version": "2.16.0",
"resolved": "https://registry.npmjs.org/@wordpress/keycodes/-/keycodes-2.16.0.tgz",
"integrity": "sha512-8CfxB+9f08FXMUsaO625abmbx2ZinFUz6upzXbe0Da8W3oy7+/TZz6EWsMVBEWz+alSR3Z2FUZ7xUuopHZFcow==",
"dev": true,
"requires": {
"@babel/runtime": "^7.11.2",
"@wordpress/i18n": "^3.16.0",
"lodash": "^4.17.19"
}
},
"@wordpress/url": {
"version": "2.19.0",
"resolved": "https://registry.npmjs.org/@wordpress/url/-/url-2.19.0.tgz",
"integrity": "sha512-RizWbBxYmWBlNd+q89r3N6Y2XO8eCG3VncnXDgbGnhV4e+2z9fjzp1/9C/SORftEn+ix/qBKbqygmkmBqb+wuw==",
"dev": true,
"requires": {
"@babel/runtime": "^7.11.2",
"lodash": "^4.17.19",
"qs": "^6.5.2",
"react-native-url-polyfill": "^1.1.2"
}
},
"node-fetch": {
"version": "2.6.1",
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.1.tgz",
"integrity": "sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw==",
"dev": true
}
}
},
"@wordpress/eslint-plugin": {
"version": "4.1.0",
"resolved": "https://registry.npmjs.org/@wordpress/eslint-plugin/-/eslint-plugin-4.1.0.tgz",
@ -20766,125 +21156,32 @@
"dev": true,
"requires": {
"@wordpress/deprecated": "^2.10.0",
"@wordpress/e2e-test-utils": "^4.6.0",
"@wordpress/e2e-test-utils": "^4.16.1",
"config": "3.3.3",
"faker": "^5.1.0",
"fishery": "^1.2.0"
},
"dependencies": {
"@babel/runtime": {
"version": "7.11.2",
"resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.11.2.tgz",
"integrity": "sha512-TeWkU52so0mPtDcaCTxNBI/IHiz0pZgr8VEFqXFtZWpYD08ZB6FaSwVAS8MKRQAP3bYKiVjwysOJgMFY28o6Tw==",
"version": "7.15.3",
"resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.15.3.tgz",
"integrity": "sha512-OvwMLqNXkCXSz1kSm58sEsNuhqOx/fKpnUnKnFB5v8uDda5bLNEHNgKPvhDN6IU0LDcnHQ90LlJ0Q6jnyBSIBA==",
"dev": true,
"requires": {
"regenerator-runtime": "^0.13.4"
}
},
"@tannin/compile": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/@tannin/compile/-/compile-1.1.0.tgz",
"integrity": "sha512-n8m9eNDfoNZoxdvWiTfW/hSPhehzLJ3zW7f8E7oT6mCROoMNWCB4TYtv041+2FMAxweiE0j7i1jubQU4MEC/Gg==",
"dev": true,
"requires": {
"@tannin/evaluate": "^1.2.0",
"@tannin/postfix": "^1.1.0"
}
},
"@tannin/evaluate": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/@tannin/evaluate/-/evaluate-1.2.0.tgz",
"integrity": "sha512-3ioXvNowbO/wSrxsDG5DKIMxC81P0QrQTYai8zFNY+umuoHWRPbQ/TuuDEOju9E+jQDXmj6yI5GyejNuh8I+eg==",
"dev": true
},
"@tannin/plural-forms": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/@tannin/plural-forms/-/plural-forms-1.1.0.tgz",
"integrity": "sha512-xl9R2mDZO/qiHam1AgMnAES6IKIg7OBhcXqy6eDsRCdXuxAFPcjrej9HMjyCLE0DJ/8cHf0i5OQTstuBRhpbHw==",
"dev": true,
"requires": {
"@tannin/compile": "^1.1.0"
}
},
"@tannin/postfix": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/@tannin/postfix/-/postfix-1.1.0.tgz",
"integrity": "sha512-oocsqY7g0cR+Gur5jRQLSrX2OtpMLMse1I10JQBm8CdGMrDkh1Mg2gjsiquMHRtBs4Qwu5wgEp5GgIYHk4SNPw==",
"dev": true
},
"@wordpress/e2e-test-utils": {
"version": "4.6.0",
"resolved": "https://registry.npmjs.org/@wordpress/e2e-test-utils/-/e2e-test-utils-4.6.0.tgz",
"integrity": "sha512-oqnFEOuWkUFwzSVGeKZOfs9YhWVyCKdsOtJKnXd6Vv5Q1quq2fmbDp6HL+dIUI2DlJZISUmOWG4B37mMVA0DLg==",
"version": "4.16.1",
"resolved": "https://registry.npmjs.org/@wordpress/e2e-test-utils/-/e2e-test-utils-4.16.1.tgz",
"integrity": "sha512-Dpsq5m0VSvjIhro2MjACSzkOkOf1jGEryzgEMW1ikbT6YI+motspHfGtisKXgYhZJOnjV4PwuEg+9lPVnd971g==",
"dev": true,
"requires": {
"@babel/runtime": "^7.9.2",
"@wordpress/keycodes": "^2.12.0",
"@wordpress/url": "^2.14.0",
"lodash": "^4.17.15",
"node-fetch": "^1.7.3"
}
},
"@wordpress/i18n": {
"version": "3.15.0",
"resolved": "https://registry.npmjs.org/@wordpress/i18n/-/i18n-3.15.0.tgz",
"integrity": "sha512-AawJgHEGPyMoPATl8a3Qa+cCZV3S6azPfvqeStbN2pSc7v0HqYhJhWaw80WToHkN4kyOsfu1PUVf1wefuoMNEA==",
"dev": true,
"requires": {
"@babel/runtime": "^7.9.2",
"gettext-parser": "^1.3.1",
"@babel/runtime": "^7.12.5",
"@wordpress/keycodes": "^2.18.0",
"@wordpress/url": "^2.21.0",
"lodash": "^4.17.19",
"memize": "^1.1.0",
"sprintf-js": "^1.1.1",
"tannin": "^1.2.0"
}
},
"@wordpress/keycodes": {
"version": "2.15.0",
"resolved": "https://registry.npmjs.org/@wordpress/keycodes/-/keycodes-2.15.0.tgz",
"integrity": "sha512-XHyBmhzWjp0svzwiGLOwovlQHH42KkACKTfakDizB5OaaAzlmgZ34Fdl03S7pWl+HUBa7MqItRhGsd4kxdo0bQ==",
"dev": true,
"requires": {
"@babel/runtime": "^7.9.2",
"@wordpress/i18n": "^3.15.0",
"lodash": "^4.17.19"
}
},
"@wordpress/url": {
"version": "2.18.0",
"resolved": "https://registry.npmjs.org/@wordpress/url/-/url-2.18.0.tgz",
"integrity": "sha512-FX6CYVG8vYgQnxjA9SsWTDAWPHarPSBIGk2shZ3I+cq+LV31dDaAz8OhvVMD6rvUoQW0INlWe1t2JKXoHhcTcw==",
"dev": true,
"requires": {
"@babel/runtime": "^7.9.2",
"lodash": "^4.17.19",
"qs": "^6.5.2",
"react-native-url-polyfill": "^1.1.2"
}
},
"base64-js": {
"version": "1.3.1",
"resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.3.1.tgz",
"integrity": "sha512-mLQ4i2QO1ytvGWFWmcngKO//JXAQueZvwEKtjgQFM4jIK0kU+ytMfplL8j+n5mspOfjHwoAg+9yhb7BwAHm36g==",
"dev": true
},
"buffer": {
"version": "5.6.0",
"resolved": "https://registry.npmjs.org/buffer/-/buffer-5.6.0.tgz",
"integrity": "sha512-/gDYp/UtU0eA1ys8bOs9J6a+E/KWIY+DZ+Q2WESNUA0jFRsJOc0SNUO6xJ5SGA1xueg3NL65W6s+NY5l9cunuw==",
"dev": true,
"requires": {
"base64-js": "^1.0.2",
"ieee754": "^1.1.4"
}
},
"encoding": {
"version": "0.1.13",
"resolved": "https://registry.npmjs.org/encoding/-/encoding-0.1.13.tgz",
"integrity": "sha512-ETBauow1T35Y/WZMkio9jiM0Z5xjHHmJ4XmjZOq1l/dXz3lr2sRn87nJy20RupqSh1F2m3HHPSp8ShIPQJrJ3A==",
"dev": true,
"requires": {
"iconv-lite": "^0.6.2"
"node-fetch": "^2.6.0"
}
},
"faker": {
@ -20892,130 +21189,6 @@
"resolved": "https://registry.npmjs.org/faker/-/faker-5.1.0.tgz",
"integrity": "sha512-RrWKFSSA/aNLP0g3o2WW1Zez7/MnMr7xkiZmoCfAGZmdkDQZ6l2KtuXHN5XjdvpRjDl8+3vf+Rrtl06Z352+Mw==",
"dev": true
},
"gettext-parser": {
"version": "1.4.0",
"resolved": "https://registry.npmjs.org/gettext-parser/-/gettext-parser-1.4.0.tgz",
"integrity": "sha512-sedZYLHlHeBop/gZ1jdg59hlUEcpcZJofLq2JFwJT1zTqAU3l2wFv6IsuwFHGqbiT9DWzMUW4/em2+hspnmMMA==",
"dev": true,
"requires": {
"encoding": "^0.1.12",
"safe-buffer": "^5.1.1"
}
},
"iconv-lite": {
"version": "0.6.2",
"resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.2.tgz",
"integrity": "sha512-2y91h5OpQlolefMPmUlivelittSWy0rP+oYVpn6A7GwVHNE8AWzoYOBNmlwks3LobaJxgHCYZAnyNo2GgpNRNQ==",
"dev": true,
"requires": {
"safer-buffer": ">= 2.1.2 < 3.0.0"
}
},
"ieee754": {
"version": "1.1.13",
"resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.1.13.tgz",
"integrity": "sha512-4vf7I2LYV/HaWerSo3XmlMkp5eZ83i+/CDluXi/IGTs/O1sejBNhTtnxzmRZfvOUqj7lZjqHkeTvpgSFDlWZTg==",
"dev": true
},
"is-stream": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz",
"integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=",
"dev": true
},
"lodash": {
"version": "4.17.20",
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.20.tgz",
"integrity": "sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA==",
"dev": true
},
"memize": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/memize/-/memize-1.1.0.tgz",
"integrity": "sha512-K4FcPETOMTwe7KL2LK0orMhpOmWD2wRGwWWpbZy0fyArwsyIKR8YJVz8+efBAh3BO4zPqlSICu4vsLTRRqtFAg==",
"dev": true
},
"node-fetch": {
"version": "1.7.3",
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-1.7.3.tgz",
"integrity": "sha512-NhZ4CsKx7cYm2vSrBAr2PvFOe6sWDf0UYLRqA6svUYg7+/TSfVAu49jYC4BvQ4Sms9SZgdqGBgroqfDhJdTyKQ==",
"dev": true,
"requires": {
"encoding": "^0.1.11",
"is-stream": "^1.0.1"
}
},
"punycode": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz",
"integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==",
"dev": true
},
"qs": {
"version": "6.9.4",
"resolved": "https://registry.npmjs.org/qs/-/qs-6.9.4.tgz",
"integrity": "sha512-A1kFqHekCTM7cz0udomYUoYNWjBebHm/5wzU/XqrBRBNWectVH0QIiN+NEcZ0Dte5hvzHwbr8+XQmguPhJ6WdQ==",
"dev": true
},
"react-native-url-polyfill": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/react-native-url-polyfill/-/react-native-url-polyfill-1.2.0.tgz",
"integrity": "sha512-hpLZ8RyS3oGVyTOe/HjoqVoCOSkeJvrCoEB3bJsY7t9uh7kpQDV6kgvdlECEafYpxe3RzMrKLVcmWRbPU7CuAw==",
"dev": true,
"requires": {
"whatwg-url-without-unicode": "8.0.0-3"
}
},
"regenerator-runtime": {
"version": "0.13.7",
"resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.7.tgz",
"integrity": "sha512-a54FxoJDIr27pgf7IgeQGxmqUNYrcV338lf/6gH456HZ/PhX+5BcwHXG9ajESmwe6WRO0tAzRUrRmNONWgkrew==",
"dev": true
},
"safe-buffer": {
"version": "5.2.1",
"resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz",
"integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==",
"dev": true
},
"safer-buffer": {
"version": "2.1.2",
"resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz",
"integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==",
"dev": true
},
"sprintf-js": {
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.1.2.tgz",
"integrity": "sha512-VE0SOVEHCk7Qc8ulkWw3ntAzXuqf7S2lvwQaDLRnUeIEaKNQJzV6BwmLKhOqT61aGhfUMrXeaBk+oDGCzvhcug==",
"dev": true
},
"tannin": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/tannin/-/tannin-1.2.0.tgz",
"integrity": "sha512-U7GgX/RcSeUETbV7gYgoz8PD7Ni4y95pgIP/Z6ayI3CfhSujwKEBlGFTCRN+Aqnuyf4AN2yHL+L8x+TCGjb9uA==",
"dev": true,
"requires": {
"@tannin/plural-forms": "^1.1.0"
}
},
"webidl-conversions": {
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-5.0.0.tgz",
"integrity": "sha512-VlZwKPCkYKxQgeSbH5EyngOmRp7Ww7I9rQLERETtf5ofd9pGeswWiOtogpEO850jziPRarreGxn5QIiTqpb2wA==",
"dev": true
},
"whatwg-url-without-unicode": {
"version": "8.0.0-3",
"resolved": "https://registry.npmjs.org/whatwg-url-without-unicode/-/whatwg-url-without-unicode-8.0.0-3.tgz",
"integrity": "sha512-HoKuzZrUlgpz35YO27XgD28uh/WJH4B0+3ttFqRo//lmq+9T/mIOJ6kqmINI9HpUpz1imRC/nR/lxKpJiv0uig==",
"dev": true,
"requires": {
"buffer": "^5.4.3",
"punycode": "^2.1.1",
"webidl-conversions": "^5.0.0"
}
}
}
},
@ -21086,9 +21259,9 @@
},
"dependencies": {
"@babel/runtime": {
"version": "7.13.9",
"resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.13.9.tgz",
"integrity": "sha512-aY2kU+xgJ3dJ1eU6FMB9EH8dIe8dmusF1xEku52joLvw6eAFN0AI+WxCLDnpev2LEejWBAy2sBvBOBAjI3zmvA==",
"version": "7.15.3",
"resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.15.3.tgz",
"integrity": "sha512-OvwMLqNXkCXSz1kSm58sEsNuhqOx/fKpnUnKnFB5v8uDda5bLNEHNgKPvhDN6IU0LDcnHQ90LlJ0Q6jnyBSIBA==",
"dev": true,
"requires": {
"regenerator-runtime": "^0.13.4"
@ -21162,13 +21335,13 @@
}
},
"@wordpress/i18n": {
"version": "3.18.0",
"resolved": "https://registry.npmjs.org/@wordpress/i18n/-/i18n-3.18.0.tgz",
"integrity": "sha512-e1uFWhWYnT0B6s3hyy+xS0S3bwabrvkZA84xxitiIcQvGnZDUPntqv6M9+VrgJVlmd2MR2TbCGJ5xKFAVFr/gA==",
"version": "3.20.0",
"resolved": "https://registry.npmjs.org/@wordpress/i18n/-/i18n-3.20.0.tgz",
"integrity": "sha512-SIoOJFB4UrrYAScS4H91CYCLW9dX3Ghv8pBKc/yHGculb1AdGr6gRMlmJxZV62Cn3CZ4Ga86c+FfR+GiBu0JPg==",
"dev": true,
"requires": {
"@babel/runtime": "^7.12.5",
"@wordpress/hooks": "^2.11.1",
"@babel/runtime": "^7.13.10",
"@wordpress/hooks": "^2.12.3",
"gettext-parser": "^1.3.1",
"lodash": "^4.17.19",
"memize": "^1.1.0",
@ -21177,13 +21350,22 @@
},
"dependencies": {
"@babel/runtime": {
"version": "7.13.9",
"resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.13.9.tgz",
"integrity": "sha512-aY2kU+xgJ3dJ1eU6FMB9EH8dIe8dmusF1xEku52joLvw6eAFN0AI+WxCLDnpev2LEejWBAy2sBvBOBAjI3zmvA==",
"version": "7.15.3",
"resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.15.3.tgz",
"integrity": "sha512-OvwMLqNXkCXSz1kSm58sEsNuhqOx/fKpnUnKnFB5v8uDda5bLNEHNgKPvhDN6IU0LDcnHQ90LlJ0Q6jnyBSIBA==",
"dev": true,
"requires": {
"regenerator-runtime": "^0.13.4"
}
},
"@wordpress/hooks": {
"version": "2.12.3",
"resolved": "https://registry.npmjs.org/@wordpress/hooks/-/hooks-2.12.3.tgz",
"integrity": "sha512-LmKiwKldZt6UYqOxV/a6+eUFXdvALFnB/pQx3RmrMvO64sgFhfR6dhrlv+uVbuuezSuv8dce1jx8lUWAT0krMA==",
"dev": true,
"requires": {
"@babel/runtime": "^7.13.10"
}
}
}
},
@ -21213,20 +21395,20 @@
}
},
"@wordpress/keycodes": {
"version": "2.18.3",
"resolved": "https://registry.npmjs.org/@wordpress/keycodes/-/keycodes-2.18.3.tgz",
"integrity": "sha512-Lenyw+K2KgiqddBv5fDCh2JRfXFrONWNvPfv1DKXzHXTvBSI0JkU1RVP5WZTcVuEtctCZWL5JbhrkG2I26w68g==",
"version": "2.19.3",
"resolved": "https://registry.npmjs.org/@wordpress/keycodes/-/keycodes-2.19.3.tgz",
"integrity": "sha512-8rNdmP5M1ifTgLIL0dt/N1uTGsq/Rx1ydCXy+gg24WdxBRhyu5sudNVCtascVXo26aIfOH9OJRdqRZZTEORhog==",
"dev": true,
"requires": {
"@babel/runtime": "^7.12.5",
"@wordpress/i18n": "^3.18.0",
"@babel/runtime": "^7.13.10",
"@wordpress/i18n": "^3.20.0",
"lodash": "^4.17.19"
},
"dependencies": {
"@babel/runtime": {
"version": "7.13.9",
"resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.13.9.tgz",
"integrity": "sha512-aY2kU+xgJ3dJ1eU6FMB9EH8dIe8dmusF1xEku52joLvw6eAFN0AI+WxCLDnpev2LEejWBAy2sBvBOBAjI3zmvA==",
"version": "7.15.3",
"resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.15.3.tgz",
"integrity": "sha512-OvwMLqNXkCXSz1kSm58sEsNuhqOx/fKpnUnKnFB5v8uDda5bLNEHNgKPvhDN6IU0LDcnHQ90LlJ0Q6jnyBSIBA==",
"dev": true,
"requires": {
"regenerator-runtime": "^0.13.4"
@ -21241,20 +21423,20 @@
"dev": true
},
"@wordpress/url": {
"version": "2.21.2",
"resolved": "https://registry.npmjs.org/@wordpress/url/-/url-2.21.2.tgz",
"integrity": "sha512-bLHg4pTo/9mQUkK1s1MU/Sjgnzfy2AkPvPn4ObGA8/4CFkMsDhQGAVhhw5YuezcxvaJkBiKJ+BxgFJ1QKksF6w==",
"version": "2.22.2",
"resolved": "https://registry.npmjs.org/@wordpress/url/-/url-2.22.2.tgz",
"integrity": "sha512-aqpYKQXzyzkCOm+GzZRYlLb+wh58g0cwR1PaKAl0UXaBS4mdS+X6biMriylb4P8CVC/RR7CSw5XI20JC24KDwQ==",
"dev": true,
"requires": {
"@babel/runtime": "^7.12.5",
"@babel/runtime": "^7.13.10",
"lodash": "^4.17.19",
"react-native-url-polyfill": "^1.1.2"
},
"dependencies": {
"@babel/runtime": {
"version": "7.13.9",
"resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.13.9.tgz",
"integrity": "sha512-aY2kU+xgJ3dJ1eU6FMB9EH8dIe8dmusF1xEku52joLvw6eAFN0AI+WxCLDnpev2LEejWBAy2sBvBOBAjI3zmvA==",
"version": "7.15.3",
"resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.15.3.tgz",
"integrity": "sha512-OvwMLqNXkCXSz1kSm58sEsNuhqOx/fKpnUnKnFB5v8uDda5bLNEHNgKPvhDN6IU0LDcnHQ90LlJ0Q6jnyBSIBA==",
"dev": true,
"requires": {
"regenerator-runtime": "^0.13.4"

View File

@ -1,7 +1,7 @@
{
"name": "woocommerce",
"title": "WooCommerce",
"version": "5.7.0",
"version": "5.8.0",
"homepage": "https://woocommerce.com/",
"repository": {
"type": "git",
@ -46,13 +46,13 @@
"@typescript-eslint/eslint-plugin": "3.10.1",
"@typescript-eslint/experimental-utils": "3.10.1",
"@typescript-eslint/parser": "3.10.1",
"@woocommerce/admin-e2e-tests": "0.1.0",
"@woocommerce/api": "file:tests/e2e/api",
"@woocommerce/e2e-core-tests": "file:tests/e2e/core-tests",
"@woocommerce/e2e-environment": "file:tests/e2e/env",
"@woocommerce/e2e-utils": "file:tests/e2e/utils",
"@wordpress/babel-plugin-import-jsx-pragma": "1.1.3",
"@wordpress/babel-preset-default": "3.0.2",
"@wordpress/e2e-test-utils": "^4.16.1",
"@wordpress/eslint-plugin": "7.3.0",
"autoprefixer": "9.8.6",
"babel-eslint": "10.1.0",

View File

@ -46,7 +46,4 @@
</exclude>
</whitelist>
</filter>
<listeners>
<listener class="SpeedTrapListener" file="tests/legacy/includes/listener-loader.php" />
</listeners>
</phpunit>

View File

@ -1,10 +1,10 @@
=== WooCommerce ===
Contributors: automattic, mikejolley, jameskoster, claudiosanches, rodrigosprimo, peterfabian1000, vedjain, jamosova, obliviousharmony, konamiman, sadowski, wpmuguru, royho, barryhughes-1
Tags: e-commerce, store, sales, sell, woo, shop, cart, checkout, downloadable, downloads, payments, paypal, storefront, stripe, woo commerce
Requires at least: 5.5
Requires at least: 5.6
Tested up to: 5.8
Requires PHP: 7.0
Stable tag: 5.5.2
Stable tag: 5.6.0
License: GPLv3
License URI: https://www.gnu.org/licenses/gpl-3.0.html

View File

@ -20,7 +20,7 @@ defined( 'ABSPATH' ) || exit;
* are supposed to be created/updated by the appropriate data store classes (or by the code that uses
* the data store classes) whenever a product is created/updated.
*
* Additionally, after the regeneration is completed a 'woocommerce_attribute_lookup__enabled' option
* Additionally, after the regeneration is completed a 'woocommerce_attribute_lookup_enabled' option
* with a value of 'no' will have been created.
*
* This class also adds two entries to the Status - Tools menu: one for manually regenerating the table contents,
@ -115,9 +115,9 @@ class DataRegenerator {
public function delete_all_attributes_lookup_data() {
global $wpdb;
delete_option( 'woocommerce_attribute_lookup__enabled' );
delete_option( 'woocommerce_attribute_lookup__last_product_id_to_process' );
delete_option( 'woocommerce_attribute_lookup__last_products_page_processed' );
delete_option( 'woocommerce_attribute_lookup_enabled' );
delete_option( 'woocommerce_attribute_lookup_last_product_id_to_process' );
delete_option( 'woocommerce_attribute_lookup_last_products_page_processed' );
$this->data_store->unset_regeneration_in_progress_flag();
// phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared
@ -166,8 +166,8 @@ CREATE TABLE ' . $this->lookup_table_name . '(
}
$this->data_store->set_regeneration_in_progress_flag();
update_option( 'woocommerce_attribute_lookup__last_product_id_to_process', current( $last_existing_product_id ) );
update_option( 'woocommerce_attribute_lookup__last_products_page_processed', 0 );
update_option( 'woocommerce_attribute_lookup_last_product_id_to_process', current( $last_existing_product_id ) );
update_option( 'woocommerce_attribute_lookup_last_products_page_processed', 0 );
return true;
}
@ -209,7 +209,7 @@ CREATE TABLE ' . $this->lookup_table_name . '(
* @return bool True if more steps need to be run, false otherwise.
*/
private function do_regeneration_step() {
$last_products_page_processed = get_option( 'woocommerce_attribute_lookup__last_products_page_processed' );
$last_products_page_processed = get_option( 'woocommerce_attribute_lookup_last_products_page_processed' );
$current_products_page = (int) $last_products_page_processed + 1;
$product_ids = WC()->call_function(
@ -232,9 +232,9 @@ CREATE TABLE ' . $this->lookup_table_name . '(
$this->data_store->create_data_for_product( $id );
}
update_option( 'woocommerce_attribute_lookup__last_products_page_processed', $current_products_page );
update_option( 'woocommerce_attribute_lookup_last_products_page_processed', $current_products_page );
$last_product_id_to_process = get_option( 'woocommerce_attribute_lookup__last_product_id_to_process' );
$last_product_id_to_process = get_option( 'woocommerce_attribute_lookup_last_product_id_to_process' );
return end( $product_ids ) < $last_product_id_to_process;
}
@ -242,9 +242,9 @@ CREATE TABLE ' . $this->lookup_table_name . '(
* Cleanup/final option setup after the regeneration has been completed.
*/
private function finalize_regeneration() {
delete_option( 'woocommerce_attribute_lookup__last_product_id_to_process' );
delete_option( 'woocommerce_attribute_lookup__last_products_page_processed' );
update_option( 'woocommerce_attribute_lookup__enabled', 'no' );
delete_option( 'woocommerce_attribute_lookup_last_product_id_to_process' );
delete_option( 'woocommerce_attribute_lookup_last_products_page_processed' );
update_option( 'woocommerce_attribute_lookup_enabled', 'no' );
$this->data_store->unset_regeneration_in_progress_flag();
}
@ -300,7 +300,7 @@ CREATE TABLE ' . $this->lookup_table_name . '(
$entry['button'] = sprintf(
/* translators: %d: How many products have been processed so far. */
__( 'Filling in progress (%d)', 'woocommerce' ),
get_option( 'woocommerce_attribute_lookup__last_products_page_processed', 0 ) * self::PRODUCTS_PER_GENERATION_STEP
get_option( 'woocommerce_attribute_lookup_last_products_page_processed', 0 ) * self::PRODUCTS_PER_GENERATION_STEP
);
$entry['disabled'] = true;
} else {
@ -364,7 +364,7 @@ CREATE TABLE ' . $this->lookup_table_name . '(
throw new \Exception( "Can't enable or disable the attributes lookup table usage while it's regenerating." );
}
update_option( 'woocommerce_attribute_lookup__enabled', $enable ? 'yes' : 'no' );
update_option( 'woocommerce_attribute_lookup_enabled', $enable ? 'yes' : 'no' );
}
/**

View File

@ -44,7 +44,7 @@ class Filterer {
* @return bool
*/
public function filtering_via_lookup_table_is_active() {
return 'yes' === get_option( 'woocommerce_attribute_lookup__enabled' );
return 'yes' === get_option( 'woocommerce_attribute_lookup_enabled' );
}
/**

View File

@ -95,7 +95,7 @@ class LookupDataStore {
$settings[] = array(
'title' => __( 'Enable table usage', 'woocommerce' ),
'desc' => __( 'Use the product attributes lookup table for catalog filtering.', 'woocommerce' ),
'id' => 'woocommerce_attribute_lookup__enabled',
'id' => 'woocommerce_attribute_lookup_enabled',
'default' => 'no',
'type' => 'checkbox',
'checkboxgroup' => 'start',
@ -104,7 +104,7 @@ class LookupDataStore {
$settings[] = array(
'title' => __( 'Direct updates', 'woocommerce' ),
'desc' => __( 'Update the table directly upon product changes, instead of scheduling a deferred update.', 'woocommerce' ),
'id' => 'woocommerce_attribute_lookup__direct_updates',
'id' => 'woocommerce_attribute_lookup_direct_updates',
'default' => 'no',
'type' => 'checkbox',
'checkboxgroup' => 'start',
@ -201,14 +201,14 @@ AND table_name = %s;',
* Schedule an update of the product attributes lookup table for a given product.
* If an update for the same action is already scheduled, nothing is done.
*
* If the 'woocommerce_attribute_lookup__direct_update' option is set to 'yes',
* If the 'woocommerce_attribute_lookup_direct_update' option is set to 'yes',
* the update is done directly, without scheduling.
*
* @param int $product_id The product id to schedule the update for.
* @param int $action The action to perform, one of the ACTION_ constants.
*/
private function maybe_schedule_update( int $product_id, int $action ) {
if ( 'yes' === get_option( 'woocommerce_attribute_lookup__direct_updates' ) ) {
if ( 'yes' === get_option( 'woocommerce_attribute_lookup_direct_updates' ) ) {
$this->run_update_callback( $product_id, $action );
return;
}
@ -669,20 +669,20 @@ AND table_name = %s;',
* @return bool True if a lookup table regeneration is already in progress.
*/
public function regeneration_is_in_progress() {
return 'yes' === get_option( 'woocommerce_attribute_lookup__regeneration_in_progress', null );
return 'yes' === get_option( 'woocommerce_attribute_lookup_regeneration_in_progress', null );
}
/**
* Set a permanent flag (via option) indicating that the lookup table regeneration is in process.
*/
public function set_regeneration_in_progress_flag() {
update_option( 'woocommerce_attribute_lookup__regeneration_in_progress', 'yes' );
update_option( 'woocommerce_attribute_lookup_regeneration_in_progress', 'yes' );
}
/**
* Remove the flag indicating that the lookup table regeneration is in process.
*/
public function unset_regeneration_in_progress_flag() {
delete_option( 'woocommerce_attribute_lookup__regeneration_in_progress' );
delete_option( 'woocommerce_attribute_lookup_regeneration_in_progress' );
}
}

View File

@ -3532,9 +3532,9 @@
"dev": true
},
"path-parse": {
"version": "1.0.6",
"resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz",
"integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==",
"version": "1.0.7",
"resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz",
"integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==",
"dev": true
},
"performance-now": {

View File

@ -5,12 +5,13 @@ import {
WP_ADMIN_LOGIN
} from '@woocommerce/e2e-utils';
const config = require('config');
const { HTTPClientFactory } = require('@woocommerce/api');
const config = require( 'config' );
const { HTTPClientFactory } = require( '@woocommerce/api' );
const { addConsoleSuppression, updateReadyPageStatus } = require( '@woocommerce/e2e-environment' );
const { DEFAULT_TIMEOUT_OVERRIDE } = process.env;
// @todo: remove this once https://github.com/woocommerce/woocommerce-admin/issues/6992 has been addressed
addConsoleSuppression( 'woocommerce_shared_settings' );
addConsoleSuppression( 'woocommerce_shared_settings', false );
/**
* Uses the WordPress API to delete all existing posts
@ -38,12 +39,23 @@ async function trashExistingPosts() {
// other posts/comments/etc. aren't dirtying tests and tests don't depend on
// each other's side-effects.
beforeAll(async () => {
// Update the ready page to prevent concurrent test runs
await updateReadyPageStatus('draft');
await trashExistingPosts();
await withRestApi.deleteAllProducts();
await withRestApi.deleteAllCoupons();
if ( DEFAULT_TIMEOUT_OVERRIDE ) {
page.setDefaultNavigationTimeout( DEFAULT_TIMEOUT_OVERRIDE );
page.setDefaultTimeout( DEFAULT_TIMEOUT_OVERRIDE );
}
try {
// Update the ready page to prevent concurrent test runs
await updateReadyPageStatus('draft');
await trashExistingPosts();
await withRestApi.deleteAllProducts();
await withRestApi.deleteAllCoupons();
await withRestApi.deleteAllOrders();
} catch ( error ) {
// Prevent an error here causing tests to fail.
}
await page.goto(WP_ADMIN_LOGIN);
await clearLocalStorage();
await setBrowserViewport('large');
@ -53,7 +65,11 @@ beforeAll(async () => {
// This is to ensure that each test ends with no user logged in.
afterAll(async () => {
// Reset the ready page to published to allow future test runs
await updateReadyPageStatus('publish');
try {
await updateReadyPageStatus('publish');
} catch ( error ) {
// Prevent an error here causing tests to fail.
}
const client = await page.target().createCDPSession();
await client.send('Network.clearBrowserCookies');

View File

@ -14,6 +14,7 @@
- The e2e test `order-status-filters.test.js` now uses the API to create orders
- Implemented data-driven design using `describe.each` and `it.each`
# 0.1.3
## Added

View File

@ -1,4 +1,3 @@
/* eslint-disable jest/no-export, jest/no-disabled-tests */
/**
* Internal dependencies
*/

View File

@ -1,5 +1,3 @@
/* eslint-disable jest/no-export, jest/no-disabled-tests */
/**
* Internal dependencies
*/
@ -45,6 +43,10 @@ const runOnboardingFlowTest = () => {
);
}
);
it('can reset shipping classes', async () => {
await withRestApi.deleteAllShippingClasses();
});
}
it('can start and complete onboarding when visiting the site for the first time.', async () => {
@ -58,7 +60,7 @@ const runTaskListTest = () => {
beforeAll(async () => {
await merchant.login();
});
it('can setup shipping', async () => {
await page.evaluate(() => {
document.querySelector('.woocommerce-list__item-title').scrollIntoView();

View File

@ -1,4 +1,3 @@
/* eslint-disable jest/no-export, jest/no-disabled-tests */
/**
* Internal dependencies
*/
@ -22,13 +21,7 @@ const runInitiateWccomConnectionTest = () => {
});
it('can initiate WCCOM connection', async () => {
await merchant.openExtensions();
// Click on a tab to choose WooCommerce Subscriptions extension
await Promise.all([
expect(page).toClick('a.nav-tab', {text: "WooCommerce.com Subscriptions"}),
page.waitForNavigation({waitUntil: 'networkidle0'}),
]);
await merchant.openHelper();
// Click on Connect button to initiate a WCCOM connection
await Promise.all([

View File

@ -1,20 +1,16 @@
/* eslint-disable jest/no-export, jest/no-standalone-expect */
/**
* Internal dependencies
*/
const {
createSimpleProduct,
createSimpleOrder,
createCoupon,
uiUnblocked,
addProductToOrder,
evalAndClick,
merchant
merchant,
createOrder,
} = require( '@woocommerce/e2e-utils' );
const config = require( 'config' );
const simpleProductName = config.get( 'products.simple.name' );
const simpleProductPrice = config.has('products.simple.price') ? config.get('products.simple.price') : '9.99';
const discountedPrice = simpleProductPrice - 5.00;
@ -22,22 +18,18 @@ const couponDialogMessage = 'Enter a coupon code to apply. Discounts are applied
let couponCode;
let orderId;
let productId;
const runOrderApplyCouponTest = () => {
describe('WooCommerce Orders > Apply coupon', () => {
beforeAll(async () => {
await createSimpleProduct();
productId = await createSimpleProduct();
couponCode = await createCoupon();
await merchant.login();
orderId = await createSimpleOrder('Pending payment', simpleProductName);
await Promise.all([
addProductToOrder(orderId, simpleProductName),
orderId = await createOrder( { productId, status: 'pending' } );
// We need to remove any listeners on the `dialog` event otherwise we can't catch the dialog below
page.removeAllListeners('dialog'),
]);
await merchant.login();
await merchant.goToOrder( orderId );
await page.removeAllListeners('dialog');
// Make sure the simple product price is greater than the coupon amount
await expect(Number(simpleProductPrice)).toBeGreaterThan(5.00);
@ -72,6 +64,8 @@ const runOrderApplyCouponTest = () => {
await uiUnblocked();
await page.waitFor(2000); // to avoid flakyness
// Verify the coupon pricing has been removed
await expect(page).not.toMatchElement('.wc_coupon_list li.code.editable', { text: couponCode.toLowerCase() });
await expect(page).not.toMatchElement('.wc-order-item-discount', { text: '5.00' });

View File

@ -1,4 +1,3 @@
/* eslint-disable jest/no-export, jest/no-disabled-tests, jest/no-standalone-expect */
const { createSimpleProduct } = require( '@woocommerce/e2e-utils' );
/**
@ -6,8 +5,7 @@ const { createSimpleProduct } = require( '@woocommerce/e2e-utils' );
*/
const {
merchant,
createSimpleOrder,
addProductToOrder,
createOrder,
} = require( '@woocommerce/e2e-utils' );
// TODO create a function for the logic below getConfigSimpleProduct(), see: https://github.com/woocommerce/woocommerce/issues/29072
@ -15,23 +13,15 @@ const config = require( 'config' );
const simpleProductName = config.get( 'products.simple.name' );
const simpleProductPrice = config.has( 'products.simple.price' ) ? config.get( 'products.simple.price' ) : '9.99';
let orderId;
const runMerchantOrdersCustomerPaymentPage = () => {
let orderId;
let productId;
describe('WooCommerce Merchant Flow: Orders > Customer Payment Page', () => {
beforeAll(async () => {
await createSimpleProduct();
productId = await createSimpleProduct();
orderId = await createOrder( { productId } );
await merchant.login();
orderId = await createSimpleOrder();
await addProductToOrder( orderId, simpleProductName );
// We first need to click "Update" otherwise the link doesn't show
await Promise.all([
expect(page).toClick( 'button.save_order' ),
page.waitForNavigation( { waitUntil: 'networkidle0' } ),
]);
});
it('should show the customer payment page link on a pending payment order', async () => {

View File

@ -1,4 +1,3 @@
/* eslint-disable jest/no-export, jest/no-disabled-tests, jest/no-standalone-expect */
/**
* Internal dependencies
*/
@ -12,7 +11,7 @@ const {
const config = require( 'config' );
const customerEmail = config.get( 'addresses.customer.billing.email' );
const adminEmail = 'admin@woocommercecoree2etestsuite.com';
const adminEmail = config.has( 'users.admin.email' ) ? config.get( 'users.admin.email' ) : 'admin@woocommercecoree2etestsuite.com';
const storeName = 'WooCommerce Core E2E Test Suite';
let orderId;

View File

@ -1,28 +1,21 @@
/* eslint-disable jest/no-export, jest/no-disabled-tests, */
/**
* Internal dependencies
*/
const {
merchant,
createSimpleProduct,
createSimpleOrder,
verifyCheckboxIsSet,
verifyValueOfInputField,
uiUnblocked,
addProductToOrder,
evalAndClick,
createOrder,
} = require( '@woocommerce/e2e-utils' );
const { waitForSelector } = require( '@woocommerce/e2e-environment' );
const config = require( 'config' );
const simpleProductName = config.get( 'products.simple.name' );
const simpleProductPrice = config.has('products.simple.price') ? config.get('products.simple.price') : '9.99';
let orderId;
let currencySymbol;
/**
* Evaluate and click a button selector then wait for a result selector.
* This is a work around for what appears to be intermittent delays in handling confirm dialogs.
@ -44,20 +37,24 @@ const clickAndWaitForSelector = async ( buttonSelector, resultSelector ) => {
const runRefundOrderTest = () => {
describe('WooCommerce Orders > Refund an order', () => {
let productId;
let orderId;
let currencySymbol;
beforeAll(async () => {
await createSimpleProduct();
productId = await createSimpleProduct();
orderId = await createOrder( {
productId,
status: 'completed'
} );
await merchant.login();
orderId = await createSimpleOrder();
await addProductToOrder(orderId, simpleProductName);
await merchant.goToOrder( orderId );
// Get the currency symbol for the store's selected currency
await page.waitForSelector('.woocommerce-Price-currencySymbol');
let currencyElement = await page.$('.woocommerce-Price-currencySymbol');
currencySymbol = await page.evaluate(el => el.textContent, currencyElement);
// Update order status to `Completed` so we can issue a refund
await merchant.updateOrderStatus(orderId, 'Completed');
});
it('can issue a refund by quantity', async () => {
@ -93,7 +90,6 @@ const runRefundOrderTest = () => {
// Verify system note was added
expect(page).toMatchElement('.system-note', { text: 'Order status changed from Completed to Refunded.' }),
]);
page.waitForNavigation( { waitUntil: 'networkidle0' } );
});
it('can delete an issued refund', async () => {

View File

@ -1,5 +1,3 @@
/* eslint-disable jest/no-export, jest/no-disabled-tests, jest/expect-expect */
/**
* Internal dependencies
*/
@ -7,9 +5,8 @@ const {
merchant,
searchForOrder,
createSimpleProduct,
addProductToOrder,
clickUpdateOrder,
factories,
createOrder,
} = require( '@woocommerce/e2e-utils' );
const searchString = 'John Doe';
@ -45,7 +42,7 @@ const customerShipping = {
/**
* Set the billing fields for the customer account for this test suite.
*
* @returns {Promise<void>}
* @returns {Promise<number>}
*/
const updateCustomerBilling = async () => {
const client = factories.api.withDefaultPermalinks;
@ -65,6 +62,7 @@ const updateCustomerBilling = async () => {
shipping: customerShipping,
};
await client.put( customerEndpoint + customerId, customerData );
return customerId;
};
/**
@ -92,35 +90,28 @@ const queries = [
const runOrderSearchingTest = () => {
describe('WooCommerce Orders > Search orders', () => {
let productId;
let orderId;
let customerId;
beforeAll( async () => {
await createSimpleProduct(itemName);
await updateCustomerBilling();
productId = await createSimpleProduct('Wanted Product');
customerId = await updateCustomerBilling();
orderId = await createOrder({
customerId,
productId,
customerBilling,
customerShipping,
});
// Create new order for testing
// Login and open All Orders view
await merchant.login();
await merchant.openNewOrder();
await page.waitForSelector('#order_status');
await page.click('#customer_user');
await page.click('span.select2-search > input.select2-search__field');
await page.type('span.select2-search > input.select2-search__field', 'Jane Smith');
await page.waitFor(2000); // to avoid flakyness
await page.keyboard.press('Enter');
// Get the post id
const variablePostId = await page.$('#post_ID');
orderId = (await(await variablePostId.getProperty('value')).jsonValue());
// Save new order and add desired product to order
await clickUpdateOrder('Order updated.', true);
await addProductToOrder(orderId, itemName);
// Open All Orders view
await merchant.openAllOrdersView();
});
it('can search for order by order id', async () => {
await searchForOrder(orderId, orderId, searchString);
// Convert the order ID to string so we can search on it
await searchForOrder(orderId.toString(), orderId, searchString);
});
it.each(queries)(

View File

@ -1,10 +1,11 @@
/* eslint-disable jest/no-export, jest/no-disabled-tests */
/**
* Internal dependencies
*/
import config from 'config';
const {
merchant,
batchCreateOrders,
withRestApi,
clickFilter,
moveAllItemsToTrash,
} = require( '@woocommerce/e2e-utils' );
@ -19,17 +20,25 @@ const orderStatus = [
['Completed', 'wc-completed'],
['Cancelled', 'wc-cancelled'],
['Refunded', 'wc-refunded'],
['Failed', 'wc-failed']
['Failed', 'wc-failed'],
];
const defaultOrder = config.get('orders.basicPaidOrder');
const runOrderStatusFiltersTest = () => {
describe('WooCommerce Orders > Filter Orders by Status', () => {
beforeAll( async () => {
beforeAll(async () => {
// First, let's create some orders we can filter against
const statuses = orderStatus.map(
(pair) => pair[1].substring(3) // remove the 'wc-' part
);
await batchCreateOrders(statuses);
const orders = orderStatus.map((entryPair) => {
const statusName = entryPair[1].replace('wc-', '');
return {
...defaultOrder,
status: statusName,
};
});
// Create the orders using the API
await withRestApi.batchCreateOrders(orders);
// Next, let's login and navigate to the Orders page
await merchant.login();

View File

@ -1,4 +1,3 @@
/* eslint-disable jest/no-export, jest/no-disabled-tests */
/**
* Internal dependencies
*/
@ -8,7 +7,9 @@ const {
clickTab,
uiUnblocked,
evalAndClick,
setCheckbox,
verifyAndPublish,
waitForSelectorWithoutThrow
} = require( '@woocommerce/e2e-utils' );
const {
waitAndClick,
@ -29,26 +30,6 @@ const VirtualProductName = 'Virtual Product Name';
const NonVirtualProductName = 'Non-Virtual Product Name';
const simpleProductPrice = config.has('products.simple.price') ? config.get('products.simple.price') : '9.99';
const verifyPublishAndTrash = async () => {
// Wait for auto save
await page.waitFor( 2000 );
// Publish product
await expect( page ).toClick( '#publish' );
await page.waitForSelector( '.updated.notice', { text: 'Product published.' } );
// Verify
await expect( page ).toMatchElement( '.updated.notice', { text: 'Product published.' } );
await page.waitForSelector( 'a', { text: 'Move to Trash' } );
// Trash product
await expect( page ).toClick( 'a', { text: 'Move to Trash' } );
await page.waitForSelector( '.updated.notice', { text: '1 product moved to the Trash.' } );
// Verify
await expect( page ).toMatchElement( '.updated.notice', { text: '1 product moved to the Trash.' } );
};
const openNewProductAndVerify = async () => {
// Go to "add product" page
await merchant.openNewProduct();
@ -74,7 +55,9 @@ const runAddSimpleProductTest = () => {
await verifyAndPublish();
await merchant.logout();
});
it('can have a shopper add the simple virtual product to the cart', async () => {
// See product in the shop and add it to the cart
await shopper.goToShop();
await shopper.addToCartFromShopPage(VirtualProductName);
@ -99,9 +82,14 @@ const runAddSimpleProductTest = () => {
await verifyAndPublish();
await merchant.logout();
});
it('can have a shopper add the simple non-virtual product to the cart', async () => {
// See product in the shop and add it to the cart
await shopper.goToShop();
await page.reload({ waitUntil: ['networkidle0', 'domcontentloaded'] });
await shopper.addToCartFromShopPage(NonVirtualProductName);
await shopper.goToCart();
await shopper.productIsInCart(NonVirtualProductName);
@ -174,7 +162,7 @@ const runAddVariableProductTest = () => {
await uiUnblocked();
});
it('can create variation attributes', async () => {
it('can add variation attributes', async () => {
await waitAndClick( page, '.variations_tab a' );
await uiUnblocked();
await waitForSelector(
@ -187,46 +175,24 @@ const runAddVariableProductTest = () => {
);
// Verify that variations were created
await Promise.all([
expect(page).toMatchElement('select[name="attribute_attr-1[0]"]', {text: 'val1'}),
expect(page).toMatchElement('select[name="attribute_attr-2[0]"]', {text: 'val1'}),
expect(page).toMatchElement('select[name="attribute_attr-3[0]"]', {text: 'val1'}),
for ( let index = 0; index < 8; index++ ) {
const val1 = { text: 'val1' };
const val2 = { text: 'val2' };
expect(page).toMatchElement('select[name="attribute_attr-1[1]"]', {text: 'val1'}),
expect(page).toMatchElement('select[name="attribute_attr-2[1]"]', {text: 'val1'}),
expect(page).toMatchElement('select[name="attribute_attr-3[1]"]', {text: 'val2'}),
// odd / even
let attr3 = !! ( index % 2 );
// 0-1,4-5 / 2-3,6-7
let attr2 = ( index % 4 ) > 1;
// 0-3 / 4-7
let attr1 = ( index > 3 );
expect(page).toMatchElement('select[name="attribute_attr-1[2]"]', {text: 'val1'}),
expect(page).toMatchElement('select[name="attribute_attr-2[2]"]', {text: 'val2'}),
expect(page).toMatchElement('select[name="attribute_attr-3[2]"]', {text: 'val1'}),
await expect( page ).toMatchElement( `select[name="attribute_attr-1[${index}]"]`, attr1 ? val2 : val1 );
await expect( page ).toMatchElement( `select[name="attribute_attr-2[${index}]"]`, attr2 ? val2 : val1 );
await expect( page ).toMatchElement( `select[name="attribute_attr-3[${index}]"]`, attr3 ? val2 : val1 );
}
expect(page).toMatchElement('select[name="attribute_attr-1[3]"]', {text: 'val1'}),
expect(page).toMatchElement('select[name="attribute_attr-2[3]"]', {text: 'val2'}),
expect(page).toMatchElement('select[name="attribute_attr-3[3]"]', {text: 'val2'}),
expect(page).toMatchElement('select[name="attribute_attr-1[4]"]', {text: 'val2'}),
expect(page).toMatchElement('select[name="attribute_attr-2[4]"]', {text: 'val1'}),
expect(page).toMatchElement('select[name="attribute_attr-3[4]"]', {text: 'val1'}),
expect(page).toMatchElement('select[name="attribute_attr-1[5]"]', {text: 'val2'}),
expect(page).toMatchElement('select[name="attribute_attr-2[5]"]', {text: 'val1'}),
expect(page).toMatchElement('select[name="attribute_attr-3[5]"]', {text: 'val2'}),
expect(page).toMatchElement('select[name="attribute_attr-1[6]"]', {text: 'val2'}),
expect(page).toMatchElement('select[name="attribute_attr-2[6]"]', {text: 'val2'}),
expect(page).toMatchElement('select[name="attribute_attr-3[6]"]', {text: 'val1'}),
expect(page).toMatchElement('select[name="attribute_attr-1[7]"]', {text: 'val2'}),
expect(page).toMatchElement('select[name="attribute_attr-2[7]"]', {text: 'val2'}),
expect(page).toMatchElement('select[name="attribute_attr-3[7]"]', {text: 'val2'}),
]);
/*
Puppeteer seems unable to find the individual variation fields in headless mode on MacOS
This section of the test runs fine in both Travis and non-headless mode on Mac
Disabling temporarily to allow the test to be re-enabled without local testing headache
await waitAndClick( page, '.variations-pagenav .expand_all');
await page.waitFor( 2000 );
await waitForSelectorWithoutThrow( 'input[name="variable_is_virtual[0]"]', 5 );
await setCheckbox('input[name="variable_is_virtual[0]"]');
await expect(page).toFill('input[name="variable_regular_price[0]"]', '9.99');
@ -242,15 +208,7 @@ const runAddVariableProductTest = () => {
await page.focus('button.save-variation-changes');
await expect(page).toClick('button.save-variation-changes', {text: 'Save changes'});
/**/
// Publish product, verify that it was published. Trash product, verify that it was trashed.
await verifyPublishAndTrash(
'#publish',
'.notice',
'Product published.',
'1 product moved to the Trash.'
);
// @todo: https://github.com/woocommerce/woocommerce/issues/30580
});
});
};

View File

@ -1,5 +1,3 @@
/* eslint-disable jest/no-export*/
/**
* Internal dependencies
*/
@ -55,7 +53,7 @@ const runAddShippingClassesTest = () => {
for (const { name, slug, description } of shippingClasses) {
const row = await expect(
page
).toMatchElement('.wc-shipping-class-rows tr', { text: slug });
).toMatchElement('.wc-shipping-class-rows tr', { text: slug, timeout: 50000 });
await expect(row).toMatchElement(
'.wc-shipping-class-name',

View File

@ -1,5 +1,3 @@
/* eslint-disable jest/no-export, jest/no-disabled-tests */
/**
* Internal dependencies
*/
@ -10,7 +8,8 @@ const {
addShippingZoneAndMethod,
clearAndFillInput,
selectOptionInSelect2,
deleteAllShippingZones,
withRestApi,
uiUnblocked,
} = require( '@woocommerce/e2e-utils' );
/**
@ -35,8 +34,8 @@ const runAddNewShippingZoneTest = () => {
describe('WooCommerce Shipping Settings - Add new shipping zone', () => {
beforeAll(async () => {
await createSimpleProduct();
await withRestApi.deleteAllShippingZones();
await merchant.login();
await deleteAllShippingZones();
});
it('add shipping zone for San Francisco with free Local pickup', async () => {
@ -78,6 +77,8 @@ const runAddNewShippingZoneTest = () => {
await selectOptionInSelect2('New York');
await expect(page).toClick('button[name="calc_shipping"]');
await uiUnblocked();
// Verify shipping costs
await page.waitForSelector('.order-total');
await expect(page).toMatchElement('.shipping .amount', {text: '$10.00'});
@ -86,7 +87,7 @@ const runAddNewShippingZoneTest = () => {
it('allows customer to benefit from a Free shipping if in CA', async () => {
await page.reload();
// Set shipping state to California
await expect(page).toClick('a.shipping-calculator-button');
await expect(page).toClick('#select2-calc_shipping_state-container');
@ -96,6 +97,8 @@ const runAddNewShippingZoneTest = () => {
await clearAndFillInput('#calc_shipping_postcode', '94000');
await expect(page).toClick('button[name="calc_shipping"]');
await uiUnblocked();
// Verify shipping method and cost
await page.waitForSelector('.order-total');
await expect(page).toMatchElement('.shipping ul#shipping_method > li', {text: 'Free shipping'});
@ -110,6 +113,8 @@ const runAddNewShippingZoneTest = () => {
await clearAndFillInput('#calc_shipping_postcode', '94107');
await expect(page).toClick('button[name="calc_shipping"]');
await uiUnblocked();
// Verify shipping method and cost
await page.waitForSelector('.order-total');
await expect(page).toMatchElement('.shipping ul#shipping_method > li', {text: 'Local pickup'});

View File

@ -1,16 +1,12 @@
/* eslint-disable jest/no-export, jest/no-disabled-tests, jest/expect-expect */
/**
* Internal dependencies
*/
const {
shopper,
merchant,
createSimpleProduct,
addShippingZoneAndMethod,
clearAndFillInput,
uiUnblocked,
selectOptionInSelect2,
withRestApi,
} = require( '@woocommerce/e2e-utils' );
/**
@ -43,29 +39,21 @@ const runCartCalculateShippingTest = () => {
await createSimpleProduct(firstProductName);
await createSimpleProduct(secondProductName, secondProductPrice);
await merchant.login();
await merchant.openNewShipping();
await withRestApi.resetSettingsGroupToDefault( 'general' );
// Add a new shipping zone Germany with Free shipping
await addShippingZoneAndMethod(shippingZoneNameDE, shippingCountryDE, ' ', 'free_shipping');
await withRestApi.addShippingZoneAndMethod(shippingZoneNameDE, shippingCountryDE, ' ', 'free_shipping');
// Add a new shipping zone for France with Flat rate & Local pickup
await addShippingZoneAndMethod(shippingZoneNameFR, shippingCountryFR, ' ', 'flat_rate');
await page.waitFor(1000); // to avoid flakiness in headless
await page.click('a.wc-shipping-zone-method-settings', {text: 'Flat rate'});
await clearAndFillInput('#woocommerce_flat_rate_cost', '5');
await page.click('.wc-backbone-modal-main button#btn-ok');
// Add additional method Local pickup for the same location
await page.waitFor(1000); // to avoid flakiness in headless
await page.click('button.wc-shipping-zone-add-method', {text:'Add shipping method'});
await page.waitForSelector('.wc-shipping-zone-method-selector');
await page.select('select[name="add_method_id"]', 'local_pickup');
await page.click('button#btn-ok');
await page.waitForSelector('#zone_locations');
await merchant.logout();
await withRestApi.addShippingZoneAndMethod(shippingZoneNameFR, shippingCountryFR, ' ', 'flat_rate', '5', ['local_pickup']);
await shopper.emptyCart();
});
afterAll(async () => {
await withRestApi.deleteAllShippingZones();
});
it('allows customer to calculate Free Shipping if in Germany', async () => {
await shopper.goToShop();
await shopper.addToCartFromShopPage(firstProductName);
@ -76,6 +64,7 @@ const runCartCalculateShippingTest = () => {
await expect(page).toClick('#select2-calc_shipping_country-container');
await selectOptionInSelect2('Germany');
await expect(page).toClick('button[name="calc_shipping"]');
await uiUnblocked();
// Verify shipping costs
await page.waitForSelector('.order-total');
@ -84,13 +73,14 @@ const runCartCalculateShippingTest = () => {
});
it('allows customer to calculate Flat rate and Local pickup if in France', async () => {
await page.reload();
await page.reload( { waitUntil: ['networkidle0', 'domcontentloaded'] } );
// Set shipping country to France
await expect(page).toClick('a.shipping-calculator-button');
await expect(page).toClick('#select2-calc_shipping_country-container');
await selectOptionInSelect2('France');
await expect(page).toClick('button[name="calc_shipping"]');
await uiUnblocked();
// Verify shipping costs
await page.waitForSelector('.order-total');
@ -119,13 +109,14 @@ const runCartCalculateShippingTest = () => {
});
it('should show correct total cart price with 2 products without flat rate', async () => {
await page.reload();
await page.reload( { waitUntil: ['networkidle0', 'domcontentloaded'] } );
// Set shipping country to Spain
await expect(page).toClick('a.shipping-calculator-button');
await expect(page).toClick('#select2-calc_shipping_country-container');
await selectOptionInSelect2('Spain');
await expect(page).toClick('button[name="calc_shipping"]');
await uiUnblocked();
// Verify shipping costs
await page.waitForSelector('.order-total');

View File

@ -1,9 +1,9 @@
/* eslint-disable jest/no-export, jest/no-disabled-tests, jest/expect-expect */
/**
* Internal dependencies
*/
const {
shopper,
withRestApi,
createSimpleProduct,
uiUnblocked
} = require( '@woocommerce/e2e-utils' );
@ -26,6 +26,9 @@ const runCartPageTest = () => {
describe('Cart page', () => {
beforeAll(async () => {
await createSimpleProduct();
await withRestApi.resetSettingsGroupToDefault('general');
await withRestApi.resetSettingsGroupToDefault('products');
await withRestApi.resetSettingsGroupToDefault('tax');
});
it('should display no item in the cart', async () => {

View File

@ -1,10 +1,10 @@
/* eslint-disable jest/no-export, jest/no-disabled-tests, jest/expect-expect, jest/no-standalone-expect */
/**
* Internal dependencies
*/
const {
shopper,
merchant,
withRestApi,
createSimpleProduct,
setCheckbox,
settingsPageSaveChanges,
@ -28,6 +28,9 @@ const runCheckoutPageTest = () => {
describe('Checkout page', () => {
beforeAll(async () => {
await createSimpleProduct();
await withRestApi.resetSettingsGroupToDefault('general');
await withRestApi.resetSettingsGroupToDefault('products');
await withRestApi.resetSettingsGroupToDefault('tax');
// Set free shipping within California
await merchant.login();

View File

@ -1,10 +1,10 @@
/* eslint-disable jest/no-export, jest/no-disabled-tests */
/**
* Internal dependencies
*/
const {
shopper,
createSimpleProductWithCategory,
utils,
} = require( '@woocommerce/e2e-utils' );
/**
@ -15,6 +15,7 @@ const {
describe,
beforeAll,
} = require( '@jest/globals' );
const { WORDPRESS_VERSION } = process.env;
const config = require( 'config' );
const simpleProductName = config.get( 'products.simple.name' );
@ -27,7 +28,7 @@ const hardware = 'Hardware';
const productTitle = 'li.first > a > h2.woocommerce-loop-product__title';
const runProductBrowseSearchSortTest = () => {
describe('Search, browse by categories and sort items in the shop', () => {
utils.describeIf( WORDPRESS_VERSION >= '5.8' )( 'Search, browse by categories and sort items in the shop', () => {
beforeAll(async () => {
// Create 1st product with Clothing category
await createSimpleProductWithCategory(simpleProductName + ' 1', singleProductPrice, clothing);

View File

@ -1,11 +1,18 @@
# Unreleased
- `updateReadyPageStatus` utility to update the status of the ready page
- Added plugin upload functionality util that provides a method to pull a plugin zip from a remote location
- `updateReadyPageStatus` utility to update the status of the ready page.
- Added plugin upload functionality util that provides a method to pull a plugin zip from a remote location:
- `getRemotePluginZip( fileUrl )` to get the remote zip. Returns the filepath of the zip location.
- Added plugin zip utility functions:
- `checkNestedZip( zipFilePath, savePath )` checks a plugin zip file for any nested zip files. If one is found, it is extracted. Returns the path where the zip file is located.
- `downloadZip( fileUrl, downloadPath )` downloads a plugin zip file from a remote location to the provided path.
- Added `getLatestReleaseZipUrl( owner, repository, getPrerelease, perPage )` util function to get the latest release zip from a GitHub repository.
- Added `DEFAULT_TIMEOUT_OVERRIDE` that allows passing in a time in milliseconds to override the default Jest and Puppeteer timeouts.
- Fix latest version tag search paging logic
- Update fallback PHP version to 7.4.22
- Update fallback MariaDB version to 10.6.4
- Update fallback WordPress version to 5.8.0.
- Remove unused WP unit test install script.
# 0.2.2

View File

@ -87,6 +87,21 @@ await takeScreenshotFor( 'name of current step' );
Screenshots will be saved to `tests/e2e/screenshots`. This folder is cleared at the beginning of each test run.
### Override default test timeout
To override the default timeout for the tests, you can use the `DEFAULT_TIMEOUT_OVERRIDE` flag and pass in a maximum timeout in milliseconds. For example, you can pass it in when running the tests from the command line:
```bash
DEFAULT_TIMEOUT_OVERRIDE=35000 npx wc-e2e test:e2e
```
This value will override the default Jest timeout as well as pass the timeout to the following Puppeteer methods:
* page.setDefaultTimeout();
* page.setDefaultNavigationTimeout();
For a list of the methods that the above timeout affects, please see the Puppeteer documentation for [`page.setDefaultTimeout()`](https://pptr.dev/#?product=Puppeteer&version=v10.2.0&show=api-pagesetdefaulttimeouttimeout) and [`page.setDefaultNavigationTimeout`](https://pptr.dev/#?product=Puppeteer&version=v10.2.0&show=api-pagesetdefaultnavigationtimeouttimeout) for more information.
### Jest Puppeteer Config
The test sequencer uses the following default Puppeteer configuration:
@ -196,6 +211,14 @@ The above method also makes use of the following utility methods which can also
- `checkNestedZip( zipFilePath, savePath )` used to check a plugin zip file for any nested zip files. If one is found, it is extracted. Returns the path where the zip file is located.
- `downloadZip( fileUrl, downloadPath )` can be used to directly download a plugin zip file from a remote location to the provided path.
### Get the latest released zip URL
If you would like to get the latest release zip URL, which can be used in the methods mentioned above, you can use the following helper function to do so:
`getLatestReleaseZipUrl( owner, repository, getPrerelease, perPage )`
This will return a string with the latest release URL. Optionally, you can use the `getPrerelease` boolean flag, which defaults to false, on whether or not to get a prerelease instead. The `perPage` flag can be used to return more results when getting the list of releases. The default value is 3.
## Additional information
Refer to [`tests/e2e/core-tests`](https://github.com/woocommerce/woocommerce/tree/trunk/tests/e2e/core-tests) for some test examples, and [`tests/e2e`](https://github.com/woocommerce/woocommerce/tree/trunk/tests/e2e) for general information on e2e tests.

View File

@ -10,7 +10,7 @@ if [[ $1 ]]; then
if [[ $WP_VERSION =~ ^[0-9]+\.[0-9]+ ]]; then
export WORDPRESS_VERSION=$WP_VERSION
else
export WORDPRESS_VERSION="5.5.1"
export WORDPRESS_VERSION="5.8.0"
fi
if ! [[ $TRAVIS_PHP_VERSION =~ ^[0-9]+\.[0-9]+ ]]; then
@ -19,7 +19,7 @@ if [[ $1 ]]; then
if [[ $TRAVIS_PHP_VERSION =~ ^[0-9]+\.[0-9]+ ]]; then
export DC_PHP_VERSION=$TRAVIS_PHP_VERSION
else
export DC_PHP_VERSION="7.4.9"
export DC_PHP_VERSION="7.4.22"
fi
if ! [[ $TRAVIS_MARIADB_VERSION =~ ^[0-9]+\.[0-9]+ ]]; then
@ -28,7 +28,7 @@ if [[ $1 ]]; then
if [[ $TRAVIS_MARIADB_VERSION =~ ^[0-9]+\.[0-9]+ ]]; then
export DC_MARIADB_VERSION=$TRAVIS_MARIADB_VERSION
else
export DC_MARIADB_VERSION="10.5.5"
export DC_MARIADB_VERSION="10.6.4"
fi
if [[ $1 == 'up' ]]; then

View File

@ -5,7 +5,7 @@ const program = require( 'commander' );
const path = require( 'path' );
const fs = require( 'fs' );
const { getAppRoot } = require( '../utils' );
const { WC_E2E_SCREENSHOTS, JEST_PUPPETEER_CONFIG } = process.env;
const { WC_E2E_SCREENSHOTS, JEST_PUPPETEER_CONFIG, DEFAULT_TIMEOUT_OVERRIDE } = process.env;
program
.usage( '<file ...> [options]' )
@ -43,6 +43,10 @@ let testEnvVars = {
jest_test_timeout: program.dev ? 120000 : 30000,
};
if ( DEFAULT_TIMEOUT_OVERRIDE ) {
testEnvVars.jest_test_timeout = DEFAULT_TIMEOUT_OVERRIDE;
}
if ( ! JEST_PUPPETEER_CONFIG ) {
// Use local Puppeteer config if there is one.
// Load test configuration file into an object.

View File

@ -84,21 +84,23 @@ function findLatestVersion( image, nameSearch ) {
// Repeat the requests until we've read as many pages as necessary.
const paginationFn = function ( result ) {
// We can save on unnecessarily loading every page by short-circuiting when
// the number of days between the first recorded version and the
// one from this page becomes excessive.
const lastUpdate = Date.parse( result.latestTag.last_updated );
if ( ! earliestUpdated ) {
earliestUpdated = lastUpdate;
} else {
const daysSinceEarliestUpdate = ( earliestUpdated - lastUpdate ) / ( 1000 * 3600 * 24 );
if ( daysSinceEarliestUpdate > 15 ) {
result.isLastPage = true;
if ( result.latestTag ) {
// We can save on unnecessarily loading every page by short-circuiting when
// the number of days between the first recorded version and the
// one from this page becomes excessive.
const lastUpdate = Date.parse( result.latestTag.last_updated );
if ( ! earliestUpdated ) {
earliestUpdated = lastUpdate;
} else {
const daysSinceEarliestUpdate = ( earliestUpdated - lastUpdate ) / ( 1000 * 3600 * 24 );
if ( daysSinceEarliestUpdate > 15 ) {
result.isLastPage = true;
}
}
}
if ( ! latestVersion || semver.gt( result.latestTag.semver, latestVersion ) ) {
latestVersion = result.latestTag.semver;
if ( ! latestVersion || semver.gt( result.latestTag.semver, latestVersion ) ) {
latestVersion = result.latestTag.semver;
}
}
if ( ! result.isLastPage ) {

View File

@ -1,179 +0,0 @@
#!/usr/bin/env bash
if [ $# -lt 3 ]; then
echo "usage: $0 <db-name> <db-user> <db-pass> [db-host] [wp-version] [skip-database-creation]"
exit 1
fi
DB_NAME=$1
DB_USER=$2
# Trim whitespace to work around an issue supplying an empty string through both `npm explore` and `npm run`.
DB_PASS=${3//[[:blank:]]/}
DB_HOST=${4-localhost}
WP_VERSION=${5-latest}
SKIP_DB_CREATE=${6-false}
# directories
TMPDIR=${TMPDIR-/tmp}
TMPDIR=$(echo $TMPDIR | sed -e "s/\/$//")
WP_TESTS_DIR=${WP_TESTS_DIR-$TMPDIR/wordpress-tests-lib}
WP_CORE_DIR=${WP_CORE_DIR-$TMPDIR/wordpress/}
download() {
if [ `which curl` ]; then
curl -s "$1" > "$2";
elif [ `which wget` ]; then
wget -nv -O "$2" "$1"
fi
}
if [[ $WP_VERSION =~ ^[0-9]+\.[0-9]+$ ]]; then
WP_TESTS_TAG="branches/$WP_VERSION"
elif [[ $WP_VERSION =~ [0-9]+\.[0-9]+\.[0-9]+ ]]; then
if [[ $WP_VERSION =~ [0-9]+\.[0-9]+\.[0] ]]; then
# version x.x.0 means the first release of the major version, so strip off the .0 and download version x.x
WP_TESTS_TAG="tags/${WP_VERSION%??}"
else
WP_TESTS_TAG="tags/$WP_VERSION"
fi
elif [[ $WP_VERSION == 'nightly' || $WP_VERSION == 'trunk' ]]; then
WP_TESTS_TAG="trunk"
else
# http serves a single offer, whereas https serves multiple. we only want one
download http://api.wordpress.org/core/version-check/1.7/ /tmp/wp-latest.json
grep '[0-9]+\.[0-9]+(\.[0-9]+)?' /tmp/wp-latest.json
LATEST_VERSION=$(grep -o '"version":"[^"]*' /tmp/wp-latest.json | sed 's/"version":"//')
if [[ -z "$LATEST_VERSION" ]]; then
echo "Latest WordPress version could not be found"
exit 1
fi
WP_TESTS_TAG="tags/$LATEST_VERSION"
fi
set -ex
install_wp() {
if [ -d $WP_CORE_DIR ]; then
return;
fi
mkdir -p $WP_CORE_DIR
if [[ $WP_VERSION == 'nightly' || $WP_VERSION == 'trunk' ]]; then
mkdir -p $TMPDIR/wordpress-nightly
download https://wordpress.org/nightly-builds/wordpress-latest.zip $TMPDIR/wordpress-nightly/wordpress-nightly.zip
unzip -q $TMPDIR/wordpress-nightly/wordpress-nightly.zip -d $TMPDIR/wordpress-nightly/
mv $TMPDIR/wordpress-nightly/wordpress/* $WP_CORE_DIR
else
if [ $WP_VERSION == 'latest' ]; then
local ARCHIVE_NAME='latest'
elif [[ $WP_VERSION =~ [0-9]+\.[0-9]+ ]]; then
# https serves multiple offers, whereas http serves single.
download https://api.wordpress.org/core/version-check/1.7/ $TMPDIR/wp-latest.json
if [[ $WP_VERSION =~ [0-9]+\.[0-9]+\.[0] ]]; then
# version x.x.0 means the first release of the major version, so strip off the .0 and download version x.x
LATEST_VERSION=${WP_VERSION%??}
else
# otherwise, scan the releases and get the most up to date minor version of the major release
local VERSION_ESCAPED=`echo $WP_VERSION | sed 's/\./\\\\./g'`
LATEST_VERSION=$(grep -o '"version":"'$VERSION_ESCAPED'[^"]*' $TMPDIR/wp-latest.json | sed 's/"version":"//' | head -1)
fi
if [[ -z "$LATEST_VERSION" ]]; then
local ARCHIVE_NAME="wordpress-$WP_VERSION"
else
local ARCHIVE_NAME="wordpress-$LATEST_VERSION"
fi
else
local ARCHIVE_NAME="wordpress-$WP_VERSION"
fi
download https://wordpress.org/${ARCHIVE_NAME}.tar.gz $TMPDIR/wordpress.tar.gz
tar --strip-components=1 -zxmf $TMPDIR/wordpress.tar.gz -C $WP_CORE_DIR
fi
download https://raw.github.com/markoheijnen/wp-mysqli/master/db.php $WP_CORE_DIR/wp-content/db.php
}
install_test_suite() {
# portable in-place argument for both GNU sed and Mac OSX sed
if [[ $(uname -s) == 'Darwin' ]]; then
local ioption='-i .bak'
else
local ioption='-i'
fi
# set up testing suite if it doesn't yet exist
if [ ! -d $WP_TESTS_DIR ]; then
# set up testing suite
mkdir -p $WP_TESTS_DIR
svn co --quiet https://develop.svn.wordpress.org/${WP_TESTS_TAG}/tests/phpunit/includes/ $WP_TESTS_DIR/includes
svn co --quiet https://develop.svn.wordpress.org/${WP_TESTS_TAG}/tests/phpunit/data/ $WP_TESTS_DIR/data
fi
if [ ! -f wp-tests-config.php ]; then
download https://develop.svn.wordpress.org/${WP_TESTS_TAG}/wp-tests-config-sample.php "$WP_TESTS_DIR"/wp-tests-config.php
# remove all forward slashes in the end
WP_CORE_DIR=$(echo $WP_CORE_DIR | sed "s:/\+$::")
sed $ioption "s:dirname( __FILE__ ) . '/src/':'$WP_CORE_DIR/':" "$WP_TESTS_DIR"/wp-tests-config.php
sed $ioption "s/youremptytestdbnamehere/$DB_NAME/" "$WP_TESTS_DIR"/wp-tests-config.php
sed $ioption "s/yourusernamehere/$DB_USER/" "$WP_TESTS_DIR"/wp-tests-config.php
sed $ioption "s/yourpasswordhere/$DB_PASS/" "$WP_TESTS_DIR"/wp-tests-config.php
sed $ioption "s|localhost|${DB_HOST}|" "$WP_TESTS_DIR"/wp-tests-config.php
fi
}
install_db() {
if [ ${SKIP_DB_CREATE} = "true" ]; then
return 0
fi
# parse DB_HOST for port or socket references
local PARTS=(${DB_HOST//\:/ })
local DB_HOSTNAME=${PARTS[0]};
local DB_SOCK_OR_PORT=${PARTS[1]};
local EXTRA=""
if ! [ -z $DB_HOSTNAME ] ; then
if [ $(echo $DB_SOCK_OR_PORT | grep -e '^[0-9]\{1,\}$') ]; then
EXTRA=" --host=$DB_HOSTNAME --port=$DB_SOCK_OR_PORT --protocol=tcp"
elif ! [ -z $DB_SOCK_OR_PORT ] ; then
EXTRA=" --socket=$DB_SOCK_OR_PORT"
elif ! [ -z $DB_HOSTNAME ] ; then
EXTRA=" --host=$DB_HOSTNAME --protocol=tcp"
fi
fi
# create database
mysqladmin create $DB_NAME --user="$DB_USER" --password="$DB_PASS"$EXTRA
}
install_deps() {
# Script Variables
BRANCH=$TRAVIS_BRANCH
REPO=$TRAVIS_REPO_SLUG
WORKING_DIR="$PWD"
if [ "$TRAVIS_PULL_REQUEST_BRANCH" != "" ]; then
BRANCH=$TRAVIS_PULL_REQUEST_BRANCH
REPO=$TRAVIS_PULL_REQUEST_SLUG
fi
# checkout dev version of woocommerce
cd "$WP_CORE_DIR/wp-content/plugins"
git clone --depth 1 "https://github.com/woocommerce/woocommerce.git"
# install dependencies
cd woocommerce
npm install
composer install --no-dev
# Back to original dir
cd "$WORKING_DIR"
}
install_wp
install_test_suite
install_db
install_deps

View File

@ -14,17 +14,17 @@ printf "Testing URL: $WP_BASE_URL\n\n"
while [[ "$(curl -s -o /dev/null -w ''%{http_code}'' ${WP_BASE_URL}/?pagename=ready)" != "200" ]]
do
echo "$(date) - Docker container is still being built"
echo "$(date) - Waiting for testing environment"
sleep ${DELAY_SEC}
((count++))
if [[ $count -gt ${MAX_ATTEMPTS} ]]; then
echo "$(date) - Docker container couldn't be built"
exit 1
echo "$(date) - Testing environment couldn't be found"
exit 1
fi
done
if [[ $count -gt 0 ]]; then
echo "$(date) - Docker container had been built successfully"
echo "$(date) - Testing environment is ready"
fi

View File

@ -3,7 +3,8 @@
"users": {
"admin": {
"username": "SMOKE_TEST_ADMIN_USER",
"password": "SMOKE_TEST_ADMIN_PASSWORD"
"password": "SMOKE_TEST_ADMIN_PASSWORD",
"email": "SMOKE_TEST_ADMIN_USER_EMAIL"
},
"customer": {
"username": "SMOKE_TEST_CUSTOMER_USER",

View File

@ -31,13 +31,13 @@ URL="http://localhost:${WORDPRESS_PORT}"
if $(wp core is-installed);
then
echo "Wordpress is already installed..."
echo "WordPress is already installed..."
else
declare -p WORDPRESS_TITLE >/dev/null
declare -p WORDPRESS_LOGIN >/dev/null
declare -p WORDPRESS_PASSWORD >/dev/null
declare -p WORDPRESS_EMAIL >/dev/null
echo "Installing wordpress..."
echo "Installing WordPress..."
wp core install \
--url=${URL} \
--title="$WORDPRESS_TITLE" \

2632
tests/e2e/env/package-lock.json generated vendored

File diff suppressed because it is too large Load Diff

View File

@ -25,7 +25,7 @@
"@jest/test-sequencer": "^25.5.4",
"@slack/web-api": "^6.1.0",
"@woocommerce/api": "^0.2.0",
"@wordpress/e2e-test-utils": "^4.15.0",
"@wordpress/e2e-test-utils": "^4.16.1",
"@wordpress/jest-preset-default": "^6.4.0",
"app-root-path": "^3.0.0",
"jest": "^25.1.0",
@ -35,11 +35,11 @@
"node-stream-zip": "^1.13.6"
},
"devDependencies": {
"@babel/cli": "7.12.0",
"@babel/core": "7.12.0",
"@babel/polyfill": "7.11.5",
"@babel/preset-env": "7.12.0",
"@wordpress/eslint-plugin": "7.1.0",
"@babel/cli": "7.12.8",
"@babel/core": "7.12.9",
"@babel/polyfill": "7.12.1",
"@babel/preset-env": "7.12.7",
"@wordpress/eslint-plugin": "7.3.0",
"ndb": "^1.1.5",
"semver": "^7.3.2"
},
@ -55,7 +55,6 @@
"docker:down": "./bin/docker-compose.sh down",
"docker:clear-all": "docker rmi --force $(docker images -q)",
"docker:ssh": "docker exec -it $(node utils/get-app-name.js)_wordpress-www /bin/bash",
"install-wp-tests": "./bin/install-wp-tests.sh",
"test:e2e": "bash ./bin/wait-for-build.sh && ./bin/e2e-test-integration.js",
"test:e2e-debug": "bash ./bin/wait-for-build.sh && ./bin/e2e-test-integration.js --dev --debug",
"test:e2e-dev": "bash ./bin/wait-for-build.sh && ./bin/e2e-test-integration.js --dev"

View File

@ -29,6 +29,52 @@ const getRemotePluginZip = async ( fileUrl ) => {
return filePath;
};
/**
* Get the latest release zip for a plugin from a GiHub repository.
*
* @param {string} owner The owner of the plugin repository.
* @param {string} repository The repository name.
* @param {boolean} getPrerelease Flag on whether to get a prelease or not.
* @param {number} perPage Limit of entries returned from the latest releases list, defaults to 3.
* @returns {Promise<string>}} Returns the URL for the release zip file.
*/
const getLatestReleaseZipUrl = async ( owner, repository, getPrerelease = false, perPage = 3 ) => {
let requesturl;
if ( getPrerelease ) {
requesturl = `https://api.github.com/repos/${owner}/${repository}/releases?per_page=${perPage}`;
} else {
requesturl = `https://api.github.com/repos/${owner}/${repository}/releases/latest`;
}
const options = {
url: requesturl,
method: 'GET',
json: true,
headers: {'user-agent': 'node.js'}
};
// Wrap in a promise to make the request async
return new Promise( function( resolve, reject ) {
request.get(options, function( err, resp, body ) {
if ( err ) {
reject( err );
} else {
if ( getPrerelease ) {
// Loop until we find the first pre-release, then return it.
body.forEach(release => {
if ( release.prerelease ) {
resolve( release.assets[0].browser_download_url );
}
});
} else {
resolve( body.assets[0].browser_download_url );
}
}
})
});
}
/**
* Check the zip file for any nested zips. If one is found, extract it.
*
@ -80,6 +126,7 @@ const downloadZip = async ( fileUrl, downloadPath ) => {
module.exports = {
getRemotePluginZip,
getLatestReleaseZipUrl,
checkNestedZip,
downloadZip,
};

View File

@ -1,7 +1,7 @@
const getAppRoot = require( './app-root' );
const { getAppName, getAppBase } = require( './app-name' );
const { getTestConfig, getAdminConfig } = require( './test-config' );
const { getRemotePluginZip } = require('./get-plugin-zip');
const { getRemotePluginZip, getLatestReleaseZipUrl } = require('./get-plugin-zip');
const takeScreenshotFor = require( './take-screenshot' );
const updateReadyPageStatus = require('./update-ready-page');
const consoleUtils = require( './filter-console' );
@ -13,6 +13,7 @@ module.exports = {
getTestConfig,
getAdminConfig,
getRemotePluginZip,
getLatestReleaseZipUrl,
takeScreenshotFor,
updateReadyPageStatus,
...consoleUtils,

View File

@ -13,8 +13,8 @@ const updateReadyPageStatus = async ( status ) => {
const wpPagesEndpoint = '/wp/v2/pages';
const adminUsername = testConfig.users.admin.username ? testConfig.users.admin.username : 'admin';
const adminPassword = testConfig.users.admin.password ? testConfig.users.admin.password : 'password';
const client = HTTPClientFactory.build(apiUrl)
.withBasicAuth(adminUsername, adminPassword)
const client = HTTPClientFactory.build( apiUrl )
.withBasicAuth( adminUsername, adminPassword )
.create();
// As the default status filter in the API is `publish`, we need to
@ -25,11 +25,11 @@ const updateReadyPageStatus = async ( status ) => {
statusFilter = 'draft';
}
const getPostsResponse = await client.get(`${wpPagesEndpoint}?search=ready&status=${statusFilter}`);
if ( getPostsResponse.data && getPostsResponse.data.length > 0) {
const getPostsResponse = await client.get( `${wpPagesEndpoint}?search=ready&status=${statusFilter}` );
if ( getPostsResponse.data && getPostsResponse.data.length > 0 ) {
const pageId = getPostsResponse.data[0].id;
// Update the page to the new status
await client.post(`${wpPagesEndpoint}/${pageId}`, { 'status': status });
await client.post( `${wpPagesEndpoint}/${pageId}`, { 'status': status } );
}
}

View File

@ -1,6 +0,0 @@
/*
* Internal dependencies
*/
const { runActivationTest } = require( '@woocommerce/e2e-core-tests' );
runActivationTest();

View File

@ -0,0 +1,3 @@
const { testAdminBasicSetup } = require( '@woocommerce/admin-e2e-tests' );
testAdminBasicSetup();

View File

@ -0,0 +1,16 @@
const {
testAdminOnboardingWizard,
testSelectiveBundleWCPay,
} = require( '@woocommerce/admin-e2e-tests' );
const {
withRestApi,
IS_RETEST_MODE,
} = require( '@woocommerce/e2e-utils' );
// Reset onboarding profile when re-running tests on a site
if ( IS_RETEST_MODE ) {
withRestApi.resetOnboarding();
}
testAdminOnboardingWizard();
testSelectiveBundleWCPay();

View File

@ -1,6 +0,0 @@
/*
* Internal dependencies
*/
const { runOnboardingFlowTest } = require( '@woocommerce/e2e-core-tests' );
runOnboardingFlowTest();

View File

@ -1,6 +0,0 @@
/*
* Internal dependencies
*/
const { runInitialStoreSettingsTest } = require( '@woocommerce/e2e-core-tests' );
runInitialStoreSettingsTest();

View File

@ -0,0 +1,3 @@
const { testAdminAnalyticsOverview } = require( '@woocommerce/admin-e2e-tests' );
testAdminAnalyticsOverview();

View File

@ -0,0 +1,3 @@
const { testAdminAnalyticsPages } = require( '@woocommerce/admin-e2e-tests' );
testAdminAnalyticsPages();

Some files were not shown because too many files have changed in this diff Show More