GRAYBYTE WORDPRESS FILE MANAGER1909

Server IP : 162.213.255.40 / Your IP : 216.73.216.119
System : Linux server146.web-hosting.com 4.18.0-513.18.1.lve.el8.x86_64 #1 SMP Thu Feb 22 12:55:50 UTC 2024 x86_64
PHP Version : 8.0.30
Disable Function : NONE
cURL : ON | WGET : ON | Sudo : OFF | Pkexec : OFF

HOME

/home/hellrfbn/public_html/wp-content/plugins/optinmonster/OMAPI/
Upload Files :
Current_dir [ Writeable ] Document_root [ Writeable ]

Command :


Current File : /home/hellrfbn/public_html/wp-content/plugins/optinmonster/OMAPI//Widget.php
<?php
/**
 * Widget class.
 *
 * @since 1.0.0
 *
 * @package OMAPI
 * @author  Thomas Griffin
 */

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

/**
 * Widget class.
 *
 * @since 1.0.0
 */
class OMAPI_Widget extends WP_Widget {

	/**
	 * 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;

	/**
	 * Constructor. Sets up and creates the widget with appropriate settings.
	 *
	 * @since 1.0.0
	 */
	public function __construct() {

		// Load the base class object.
		$this->base = OMAPI::get_instance();

		$widget_ops = apply_filters(
			'optin_monster_api_widget_ops',
			array(
				'classname'   => 'optin-monster-api',
				'description' => esc_html__( 'Place an OptinMonster campaign into a widgetized area.', 'optin-monster-api' ),
			)
		);

		$control_ops = apply_filters(
			'optin_monster_api_widget_control_ops',
			array(
				'id_base' => 'optin-monster-api',
				'height'  => 350,
				'width'   => 225,
			)
		);

		parent::__construct(
			'optin-monster-api',
			apply_filters( 'optin_monster_api_widget_name', esc_html__( 'OptinMonster', 'optin-monster-api' ) ),
			$widget_ops,
			$control_ops
		);

	}

	/**
	 * Outputs the widget within the widgetized area.
	 *
	 * @since 1.0.0
	 *
	 * @param array $args     The default widget arguments.
	 * @param array $instance The input settings for the current widget instance.
	 *
	 * @return void
	 */
	public function widget( $args, $instance ) {

		$title    = apply_filters( 'widget_title', isset( $instance['title'] ) ? $instance['title'] : '' );
		$optin_id = isset( $instance['optin_monster_id'] ) ? $instance['optin_monster_id'] : 0;

		do_action( 'optin_monster_api_widget_before_output', $args, $instance );

		echo $args['before_widget'];

		do_action( 'optin_monster_api_widget_before_title', $args, $instance );

		// If a title exists, output it.
		if ( $title ) {
			echo $args['before_title'] . $title . $args['after_title'];
		}

		do_action( 'optin_monster_api_widget_before_optin', $args, $instance );

		// If a optin has been selected, output it.
		if ( $optin_id ) {
			// Grab the optin object. If it does not exist, return early.
			$optin = absint( $optin_id ) ? $this->base->get_optin( $optin_id ) : $this->base->get_optin_by_slug( $optin_id );
			if ( ! $optin ) {
				return;
			}

			// If in test mode but not logged in, skip over the optin.
			$test = (bool) get_post_meta( $optin->ID, '_omapi_test', true );
			if ( $test && ! is_user_logged_in() ) {
				return;
			}

			// Load the optin.
			optin_monster(
				$optin->ID,
				'id',
				array(
					'followrules' => ! empty( $instance['followrules'] ) ? 'true' : 'false',
				)
			);
		}

		do_action( 'optin_monster_api_widget_after_optin', $args, $instance );

		echo $args['after_widget'];

		do_action( 'optin_monster_api_widget_after_output', $args, $instance );

	}

	/**
	 * Sanitizes and updates the widget.
	 *
	 * @since 1.0.0
	 *
	 * @param array $new_instance The new input settings for the current widget instance.
	 * @param array $old_instance The old input settings for the current widget instance.
	 *
	 * @return array
	 */
	public function update( $new_instance, $old_instance ) {

		// Set $instance to the old instance in case no new settings have been updated for a particular field.
		$instance = $old_instance;

		// Sanitize user inputs.
		$instance['title']            = trim( $new_instance['title'] );
		$instance['followrules']      = ! empty( $new_instance['followrules'] );
		$instance['optin_monster_id'] = absint( $new_instance['optin_monster_id'] );

		return apply_filters( 'optin_monster_api_widget_update_instance', $instance, $new_instance );

	}

