HEX
Server: Apache/2.4.46 (Ubuntu)
System: Linux localhost 5.11.0-49-generic #55-Ubuntu SMP Wed Jan 12 17:36:34 UTC 2022 x86_64
User: root (0)
PHP: 7.4.16
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Upload Files
File: /var/www/html/wavecolordrop.com/wp-content/plugins/wps-team/includes/base/base-notification.php
<?php
namespace WPSpeedo_Team;

if ( ! defined('ABSPATH') ) exit;

abstract class Base_Notification {

    use Date_Methods;

    public $notifications = [];

    public function get_notification( $instance_key ) {
        if ( array_key_exists( $instance_key, $this->notifications ) ) {
            return $this->notifications[ $instance_key ];
        }
        return null;
    }

    public function get_notifications( $type = null ) {

        $notifications = $this->notifications;

        if ( $type ) {
            $notifications = wp_list_filter( $notifications, ['type' => $type] );
        }

        return $notifications;

    }

    public function get_active_notifications( $type = null ) {
        $notifications = wp_list_filter( $this->get_notifications( $type ), [ 'is_active' => true ] );
        return wp_list_sort( $notifications, 'next_exec_time' );
    }

    public function get_exec_notifications( $date = null, $type = null ) {

        if ( ! $date ) $date = $this->current_time();

        $notifications = $this->get_active_notifications( $type );

        $_notifications = [];

        foreach ( $notifications as $notification ) {

            if ( empty( $notification->next_exec_time ) ) continue;

            if ( $this->date_is_current_or_prev( $notification->next_exec_time, $date ) ) {
                $_notifications[] = $notification;
            }
            
        }

        return $_notifications;

    }

    public function get_upcoming_notifications( $date = null, $type = null ) {

        if ( ! $date ) $date = $this->current_time();

        $notifications = $this->get_active_notifications( $type );

        $_notifications = [];

        foreach ( $notifications as $notification ) {

            if ( empty( $notification->next_exec_time ) ) continue;

            if ( $this->date_is_next( $notification->next_exec_time, $date ) ) {
                $_notifications[] = $notification;
            }
            
        }

        return $_notifications;

    }

    public function register( $instance ) {
        if ( ! array_key_exists( $instance->get_id(), $this->notifications ) ) {
            $this->notifications[ $instance->get_id() ] = $instance;
        }
    }

    public function get( $id ) {
        if ( array_key_exists( $id, $this->notifications ) ) {
            return $this->notifications[ $id ];
        }
        return false;
    }

}