403Webshell
Server IP : 188.151.22.197  /  Your IP : 216.73.217.74
Web Server : Apache/2.4.62 (Rocky Linux) OpenSSL/3.5.5
System : Linux wsten.se 5.14.0-687.30.1.el9_8.x86_64 #1 SMP PREEMPT_DYNAMIC Mon Jul 27 13:09:21 UTC 2026 x86_64
User : apache ( 48)
PHP Version : 8.1.32
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /home/eric/vhost/wsten/wp-content/plugins/elementor-pro/modules/atomic-form/actions/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /home/eric/vhost/wsten/wp-content/plugins/elementor-pro/modules/atomic-form/actions/action-base.php
<?php
namespace ElementorPro\Modules\AtomicForm\Actions;

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

abstract class Action_Base {

	/**
	 * Get the action type identifier.
	 *
	 * @return string Action type (e.g., 'email', 'webhook', 'collect-submissions')
	 */
	abstract public function get_type(): string;

	/**
	 * Execute the action with the provided form data and widget settings.
	 *
	 * @param array $form_data Sanitized form data submitted by the user.
	 *                         Example: ['name' => 'John', 'email' => 'john@example.com']
	 * @param array $widget_settings Full widget settings - action extracts what it needs.
	 *                               Example: ['email_to' => 'admin@site.com', 'email_subject' => 'New form', ...]
	 * @param array $context Additional context (post_id, form_id, form_name).
	 *                       Example: ['post_id' => 123, 'form_id' => 'contact', 'form_name' => 'Contact Form']
	 * @return array Result array with 'status' and optional data.
	 *               Success: ['status' => 'success', 'message' => '...', ...]
	 *               Failure: ['status' => 'failed', 'error' => '...', ...]
	 */
	abstract public function execute( array $form_data, array $widget_settings, array $context ): array;

	/**
	 * Validate widget settings for this action.
	 *
	 * @param array $widget_settings Widget settings to validate.
	 * @return bool|\WP_Error True if valid, WP_Error otherwise.
	 */
	protected function validate_settings( array $widget_settings ) {
		return true;
	}

	/**
	 * Format a success result.
	 *
	 * @param string $message Success message.
	 * @param array $additional_data Additional data to include.
	 * @return array
	 */
	protected function success( string $message, array $additional_data = [] ): array {
		return array_merge(
			[
				'status' => 'success',
				'message' => $message,
			],
			$additional_data
		);
	}

	/**
	 * Format a failure result.
	 *
	 * @param string $error Error message.
	 * @param array $additional_data Additional data to include.
	 * @return array
	 */
	protected function failure( string $error, array $additional_data = [] ): array {
		return array_merge(
			[
				'status' => 'failed',
				'error' => $error,
			],
			$additional_data
		);
	}
}

Youez - 2016 - github.com/yon3zu
LinuXploit