	/**
	 * Outputs the widget form where the user can specify settings.
	 *
	 * @since 1.0.0
	 *
	 * @param array $instance The input settings for the current widget instance.
	 *
	 * @return void
	 */
	public function form( $instance ) {

		// Get all available optins and widget properties.
		$optins      = $this->base->get_optins();
		$title       = isset( $instance['title'] ) ? $instance['title'] : '';
		$followrules = ! empty( $instance['followrules'] );
		$optin_id    = isset( $instance['optin_monster_id'] ) ? $instance['optin_monster_id'] : false;

		do_action( 'optin_monster_api_widget_before_form', $instance );
		?>
		<p>
			<label for="<?php echo esc_attr( $this->get_field_id( 'title' ) ); ?>"><?php esc_html_e( 'Title', 'optin-monster-api' ); ?></label>
			<input id="<?php echo esc_attr( $this->get_field_id( 'title' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'title' ) ); ?>" type="text" value="<?php echo esc_attr( $title ); ?>" style="width: 100%;" />
		</p>
		<?php do_action( 'optin_monster_api_widget_middle_form', $instance ); ?>
		<p>
			<label for="<?php echo esc_attr( $this->get_field_id( 'optin_monster_id' ) ); ?>"><?php esc_html_e( 'Campaign', 'optin-monster-api' ); ?></label>
			<select id="<?php echo esc_attr( $this->get_field_id( 'optin_monster_id' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'optin_monster_id' ) ); ?>" style="width: 100%;">
				<?php if ( ! empty( $optins ) ) {
					foreach ( $optins as $optin ) {
						$type    = get_post_meta( $optin->ID, '_omapi_type', true );
						$enabled = (bool) get_post_meta( $optin->ID, '_omapi_enabled', true );

						// Only allow sidebar types.
						if ( 'sidebar' !== $type && 'inline' !== $type ) {
							continue;
						}

						// Display disabled or enabled selection.
						if ( $enabled ) {
							echo '<option value="' . esc_attr( $optin->ID ) . '"' . selected( $optin->ID, $optin_id, false ) . '>' . esc_html( $optin->post_title ) . '</option>';
						} else {
							echo '<option value="' . esc_attr( $optin->ID ) . '" disabled="disabled"' . selected( $optin->ID, $optin_id, false ) . '>' . esc_html( $optin->post_title ) . ' (' . esc_html__( 'Not Enabled', 'optin-monster-api' ) . ')</option>';
						}
					}
				}
				?>
			</select>
		</p>
		<p>
			<input id="<?php echo esc_attr( $this->get_field_id( 'followrules' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'followrules' ) ); ?>" type="checkbox" value="1" <?php checked( $followrules ); ?> />
			<label for="<?php echo esc_attr( $this->get_field_id( 'followrules' ) ); ?>"><?php esc_html_e( 'Apply Advanced Output Settings?', 'optin-monster-api' ); ?></label>
		</p>
		<?php

		do_action( 'optin_monster_api_widget_after_form', $instance );

	}

}

