* Store transactional meta in HPOS tables.
* Add transaction to the list of legacy meta, since we have getters for it, but its not stored in custom table.
* Add unit test.
* Unit test fixups + mark payment tokens as non internal for datastore.
* Use correct filename for HPOS.
* Mark payment_tokens as internal and update getter/setters accordingly.
* Fix indentation.
* Address PR review feedback.
* Revert behaviour of code that was using nullish coalescing operator.
* Add changefile(s) from automation for the following project(s): woocommerce
---------
Co-authored-by: github-actions <github-actions@github.com>
* Auto create variations and move product to variable when adding variation options
* Delete unused components
* Add tour to variation options
* Remove unneeded options
* Add changelog
* Fix types
* Fix lint errors
* Fix broken tests
* FIlter out option tags when not included in attributes
* Don't invalidate variations data when no new variations are created
* WC_REST_Telemetry_Controller: add `first_used` and `installation_date` meta fields for WCTracker.
* Add `installation_date` parameter to the endpoint parameter collection.
* Update implementation with unit tests.
* Update comments in the test class.
* Auto fixes from phpcbf.
* Attempt fixing lint errors in the tests.
* Set the installation date with the same date format as the pre-existing `last_used`.
* Add changelog.
* Fix an issue where the lack of installation date in the request still sets the field to the current date.
* Attempt fixing lint errors with phpcbf.
* Initial BlockTemplate implementation
* Initial BlockTemplate tests
* FIx undefined array key errors
* Fix linter errors (except for missing docs ones)
* Get as simple array
* Unit test updates for get_as_simple_array()
* Remove inner content (not used currently)
* Rename attrs to attributes
* Move name out of data array
* Move id out of data array
* Move order out of data array
* Move attributes out of data array; remove data array
* Add doc comments to Block
* Add doc comments to BlockTemplate
* Add doc comments to BlockContainerInterface and BlockContainerTrait
* Doc comment updates.
* Add doc comments to BlockTest
* Add doc comments to BlockTemplateTest
* Add BlockInterface
* Remove key consts from Block
* Move implementations to internal
* Clean up interfaces
* Do not have BlockInterface extend BlockContainerInterface
* FIx case in namespace declaration
* Add exceptions to add_block doc
* Rename BlockTemplate to BlockBasedTemplate
* Rename block-based template vars in tests
* Fix missing get_parent on block containers
* Changelog
* Add get_block_by_id to BlockBasedTemplateInterface
* Rename get_block_by_id to get_block
* Rename get_as_simple_array to get_as_formatted_template
* Rename child blocks to inner blocks
* Rename BlockBasedTemplate to BlockTemplate
* Move validation to separate method
* Move namespace to be non-product editor specific
* Rename get_as_formatted_ methods to get_formatted_
* Rename BlockBasedTemplateTest to BlockTemplateTest
* Add ability to use a custom block generator with add_block
* Add check that block belongs to root template in internal_add_block_to_template
* Fix up code docs related to $block_creator
* Fix code doc linting errors in tests
* Add test for a buggy block creator implementation
* Add test for an invalid block creator
* Rename internal_add_block_to_template to cache_block
* Add add_block_container() method
* Fix linting issue.
* Fix minor issues in ContainerInterface with get_root_template() and get_parent()
* Add block template with abstract blocks and templates (#39630)
* Make block template abstract and protected add block methods
* Create block abstraction and generic block
* Remove add_block from container interface
* Update tests for generic and custom blocks
* Add tests around custom block templates
* Fix up lint errors
* Fix errant comment for add_block
---------
Co-authored-by: Joshua T Flowers <joshuatf@gmail.com>
* Tour: reconfigure to work with new layout
- Started Reconfiguring the existing tour to work with the new layout and components.
- Updated step content based on design
- Implemented PR feedback
- Removed task list for MVP
# Conflicts:
# plugins/woocommerce-admin/client/marketplace/components/tabs/tabs.tsx
* Create and register product-variation-items-field block
* Create variations-table component
* Use variations-table component in variation-items block
* Remove last border bottom from the variation options list
* Add changelog file
* Add changelog file
* Autoload test helpers and exclude from test suites.
This avoids loading order problems, and eliminates warnings (about HposTestCase) not containing any tests.
* Add changefile(s) from automation for the following project(s): woocommerce
---------
Co-authored-by: github-actions <github-actions@github.com>
* Compare props to set changed array between post and order data.
* Use correct classname so that props can be set.
* Also clear cache after update and before backfill.
User Menu: Create component and add to header
- Create initial component design
- We may need to return to implement the helper connection URLs once those are in place.
- Some PHPCS errors still exist - this is to be expected for now.
# Conflicts:
# plugins/woocommerce-admin/client/marketplace/stylesheets/_variables.scss
Co-authored-by: And Finally <andfinally@users.noreply.github.com>
Co-authored-by: raicem <unalancem@gmail.com>
- Changed classNames in `Search` component.
- Moved styles from `header.scss` to `search.scss`.
- Deleted `HeaderSearch` and `HeaderSearchButton` components, no longer needed.
- Removed wrapper element around search form.
- Corrected marketplace API address in `Search` component.
- Using state to remember search term, instead of getting value of search input.
- Added condition to clear search input if Escape is pressed while it's focused.
- Not running search if search term is falsy.
- Changed label of "Extensions" tab to "Browse" – we'll do this for the moment, as we have repetition with the page title `Extensions`.
- Reset layout to allow full width
- Added Footer & IconWithText components
Add temporary placeholder components
All components here are temporary and can be removed/replaced when their relevant PR is ready.
Add marketplace footer component
The component is added using a SlotFill to use the existing WC Admin footer and utilise full width correctly.
Setup initial content area layout
Update tab styles
Setup styling to match latest design
Finalise footer, wide layout, and tidy styles
- Applies the wide layout from latest MVP design
- Applies the correct footer links to titles
- Some general style tidying
Organise styles and setup variables
Swap to using CSS Grid for layouts
Update breakpoints
Restructure style naming and update to core styles
Add translation in some places
In-app marketplace search component. Cleaned up the commit history of this branch. Copied changes from these commits:
e9828422706176817e511778980005222aa36cc5
9ca2ae351c97fcd27ecd77a1464c2a9ca16de040
e47815705f3854bf50ff48d7975b7cf2f541614b
976811c458e67ae7fa107c8bf8554fdc3e809d85
46eafdf49fe39c12dee77d6ce0885bdeda527dea
Deleted unused import.
* Do not run code in tracks debug unless WC_ABSPTAH is defined.
* Add changefile(s) from automation for the following project(s): woocommerce-beta-tester
* Also avoid registering scripts if Woo is not installed.
---------
Co-authored-by: github-actions <github-actions@github.com>
* Add sync and usage flags to legacy features.
* Use transient instead of constant.
* Add unit test and changelog.
* Add more robustness to unit test by adding more setting values.
* PHPCS fixes
---------
Co-authored-by: Jorge Torres <jorge.torres@automattic.com>
* Update woocommerce.php for WP 6.3
* Update readme.txt for WP 6.3
* Add changefile(s) from automation for the following project(s): woocommerce
---------
Co-authored-by: github-actions <github-actions@github.com>
* Revert "Update product experiment name (#39210)"
This reverts commit c547326135.
* Add changefile(s) from automation for the following project(s): woocommerce
---------
Co-authored-by: github-actions <github-actions@github.com>
* Modify dom structure, add a specific class and alter the querySelector
* Select all bubbles instead of only the first one
* Add changelog
* Cleanup
* Cleanup
* Reset checkbox position
* Center align chekbox, logo, and the title
* Add changelog
* Remove use of classnames -- no longer needed
* Fix CSS lint issues
* Update task list to show a spinner on item click
There is an issue of a noticeable delay when clicking on product task list items, which leaves users waiting without any indication of the loading status.
To enhance the user experience, add a loading spinner that provides visual feedback during the transition to the next page.
Co-authored-by: yashita.mittal <yashita.mittal@a8c.com>
* Add support for variable products
* Add 'hello world' block to variations tab
* Add product-section block to template
* Add AttributeControl component to screen
* Add changelog
* Change labels
* Make a copy of AttributeControl to VariationOptionsControl to allow the fields to evolve separately in future
* Fix tests
* Add changelog to woocommerce
* Fix alert error
* Remove copied control and start adapting attribute control to handle both scenarios
* Add -field to block name
* Revert "Add -field to block name"
This reverts commit 50e1ee66e27ffb2df22ea7f6a4f78d1577a273f5.
* Revert "Revert "Add -field to block name""
This reverts commit eee0441c6532f9fa8cf8383d9699fd503dd054ae.
* Extract more labels
* Hide drag handle in variation options
* Add post password to API
* Add changelog
* Fix phpcs issue
* Remove post_password from tests
* Add additional property to test
* Increment number of properties in product schema
* Update the post when post_password changes
* Start adding password block
* Add css and import it
* Refactor attributes and erase password when checkbox is unchecked
* Add changelogs
* Remove unused imports
* Rename 'fields' to 'field'
* Refactor CSS
* Remove example object
The for your state element generates confusion for merchants and HEs alike because of the homonym state. There is regularly an assumption that this is referring to a geographical state (e.g., the state of California) instead of a system state.
Removing the for your state string from this message retains the original message but eliminates confusion that may be brought on by using the word state.
* Add post password to API
* Add changelog
* Fix phpcs issue
* Remove post_password from tests
* Add additional property to test
* Increment number of properties in product schema
* Update the post when post_password changes
In #38849 a change was made that allowed the class mocking necessary
for this test to happen in a way that wouldn't interfere with other
unit tests.
Fixes#38720
* Support inserting NULL values for strict DB mode
* Set default date for placeholder order to support strict MySQL.
* Add unit test to verify strict mode also works.
* Make HPOS behavior of modified date consistent with WP_Post.
In HPOS we were leaving modified date to be empty, while WP_Post set it to the created date if modified date is null.
* Fix grammar in data-sharing agreement copy
* Add changelog
* Put ,
* Add brackets
* Move learn more link inside the bracket
* Update test snapshot
* Fix grammar
* Update test snapshot
* WIP extend support for frontmatter in manifests.
* Change some of the prop names in the frontmatter support, add tests.
* WIP support new frontmatter in plugin.
* Improve category processing.
* restructure the docs to have a nested category with no index.
* Add WP test stubs to dev.
* Add tests for the ManifestProcessor.
* Add param docs to function
* Store post meta on posts when they are updated or created. Add supporting tests.
* WIP supporting more core block types.
* Fix bugs in conversion.
* Adjust conversion for issues with tables, blockquotes, code.
* Resolve pnpm lock conflicts
* Return manifest to state in trunk.
* Return pnpm lock to trunk state.
* Update fixture for new md content.
* Add a grace period during which email verification is not required (order pay/conf page).
When the order confirmation (or payment) page is requested, we often want to ensure the visitor is associated with the order. However, this relies heavily on information stored in the user session and, depending on the payment gateway in use, this may not be dependable. Therefore, we've introduced a grace period during which no such verification will take place.
* Provide a mechanism for establishing server-side filters from our E2E tests.
* Make our utilities for setting up filters from E2E available in the test env.
* Update guest shopper workflow to account for order conf/payment access grace period.
* Tidy verbiage.
* Add changefile(s) from automation for the following project(s): woocommerce
* Only activate the Filter Setter (e2e utility) during e2e tests.
* Coding standard fixes for E2E utility plugin.
* e2e: Update locators for headings to use getByRole, add await to clearFilters
* e2e: Abstract the cookie domain to work on non-localhost test sites
---------
Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Corey McKrill <916023+coreymckrill@users.noreply.github.com>
* Add Organization to the right of General tab
* Add Product catalog and Attributes sections to the Organization tab
* Add Categories and Disable product reviews blocks to Product catalog section
* Add attributes block to the attributes section
* Add changelog files
* Fix php linter error
* Remove Categories and Attributes blocks from the General tab
* Change Disable product reviews by Enable product reviews
Fixes the calculation from when Apply minimum order rule before coupon discount is active and prices are entered inclusive of tax and displayed that way in cart and checkout, free shipping is no longer available (based on the minimum order amount including tax), as it uses the pre-tax amount when a coupon is applied.
Fixes#28752
* Use option to track new WC installs
* Correct hook used for disabling legacy coupon menu
* Add changelog
* Fix deprecated hook version number
* Update unit tests
* Use AccessiblePrivateMethods to register action
* Update comments
---------
Co-authored-by: Martyn Jones <martyn.jones@automattic.com>
* Allow registered React-powered page to specify 'parent path', so the right menu item can be highlighted.
* Fix linting issue.
* Changelog.
* Add changefile(s) from automation for the following project(s): woocommerce
* Changelog.
* Add changefile(s) from automation for the following project(s): woocommerce
* Changelog.
* Update plugins/woocommerce/changelog/add-override-menu-item-highlight
Co-authored-by: Eric Jinks <3147296+Jinksi@users.noreply.github.com>
---------
Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Eric Jinks <3147296+Jinksi@users.noreply.github.com>
Earlier, we were marking this based on whether HPOS is enabled or not, but now that HPOS is enabled (but not authoritative) for everyone, we need a seperate option to track this.
* Change WooCommerce Payments to WooPayments across the WC Core
* Change WooCommerce Payments to WooPayments across the WC Core
* Add more changelogs
* Add changelog for data package
* Change banner image and task description
* Fix lint error
* Change one more banner image
* Fix to the banner image
* Roll back changelog.txt and fix one condition for backwards compatibility
* Fix in changelog.txt
* Small fix in changelog.txt
* Save order object before persisting data.
Earlier we were backfilling order before updating them in the orders table. This would cause an issue where if there is any method that reads the DB again before backfilling it would read the stale record. Additionally, there is risk of data not being written to order table, but still backfilled.
Changing the order to backfill later fix this issue since if something reads the DB again during backfill, it will still read the latest record.
* Add changelog.
* Add unit tests.
* Coding standard fixes.
* Load subscription notes only via WC Admin home page and extensions page to avoid calling helper API endpoints unnecessarily.
* Adding change log.
* Moving connection check after the early return statements.
* Use admin_head hook instead of admin_init to load subscriptions notes.
Since `get_current_screen` function can not be called within `admin-init` hook it is not possible to determine if the subscriptions are being loaded via WC related page or not.
* Update doc block.
* Move placeholder of summary to help text at bottom of the component
* Focus the name field when mounting
* Add changelog
* Create 'autoFocus' block attribute instead of using useEffect
* Add changelog
* Validate shipping rates are suitable for all the products in cart
* add changelog
* added phpcs ignore rule
* Refactor shipping rates validation specifically for flat rate
* performant check after CR comments
* account for free shipping
* Added Unit Tests
* fix unit test assertion
* Adding more unit tests and fixing previous one
* Fixing errors because of added test after effects
* move tests location and improve readability
* fix phpcs errors
---------
Co-authored-by: Dimitrios Pantazis <dpanta94@gmail.com>
* Switching front-end description logic to use new endpoint
* Logging troubles
* Tentively working for title suggestions
* Adding changelog
* Updating to accept altered response body for title suggestions
* Using client-size streaming instead of our own proxy API
* Removing obsolete API code
* implementing feedback
* Refactoring product data logic
* Fixing getAttributes function to work with local attributes
* Allowing for boolean values in product data
* Refactoring getCategories to always return array
* Removing orphaned type
* Refactoring getCategories again
* Refactor productData methods to get attributes and categories
* Include product properties in the prompt for generating description
* Add changelog
* Include local attributes in addition to global attr
* Show error if parsing suggestions fail
---------
Co-authored-by: Joel <dygerati@gmail.com>
* Change the modal's description test in the first step of the product block editor tour
* Change the modal's description text in the first step of the product block editor guide
* Change the modal's description text in the second step of the product block editor guide
* Change the modal's title and description text in the third step of the product block editor guide
* Change the modal's description text in the four step of the product block editor guide
* Enhance the Options menu of the product block editor
* Add slide up animation and translucent background to the feedback bottom bar
* Change de CES's modal heading text in the product block editor
* Change the notice message after the feedback is being sent from the CES Modals
* Enhance leave feedback modal checkbox labels
* Change leave feedback modal submit button text
* Show success notice after submit the leave feedback modal
* Add changelog files
* Change the illustration in the first step of the feature tour
* Change the modal's title and description text in the first step of the product block editor tour for old users
* Change the modal's title and description text in the first step of the product block editor guide for old users
* Change the modal's title and description text in the third step of the product block editor guide for old users
* Fix unit tests
* Change the customer effort score changelog description
* Change footer forward button to primary and backward button to tertiary in the tour guide modal
The meta values for deletion records will now be 'posts_table'
and 'orders_table', instead of the hardcoded table names. This is safer
because the database prefix could change (in case of a site migration,
for example).
* Create and register woocommerce/product-variations-fields block
* Hide or show the empty state or inner blocks if the product has attributes
* Add changelog files
* Fix php linter errors
* Bootstrap server side block definitions
* Add changelog file
* Revert action priority to its prev value
* Check if unstable__bootstrapServerSideBlockDefinitions function exists before call it
* Fix error while dismissing the last alert when there's multiple
* Copy action id to localized action
* Add changefile(s) from automation for the following project(s): woocommerce
* Fix lint issue
* Improve implementation and add test
---------
Co-authored-by: github-actions <github-actions@github.com>
* Perform feature flag change and redirection in the same request
* Add changelog file
* Remove feature related query args after enabling/disabling it
* Use REQUEST_URI instead of referred one
* Fix lint errors
* Move phpcs to new line
* Use isset instead of empty
---------
Co-authored-by: Nathan Schneider <nsschneider1@gmail.com>
Co-authored-by: Lourens Schep <lourensschep@gmail.com>
* Send $product_name through woocommerce_cart_item_name filter only once. Closes#38744.
* Replace additional product name filters, with already filtered variable.
* add additional params to docblock of woocommerce_cart_item_name
* bump template version to 7.9.0
* revert cart_item_name filter change in #37830
* Minor fixes
* Bump template version
---------
Co-authored-by: Ron Rennick <ronald.rennick@automattic.com>
Co-authored-by: Jorge A. Torres <jorge.torres@automattic.com>
* Remove letter-spacing and use 500 for font-weight
* Add changelog
* Style updates for the header
* Set letter-spacing to normal
* Use 500 for font-weight
* Remove max-width
* Add changelog
Adds `filter_empty` parameter, so that customer records with specific empty fields can be left out of the results, resulting in more efficient requests.
Fixes#38820
Even if errors are found when populating the order properties, the order object will be returned anyway. Additionally, these errors will be logged as warnings, both when using the new HPOS-based orders datastore and when using the old CPT based datastore.
* Use NumberUtil::round() instead of number_format() in WC_Order::get_item_subtotal()
* Add changelog
---------
Co-authored-by: Jorge A. Torres <jorge@0xbad.com>
* Add product id to product data
* Create a React Hook for updating product slug
* Update product slug when title is updated.
* Add changelog
* Import hooks from index
* Use getPostId util to get product ID
* Only update draft product's slug
* Revert "Always show pricing group fields, disable if not available for a product type (#38531)"
This reverts commit 18f2de2bc4.
* Add changelog and fix lint issues
* Remove call to removed function
* Add new countries in isWCPaySupported
* Add new countries in get_wcpay_countries
* Add new countries in default free extension 'woocommerce-payments'
* changelog
* fox linting issue
* Remove support for Czech Republic, Sweden, Hungary
* Revert "Remove support for Czech Republic, Sweden, Hungary"
This reverts commit 0a8309f664.
* When ExtendedContainer::replace is used and an instance of an object is passed as the replacement, the init method of the passed object will be executed (previously the container would execute init only when creating a new instance from a class name).
* Added the ExtendedContainer::reset_replacement method, this will undo a replace and reset the registration back to its original state (so get will act as if replace had never been executed for the given class name). Note that for shared definitions this needs to be combined with reset_all_resolved.
* Similarly, added the ExtendedContainer::reset_all_replacements method.
* Add possibility to track select and checkbox values for non_option settings
* Track select and checkboxes in abstract-wc-settings-api
* Add changelog
* Add hook comment and ignore phpcs for actions that were already called before
With orders table authoritative, sync disabled, an order with refunds
is deleted, a duplicate deletion record was being created for the refund.
That's because 'upshift_or_delete_child_orders' was deleting the child
orders, which caused a deletion record to be already created; and
after that, 'handle_order_deletion_with_sync_disabled' was again
creating a record for these child orders.
The fix is a bit convoluted because we can't know for sure if
'upshift_or_delete_child_orders' will delete the child orders or not.
* Fix overlapping button position when the height is less than 667px (iphone SE)
* Fix misaligned check icon on mobile
* Prevent the menu from closing when clicking on a selected item
* Add changelog
* Fix lint
---------
Co-authored-by: moon <moon.kyong@automattic.com>
* Remove feature related query args after enabling/disabling it
* Test to see if E2E tests pass
* Revert "Test to see if E2E tests pass"
This reverts commit 120e971f33f22dc3e7eec6e5ab228b1908c56364.
* Add support to remove multiple query params
* Add wc_get_default_product_type_options function
* Use wc_get_default_product_type_options() as initial input for product_type_options filter
* Changelog
* Only record product update on already published products
* Add source into published product tracks event
* Add missing tracks options to product update event
* Track tab clicks in the editor
* Add source to tab clicks
* Record tracks on preview click
* Add events for media gallery, description, and attributes
* Add tracks events to more menu
* Replace new_product_page with source
* Add changelog entry
* Fix lint errors
* Add tracks for About the Editor menu item
* Add onClick event to AboutTheEditor menu item
* Use dropdown option event for classic editor menu click
- When ExtendedContainer::replace is used passing an instance of
an object, the 'init' method will be executed in the instance
when resolving the replaced class name.
- Added the ExtendedContainer::reset_replacement method, this will
undo a 'replace' and reset the registration back to its original state.
- Similarly, added the ExtendedContainer::reset_all_replacements method.
This makes the behavior of wc_get_order to be the same as when HPOS
is disabled (and Abstract_WC_Order_Data_Store_CPT is thus used
instead): the order is still retrieved (although without the errored
properties set) instead of the function just returning false.
An example of when this can happen is if an order refund has the id
of a no longer existing order as the parent id.
* get_index_columns using SHOW INDEX FROM query instead of information_schema
* returning empty array for clarity
* ignore interpolated query
* adding changelog entry
* Adding unit tests for the updated DatabaseUtil::get_index_columns()
---------
Co-authored-by: Michael Pretty <prettyboymp@Michaels-MacBook-Pro.local>
* Disable 'Used for variations' checkbox when product type is not variable and remove leftover code
* Run disable or enable fields after saving attributes
* Update orders status query to ensure it exclude trash.
* Add incentive ID to every track event
on the welcome incentive page.
* Remove unnecessary SCSS after #38775 fix
* Add changelog entry
* Replace tos_url with tc_url for accurate naming
* Fix phpcs errors
---------
Co-authored-by: Vlad Olaru <vlad@pixelgrade.com>
* Enable core-profiler in prod
* Add Changelog
* Skip StoreDetails tests -- we're replacing it with Core Profiler
* Add features.is_enablefd to detect features
* Skip the onboarding wizard tests when the core profiler is enabled
* Skip skipping the onboarding wizard when the core profielr is enabled
* Incldue features module
* Skip core profiler for testing
* Skip core profiler for testing
* Remove test code
* Skip teh plugin page when all the plugins are activated
* Fix the if statement so that stageIndex becomes 2 when progress is over 60
* Add a 2nd loader stage for the skipped guided setup
* Add changelog
* Lint fix -- css
* fix: banished core profiler page spinners
* addressed pr comments
* update jest snapshot
---------
Co-authored-by: rjchow <me@rjchow.com>
* Use theme color for the option hover
* Add Changelog
* Remvoe absolute position -- can't predict correct value for bottom
* Fix css lint error
* Fix button width
* Use gray-0 for dropdown item hover color
* Fix border style for Give your store a name field
* Fix hover color for the platform options
* Remove light color on hover
---------
Co-authored-by: Ilyas Foo <foo.ilyas@gmail.com>
* Fix font heading font style and adjust main component max width to match design
* Remove redundant #FunWooFact
* Reset button font color to follow admin theme
* Fix Installed label vertical alignment
* Changelog
* Remove permanent borders from consent checkbox, lint fix
* Remove box shadow on checkboxes in plugins page
* Standardize checkbox styling across core profiler
* Fix heading font styling
* Lint
* More lint
* Update snapshot
Squashed commit of the following:
commit 8ccd8e26127594e859b37ead9fd150f05d36d9f5
Author: barryhughes <3594411+barryhughes@users.noreply.github.com>
Date: Mon Jun 5 19:37:57 2023 -0700
Do not output payment gateway nonce to unqualified users.
commit 882946bb18dee5eb7ffea48ddfbd4c14a5092c94
Author: barryhughes <3594411+barryhughes@users.noreply.github.com>
Date: Wed Jun 7 14:24:58 2023 -0700
Instead of looking for `?wc-ajax`, specifically exempt `admin-ajax.php`.
This mimics the existing approach used for `admin-post.php` requests, and is stricter by default.
commit 99cffd7cde1aa87176254845c732c91a446232f7
Author: barryhughes <3594411+barryhughes@users.noreply.github.com>
Date: Tue Jun 6 12:40:21 2023 -0700
Nonce verification not needed when evaluating ajax properties.
commit 99157d2a18ea78c68c265609dfdd1bddadeee7b2
Author: barryhughes <3594411+barryhughes@users.noreply.github.com>
Date: Tue Jun 6 12:38:53 2023 -0700
Document `woocommerce_disable_admin_bar` hook.
commit badcf8f50099dd38fa855d2aa71c8507d3f2a252
Author: barryhughes <3594411+barryhughes@users.noreply.github.com>
Date: Mon Jun 5 18:49:25 2023 -0700
Describe expectations around customer access to the dashboard.
commit 127053e1c27e7da5515c6638859fa09384241624
Author: barryhughes <3594411+barryhughes@users.noreply.github.com>
Date: Mon Jun 5 13:30:03 2023 -0700
'wc-ajax' requests should be filtered out of admin access logic.
commit 2e8182761e050cc4371181eaa197b6d4b2867f89
Author: Vedanshu Jain <vedanshu.jain.2012@gmail.com>
Date: Fri May 12 15:15:57 2023 +0530
Clean up individual escape to also do it again when it is used.
* Initial refactor of components
Move out from index every UI component to make it easier to maintain.
* Initial implementation of new design
Some minor adjustments are missing, and I've added a few TODOs to complete later.
* Add changelog entry
* Finish design update
* Compress menu icon
* Add user's first name to heading copy
* Fetch and cache eligible incentive from WCPay API
Sharing its properties under `window.WcSettings.admin`
* Filter `allowed_promo_notes`
To be able to add those form WCPay API request
* Update JS side to use the new shared incentive details
* Ensure we cache requests even if there are no eligible incentives
* Fix a typo in WCPayBanner
* Move incentive preloaded data from wcSettings
to a new window variable which will be only loaded on WCPay welcome page.
* Simplify `has_wcpay` check
* Render sanitized HTML from incentive description
* Update get incentive logic to also cache non success responses
* Add incentive ID to page view track
* Add changelog entry for the onboarding package
* Update used options names
and add them to `get_default_option_permissions
* Differentiate every dismissed incentive
Reuse WCPay welcome page logic for notes display conditions
* Use tos_url instead of tos_link to match response
* Fix incentives endpoint request payload
* Back to preload incentive on admin shared settings
* Move promo notes filter to where it's used
to avoid any possible race conditions.
* Replace every occurrence of `WooCommerce Payments` with `WooPayments`
* Prevent modal large padding-bottom
* Prevent another global style override on modal
* Fix TS error coming from trunk merge
* Fix wrong style property
* Further restrict WCPay incentives to plugin not active and countries supported
* Adjust the meaning of has_wcpay
* Wait for dismiss option update before redirect
to prevent the side menu entry to be visible after redirecting back to WC admin.
* Enforce TOS asterix at the end of incentive description
* Remove underscore from priavate instance var.
* Fix ESLint error
* Fix SCSS linting issues
* Refine `has_wcpay` and `has_orders`
* Enforce consistent WooPayments branding
* Enforce stricter i18n calls with escape
* Update page title to match new branding
* docs: Enforce branding in code docs also
* Remove method that is unreliable to be used outside of onboarding
* Remove unused constant
* Missing new line
Co-authored-by: Ilyas Foo <foo.ilyas@gmail.com>
---------
Co-authored-by: Vlad Olaru <vlad@pixelgrade.com>
Co-authored-by: Ilyas Foo <foo.ilyas@gmail.com>
* Return full response from getJetpackAuth
* Add success and errors
* Redirect to Home in case of an error from getJetpackAuth endpoint
* Add changelog
* Use redirectToJetpackAuthPage
* Replace window.location.href with navigateTo
* Fix type issue with getJetpackAuthUrl
* Update plugins/woocommerce-admin/client/core-profiler/index.tsx
Co-authored-by: Chi-Hsuan Huang <chihsuan.tw@gmail.com>
---------
Co-authored-by: Chi-Hsuan Huang <chihsuan.tw@gmail.com>
* Add install-and-activate-plugins-async action to onboarding
* Add label and learn_more_link types
* Use label and learn_more_link
* Remove unused imports
* ts fixes
* Visual changes on the plugin page
* Change CTA font size from 13px to 14px
* Change spacing between the chebox and logo to 24px
* Change heading font-weight to 500
* Fix css lint error
* Add back learn more link that was removed from rebase
* Add required packages
* Load Jetpack Config
* Add getJetpackAuthUrl to data/onboarding
* Add Connection Rest Auth -- seems like this is required for Jetpack to communicate back to the connected site
* Add jetpack-authorization-url REST API
* Redirect to Jetpack Auth page after the installatino process if jetpack was selected
* Require can_install_plugins permission for jetpack auth url endpoint
* Update packages/js/data/src/onboarding/resolvers.ts
Co-authored-by: Ilyas Foo <foo.ilyas@gmail.com>
* Update plugins/woocommerce/src/Admin/API/OnboardingPlugins.php
Co-authored-by: Ilyas Foo <foo.ilyas@gmail.com>
* Remove automattic/jetpack-sync and its config
* Support redirect_url and from params
* Do not redirect to Jetpack auth if it is already connected
* Add installed_ext_success=1
* Use woocommerce-core-profiler for from value
* Revert unrelated lock file changes
* Minor refactor
* Extracted out isJetpackConnected cond to a guard
* Added meta data for isJetpackConnected to prevent unwanted spinner
* Add Changelog
* Lint fix
* Move Jetpack Connection config init to class-woocommerce
* Add changelog
* Remove unnecessary require
* Note jetpack-authorization-url endpoint is experimental
* Fix broken test
* Add component to sendToJetPackAuthPage state
* Fix lint error
---------
Co-authored-by: rjchow <me@rjchow.com>
Co-authored-by: Ilyas Foo <foo.ilyas@gmail.com>
Actions starting with “mark_” were silently handled by our own code, preventing 3rd parties from adding their own “mark_” bulk actions and acting on them.
* Configure the expiriment to redirect variation treatment to the new product editor
* Add changelog file
* Fix experiment name
* Fix changelog description
* Options menu in product editor view should show Turn off the new product editor with some subtext
* Record event product_editor_options_turn_off_editor_click when clicking Turn off the new product form menu item
* Add changelog file
* Add 'About the Editor' menu item
* Show the guide when clicking the menu item
* Add track event when clicking about the editor
* Add changelog
* Remove from product more menu
Adds the following pnpm commands for utilizing the new phpcs-changed
composer scripts (see #37465 and #38085):
- `pnpm --filter=woocommerce run lint:php:changes`
- `pnpm --filter=woocommerce run lint:php:changes:staged`
- `pnpm --filter=woocommerce run lint:php:changes:branch`
Also updates the contributing guidelines to make these commands more
discoverable.
* Use WooFooterItem for Footer
* Use WooFooterItem fill for TransientNotices
* Adjust TransientNotices styling to work in footer
* Fix footer width when in setup wizard
* Change export of TransientNotices from default to named
* Add border to footer
* Changelog
* Changelog
* Mock WooFooterItem to allow unit tests to pass
* Fix lint error in test
* Adds a data key with the list of WC features that are currently enabled on the site.
* Adds a feature_compat key to each plugin that shows its compatibility with each feature (compatible, incompatible, or uncertain) if the plugin is "WooCommerce aware", otherwise just an empty array.
This PR fixes two unit test files that could not be run individually by adding HPOSToggleTrait.php to the unit test boot loader. It also does a bit of namespace cleanup in HPOSToggleTrait.php.
The mocks in this test were affecting other unit tests for the
PluginUtil class, but only when run in GitHub actions (the tests were
working fine locally). Rather than hold up this PR, I've created
issue #38720 as a future task to add the unit test back in once we've
figured out if there's something buggy happening with dependency
injection.
* Add support for new properties "added" and "deleted" in settings tracking
* Add calls to actions when adding and deleting shipping zones and classes
* Add changelog
* Cover an edge case where the zone is created through adding a method and add more comments
* Fix lint issues
* Add inline comment explaining if statement
Refactor WC_Settings_Tracking to work with a single action with an additional parameter
We were checking whether an order is modified before migrating them. While on surface this looks good, the logic itself has following flaws:
1. We were only checking the columns in the core posts table, but none of the meta fields.
2. Our comparison logic was written in SQL, but given that we have a much better comparison logic already written in PHP, it does not makes sense to maintain two different versions.
3. We are alrady checking for modified records in the batch processor itself, so another check this close to migration logic is not really needed.
* Change Skip this setup to Skip this step
* Visual changes on intro, user profile, and skip guided page
* Always check tracking agreement
* Change border to 2px
* Change Give yoru store a name font-size to 13
* Add Changelog
* Update test to reflect the text change
* Remove !important
* Update test snapshot
* Update test snapshot
* Remove test that is no longer necessary
* Add install-and-activate-plugins-async action to onboarding
* Add label and learn_more_link types
* Use label and learn_more_link
* Fix type
* Add changelog
* Add changelog
* Add install_priority -- this will be used in the core profiler
* Sort selected plugins by install_priority for installation
* Remove unused imports
* dev: refactor installAndActivatePlugins to xstate
* ts fixes
* Sort plugins by install_priority
* Make sure WooCommerce Shipping is always visible
* Update free extension list content
* Updated WC payment description
* Updated logo images
* Visual changes on the plugin page
* Change CTA font size from 13px to 14px
* Change spacing between the chebox and logo to 24px
* Change heading font-weight to 500
* Fix css lint error
* Fix gray-900 variable name
* Hide learn more link on mobile view
* Add back learn more link that was removed from rebase
* Send pluginsAvailable to pluginInstallermachine
* Use is_activated to determine plugin availability and install status
* Update packages/js/data/src/onboarding/types.ts
Co-authored-by: Ilyas Foo <foo.ilyas@gmail.com>
* Update plugins/woocommerce/src/Internal/Admin/RemoteFreeExtensions/DefaultFreeExtensions.php
Co-authored-by: Ilyas Foo <foo.ilyas@gmail.com>
* Add back recordTracksPluginsLearnMoreLinkClicked
* Use install-and-activate-plugins-async when timer is up
* Record plugin and link with learn more linked clicked event
* Fix failign tests
* Add comment for install_priority
---------
Co-authored-by: rjchow <me@rjchow.com>
Co-authored-by: Ilyas Foo <foo.ilyas@gmail.com>
* Ensure order ordering in order filter unit test
* remove unused variable, fix spacing
---------
Co-authored-by: Ron Rennick <ronald.rennick@automattic.com>
* Copy Guide component from @wordpress/components and fix focus issue
* Add 'tell me more' button and behavior
* Move Guide component from components package to admin package
Implement assigning an href to the finish button, sending the current page and origin as a parameter on the onFinish callback
* Remove dependency
* Restore pnpm-lock.yaml
* Add changelog
* Add comment in Guide component
* Dismiss modal only when it's finished or X button is clicked
* Add 'rel' when opening link in a new tab
* Always show General product tab
* Add info messages for variable and grouped products
* Add logic to disable/enable fields and labels based on product type
* Tweak CSS and fix links
* Add tracks events for links
* Add filters to pricing disabled message
* Tweak logic to only enable fields on certain product types instead of disabling in the opposite ones
Add fallback message when pricing is disabled but it's not Variable or Grouped product
* Add docblocks
* Fix more lint issues
* Fix last lint issues
* Update selector in e2e test
* Refactor PHP echo
* Attach to #woocommerce-product-data instead of attaching to body
* Adds a data key with the list of WC features that are currently
enabled on the site.
* Adds a `feature_compat` key to each plugin that shows its
compatibility with each feature (compatibile, incompatible, uncertain)
if the plugin is "woocommerce aware", otherwise just an empty array.
* Changes the feature given it's id and a toggle value as a query param
* Swap classic editor and new product block editor url when product_block_editor feature changes
* Turn off the product_block_editor feature when user choose to use the classic editor
* Add changelog files
* Fix linter errors
* Add nonce to each feature change request
* Change the hooks name for better readability
* Use get_current_screen function to better identify if the current screen is the product creation or edition
* Add wp_die if the nonce verification failed
* Change regex for explode/parse_url for better reading
* dev: refactor installAndActivatePlugins to xstate
* ts fixes
* fixed first plugin install progress bar reset issue
* clean up todo comments
* fixed bug where errors were not reported if past 30s timeout
* fix lint
Co-authored-by: Joel Thiessen <444632+joelclimbsthings@users.noreply.github.com>
Co-authored-by: Nima Karimi <73110514+nima-karimi@users.noreply.github.com>
Co-authored-by: Thomas Shellberg <tommy.shellberg@automattic.com>
In PHP 8.1 the behavior of mb_detect_encoding has changed from
"return the first suitable encoding from the list" to
"return the most probable encoding from the list". The algorithm used
for "most probable" often fails, though, and detects valid UTF-8
strings as if they were ISO-8859-1. The fix is to use mb_check_encoding
instead.
Additionally, if conversion is needed, mb_convert_encoding is now used
since utf8_encode is deprecated.
In PHP 8.1 several functions that accept a string as an argument
(e.g. str_replace) throw a deprecation notice when null is passed.
This commit changes the usages of these functions in
wc-formatting-functions.php so that null inputs are converted
to empty strings.
* dev: refactor core-profiler - modularise each page
- wrapped each page's pre, post, and main states into their top level states for tidiness
- tagged them with id so that we can easily jump to them when doing routing
- generalised component finder code such that it recursively traverses the state meta object until it finds a component key
- fixed css label to use top level state key
* moved initializing into introOptIn so it's not a special case by itself
Makes it possible to do a partial match search for customers across
name, username, and email, instead of having to choose one of those
fields.
Refs #33383
* Add placeholder TourKit in product-page
* Create component and configure it to show to the right of wp menu
* Finish TourKit and start creating features guide
* Implement CSS changes and background color
* Create Wrapper to facilitate showing the tour and guide without relying on the options in the future
* Refactor
Add tracks events
* Add changelog
* Fix lint problems
* Fix CSS
* Refactor styles
* General refactor and extract BlockEditorGuide component
* Add changelog
* Fix lint issues
This introduces 2 filters: `woocommerce_order_table_orders_clauses` and `woocommerce_order_table_orders_request`. They mimic the ones found in `WP_Query::get_posts()`.
They allow to modify the query's clauses, depending on the query args (available in the `OrdersTableQuery` object) for example.
Fixes a bug where on 2-col layouts, text was overlapping the image because the overall container size is less than 500px.
75% is the equivelent of 500px for single-col layout.
* Update the margin-left on the buttons in the top bar from 16px to 8px
* On mobile, the left and right body margins should be 32 px
* The inner padding in the tab in the top bar should be 12px, not 16px
* In the edit product link modal, let's set this modal’s width to 650 px and remove the line separating the header from the contents
* All modals should now have 8 px window radius
* In the feedback form, can we fix the buttons at the bottom
* The help icon in checkboxes small, detached from the item label, and vertically misaligned. Left margin of 4 px, no vertical adjustment; somehow it has a -2px set for the top margin)
* Fix block-editor-block-contextual-toolbar top position
* When the product is in a draft state, the button in the top bar should say Add, not Save. It should change into Update once it's published on the store
* Fix layout margin top
* Add ection support for blockGap and set title and description to optional
* Remove non needed control field margin bottom
* Fix schedule sale block spacing
* Remove non needed control field help text margin bottom
* Remove the sub section outer spacing
* Move pricing fields into a sub section block
* Fix collapsible-contet margin top
* Remove invalid inner block layout spacing
* Wrap sku, stock toogle and quantity within a sub section
* Group inventory advance section inner blocks into a sub section
* Fix linter error
* Add changelog files
* Fix php lint error
* Change unit names to fit GB definitions
see: b2c16f3c68/packages/base-styles/_variables.scss\#L31-L41
* Make option API fail when using a disallowed option name in non-produciton environments and update permission list
* Add changelog
* Change Option API deprecated notice version to WC 6.3
* Change install-async to install-activate-async
* Add changelog
* Add comment for activated function
* Fix tests and rename install-activate-async to install-and-activate-async
* Rename callback function to static
* Filter by date_paid and date_completed on list table orders based on configuration
* Use separate query param 'order_date_type' to filter orders
* Add clarifying comment
* Add missing phpcs ignore
* Refactor to use 'm' and 'order_date_type' query parameters
When WC is provided only the country for the option `woocommerce_default_country` then it will fail to select a default state within the listed states.
Try this by manually setting `woocommerce_default_country` to "US" and you will see it selects the first country in the list instead of the first state within that country.
This only happens for countries that have states like US and CA for instance.
This ensures that the instance of the page controller class that
is used to set up the HPOS order admin screens is accessible and has
all its properties set correctly for use with the new is_order_screen
method.