Commit Graph

21686 Commits

Author SHA1 Message Date
Jorge Torres 490a492ab4 Simplify product CSV import logic using helper 2024-09-12 12:23:47 -07:00
Jorge Torres e478753385 Add CSV upload helper 2024-09-12 12:23:47 -07:00
Jorge Torres 5a9adc7c83 Add utility function to create a no-index directory 2024-09-12 12:23:47 -07:00
Jorge Torres 2a760a51a1 Add better validation for file paths in CSV product import 2024-09-12 12:23:47 -07:00
Jorge Torres b099eb49cf Move AJAX callback to produt importer controller 2024-09-12 12:23:47 -07:00
Naman Malhotra 435be75e96
Update readme.txt (#51323)
readme tweaks and version update
2024-09-12 19:23:34 +07:00
github-actions[bot] bda4a4d1a4
Cherry pick 51312 into release/9.3 (#51318)
* Disable remote logging feature by default (#51312)

* Disable remote logging feature by default

* Changelog

* Prep for cherry pick 51312

---------

Co-authored-by: Ilyas Foo <foo.ilyas@gmail.com>
Co-authored-by: WooCommerce Bot <no-reply@woocommerce.com>
2024-09-12 19:03:25 +07:00
Néstor Soriano 6861980316
Prep release/9.3 for 9.3 cycle (#51321)
Prep release/9.3 for 9.3 cycle with version bump to 9.3.1
2024-09-12 13:51:23 +02:00
github-actions[bot] 8291a2d35c
Cherry pick 51289 into release/9.3 (#51293)
* Revert update to createRoot in Checkout block. (#51289)

* Revert "[React 18] Use `createRoot().render()` instead of `render()` (#48843)"

This reverts commit 752273e6ce.

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

---------

Co-authored-by: github-actions <github-actions@github.com>

* Prep for cherry pick 51289

---------

Co-authored-by: Seghir Nadir <nadir.seghir@gmail.com>
Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: WooCommerce Bot <no-reply@woocommerce.com>
2024-09-11 21:48:14 +07:00
Naman Malhotra 04ec3e2d30
Update changelog date for release 9.3 (#51257)
Updated changelog date for 9.3
2024-09-10 20:37:03 +08:00
Néstor Soriano 30045fc22c
Prep release/9.3 for 9.3 cycle (#51226)
Prep release/9.3 for 9.3 cycle with version bump to 9.3.0
2024-09-09 16:22:59 +02:00
Barry Hughes 5d72847296
Prep release/9.3 for 9.3 cycle (#51125)
Prep release/9.3 for 9.3 cycle with version bump to 9.3.0-rc.1
2024-09-04 07:49:38 -07:00
rodelgc 0292968817
Move changelog entries of #51108 to readme.txt (#51130) 2024-09-04 10:51:39 +08:00
github-actions[bot] 041cced998
Cherry pick 51081 into release/9.3 (#51106) 2024-09-04 07:00:53 +08:00
github-actions[bot] e00e6aa90e
Cherry pick 51075 into release/9.3 (#51117)
* Use PHP 7.4 for WooCommerce Blocks' `wp-env` Config (#51075)

This resolves a PHP 7.4 compatibility problem as well as updates the `wp-env` config for the Blocks tests to use 7.4 rather than the latest.

* Prep for cherry pick 51075

---------

Co-authored-by: Christopher Allford <6451942+ObliviousHarmony@users.noreply.github.com>
Co-authored-by: WooCommerce Bot <no-reply@woocommerce.com>
2024-09-03 14:04:21 -07:00
github-actions[bot] 8f80f6cf12
Cherry pick 51067 into release/9.3 (#51083)
* Revert "Store API: Do not resume orders with `pending` status (#50531)" (#51067)

* Revert "Store API: Do not resume orders with `pending` status (#50531)"

This reverts commit 3170acd1b0.

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

---------

Co-authored-by: github-actions <github-actions@github.com>

* Prep for cherry pick 51067

---------

Co-authored-by: Seghir Nadir <nadir.seghir@gmail.com>
Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: WooCommerce Bot <no-reply@woocommerce.com>
2024-09-03 13:02:43 +01:00
github-actions[bot] 5a6d8552a7
Cherry pick 50970 into release/9.3 (#51092)
* Update woocommerce shipping promo banner [wc-shipping-188] (#50970)

* Make sure the WC Shipping slug is used for installation

* Make sure the check to show banner metabox work for HPOS as well

* Make ShippingLabelBannerDisplayRules::order_has_shippable_products work with HPOS as well

* Remove Jetpack plugin specific checks in ShippingLabelBannerDisplayRules

* Use correct variable names for dotcom connection

* Fix comments

* Remove depenency on WCS&T for showing WC Shipping promo banner

* Remove WC Tax and WC Shipping from incompatible plugins

* Vary action button label if WCS&T is already installed

* Inject config and render label purchase app after activation

* Open the purchase modal after adding it to DOM

* Render Shipment tracking metabox

* Use a different headline when WCS&T is already installed

* Fix UX when a none-compatible WCS&T is already active

* Fix CSS linting issues

* Fix Jslint issues

* Improve around usage of localized variables

* Fix and update JS tests

* Address phpcs issues

* Delete metaboxes of compatible WCS&T

* Remove redundant variable assignment

* Remove css and js of WCS&T if a compatible version is installed

* Fix failing legacy PHPUnit tests

* Only open the new label purchase modal if WCS&T is not active

* Remove redundant code around TOS acceptance for showing the banner

* Remove redundant test for Jetpack version checking

* Make sure target passed to MutationObserver.observe is available

* Add changelog file

* Add openWcsModal to component's prototype

* Add more js unit tests

* Address PHP notice

* Remove redundant variable assignments

* Rename wcsPluginSlug to more clear wcShippingPluginSlug

* Add a link to plugins page if incompatible WCS&T is already installed

* Remove unused function parameters

* Fix API resource path

* Handle a case where none compatible version of WCShipping is installed

* Prep for cherry pick 50970

* Remove infant use statement

---------

Co-authored-by: Sam Najian <dev@najian.info>
Co-authored-by: WooCommerce Bot <no-reply@woocommerce.com>
Co-authored-by: Sam Najian <sam.najian@automattic.com>
2024-09-03 11:21:21 +01:00
Chi-Hsuan Huang c82500bbe8
Cherry pick 51013 and 51046 into release/9.3 (#51108)
* add: sanitise query params in remote logging (PHP) (#51013)

* add: remote logger request uri sanitisation (JS) (#51046)

* add: remote logger request uri sanitisation

* md lint

* Update packages/js/remote-logging/README.md

Co-authored-by: Paul Sealock <psealock@gmail.com>

* pr feedback

---------

Co-authored-by: Paul Sealock <psealock@gmail.com>

---------

Co-authored-by: RJ <27843274+rjchow@users.noreply.github.com>
Co-authored-by: Paul Sealock <psealock@gmail.com>
2024-09-03 10:41:51 +01:00
github-actions[bot] f1f3bbee38
Cherry pick 51001 into release/9.3 (#51038)
* Ensure stock change notifications only fire when necessary (#51001)

* Ensure stock change notifs only fire when necessary

In #49583 we changed when the actions that trigger stock change
notifications fire, to decouple them from order creation. However, it
turns out what during product creation, the stock quantity update
routines still run even when no stock is being set and even when the
"manage stock" setting is set to false. Rather than try to untangle the
web of why this happens (and potentially break other things in the
process), this simply adds a check for the "manage stock" setting prior
to firing the notif actions, and bail early if the product does not have
managed stock.

It also adds a unit test, which is really more of an integration test,
to ensure this behavior.

Fixes #50958

* Remove irrelevant doc block info

In #49583 we added a second parameter to the
`woocommerce_variation_set_stock` and `woocommerce_product_set_stock`
action hooks, but it was later removed. However, we didn't remove the
corresponding doc block info.

* Add changelog file

---------

Co-authored-by: Naman Malhotra <naman03malhotra@gmail.com>

* Prep for cherry pick 51001

---------

Co-authored-by: Corey McKrill <916023+coreymckrill@users.noreply.github.com>
Co-authored-by: Naman Malhotra <naman03malhotra@gmail.com>
Co-authored-by: WooCommerce Bot <no-reply@woocommerce.com>
2024-08-30 01:03:56 +07:00
github-actions[bot] e158aada73
Cherry pick 50923 into release/9.3 (#51035)
* CYS - Remove usage of `prepare_item_for_response` function in `Images` endpoint (#50923)

* Remove usage of `prepare_item_for_response` function

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

---------

Co-authored-by: github-actions <github-actions@github.com>

* Prep for cherry pick 50923

---------

Co-authored-by: Alba Rincón <albarin@users.noreply.github.com>
Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: WooCommerce Bot <no-reply@woocommerce.com>
2024-08-29 19:10:03 +07:00
github-actions[bot] fe8bd470e4
Cherry pick 51021 into release/9.3 (#51031)
* [tests] Execute test env setup on host instead of wp-env container (reverts #50445) (#51021)

* Prep for cherry pick 51021

---------

Co-authored-by: Adrian Moldovan <3854374+adimoldovan@users.noreply.github.com>
Co-authored-by: WooCommerce Bot <no-reply@woocommerce.com>
2024-08-29 09:23:38 +01:00
Jorge A. Torres e88474b437
Add changelog to 9.3 (#50973)
* Add changelog entries to readme.txt

* Remove changelog files from changelog/ directory

* Add links
2024-08-27 14:34:38 -03:00
Naman Malhotra 6f53152654 Update stable tag to 9.2.3 (#50965)
woorelease: Update stable tag to 9.2.3
2024-08-26 21:59:14 +03:00
github-actions[bot] 74cccaee18
Cherry pick 50892 into release/9.3 (#50914)
* Ensure translation is loaded for new shared file in Checkout Block (#50892)

* Ensure translation is loaded for new shared file

* add other files

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

---------

Co-authored-by: github-actions <github-actions@github.com>

* Prep for cherry pick 50892

---------

Co-authored-by: Seghir Nadir <nadir.seghir@gmail.com>
Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: WooCommerce Bot <no-reply@woocommerce.com>
2024-08-23 10:57:54 -03:00
Jorge A. Torres 17ff8cbf1b
Cherry-pick PR#50854 into release/9.3 (#50898)
* Revert "Drop Select2 in Backwards compatable manner (#48731)"

This reverts commit 8f98a2a057.

* Fix linting issue

---------

Co-authored-by: Naman Malhotra <naman03malhotra@gmail.com>
2024-08-22 20:53:57 -03:00
Jorge A. Torres 7699efbd2e
Cherry-pick PR#50881 into release/9.3 (#50899)
* Revert "PluginUtil: Add method to get active valid plugins (#48709)"

This reverts commit 4d68cd486e.

* Reintroduce get_all_active_valid_plugins public function after revert (#50885)

Retroduce get_all_active_valid_plugins public function after revert

---------

Co-authored-by: Naman Malhotra <naman03malhotra@gmail.com>
2024-08-22 20:08:13 -03:00
Jorge A. Torres 8841ce6919 Bump stable tag after 9.2.2 (#50895)
Update stable tag
2024-08-22 18:53:23 -03:00
WooCommerce Bot f710b2afb0 Prep release/9.3 for 9.3 cycle with version bump to 9.3.0-beta.1 2024-08-22 00:04:22 +00:00
Lucas fa6ea00b3c
Use stricter text selector on test (#50848)
* Use stricter text selector

Removes text ambiguity to avoid errors like "Strict mode violation resolved to 2 elements". For instance, it might search for "Settings", and there might be a menu "Foo Settings" which would resolve to 2 elements. This changes the behavior to match the exact test, instead of a substring.

* Update page-loads.spec.js

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

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-08-21 13:25:27 -07:00
Tomek Wytrębowicz 63f96eb5a8
Mark props with defaults as not required (#50816) 2024-08-21 21:59:42 +02:00
Adrian Moldovan e1e628ccf0
[e2e tests] Fix flaky navigation to editor (#50841) 2024-08-21 22:18:20 +03:00
Tomek Wytrębowicz d31aae633a
Move `ReportError` to `@woocommerce/components` as `AnalyticsError` (#50108)
Co-authored-by: Eason <eason.su.tw@gmail.com>
2024-08-21 20:12:13 +02:00
Tomek Wytrębowicz 536807ca43
Fix optional param in PHPdoc for WC_Admin_Marketplace_Promotions (#50732)
Co-authored-by: github-actions <github-actions@github.com>
2024-08-21 20:11:16 +02:00
Jorge A. Torres b798b261b3
Update stable tag to 9.2.1 (#50850)
woorelease: Update stable tag to 9.2.1
2024-08-21 15:10:28 -03:00
Corey McKrill b430971093
Avoid fatal in `wc_get_chosen_shipping_method_ids` (#50774)
This ensures the WC() session object is initialized before attempting to
get chosen shipping methods. If it's not initialized,
`wc_get_chosen_shipping_method_ids` will return an empty array.

Fixes #50283
2024-08-21 10:28:54 -07:00
Tomek Wytrębowicz 0322426dce
Reduce duplicated code in Analytics classes (#49425)
- Add code docs to the Analytics classes and make get_order_statuses non-internal.
   Document analytics classes and some methods. Add simple examples of how to use it. Give a brief "why?" and "when?" answers. Add links between related classes.
- Replace `Automattic\WooCommerce\Admin\API\Reports\*\Query` classes with a single `GenericQuery` class.
- Reduce the amount of duplicated code in Analytics `DataStore`s.
- Reduce duplicated code in Analytics controllers
- Add `FilteredGetDataTrait`, `OrderAwareControllerTrait`, and `StatsDataStoreTrait` for extension developers to reuse while creating custom Analytics
- Add a `GenericQuery` to reduce duplicated code in Query classes.
   Also, to expose it to community extensions for reuse.
- Use `GenericQuery` instead of duplicated `Query` classes
- Move caching code to shared `DataStore::get_data`
- Move intervals specific `initialize_queries` to shared Trait
- Move intervals checking logic to shared `StatsDataStoreTrait`
- Reuse `GenericController::prepare_item_for_response` for `Reports\Controller` subclasses
- Reuse `GenericController::get_collection_params` for `Reports\Controller` subclasses.
- Move `get_items` code to shared `GenericStatsController`
- Move shared paginable controllers `get_items` code to the generic class
- Move fields param to `GenericStatsController`
- Separate `OrderAwareControllerTrait` from `ReportController`
   to allow specific Analytics Controllers to extend the `Generic(Stats)Controller` directly, without extending the `ReportController`, which is used to list reports.


It's meant not to change any behavior. However, due to unification, it did tweak a few things mostly from the developer perspective:
- Previously, only some controllers threw an error from `get_items` when the data was missing; some did not. Now controllers the following Controllers changed behavior to also for such an error:
	- Coupons
	- Customers
	- Downloads
	- Orders
	- Products
	- Taxes
- the error has one error code from all controllers:`woocommerce_rest_reports_invalid_response` (previously there were report-specific)
   - `woocommerce_rest_reports_categories_invalid_response` -> `woocommerce_rest_reports_invalid_response`
- In Orders Controller, the `$orders_data['order_number'], $orders_data['total_formatted']` are set in the `prepare_item_for_response` method, not in the `get_items`So `prepare_item_for_response` function is expected to be called with bare data from Query
- In Products Controller extended-info is now sanitized in the `prepare_item_for_response` method, not in the `get_items`
- ⚠️ (breaking) Previosly some Controlers' `prepare_item_for_response` function was getting and expecting first argument to be casted to `object`, while the rest of controllers used data as returned from the Store. This PR unifies this behavior  for
   -  `Coupons\Stats\Controller`
   -  `Taxes\Controller`
   -  `Taxes\Stats\Controller`
   So, if you extend those classes and override `prepare_item_for_response` in a way that expects `object`, you will get an error. (I have not found such cases in the `all-plugins` repo.)
   All `woocommerce_rest_prepare_report_*` filters remain intact and inconsistent for backward compatibility.

Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Mik <mikkamp@users.noreply.github.com>
2024-08-21 19:23:51 +02:00
Adrian Duffell c738aeed17
Update site visibility badge height to 18px (#50792)
* Update badge height to 18px

* Add changelog
2024-08-22 00:23:40 +08:00
Adrian Moldovan cb9912bcf4
[e2e test] Fix strict mode violation in delete variation test (#50838) 2024-08-21 08:57:48 -07:00
piinthecloud 7dd2f11805
Docs/check payment method support (#50845)
* Fixed minor issues with recently added snippets docs

Fixed a few duplicate titles and encoding issues in the docs that were recently added via public resources.

* Create docs-check_payment_method_support

* update manifest

* fix linter errors

---------

Co-authored-by: Yaku <15178758+jacoswan@users.noreply.github.com>
2024-08-21 11:56:26 -04:00
Alba Rincón 796854770c
CYS - Move the `ai/product` endpoint to woocommerce admin API (#50393)
* CYS - Move the ai/store-title endpoint to woocommerce admin api

* Add middleware and callback

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

* Fix lint error

* CYS - Move the ai/business-description endpoint to woocommerce admin API

* CYS - Move the ai/store-info endpoint to woocommerce admin API

* Update endpoint

* CYS - Move the ai/images endpoint to woocommerce admin API

* CYS - Move the `ai/patterns` endpoint to woocommerce admin API

* CYS - Move the `ai/product` endpoint to woocommerce admin API

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

* Remove import

* Add changefile(s) from automation for the following project(s): woocommerce-beta-tester, woocommerce

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

* Add strict types

* Extract AI_CONTENT_GENERATED constant

* Move instance creating to where it's used

* Add try/catch and fix the on Patterns

* Use the base AIEndpoint class

* Fix endpoint

* Update comment return type

* Fix comments

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-08-21 15:34:12 +02:00
Roy Ho 944d9233ed
Add/clear theme info cache (#50803)
* Add function to clear system status theme info cache to tool page

* Add clear cache tooltip to the template override section

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

* Remove extra td

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-08-21 06:21:14 -07:00
DAnn2012 5690850e47
Fix typo (class-wc-tests-customizing-product-catalog.php) (#50336)
* Update class-wc-tests-customizing-product-catalog.php

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

---------

Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Vedanshu Jain <vedanshu.jain.2012@gmail.com>
2024-08-21 17:39:39 +05:30
Ilyas Foo 20a6327637
Add CSS outline for keyboard accessibility (#50794)
* Add CSS outline for keyboard accessibility

* Changelog
2024-08-21 18:47:33 +08:00
Adrian Duffell e45b59b71f
Update the link color in legal disclaimers on core profiler (#50830)
* Revert t&c link colors in core profiler

* Add changelog
2024-08-21 17:11:07 +08:00
Ilyas Foo 64dcafe29b
Vertically center product meta box elements (#50826)
* Vertically center product meta elements

* Changelog
2024-08-21 14:42:59 +08:00
Gabriel Manussakis b449ca840f
[Accessibility] Announce notice messages after page loads (#50061)
* Update makup of add to cart success message

* Update CSS to position the add to cart success message content

* Focus notice message after page loads

* Add changelog file

* Remove tabindex attribute from add-to-cart success message

* Update tests for the add-to-cart success message

* Remove white space on test

* Increase delay before focusing the error message

* Cobine delay with queue method

* Remove unnecessary woocommerce-notice-content class

* Swap view cart link order in notice

* Remove woocommerce-notice-content wrapper

* Refactor to vanilla JS code that focus on notice message

---------

Co-authored-by: Manish Menaria <the.manish.menaria@gmail.com>
2024-08-21 11:54:58 +05:30
Akeda Bagus 9ef1b72fc1
Set timeout to 2 seconds for helper product-usage-notice-rules endpoint request (#50821) 2024-08-21 11:47:40 +07:00
Moon dac8fa8eba
Coming soon mode - Match shop page when permalink structure is set to plain (#50567)
* Match shop page when permalink structure is set to plain

* Revert uninteded change

* Match post types

* Check for param

* Add test for post_type check

* Fix tests

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

* Use wp_parse_url

* Test returning false

* Lint fixes

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-08-20 19:50:00 -07:00
Jorge A. Torres d07cb35247
Cherry pick PR#50805 into trunk (#50814) 2024-08-20 20:46:07 -03:00
Jorge A. Torres d2104e1079
Cherry pick PR#50804 into trunk (#50812) 2024-08-20 20:45:13 -03:00