File: /home4/cca63905/public_html/nueva/modules/pmproductvideoreviews/controllers/front/cron.php
<?php
/**
* rec.reviews
*
* @author Presta-Module.com <support@presta-module.com> - https://www.presta-module.com
* @copyright Presta-Module - https://www.presta-module.com
* @license see file: LICENSE.txt
*
* ____ __ __
* | _ \ | \/ |
* | |_) | | |\/| |
* | __/ | | | |
* |_| |_| |_|
*/
if (!defined('_PS_VERSION_')) {
exit;
}
use PrestaModule\ProductVideoReviews\Utils;
class pmproductvideoreviewsCronModuleFrontController extends ModuleFrontController
{
/**
* Cron method (sync reviews)
*
* @return void
*/
public function init()
{
if (!Tools::getIsset('pvr_token') || Tools::getValue('pvr_token') != Configuration::get('PVR_CRON_TOKEN')) {
Tools::redirect('404');
}
if (ob_get_length() > 0) {
ob_clean();
}
header('X-Robots-Tag: noindex, nofollow', true);
header('Content-type: application/json');
Utils::reviewSync();
die(json_encode([
'result' => true,
'message' => $this->module->l('The reviews have been successfully updated.', 'cron'),
]));
}
}