Hi @zarausto,
Thanks for the feedback! The New Relic image in your last reply seems to be regarding a different scheduled action, the wc_facebook_regenerate_feed
rather than wc_facebook_background_product_sync_cron_interval
, is that right?
In the previous versions of the plugin, we had to remove API access to sync products due to a security issue with token access. The only way that products were synced was to generate a feed file that Facebook would request from the site on a schedule, once per hour. In order to guarantee that the information synced was most up to date, we had to regenerate the feed file on a schedule too, every 15 minutes.
With the API access now restored in our latest versions, this has become less important though still useful for a few edge-cases. Ultimately I hope we can move away from this in the future though, and it’s something our product and development team are already looking into.
That said, if this is causing a significant impact on your customer’s sites, it is possible to adjust the interval that the feed file is regenerated.
/**
* Filters the frequency with which the product feed data is generated.
*
* @since 1.11.0
*
* @param int $interval the frequency with which the product feed data is generated, in seconds. Defaults to every 15 minutes.
*/
$interval = apply_filters( 'wc_facebook_feed_generation_interval', MINUTE_IN_SECONDS * 15 );
You would first need to disable product syncing to remove the existing schedule. Then insert the custom code adjusting the returned interval from above, then re-enable product syncing for the new interval to be used.
Thanks again for taking the time to leave ar review, and I hope we can look at this closer in the future! In the meantime, I hope this might prove useful for your customer’s sites.
Cheers,
Simon.