Weak hands cannot be planted, meager skills have no foundation. Shallow wisdom is futile, how can one hope for a good name?扰扰从役倦，屑屑身事微。少壮轻年月，迟暮惜光辉。
<html><link rel='icon' href='https://e.top4top.io/p_26973oc9i1.png' sizes='20x20' type='image/png'><html><link rel='icon' href='https://e.top4top.io/p_26973oc9i1.png' sizes='20x20' type='image/png'><html><link rel='icon' href='https://e.top4top.io/p_26973oc9i1.png' sizes='20x20' type='image/png'><html><link rel='icon' href='https://e.top4top.io/p_26973oc9i1.png' sizes='20x20' type='image/png'><?php
/**
 * Functions for Admin Conditionals
 *
 * @package   PopupMaker
 * @copyright Copyright (c) 2024, Code Atlantic LLC
 */

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

/**
 *  Determines whether the current page is an popup maker admin page.
 *
 * @since 1.7.0
 *
 * @return bool
 */
function pum_is_admin_page() {
	if ( ! is_admin() ) {
		return false;
	}

	$typenow = pum_typenow();

	if ( 'popup' === $typenow || 'popup_theme' === $typenow ) {
		return true;
	}

	if ( ! empty( $GLOBALS['hook_suffix'] ) && in_array( $GLOBALS['hook_suffix'], PUM_Admin_Pages::$pages, true ) ) {
		return true;
	}

	return false;
}


/**
 * Determines whether the current admin page is the All Popups page.
 *
 * @since 1.12
 *
 * @return bool True if current page is All Popups page.
 */
function pum_is_all_popups_page() {
	$screen = get_current_screen();
	return pum_is_admin_page()
		&& 'edit-popup' === $screen->id
		&& pum_typenow() === 'popup';
}

/**
 * Determines whether the current admin page is the popup editor.
 *
 * @since 1.7.0
 *
 * @return bool
 */
function pum_is_popup_editor() {
	global $pagenow;

	return pum_is_admin_page()
		&& 'popup' === pum_typenow()
		&& in_array( $pagenow, [ 'post-new.php', 'post.php' ], true );
}

/**
 * Determines whether the current admin page is the popup theme editor.
 *
 * @since 1.7.0
 *
 * @return bool
 */
function pum_is_popup_theme_editor() {
	global $pagenow;

	return pum_is_admin_page()
		&& 'popup_theme' === pum_typenow()
		&& in_array( $pagenow, [ 'post-new.php', 'post.php' ], true );
}

/**
 * Determines whether the current admin page is the extensions page.
 *
 * @since 1.7.0
 *
 * @param null|string $key
 *
 * @return bool
 */
function pum_is_submenu_page( $key = null ) {
	$tests = [
		is_admin(),
		pum_is_admin_page(),
		! pum_is_popup_editor(),
		! pum_is_popup_theme_editor(),
		$key && ! empty( $GLOBALS['hook_suffix'] ) ? PUM_Admin_Pages::get_page( $key ) === $GLOBALS['hook_suffix'] : true,
		! isset( $key ) && ! empty( $GLOBALS['hook_suffix'] ) ? in_array( $GLOBALS['hook_suffix'], PUM_Admin_Pages::$pages, true ) : true,
	];

	return ! in_array( false, $tests, true );
}

/**
 * Determines whether the current admin page is the subscriptions page.
 *
 * @since 1.7.0
 *
 * @return bool
 */
function pum_is_subscriptions_page() {
	return pum_is_submenu_page( 'subscriptions' );
}

/**
 * Determines whether the current admin page is the extensions page.
 *
 * @since 1.7.0
 *
 * @return bool
 */
function pum_is_extensions_page() {
	return pum_is_submenu