Home > Enterprise >  My Wordpress 5.9 Admin section , in certain parts says "The Site Health check requires JavaScri
My Wordpress 5.9 Admin section , in certain parts says "The Site Health check requires JavaScri

Time:05-07

My WordPress 5.9 Admin section , in certain parts such as the Tools>Site Health , section says "The Site Health check requires JavaScript" but all java script is enable in my browser. Is there any way to fix this? Screen shot

Console error

> This page uses the non standard property “zoom”. Consider using calc() in the relevant property values, or using “transform” along with “transform-origin: 0 0”. site-health.php
Content Security Policy: The page’s settings blocked the loading of a resource at eval (“script-src”).
Content Security Policy: The page’s settings blocked the loading of a resource at inline (“script-src”). site-health.php:7:1
Content Security Policy: The page’s settings blocked the loading of a resource at inline (“style-src”). site-health.php:18:1
Content Security Policy: The page’s settings blocked the loading of a resource at inline (“script-src”). site-health.php:34:1
Content Security Policy: The page’s settings blocked the loading of a resource at inline (“script-src”). site-health.php:40:1
JQMIGRATE: Migrate is installed, version 3.3.2 load-scripts.php:5:709
Content Security Policy: The page’s settings blocked the loading of a resource at inline (“script-src”). site-health.php:46:1
Content Security Policy: The page’s settings blocked the loading of a resource at inline (“script-src”). site-health.php:51:1
Content Security Policy: The page’s settings blocked the loading of a resource at inline (“style-src”). site-health.php:56:1
Content Security Policy: The page’s settings blocked the loading of a resource at data:application/x-font-woff;charset=utf… (“font-src”).
Content Security Policy: The page’s settings blocked the loading of a resource at inline (“script-src”). site-health.php:59:1
Content Security Policy: The page’s settings blocked the loading of a resource at inline (“script-src”). site-health.php:63:1
Content Security Policy: The page’s settings blocked the loading of a resource at inline (“style-src”). 2 site-health.php
downloadable font: font load failed (font-family: "dashicons" style:normal weight:400 stretch:100 src index:1): content blocked source: data:application/x-font-woff;charset=utf-8;base64,d09GRgABAAAAAHvwAAsAAAAA3EgAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAABHU1VCAAABCAAAADMAAA …  raYQmdpQyhq3X375Vc9EZS30pVSoMiV6G5Jm7pcilxK8re9HaWE7llDtzEurqevbqTuhkiXkWFjg8qRoRtx1zUF U3C cCEVTbJqvo4z7bz9Ky79Jj1xdzc/wARDj0u
Content Security Policy: The page’s settings blocked the loading of a resource at data:application/x-font-woff;charset=utf… (“font-src”).
Content Security Policy: The page’s settings blocked the loading of a resource at inline (“script-src”). site-health.php:302:1
Content Security Policy: The page’s settings blocked the loading of a resource at inline (“script-src”). site-health.php:305:1
Content Security Policy: The page’s settings blocked the loading of a resource at inline (“script-src”). site-health.php:317:1
Content Security Policy: The page’s settings blocked the loading of a resource at inline (“script-src”). site-health.php:322:1
Content Security Policy: The page’s settings blocked the loading of a resource at inline (“script-src”). site-health.php:330:1
Content Security Policy: The page’s settings blocked the loading of a resource at inline (“script-src”). site-health.php:335:1
Content Security Policy: The page’s settings blocked the loading of a resource at inline (“script-src”). site-health.php:339:1
Content Security Policy: The page’s settings blocked the loading of a resource at inline (“script-src”). site-health.php:342:1
Content Security Policy: The page’s settings blocked the loading of a resource at inline (“script-src”). site-health.php:351:1
Content Security Policy: The page’s settings blocked the loading of a resource at inline (“script-src”). site-health.php:355:1
Content Security Policy: The page’s settings blocked the loading of a resource at inline (“script-src”). site-health.php:363:1
Uncaught TypeError: l10n is undefined
    <anonymous> https://senhrijournal.ac.in/wp-content/plugins/cmb2/js/cmb2.min.js?ver=2.10.1:1
    <anonymous> https://senhrijournal.ac.in/wp-content/plugins/cmb2/js/cmb2.min.js?ver=2.10.1:1
