Title: PHP Warning when 503 error on site
Last modified: July 8, 2026

---

# PHP Warning when 503 error on site

 *  [AWOL](https://wordpress.org/support/users/awol/)
 * (@awol)
 * [1 week ago](https://wordpress.org/support/topic/php-warning-when-503-error-on-site/)
 * Hello,
 * This is an AI assisted post to describe both the issue and solution for it, which
   I hope is both correct and can be implemented.
 * I noticed a PHP warning generating in my site’s debug logs during edge cases 
   when the global `$post` object is not populated (such as server error pages, 
   empty search queries, or archive views).
 * Because the plugin evaluates block conditions globally, it attempts to read the
   post name property even if the post object itself evaluates to null.
 * **The Warning:**
   `PHP Warning: Attempt to read property "post_name" on null in/
   wp-content/plugins/wicked-block-conditions/classes/condition/class-post-slug.
   php on line 41`
 * **The Cause:**
   On line 41 of `classes/condition/class-post-slug.php`, the plugin
   executes a comparison:`return $this->slug == $post->post_name;`
 * If `$post` is null, reading the property triggers the warning.
 * **Suggested Fix:**
   To safely handle cases where `$post` is not an object, line
   41 can be updated to explicitly verify the object status and property existence
   before running the comparison. Replacing line 41 with the following structure
   resolves the issue entirely while maintaining the exact intended conditional 
   logic:
 * php
 *     ```wp-block-code
       return is_object( $post ) && isset( $post->post_name ) && $this->slug == $post->post_name;
       ```
   
 * Could you please consider including this null-safety check in the next plugin
   update to keep the debug logs clean?
 * Thank you for your time and for maintaining this helpful plugin!

You must be [logged in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fphp-warning-when-503-error-on-site%2F%3Foutput_format%3Dmd&locale=en_US)
to reply to this topic.

 * ![](https://ps.w.org/wicked-block-conditions/assets/icon-256x256.png?rev=2941036)
 * [Wicked Block Conditions](https://wordpress.org/plugins/wicked-block-conditions/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wicked-block-conditions/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wicked-block-conditions/)
 * [Active Topics](https://wordpress.org/support/plugin/wicked-block-conditions/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wicked-block-conditions/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wicked-block-conditions/reviews/)

 * 0 replies
 * 1 participant
 * Last reply from: [AWOL](https://wordpress.org/support/users/awol/)
 * Last activity: [1 week ago](https://wordpress.org/support/topic/php-warning-when-503-error-on-site/)
 * Status: not resolved