In the PrestaShop ecosystem, the concept of "health check" has become a central method for ensuring the stability, connectivity, and proper functioning of critical modules, particularly those that integrate with external platforms. Understanding the role of the health check and the necessity of access to external APIs is essential to guarantee the success of the integration of modules such as Facebook and Google into a PrestaShop store.
Definition and role of the health check in PrestaShop.
A healthcheck is a feature exposed by a PrestaShop module that allows for remote verification of the technical health status of the module and its dependencies. This verification can be triggered either by automated tools or by support teams, without requiring direct access to the store's back office.
The healthcheck serves several purposes:
- To confirm that the module is properly installed and active (otherwise, an HTTP error 404 or 500 is returned).
- Check the compatibility with the version of PrestaShop, the module, PHP, and the presence of necessary dependencies.
- Test the validity of the authentication tokens or the OAuth connections required for integration with third-party services.
- Ensure that the technical connectors (such as cURL or fopen) are enabled on the server.
- Verify the connectivity to the external APIs essential for the operation of the module (for example, the endpoints of Facebook, PrestaShop Accounts, CloudSync, etc.).
- Return a structured diagnosis, facilitating the rapid identification of bottlenecks or errors during integration or technical support.
An example of a healthcheck response for a PrestaShop module may resemble the following:
{
"prestashop_version": "1.7.8.7",
"ps_facebook_version": "x.y.z",
"php_version": "7.4.33",
"oauthApiConnectivity": true,
"facebookApiConnectivity": true,
"cloudsyncApiConnectivity": true,
"fopenActive": true,
"curlActive": true,
"shopLinked": true,
"is_valid_jwt": true,
"env": {
"facebookApiUrl": "<https://graph.facebook.com>",
"cloudsyncApiUrl": "<https://eventbus-sync.psessentials.net>"
}
}
This report allows for the anticipation or diagnosis of integration, authentication, or catalog synchronization issues.
Concrete examples of checks performed by the healthcheck.
-
Facebook API Connectivity: call test on
https://graph.facebook.comto verify the availability of the service and the validity of the access tokens. -
CloudSync/EventBus Connectivity: test on
https://eventbus-sync.psessentials.netto ensure that the catalog data can be transmitted and synchronized. -
PrestaShop Accounts Connectivity: verification of the possibility to refresh or obtain a valid OAuth token via
https://accounts-api.distribution.prestashop.net/. - Activation of the necessary PHP modules (cURL, fopen, etc.): to ensure that the server can perform outgoing HTTP requests.
- Verification of versions and dependencies: to ensure that the module operates in a compatible environment.
The health check of a PrestaShop module is an essential component to ensure the reliability of the integration between the store and third-party services. It allows for both anticipating problems, accelerating support, and ensuring the technical compliance of the store. To effectively fulfill its mission, the health check must be able to access critical external APIs (Facebook, Google, PrestaShop Accounts, CloudSync/EventBus) without restriction. Any network or firewall restrictions preventing this access will lead to major malfunctions and difficulties in assistance, rendering the merchant and customer experience unsatisfactory.