Skip to content

Remove unused /me, page and permissions API wrappers - #4092

Open
jczhuoMeta wants to merge 1 commit into
mainfrom
cleanup/remove-unused-me-page-permissions-wrappers
Open

jczhuoMeta wants to merge 1 commit into
mainfrom
cleanup/remove-unused-me-page-permissions-wrappers

Conversation

@jczhuoMeta

Copy link
Copy Markdown
Contributor

Description

Removes Graph API wrappers that nothing calls, so that no plugin code path depends on an endpoint needing ads_management or a pages_* scope. This supports moving the Commerce Extension to least-privilege token scopes.

  • Delete API::get_user() (GET /me) and API::get_page() (GET /{page_id}?fields=name,link), along with API\User\{Request,Response} and API\Pages\Read\{Request,Response}. Only tests called them.
  • Delete API\User\Permissions\Delete\{Request,Response} (DELETE /{user_id}/permissions/{perm}). These were never wired into API and have no callers.
  • Stop sending page_id, ad_account_id, business_manager_id and profiles to /settings/finalize-install, and drop them from its schema. Handler::handle_finalize_install() never reads them: it persists only the token, CMS, CPI, catalog and pixel. A cached admin page that still sends them is harmless, because the fields were optional and never read.
  • Option constants and their delete-on-disconnect cleanup are untouched, so older installs are still cleared.

The /me/accounts page access token read was already removed in 3.7.7. This removes what remained. There is no runtime behaviour change.

Type of change

  • Tweak (non-breaking change which fixes code modularity, linting or phpcs issues)

Checklist

  • I have commented my code, particularly in hard-to-understand areas, if any.
  • I have confirmed that my changes do not introduce any new PHPCS warnings or errors.
  • I followed general Pull Request best practices.
  • I have added tests (if necessary) and all the new and existing unit tests pass locally with my changes.
  • Plugin documentation updated: includes/API/Plugin/README.md no longer shows page_id in the finalize-install example.

Changelog entry

Remove unused /me, page and permissions Graph API wrappers and unread finalize-install fields.

Test Plan

  • tests/Unit/ApiTest.php: 29 tests pass.
  • Finalize-install schema unit test and the Shops payload/schema contract integration test: pass.
  • Full unit and integration suites: each test that fails or errors on this branch also fails or errors on unmodified main in the same local environment, mostly PHP 8.5 setAccessible() deprecations and a null connection handler. This change adds no new failures.
  • git grep finds no remaining references to the removed classes or methods.

@meta-cla meta-cla Bot added the CLA Signed label Oct 14, 2026
@jczhuoMeta jczhuoMeta added the changelog: tweak Small change, that isn't actually very important. label Oct 14, 2026
@github-actions

github-actions Bot commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

📦 Latest Plugin Build

Built at: 2026-11-05T10:26:09Z
Commit: 8376922
Size: 1.9M

Download: Click here to download the plugin

To download: Click the link above → Scroll to bottom → Download "facebook-for-woocommerce" artifact

@meta-codesync

meta-codesync Bot commented Oct 14, 2026

Copy link
Copy Markdown

@jczhuoMeta has imported this pull request. If you are a Meta employee, you can view this in D125260127.

Delete API::get_user() (GET /me), API::get_page() and the never-wired
User\Permissions\Delete request/response. Nothing outside tests calls them.

Stop sending page_id, ad_account_id, business_manager_id and profiles to
/settings/finalize-install and drop them from its schema; the handler never
reads them. Option constants and disconnect cleanup are untouched.
@vahidkay-meta
vahidkay-meta force-pushed the cleanup/remove-unused-me-page-permissions-wrappers branch from 1a1930d to 8eb5ba7 Compare November 5, 2026 10:25

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog: tweak Small change, that isn't actually very important. CLA Signed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant