-
Notifications
You must be signed in to change notification settings - Fork 21
[WOOSHIP-1511] chore: add active WC shipping plugin version to CS API calls #2881
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: trunk
Are you sure you want to change the base?
Conversation
| 'dimension_unit' => strtolower( get_option( 'woocommerce_dimension_unit' ) ), | ||
| 'weight_unit' => strtolower( get_option( 'woocommerce_weight_unit' ) ), | ||
| 'wcs_version' => WC_Connect_Loader::get_wcs_version(), | ||
| 'wcshipping_version' => WC_Connect_Loader::get_wc_shipping_version(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess it's worth checking how currently wcshipping_version is used on connect-server side, I guess in some cases it's used to determine if the request is coming from WC Shipping or not.
Maybe simply passing active_plugins => get_option( 'active_plugins' ) or get_plugins(with a plugin's folder as argument) would be a safer alternative.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We'd anyways need the version as well, wcshipping_version currently has 2 use cases:
- The actual version number of the plugin sending the request.
- The existence of
wcshipping_version, implies request is coming fromwcshipping_version
While the above is not perfect, we shouldn't refactor it at this stage.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The idea was not to remove the wcshipping_version but to add a better plugin source check. I worked on a draft over the weekend for this but it needs a lot of test fixes. I have pushed it here and will fix in the cooldown week. Till then I guess both of these PRs can be parked.
|
@ayushpahwa do you want to keep this PR or should we close it? |

Description
Add the plugin version of WC shipping to the API call made to connect server. This will inform the connect server if WC shipping is also active along with the current plugin.
Related issue(s)
Fixes #WOOSHIP-1511
Steps to reproduce & screenshots/GIFs
lib/services/index.jsin the functionvalidationHandler, addconsole.log("Request: ", JSON.stringify(request.payload, null, 2));woocommerce>orderspage and notice the logs. It should show values for bothwcs_versionandwcshipping_versionin thesettingsobject.Installed pluginsand deactivate WC Shipping. Navigate back towoocommerce>orderspage and notice that only value for bothwcs_versionis valid andwcshipping_versionwill be coming asundefined.PS: ensure to test the similar PR in WC shipping for effective review.
Checklist
changelog.txtentry addedreadme.txtentry added