Commit Graph

5817 Commits

Author SHA1 Message Date
Mehrshad Darzi 027b335028
Fix columm to column 2021-03-30 12:43:41 +04:30
Nestor Soriano e0dad77e49 Fix logic for including the "payments" task in onboarding wizard
The logic should be "if woo payments is installed and the country
is US then remove the payments task" but the check was mistakenly
being set to "or" so the task was removed whenever the country was US.
2021-03-29 11:25:39 +02:00
Timo Boyer 3e5d7418d9 Remove double space before concat operator 2021-03-23 23:29:30 +01:00
Quy f0cc75223d
Remove colon since checkbox is before label 2021-03-23 14:00:50 -07:00
Timo Boyer f31bc26b61 Correctly close <option>-tag in admin products/orders list table 2021-03-23 21:23:46 +01:00
Roy Ho 7fb346c5d1
Merge pull request #29447 from luizbills/patch-1
Add missing sectionend in email settings
2021-03-23 09:48:11 -07:00
jonathansadowski 2e60d47a01
Merge pull request #29181 from woocommerce/fix/27233
Use AJAX for Page Configuration
2021-03-23 11:46:00 -05:00
Luiz "Bills 3e48ca7c35
fix coding standard 2021-03-23 13:25:20 -03:00
Luiz "Bills df4b584a82
delele empty space 2021-03-23 12:06:10 -03:00
Néstor Soriano 886cd15016
Merge pull request #29378 from woocommerce/fix/code-sniff
Remove Travis and fix CI in GitHub Actions
2021-03-23 15:22:49 +01:00
roykho c79fd6b7bf
Add excludes feature to exclude certain pages 2021-03-22 13:36:55 -07:00
roykho e5380ac966
Add new function to handle single page search closes #27233 2021-03-22 13:20:16 -07:00
roykho 96463b7172
Update verbiage based on feedback 2021-03-22 05:42:34 -07:00
Luiz "Bills f4565abccb
Add missing sectionend in email settings 2021-03-20 14:51:27 -03:00
roykho 01f949cc32
Update SSR db version tooltip to accurately describe the versioning closes #29430 2021-03-19 06:27:17 -07:00
Roy Ho e62f20b9b3
Merge pull request #29049 from wppunk/master
Fix #29048
2021-03-17 13:46:19 -07:00
Néstor Soriano 17224d0ab1
Merge pull request #29345 from woocommerce/hw/low-stock-threshold-for-variations
Low stock threshold for variations
2021-03-17 08:59:32 +01:00
Claudio Sanches b0dce9feff Fixed coding standards 2021-03-16 11:42:28 -03:00
Peter Fabian cb6e0d8201 Don't echo the strings, return them for later use. 2021-03-16 13:01:15 +01:00
Peter Fabian a2e9c055d5 Make the inherited values explicit by stating where it comes from. 2021-03-16 12:39:25 +01:00
Peter Fabian f33c80186f Updated the wording of the tooltip. 2021-03-16 08:51:29 +01:00
Peter Fabian bb5c56c148 Set correct placeholder value for variation--first the parent, then the store-wide default. 2021-03-15 18:41:55 +01:00
Peter Fabian 2ae5ec59ba Improve the description of the low stock threshold tooltip. 2021-03-15 12:42:10 +01:00
Claudio Sanches 32baae989d Fixed just one PHPCS error to trigger messages in PR 2021-03-13 21:08:20 -03:00
Peter Fabian 1f8f8580d1 Better wording of the tooltip--being more specific about what the amount relates to. 2021-03-11 16:26:41 +01:00
Peter Fabian f7755f123e Enable bulk updates of variations with low stock amount. 2021-03-10 18:15:31 +01:00
Peter Fabian 685be2a791 Connect the UI to the db to allow updates of the values. 2021-03-10 17:24:52 +01:00
Peter Fabian b92d1d1391 Harmonize the id and name with simple product. 2021-03-10 15:38:49 +01:00
Peter Fabian a6b45d08bf Added low stock threshold input to the Admin UI. 2021-03-10 11:47:22 +01:00
roykho cb0b92750b
Extract recount terms logic into own function closes #25375 2021-03-04 09:06:03 -08:00
Moon 00a272fa85
Merge pull request #29174 from woocommerce/add/28568-dashboard-widget-finish-setup
Add/28568 dashboard widget - setup
2021-03-02 16:46:51 -08:00
Moon d013d7f765 Move init logic to should_display_widget 2021-03-02 16:06:10 -08:00
roykho 503a218e85
Revert "Flush term cache when saving product and settings closes #25375"
This reverts commit 8b0915c4e0.
2021-02-26 12:42:23 -08:00
Roy Ho f6d77c206d
Merge pull request #29228 from woocommerce/fix/28238
Update default GIT branch
2021-02-26 11:59:09 -08:00
Vedanshu Jain 422002a2a8
Merge pull request #29200 from woocommerce/fix/upgrade-notices-major-version
Remove compatibility checks for major version
2021-02-26 14:55:30 +05:30
Claudio Sanches d6e3cf6de9 Update default GIT branch 2021-02-25 20:51:14 -03:00
Peter Fabian 47bfca58b0
Merge pull request #29052 from woocommerce/add/install_wcpay_addon_tracks
Add tracks event for WooCommerce Payments install via wc-addons page
2021-02-25 15:04:36 +01:00
louwie17 893fe6cc24
Merge pull request #29149 from woocommerce/update/28569_status_widget_net_sales_link
Woocommerce dashboard status widget net sales link and logic
2021-02-25 09:09:29 -04:00
Peter Fabian 8566a79da0 Pull out the constant to a globally accessible place so that it can be reused. 2021-02-24 14:29:45 +01:00
Peter Fabian 313ea8541c Remove compatibility checks for major version.
In addition to #28840, there are other places where we make use of compatibility check with major versions. I've discovered 2:
- update through /wp-admin/update-core.php
- force disabling auto-updates if there are any extensions that haven't declared their compatibility with WC 5.0

