woocommerce / facebook-for-woocommerce

A first-party extension plugin built for WooCommerce. Development is managed by Ventures.
https://woocommerce.com/products/facebook/
GNU General Public License v2.0
211 stars 140 forks source link

Problem: #2808

Closed atuld123 closed 1 month ago

atuld123 commented 1 month ago

Changes proposed in this Pull Request:

Problem:

  1. The Delete Permission User API only removed Meta connection assets from the WooCommerce database, leaving asset-related data enabled on Meta surfaces.
  2. If a user disconnected the connection before uninstalling assets from Meta surfaces using Managed Connection; the UI for Managed Connection was also removed, making it difficult for users to uninstall this feature from Meta surface.

Solution:

  1. Replaced the Delete Permission User API with the recommended Delete FBE Connection endpoint, which uninstalls assets from Meta surfaces and removes their permissions.
  2. Removed the Managed Connection UI button for uninstalling FBE from Meta surfaces, as the Delete Connection endpoint now handles this functionality.

Screenshots:

Before:

image

After:

image image

Detailed test instructions:

  1. Run new tests: ./vendor/bin/phpunit --filter test_delete_mbe_connection_deletes_user_permission_request
  2. Run all tests : npm run test:php
  3. Lint: ./vendor/bin/phpcs
  4. Manual testing: I have tested new Disconnect UI flow; it uninstall FBE connection from WooCommerce as well as from Meta surface

Changelog entry

Removed: Delete Permission User API Added: Delete FBE Connection endpoint to uninstall assets from Meta surfaces and remove permissions Removed: Managed Connection UI button for uninstalling FBE from Meta surfaces (now handled by Delete Connection endpoint)