[02-Jun-2025 13:31:00 UTC] PHP Warning: Attempt to read property “post_title” on null in /home/site/public_html/wp-content/plugins/ays-popup-box/public/class-ays-pb-public.php on line 3196 [02-Jun-2025 13:31:00 UTC] PHP Warning: Attempt to read property “post_type” on null in /home/site/public_html/wp-content/plugins/ays-popup-box/public/class-ays-pb-public.php on line 3199
Thousands of these. Please advise. We are using version 5.3.2
I want to mention that we tested this case with the version you mentioned, but didn’t get those warnings on our end.
Could you please place the popup on a Test page and provide us with the link to it so we can take a closer look? Also, let us know if these warnings started appearing after updating to this version or if they were there before, too.
It was occurring prior to this release. We don’t currently have any pop-ups live, but there were two still active. They were date restricted. However, we were still getting the errors. I added one to a test page for you to review here so hopefully that helps. Thanks!
Please let us know the following. Have you previously had a post where the popup was located, and then later you deleted that post? Or maybe you had a post that was included in the popup’s settings, and that post was later deleted or made private?
These questions arise because the warning you’re seeing suggests that the popup is trying to load on a post but cannot find it.
The warning:
[02-Jun-2025 13:31:00 UTC] PHP Warning: Attempt to read property "post_title" on null in /home/site/public_html/wp-content/plugins/ays-popup-box/public/class-ays-pb-public.php on line 3196 [02-Jun-2025 13:31:00 UTC] PHP Warning: Attempt to read property "post_type" on null in /home/site/public_html/wp-content/plugins/ays-popup-box/public/class-ays-pb-public.php on line 3199
In the screenshot below you can see the lines mentioned in the warning message:
It was not a one-time occurrence. The only pop-ups in the plugin were all assigned to the home page, pages, and test pop-up page (usually put here first to test), which is the url that was included in the last thread. None of the pop-ups are active/published, except for the one I reactivated for you to see the page so I don’t know why it is looking for anything. It seems odd that it would be trying to find a post to display on if it’s not published.
My answers below:
Have you previously had a post where the popup was located, and then later you deleted that post?
Hard to say…I think that is a common scenario for any wordpress site and I cannot say for sure because I am not tracking the pages that we assign pop-ups to over any period of time.If the pop-up is not published, why is it actively looking to populate a page/post anyway?
Or maybe you had a post that was included in the popup’s settings, and that post was later deleted or made private?
Same answer as above.
I just checked the error log and it’s starting to fill again. Thousands. It’s the only error in the log. Please advise.
For other readers, the customer contacted us via email, we provided the fixed zip file for the issue, and the problem was resolved. Also, we have included the fix in the latest update of the plugin (v5.3.5). You can update to the latest version and be sure the problem is resolved there.