| Server IP : 216.238.66.20 / Your IP : 216.73.216.149 Web Server : nginx/1.30.4 System : Linux woropds 5.15.0-187-generic #197-Ubuntu SMP Fri Jul 17 19:17:01 UTC 2026 x86_64 User : root ( 0) PHP Version : 8.2.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /var/www/sweetheart.mx/htdocs/wp-content/plugins/backwpup/src/Admin/Rating/ |
Upload File : |
<?php
declare(strict_types=1);
namespace WPMedia\BackWPup\Admin\Rating;
/**
* Handles admin-post actions for the rating notice.
*/
class RatingActions {
/**
* Dismiss duration for the close icon.
*/
private const DISMISS_DAYS = 30;
/**
* RatingNoticeDecider instance.
*
* @var RatingNoticeDecider
*/
private RatingNoticeDecider $decider;
/**
* RatingEvents instance.
*
* @var RatingEvents
*/
private RatingEvents $events;
/**
* RatingNoticeDecider instance.
*
* @param RatingNoticeDecider $decider RatingNoticeDecider instance.
* @param RatingEvents $events RatingEvents instance.
*/
public function __construct( RatingNoticeDecider $decider, RatingEvents $events ) {
$this->decider = $decider;
$this->events = $events;
}
/**
* Dismiss notice for a period of time.
*/
public function dismiss(): void {
check_admin_referer( 'backwpup_rating_notice_dismiss' );
$this->decider->dismiss_until( get_current_user_id(), time() + ( self::DISMISS_DAYS * DAY_IN_SECONDS ) );
$this->events->do_tracking( RatingEvents::TRIGGER_DISMISSED );
wp_safe_redirect( wp_get_referer() ?: admin_url() );
exit;
}
/**
* Remind notice for a period of time (30 days).
*/
public function remind(): void {
check_admin_referer( 'backwpup_rating_notice_remind' );
$this->decider->remind_later( (int) get_current_user_id(), time() + ( self::DISMISS_DAYS * DAY_IN_SECONDS ) );
$this->events->do_tracking( RatingEvents::TRIGGER_REMIND_LATER );
wp_safe_redirect( wp_get_referer() ?: admin_url() );
exit;
}
}