Forum Replies Created

Viewing 1 replies (of 1 total)
  • I found this same problem. Normally I’d advise against editing a plugin, but since this one hasn’t been updated for a year, it may not be a bad idea in this case.

    This error is caused by an event that fires when a new post is published (The actual post publishes with no issue, but the event causes an error when WP redirects back to the post editor).

    If you look on Line 927 you’ll see something similar to the following:

    
        $response = json_decode($zemanta_response['body']);
        if (isset($response->status) !is_wp_error($zemanta_response)) {
            $status = $response->status;
        }
    

    That $zemata_response['body']); is what’s causing the error. You’ll see on the next line that the plugin developer actually excepted that variable to be a WP_Error sometimes, because they actually check to make sure that it’s not. The problem is, they are trying to access a value from an array before making sure that it <string>is.

    If you change that chunk of code to the following:

    
        if (!is_wp_error($zemanta_response) && isset($response->status)) {
            $response = json_decode($zemanta_response['body']);
            $status = $response->status;
        }
    

    The plugin will check to make sure the variable is not a WP_Error first, and then it will continue processing. If it is an error, the event will stop, and you will no longer see the error on publishing the post.

Viewing 1 replies (of 1 total)