| Server IP : 149.28.60.191 / Your IP : 216.73.217.128 Web Server : nginx/1.31.1 System : Linux vultr.guest 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64 User : mda ( ) PHP Version : 7.4.33 Disable Function : getmyuid,passthru,leak,listen,diskfreespace,tmpfile,link,shell_exec,dl,exec,system,highlight_file,source,show_source,fpassthru,virtual,posix_ctermid,posix_getcwd,posix_getegid,posix_geteuid,posix_getgid,posix_getgrgid,posix_getgrnam,posix_getgroups,posix_getlogin,posix_getpgid,posix_getpgrp,posix_getpid,posix_getppid,posix_getpwuid,posix_getrlimit,posix_getsid,posix_getuid,posix_isatty,posix_kill,posix_mkfifo,posix_setegid,posix_seteuid,posix_setgid,posix_setpgid,posix_setsid,posix_setuid,posix_times,posix_ttyname,posix_uname,proc_open,proc_close,proc_nice,proc_terminate,escapeshellcmd,ini_alter,popen,pcntl_exec,socket_accept,socket_bind,socket_clear_error,socket_close,socket_connect,symlink,posix_geteuid,ini_alter,socket_listen,socket_create_listen,socket_read,socket_create_pair,stream_socket_server MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /home/mda/webapps/mda-restore/wp-content/themes/Avada/includes/ |
Upload File : |
<?php
/**
* WP and PHP compatibility.
*
* Functions used to gracefully fail when a theme doesn't meet the minimum WP or PHP versions required.
* Only call this file after initially checking that the site doesn't meet either the WP or PHP requirement.
*
* @package avada
* @since 6.0
*/
/**
* Add actions to fail at certain points in the load process.
*/
add_action( 'after_switch_theme', 'avada_compat_switch_theme' );
add_action( 'load-customize.php', 'avada_compat_load_customize' );
add_action( 'template_redirect', 'avada_compat_preview' );
/**
* Returns the compatibility messaged based on whether the WP or PHP minimum requirement wasn't met.
*
* @since 6.0
* @access public
* @return string
*/
function avada_compat_message() {
if ( version_compare( $GLOBALS['wp_version'], AVADA_MIN_WP_VER_REQUIRED, '<' ) ) {
return sprintf(
/* Translators: 1 is the required WordPress version and 2 is the user's current version. */
esc_html__( 'Avada requires at least WordPress version %1$s. You are running version %2$s. Please upgrade and try again.' ),
esc_html( AVADA_MIN_WP_VER_REQUIRED ),
$GLOBALS['wp_version']
);
} elseif ( version_compare( PHP_VERSION, AVADA_MIN_PHP_VER_REQUIRED, '<' ) ) {
return sprintf(
/* Translators: 1 is the required PHP version and 2 is the user's current version. */
esc_html__( 'Avada requires at least PHP version %1$s. You are running version %2$s. Please upgrade and try again.' ),
AVADA_MIN_PHP_VER_REQUIRED,
PHP_VERSION
);
}
return '';
}
/**
* Switches to the previously active theme after the theme has been activated.
*
* @since 6.0
* @access public
* @param string $old_name Previous theme name/slug.
* @return void
*/
function avada_compat_switch_theme( $old_name ) {
switch_theme( $old_name ? $old_name : WP_DEFAULT_THEME );
unset( $_GET['activated'] ); // phpcs:ignore WordPress.Security.NonceVerification
add_action( 'admin_notices', 'avada_compat_upgrade_notice' );
}
/**
* Outputs an admin notice with the compatibility issue.
*
* @since 6.0
* @return void
*/
function avada_compat_upgrade_notice() {
printf( '<div class="error"><p>%s</p></div>', esc_html( avada_compat_message() ) );
}
/**
* Kills the loading of the customizer.
*
* @since 6.0
* @return void
*/
function avada_compat_load_customize() {
wp_die( esc_html( avada_compat_message() ), '', array( 'back_link' => true ) );
}
/**
* Kills the customizer previewer on installs prior to WP 4.7.
*
* @since 6.0
* @return void
*/
function avada_compat_preview() {
if ( isset( $_GET['preview'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification
wp_die( esc_html( avada_compat_message() ) );
}
}
/**
* If this is a theme update show the admin notice.
*
* @since 6.0
*/
$avada_db_version = get_option( 'avada_version', false );
if ( $avada_db_version ) {
avada_compat_switch_theme( '' );
}