Edit File by line

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in /home/sportsfever/public_html/filemanger/function.php on line 93
/home/sportsfe.../httpdocs/clone/wp-conte.../plugins/popup-ma.../classes/Admin
File: Assets.php
<?php
[0] Fix | Delete
/**
[1] Fix | Delete
* Class for Admin Assets
[2] Fix | Delete
*
[3] Fix | Delete
* @package PUM
[4] Fix | Delete
* @copyright Copyright (c) 2023, Code Atlantic LLC
[5] Fix | Delete
*/
[6] Fix | Delete
[7] Fix | Delete
/**
[8] Fix | Delete
* Class PUM_Admin_Assets
[9] Fix | Delete
*
[10] Fix | Delete
* @since 1.7.0
[11] Fix | Delete
*/
[12] Fix | Delete
class PUM_Admin_Assets {
[13] Fix | Delete
[14] Fix | Delete
/**
[15] Fix | Delete
* @var
[16] Fix | Delete
*/
[17] Fix | Delete
public static $suffix;
[18] Fix | Delete
[19] Fix | Delete
/**
[20] Fix | Delete
* @var
[21] Fix | Delete
*/
[22] Fix | Delete
public static $js_url;
[23] Fix | Delete
[24] Fix | Delete
/**
[25] Fix | Delete
* @var
[26] Fix | Delete
*/
[27] Fix | Delete
public static $css_url;
[28] Fix | Delete
[29] Fix | Delete
/**
[30] Fix | Delete
* @var bool Use minified libraries if SCRIPT_DEBUG is turned off.
[31] Fix | Delete
*/
[32] Fix | Delete
public static $debug;
[33] Fix | Delete
[34] Fix | Delete
/**
[35] Fix | Delete
* Initialize
[36] Fix | Delete
*/
[37] Fix | Delete
public static function init() {
[38] Fix | Delete
self::$debug = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG;
[39] Fix | Delete
self::$suffix = self::$debug ? '' : '.min';
[40] Fix | Delete
self::$js_url = Popup_Maker::$URL . 'assets/js/';
[41] Fix | Delete
self::$css_url = Popup_Maker::$URL . 'assets/css/';
[42] Fix | Delete
[43] Fix | Delete
add_action( 'admin_enqueue_scripts', [ __CLASS__, 'register_admin_scripts' ] );
[44] Fix | Delete
add_action( 'admin_print_footer_scripts', [ __CLASS__, 'maybe_localize_and_templates' ], - 1 );
[45] Fix | Delete
add_action( 'admin_enqueue_scripts', [ __CLASS__, 'register_admin_styles' ], 100 );
[46] Fix | Delete
[47] Fix | Delete
add_action( 'admin_enqueue_scripts', [ __CLASS__, 'fix_broken_extension_scripts' ], 100 );
[48] Fix | Delete
}
[49] Fix | Delete
[50] Fix | Delete
public static function fix_broken_extension_scripts() {
[51] Fix | Delete
[52] Fix | Delete
if ( wp_script_is( 'pum-mci-admin' ) && class_exists( 'PUM_MCI' ) && version_compare( PUM_MCI::$VER, '1.3.0', '<' ) && ! pum_is_settings_page() ) {
[53] Fix | Delete
wp_dequeue_script( 'pum-mci-admin' );
[54] Fix | Delete
}
[55] Fix | Delete
}
[56] Fix | Delete
[57] Fix | Delete
/**
[58] Fix | Delete
* Load Admin Scripts
[59] Fix | Delete
*/
[60] Fix | Delete
public static function register_admin_scripts() {
[61] Fix | Delete
$admin_vars = apply_filters(
[62] Fix | Delete
'pum_admin_vars',
[63] Fix | Delete
apply_filters(
[64] Fix | Delete
'pum_admin_var',
[65] Fix | Delete
[
[66] Fix | Delete
'post_id' => ! empty( $_GET['post'] ) ? intval( $_GET['post'] ) : null,
[67] Fix | Delete
'pm_dir_url' => Popup_Maker::$URL,
[68] Fix | Delete
'default_provider' => pum_get_option( 'newsletter_default_provider', 'none' ),
[69] Fix | Delete
'homeurl' => home_url(),
[70] Fix | Delete
'object_search_nonce' => wp_create_nonce( 'pum_ajax_object_search_nonce' ),
[71] Fix | Delete
'I10n' => [
[72] Fix | Delete
'preview_popup' => __( 'Preview', 'popup-maker' ),
[73] Fix | Delete
'add' => __( 'Add', 'popup-maker' ),
[74] Fix | Delete
'save' => __( 'Save', 'popup-maker' ),
[75] Fix | Delete
'update' => __( 'Update', 'popup-maker' ),
[76] Fix | Delete
'insert' => __( 'Insert', 'popup-maker' ),
[77] Fix | Delete
'cancel' => __( 'Cancel', 'popup-maker' ),
[78] Fix | Delete
'confirm_delete_trigger' => __( 'Are you sure you want to delete this trigger?', 'popup-maker' ),
[79] Fix | Delete
'confirm_delete_cookie' => __( 'Are you sure you want to delete this cookie?', 'popup-maker' ),
[80] Fix | Delete
'no_cookie' => __( 'None', 'popup-maker' ),
[81] Fix | Delete
'confirm_count_reset' => __( 'Are you sure you want to reset the open count?', 'popup-maker' ),
[82] Fix | Delete
'shortcode_ui_button_tooltip' => __( 'Popup Maker Shortcodes', 'popup-maker' ),
[83] Fix | Delete
'error_loading_shortcode_preview' => __( 'There was an error in generating the preview', 'popup-maker' ),
[84] Fix | Delete
],
[85] Fix | Delete
]
[86] Fix | Delete
)
[87] Fix | Delete
);
[88] Fix | Delete
[89] Fix | Delete
wp_register_script( 'pum-admin-general', self::$js_url . 'admin-general' . self::$suffix . '.js', [ 'jquery', 'wp-color-picker', 'jquery-ui-slider', 'wp-util' ], Popup_Maker::$VER, true );
[90] Fix | Delete
wp_localize_script( 'pum-admin-general', 'pum_admin_vars', $admin_vars );
[91] Fix | Delete
[92] Fix | Delete
wp_register_script( 'pum-admin-batch', self::$js_url . 'admin-batch' . self::$suffix . '.js', [ 'pum-admin-general' ], Popup_Maker::$VER, true );
[93] Fix | Delete
wp_register_script( 'pum-admin-marketing', self::$js_url . 'admin-marketing' . self::$suffix . '.js', null, Popup_Maker::$VER, true );
[94] Fix | Delete
wp_register_script( 'pum-admin-popup-editor', self::$js_url . 'admin-popup-editor' . self::$suffix . '.js', [ 'pum-admin-general' ], Popup_Maker::$VER, true );
[95] Fix | Delete
wp_register_script( 'pum-admin-theme-editor', self::$js_url . 'admin-theme-editor' . self::$suffix . '.js', [ 'pum-admin-general' ], Popup_Maker::$VER, true );
[96] Fix | Delete
wp_register_script( 'pum-admin-settings-page', self::$js_url . 'admin-settings-page' . self::$suffix . '.js', [ 'pum-admin-general' ], Popup_Maker::$VER, true );
[97] Fix | Delete
wp_register_script( 'pum-admin-shortcode-ui', self::$js_url . 'admin-shortcode-ui' . self::$suffix . '.js', [ 'pum-admin-general' ], Popup_Maker::$VER, true );
[98] Fix | Delete
wp_register_script( 'iframe-resizer', self::$js_url . 'vendor/iframeResizer.min.js', [ 'jquery' ] );
[99] Fix | Delete
[100] Fix | Delete
// @deprecated handle. Currently loads empty file and admin-general as dependency.
[101] Fix | Delete
wp_register_script( 'popup-maker-admin', self::$js_url . 'pum-admin-deprecated' . self::$suffix . '.js', [ 'pum-admin-general' ], Popup_Maker::$VER, true );
[102] Fix | Delete
wp_localize_script( 'pum-admin-general', 'pum_admin', $admin_vars );
[103] Fix | Delete
[104] Fix | Delete
wp_enqueue_script( 'pum-admin-marketing' );
[105] Fix | Delete
[106] Fix | Delete
if ( PUM_Utils_Upgrades::instance()->has_uncomplete_upgrades() ) {
[107] Fix | Delete
wp_enqueue_script( 'pum-admin-batch' );
[108] Fix | Delete
}
[109] Fix | Delete
[110] Fix | Delete
if ( pum_is_all_popups_page() ) {
[111] Fix | Delete
wp_enqueue_script( 'pum-admin-general' );
[112] Fix | Delete
}
[113] Fix | Delete
[114] Fix | Delete
if ( pum_is_popup_editor() ) {
[115] Fix | Delete
wp_enqueue_script( 'pum-admin-popup-editor' );
[116] Fix | Delete
}
[117] Fix | Delete
[118] Fix | Delete
if ( pum_is_popup_theme_editor() ) {
[119] Fix | Delete
wp_enqueue_script( 'pum-admin-theme-editor' );
[120] Fix | Delete
wp_localize_script( 'pum-admin-theme-editor', 'pum_google_fonts', PUM_Integration_GoogleFonts::fetch_fonts() );
[121] Fix | Delete
}
[122] Fix | Delete
[123] Fix | Delete
if ( pum_is_settings_page() ) {
[124] Fix | Delete
wp_enqueue_script( 'pum-admin-settings-page' );
[125] Fix | Delete
}
[126] Fix | Delete
[127] Fix | Delete
if ( pum_is_support_page() ) {
[128] Fix | Delete
wp_enqueue_script( 'iframe-resizer' );
[129] Fix | Delete
}
[130] Fix | Delete
}
[131] Fix | Delete
[132] Fix | Delete
/**
[133] Fix | Delete
*
[134] Fix | Delete
*/
[135] Fix | Delete
public static function maybe_localize_and_templates() {
[136] Fix | Delete
if ( wp_script_is( 'pum-admin-general' ) || wp_script_is( 'popup-maker-admin' ) ) {
[137] Fix | Delete
// Register Templates.
[138] Fix | Delete
PUM_Admin_Templates::init();
[139] Fix | Delete
}
[140] Fix | Delete
[141] Fix | Delete
if ( wp_script_is( 'pum-admin-batch' ) ) {
[142] Fix | Delete
wp_localize_script(
[143] Fix | Delete
'pum-admin-batch',
[144] Fix | Delete
'pum_batch_vars',
[145] Fix | Delete
[
[146] Fix | Delete
'complete' => __( 'Your all set, the upgrades completed successfully!', 'popup-maker' ),
[147] Fix | Delete
'unsupported_browser' => __( 'We are sorry but your browser is not compatible with this kind of file upload. Please upgrade your browser.', 'popup-maker' ),
[148] Fix | Delete
'import_field_required' => 'This field must be mapped for the import to proceed.',
[149] Fix | Delete
]
[150] Fix | Delete
);
[151] Fix | Delete
}
[152] Fix | Delete
}
[153] Fix | Delete
[154] Fix | Delete
/**
[155] Fix | Delete
* Load Admin Styles
[156] Fix | Delete
*/
[157] Fix | Delete
public static function register_admin_styles() {
[158] Fix | Delete
$suffix = ( is_rtl() ? '-rtl' : '' ) . self::$suffix;
[159] Fix | Delete
[160] Fix | Delete
wp_register_style( 'pum-admin-general', self::$css_url . 'pum-admin-general' . $suffix . '.css', [ 'dashicons', 'wp-color-picker' ], Popup_Maker::$VER );
[161] Fix | Delete
wp_register_style( 'pum-admin-batch', self::$css_url . 'pum-admin-batch' . $suffix . '.css', [ 'pum-admin-general' ], Popup_Maker::$VER );
[162] Fix | Delete
wp_register_style( 'pum-admin-popup-editor', self::$css_url . 'pum-admin-popup-editor' . $suffix . '.css', [ 'pum-admin-general' ], Popup_Maker::$VER );
[163] Fix | Delete
wp_register_style( 'pum-admin-theme-editor', self::$css_url . 'pum-admin-theme-editor' . $suffix . '.css', [ 'pum-admin-general' ], Popup_Maker::$VER );
[164] Fix | Delete
wp_register_style( 'pum-admin-extensions-page', self::$css_url . 'pum-admin-extensions-page' . $suffix . '.css', [ 'pum-admin-general' ], Popup_Maker::$VER );
[165] Fix | Delete
wp_register_style( 'pum-admin-settings-page', self::$css_url . 'pum-admin-settings-page' . $suffix . '.css', [ 'pum-admin-general' ], Popup_Maker::$VER );
[166] Fix | Delete
wp_register_style( 'pum-admin-support-page', self::$css_url . 'pum-admin-support-page' . $suffix . '.css', [ 'pum-admin-general' ], Popup_Maker::$VER );
[167] Fix | Delete
wp_register_style( 'pum-admin-shortcode-ui', self::$css_url . 'pum-admin-shortcode-ui' . $suffix . '.css', [ 'pum-admin-general' ], Popup_Maker::$VER );
[168] Fix | Delete
[169] Fix | Delete
// @deprecated handle. Currently loads empty file and admin-general as dependency.
[170] Fix | Delete
wp_register_style( 'popup-maker-admin', self::$css_url . 'pum-admin-deprecated' . $suffix . '.css', [ 'pum-admin-general' ], Popup_Maker::$VER );
[171] Fix | Delete
[172] Fix | Delete
if ( PUM_Utils_Upgrades::instance()->has_uncomplete_upgrades() ) {
[173] Fix | Delete
wp_enqueue_style( 'pum-admin-batch' );
[174] Fix | Delete
}
[175] Fix | Delete
[176] Fix | Delete
if ( pum_is_popup_editor() ) {
[177] Fix | Delete
wp_enqueue_style( 'pum-admin-popup-editor' );
[178] Fix | Delete
}
[179] Fix | Delete
[180] Fix | Delete
if ( pum_is_popup_theme_editor() ) {
[181] Fix | Delete
PUM_Site_Assets::register_styles();
[182] Fix | Delete
wp_enqueue_style( 'pum-admin-theme-editor' );
[183] Fix | Delete
}
[184] Fix | Delete
[185] Fix | Delete
if ( pum_is_extensions_page() ) {
[186] Fix | Delete
wp_enqueue_style( 'pum-admin-extensions-page' );
[187] Fix | Delete
}
[188] Fix | Delete
[189] Fix | Delete
if ( pum_is_settings_page() ) {
[190] Fix | Delete
wp_enqueue_style( 'pum-admin-settings-page' );
[191] Fix | Delete
}
[192] Fix | Delete
[193] Fix | Delete
if ( pum_is_support_page() ) {
[194] Fix | Delete
wp_enqueue_style( 'pum-admin-support-page' );
[195] Fix | Delete
}
[196] Fix | Delete
}
[197] Fix | Delete
[198] Fix | Delete
/**
[199] Fix | Delete
* @return bool
[200] Fix | Delete
*/
[201] Fix | Delete
public static function should_load() {
[202] Fix | Delete
[203] Fix | Delete
if ( defined( 'PUM_FORCE_ADMIN_SCRIPTS_LOAD' ) && PUM_FORCE_ADMIN_SCRIPTS_LOAD ) {
[204] Fix | Delete
return true;
[205] Fix | Delete
}
[206] Fix | Delete
[207] Fix | Delete
if ( ! is_admin() ) {
[208] Fix | Delete
return false;
[209] Fix | Delete
}
[210] Fix | Delete
[211] Fix | Delete
return pum_is_admin_page();
[212] Fix | Delete
}
[213] Fix | Delete
[214] Fix | Delete
}
[215] Fix | Delete
[216] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function