* PluginUtil: Add method to get active valid plugins
When getting a list of active plugins directly from the options table,
you can run into an error if you try to then access one of the plugin
files if it doesn't actually exist. WP Core has a method that verifies
that the files exist before returning the list. But it's marked as a
"private" method, which means it could change and break backcompat.
That seems very unlikely, though, so we're using the method (it was
already in use actually), but putting in some safeguards so we can
detect if a backcompat issue arises.
Fixes#48132
* Modify to accommodate multisite
* woocommerce_removed_coupon event should recalculate totals automatically
* Remove early calculation from cart routes
* get_cart_for_response ensures late calculation if needed
* Remove calculation when removing coupons
* Calc totals already does shipping
* Remove calc on checkout route
* Update cart controller to load session if needed and introduce new helper methods
* Changelog
* Improve mu-compatibility of `WC_Customer_Data_Store::get_last_order()`.
* Use the blog prefix as a suffix rather than a prefix (readability).
Co-authored-by: Corey McKrill <916023+coreymckrill@users.noreply.github.com>
* Extract site-specific user meta handlers into their own set of reusable methods.
* Make the customer data store's get_order_count and get_total_spent methods network-aware.
* Support deletion of site-specific user meta.
* Update cache invalidation (make multisite-aware) for money spent, order count, and last order.
* Further fixes for mu-aware order and spend caching.
* Add migration to remove unneeded/unused user meta data.
* Revert change to handling of `paying_customer` user meta (out-of-scope for this fix).
* Be stricter when obtaining current blog prefix.
* Add missing `@since` tag to historic filter hook.
Archaeology: https://github.com/woocommerce/woocommerce/compare/4.9.0...4.9.1#diff-8dcda80485fb4b7bc3cb9544ecf4b73aa78dc448bc574b1e56271ee8b56e7189R330
* Ensure the 'last order ID' references an order that actually belongs to the current customer.
* Fix docblock.
* Add additional test to describe safeguards around fetching a customer order.
* Unset `$last_order_id` if the order is not of type `WC_Order`
Co-authored-by: Corey McKrill <916023+coreymckrill@users.noreply.github.com>
* Merge 9.1.0 update functions list.
* Logging best practices (do not translate).
Co-authored-by: Corey McKrill <916023+coreymckrill@users.noreply.github.com>
* Logging best practices (do not translate).
Co-authored-by: Corey McKrill <916023+coreymckrill@users.noreply.github.com>
---------
Co-authored-by: barryhughes <3594411+barryhughes@users.noreply.github.com>
Co-authored-by: Corey McKrill <916023+coreymckrill@users.noreply.github.com>
* Wrap order note saving with wc_sanitize_textarea
* Add changelog
* Change note output to wp_kses with no allowed HTML
* Add totalsMock for order confirmation test
* Add Totals test
* Add classic checkout test to ensure notes are cleaned
* Change wp_kses_post to wp_kses for all order note usage
* wp_kses the order note before editing too
---------
Co-authored-by: Thomas Roberts <thomas.roberts@automattic.com>
The old code was retrieving all the existing download entries from
the database and then counting them locally. Now a SQL COUNT query
is used instead.
---------
Co-authored-by: Naman Malhotra <naman03malhotra@gmail.com>
* Fix typo (index.tsx)
"Congratuations" -> "Congratulations"
* Add changefile(s) from automation for the following project(s): woocommerce
---------
Co-authored-by: Paul Sealock <psealock@gmail.com>
Co-authored-by: github-actions <github-actions@github.com>
* Update wc_update_product_lookup_tables_column function
* Rename error message
* Create 'form-flex-box' class and increase icon size
* Persist global_unique_id for main product and variations
* Add global unique id field to main product
* Add global unique id field to variations
* Add changelog
* Update error message
* Add `rel="noreferrer"` to external link
This is a precautionary security measure to to prevent the new page
from accessing the original page’s `window` object.
See pb22l9-304-p2 (internal link) for additional context.
* Add changefile(s) from automation for the following project(s): woocommerce
---------
Co-authored-by: github-actions <github-actions@github.com>
* move checkout docs with front matter to main folder
* add manifest
* add core changelog
* Remove emojis, unsupported links and table of contents
* pr comments
* update folder name and remove toc
* title fix
---------
Co-authored-by: Jacklyn Biggin <hi@jacklyn.dev>
* Fix order_count consistency between stats and reports
* Add changefile(s) from automation for the following project(s): woocommerce
---------
Co-authored-by: github-actions <github-actions@github.com>
* Bring back footer and header borders on hover and selected patterns
* Add changefile(s) from automation for the following project(s): woocommerce
* Fix the selected pattern color
* Fix lint errors
---------
Co-authored-by: github-actions <github-actions@github.com>
* Update delete button copy to match Dotcom
* Add changefile(s) from automation for the following project(s): woocommerce
---------
Co-authored-by: github-actions <github-actions@github.com>
* Fix the intro cards to match the designs
* Add changefile(s) from automation for the following project(s): woocommerce
---------
Co-authored-by: github-actions <github-actions@github.com>
* Refactor to extract ExpressionField
* Move styling of expression and result prefixes to CSS
* Layout expression field with grid
* Add buttons to expression field
* Enter edit mode and cancel
* Hook up editing in textarea
* Allow existing expression to be edited
* Make expression param optional
* Use ExpressionField to add new expression
* Hide cancel button if no callback and add updateLabel prop
* Only show error when dirty
* Placeholder for expression field
* Format result in expression field
* Expression field textarea styling
* Justify expressions at bottom
* Prevent jumping when editing expression
* Revert changes on cancel
* Remove unused CSS
* Extract ExpressionTextArea
* Extract ExpressionResult
* Auto height textarea
* Hover styling for expression
* Result type tag
* Tweak styling
* Update padding in expression field
* Changelog
* Enable scrolling of result when editing expression
* Use smaller close icon
* Fix enabling of add/edit button
* Focus text area when clicking edit button
* Put cursor at the end of text area when focusing it
* Enter edit mode when clicking on text area
* Remove expression in list
* Don't style expressions list as a flex box
* Show full result while editing expression
* Render an aria-label for the initial mini cart html
* FIx mini-cart items not visible when zoomed in
* Add changelog
* Fix linting issues
* Add changefile(s) from automation for the following project(s): woocommerce-blocks, woocommerce
* Kick the GH actions
* Add changefile(s) from automation for the following project(s): woocommerce-blocks, woocommerce
* delete duplicate changelog file
* Add changefile(s) from automation for the following project(s): woocommerce-blocks, woocommerce
* Delete plugins/woocommerce/changelog/48384-fix-43639-zoom-mini-cart
---------
Co-authored-by: github-actions <github-actions@github.com>
* Improve the handling of the deprecated WC()->api property:
- When the legacy REST API plugin is not available, set the property
to an instance of RestApiUtil. This object has the get_endpoint_data
method that is still used by external plugins.
- Add a new legacy_rest_api_is_available method to WooCommerce class.
- Replace all instances of "is_null(WC()->api)" with (negated) calls to
the new legacy_rest_api_is_available method.
- Make WC()->api point to an instance of LegacyRestApiStub, instead of RestApiUtil.
---------
Co-authored-by: Naman Malhotra <naman03malhotra@gmail.com>
* Add inputMode decimal to regular price and sale price fields and useNumberInputProps
* Change min and max numbers for NumberControl
* Allow typing minus in number
* Fix number control CSS issues in modals
* Allow providing elements as label and add onFocus handler
* Migrate manage downloads limits modal to NumberControl
* Migrate shipping dimension fields to NumberControl
* Add changelog
* Avoid passing NaN to onChange
* Move limits to individual fields
* Update max limits and add underscores for readability
* add block parser and filters wip
* replace strings with template slugs and do some polish
* Refactor some parts to reused in wc_tracker
* Clean up and introduce snapshot data in the WC_Tracker
* Minor improvements
* Track only fse themes
* Consolidate collection names per context in the WC_Tracker snapshot
* Add changelog
* Separate taxonomy filter usage into specific category and tag usage
* Polish event params values
* Lint
* Remove wc-tracker to simplify the pr
* More cleanup
* Unify location names
* Handle stock status default value
* Renamed order confirm context
* Track price filter fix
* consider 3pd stock statuses in tracking
* Lint
* Consider the woocommerce_hide_out_of_stock_items option when tracking stock filter
* Cleanup empty lines
* Rename single product area flag
* Add docblock
* Avoid drafts and autosaves
* introduce a new class under tracking events
* Cleanup main controller
* Cleanup
* Add docblocks
* Stop recursive process up to 2 levels and cleanup
* Cleanup
* Ensure blocks exist
* Lint
* Normalize keys and values
* Track inherit and order-by usage
* Fix lint
* Add strict types
* add strict again
* Strict types
* Move strict types
* Remove codeblock
* Clean up
* Move directive on separate line
* Cleanup spaces
* Updated Collection Selection Buttons
Rather than using normal buttons we're going to replace these with cards
that we want to use instead.
* Reworked Product Catalog Creation
* Added Dropdown Collection Option
* Changelog
* Added Collection Dashicon Support
* Fixed Collection Change Modal
This is going to get replaced soon but it may as well look nicer than it
does right now.
* Type Fix
* Fixed `:focus` Hover Border
* Simplified Click Handler
* Style Fixes
* Gutenberg Style Fixes
* E2E Fixes
* Fixed E2E Test
* Added Dropdown Inserter E2E Support
* Logging
* Fixed Default Insertion Options
* Prevent Premature Rendering
* E2E Fix Attempt
* Lint Fix
* E2E Fix
* Fix test chaking if custom registred collections are available in the collection chooser
* Improve logic of choosing collection to cover both dropdown and placeholder
---------
Co-authored-by: Karol Manijak <20098064+kmanijak@users.noreply.github.com>
* Add initial install version to database
* Change update_option to add_option
* Add changelog
* Add since annotation
* Change initial_install_version option to initial_installed_version and also set autoload to false
* Add unit test for initial_installed_version
* Add unit test for initial_installed_version
* Make use of simple products exclusion filter regardless of included products
* Add unit test
* Add changefile(s) from automation for the following project(s): woocommerce
* Update reports-variations.php: Remove since comment
---------
Co-authored-by: github-actions <github-actions@github.com>
* Load controllers only when needed for performance.
* Classify controllers based on their namespace and load selectively.
* Enable private namespace along with store api.
* Only prevent route loading when request is known for back compat.
* Lint fixes.
* Remove duplicate inclusion.
* Correctly load feature controller.
* Add since tag.
* Add unit tests.
* CYS: Fix pattern preview border color when the user hovers the preview; fix pattern preview border color when the pattern is present in the site preview
* Remove the is-added class to avoid marking patterns that are already removed
* Add changefile(s) from automation for the following project(s): woocommerce
* Fix lint errors
* Fix lint error
---------
Co-authored-by: Alba Rincón <alba.rincon@automattic.com>
Co-authored-by: github-actions <github-actions@github.com>
* Link Payments task item to Overview if WooPayments is connected
* Link APMs task item to payments task page
* Add changelog for WooCommerce
* If WCPay is connected go to Payments Overview page
It shouldn't matter if the WCPay account is fully or partially onboarded.
* Fix determining if other gateways are enabled besides WCPay ones
Since UPE, WCPay registers multiple payment gateways, all prefixed with woocommerce_payments.
* Fix WooCommercePayments task kick-in logic
The WooCommercePayments task should supersede the general Payments task
when the general Payments task is not completed already and the store is in a
WooPayments supported country. We should not factor in if WooPayments is
just installed but not connected.
* Add changelog
* test: Fix Playwright tests for payment tasks
* test: Fix Playwright tests linting
* test: Further fixes to the Playwright payment setup task
Introduce a method to help ensure values that have been filtered are still of the expected type.
Fixes#47601
* Reduce potential for plugin conflict-driven fatal errors during (REST API) refund creation.
* Parcel up return-type-assurance logic into its own reusable helper.
* Generalize the type checking helper.
* Do not replace existing WP_Errors.
* Do not translate logging messages, per current best practices.
Ref: d2bde1368a/docs/extension-development/logging.md (best-practices)
* Add test describing the behaviour of `Types::ensure_instance_of()`.
Note that the exception error code originally specified in the Types class was also removed: if we want this, it needs to be an integer rather than a string. However, we don't have a methodology or centralized registry for handling numeric error codes at present.
* Use ternary shorthand, not null coalescing.
* Add `@since` tag for hook `woocommerce_rest_pre_insert_<POST_TYPE>_object`.
Selected 4.5.0, as this is the point at which the (until then separate) REST API package was merged into WooCommerce Core.
* Avoid short ternaries.
* Strict types.