[ Back ]
Name
Size
Last Modified
Owner / Group
Permissions
Options
..
--
July 23 2025 07:38:29
hellrfbn / hellrfbn
0755
EasyDigitalDownloads
--
July 23 2025 07:38:29
hellrfbn / hellrfbn
0755
Elementor
--
July 23 2025 07:38:29
hellrfbn / hellrfbn
0755
Integrations
--
July 23 2025 07:38:29
hellrfbn / hellrfbn
0755
MemberPress
--
July 23 2025 07:38:29
hellrfbn / hellrfbn
0755
Plugins
--
July 23 2025 07:38:29
hellrfbn / hellrfbn
0755
Promos
--
July 23 2025 07:38:29
hellrfbn / hellrfbn
0755
Rules
--
July 23 2025 07:38:29
hellrfbn / hellrfbn
0755
Shortcodes
--
July 23 2025 07:38:29
hellrfbn / hellrfbn
0755
WPForms
--
July 23 2025 07:38:29
hellrfbn / hellrfbn
0755
WooCommerce
--
July 23 2025 07:38:29
hellrfbn / hellrfbn
0755
.htaccess
0.41 KB
July 23 2025 07:38:29
hellrfbn / hellrfbn
0644
Actions.php
7.003 KB
February 05 2025 15:45:15
hellrfbn / hellrfbn
0644
Ajax.php
1.459 KB
February 05 2025 15:45:15
hellrfbn / hellrfbn
0644
Api.php
14.168 KB
February 05 2025 15:45:15
hellrfbn / hellrfbn
0644
ApiAuth.php
2.405 KB
February 05 2025 15:45:15
hellrfbn / hellrfbn
0644
ApiKey.php
5.083 KB
February 05 2025 15:45:15
hellrfbn / hellrfbn
0644
AssetLoader.php
5.587 KB
February 05 2025 15:45:15
hellrfbn / hellrfbn
0644
BaseRestApi.php
6.647 KB
February 05 2025 15:45:15
hellrfbn / hellrfbn
0644
Blocks.php
12.7 KB
February 05 2025 15:45:15
hellrfbn / hellrfbn
0644
ClassicEditor.php
6.919 KB
February 05 2025 15:45:15
hellrfbn / hellrfbn
0644
ConstantContact.php
7.424 KB
February 05 2025 15:45:15
hellrfbn / hellrfbn
0644
Debug.php
4.349 KB
February 05 2025 15:45:15
hellrfbn / hellrfbn
0644
EasyDigitalDownloads.php
9.329 KB
February 05 2025 15:45:15
hellrfbn / hellrfbn
0644
Elementor.php
5.364 KB
February 05 2025 15:45:15
hellrfbn / hellrfbn
0644
Inserter.php
11.291 KB
February 05 2025 15:45:15
hellrfbn / hellrfbn
0644
InstallSkin.php
1.354 KB
February 05 2025 15:45:15
hellrfbn / hellrfbn
0644
InstallSkinCompat.php
1.362 KB
February 05 2025 15:45:15
hellrfbn / hellrfbn
0644
MailPoet.php
13.359 KB
February 05 2025 15:45:15
hellrfbn / hellrfbn
0644
MemberPress.php
4.117 KB
February 05 2025 15:45:15
hellrfbn / hellrfbn
0644
Menu.php
15.417 KB
February 05 2025 15:45:15
hellrfbn / hellrfbn
0644
Notifications.php
18.467 KB
February 05 2025 15:45:15
hellrfbn / hellrfbn
0644
OmuApi.php
4.025 KB
February 05 2025 15:45:15
hellrfbn / hellrfbn
0644
Output.php
24.277 KB
February 05 2025 15:45:15
hellrfbn / hellrfbn
0644
Pages.php
16.645 KB
February 05 2025 15:45:15
hellrfbn / hellrfbn
0644
Partners.php
4.692 KB
February 05 2025 15:45:15
hellrfbn / hellrfbn
0644
Plugins.php
24.339 KB
February 05 2025 15:45:15
hellrfbn / hellrfbn
0644
Promos.php
1.105 KB
February 05 2025 15:45:15
hellrfbn / hellrfbn
0644
Refresh.php
5.55 KB
February 05 2025 15:45:15
hellrfbn / hellrfbn
0644
RestApi.php
38.58 KB
February 05 2025 15:45:15
hellrfbn / hellrfbn
0644
RevenueAttribution.php
2.966 KB
February 05 2025 15:45:15
hellrfbn / hellrfbn
0644
Review.php
1.447 KB
February 05 2025 15:45:15
hellrfbn / hellrfbn
0644
Rules.php
23.44 KB
February 05 2025 15:45:15
hellrfbn / hellrfbn
0644
Save.php
10.798 KB
February 05 2025 15:45:15
hellrfbn / hellrfbn
0644
Shortcode.php
3.582 KB
February 05 2025 15:45:15
hellrfbn / hellrfbn
0644
Sites.php
8.354 KB
February 05 2025 15:45:15
hellrfbn / hellrfbn
0644
Support.php
8.248 KB
February 05 2025 15:45:15
hellrfbn / hellrfbn
0644
Type.php
2.438 KB
February 05 2025 15:45:15
hellrfbn / hellrfbn
0644
Urls.php
8.785 KB
February 05 2025 15:45:15
hellrfbn / hellrfbn
0644
Utils.php
5.198 KB
February 05 2025 15:45:15
hellrfbn / hellrfbn
0644
Validate.php
9.063 KB
February 05 2025 15:45:15
hellrfbn / hellrfbn
0644
WPForms.php
2.604 KB
February 05 2025 15:45:15
hellrfbn / hellrfbn
0644
Widget.php
6.496 KB
February 05 2025 15:45:15
hellrfbn / hellrfbn
0644
WooCommerce.php
19.576 KB
February 05 2025 15:45:15
hellrfbn / hellrfbn
0644
WpErrorException.php
0.697 KB
February 05 2025 15:45:15
hellrfbn / hellrfbn
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2025
CONTACT ME
Static GIF