• Resolved emiliemartinez

    (@emiliemartinez)


    Hey,

    I just updated to WP 8.2, most recent Divi Theme and started to get a 500 server error across the site. I’m a dev, but not familiar with WP (it’s a pet non-profit account).

    This is what I’m seeing in the logs:

    Error log: {
    “installName”: “wilderness1stg”,
    “environment”: “STAGE”,
    “type”: “error”,
    “date”: “2023-09-27T02:39:22.000Z”,
    “severity”: “notice”,
    “client”: “70.226.117.190:0”,
    “message”: “auditor:event=activated_plugin {\”plugin\”:\”autoptimize/autoptimize.php\”,\”network_activation\”:false,\”blog_id\”:1,\”event\”:\”activated_plugin\”,\”current_user_id\”:13,\”remote_addr\”:\”70.226.117.190\”}, referer: https://wilderness1stg.wpenginepowered.com/wp-admin/plugins.php”,
    “uuid”: “22b98b97-cb00-416b-81c0-4065fee914f3”
    }

    Access log (I think this is irrelevant):

    {
    “installName”: “wilderness1stg”,
    “environment”: “STAGE”,
    “domain”: “wilderness1stg.wpenginepowered.com”,
    “ipAddress”: “70.226.117.190”,
    “date”: “2023-09-27T02:39:35.000Z”,
    “type”: “nginx”,
    “verb”: “GET”,
    “resource”: “/”,
    “protocol”: “HTTP/1.0”,
    “status”: 500,
    “referer”: null,
    “userAgent”: “Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/116.0.0.0 Safari/537.36”,
    “uuid”: “99281df6-085c-4063-84dc-fb4d7c004f91”
    }

    I unchecked every option in the plugin, and none of it fixed the 500 error. Any ideas? I am so grateful for any help!

    The page I need help with: [log in to see the link]

Viewing 10 replies - 1 through 10 (of 10 total)
  • Plugin Author Optimizing Matters

    (@optimizingmatters)

    Autoptimize logs a “doing it wrong” notice if (or rather when) Divi tries to clear AO’s cache when it shouldn’t, but that does not cause a 50x error. Can you check the actual PHP errorlog to see what exactly is logged (the actual error message seems not to be included)?

    Thread Starter emiliemartinez

    (@emiliemartinez)

    that’s awesome that it does that! But doesn’t seem to be related?

    This is what I’m seeing in the log:

    auditor:event=activated_plugin {\”plugin\”:\”autoptimize/autoptimize.php\”,\”network_activation\”:false,\”blog_id\”:1,\”event\”:\”activated_plugin\”,\”current_user_id\”:13,\”remote_addr\”:\”70.226.117.190\

    And when I download the log too. The site is currently down due to the plug-in. I realize that the site doesn’t actually help, but you can see it’s completely inaccessible.

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    that’s awesome that it does that! But doesn’t seem to be related?

    indeed not, as a notices do not cause 50X server errors

    error.auditor:event=activated_plugin {\”plugin\”:\”autoptimize/autoptimize.php\”,\”network_activation\”:false,\”blog_id\”:1,\”event\”:\”activated_plugin\”,\”current_user_id\”:13,\”remote_addr\”:\”70.226.117.190\

    afraid this does not contain a PHP error as such :-/

    A typical PHP errormessage looks something like this:
    [01-Nov-2020 13:15:17 UTC] PHP Fatal error: require(): Failed opening required '/var/www/html/wp-content/plugins/autoptimize/classes/autoptimizeUtils.php' (include_path='.:/usr/share/php') in /var/www/html/wp-content/plugins/autoptimize/autoptimize.php on line 72

    afraid we need such details to be able to troubleshoot this further :/

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    any news on the exact PHP errormessage emiliemartinez ?

    Thread Starter emiliemartinez

    (@emiliemartinez)

    Hey,

    Sorry for the delay, here’s that message:

    Fatal error: Uncaught TypeError: strpos(): Argument #3 ($offset) must be of type int, string given in /nas/content/live/wilderness1stg/wp-content/themes/wt/functions.php:341 Stack trace: #0 /nas/content/live/wilderness1stg/wp-content/themes/wt/functions.php(341): strpos(‘/’, ‘tell-us-your-st…’, ‘memories’) #1 /nas/content/live/wilderness1stg/wp-includes/class-wp-hook.php(308): my_ao_noptimize() #2 /nas/content/live/wilderness1stg/wp-includes/plugin.php(205): WP_Hook->apply_filters(false, Array) #3 /nas/content/live/wilderness1stg/wp-content/plugins/autoptimize/classes/autoptimizeMain.php(424): apply_filters(‘autoptimize_fil…’, false) #4 /nas/content/live/wilderness1stg/wp-content/plugins/autoptimize/classes/autoptimizeExtra.

    php(153): autoptimizeMain::should_buffer() #5 /nas/content/live/wilderness1stg/wp-includes/class-wp-hook.php(310): autoptimizeExtra->run_on_frontend(Object(WP)) #6 /nas/content/live/wilderness1stg/wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters(NULL, Array) #7 /nas/content/live/wilderness1stg/wp-includes/plugin.php(565): WP_Hook->do_action(Array) #8 /nas/content/live/wilderness1stg/wp-includes/class-wp.php(796): do_action_ref_array(‘wp’, Array) #9 /nas/content/live/wilderness1stg/wp-includes/functions.php(1335): WP->main(”) #10 /nas/content/live/wilderness1stg/wp-blog-header.php(16): wp() #11 /nas/content/live/wilderness1stg/index.php(17): require(‘/nas/content/li…’) #12 {main} thrown in /nas/content/live/wilderness1stg/wp-content/themes/wt/functions.php on line 341

    Any thoughts? ??

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    OK, so a conflict between the theme and AO. can you copy/paste the contents of wilderness1stg/wp-content/themes/wt/functions.php into a pastebin.com paste or a github gist so I can check the theme’s code?

    Thread Starter emiliemartinez

    (@emiliemartinez)

    Thanks again for your patience. Here’s a git of that file ??

    https://github.com/emiliekmartinez/wildernesstrek/blob/main/functions.php

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    you’ll probably have to change

    if (strpos($_SERVER['REQUEST_URI'],'tell-us-your-story','memories')!==false) {
    into

    if ( strpos( $_SERVER['REQUEST_URI'], 'tell-us-your-story' ) !== false || strpos( $_SERVER['REQUEST_URI'], 'memories' ) !== false ) {

    (warning; untested code) because the 3rd parameter strpos expects is the “offset” which has to be an int, but it’s getting a string (memories) instead. hence the error

    Fatal error: Uncaught TypeError: strpos(): Argument #3 ($offset) must be of type int, string given in /nas/content/live/wilderness1stg/wp-content/themes/wt/functions.php:341

    but even easier would be to simply remove the code (lines 338-346) and instead on the “edit” view of those pages use the “autoptimize this page” metabox to disable autoptimize on those pages without having to code ??

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    have you had the chance to look into these possible solutions emiliemartinez ? ??

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    No feedback so I assume this got resolved Emilie? Feel free to follow up if you still encounter issues!

    have a nice day!
    frank

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘500 Error Critical Error’ is closed to new replies.