cmb2.min.js:1:528
Content Security Policy: The page’s settings blocked the loading of a resource at inline (“script-src”). site-health.php:367:1
Content Security Policy: The page’s settings blocked the loading of a resource at inline (“script-src”). site-health.php:418:1
Content Security Policy: The page’s settings blocked the loading of a resource at inline (“style-src”). a11y.min.js:2:2077
Content Security Policy: The page’s settings blocked the loading of a resource at inline (“style-src”). a11y.min.js:2:2369
Content Security Policy: The page’s settings blocked the loading of a resource at inline (“style-src”). a11y.min.js:2:1335
Content Security Policy: The page’s settings blocked the loading of a resource at inline (“style-src”). a11y.min.js:2:1716
Content Security Policy: The page’s settings blocked the loading of a resource at inline (“style-src”). a11y.min.js:2:1335
Content Security Policy: The page’s settings blocked the loading of a resource at inline (“style-src”). a11y.min.js:2:1716
Content Security Policy: The page’s settings blocked the loading of a resource at eval (“script-src”).
Content Security Policy: The page’s settings blocked the loading of a resource at inline (“style-src”). load-scripts.php:2:51642
downloadable font: font load failed (font-family: "dashicons" style:normal weight:400 stretch:100 src index:1): content blocked source: data:application/x-font-woff;charset=utf-8;base64,d09GRgABAAAAAHvwAAsAAAAA3EgAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAABHU1VCAAABCAAAADMAAA …  raYQmdpQyhq3X375Vc9EZS30pVSoMiV6G5Jm7pcilxK8re9HaWE7llDtzEurqevbqTuhkiXkWFjg8qRoRtx1zUF U3C cCEVTbJqvo4z7bz9Ky79Jj1xdzc/wARDj0u
Content Security Policy: The page’s settings blocked the loading of a resource at data:application/x-font-woff;charset=utf… (“font-src”). resource:773:36
Content Security Policy: The page’s settings blocked the loading of a resource at data:application/x-font-woff;charset=utf… (“font-src”). 

enter image description here

.htaccess file:

enter image description here

CodePudding user response:

Have you checked the .htacces file? Here is a link for solution it may be useful.

CodePudding user response:

Please try to edit your site-health.php with this code & Don't forgot to take backup of your old file.

    <?php
/**
 * Tools Administration Screen.
 *
 * @package WordPress
 * @subpackage Administration
 */

/** WordPress Administration Bootstrap */
require_once __DIR__ . '/admin.php';

wp_reset_vars( array( 'action' ) );

$tabs = array(
    /* translators: Tab heading for Site Health Status page. */
    ''      => _x( 'Status', 'Site Health' ),
    /* translators: Tab heading for Site Health Info page. */
    'debug' => _x( 'Info', 'Site Health' ),
);

/**
 * An associative array of extra tabs for the Site Health navigation bar.
 *
 * Add a custom page to the Site Health screen, based on a tab slug and label.
 * The label you provide will also be used as part of the site title.
 *
 * @since 5.8.0
 *
 * @param string[] $tabs An associative array of tab labels keyed by their slug.
 */
$tabs = apply_filters( 'site_health_navigation_tabs', $tabs );

$wrapper_classes = array(
    'health-check-tabs-wrapper',
    'hide-if-no-js',
    'tab-count-' . count( $tabs ),
);

$current_tab = ( isset( $_GET['tab'] ) ? $_GET['tab'] : '' );

$title = sprintf(
    // translators: %s: The currently displayed tab.
    __( 'Site Health - %s' ),
    ( isset( $tabs[ $current_tab ] ) ? esc_html( $tabs[ $current_tab ] ) : esc_html( reset( $tabs ) ) )
);

if ( ! current_user_can( 'view_site_health_checks' ) ) {
    wp_die( __( 'Sorry, you are not allowed to access site health information.' ), '', 403 );
}

