• The last time I logged into the dashboard was 21 April, and there have been 2 maintenance releases since then (4.5.1 and 4.5.2) which have auto updated. The front end is displaying without any issues, including when logged in.

    The dashboard though is displaying like this.

    Looking at the source code of the dashboard, the first part is as below.

    <?php
    /**
     * Dashboard Administration Screen
     *
     * @package WordPress
     * @subpackage Administration
     */
    
    /** Load WordPress Bootstrap */
    require_once( dirname( __FILE__ ) . '/admin.php' );
    
    /** Load WordPress dashboard API */
    require_once(ABSPATH . 'wp-admin/includes/dashboard.php');
    
    wp_dashboard_setup();
    
    wp_enqueue_script( 'dashboard' );
    if ( current_user_can( 'edit_theme_options' ) )
    	wp_enqueue_script( 'customize-loader' );
    if ( current_user_can( 'install_plugins' ) )
    	wp_enqueue_script( 'plugin-install' );
    if ( current_user_can( 'upload_files' ) )
    	wp_enqueue_script( 'media-upload' );
    add_thickbox();
    
    if ( wp_is_mobile() )
    	wp_enqueue_script( 'jquery-touch-punch' );
    
    $title = __('Dashboard');
    $parent_file = 'index.php';
    
    $help = '<p>' . __( 'Welcome to your WordPress Dashboard! This is the screen you will see when you log in to your site, and gives you access to all the site management features of WordPress. You can get help for any screen by clicking the Help tab in the upper corner.' ) . '</p>';
    
    // Not using chaining here, so as to be parseable by PHP4.
    $screen = get_current_screen();
    
    $screen->add_help_tab( array(
    	'id'      => 'overview',
    	'title'   => __( 'Overview' ),
    	'content' => $help,
    ) );

    Any ideas why this might be happening? It was working fine as of 4.5 – cannot say about 4.5.1 though. The site is on a server using PHP7 if relevant. The plugins installed and active are:

    Yoast SEO v3.2.4
    wp-bcrypt v1.0.1
    All In One WP Security & Firewall (updated on 21 April, not sure of version)
    Contact Form 7 (was updated on 21 April, not sure of version)

Viewing 6 replies - 1 through 6 (of 6 total)
  • Have you tried:

    – deactivating all plugins to see if this resolves the problem. If this works, re-activate the plugins one by one until you find the problematic plugin(s).

    – switching to the default theme to rule out any theme-specific problems.

    resetting the plugins folder by FTP or PhpMyAdmin. Sometimes, an apparently inactive plugin can still cause problems.

    – re-uploading all files & folders – except the wp-content folder and wp-config.php & root .htaccess files – from a fresh download of WordPress. Make sure that you delete the old copies of files & folder before uploading the new ones.

    Thread Starter mojorob

    (@mojorob)

    Deactivating plugins via PhpMyAdmin didn’t change anything. The theme being used is the only theme installed.

    I’ve noticed when looking at the source code in Firefox that some of the PHP code is in red (indicating something wrong with it), and other parts of the PHP code displays in the normal colour for when you look at the source code.

    I’ll look at reuploading files when I have time a bit later.

    The theme being used is the only theme installed.

    And what theme is that?

    Thread Starter mojorob

    (@mojorob)

    It’s a custom theme.

    Then, at the very least, you need to upload a copy of the current default theme – Twenty Sixteen. It’s vital in some situations, to have access to that theme on your site. Once the theme is uploaded, activate it and see it that helps.

    Thread Starter mojorob

    (@mojorob)

    This is odd. I’ve just come back from somewhere, logged in and the dashboard is working fine again.

    As a side question, what are the situations when it’s vital to have the current default theme on the server?

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Dashboard displaying PHP code’ is closed to new replies.