403Webshell
Server IP : 89.39.208.18  /  Your IP : 216.73.217.74
Web Server : LiteSpeed
System :
User :  ( )
PHP Version : 7.4.33
Disable Function : eval,./,ln,passthru,dl,system,exec,popen,shell_exec,posix_getpwuid,posix_uname,ftp_exec,posix_uname,posix_getpwuid,posix_kill,posix_mkfifo,posix_setpgid,posix_setsid,posix_setuid,get_current_user,getmyuid,getmygid,listen,chgrp,apache_note,apache_setenv,apache_child_terminate,closelog,debugger_off,debugge_on,ini_restore,netscript,escapeshellarg,cmd,backtick,virtual,show_sourc,show_source,pclose,pcntl_exec,datasec,old_offset,ctrl_dir,ini_alter,leak,listen,chgrp,apache_setenv,define_syslog_variables,root,diskfreespace,disk_free_space,disk_total_space,posix_kill,getmyuid,getmygid,apache_child_terminate,php_ini_scanned_files,ls,ps_aux,chown,getrusage,posixc,posame,chgrp,posix_setuid,posix_setsid,posix_setgid,apache_note,apache_setenv,x_getuid,e_ini_file,nfo,SQL,mysql_li,t_dbs,filegroup,highlight_file,ilegetcontents,get_dir,popen,popens,pfsockopen,dos_conv,apache_get_modules,crack_check,crack_closedict,rar_open,bzopen,bzread,bzwrite,shellcode,posix_isatty,posix_getservbyname,escapeshellarg,hypot,pg_host,pos,posix_access,inurl,posix_times,posix_mknod,pclose,ps_fill,symlink,id,escapeshellcmd,php_uname,phpinfo
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /home3/./mahyarcake/./www/wp-content/plugins/mailchimp-for-wp/includes/forms/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /home3/./mahyarcake/./www/wp-content/plugins/mailchimp-for-wp/includes/forms/class-form-manager.php
<?php

/**
 * This class takes care of all form related functionality
 *
 * Do not interact with this class directly, use `mc4wp_form` functions tagged with @access public instead.
 *
 * @class MC4WP_Form_Manager
 * @ignore
 * @access private
*/
class MC4WP_Form_Manager {


	/**
	 * @var MC4WP_Form_Output_Manager
	 */
	protected $output_manager;

	/**
	 * @var MC4WP_Form_Listener
	 */
	protected $listener;

	/**
	 * @var MC4WP_Form_Tags
	 */
	protected $tags;

	/**
	* @var MC4WP_Form_Previewer
	*/
	protected $previewer;

	/**
	 * @var MC4WP_Form_Asset_Manager
	 */
	protected $assets;

	/**
	 * @var MC4WP_Form_AMP
	 */
	protected $amp_compatibility;

	/**
	 * Constructor
	 */
	public function __construct() {
		$this->output_manager    = new MC4WP_Form_Output_Manager();
		$this->tags              = new MC4WP_Form_Tags();
		$this->listener          = new MC4WP_Form_Listener();
		$this->previewer         = new MC4WP_Form_Previewer();
		$this->assets            = new MC4WP_Form_Asset_Manager();
		$this->amp_compatibility = new MC4WP_Form_AMP();
	}

	/**
	 * Hook!
	 */
	public function add_hooks() {
		add_action( 'init', array( $this, 'initialize' ) );
		add_action( 'widgets_init', array( $this, 'register_widget' ) );
		add_action( 'rest_api_init', array( $this, 'register_endpoint' ) );

		$this->listener->add_hooks();
		$this->output_manager->add_hooks();
		$this->assets->add_hooks();
		$this->tags->add_hooks();
		$this->previewer->add_hooks();
		$this->amp_compatibility->add_hooks();
	}

	/**
	 * Initialize
	 */
	public function initialize() {
		$this->register_post_type();
		$this->register_block_type();
	}

	private function register_block_type() {
		// Bail if register_block_type does not exist (available since WP 5.0)
		if ( ! function_exists( 'register_block_type' ) ) {
			return;
		}

		register_block_type(
			'mailchimp-for-wp/form',
			array(
				'render_callback' => array( $this->output_manager, 'shortcode' ),
			)
		);
	}

	/**
	 * Register post type "mc4wp-form"
	 */
	private function register_post_type() {
		// register post type
		register_post_type(
			'mc4wp-form',
			array(
				'labels' => array(
					'name'          => 'Mailchimp Sign-up Forms',
					'singular_name' => 'Sign-up Form',
				),
				'public' => false,
			)
		);
	}

	/**
	 * Register our Form widget
	 */
	public function register_widget() {
		register_widget( 'MC4WP_Form_Widget' );
	}

	/**
	 * Register an API endpoint for handling a form.
	 */
	public function register_endpoint() {
		register_rest_route(
			'mc4wp/v1',
			'/form',
			array(
				'methods'  => 'POST',
				'permission_callback' => '__return_true',
				'callback' => array( $this, 'handle_endpoint' ),
			)
		);
	}

	/**
	 * Process requests to the form endpoint.
	 *
	 * A listener checks every request for a form submit, so we just need to fetch the listener and get its status.
	 */
	public function handle_endpoint() {
		$form = mc4wp_get_submitted_form();
		if ( ! $form instanceof MC4WP_Form ) {
			return new WP_Error(
				'not_found',
				esc_html__( 'Resource does not exist.', 'mailchimp-for-wp' ),
				array(
					'status' => 404,
				)
			);
		}

		if ( $form->has_errors() ) {
			$message_key = $form->errors[0];
			$message     = $form->get_message( $message_key );
			return new WP_Error(
				$message_key,
				$message,
				array(
				'status' => 400,
				)
			);
		}

		return new WP_REST_Response( true, 200 );
	}

	/**
	 * @param       $form_id
	 * @param array $config
	 * @param bool  $echo
	 *
	 * @return string
	 */
	public function output_form( $form_id, $config = array(), $echo = true ) {
		return $this->output_manager->output_form( $form_id, $config, $echo );
	}

	/**
	 * Gets the currently submitted form
	 *
	 * @return MC4WP_Form|null
	 */
	public function get_submitted_form() {
		if ( $this->listener->submitted_form instanceof MC4WP_Form ) {
			return $this->listener->submitted_form;
		}

		return null;
	}

	/**
	 * Return all tags
	 *
	 * @return array
	 */
	public function get_tags() {
		return $this->tags->all();
	}
}

Youez - 2016 - github.com/yon3zu
LinuXploit