| Server IP : 38.190.208.107 / Your IP : 216.73.217.21 Web Server : nginx/1.28.1 System : Linux ht2026040333114 6.1.0-10-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.37-1 (2023-07-03) x86_64 User : root ( 0) PHP Version : 8.2.28 Disable Function : 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,eval,assert,passthru,system,exec,shell_exec,popen,proc_open MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /www/wwwroot/wp.4/wp-content/themes/woodmart/inc/integrations/woocommerce/modules/ |
Upload File : |
<?php if ( ! defined( 'WOODMART_THEME_DIR' ) ) {
exit( 'No direct script access allowed' );
}
if ( ! function_exists( 'woodmart_maintenance_page' ) ) {
/**
* Check if the current page is maintenance page.
*
* @return bool
*/
function woodmart_maintenance_page() {
if ( ! woodmart_get_opt( 'maintenance_mode' ) || ( is_user_logged_in() && current_user_can( 'edit_posts' ) ) || ( woodmart_get_opt( 'maintenance_mode' ) && isset( $_GET[ woodmart_get_opt( 'maintenance_access_key' ) ] ) ) ) { //phpcs:ignore
return false;
}
$pages_ids = woodmart_pages_ids_from_template( 'maintenance' );
if ( ! empty( $pages_ids ) && is_page( $pages_ids ) ) {
return true;
}
return false;
}
}
if ( ! function_exists( 'woodmart_is_maintenance_active' ) ) {
/**
* This function will return true if the site visitor should be redirected to the maintenance page.
*
* @return bool
*/
function woodmart_is_maintenance_active() {
$maintenance_mode = woodmart_get_opt( 'maintenance_mode' );
$maintenance_access_key = woodmart_get_opt( 'maintenance_access_key' );
$is_access_key = ! empty( $maintenance_access_key ) && isset( $_GET[ $maintenance_access_key ] ); //phpcs:ignore;
if ( ! $maintenance_mode || ( is_user_logged_in() && current_user_can( 'edit_posts' ) ) || $is_access_key || ! woodmart_pages_ids_from_template( 'maintenance' ) ) {
return false;
}
return true;
}
}
if ( ! function_exists( 'woodmart_maintenance_mode' ) ) {
/**
* Maintenance mode redirect.
*
* @return void
*/
function woodmart_maintenance_mode() {
if ( ! woodmart_is_maintenance_active() ) {
return;
}
$page_id = woodmart_pages_ids_from_template( 'maintenance' );
$page_id = current( $page_id );
if ( ! $page_id ) {
return;
}
if ( ! is_page( $page_id ) && ( ! is_user_logged_in() || ! current_user_can( 'edit_posts' ) ) ) {
wp_redirect( get_permalink( $page_id ) );
exit();
}
}
add_action( 'template_redirect', 'woodmart_maintenance_mode', 10 );
}