=== StallRadar Sync Doctor for Meta for WooCommerce ===
Contributors: hamzanaimat
Tags: facebook for woocommerce, meta, facebook catalog, instagram shopping, sync
Requires at least: 6.5
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 1.0.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Meta for WooCommerce (Facebook for WooCommerce) not syncing? One screen that tells you why and what to do.

== Description ==

Meta for WooCommerce fails quietly. The catalog stops updating, products vanish from Facebook and Instagram, or the plugin switches itself off after a crash and says so only in a small notice on the Plugins screen.

The answer is usually already on your site, spread across places a store owner never looks: the plugin's settings, its crash record, the product feed file, the background job queue and the WooCommerce logs. This plugin reads all of them and puts the answer on one screen, under **Tools > Meta Sync Doctor**.

= What it checks =

* **Store and plugin:** Meta for WooCommerce installed and running (and why not, if it will not activate), whether it has **switched itself off after repeated crashes** and for how long, WooCommerce version, "Coming soon" mode, HTTPS, outgoing requests to Meta blocked in wp-config.php.
* **Connection:** connected to Meta, the Business Manager it is connected to, Meta rejecting the store's connection in the last 24 hours, no product catalog linked, no pixel set, the plugin's own connection test failing.
* **Product feed and background jobs:** product sync switched off, the feed file missing, stale or empty, Meta's background jobs overdue or failing and why.
* **Products:** products switched off for Facebook sync one by one, and products kept out by excluded categories or tags.
* **Pixel:** another plugin sending Meta pixel events too, which counts every sale twice.
* **Recent errors:** what Meta for WooCommerce logged in the last 7 days, grouped, with a plain-language fix for known errors.
* **Connection tests (on demand):** whether the server can reach Meta right now, whether Meta still accepts the store's connection, and whether the REST API is open.

A summary also appears in **Tools > Site Health**.

= Two buttons, nothing else =

* **Switch it back on** removes Meta for WooCommerce's crash flag, exactly as its own "Re-enable plugin" link does, after you have dealt with the cause.
* **Rebuild the feed now** queues Meta for WooCommerce's own feed job instead of waiting for the daily run.

Nothing else is ever changed. It contacts no outside service unless an administrator presses "Run connection tests" (see External services below).

It is not affiliated with Meta, Facebook or WooCommerce.

== External services ==

This plugin contacts Meta only when an administrator presses the "Run connection tests" button on its screen. Nothing is sent on page load, on a schedule, or from the front end of the site.

**Meta (graph.facebook.com and www.facebook.com)**, run by Meta Platforms, Inc. Meta for WooCommerce sends your products and events to these addresses, so the test checks the store can reach them.
* Reachability: one HTTPS request to each address's front page, sending the server's IP address and WordPress's standard user agent, which includes your site's address.
* Connection check: only if Meta for WooCommerce is connected, one request to https://graph.facebook.com/me asking for the id of the store's own access token. It sends the access token Meta for WooCommerce already stores, and nothing else. The token is sent only to graph.facebook.com and is never shown or stored by this plugin. No store, product or customer data is sent.
Terms of service: https://www.facebook.com/terms.php - Platform terms: https://developers.facebook.com/terms/ - Privacy policy: https://www.facebook.com/privacy/policy/

== Installation ==

1. Install and activate the plugin.
2. Open **Tools > Meta Sync Doctor**.

== Frequently Asked Questions ==

= Does it fix the problems itself? =

It tells you exactly what is wrong and where to fix it. The fixes are made in Meta for WooCommerce, Commerce Manager or your hosting, where they belong. The two buttons above are the only changes it can make, and only when you press them.

= Does it work when Meta for WooCommerce has switched itself off? =

Yes. That is one of the main problems it diagnoses. It reads the crash record directly, so it works while Meta for WooCommerce is not loading.

= Why are there no errors listed? =

Meta for WooCommerce writes most errors to the WooCommerce log only when its debug mode or its "Meta diagnosis" setting is on. The screen tells you when both are off. Crashes go to the server's PHP error log instead.

= Which versions of Meta for WooCommerce does it support? =

It was verified against Meta for WooCommerce 3.7. With a newer version installed, the screen says so, because a newer release may store some data differently.

= Does it slow down my site? =

No. It does nothing on the front end. The checks run only when you open its screen.

== Screenshots ==

1. The diagnosis: what is blocking the sync and how to fix it.
2. Meta for WooCommerce switched off after crashes, with the button to switch it back on.
3. Background jobs, recent errors and connection tests.

== Changelog ==

= 1.0.0 =

* First release.
