• When I upgraded to 6.3.1, the final message was that there had been a critical error and that I should check for an explanatory email. However, health status does not indicate any problems and the website appears to be working fine.

    I have noticed that if I select a live preview of themes 2022 or 2023, I get the same msg:
    There has been a critical error on this website. Please check your site admin email inbox for instructions.
    An attempt to activate either of these themes appears to be successful.

    This is not a problem as I am using the Tempera theme, but could there be an underlying problem which requires investigation.

    Andy

Viewing 5 replies - 1 through 5 (of 5 total)
  • The reason for the error should be visible in the error log. You can find it in your hosting area. If necessary, the support of your hosting can help you.

    Alternatively, you could also enable debugging in WordPress. How to do this is described here: https://www.ads-software.com/support/article/debugging-in-wordpress/ – also here the support of your hosting can help you if necessary to edit the file accordingly.

    In both cases you should be able to see what the cause is in the logfile.

    Thread Starter andynz

    (@andynz)

    Thanks for your quick response. Here is the full log whenever I try to show a live preview of theme 2023.
    I could not see how to attach a file to this post, so hope an embed is OK.

    [05-Oct-2023 22:44:36 UTC] PHP Fatal error:  Uncaught Error: Call to undefined function wp_get_current_user() in /home/patgennz/public_html/wp2021/wp-includes/capabilities.php:877
    Stack trace:
    #0 /home/patgennz/public_html/wp2021/wp-includes/theme-previews.php(17): current_user_can('switch_themes')
    #1 /home/patgennz/public_html/wp2021/wp-includes/class-wp-hook.php(310): wp_get_theme_preview_path('tempera')
    #2 /home/patgennz/public_html/wp2021/wp-includes/plugin.php(205): WP_Hook->apply_filters('tempera', Array)
    #3 /home/patgennz/public_html/wp2021/wp-includes/theme.php(317): apply_filters('template', 'tempera')
    #4 /home/patgennz/public_html/wp2021/wp-includes/theme.php(328): get_template()
    #5 /home/patgennz/public_html/wp2021/wp-includes/l10n.php(1306): get_template_directory()
    #6 /home/patgennz/public_html/wp2021/wp-includes/l10n.php(1331): _load_textdomain_just_in_time('wp-photo-album-...')
    #7 /home/patgennz/public_html/wp2021/wp-includes/l10n.php(185): get_translations_for_domain('wp-photo-album-...')
    #8 /home/patgennz/public_html/wp2021/wp-includes/l10n.php(297): translate('General', 'wp-photo-album-...')
    #9 /home/patgennz/public_html/wp2021/wp-content/plugins/wp-photo-album-plus/wppa-setting-see-also.php(15): __('General', 'wp-photo-album-...')
    #10 /home/patgennz/public_html/wp2021/wp-content/plugins/wp-photo-album-plus/wppa-init.php(75): require_once('/home/patgennz/...')
    #11 /home/patgennz/public_html/wp2021/wp-content/plugins/wp-photo-album-plus/wppa.php(15): require_once('/home/patgennz/...')
    #12 /home/patgennz/public_html/wp2021/wp-settings.php(462): include_once('/home/patgennz/...')
    #13 /home/patgennz/public_html/wp2021/wp-config.php(89): require_once('/home/patgennz/...')
    #14 /home/patgennz/public_html/wp2021/wp-load.php(50): require_once('/home/patgennz/...')
    #15 /home/patgennz/public_html/wp2021/wp-admin/admin.php(34): require_once('/home/patgennz/...')
    #16 /home/patgennz/public_html/wp2021/wp-admin/site-editor.php(12): require_once('/home/patgennz/...')
    #17 {main}  thrown in /home/patgennz/public_html/wp2021/wp-includes/capabilities.php on line 877

    The trace mentions both my active theme ‘tempera’ and plugin wp-photo-album-plus, but disabling these makes no difference.

    Running PHP 8.1.21

    Andy

    Thread Starter andynz

    (@andynz)

    Further investigation indicates that the problem goes away if all of the following plugins are deactivated:
    Tablepress
    Password protected
    WP photo album plus

    Alternatively, I can activate all of the above and add the following code (found in another forum) to capabilities.php
    include_once(ABSPATH . ‘wp-includes/pluggable.php’);

    but this is probably not good in the longer term.

    Andy

    No, customising a WordPress core file is NEVER a good idea. Don’t do it.

    The error message clearly states wp-photo-album-plus as the cause. Interesting, if you have to deactivate these 3 plugins first so that it doesn’t occur anymore. BUT: the actual error is that a WordPress core function “wp_get_current_user” is not found. This indicates to me that your WordPress core files are not completely saved. If your backend still works, go to Update and reinstall the core files from there. It may make sense to make a backup beforehand.

    If you can’t get there in the backend, you can download the appropriate package for your WordPress from https://www.ads-software.com/download/releases/ and unpack it locally. Then upload the wp-includes directory to your hosting via FTP. Your hoster’s support can help you with this.

    Thread Starter andynz

    (@andynz)

    Thanks for the advice and I agree that WP base should never be modified. This was a patch on my test site for evaluation.
    However, here are links which appear to relate exactly to my problem (failed attempt to preview a block theme).

    https://github.com/WordPress/gutenberg/issues/53284

    https://core.trac.www.ads-software.com/ticket/59000

    It does not affect normal operation of the website so I will wait to see if it is fixed by 6.3.2.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Critical error after upgrade to wp 6.3.1’ is closed to new replies.