• Resolved Zeno Popovici

    (@zenopopovici)


    Somehow the purge_post_on_update is called on the login page?! and because  $post_type_object = get_post_type_object($post_type); is null, the following condition errors out:`Somehow the purge_post_on_update is called on the login page?! and because  $post_type_object = get_post_type_object($post_type); is null, the following condition errors out:

    if ((defined('DOING_AUTOSAVE') && DOING_AUTOSAVE) || 'revision' === $post_type  || !$post_type_object->public) {
        return;
    }
    2023/01/17 13:41:18 [error] 746#746: *689 FastCGI sent in stderr: "PHP message: PHP Warning:  Attempt to read property "public" on null in /home/vsp/xxxx.com/dist-wp/wp-content/plugins/wp-optimize/cache/class-wpo-cache-rules.php on line 146PHP message: PHP Warning:  Attempt to read property "public" on null in /home/vsp/xxxx.com/dist-wp/wp-content/plugins/wp-optimize/cache/class-wpo-cache-rules.php on line 146PHP message: PHP Warning:  Attempt to read property "public" on null in /home/vsp/xxxx.com/dist-wp/wp-content/plugins/wp-optimize/cache/class-wpo-cache-rules.php on line 146PHP message: PHP Warning:  Attempt to read property "public" on null in /home/vsp/xxxx.com/dist-wp/wp-content/plugins/wp-optimize/cache/class-wpo-cache-rules.php on line 146PHP message: PHP Warning:  Attempt to read property "public" on null in /home/vsp/xxxx.com/dist-wp/wp-content/plugins/wp-optimize/cache/class-wpo-cache-rules.php on line 146PHP message: PHP Warning:  Attempt to read property "public" on null in /home/vsp/xxxx.com/dist-wp/wp-content/plugins/wp-optimize/cache/class-wpo-cache-rules.php on line 146PHP message: PHP Warning:  Attempt to read property "public" on null in /home/vsp/xxxx.com/dist-wp/wp-content/plugins/wp-optimize/cache/class-wpo-cache-rules.php on line 146" while reading response header from upstream, client: xxx.xxx.xxx.xxx, server: xxxx.com, request: "GET /wp-login.php?redirect_to=https%3A%2F%2Fxxxx.com%2Fwp-admin%2F&reauth=1 HTTP/1.1", upstream: "fastcgi://unix:/run/php/php8.1-fpm-vsp.sock:", host: "xxxx.com"
    2023/01/17 13:41:18 [error] 746#746: *689 upstream sent too big header while reading response header from upstream, client: xxx.xxx.xxx.xxx, server: xxxx.com, request: "GET /wp-login.php?redirect_to=https%3A%2F%2Fxxxx.com%2Fwp-admin%2F&reauth=1 HTTP/1.1", upstream: "fastcgi://unix:/run/php/php8.1-fpm-vsp.sock:", host: "xxxx.com"

    The soution is to check for null in the same if

    if ((defined('DOING_AUTOSAVE') && DOING_AUTOSAVE) || 'revision' === $post_type || $post_type_object == null || !$post_type_object->public) {
        return;
    }
Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Contributor Venkat Raj

    (@webulous)

    The function purge_post_on_update is hooked to save_post and wp_trash_post action hooks. Theoretically it won’t fire on login page.

    Anyways, it is good to write defensive code, so we will add this null check in the upcoming release.

    Thread Starter Zeno Popovici

    (@zenopopovici)

    Hi@webulous, I’m also wondering what other interaction with other plugins causes the call to be made on the login screen.
    I just had to fix the problem without disabling the plugin as it is the best in its class and we can’t live without it 🙂

    Thanks for adding this in the next release!

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Bad Gateway 502 on WordPress Login’ is closed to new replies.