This change updates both places to be in line with the changes done in #28840.
2021-02-23 13:27:06 +01:00
Moon 5c99233905 Minor fixes
* Removed extra double quotation from the image tag

* Fixed typo in the init() method

* Moved init() method body into the constructor -- a separate method is not necessary
2021-02-22 20:33:02 -08:00
Rasmy Nguyen 7a4b54ad38 Add section to tracks event props
This adds the Extenstions tab to the event props so we can determine
which tab merchants are installing wcpay from.
2021-02-23 12:25:40 +09:00
Rasmy Nguyen cbb1a540bd Change hook name and add id param to track method
This changes the addon install hook to match the other hooks in the
extensions tracking class. This also adds an addon_id param to the
callback associated with this hook so we can extend this to other
plugins in the future.
2021-02-23 11:34:28 +09:00
Rasmy Nguyen 4ad1465fe3 Add tracks event for WCPay install via addons page
This adds a tracks event for WooCommerce Payments installs via the
wc-addons page.
2021-02-23 11:34:28 +09:00
Moon 781c5e24d7 Status dashboard widget should be rendered only if onboarding tasks have been completed or hidden 2021-02-22 15:29:47 -08:00
Fernando f613bbaeba
Merge pull request #29105 from woocommerce/fix/disable-merchant-email-notes
Merchant email notes now are turned off by default
2021-02-22 09:48:00 -03:00
Christopher Allford 5e771d8e4f Started Converting Woo Page Dropdowns
Since the page selection dropdowns in the Advanced settings area are
populated on load we can end up taking a very long time to load on
shops that have lots of pages. This commit adds page search support
to wooSelect and starts converting the pages to use it.
2021-02-19 15:28:07 -08:00
Claudio Sanches b6fe772d54
Merge pull request #29109 from woocommerce/update/add-tracking-to-status-widget
Add tracking to WooCommerce Status widget
2021-02-18 20:03:50 -03:00
Lourens Schep 966aca59ad Removed external class and moved logic to private functions 2021-02-18 16:05:00 -04:00
Lourens Schep 4663d31f66 Fix some formatting changes 2021-02-18 12:01:52 -04:00
Lourens Schep 136e82ee01 Added a v2 report class that makes use of the wc-analytics if wc admin is not disabled 2021-02-18 12:01:52 -04:00
Moon bc3219e22e Add tests for the finish setup dashboard widget and clean up code 2021-02-17 16:07:50 -08:00
Moon 6284cbee3a Add a new dashboard widget to promote store setup 2021-02-17 12:10:13 -08:00
louwie17 2471f816e4
Merge pull request #29093 from woocommerce/update/28570_widget_stock_links
Update the woo widget stock links to new analytics page
2021-02-17 09:35:50 -04:00
Moon 3707764736 Add tracking to WooCommerce Status widget -- net-sales, order-processing, orders-on-hold, low-stock, and out-of-stock 2021-02-15 16:41:14 -08:00
Claudio Sanches 7a71258257
Merge pull request #29094 from woocommerce/try/admin-menu-svg-icons
Use SVG and Dashicons instead of custom font for admin bar icons
2021-02-12 18:06:37 -03:00
Matt Sherman 6044f3e958 Update Products and Reports icons to use Dashicons instead of custom font 2021-02-12 10:37:23 -05:00
Fernando Marichal 15424c99d6 Merchant email notes now are turned off by default
This commit turns off the merchant email notes by default
2021-02-11 14:15:17 -03:00
Matt Sherman 9f00fbfde1
Move admin menu manipulation from admin_head to admin_menu (#29088) 2021-02-11 11:48:36 -05:00
Néstor Soriano 9105910234
Merge pull request #28950 from woocommerce/exporter_product_type_filter
Add filter to allow third-parties to filter exportable product types
2021-02-11 14:32:17 +01:00
Roy Ho 78851e6945
Merge pull request #28980 from leewillis77/add/add-generation-date-to-status-report
Add time of generation to the system status report
2021-02-11 05:09:03 -08:00
Claudio Sanches 69c5d428a2
Merge pull request #29095 from woocommerce/fix/conditional-wc-admin
Check if WC Admin is active before showing message
2021-02-10 19:45:34 -03:00
roykho 315c4de5c3
Check if WC Admin is active before showing message 2021-02-10 13:21:35 -08:00
Lourens Schep 5c6331593a Remove unnecessary wp-admin from urls 2021-02-10 16:42:04 -04:00
Matt Sherman cca38a577e Use SVG instead of CSS/font for WooCommerce icon 2021-02-10 15:12:47 -05:00
Lourens Schep 2db09d410b Change widget stock links to new analytics page when wc_admin is not disabled 2021-02-10 15:04:04 -04:00
Max WP Punk 585d96f237
Fix #29048 2021-02-08 03:28:43 +02:00
Mehul Gohil beb5916947
remove unnecessary closing brace in help text 2021-02-05 01:02:20 +05:30
James Allan 53e6a7317b Add filter to allow third-parties to filter exportable product types 2021-02-02 14:41:03 +10:00
Lee Willis 6b0a88f6ef Add time of generation to the system status report 2021-01-29 12:52:27 +00:00
roykho 8b0915c4e0
Flush term cache when saving product and settings closes #25375 2021-01-28 08:26:24 -08:00
roykho e86dc6a9ee
Remove html_entity_decode 2021-01-21 12:17:22 -08:00
roykho d550cce434
Addressed feedback by adding whitelisted nonce actions 2021-01-21 12:08:20 -08:00
roykho 21f872e766
Fix merge conflict 2021-01-20 07:10:47 -08:00
roykho 52a2ce0300
Move nonce prepartion into core utilizing filter hook from WC Admin 2021-01-20 07:06:23 -08:00
Claudio Sanches de81f2d686 Remove filter after email is sent 2021-01-19 17:57:48 -03:00
Claudio Sanches aea6e02a2a Fixed method with signature changed and introduced new filter instead 2021-01-19 17:51:31 -03:00
Claudio Sanches e6251955f2
Merge pull request #28840 from woocommerce/update/remove-untrusted-plugin-notice
Deactivate untested plugin's notices
2021-01-18 19:56:56 -03:00
Claudio Sanches ea54d5ad5f
Merge pull request #28679 from woocommerce/fix/woocommerce-gutenberg-products-block-issues-3565
Show correct WooCommerce pages status if they are using blocks vs shortcode.
2021-01-18 19:26:34 -03:00
Claudio Sanches 8f0237e390 Update untested extensions modal notice 2021-01-18 19:23:59 -03:00
Claudio Sanches 13462932ae Deactivate untrusted plugin's banner 2021-01-18 18:29:02 -03:00
Claudio Sanches 5ca7c51714
Merge pull request #28712 from woocommerce/add/config_merchant_email_notifications
Added merchant email note switch
2021-01-15 13:32:02 -03:00
Peter Fabian 02a2bbad71
Merge pull request #28799 from woocommerce/fix/issue-27789
Add notice to deprecate old reports closes #27789
2021-01-14 19:05:44 +01:00
jonathansadowski e8552094c2
Merge pull request #28809 from woocommerce/fix/issue-27791
Prevent duplicate new order email from being sent when changing order…
2021-01-14 09:36:30 -06:00
roykho 5b4e3a2e2e
Add margin 2021-01-14 05:25:26 -08:00
roykho 218c799811
Prevent duplicate new order email from being sent when changing order status closes #27791 2021-01-13 14:13:57 -08:00
Claudio Sanches 1f321f4a79
Merge pull request #28719 from raicem/update/featured-products-endpoint
Add Auth token for search/featured extensions requests
2021-01-13 18:13:25 -03:00
raicem eb3ba820da Use "wp_safe_remote_get" for sending search requests 2021-01-13 23:53:53 +03:00
roykho 8e7a59d959
Change location of the notice so it shows up in all reports 2021-01-13 07:00:37 -08:00
roykho 6041c10ea3
Add notice to deprecate old reports closes #27789 2021-01-12 07:37:00 -08:00
raicem f0166fcc56 Fix indentation errors as per WordPress code style guides 2021-01-07 15:14:38 +03:00
roykho fac6d3a246
Remove do_update_woocommerce query arg to prevent actions taken on it 2021-01-05 14:16:46 -08:00
raicem 7b67977a31 Reduce "wc_addons_featured" transient cache duration
The featured extension list was static but now it's fetched from
WooCommerce.com and may change more frequently. Reducing the
cache duration to allow users to see changes much more quickly.
2021-01-05 17:45:34 +03:00
raicem c70eee2a0a Send auth token when sending search and featured extension requests 2021-01-05 17:40:58 +03:00
Ron Rennick eca159ecab phpcs fixes, on sale dates should be displayed in local time 2021-01-05 13:19:49 +01:00
Ron Rennick 0d2a5ac5e9 Fixes needed for variable product E2E test
- Jest/Puppeteer sometimes will not find an element on page load when that element is outside the initial viewport
- There were duplicate .variation_tab classes which confused Jest/Puppeteer
- Add function for opening and verifying new product page
- Update test sequence for changes in flow in markup and Jest/Puppeteer
2021-01-05 13:19:49 +01:00
raicem c628c15ac6 Update featured products endpoint
WooCommerce.com will provide this list of products.
2021-01-05 12:43:17 +03:00
Fernando Marichal 543f1e1307 Fixed copy 2020-12-30 12:13:39 -03:00
Fernando Marichal f2648d76cf Turned merchant email notifications on by default
This commit adds the code to turn email notifications on by default
2020-12-30 10:42:53 -03:00
Fernando Marichal 5a21a4f71c Added merchant email note configuration
This commit adds a merchant email note configuration option
2020-12-29 14:31:46 -03:00
budzanowski 32c1c9c963 Print missing block info in the status page. 2020-12-28 16:27:31 +01:00
vedanshujain 892b7caa37 Stock managment fixes:
1. Use $already_reduced_stock instead of also considering $refunded_item_quantity while deleting orders. This will bring back part of #27504 again, but for now this seems to be the best solution for countering #28605. It needs discussion whether deleting a line item completely should also undo any refund related changes on it or not.

2. Also mark `stock_reduced` flag on order if any of the line item has any `_reduced_stock` flag. This will allow for stock restoring logic to work properly when order is cancelled.

3. Only adjust line item stock when order is in `processing`, `completed` or `on-hold` status state, because we need to reduce stocks on these status only. Stock adjustments in refunds or when changing statuses is already taken care of by their specific hooks.
2020-12-17 22:28:21 +05:30
Vedanshu Jain 4339aee35f
Merge pull request #27352 from juliquiron/fix/slow-wc-customer-get-operations
Added cache and filter for wc-customer get operations.
2020-12-14 09:43:04 +05:30
Roy Ho aa89afcf95
Merge pull request #28332 from woocommerce/update/replace-jquery-click
Replace usages of depracted jQuery.fn.click() event shorthand
2020-12-07 06:03:56 -08:00
Rodrigo Primo 23af5478ec Fix JS coding standards 2020-12-05 11:11:56 -03:00
roykho 4a2943d452
Defer nonce creation until displayed by WC Admin closes #27424 2020-12-04 13:17:24 -08:00
Roy Ho f698fbdeee
Merge pull request #28403 from bordoni/issue/28291
Prevent non-numeric values from throwing a Warning on PHP 7.4+
2020-12-01 10:43:13 -08:00
Gustavo Bordoni d6d68ed9cd
Remove white space. 2020-12-01 13:16:53 -05:00
Roy Ho 89efae43a1
Merge pull request #28416 from woocommerce/fix/issue-27154
Fix/issue 27154
2020-11-30 06:14:15 -08:00
OlegApanovich 26dae12279 Fix toggle chevron issue in admin edit product data attribute section #27923
After chevron clicking on attribute section complete edit product data section toggled insted cliackig area.
Key point issue is missing 'postbox' class of wordpress postbox.js library for a attribute block that we try to toggle.
2020-11-27 11:50:44 +02:00
roykho 3981377809
Strip the tags from product description on all other select2 fields that performs searches 2020-11-25 13:32:50 -08:00
Gustavo Bordoni 2909be0777
Prevent non-numeric values from throwing a Warning on PHP 7.4+
Resolves #28291
2020-11-25 00:10:04 -05:00
Rodrigo Primo 1fca8bb1b1 Replaces a few more instances of jQuery.fn.click() event shorthand
This commit replaces a few more instances of jQuery.fn.click() event shorthand that were missed in the previous commit. For more information see the commit message for 8ebead165e.
2020-11-18 16:31:17 -03:00
Rodrigo Primo ee31c791af Fix PHPCS violations 2020-11-18 15:33:36 -03:00
Rodrigo Primo 8ebead165e Replace usages of depracted jQuery.fn.click() event shorthand
This commit replaces all instances in WooCommerce codebase (except included third-party libraries) where jQuery.fn.click( handler ) event shorthand was used. This shorthand was deprecated in jQuery 3.3 (see https://github.com/jquery/jquery/issues/3214). The jQuery documentation was not updated yet (see https://github.com/jquery/jquery-migrate/issues/288 and https://github.com/jquery/api.jquery.com/issues/972).

jQuery.click() was not deprecated and so it was not replaced.
2020-11-18 15:27:46 -03:00
Renatho De Carli Rosa c2b066edcb Fix requires_php check 2020-11-13 16:47:26 -03:00
Renatho De Carli Rosa 5cbcdcd92c Add requires_php support
With this check, we're able to avoid updates when the PHP version
is not supported
2020-11-13 16:47:26 -03:00
Christopher Allford 03f65478f2
Merge pull request #28249 from woocommerce/add/composer-2
Update Composer to v2 (includes woocommerce-blocks 3.8.0 and woocommerce-admin 1.7.0)
2020-11-12 21:16:51 -08:00
Christopher Allford 2516414eb6
Merge pull request #28229 from woocommerce/add/wc-pay-extensions-screen
Add WooCommerce Payments banner to extensions screen
2020-11-12 14:21:01 -08:00
Christopher Allford 30d2e278b9 Replaced the deprecated `WC_Admin_Note` class 2020-11-12 13:26:30 -08:00
roykho 5597f74e81
Merge branch 'master' into fix/issue-27972 2020-11-12 06:21:52 -08:00
roykho 134786ada8 Fix stock reducing incorrect amount when order item is deleted after a refund closes #27504 2020-11-11 15:28:06 -06:00
Gerhard Potgieter 6832dc96a4 Make wc shipping button also purple 2020-11-10 19:43:11 +02:00
Gerhard Potgieter 3c1352d36c Remember to break 2020-11-10 19:36:34 +02:00
Gerhard Potgieter caf2ea99fa Shorten title as per feedback 2020-11-10 19:26:44 +02:00
Gerhard Potgieter a0812d5009 Remove redirect as it does not work with the background installer 2020-11-10 18:28:47 +02:00
Gerhard Potgieter b5fb7c0104 Add purple woo button 2020-11-10 18:26:59 +02:00
Gerhard Potgieter b5a4a1597f Fix current section check, phpcs linting errors. 2020-11-10 16:48:11 +02:00
Gerhard Potgieter 692dfa7fec Update banner copy 2020-11-09 15:21:38 +02:00
Gerhard Potgieter 8af8554770 Add functionality to handle woocommerce payments install 2020-11-09 14:48:49 +02:00
Gerhard Potgieter 7d33488d6b WooCommerce Services to WooCommerce Shipping 2020-11-09 14:22:20 +02:00
Gerhard Potgieter 78336781d1 Remember output_ in function name 2020-11-09 14:20:24 +02:00
Gerhard Potgieter b1d9363918 Add wc payments to extensions addons page. 2020-11-09 14:19:11 +02:00
roykho 4c079ea99e
Update SSR version to check against major versions only closes #27972 2020-10-27 08:16:35 -07:00
Roy Ho c96a642e8a
Merge pull request #28067 from woocommerce/fix/27529
Fix: use the correct parameter when calling get_avatar()
2020-10-26 07:46:51 -07:00
Rodrigo Primo 09faf8ba84 Fix: use the correct parameter when calling get_avatar()
`WC_Admin_Dashboard::recent_reviews()` was calling `get_avatar()` passing `$comment->comment_author` which is not one of the list of parameters that the function accepts to get the avatar. As a result, the widget that displays the recent reviews in the admin dashboard was never displaying the avatar of the user that left the review. This commit fixes this issue by passing `$comment->comment_email` instead. I opted to use `$comment->comment_author` as it should be available for reviews left both by authenticated and anonymous users and because getting the comment object wouldn't be so simple (either we need to perform an extra query for each review or deprecate the `woocommerce_report_recent_reviews_query_from` filter).
2020-10-22 17:43:59 -03:00
Rodrigo Primo e91872c1a8 PHPCS fixes 2020-10-22 17:34:47 -03:00
pjv f03bfb85da Fix incorrect capability for product sorting link
Fixes #28049
2020-10-22 13:03:35 -05:00
Rodrigo Primo 0a81188e42
Merge pull request #27987 from woocommerce/php8/fix-required-parameters-after-optional-take-2
[PHP 8] Convert optional-before-required parameters into required parameters (take 2)
2020-10-17 09:42:20 -03:00
roykho e8bcd464db
Update escape based on suggestion 2020-10-16 06:00:34 -07:00
Nestor Soriano 63ced34e2d Convert optional-before-required arguments to required (take 2)
In PHP 8 required parameters after optional parameters in
function/method signatures trigger a deprecation notice. These type
of parameters are pointless since a value needs to always be
provided for them anyway, so they are actually de-facto required.

This commit converts all these not-so-optional parameters into
truly required parameters by removing their default values.
2020-10-16 13:08:31 +02:00
roykho 800cbdbc7e
Add missing escapes 2020-10-15 16:31:56 -07:00
roykho ace411aacd
Fix billing email being parsed as a URL link when beginning of email contains www closes #25099 2020-10-15 14:25:03 -07:00
Néstor Soriano e4a109f0d1
Merge pull request #27763 from woocommerce/fix/27445
Remove protection as we already diff and update only if needed.
2020-10-15 10:01:34 +02:00
Claudio Sanches e34681dbb4
Merge pull request #27696 from woocommerce/fix/version-race-conditions
Fix some race conditions in WC_Install
2020-10-14 20:18:47 -03:00
Claudio Sanches 23fe4f71bb
Merge pull request #27842 from sudoshreyansh/fix/27839
Fixed </strong> closing tag position. Issue: #27839
2020-10-14 18:06:10 -03:00
Néstor Soriano c15488d840
Merge pull request #27830 from woocommerce/php8/fix-round-function-with-non-numeric-argument 2020-10-09 08:01:44 +02:00
Knyazevich ce59afb2b9 Simplify drafts excluding logic (ref #24136) 2020-10-06 18:11:58 +03:00
Knyazevich f551c6c792 Exclude drafts from the "Shop page" select (ref #24136) 2020-10-06 06:42:56 +03:00
sudoshreyansh dd9bf06594 Fixed </strong> closing tag position. Issue: #27839 2020-10-02 15:46:41 +05:30
Nestor Soriano 52eed70f04 Add a 'NumberUtil' class with a 'round' method.
There's a number of places in the WooCommerce codebase where the
built-in function 'round' is executed passing a non-numeric value
(not a number and not a string that can be parsed as a number),
for example round(''). In PHP 7 this yields a value of 0, but in
PHP 8 this throws an error.

This commit adds a 'NumberUtil' class with a static 'round' method,
this method checks if the passed value is numeric and if so it just
executes the built-in function, otherwise it returns 0. And all the
calls to 'round' in the codebase are replaced with 'NumberUtil::round'.
2020-10-01 11:08:51 +02:00
vedanshujain c69e1f5799 Remove protection as we already diff and update only if needed.
In #26642 we removed adding reduced_stock meta when adding new order item to prevent ghost entries, but in inadvertently exposed an underlying bug where _reduced_stock meta was getting set to 0 if its emtpy.

We were then checking the presence of this meta, but also not reducing the stock in case it was not set.
2020-09-24 00:54:24 +05:30
Rodrigo Primo c3a72b994a Fix version in which the setup wizard was deprecated
The setup wizard is going to be deprecated in WC 4.6.0 which should be
released soon. Some functions were marked as if they were deprecated in
WC 4.5.0 which is not the case.
2020-09-22 11:20:33 -03:00
Rodrigo Primo 51fd4af1b2 Remove call to __() from deprecation messages
Doing this as AFAIK we don't typically support traslation for
deprecation messages.
2020-09-22 11:18:43 -03:00
Rodrigo Primo 7401982d37
Merge pull request #27047 from woocommerce/fix/26972
Removed Features settings and home screen option
2020-09-18 16:46:43 -03:00
Ron Rennick 4b3b40d42e address feedback 2020-09-18 15:22:24 -03:00
Ron Rennick 43051a0950 update deprecation versions to 4.6.0 2020-09-18 13:16:46 -03:00
Ron Rennick 9915a5b142 merge master 2020-09-18 12:53:28 -03:00
Claudio Sanches 29b8b0d60d
Merge pull request #27701 from woocommerce/fix/rest-api-package-tag
Fixed usage of package tag in REST API and templates
2020-09-17 18:45:14 -03:00
Claudio Sanches 153ce009de Fixed helper header 2020-09-17 16:50:17 -03:00
Claudio Sanches 3377c60c5e
Merge pull request #27433 from woocommerce/fix/remove-relative-include-paths
Change relative include paths to absolute include paths
2020-09-17 13:15:40 -03:00
Claudio Sanches f4e9fcc1a4 Fixed missing include 2020-09-17 13:12:57 -03:00
Konstantin Kovshenin a100ed67b2 Fix race conditions in WC_Install
In an environment with persistent object caching, concurrent calls
to delete_option() + add_option() can result in the option value
leaking out of the alloptions cache key, and into its own cache
item under the options group, while deleting the value from the
database.

This causes future function calls to add_option() to fail, since
the value already exists in cache (under the wrong key). It also
causes calls to delete_option() to fail, since the value is not
in the database.

This commit forces update_option() instead of the delete + add
combination, as well as removes multiple unnecessary calls to
update the woocommerce_db_version from admin notes and notices.
2020-09-17 11:59:50 +03:00
Rodrigo Primo d50cd4389b Fix using tax classes with some non-ASCII characters
This commit fixes a bug that made it impossible to assign to a product a tax class that contained non-ASCII characters that are URL encoded by sanitize_title().

WooCommerce uses sanitize_title() to generate a slug when creating a tax class (d48f1d4e2e/includes/class-wc-tax.php (L808)). sanitize_title() converts some non-ASCII to ASCII equivalents (those handled by remove_accents()) and URL encodes others (like some Greek characters, for example).

The code was using wc_clean() to sanitize the tax class when the user edited a product. The problem is that wc_clean() removes URL encoded characters, changing the slug of some tax class, causing WooCommerce to use the standard tax class instead without any errors. To fix this issue, this commit replaces wc_clean() with sanitize_title(). This should be enough for security purposes and should not cause any issues with non-ASCII characters.
2020-09-08 16:00:56 -03:00
Ron Rennick 8fe3bcb90e rebase to current master 2020-08-28 10:59:43 -03:00
Claudio Sanches c4ccc38780 Fixed use __DIR__ for relative paths 2020-08-26 18:46:44 -03:00
Romario 67a178f4f7 Replace 'DIRECTORY_SEPARATOR' with '/' 2020-08-26 15:50:34 -05:00
Romario 3b90d99d44
Change 'dirname( __FILE__ )' to '__DIR__ ' and include '/'
Co-authored-by: Claudio Sanches <contato@claudiosanches.com>
2020-08-26 14:58:22 -05:00
Claudio Sanches 5240682f38 Improve choice of words 2020-08-25 18:03:03 -03:00
Hayden Whiteman 3fca3caf1d Fix #27413 2020-08-22 19:35:13 +12:00
Romario acfb3e5dfd Add spacing between '$dir 'and '.' 2020-08-21 15:25:21 -05:00
Romario 073c63c9c4 Replace dirname with __DIR__ and add DIRECTORY_SEPARATOR
Previously 'dirname(  __FILE__ )' was used to import files, however, the directory separator was missing.

This commit replaces 'dirname(  __FILE__ )' that was introduced in 5370d02484 with __DIR__  and added DIRECTORY_SEPARATOR
2020-08-21 15:16:26 -05:00
Romario 5370d02484 Change relative include paths to absolute include paths
Relative include paths in PHP can break whenever the server is running opcache.  As such, WordPress.com deploy system refuses to include WooCommerce because of that issue.

This commit changes the relative include paths to absolute include paths.

Relates to #27269
2020-08-20 15:32:04 -05:00
Claudio Sanches af357e9177 Updated priority of admin_body_class filter 2020-08-20 13:18:23 -03:00
Julià Mestieri b2c35a5ded Added cache and filters for wc-customer get operations. 2020-08-17 11:25:54 +02:00
Néstor Soriano f8ea11a607
Merge pull request #27145 from woocommerce/fix/26006
Fixed "virtual" and "downlodable" pointers on product walkthrough
2020-08-14 08:55:53 +02:00
Ron Rennick 72df8aecfa updated deprecated version to 4.5.0 2020-08-13 14:46:12 -03:00
Ron Rennick f0ad8a01be merge current master 2020-08-13 14:33:07 -03:00
Claudio Sanches 070e3896cf Restored pointers position 2020-08-12 21:46:36 -03:00
Claudio Sanches df4aa12f21 Fixed coding standards to make trigger a test on Travis 2020-08-11 20:11:07 -03:00
Claudio Sanches db85fad826 Merge branch 'master' into fix/26006 2020-08-10 18:52:21 -03:00
Claudio Sanches 525db3aa21 Fixed incorrect package tags 2020-08-05 17:49:10 -03:00
Claudio Sanches f4b336a0f3 Fixed incorrect package 2020-08-05 13:51:37 -03:00
Claudio Sanches d48f1d4e2e Fixed package tag usage 2020-08-05 13:36:24 -03:00
Claudio Sanches 891a0cf8e8
Merge pull request #27170 from woocommerce/fix/27167
Fixed - Fixed "Product type" dropdown from Product's data meta box on WP 5.5
2020-07-30 16:38:18 -03:00
Claudio Sanches cc8282a23f
Merge pull request #27142 from woocommerce/fix/25788
Improve order details UI to highlight "Paid" and "Net Payment" sections
2020-07-30 15:49:24 -03:00
Claudio Sanches 77f8bb57a6 Check if there's a payment method title 2020-07-30 13:05:03 -03:00
Claudio Sanches a464b7aeab Improved wc_get_current_admin_url()
- Replace "/wp-admin" with regex like on WP core.
- Remove "wc-hide-notice" from query args.
2020-07-29 21:01:39 -03:00
Claudio Sanches c9f52a45eb New wc_get_current_admin_url() function 2020-07-29 20:52:36 -03:00
Claudio Sanches e26076af7b Return to the current page after enabled or disabling db update notices 2020-07-29 20:37:27 -03:00
Claudio Sanches d498341f0e Added function to get current admin page 2020-07-29 20:37:12 -03:00
Claudio Sanches 97c7937fd9 Fixed "Product type" dropdown on WP 5.5
WP 5.5 doesn't introduce a <span> tag inside metaboxes headings
2020-07-29 19:12:02 -03:00
Néstor Soriano d5bedd82b2
Merge pull request #27148 from woocommerce/fix/dont-request-translations-with-no-locales
Don't request empty locales list for plugin translations.
2020-07-29 16:23:06 +02:00
Néstor Soriano 0f134ca6a2
Merge pull request #27054 from woocommerce/fix/27036
add/update correct deprecated notices on existing deprecations
2020-07-29 15:20:24 +02:00
Claudio Sanches 008e41170b Improved UX to highlight order data when there's some refund 2020-07-28 15:13:00 -03:00
Claudio Sanches cc42af2f6e Fixed phpcs flag 2020-07-28 10:36:28 -03:00
budzanowski 57aeff0a71 Update comment. 2020-07-28 11:49:01 +02:00
budzanowski ac501dea64 Don't request empty locales list for plugin translations. 2020-07-28 11:37:51 +02:00
Claudio Sanches 2df7324b0d Fixed "virtual" and "downloadable" checkboxes pointers 2020-07-27 22:43:04 -03:00
Claudio Sanches 283c82b6b4 Fixed coding standards 2020-07-27 22:42:15 -03:00