403Webshell
Server IP : 43.130.17.34  /  Your IP : 216.73.217.6
Web Server : nginx/1.28.0
System : Linux VM-4-12-opencloudos 6.6.92-34.1.oc9.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Jun 25 21:32:13 CST 2025 x86_64
User : www ( 1000)
PHP Version : 8.0.26
Disable Function : passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv
MySQL : OFF  |  cURL : ON  |  WGET : OFF  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /www/wwwroot/yespkg.com/wp-content/plugins/mail-manager-wpforms/includes/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /www/wwwroot/yespkg.com/wp-content/plugins/mail-manager-wpforms/includes/class-action.php
<?php
/**
 * Handles the action functionality of the plugin.
 *
 * @link       https://mmw.diviaccessories.com/
 * @since      1.0.0
 *
 * @package    mail-manager-wpforms
 * @subpackage mail-manager-wpforms/action
 */

namespace MMWPF\Frontend;

/**
 * Handles the plugin's action functionality.
 *
 * Specifies the plugin name, version, and provides examples for
 * enqueueing public/admin-facing stylesheets and JavaScript files.
 *
 * @since      1.0.0
 * @author     nishanmazumder<arosh019@gmail.com>
 */
class Action {

	use \MMWPF\TRT\Trait_Manager;

	/**
	 * The ID of this plugin.
	 *
	 * @since    1.0.0
	 * @access   private
	 * @var      string    $plugin_name    The ID of this plugin.
	 */
	private $plugin_name;

	/**
	 * The version of this plugin.
	 *
	 * @since    1.0.0
	 * @access   private
	 * @var      string    $version    The current version of this plugin.
	 */
	private $version;

	/**
	 * Initializes the class and sets its properties.
	 *
	 * @since    1.0.0
	 */
	public function __construct() {

		$this->plugin_name = MMWPF_NAME;
		$this->version     = MMWPF_VERSION;
	}

	/**
	 * Registers JavaScript and stylesheets for the admin section of the site.
	 *
	 * @since    1.0.0
	 */
	public function enqueue_admin_resources() {
		/**
		 * This function serves as a demonstration.
		 *
		 * An instance of this class should be passed to the kick_mmwpf() function
		 * in Loader, where all hooks are defined.
		 *
		 * Loader will then link the defined hooks
		 * with the functions in this class.
		 */

		wp_enqueue_style( $this->plugin_name . '-src-admin', MMWPF_URL . 'assets/admin/css/admin.css', array(), $this->version, 'all' );
		wp_enqueue_script( $this->plugin_name . '-src-admin', MMWPF_URL . 'assets/admin/js/admin.js', array( 'jquery' ), $this->version, false );

		wp_localize_script(
			$this->plugin_name . '-src-admin',
			'mmwpf_ajax_obj',
			array(
				'ajax_url' => admin_url( 'admin-ajax.php' ),
				'nonce'    => wp_create_nonce( 'mmwpf_nonce' ),
			)
		);
	}

	/**
	 * Registers JavaScript and stylesheets for the public-facing side of the site.
	 *
	 * @since    1.0.0
	 */
	public function enqueue_public_resources() {
		/**
		 * This function is solely for demonstration purposes.
		 *
		 * An instance of this class should be passed to the kick_mmwpf() function
		 * in Loader, where all hooks are defined.
		 *
		 * Loader will then establish the relationship
		 * between the defined hooks and the functions in this class.
		 */

		wp_enqueue_style( $this->plugin_name . '-src-public', MMWPF_URL . 'assets/public/css/public.css', array(), $this->version, 'all' );
		wp_enqueue_script( $this->plugin_name . '-src-public', MMWPF_URL . 'assets/public/js/public.js', array( 'jquery' ), $this->version, false );
	}

	/**
	 * Registers build JavaScript and stylesheets for the public/admin side of the site.
	 *
	 * @since    1.0.0
	 *
	 * @param array $admin_page Current page.
	 */
	public function enqueue_build_resources( $admin_page ) {

		if ( 'mail-manager_page_mail-manager-wpf-settings' !== $admin_page ) {
			return;
		}

		wp_enqueue_style( 'wp-components' );
		$asset_file = MMWPF_PATH . 'build/index.asset.php';

		if ( ! file_exists( $asset_file ) ) {
			return;
		}

		$asset = include $asset_file;

		wp_enqueue_style(
			$this->plugin_name . '-build-css',
			MMWPF_URL . 'build/index.css',
			array_filter(
				$asset['dependencies'],
				function ( $style ) {
					return wp_style_is( $style, 'registered' );
				}
			),
			$asset['version']
		);

		wp_enqueue_script(
			$this->plugin_name . '-build-script',
			MMWPF_URL . 'build/index.js',
			$asset['dependencies'],
			$asset['version'],
			array(
				'in_footer' => true,
			)
		);
	}

