GRAYBYTE WORDPRESS FILE MANAGER2372

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/image-optimization/classes/
Upload Files :
Current_dir [ Writeable ] Document_root [ Writeable ]

Command :


Current File : /home/giriqfky/trustyourlawyer.com/wp-content/plugins/image-optimization/classes//utils.php
<?php

namespace ImageOptimization\Classes;

use ImageOptimization\Classes\Client\Client;
use ImageOptimization\Plugin;

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

class Utils {
	/**
	 * get_elementor
	 * @param $instance
	 *
	 * @return \Elementor\Plugin|false|mixed|null
	 */
	public static function get_elementor( $instance = false ) {
		static $_instance = null;
		if ( false !== $instance ) {
			$_instance = $instance;

			return $instance;
		}
		if ( null !== $_instance ) {
			return $_instance;
		}
		if ( class_exists( 'Elementor\Plugin' ) ) {
			return \Elementor\Plugin::instance(); // @codeCoverageIgnore
		}

		return false;
	}

	public static function get_api_client(): ?Client {
		return Client::get_instance();
	}

	public static function get_module( $module_name = '' ) {
		return Plugin::instance()->modules_manager->get_modules( $module_name );
	}

	public static function get_module_component( $module_name, $component ) {
		$module = self::get_module( $module_name );
		if ( $module ) {
			return $module->get_component( $component );
		}
		return null;
	}

	/**
	 * is_elementor_installed
	 * @return bool
	 */
	public static function is_elementor_installed(): bool {
		$plugins = get_plugins();
		return isset( $plugins['elementor/elementor.php'] );
	}

	/**
	 * is_elementor_installed_and_active
	 * should be used only after `plugins_loaded` action
	 * @return bool
	 */
	public static function is_elementor_installed_and_active(): bool {
		return did_action( 'elementor/loaded' );
	}

	public static function is_media_page(): bool {
		$current_screen = get_current_screen();

		if ( ! $current_screen ) {
			return false;
		}

		return 'upload' === $current_screen->id && 'attachment' === $current_screen->post_type;
	}

	public static function is_media_upload_page(): bool {
		$current_screen = get_current_screen();

		if ( ! $current_screen ) {
			return false;
		}

		return 'media' === $current_screen->id && 'add' === $current_screen->action;
	}

	public static function is_single_attachment_page(): bool {
		$current_screen = get_current_screen();

		if ( ! $current_screen ) {
			return false;
		}

		return 'attachment' === $current_screen->id && 'post' === $current_screen->base;
	}

	public static function is_plugin_page(): bool {
		$current_screen = get_current_screen();

		return str_contains( $current_screen->id, 'image-optimization-' );
	}

	public static function is_plugin_settings_page(): bool {
		$current_screen = get_current_screen();

		return str_contains( $current_screen->id, 'image-optimization-settings' );
	}

	public static function is_bulk_optimization_page(): bool {
		$current_screen = get_current_screen();

		return str_contains( $current_screen->id, 'image-optimization-bulk-optimization' );
	}

	public static function user_is_admin(): bool {
		return current_user_can( 'manage_options' );
	}

	public static function is_wp_dashboard_page(): bool {
		$current_screen = get_current_screen();

		return str_contains( $current_screen->id, 'dashboard' );
	}

	public static function is_wp_updates_page(): bool {
		$current_screen = get_current_screen();

		return str_contains( $current_screen->id, 'update' );
	}
}

[ Back ]
Name
Size
Last Modified
Owner / Group
Permissions
Options
..
--
July 10 2025 04:32:21
giriqfky / giriqfky
0755
async-operation
--
July 10 2025 04:32:21
giriqfky / giriqfky
0755
client
--
July 10 2025 04:32:21
giriqfky / giriqfky
0755
exceptions
--
July 10 2025 04:32:21
giriqfky / giriqfky
0755
file-system
--
July 10 2025 04:32:21
giriqfky / giriqfky
0755
image
--
July 10 2025 04:32:21
giriqfky / giriqfky
0755
migration
--
July 10 2025 04:32:21
giriqfky / giriqfky
0755
rest
--
July 10 2025 04:32:21
giriqfky / giriqfky
0755
.htaccess
0.41 KB
July 10 2025 04:32:21
giriqfky / giriqfky
0644
basic-enum.php
0.683 KB
February 06 2024 19:05:42
giriqfky / giriqfky
0644
file-utils.php
2.531 KB
February 06 2024 19:05:42
giriqfky / giriqfky
0644
locale.php
0.563 KB
February 06 2024 19:05:42
giriqfky / giriqfky
0644
logger.php
0.856 KB
February 06 2024 19:05:42
giriqfky / giriqfky
0644
module-base.php
7.1 KB
March 05 2024 17:32:40
giriqfky / giriqfky
0644
route.php
11.064 KB
February 06 2024 19:05:42
giriqfky / giriqfky
0644
utils.php
3.132 KB
October 01 2024 15:04:24
giriqfky / giriqfky
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2025
CONTACT ME
Static GIF