wp_enqueue_style( 'site-health' );
wp_enqueue_script( 'site-health' );

if ( ! class_exists( 'WP_Site_Health' ) ) {
    require_once ABSPATH . 'wp-admin/includes/class-wp-site-health.php';
}

if ( 'update_https' === $action ) {
    check_admin_referer( 'wp_update_https' );

    if ( ! current_user_can( 'update_https' ) ) {
        wp_die( __( 'Sorry, you are not allowed to update this site to HTTPS.' ), 403 );
    }

    if ( ! wp_is_https_supported() ) {
        wp_die( __( 'It looks like HTTPS is not supported for your website at this point.' ) );
    }

    $result = wp_update_urls_to_https();

    wp_redirect( add_query_arg( 'https_updated', (int) $result, wp_get_referer() ) );
    exit;
}

$health_check_site_status = WP_Site_Health::get_instance();

get_current_screen()->add_help_tab(
    array(
        'id'      => 'overview',
        'title'   => __( 'Overview' ),
        'content' =>
                '<p>' . __( 'This screen allows you to obtain a health diagnosis of your site, and displays an overall rating of the status of your installation.' ) . '</p>' .
                '<p>' . __( 'In the Status tab, you can see critical information about your WordPress configuration, along with anything else that requires your attention.' ) . '</p>' .
                '<p>' . __( 'In the Info tab, you will find all the details about the configuration of your WordPress site, server, and database. There is also an export feature that allows you to copy all of the information about your site to the clipboard, to help solve problems on your site when obtaining support.' ) . '</p>',
    )
);

get_current_screen()->set_help_sidebar(
    '<p><strong>' . __( 'For more information:' ) . '</strong></p>' .
    '<p>' . __( '<a href="https://wordpress.org/support/article/site-health-screen/">Documentation on Site Health tool</a>' ) . '</p>'
);

// Start by checking if this is a special request checking for the existence of certain filters.
$health_check_site_status->check_wp_version_check_exists();

require_once ABSPATH . 'wp-admin/admin-header.php';
?>
<div >
    <div >
        <h1>
            <?php _e( 'Site Health' ); ?>
        </h1>
    </div>

    <?php
    if ( isset( $_GET['https_updated'] ) ) {
        if ( $_GET['https_updated'] ) {
            ?>
            <div id="message" ><p><?php _e( 'Site URLs switched to HTTPS.' ); ?></p></div>
            <?php
        } else {
            ?>
            <div id="message" ><p><?php _e( 'Site URLs could not be switched to HTTPS.' ); ?></p></div>
            <?php
        }
    }
    ?>

    <div >
        <div >
            <svg role="img" aria-hidden="true" focusable="false" width="100%" height="100%" viewBox="0 0 200 200" version="1.1" xmlns="http://www.w3.org/2000/svg">
                <circle r="90" cx="100" cy="100" fill="transparent" stroke-dasharray="565.48" stroke-dashoffset="0"></circle>
                <circle id="bar" r="90" cx="100" cy="100" fill="transparent" stroke-dasharray="565.48" stroke-dashoffset="0"></circle>
            </svg>
        </div>
        <div >
            <?php _e( 'Results are still loading&hellip;' ); ?>
        </div>
    </div>

    <nav  aria-label="<?php esc_attr_e( 'Secondary menu' ); ?>">
        <?php
        $tabs_slice = $tabs;

        /*
         * If there are more than 4 tabs, only output the first 3 inline,
         * the remaining links will be added to a sub-navigation.
         */
        if ( count( $tabs ) > 4 ) {
            $tabs_slice = array_slice( $tabs, 0, 3 );
        }

        foreach ( $tabs_slice as $slug => $label ) {
            printf(
                '<a href="%s" >%s</a>',
                esc_url(
                    add_query_arg(
                        array(
                            'tab' => $slug,
                        ),
                        admin_url( 'site-health.php' )
                    )
                ),
                ( $current_tab === $slug ? 'active' : '' ),
                esc_html( $label )
            );
        }
        ?>

        <?php if ( count( $tabs ) > 4 ) : ?>
            <button type="button"  aria-haspopup="true">
                <span ></span>
                <span ><?php _e( 'Toggle extra menu items' ); ?></span>

                <div >
                    <?php
                    // Remove the first few entries from the array as being already output.
                    $tabs_slice = array_slice( $tabs, 3 );
                    foreach ( $tabs_slice as $slug => $label ) {
                        printf(
                            '<a href="%s" >%s</a>',
                            esc_url(
                                add_query_arg(
                                    array(
                                        'tab' => $slug,
                                    ),
                                    admin_url( 'site-health.php' )
                                )
                            ),
                            ( isset( $_GET['tab'] ) && $_GET['tab'] === $slug ? 'active' : '' ),
                            esc_html( $label )
                        );
                    }
                    ?>
                </div>
            </button>
        <?php endif; ?>
    </nav>
