: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
'disable_shortcode_ui' => [
'label' => __( 'Disable the Popup Maker shortcode button', 'popup-maker' ),
'label' => __( 'Disable Popup Maker occasionally showing random tips to improve your popups.', 'popup-maker' ),
'label' => __( 'Disable Popup Maker occasionally showing community notices such as security alerts, new features or sales on our extensions.', 'popup-maker' ),
'complete_uninstall' => [
'label' => __( 'Delete all Popup Maker data on deactivation', 'popup-maker' ),
'desc' => __( 'Check this to completely uninstall Popup Maker.', 'popup-maker' ),
'disable_google_font_loading' => [
'label' => __( "Don't Load Google Fonts", 'popup-maker' ),
'desc' => __( 'Check this disable loading of google fonts, useful if the fonts you chose are already loaded with your theme.', 'popup-maker' ),
'disable_popup_maker_core_styles' => [
'label' => __( 'Don\'t load Popup Maker core stylesheet.', 'popup-maker' ),
'desc' => __( 'Check this if you have copied the Popup Maker core styles to your own stylesheet or are using custom styles.', 'popup-maker' ),
'disable_popup_theme_styles' => [
'label' => __( 'Don\'t load popup theme styles to the head.', 'popup-maker' ),
'desc' => __( 'Check this if you have copied the popup theme styles to your own stylesheet or are using custom styles.', 'popup-maker' ),
'id' => 'output_pum_styles',
'content' => self::field_pum_styles(),
$fields = apply_filters( 'pum_settings_fields', $fields );
$fields = PUM_Admin_Helpers::parse_tab_fields(
'name' => 'pum_settings[%s]',
public static function field_pum_styles() {
$core_styles = file_get_contents( Popup_Maker::$DIR . 'assets/css/pum-site' . ( is_rtl() ? '-rtl' : '' ) . PUM_Site_Assets::$suffix . '.css' );
$user_styles = PUM_AssetCache::generate_font_imports() . PUM_AssetCache::generate_popup_theme_styles() . PUM_AssetCache::generate_popup_styles();
<button type="button" id="show_pum_styles" onclick="jQuery('#pum_style_output').slideDown();jQuery(this).hide();"><?php _e( 'Show Popup Maker CSS', 'popup-maker' ); ?></button>
<p class="pum-desc desc"><?php __( "Use this to quickly copy Popup Maker's CSS to your own stylesheet.", 'popup-maker' ); ?></p>
<div id="pum_style_output" style="display:none;">
<label for="pum_core_styles"><?php _e( 'Core Styles', 'popup-maker' ); ?></label> <br />
<textarea id="pum_core_styles" wrap="off" style="white-space: pre; width: 100%;" readonly="readonly"><?php echo $core_styles; ?></textarea>
<label for="pum_generated_styles"><?php _e( 'Generated Popup & Popup Theme Styles', 'popup-maker' ); ?></label> <br />
<textarea id="pum_generated_styles" wrap="off" style="white-space: pre; width: 100%; min-height: 200px;" readonly="readonly"><?php echo $user_styles; ?></textarea>
public static function user_role_options() {
foreach ( $wp_roles->roles as $role => $labels ) {
$options[ $role ] = $labels['name'];
* Render settings page with tabs.
public static function page() {
$settings = PUM_Utils_Options::get_all();
if ( empty( $settings ) ) {
$settings = self::defaults();
<form id="pum-settings" method="post" action="">
<?php wp_nonce_field( basename( __FILE__ ), 'pum_settings_nonce' ); ?>
<h1><?php _e( 'Popup Maker Settings', 'popup-maker' ); ?></h1>
<div id="pum-settings-container" class="pum-settings-container">
<div class="pum-no-js" style="padding: 0 12px;">
<p><?php printf( __( 'If you are seeing this, the page is still loading or there are Javascript errors on this page. %1$sView troubleshooting guide%2$s', 'popup-maker' ), '<a href="https://docs.wppopupmaker.com/article/373-checking-for-javascript-errors" target="_blank">', '</a>' ); ?></p>
<script type="text/javascript">
window.pum_settings_editor =
echo PUM_Utils_Array::safe_json_encode(
'pum_settings_editor_args',
'sections' => self::sections(),
'fields' => self::fields(),
'active_tab' => self::get_active_tab(),
'active_section' => self::get_active_section(),
'current_values' => self::parse_values( $settings ),
<button class="button-primary bottom" style="margin-left: 156px;"><?php _e( 'Save', 'popup-maker' ); ?></button>
public static function defaults() {
foreach ( $tabs as $section_id => $fields ) {
foreach ( $fields as $key => $field ) {
$defaults[ $key ] = isset( $field['std'] ) ? $field['std'] : null;
* List of tabs & labels for the settings panel.
public static function tabs() {
if ( ! isset( $tabs ) ) {
'general' => __( 'General', 'popup-maker' ),
'subscriptions' => __( 'Subscriptions', 'popup-maker' ),
'extensions' => __( 'Extensions', 'popup-maker' ),
'licenses' => __( 'Licenses', 'popup-maker' ),
'privacy' => __( 'Privacy', 'popup-maker' ),
'misc' => __( 'Misc', 'popup-maker' ),
$tabs = apply_filters( 'popmake_settings_tabs', $tabs );
* List of tabs & labels for the settings panel.
public static function sections() {
'pum_settings_tab_sections',
'main' => __( 'General', 'popup-maker' ),
'main' => __( 'General', 'popup-maker' ),
'main' => __( 'Extension Settings', 'popup-maker' ),
'main' => __( 'Licenses', 'popup-maker' ),
'main' => __( 'General', 'popup-maker' ),
'forms' => __( 'Subscription Forms', 'popup-maker' ),
'main' => __( 'Misc', 'popup-maker' ),
'assets' => __( 'Assets', 'popup-maker' ),
* @return int|null|string
public static function get_active_tab() {
return isset( $_GET['tab'] ) && array_key_exists( $_GET['tab'], $tabs ) ? sanitize_text_field( $_GET['tab'] ) : key( $tabs );
* @return bool|int|null|string
public static function get_active_section() {
$active_tab = self::get_active_tab();
$sections = self::sections();
$tab_sections = ! empty( $sections[ $active_tab ] ) ? $sections[ $active_tab ] : false;
return isset( $_GET['section'] ) && array_key_exists( $_GET['section'], $tab_sections ) ? sanitize_text_field( $_GET['section'] ) : key( $tab_sections );
* Parse values for form rendering.
* Add additional data for license_key fields, split the measure fields etc.
public static function parse_values( $settings ) {
foreach ( $settings as $key => $value ) {
$field = self::get_field( $key );
* Process fields with specific types.
switch ( $field['type'] ) {
$license = get_option( $field['options']['is_valid_license_option'] );
'status' => PUM_Licensing::get_status( $license, ! empty( $value ) ),
'messages' => PUM_Licensing::get_status_messages( $license, trim( $value ) ),
'expires' => PUM_Licensing::get_license_expiration( $license ),
'classes' => PUM_Licensing::get_status_classes( $license ),
* Process fields with specific ids.
switch ( $field['id'] ) {
case 'pum_license_status':
$settings[ $key ] = Licensing::get_status();
public static function license_deactivated() {
public static function sanitize_objects( $meta = [] ) {
if ( ! empty( $meta ) ) {
foreach ( $meta as $key => $value ) {
if ( is_string( $value ) ) {
$value = json_decode( stripslashes( $value ) );
} catch ( Exception $e ) {
$meta[ $key ] = PUM_Admin_Helpers::object_to_array( $value );