| Server IP : 104.26.2.156 / Your IP : 216.73.216.185 Web Server : nginx/1.27.1 System : Linux us-1 5.15.0-131-generic #141-Ubuntu SMP Fri Jan 10 21:18:28 UTC 2025 x86_64 User : vinodai ( 3134) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system,proc_open,popen,parse_ini_file,show_source MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /storage/v1396/themastermynd/public_html/wp-content/plugins/optinmonster/OMAPI/ |
Upload File : |
<?php
/**
* Ajax class.
*
* @since 1.0.0
*
* @package OMAPI
* @author Thomas Griffin
*/
// Exit if accessed directly.
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
/**
* Ajax class.
*
* @since 1.0.0
*/
class OMAPI_Ajax {
/**
* Holds the class object.
*
* @since 1.0.0
*
* @var object
*/
public static $instance;
/**
* Path to the file.
*
* @since 1.0.0
*
* @var string
*/
public $file = __FILE__;
/**
* Holds the base class object.
*
* @since 1.0.0
*
* @var object
*/
public $base;
/**
* Primary class constructor.
*
* @since 1.0.0
*/
public function __construct() {
// Set our object.
$this->set();
// Load non-WordPress style ajax requests.
// phpcs:ignore Generic.Commenting.Todo.TaskFound
// TODO move all of this to RestApi, and use rest api for these requests!
add_action( 'init', array( $this, 'ajax' ), 999 );
}
/**
* Sets our object instance and base class instance.
*
* @since 1.0.0
*/
public function set() {
self::$instance = $this;
$this->base = OMAPI::get_instance();
}
/**
* Callback to process external ajax requests.
*
* @since 1.0.0
*/
public function ajax() {
if (
! isset( $_REQUEST['action'] )
|| empty( $_REQUEST['optin-monster-ajax-route'] )
) {
return;
}
check_ajax_referer( 'omapi', 'nonce' );
switch ( $_REQUEST['action'] ) {
case 'mailpoet':
$this->base->mailpoet->handle_ajax_call();
break;
default:
break;
}
}
}