Skip to content

Remove the FBE plugin version heartbeat - #4058

Open
jczhuoMeta wants to merge 1 commit into
mainfrom
cleanup/remove-deprecated-version-metadata
Open

jczhuoMeta wants to merge 1 commit into
mainfrom
cleanup/remove-deprecated-version-metadata

Conversation

@jczhuoMeta

@jczhuoMeta jczhuoMeta commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor

Description

The daily FBE heartbeat (Update::send_new_version_to_facebook_server()) writes version_id, is_multisite and is_woo_all_products_opted_out to the FBE business configuration. Meta reads the plugin version from the Commerce Partner Integration (CPI), so this removes the FBE write entirely.

The plugin already sends the version to the CPI as extension_version:

  • Daily CPI configuration push: POST /{commerce_partner_integration_id} from Connection::refresh_installation_data()
  • Onboarding: finalize-install
  • Legacy repair: commerce_partner_integrations_repair

Removed

  • Update::send_new_version_to_facebook_server() and its Heartbeat::DAILY hook
  • Update::LATEST_VERSION_SENT
  • API::update_plugin_version_configuration()
  • API\FBE\Configuration\Update\Request and API\FBE\Configuration\Update\Response
  • Their unit tests

Renamed, behavior unchanged

  • What remains of ExternalVersionUpdate\Update is only the hourly plugin configuration telemetry: the plugin_updates flow logged to commerce_seller_logs every 3 hours.
  • It moves to Utilities\PluginConfigTelemetry, so the name describes what it does.
  • It reads the master-sync opt-out option through PluginRender::MASTER_SYNC_OPT_OUT_TIME instead of a duplicate constant.
  • Hook, throttle, payload, option and transient names are unchanged.

Unchanged: the FBE configuration read (API\FBE\Configuration\Request) used by the legacy management URL.

Stored data: stores keep the orphaned facebook_for_woocommerce_latest_version_sent_to_server row. It joins DEPRECATED_OPTIONS, so disconnecting clears it, and the version-gated cleanup removes it later with the other retired options. The e2e reset test's copy of that list is updated to match.

Compatibility

The following public symbols are removed without a deprecation cycle, as in #4001. No first-party caller remains.

  • API::update_plugin_version_configuration()
  • Update::LATEST_VERSION_SENT
  • The two FBE Configuration Update classes

ExternalVersionUpdate\Update moves to Utilities\PluginConfigTelemetry. Its TRANSIENT_LANGUAGE_FEED_STATS* and COLLECTIONPAGE_COMPAT_OPTION constants move with it. Its MASTER_SYNC_OPT_OUT_TIME is dropped in favor of PluginRender::MASTER_SYNC_OPT_OUT_TIME.

Connected stores with no stored CPI ID stop reporting a plugin version to the integration, because the daily CPI push needs one. They still report seller_platform_app_version in the hourly telemetry.

Dependency

None remaining. Meta's server-side readers now take the plugin version from the CPI first, and that change is deployed. The FBE version_id fallback only serves older plugin versions, which keep writing it.

This PR is independent of #4070. Both add to tests/e2e/plugin-level-tests.spec.js in different places, and they merge cleanly onto main in either order.

Internal tracking: T292702666

Type of change

  • Tweak (removes a redundant server write and renames the remaining telemetry class)

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 have checked plugin debug logs that my changes do not introduce any new PHP warnings or FATAL 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.
  • I have completed dogfooding and QA testing, or I have conducted thorough due diligence to ensure that it does not break existing functionality.
  • I have updated or requested update to plugin documentations (if necessary). No documentation change is needed.

Changelog entry

Remove the daily plugin version update to the FBE business configuration; the version is reported through the Commerce Partner Integration.

Test Plan

Automated

  • PHP unit suite (PHP 8.2): 2090 tests passed.
    • New PluginConfigTelemetryTest covers the hourly hook, the 3-hour throttle, the plugin_updates payload, and the language feed stats transient that LanguageOverrideFeed writes through the moved constant.
  • PHPCS (phpcs.xml.dist) on changed production files: no new warnings. The existing edit_product capability warning in facebook-commerce.php is on an untouched line.
  • PHPCompatibilityWP (PHP 7.4+) on changed PHP files: clean.
  • php -l, node --check on the e2e spec, git diff --check: passed.
  • Repository-wide search: no remaining references to the removed method, constant, classes, option or transient, or to ExternalVersionUpdate.

Manual verification

