文件操作 - Subscriber.php
返回文件管理
返回主菜单
删除本文件
文件: /storage/v12552/stanleysteamer/public_html/wp-content/plugins/imagify/classes/Tools/Subscriber.php
编辑文件内容
<?php declare(strict_types=1); namespace Imagify\Tools; use Imagify\EventManagement\SubscriberInterface; /** * Registers the AJAX action for the one-click internal-state reset. */ class Subscriber implements SubscriberInterface { /** * ResetInternalState service. * * @var ResetInternalState */ private $reset; /** * Constructor. * * @param ResetInternalState $reset ResetInternalState service. */ public function __construct( ResetInternalState $reset ) { $this->reset = $reset; } /** * Returns the events this subscriber listens to. * * Note: the settings-section template is rendered directly via print_template() * in page-settings.php — no imagify_settings_tools hook is registered here. * * @return array */ public static function get_subscribed_events(): array { return [ // @action 'wp_ajax_imagify_reset_internal_state' => 'reset_internal_state', ]; } /** * Handles the AJAX request to reset Imagify internal state. * * Verifies the nonce and capability before delegating to ResetInternalState. * * @return void */ public function reset_internal_state(): void { imagify_check_nonce( 'imagify_reset_internal_state' ); if ( ! imagify_get_context( 'wp' )->current_user_can( 'manage' ) ) { imagify_die(); return; } $this->reset->reset(); wp_send_json_success( [ 'message' => __( 'Imagify internal state has been reset successfully.', 'imagify' ) ] ); } }
修改文件时间
将文件时间修改为当前时间的前一年
删除文件