id != 'settings_page_sportspress' ) { include( 'views/html-notice-install.php' ); } } /** * Show the Theme Check notice */ public function theme_check_notice() { // include( 'views/html-notice-theme-support.php' ); } /** * Show a notice highlighting bad template files */ public function template_file_check_notice() { if ( isset( $_GET['page'] ) && 'sp-status' == $_GET['page'] ) { return; } $status = include( 'class-sp-admin-status.php' ); $core_templates = $status->scan_template_files( SP()->plugin_path() . '/templates' ); $outdated = false; foreach ( $core_templates as $file ) { $theme_file = false; if ( file_exists( get_stylesheet_directory() . '/' . $file ) ) { $theme_file = get_stylesheet_directory() . '/' . $file; } elseif ( file_exists( get_stylesheet_directory() . '/sportspress/' . $file ) ) { $theme_file = get_stylesheet_directory() . '/sportspress/' . $file; } elseif ( file_exists( get_template_directory() . '/' . $file ) ) { $theme_file = get_template_directory() . '/' . $file; } elseif( file_exists( get_template_directory() . '/sportspress/' . $file ) ) { $theme_file = get_template_directory() . '/sportspress/' . $file; } if ( $theme_file ) { $core_version = $status->get_file_version( SP()->plugin_path() . '/templates/' . $file ); $theme_version = $status->get_file_version( $theme_file ); if ( $core_version && $theme_version && version_compare( $theme_version, $core_version, '<' ) ) { $outdated = true; break; } } } if ( $outdated ) { include( 'views/html-notice-template-check.php' ); } } } endif; return new SP_Admin_Notices();