On a connected store with a CPI ID, with debug logging enabled:

  1. Daily sync. Run wp transient delete _wc_facebook_for_woocommerce_refresh_installation_data, then wp eval 'do_action( "facebook_for_woocommerce_daily_heartbeat" );'. Confirm that POST /{commerce_partner_integration_id} carries extension_version and that no POST /fbe_business request is made.
  2. Telemetry. Run wp transient delete _wc_facebook_for_woocommerce_send_plugin_config_flag, then wp eval 'do_action( "facebook_for_woocommerce_hourly_heartbeat" );'. Confirm that one POST /commerce_seller_logs request carries the plugin_updates flow with the same fields as before.
  3. Stored data. Run WooCommerce > Status > Tools > Reset connection settings and confirm that facebook_for_woocommerce_latest_version_sent_to_server is deleted.

QA results

Local WordPress store (WordPress 7.1.2, WooCommerce 11.1.2, PHP 8.2.30), 2026-10-13. The PHP debug log had no new warnings or fatal errors during any of the checks below, including heartbeats run through WP-Cron.

  • Renamed class. Utilities\PluginConfigTelemetry loads, and ExternalVersionUpdate\Update no longer exists.
  • Daily sync (connected store). POST /{commerce_partner_integration_id} returned 200 with extension_version, and no POST /fbe_business request was made.
  • Telemetry (connected store). POST /commerce_seller_logs returned 200 with the plugin_updates flow.
  • Stored data. The Reset connection settings callback deleted facebook_for_woocommerce_latest_version_sent_to_server (it held 3.7.6).

Screenshots

Not applicable; this change has no user-interface impact.

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

github-actions Bot commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor

📦 Latest Plugin Build

Built at: 2026-11-05T10:26:01Z
Commit: ed9b81d
Size: 1.9M

Download: Click here to download the plugin

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

@jczhuoMeta
jczhuoMeta marked this pull request as draft September 22, 2026 18:18
@jczhuoMeta
jczhuoMeta force-pushed the cleanup/remove-deprecated-version-metadata branch from d56d10e to 2738f3e Compare September 30, 2026 17:58
@jczhuoMeta jczhuoMeta changed the title Remove deprecated plugin version metadata Remove the FBE plugin version heartbeat Sep 30, 2026
@jczhuoMeta
jczhuoMeta force-pushed the cleanup/remove-deprecated-version-metadata branch from 35a7f53 to e5071c2 Compare September 30, 2026 20:03
@jczhuoMeta
jczhuoMeta force-pushed the cleanup/remove-deprecated-version-metadata branch from e5071c2 to 7629cbe Compare October 13, 2026 19:37
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 4 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (main@08164c9). Learn more about missing BASE report.

Files with missing lines Patch % Lines
...ncludes/Feed/Localization/LanguageOverrideFeed.php 0.00% 2 Missing ⚠️
class-wc-facebookcommerce.php 0.00% 1 Missing ⚠️
includes/Utilities/PluginConfigTelemetry.php 0.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4058   +/-   ##
=======================================
  Coverage        ?   11.14%           
  Complexity      ?     6118           
=======================================
  Files           ?      233           
  Lines           ?    20730           
  Branches        ?        0           
=======================================
  Hits            ?     2310           
  Misses          ?    18420           
  Partials        ?        0           
Flag Coverage Δ
integration 11.14% <0.00%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@jczhuoMeta
jczhuoMeta marked this pull request as ready for review October 13, 2026 22:29
@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 D125258319.

The daily heartbeat wrote version_id, is_multisite and
is_woo_all_products_opted_out to the FBE business configuration. Meta reads
the plugin version from the Commerce Partner Integration, which the plugin
already updates with extension_version on finalize-install, on repair, and in
the daily configuration push, so the FBE write is removed along with its
request/response classes and tests. Stores keep the orphaned latest-version
option row, so it joins DEPRECATED_OPTIONS and is cleared on disconnect like
the other retired options.

What remains of the class only holds the hourly plugin configuration
telemetry, the plugin_updates flow of commerce_seller_logs. It moves to
Utilities\PluginConfigTelemetry so the name says what it does, and reads the
master-sync opt-out option through PluginRender instead of a duplicate
constant. Telemetry behavior is unchanged: same hook, throttle, payload,
option and transient names. A new unit test covers the telemetry, including
the language feed stats transient that LanguageOverrideFeed writes through
the moved constant.
@vahidkay-meta
vahidkay-meta force-pushed the cleanup/remove-deprecated-version-metadata branch from 7629cbe to 14911b2 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.

2 participants