	/**
	 * Add default settings.
	 *
	 * @since    1.0.0
	 */
	public function add_default_settings() {
		// temporary setting for string only.
		return array(
			'mmwpf_string' => array(
				'mmwpf_disabled_link_color' => '#3e3e3e',
				'mmwpf_table_hf_bg'         => '#000',
				'mmwpf_export_wrapper_bg'   => '#000',
				'mmwpf_export_btn_bg'       => '#fff',
				'mmwpf_export_btn_color'    => '#000',
				'mmwpf_table_hf_font_color' => '#fff',
				'mmwpf_action_btn_bg'       => '#000',
				'mmwpf_action_btn_color'    => '#fff',
				'mmwpf_trash_btn_bg'        => '#b32d2e',
				'mmwpf_trash_btn_color'     => '#fff',
				'mmwpf_status_read_bg'      => '#ccffd4',
				'mmwpf_status_unread_bg'    => '#f7ddef',
				'mmwpf_unsave_entry_color'  => '#aaa',
				'mmwpf_save_entry_color'    => '#b32d2e',
				'mmwpf_back_to_entry_bg'    => '#000',
				'mmwpf_back_to_entry_color' => '#fff',
			),
			'mmwpf_array'  => array(
				'mmwpf_form_list' => array(),
			),
		);
	}

	/**
	 * Register admin settings.
	 *
	 * @since    1.0.0
	 */
	public function register_mmwpf_admin_settings() {

		$default_values = array();
		$default_schema = array();

		$get_default_value = apply_filters( 'mmwpf_default_settings', array() );

		$default_values = array_merge( $get_default_value['mmwpf_string'], $default_values );
		$default_values = array_merge( $get_default_value['mmwpf_array'], $default_values );

		// schema string value.
		foreach ( array_keys( $get_default_value['mmwpf_string'] ) as $key ) {
			$default_schema[ $key ] = array(
				'type' => 'string',
			);
		}

		// schema array value.
		$default_schema['mmwpf_form_list'] = array(
			'type' => 'array',
		);

		register_setting(
			'options',
			'mmwpf_get_admin_style_settings',
			array(
				'type'              => 'object',
				'default'           => $default_values,
				'show_in_rest'      => array(
					'schema' => array(
						'type'       => 'object',
						'properties' => $default_schema,
					),
				),
				'sanitize_callback' => array( $this, 'mmwpf_sanitize_admin_style_settings' ),
			)
		);
	}

	/**
	 * Sanitize settings.
	 *
	 * @since    1.0.0
	 *
	 * @param array $input All fields.
	 */
	public function mmwpf_sanitize_admin_style_settings( $input ) {

		$sanitized_input = array();

		if ( is_array( $input ) ) {
			foreach ( $input as $key => $value ) {
				if ( is_array( $value ) ) { // for array value.
					foreach ( $value as $k => $v ) {
						$sanitized_input[ $key ][ $k ] = sanitize_text_field( $v );
					}
				} else { // temp solution.
					$sanitized_input[ $key ] = sanitize_hex_color( $value );
				}
			}
		}

		return $sanitized_input;
	}


	/**
	 * Apply style to css variable.
	 *
	 * @since    1.0.0
	 */
	public function apply_admin_css_var() {
		$default_value_string = apply_filters( 'mmwpf_default_settings', array() );
		$default_value_string = array_merge_recursive( ...array_values( $default_value_string ) );

		$options = get_option( 'mmwpf_get_admin_style_settings', $default_value_string );
		
		wp_enqueue_style( $this->plugin_name . '-admin-variable-style', MMWPF_URL . 'assets/admin/css/inline-dynamic.css', array(), $this->version, 'all' );

		$css_variables = array(
			'mmwpf_disabled_link_color' => '--mmwpf-disabled-link-color',
			'mmwpf_table_hf_bg'         => '--mmwpf-table-hf-bg',
			'mmwpf_export_wrapper_bg'   => '--mmwpf-export-wrapper-bg',
			'mmwpf_export_btn_bg'       => '--mmwpf-export-btn-bg',
			'mmwpf_export_btn_color'    => '--mmwpf-export-btn-color',
			'mmwpf_table_hf_font_color' => '--mmwpf-table-hf-font-color',
			'mmwpf_action_btn_bg'       => '--mmwpf-action-btn-bg',
			'mmwpf_action_btn_color'    => '--mmwpf-action-btn-color',
			'mmwpf_trash_btn_bg'        => '--mmwpf-trash-btn-bg',
			'mmwpf_trash_btn_color'     => '--mmwpf-trash-btn-color',
			'mmwpf_status_read_bg'      => '--mmwpf-status-read-bg',
			'mmwpf_status_unread_bg'    => '--mmwpf-status-unread-bg',
			'mmwpf_unsave_entry_color'  => '--mmwpf-unsaved-entry-color',
			'mmwpf_save_entry_color'    => '--mmwpf-save-entry-color',
			'mmwpf_back_to_entry_bg'    => '--mmwpf-back-to-entry-bg',
			'mmwpf_back_to_entry_color' => '--mmwpf-back-to-entry-color',
		);

		$custom_css = ':root {';
		foreach ( $css_variables as $option_key => $css_var ) {
			if ( isset( $options[ $option_key ] ) && ! empty( $options[ $option_key ] ) ) {
				$sanitized_value = sanitize_hex_color( $options[ $option_key ] );

				if ( empty( $sanitized_value ) ) {
					$sanitized_value = $options[ $option_key ];
				}

				$custom_css .= $css_var . ': ' . esc_attr( $sanitized_value ) . ';';
			}
		}

		$custom_css .= '}';

		wp_add_inline_style( $this->plugin_name . '-admin-variable-style', $custom_css );
	}
}

Youez - 2016 - github.com/yon3zu
LinuXploit