Closed layoutd closed 7 months ago
Thanks @rawdreeg
Along with the one nit pick I left in the comments. I wonder since we're only marking the class as deprecated without removing it, we shouldn't have a
_doing_it_wrong
call when try to access the class method.
Yeah, I've gone back and forth on that. I doubt there are many people extending or invoking the Messenger class or methods directly, but the extension has a huge user base and I'm a bit gun shy about breaking things now 😳
I'll look into removing the code altogether (I want to see some prior art just to be sure I'm doing it right).
Thanks @rawdreeg
Along with the one nit pick I left in the comments. I wonder since we're only marking the class as deprecated without removing it, we shouldn't have a
_doing_it_wrong
call when try to access the class method.Yeah, I've gone back and forth on that. I doubt there are many people extending or invoking the Messenger class or methods directly, but the extension has a huge user base and I'm a bit gun shy about breaking things now 😳
I'll look into removing the code altogether (I want to see some prior art just to be sure I'm doing it right).
I am happy to deprecate gracefully. but if the feature won't work from FB then it will probably break one way or another :-D
I can approve this, and we can have a separate task for totally deleting the class if it helps.
I strongly suggest removing the code, tests, anything related to chat at this point.
@layoutd I have created #2721 for visibility and tagged you there.
I've gone through and removed almost everything. I left a few public properties and methods that can be fully removed a few releases after 3.2.0 (just in case there is anyone using them, they'll have a few release cycles to discover the "graceful" errors):
Thanks for the 👀 @rawdreeg. I'm going to leave it awaiting merge until April 26, so it can be released on the 30th or on May 7.
Changes proposed in this Pull Request:
This disables and deprecates all Messenger functionality following https://github.com/woocommerce/facebook-for-woocommerce/issues/2622#issuecomment-2004533578.
This PR should:
It doesn't delete any files or methods – simply marks them as deprecated for posterity. If this seems too safe, the unused files could be deleted in a subsequent PR or release.
phpcs
checks? Please removephpcs:ignore
comments in changed files and fix any issues, or delete if not practical.Detailed test instructions:
For all tests, confirm no errors in log or browser console. Install and upgrade...
wp-admin/admin.php?page=wc-facebook&tab=messenger
):Enable messenger and confirm the chat appears on shop (probably with a slight delay, and with
has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.
error in the console):Check for
.fb-customerchat
DOM element or thexfbml.customerchat.js
script to see that the chat plugin is being injected:Upgrade to current version:
Visit extension settings (
wp-admin/admin.php?page=wc-facebook
) and confirm the deprecation notice appears (Don't dismiss!!): (It should also appear on the messenger settings and other places, like Plugins or the Orders page)Check for Facebook Messenger options:
Finally, upgrade to this PR:
Force migration by updating the version to
3.2.0
infacebook-for-woocommerce.php
:Confirm Messenger settings page is gone
/wp-admin/admin.php?page=wc-facebook
/wp-admin/admin.php?page=wc-facebook&tab=messenger
&tab=nopagehere
)Confirm settings DB records erased
Confirm messenger scripts are no longer injected
.fb-customerchat
DOM element and thexfbml.customerchat.js
script are no longer present.Confirm messenger deprecation notice removed
Bonus
Changelog entry