HEX
Server: nginx/1.28.1
System: Linux 10-41-63-61 6.8.0-31-generic #31-Ubuntu SMP PREEMPT_DYNAMIC Sat Apr 20 00:40:06 UTC 2024 x86_64
User: www (1001)
PHP: 7.4.33
Disabled: passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,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_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv
Upload Files
File: /www/wwwroot/tokld.top/wp-content/plugins/athemes-starter-sites/core/core-helpers.php
<?php
/**
 * The basic helpers functions
 *
 * @package    Athemes Starter Sites
 * @subpackage Core
 * @version    1.0.0
 * @since      1.0.0
 */

/**
 * Output error message.
 *
 * @param string $message The error message.
 */
function atss_alert_warning( $message ) {
	if ( current_user_can( 'editor' ) || current_user_can( 'administrator' ) ) {
		?>
		<p class="atss-alert atss-alert-warning" role="alert">
			<object>
				<?php call_user_func( 'printf', '%s', $message ); ?>
			</object>

			<?php esc_html_e( ' Don’t worry, this error is visible to site admins only, and your site visitors won’t see it.', 'athemes-starter-sites' ); ?>
		</p>
		<?php
	}
}

/**
 * Processing path of style.
 *
 * @param string $path URL to the stylesheet.
 */
function atss_style( $path ) {
	// Check RTL.
	if ( is_rtl() ) {
		return $path;
	}

	// Check Dev.
	$dev = ATSS_PATH . 'assets/css/athemes-starter-sites-dev.css';

	if ( file_exists( $dev ) ) {
		return str_replace( '.css', '-dev.css', $path );
	}

	return $path;
}

function atss_import_helper( $theme, $demo_id ) {
	if( get_option( 'atts_current_starter' ) == $demo_id ) {
		return false;
	}
	
	wp_remote_get( 'https://www.athemes.com/reports/starters.php?theme='. $theme .'&demo_id='. $demo_id,
		array(
			'timeout'     => 30,
			'user-agent' => 'WordPress/' . get_bloginfo( 'version' ) . ';'
		)
	);
	update_option( 'atts_current_starter', $demo_id );
}

/**
 * Get page by title
 * The core WordPress function 'get_page_by_title' were deprecated since 6.2.0
 * More info: https://make.wordpress.org/core/2023/03/06/get_page_by_title-deprecated/
 * 
 * @param string $page_title The title of the page.
 */
function atss_get_page_by_title( $page_title ) {
	$query = new WP_Query(
		array(
			'post_type'              => 'page',
			'title'                  => $page_title,
			'post_status'            => 'all',
			'posts_per_page'         => 1,
			'no_found_rows'          => true,
			'ignore_sticky_posts'    => true,
			'update_post_term_cache' => false,
			'update_post_meta_cache' => false,
			'orderby'                => 'post_date ID',
			'order'                  => 'ASC',
		)
	);
	 
	if ( ! empty( $query->post ) ) {
		$page_got_by_title = $query->post;
	} else {
		$page_got_by_title = null;
	}

	return $page_got_by_title;
}