403Webshell
Server IP : 87.98.154.146  /  Your IP : 216.73.216.165
Web Server : Apache
System : Linux webm004.cluster126.gra.hosting.ovh.net 6.18.42-ovh-vps-grsec-zfs+ #1 SMP PREEMPT_DYNAMIC Wed Aug 5 15:59:48 CEST 2026 x86_64
User : ohklomafyi ( 52085)
PHP Version : 7.4.33
Disable Function : _dyuweyrj4,_dyuweyrj4r,dl
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /home/ohklomafyi/www/wp-content/plugins/shortpixel-image-optimiser/class/Model/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /home/ohklomafyi/www/wp-content/plugins/shortpixel-image-optimiser/class/Model/AdminNoticeModel.php
<?php
namespace ShortPixel\Model;

if ( ! defined( 'ABSPATH' ) ) {
 exit; // Exit if accessed directly.
}

use ShortPixel\ShortPixelLogger\ShortPixelLogger as Log;
use ShortPixel\Notices\NoticeController as Notice;
use ShortPixel\Notices\NoticeController as Notices;


abstract class AdminNoticeModel
{
	 protected $key; // abstract
	 protected $notice;

	 protected $errorLevel = 'normal';
	 protected $suppress_delay = YEAR_IN_SECONDS;
	 protected $callback;

	 protected $include_screens = array();
	 protected $exclude_screens = array();

	 protected $data;


   abstract protected function checkTrigger();
   abstract protected function getMessage();

	 // No stuff loading here, low init
	 public function __construct()
	 {

	 }

	 // The main init, ty.
	 public function load()
	 {
		 $noticeController = Notices::getInstance();
		 $notice = $noticeController->getNoticeByID($this->key);

		 if (is_object($notice))
		 {
		 	$this->notice = $notice;
		 }

		 if (is_object($notice) && $notice->isDismissed())
		 {
			 return false;
		 }

		 if (is_null($this->notice) && $this->checkTrigger() === true)
		 {
			  $this->add();
		 }
		 elseif ( is_object($this->notice) && $this->checkReset() === true)
		 {
			  $this->reset();
		 }
	 }

	 public function getKey()
	 {
		  return $this->key;
	 }

	 public function reset($key = null)
	 {
		  $key = (is_null($key)) ? $this->key : $key;
		 	Notices::removeNoticeByID($key);
	 }

	 protected function checkReset()
	 {
		  return false;
	 }

	 // For when trigger condition is not applicable.
	 public function addManual($args = array())
	 {
		  foreach($args as $key => $val)
			{
				 $this->addData($key, $val);
			}
		 	$this->add();
	 }

	 public function getNoticeObj()
	 {
		  return $this->notice;  // can be null!
	 }

	 // Proxy for noticeModel dismissed
	 public function isDismissed()
	 {
		 	$notice = $this->getNoticeObj();
			if (is_null($notice) || $notice->isDismissed() === false)
				return false;

			return true;
	 }


	 protected function add()
	 {

		 switch ($this->errorLevel)
		 {
			 case 'warning':
			 	$notice = Notices::addWarning($this->getMessage());
			 break;
			 case 'normal';
			 default:
			 	$notice = Notices::addNormal($this->getMessage());

			 break;
		 }

		 /// Todo implement include / exclude screens here.
		 if (count($this->exclude_screens) > 0)
		 {
			 $notice->limitScreens('exclude', $this->exclude_screens);
		 }

		 if (count($this->include_screens) > 0)
		 {
			 $notice->limitScreens('include', $this->include_screens);
		 }

		 if (! is_null($this->callback))
		 	Notices::makePersistent($notice, $this->key, $this->suppress_delay, $this->callback);
		 else
		 	Notices::makePersistent($notice, $this->key, $this->suppress_delay);

		 $this->notice = $notice;
	 }

	 protected function addData($name, $value)
	 {
		  $this->data[$name] = $value;
	 }

	 protected function getData($name)
	 {
		  	if (isset($this->data[$name]))
				{
					 return $this->data[$name];
				}
				return false;
	 }



}

Youez - 2016 - github.com/yon3zu
LinuXploit