id ) { include( 'views/html-notice-translation-upgrade.php' ); } } /** * Show a notice highlighting bad template files */ public function template_file_check_notice() { if ( isset( $_GET['page'] ) && 'wc-status' == $_GET['page'] ) { return; } $core_templates = WC_Admin_Status::scan_template_files( WC()->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() . '/woocommerce/' . $file ) ) { $theme_file = get_stylesheet_directory() . '/woocommerce/' . $file; } elseif ( file_exists( get_template_directory() . '/' . $file ) ) { $theme_file = get_template_directory() . '/' . $file; } elseif( file_exists( get_template_directory() . '/woocommerce/' . $file ) ) { $theme_file = get_template_directory() . '/woocommerce/' . $file; } if ( $theme_file ) { $core_version = WC_Admin_Status::get_file_version( WC()->plugin_path() . '/templates/' . $file ); $theme_version = WC_Admin_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 WC_Admin_Notices();