0

It's been approximately a month since i can no longer update any plugins or wordpress core on my website. When I attempt to update the website it get's knocked off line. Jetpack then reactivates the website for me after 5-8 minutes. When it comes back online I get this in the admin section:

There has been a critical error on your website. Please check your site admin email inbox for instructions.

Unfortunately, i don't actually get that email. Thus no further information.

Despite these problems, I can continue to publish articles, and the rest of the website works as expected.

I've been reading up on what could possibly be the problem, and think it could have something to do with my webhosts settings (DigitalOcean) and directory permissions.

What do I need to look at to determine if directory permissions is the problem? Or what the problem could possible be, to have the website behave like this?

UPDATE: I have looked at the error.log and I see the following lines repeated:

[Tue Jan 21 09:15:26.128769 2020] [fcgid:warn] [pid 16817] [client 52.9.128.29:42158] mod_fcgid: stderr: PHP Fatal error:  Uncaught Error: Call to undefined function get_header() in /var/www/clients/client1/web1/web/wp-content/themes/study-circle/index.php:13
[Tue Jan 21 09:15:26.128824 2020] [fcgid:warn] [pid 16817] [client 52.9.128.29:42158] mod_fcgid: stderr: Stack trace:
[Tue Jan 21 09:15:26.128832 2020] [fcgid:warn] [pid 16817] [client 52.9.128.29:42158] mod_fcgid: stderr: #0 {main}
[Tue Jan 21 09:15:26.128837 2020] [fcgid:warn] [pid 16817] [client 52.9.128.29:42158] mod_fcgid: stderr:   thrown in /var/www/clients/client1/web1/web/wp-content/themes/study-circle/index.php on line 13

The index.php code looks normal to me...

<?php
/**
 * The template for displaying home page.
 *
 * This is the template that displays all pages by default.
 * Please note that this is the WordPress construct of pages
 * and that other 'pages' on your WordPress site will use a
 * different template.
 *
 * @package Study Circle
 */

get_header(); 
?>
<div class="container">
     <div class="page_content">
        <section class="site-main">
             <div class="blog-post">
                    <?php
                    if ( have_posts() ) :
                        // Start the Loop.
                        while ( have_posts() ) : the_post();
                            /*
                             * Include the post format-specific template for the content. If you want to
                             * use this in a child theme, then include a file called called content-___.php
                             * (where ___ is the post format) and that will be used instead.
                             */
                            get_template_part( 'content' );

                        endwhile;
                        // Previous/next post navigation.
                        the_posts_pagination();

                    else :
                        // If no content, include the "No posts found" template.
                         get_template_part( 'no-results', 'index' );

                    endif;
                    ?>
                    </div><!-- blog-post -->
             </section>

        <?php get_sidebar();?>     
        <div class="clear"></div>
    </div><!-- site-aligner -->
</div><!-- content -->
<?php get_footer(); ?>

And the get_header Function from wp-includes/general-template.php:

function get_header( $name = null ) {
    /**
     * Fires before the header template file is loaded.
     *
     * @since 2.1.0
     * @since 2.8.0 $name parameter added.
     *
     * @param string|null $name Name of the specific header file to use. null for the default header.
     */
    do_action( 'get_header', $name );

    $templates = array();
    $name      = (string) $name;
    if ( '' !== $name ) {
        $templates[] = "header-{$name}.php";
    }

    $templates[] = 'header.php';

    locate_template( $templates, true );
}
2
  • That looks OK. get_header is defined in wp-includes/general-template.php. It might be worth replacing all of the core WordPress files with a new uploaded copy if you can do that easily / safely.
    – Rup
    Commented Jan 21, 2020 at 9:10
  • I don't know enough about PHP to say for certain, but the get_header functino also looks ok to me. How would I go about replacing all of the core wordpress files? Download the current files using FTP as a backup and then upload a new copy manually also using FTP? Makes me a bit nervous.
    – rohrl77
    Commented Jan 21, 2020 at 10:09

2 Answers 2

1

Besides looking at your inbox for any messages that WP might send you (they don't always get sent), look at the error.log file in the site root and wp-admin folders. That will tell you where the error is.

If it is a plugin, then rename that plugin's folder temporarily, then try the update again. You could also rename the entire plugin folder to temporarily disable all plugins. And you might consider reverting to one of the 'twenty' themes to do your update.

Once you have updated WP (and updated your PHP version, which may also be the problem; contact your hosting place for instructions on that), you can move back to your old theme. Then make a new plugins folder, and move each plugin folder individually to the new plugins folder. After each move, check the admin page, and do the 'update' check. Repeat for each plugin. (And update your theme, if needed.)

Your issue shows the importance of keeping WP - core, themes, and plugins - updated. Less problems that way. (And the importance of updating your PHP version.)

3
  • Thanks for your answer. I always keep my plugins and WP updated to the very latest version. Not beeing uptodate is exactely what I fear.... website gets hacked or god knows what else. I'll now have a look at the error log.
    – rohrl77
    Commented Jan 21, 2020 at 8:52
  • 1
    Kudos for keeping your site up to date. Log files will tell you a lot. Let us know what you find out in a comment. Hopefully, my answer and your comments will help others that wander by this question. (And a 'checkmark' is always appreciated if my answer was correct - or got you into the direction of the solution.) Commented Jan 21, 2020 at 19:22
  • It took me a while to get to the point where i could test your approach, because i wanted to be undisturbed in case things would go sideways. Also to first make a backup copy of the website. I tried your relatively simple trick with renaming the folder and saddly, upon attempting to update wordpress core, it failed. The PHP Version i have is PHP-Version: 7.0.33-0+deb9u3 ...while i see that Wordpress recommends 7.3 or higher i'm not that far behind.
    – rohrl77
    Commented Jan 31, 2020 at 10:18
0

In the end I could not solve this myself. I hired a freelancer who specialised in WP development. As it turned out, it was a plugin (OptimizePress 2) that was responsible for this problem, however, the issue remained even when that plugin was deactived. How this is possible, I don't know, and can't give any real technical details on.

Just wanted to report back.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.