GRAYBYTE WORDPRESS FILE MANAGER9835

Server IP : 198.54.121.189 / Your IP : 216.73.216.140
System : Linux premium69.web-hosting.com 4.18.0-553.44.1.lve.el8.x86_64 #1 SMP Thu Mar 13 14:29:12 UTC 2025 x86_64
PHP Version : 7.4.33
Disable Function : NONE
cURL : ON | WGET : ON | Sudo : OFF | Pkexec : OFF
Directory : /home/giriqfky/trustyourlawyer.com/wp-content/plugins/ninja-forms/includes/
Upload Files :
Current_dir [ Writeable ] Document_root [ Writeable ]

Command :


Current File : /home/giriqfky/trustyourlawyer.com/wp-content/plugins/ninja-forms/includes//PromotionManager.php
<?php if ( ! defined( 'ABSPATH' ) ) exit;

class NF_PromotionManager
{
	public $promotions;

	/**
	 * Accepts a string of location to tell let us know where in the app we are sending promotions to.
	 * Then will return an array of promotions to run in the location.
	 */
	public function __construct()
	{
		$this->set_promotions();
		$this->maybe_remove_personal();
		$this->maybe_remove_sendwp();
		$this->sort_active_promotions_by_locations();
	}

	public function get_promotions()
	{
		return $this->promotions;
	}

	/**
	 * Set our promtions array to our promotions property.
	 */
	private function set_promotions()
	{
		if ( apply_filters( 'ninja_forms_disable_marketing', false ) )
		{
			$this->promotions = array();
		} else {
			$this->promotions = Ninja_Forms()->config( 'DashboardPromotions' );
		}
	}

	/*
	 * Membership Checks
	 *
	 * These funcitons all check to see if the individual add-ons that make up
	 * our personal membership are active.
	*/
	private function is_layout_styles_active()
	{
		return class_exists( 'NF_Layouts', false );
	}

	private function is_conditional_logic_active()
	{
		return class_exists( 'NF_ConditionalLogic', false );
	}

	private function is_multi_part_active()
	{
		return class_exists( 'NF_MultiPart', false );
	}

	private function is_file_uploads_active()
	{
		return class_exists( 'NF_FU_File_Uploads', false );
	}

	/**
	 * Utilizes the helper methods above to determine if a
	 * a Membership is active on a site.
	 */
	private function is_personal_active()
	{
		if (
			$this->is_conditional_logic_active() &&
			$this->is_file_uploads_active() &&
			$this->is_layout_styles_active() &&
			$this->is_multi_part_active()
		) {
				return true;
		}
		return false;
	}

	/**************************************************************************
	 * Promotion Removal Methods
	 *
	 * These funcitons all check for different add-ons/products and remove
	 * promotions for them if they are in use.
	****************************************************************************/
	private function maybe_remove_sendwp()
	{
		if ( phpversion() < '5.6.0' ) {
			$this->remove_promotion( 'sendwp' );

			return;
		} if ( $this->is_sendwp_active() ) {
			$this->remove_promotion( 'sendwp' );
		} elseif ( $this->is_ninja_mail_active() ) {
			$this->remove_promotion( 'sendwp' );
		}
	}

	private function maybe_remove_personal()
	{
		if ( $this->is_personal_active() ) {
			$this->remove_promotion( 'personal' );
		}
	}

	/***************************************************************************
	 * Helper Methods
	****************************************************************************/
	/**
	 * Pass in a promotion type to have it removed from
	 * the list of active promotions.
	 *
	 * @return void
	 */
	private function remove_promotion( $type )
	{
		// Loops over promotions and removes unused types of promotions.
		foreach ( $this->promotions as $promotion ) {
			if ( $type == $promotion[ 'type' ] ) {
				unset( $this->promotions[ $promotion[ 'id' ] ] );
			}
		}
	}

	/**
	 * Sorts our promotions by where they will appear in app.
	 *
	 * @return void
	 */
	private function sort_active_promotions_by_locations()
	{
		$sorted_locations = array();

		foreach ( $this->promotions as $promotion ) {
			$sorted_locations[ $promotion[ 'location' ] ][] = $promotion;
		}

		$this->promotions = $sorted_locations;
	}

	private function is_sendwp_active()
	{
		if ( class_exists( '\SendWP\Mailer', FALSE ) ) {
			return true;
		}

		return false;
	}

	private function is_ninja_mail_active()
	{
		if ( class_exists('\NinjaMail\Plugin', FALSE ) ) {
			return true;
		}

		return false;
	}
}

[ Back ]
Name
Size
Last Modified
Owner / Group
Permissions
Options
..
--
July 10 2025 04:32:23
giriqfky / giriqfky
0755
AJAX
--
July 10 2025 04:32:23
giriqfky / giriqfky
0755
Abstracts
--
July 10 2025 04:32:23
giriqfky / giriqfky
0755
Actions
--
July 10 2025 04:32:23
giriqfky / giriqfky
0755
Adapters
--
July 10 2025 04:32:23
giriqfky / giriqfky
0755
Admin
--
July 10 2025 04:32:23
giriqfky / giriqfky
0755
Config
--
July 10 2025 04:32:23
giriqfky / giriqfky
0755
Contracts
--
July 10 2025 04:32:23
giriqfky / giriqfky
0755
Database
--
July 10 2025 04:32:23
giriqfky / giriqfky
0755
Display
--
July 10 2025 04:32:23
giriqfky / giriqfky
0755
Entities
--
July 10 2025 04:32:23
giriqfky / giriqfky
0755
Exports
--
July 10 2025 04:32:23
giriqfky / giriqfky
0755
Factories
--
July 10 2025 04:32:23
giriqfky / giriqfky
0755
Fields
--
July 10 2025 04:32:23
giriqfky / giriqfky
0755
Handlers
--
July 10 2025 04:32:23
giriqfky / giriqfky
0755
Integrations
--
July 10 2025 04:32:23
giriqfky / giriqfky
0755
Interfaces
--
July 10 2025 04:32:23
giriqfky / giriqfky
0755
Libraries
--
July 10 2025 04:32:23
giriqfky / giriqfky
0755
MergeTags
--
July 10 2025 04:32:23
giriqfky / giriqfky
0755
Routes
--
July 10 2025 04:32:23
giriqfky / giriqfky
0755
Telemetry
--
July 10 2025 04:32:23
giriqfky / giriqfky
0755
Templates
--
July 10 2025 04:32:23
giriqfky / giriqfky
0755
Traits
--
July 10 2025 04:32:23
giriqfky / giriqfky
0755
Updates
--
July 10 2025 04:32:23
giriqfky / giriqfky
0755
WPCLI
--
July 10 2025 04:32:23
giriqfky / giriqfky
0755
.htaccess
0.41 KB
July 10 2025 04:32:23
giriqfky / giriqfky
0644
Dispatcher.php
3.377 KB
November 18 2024 20:55:28
giriqfky / giriqfky
0644
Helper.php
21.698 KB
April 24 2025 22:30:30
giriqfky / giriqfky
0644
PromotionManager.php
3.562 KB
August 30 2022 18:49:42
giriqfky / giriqfky
0644
Session.php
4.055 KB
August 01 2017 22:43:48
giriqfky / giriqfky
0644
Widget.php
3.635 KB
December 10 2024 20:32:36
giriqfky / giriqfky
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2025
CONTACT ME
Static GIF