</div>

<hr >

<?php
if ( isset( $_GET['tab'] ) && ! empty( $_GET['tab'] ) ) {
    /**
     * Output content of a custom Site Health tab.
     *
     * This action fires right after the Site Health header, and users are still subject to
     * the capability checks for the Site Health page to view any custom tabs and their contents.
     *
     * @since 5.8.0
     *
     * @param string $tab The slug of the tab that was requested.
     */
    do_action( 'site_health_tab_content', $_GET['tab'] );

    require_once ABSPATH . 'wp-admin/admin-footer.php';
    return;
} else {
    ?>

<div >
    <p><?php _e( 'The Site Health check requires JavaScript.' ); ?></p>
</div>

<div >
    <div >
        <p >
            <span  aria-hidden="true"></span>
        </p>

        <p >
            <?php _e( 'Great job!' ); ?>
        </p>

        <p>
            <?php _e( 'Everything is running smoothly here.' ); ?>
        </p>
    </div>

    <div >
        <h2>
            <?php _e( 'Site Health Status' ); ?>
        </h2>

        <p><?php _e( 'The site health check shows critical information about your WordPress configuration and items that require your attention.' ); ?></p>

        <div  id="health-check-issues-critical">
            <h3 >
                <?php
                    /* translators: %s: Number of critical issues found. */
                    printf( _n( '%s critical issue', '%s critical issues', 0 ), '<span >0</span>' );
                ?>
            </h3>

            <div id="health-check-site-status-critical" ></div>
        </div>

        <div  id="health-check-issues-recommended">
            <h3 >
                <?php
                    /* translators: %s: Number of recommended improvements. */
                    printf( _n( '%s recommended improvement', '%s recommended improvements', 0 ), '<span >0</span>' );
                ?>
            </h3>

            <div id="health-check-site-status-recommended" ></div>
        </div>
    </div>

    <div >
        <button type="button"  aria-expanded="false" aria-controls="health-check-issues-good">
            <?php _e( 'Passed tests' ); ?>
            <span ></span>
        </button>
    </div>

    <div  id="health-check-issues-good">
        <h3 >
            <?php
                /* translators: %s: Number of items with no issues. */
                printf( _n( '%s item with no issues detected', '%s items with no issues detected', 0 ), '<span >0</span>' );
            ?>
        </h3>

        <div id="health-check-site-status-good" ></div>
    </div>
</div>

<script id="tmpl-health-check-issue" type="text/template">
    <h4 >
        <button aria-expanded="false"  aria-controls="health-check-accordion-block-{{ data.test }}" type="button">
            <span >{{ data.label }}</span>
            <# if ( data.badge ) { #>
                <span >{{ data.badge.label }}</span>
            <# } #>
            <span ></span>
        </button>
    </h4>
    <div id="health-check-accordion-block-{{ data.test }}"  hidden="hidden">
        {{{ data.description }}}
        <# if ( data.actions ) { #>
            <div >
                {{{ data.actions }}}
            </div>
        <# } #>
    </div>
</script>

    <?php
}
require_once ABSPATH . 'wp-admin/admin-footer.php';
  • Related