HEX
Server: Apache
System: Linux clpupre 5.4.0-90-generic #101-Ubuntu SMP Fri Oct 15 20:00:55 UTC 2021 x86_64
User: undanet (1000)
PHP: 7.4.3
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Upload Files
File: /home/undanet/www/wp-content/plugins/popup-maker/includes/functions/themes/portability.php
<?php
/*******************************************************************************
 * Copyright (c) 2019, Code Atlantic LLC
 ******************************************************************************/

/**
 * @param       $name
 * @param null  $settings
 * @param array $extra_meta
 *
 * @return int|\WP_Error
 */
function pum_install_theme( $name, $settings = null, $extra_meta = [] ) {
	if ( ! isset( $settings ) ) {
		$settings = PUM_Admin_Themes::defaults();
	}

	$new_theme_id = @wp_insert_post(
		[
			'post_title'     => $name,
			'post_author'    => get_current_user_id(),
			'post_status'    => 'publish',
			'post_type'      => 'popup_theme',
			'comment_status' => 'closed',
			'meta_input'     => array_merge(
				(array) $extra_meta,
				[
					'popup_theme_settings' => $settings,
				]
			),
		]
	);

	pum_reset_assets();

	return $new_theme_id;

}

/**
 * @param $hash
 *
 * @return mixed
 */
function pum_import_theme_from_repo( $hash ) {
	$theme_data = [
		'name'            => __( 'Imported Theme', 'popup-maker' ),
		'settings'        => PUM_Admin_Themes::defaults(),
		'original_author' => 'Daniel',
	];

	return pum_install_theme(
		$theme_data['name'],
		$theme_data['settings'],
		[
			'_pum_theme_repo_hash'   => $hash,
			'_pum_theme_repo_author' => $theme_data['original_author'],
		]
	);
}

/**
 * Installs a default theme and returns the new theme ID.
 *
 * @since 1.8.0
 *
 * @return int|\WP_Error
 */
function pum_install_default_theme() {
	return pum_install_theme(
		__( 'Default Theme', 'popup-maker' ),
		null,
		[
			'_pum_built_in'            => 'default-theme',
			'_pum_default_theme'       => true,
			'popup_theme_data_version' => 3,
		]
	);
}