Commit Graph

21418 Commits

Author SHA1 Message Date
Vladimir Reznichenko a3f4d722b9
CI: speedup 'Check Asset Sizes' job (take 3) (#50178)
* CI: attempt 3 to speedup 'Check Asset Sizes' job.

* CI: cleanup

* CI: changelog entry.
2024-08-01 14:15:10 -07:00
Gabriel Manussakis fa3d8233da
[Accessibility] Keep focus on shipping option input once selected (#49360)
* Keep focus on shipping option input once selected

* Add changelog file

* Remove unnecessary space

* Manage focus of the shipping methods inputs on checkout

* Refactor the code to use native JS instead of jQuery

* Revert native JS usage on jQuery code

* Focus shipping input after re-initing payment methods on checkout

* Replace includes with indexOf for consistency

* Revert usage of native JS

* Remove unnecessary if statement

* Check if event exists before assigning current target

* Get current target with native JS

* Remove unnecessary spaces
2024-08-02 03:14:18 +07:00
Andrej Mernik f20afed89c
Optimize maybe_assign_default_product_cat to drop caches only if changes were made (#50006)
* Optimize maybe_assign_default_product_cat

maybe_assign_default_product_cat should flush cache, delete transients and update term counts only if changes were made

* Fix whitespace

* Add changefile(s) from automation for the following project(s): woocommerce

---------

Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Barry Hughes <3594411+barryhughes@users.noreply.github.com>
2024-08-01 12:58:16 -07:00
github-actions[bot] 38d2d82e2d
Delete changelog files based on PR 50236 (#50238)
Delete changelog files for 50236

Co-authored-by: WooCommerce Bot <no-reply@woocommerce.com>
2024-08-01 11:40:07 -07:00
Jorge A. Torres 4d1e61a8ce
Prevent creation of password-protected coupons (#50236)
* Warn when creating password-protected coupons

* Add changelog
2024-08-01 11:31:38 -07:00
Corey McKrill 864d7b52e8
Logging: Add parameter to avoid log directory creation (#49766)
* Logging: Add parameter to avoid log directory creation

The `get_log_directory` method, by default, attempts to create the
directory if it doesn't exist yet. However, the method is called early
in the initialization of the WooCommerce plugin, regardless of whether
the logging system is configured to use the filesystem. This adds a
parameter to `get_log_directory` to specify whether to attempt directory
creation, and ensures that the parameter is set to false in a couple
of specific places.

* Remove usage of method from old log file handler

* Don't initialize log directory when getting size

* Add missing translator note

* Rename  param to

* Reduce usage of wp_upload_dir
2024-08-01 11:21:53 -07:00
Ames Plant 806f2efdc6
[Accessibility] Update product order status colors to ensure accessible color contrasts (#49934)
Update product order status colors to ensure accessible color contrasts

Co-authored-by: amesplant <95257231+amesplant-dmv@users.noreply.github.com>
2024-08-01 18:19:59 +01:00
Thilina Pituwala 03fa96d7f3
Fix subscription activations when user own multiple subscriptions of same product install on different stores (#49803)
* When matching subscriptions to installed products, giving priority to subscriptions available for activation.

* Add changefile(s) from automation for the following project(s): woocommerce

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-08-01 19:04:55 +02:00
Fernando Marichal 03bbc139de
Enable skipped E2E tests for attributes (#50143)
* Enable test to add existing attributes

* Enable test to update product attribute

* Add changelog

* Locate item by aria-label instead of label

* Add blur to the summary field
2024-08-01 13:45:11 -03:00
Nathan Silveira 6a9278d7c2
Strip HTML tags from aria-label in wc_help_tip function (#50103)
* Strip HTML tags from aria-label in wc_help_tip function

* Run same escape sequence for aria_label string

* Refactor wc_help_tip and add additional test case

* Remove blank line
2024-08-01 12:35:41 -03:00
Thomas Roberts e2bd308e8e
Prevent Store API orders being placed with empty/invalid fields (#50028)
* Fix spacing/capitalisation on comments.

* Use get_fields_for_location to prevent numeric keys going into locale

* Merge default locale with current locale

Required because the current locale only contains a diff against the default

* Iterate over current locale to get validate required fields

* Add unit tests to cover the state/postcode checks

* Add changelog

* Fix lint errors

* Ensure locale filter runs when tests need it.

* Update tests to reset locale after running

* Add validate_required_additional_fields function

* Add test to ensure required additional fields are passed

* Add throws tag to docblock
2024-08-01 15:58:06 +02:00
Mike Jolley 02c639c2a3
Store API: Remove the need for nonces when using cart tokens. Remove deprecated `X-WC-Store-API-Nonce` header. (#50025)
* Tweak token validation to handle empty nonce

* Disable nonce check if you have a valid token

* Docs for Cart-Token

* Remove deprecated X-WC-Store-API-Nonce (was due to be removed blocks 7.5)

* Token should default to empty string

* Changelog
2024-08-01 15:52:54 +02:00
Michal Iwanow a15235d230
Update My Subscriptions screen labels and columns (#49985)
* Remove Marketplace feedback modal which is no longer used

The goal of the modal was not to be shown after 2023 (see https://github.com/woocommerce/woocommerce/pull/39609),
so we can remove it from the codebase now. Especially that it's a bit buggy - snackbar prompting for feedback
is displayed but the modal is not there because of the check for FEEDBACK_DIALOG_CAN_APPEAR.

* Marketplace Subscriptions - rename columns

* Marketplace subscriptions - show status badge in the Subscription column

Additionally, we remove the info icon from the status popover

* Marketplace subscriptions - add button helping to turn renewals on

* changelog

* Add focus handlers for accessibility

* Remove unused variable

* Fix sharing path url - My Subscriptions

* Change the status badge priority for expired

We should show the expired badge first, as it makes more sense with the
primary action.

---------

Co-authored-by: raicem <cem.unalan@automattic.com>
Co-authored-by: Cem Ünalan <raicem@users.noreply.github.com>
2024-08-01 14:12:32 +02:00
Manish Menaria a73c6e5546
Product Collection: Enable Context-Aware Previews by Adding `usesReference` to `registerProductCollection` (#49796)
* Allow registering custom collections with various context references

Implemented the registration of product collections with different context references using the `usesReference` property. These custom collections are now registered with specific contexts such as product, cart, order, and archive.

This enhancement allows for more tailored previews and functionality based on the specific context in which the product collection is used.

* Add changefile(s) from automation for the following project(s): woocommerce-blocks

* Support multiple references for usesReference

* docs: update documentation to include `usesReference`

Enhanced the `register-product-collection` documentation to include details about the new `usesReference` property. This property allows collections to specify required references, enhancing their contextual relevance and preview capabilities.

- Added `usesReference` description to the collection fields section.
- Included examples demonstrating the usage of `usesReference` with single and multiple references.
- Clarified the behavior when required references are unavailable on the editor side but available on the frontend.

This documentation update provides third-party developers with the necessary information to utilize the `usesReference` property effectively in their custom product collections.

* test: add e2e tests for `usesReference`

Added end-to-end tests to verify the functionality of the `usesReference` property in product collections. These tests ensure that the appropriate preview labels are displayed.

- Created multiple custom product collections with different `usesReference` values: `product`, `cart`, `order`, `archive`, and combinations of these.
- Verified that collections show the correct preview label when the required reference is present.
- Ensured that the preview label is not shown in irrelevant contexts, such as posts or product catalog templates.

This addition enhances test coverage and ensures the robustness of the `usesReference` feature.

* Fixed issue with preview label showing in Specific Product and Archive templates.

* Handle cases when termId or productId is 0

This also improves the readability of the code by using better variable names.

* Make PC use postId context so location can be recognised correctly (#50152)

* Fix TS errors

---------

Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Karol Manijak <20098064+kmanijak@users.noreply.github.com>
2024-08-01 15:33:27 +05:30
Bart Kalisz 63e212f9ce
Blocks: Update wp-env config to use production WP (#49704) 2024-08-01 11:59:42 +02:00
DAnn2012 e65e8bf83a
Made two strings translatable in slotfill.js (#50198)
* Update slotfill.js

* Add changefile(s) from automation for the following project(s): woocommerce

---------

Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Chi-Hsuan Huang <chihsuan.tw@gmail.com>
2024-08-01 09:13:18 +00:00
Alba Rincón 69ce0c6e3a
CYS - Document possible Intro pages (#50171)
* CYS - Document possible Intro pages

* Update README.md

* Add changefile(s) from automation for the following project(s): woocommerce

* Fix lint errors

* Move images to the repo

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-08-01 10:33:03 +02:00
Akeda Bagus cf6268ec55
Use UTM parameters to link Tracks events: CTA from connect notice and successful site connection (#50126)
Pass UTM parameters to get events from clicking "connect" notice to site being connected
2024-08-01 14:01:21 +07:00
Ilyas Foo bb8090a165
Improvements to core profiler checkbox UX (#50151)
* Fix border and vertical align

* Changelog

* Add toggle event to plugin card

* Add test

* Fix double invocation and simplified onChange

* Fix unintended optional parameter change
2024-08-01 13:26:05 +08:00
Chi-Hsuan Huang e29d14b12e
Implement server-side remote error logging (#49599)
* Implement php remote logging

* Log fatal errors remotly

* Add tests

* Add changelog

* Improve code doc and type check

* Bug fixs

Fix Undefined variable $local_logger

* Rebase

* Fix tests

Fix tests

* Fix import path

* Use WC_Site_Tracking::is_tracking_enabled()

* Simplfy path checking/replace logic

* Rename log method -> handle

* Handle wp_safe_remote_post fails

* Fix lint

* Update plugins/woocommerce/includes/class-woocommerce.php

Co-authored-by: Barry Hughes <3594411+barryhughes@users.noreply.github.com>

* Update plugins/woocommerce/src/Internal/Logging/RemoteLogger.php

Co-authored-by: Barry Hughes <3594411+barryhughes@users.noreply.github.com>

* Use WC_Rate_Limiter

* Update wc_doing_it_wrong log method name

* Update is_third_party_error method signature in RemoteLogger.php

* Revert changes

* Update plugins/woocommerce/src/Internal/Logging/RemoteLogger.php

Co-authored-by: Barry Hughes <3594411+barryhughes@users.noreply.github.com>

* Update plugins/woocommerce/src/Internal/Logging/RemoteLogger.php

Co-authored-by: Barry Hughes <3594411+barryhughes@users.noreply.github.com>

* Update plugins/woocommerce/src/Internal/Logging/RemoteLogger.php

Co-authored-by: Barry Hughes <3594411+barryhughes@users.noreply.github.com>

* Update plugins/woocommerce/src/Internal/Logging/RemoteLogger.php

Co-authored-by: Barry Hughes <3594411+barryhughes@users.noreply.github.com>

* chore: Add 'php' tag to RemoteLogger in woocommerce

* Fix test

---------

Co-authored-by: Barry Hughes <3594411+barryhughes@users.noreply.github.com>
2024-08-01 04:56:14 +00:00
Chi-Hsuan Huang c9f20f87d2
Fix e2e Google for WooCommerce strict mode violation error (#50189)
* Fix e2e Google for WooCommerce strict mode violation error

* Add changelog

* Fix test
2024-08-01 12:27:00 +08:00
Niels Lange 3dd6a4037b
Display address card for virtual products if shopper's address is known (#50127)
* Display address card for virtual products

* Remove obsolete dependency

* Optimise dependencies

* Add changefile(s) from automation for the following project(s): woocommerce-blocks

* Adjust core e2e tests

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-07-31 15:17:21 +02:00
Niels Lange 6e2fbcae52
Text adjustments on shipping zones settings page (#50136)
* Text adjustments on shipping zones settings page

* Add changefile(s) from automation for the following project(s): woocommerce

* Fix line error and escape output

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-07-31 15:16:59 +02:00
Vladimir Reznichenko 5d4733edd8
CI: re-introduce sharding in PHPUnit jobs (#50084)
In this PR we re-grouping PHPUnit jobs and introducing sharding based on two test suites - legacy and main, in order to reduce per-PR CI flow duration and release workers earlier.
2024-07-31 12:58:15 +02:00
Tung Du 5ffad9a659
[Experimental]: Update: new title and icon for the Overlay Navigation block (#50011)
* update: rename Navigation block to Overlay Navigation with new icon

* chore: changelog

* chore: use comment instead of update

* reset lock file

* test: update block title

* test: update overlay navigation test
2024-07-31 12:56:53 +07:00
DAnn2012 4318dac7ec
Fix typo (class-wc-rest-wccom-site-ssr-controller.php) (#50145)
* Update class-wc-rest-wccom-site-ssr-controller.php

* Add changefile(s) from automation for the following project(s): woocommerce

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-07-30 16:29:50 -07:00
Alex Florisca 13a79c821a
Express checkout buttons have a min-width of 240px (#49304)
* express checkout buttons have a min-width of 240px

* Add changefile(s) from automation for the following project(s): woocommerce-blocks

* Fix linting issue

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-07-30 15:42:51 +01:00
nigeljamesstevenson 217d628199
Remove changelog file that was created for `9.1.4` (#50120)
Delete plugins/woocommerce/changelog/fix-woocommerce_product_add_to_cart_text-filter-core-approach

removing changelog that was created for `9.1.4`
2024-07-30 06:50:09 -07:00
Fernando Marichal e759036dcb
[Enhancement]: Change link label for duplicated SKU (#49729)
* Change link label for sku

* Add changelog

* Add id to product_sku

* Fix focus function

* Get element by id

* Fix tests

* remove hardcoded elements

# Conflicts:
#	packages/js/product-editor/src/hooks/use-error-handler.ts

* Add id to generic text

* Remove comment

* Fix e2e tests

* Add changelog

* Fix js tests

* Show example of empty useValidation

* Rename validator function

* Create method getParentTabIdByBlockName

* Fix errorhandler hook

* Fix tests

* Fix useBlocksHelper tests

* Fix e2e test

* Fix test

* Add tests

* Replace empty string by null

* Add errorContext null check

* Fix errorHandler hook tests

* Fix test description

---------

Co-authored-by: Lourens Schep <lourensschep@gmail.com>
2024-07-30 10:00:17 -03:00
Nathan Silveira 71b865fa63
Add abbreviations for fields GTIN, UPC, EAN, or ISBN (#50042)
* Add abbreviations for fields GTIN, UPC, EAN, OR ISBN

* Add translators comments
2024-07-30 09:51:29 -03:00
Alba Rincón 9d826e7b3b
CYS - Update the `show_on_front` setting to `posts` (#50083)
* Update the `show_on_front` setting to `posts`.

This is needed for the CYS flow to work properly

* Add changefile(s) from automation for the following project(s): woocommerce

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-07-30 13:07:46 +02:00
Francesco 81d20d8d32
feat: add `aria-required` attributes to WC form fields (#48371)
* feat: add `aria-required` attributes to WC form fields

* Add changefile(s) from automation for the following project(s): woocommerce

* added tests for radio fields

* WIP

* WIP

* yoda, space

* Update functions.php

* WIP

* WIP

* Add changefile(s) from automation for the following project(s): woocommerce

* Add changefile(s) from automation for the following project(s): woocommerce

* Update plugins/woocommerce/tests/legacy/unit-tests/templates/functions.php

Co-authored-by: Alex Florisca <alex.florisca@automattic.com>

* fix checkbox required attribute, add tests

* lint

* Add changefile(s) from automation for the following project(s): woocommerce

* importing changes from Thomas' branch, aria-hidden on abbr

* Add changefile(s) from automation for the following project(s): woocommerce

* added hidden also on JS changes

* template number change

* forgot to commit these changes

* porting of changes from selectWoo repository

* undo unwanted changes

* Update checkout e2e to stop looking for * in field labels

* removed aria-hidden to abbr, to avoid regressions across multiple repos

* lint

---------

Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Alex Florisca <alex.florisca@automattic.com>
Co-authored-by: Thomas Roberts <thomas.roberts@automattic.com>
2024-07-30 16:11:23 +05:30
Luigi Teschio d080f44c17
CYS: Fix opt-in flow fonts (#50086)
* CYS: Fix opt-in flow fonts

* Add changefile(s) from automation for the following project(s): woocommerce

* add E2E test

* fix e2e test

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-07-30 12:10:51 +02:00
Luigi Teschio d4e686a063
CYS: Fix opt-in flow patterns (#50080)
* CYS: Fix opt-in flow patterns

* clean up not necessary state

* Add changefile(s) from automation for the following project(s): woocommerce

* show spinner

* improve e2e test

* fix e2e test

* fix lint error

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-07-30 12:10:16 +02:00
Adrian Moldovan d4696f0437
[e2e tests] Updated docs with new pnpm commands (#50117) 2024-07-30 10:58:05 +02:00
github-actions[bot] e750ba5592
Delete changelog files based on PR 49929 (#50095)
Delete changelog files for 49929

Co-authored-by: WooCommerce Bot <no-reply@woocommerce.com>
2024-07-29 11:58:29 -07:00
Alexandre Lara ced27dddeb
[Experimental] Product Filters Redesign > Overlay: Replace Product Filters Block with Template Part (#49999)
* Modify Product Filters Overlay template part

* Add changefile(s) from automation for the following project(s): woocommerce

* Add E2E tests for the Product Filters Overlay template part

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-07-29 15:36:53 -03:00
Alex Lykesas 26a6c9adba
Enhance Customer Email Password Reset include Login Username in Reset Password Link (#49737)
* Add login username in reset password links

* Add changefile(s) from automation for the following project(s): woocommerce

* Move login param as final query param

* Bump template versions to 9.3.0

* `phpcs:ignore` should be specific

* `phpcs:ignore` should be specific

---------

Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Barry Hughes <3594411+barryhughes@users.noreply.github.com>
2024-07-29 11:11:00 -07:00
github-actions[bot] 853c722b08
Delete changelog files based on PR 50076 (#50097)
Co-authored-by: WooCommerce Bot <no-reply@woocommerce.com>
2024-07-29 18:54:55 +02:00
Simon Porter f61a9bf37a
Allow rendering the quantity in cart when the quantity is not editable (#49450) 2024-07-29 16:12:15 +01:00
nigeljamesstevenson 77318c4a67
Cherry pick #351 and #363 into trunk (#50075)
* XSS vulnerability on various unescaped attributes

* escape Product Filter Stock status

* escape more blocks

* escape more blocks

* escape more blocks

* add changelog

* update changelog

* Fix misplaced json encode flags

* Add escaping to the block names

* Update changelog message

---------

Co-authored-by: Luigi Teschio <gigitux@gmail.com>
Co-authored-by: roykho <roykho77@gmail.com>
2024-07-29 15:29:34 +01:00
Miguel Pérez Pellicer 61d9b63f67
Add admin_install_timestamp in WC_Tracker (#50076)
* Add admin_install_timestamp in WC_Tracker

* Lint

* Tweak tests

* Tweak tests

* Lint
2024-07-29 18:12:55 +04:00
github-actions[bot] 191c8edd18
Update changelog.txt from release 9.1.4 (#50039)
* Prep trunk post release 9.1.4

* Satisfy changelog requirement.

---------

Co-authored-by: WooCommerce Bot <no-reply@woocommerce.com>
Co-authored-by: Barry Hughes <3594411+barryhughes@users.noreply.github.com>
2024-07-29 07:03:06 -07:00
RJ a92fbcaa07
fix: wcadmin react18 createroot shipping settings, payment method, wc beta tester (#48835) 2024-07-29 21:30:03 +08:00
Jonathan Lane 31c4ae8431
Adds concurrency limit to workflow run (#50034)
Co-authored-by: Jon Lane <jon.lane@automattic.com>
2024-07-29 16:25:26 +03:00
Vladimir Reznichenko 07a71106dc
Monorepo: actualize loaders paths filtering for better Webpack performance. (#49714) 2024-07-29 15:20:17 +02:00
Karol Manijak edc268afa5
Product Collection: sync with current query doesnt display the correct products in the specific category templates (#49889)
* Recognize custom category templates as archive ones

* Disable the preview label if termId is recognized

* Fetch the product category template ID

* Prepare util to properly parse product taxonomies

* Utilise the taxonomies util and update the query accordingly

* Add tests

* Update tests to be more specific

* Improve selectors in E2E test

* Add changelog

* Update selectors

* Fix the order of expected products

* Remove unneceessery entries from array that are covered by another entries

* Rename the variable to beytter depict its purpose
2024-07-29 14:21:44 +02:00
Adrian Moldovan c12cb6ccdf
[tests] Move API core tests as a suite in e2e-pw (#50024) 2024-07-29 13:51:36 +03:00
Tom Cafferkey 640312d0d1
CYS: Insert Add Patterns button for no blocks placeholder (#49981)
* Add uninteractive button

* insertPatternByName

* Add comment explaining the event listener

* Add E2E test coverage

* Vertical align content

* Hide popover for interactive elements

* Replace not.toBeVisible with toBeHidden
2024-07-29 10:05:29 +00:00
Bart Kalisz d731edc868
Product Collection: Fix max price filter query value inclusion (#49917) 2024-07-29 11:51:26 +02:00