sndrs
Forum Replies Created
-
Hi @mjuhl2003 , good news, found a fix for the issue, and more importantly, I found the root cause.
I’ve added all information below. Good luck! 😉
(credit to my Claude AI companion 😉 )For me the cause was orphaned post-meta, causing the queries exceed default limits.
By using the plugin “WP Sweep”, I could clean up the orphaned postmeta first and then “optimize” all tables secondly. This fixes the issue.50% of my post meta table were orphans, and it seems that something in Elementor caused it. You can see that with WP Sweep if you “view details”. So it might be necessary to check orphans later again.
WP Sweep is the easy way via the wordpress admin. On my staging environment, I could also fix it manually in the DB with a SQL query, which also works (don’t forget to update your table prefix in the snippets below):
DELETE pm FROM stg_f5560_postmeta pmÂ
LEFT JOIN stg_f5560_posts p ON p.ID = pm.post_idÂ
WHEREÂ p.IDÂ ISNULL;+ optimize the table:
OPTIMIZEÂ TABLEÂ stg_f5560_postmeta;If you’re not able to do this, there was also a very general fix without cleanup, by adding the following snippet to your functions.php
But I don’t think it is a best practice, to be honest. It might go wrong, if there’s really an issue with the post-meta size.// Allow large MySQL SELECTs for PublishPress Notifications
add_filter('query', function($query) {
if (strpos($query, 'psppnotif_workflow') !== false) {
global $wpdb;
$wpdb->query('SET SQL_BIG_SELECTS=1');
}
return $query;
});FYI @rizaprihananto , I guess the DB queries could be improved, so orphaned post meta is ignored, but I’m not an expert… 🙂
For the record, the original DB error below (as my debug log no longer exists)[24-Mar-2026 20:59:57 UTC] WordPress database error The SELECT would examine more than MAX_JOIN_SIZE rows; check your WHERE and use SET SQL_BIG_SELECTS=1 or SET MAX_JOIN_SIZE=# if the SELECT is okay for query SELECT stg_f5560_posts.*
FROM stg_f5560_posts LEFT JOIN stg_f5560_postmeta ON ( stg_f5560_posts.ID = stg_f5560_postmeta.post_id ) LEFT JOIN stg_f5560_postmeta AS mt1 ON ( stg_f5560_posts.ID = mt1.post_id ) LEFT JOIN stg_f5560_postmeta AS mt2 ON ( stg_f5560_posts.ID = mt2.post_id AND mt2.meta_key = '_psppno_evtcontposttype' ) LEFT JOIN stg_f5560_postmeta AS mt3 ON ( stg_f5560_posts.ID = mt3.post_id ) LEFT JOIN stg_f5560_postmeta AS mt4 ON ( stg_f5560_posts.ID = mt4.post_id AND mt4.meta_key = '_psppno_evtcontcategory' ) LEFT JOIN stg_f5560_postmeta AS mt5 ON ( stg_f5560_posts.ID = mt5.post_id ) LEFT JOIN stg_f5560_postmeta AS mt6 ON ( stg_f5560_posts.ID = mt6.post_id AND mt6.meta_key = '_psppno_evtconttaxonomy' )
WHERE 1=1 AND (
( stg_f5560_postmeta.meta_key = '_psppno_evtpostupdate' AND stg_f5560_postmeta.meta_value = '1' )
AND
(
( mt1.meta_key = '_psppno_evtcontposttype' AND mt1.meta_value = '0' )
OR
( mt1.meta_key = '_psppno_evtcontposttype' AND mt1.meta_value = '' )
OR
( mt1.meta_key = '_psppno_evtcontposttype' AND mt1.meta_value = '' )
OR
mt2.post_id IS NULL
OR
( mt1.meta_key = '_psppno_posttype' AND mt1.meta_value = 'page' )
)
AND
(
( mt3.meta_key = '_psppno_evtcontcategory' AND mt3.meta_value = '0' )
OR
( mt3.meta_key = '_psppno_evtcontcategory' AND mt3.meta_value = '' )
OR
( mt3.meta_key = '_psppno_evtcontcategory' AND mt3.meta_value = '' )
OR
mt4.post_id IS NULL
OR
( mt3.meta_key = '_psppno_whencategory' AND mt3.meta_value IN ('') )
)
AND
(
( mt5.meta_key = '_psppno_evtconttaxonomy' AND mt5.meta_value = '0' )
OR
( mt5.meta_key = '_psppno_evtconttaxonomy' AND mt5.meta_value = '' )
OR
( mt5.meta_key = '_psppno_evtconttaxonomy' AND mt5.meta_value = '' )
OR
mt6.post_id IS NULL
OR
( mt5.meta_key = '_psppno_whenterm' AND mt5.meta_value IN ('') )
)
) AND stg_f5560_posts.post_type = 'psppnotif_workflow' AND ((stg_f5560_posts.post_status = 'publish')) AND stg_f5560_posts.post_name NOT IN ('revision-scheduled-publication','scheduled-revision-is-published','revision-scheduled','revision-is-scheduled','revision-declined','revision-deferred-or-rejected','revision-submission','revision-is-submitted','new-revision','new-revision-created','revision-status-changed','revision-is-applied','revision-is-published') AND stg_f5560_posts.post_name NOT LIKE 'revision-scheduled-publication-%' AND stg_f5560_posts.post_name NOT LIKE 'scheduled-revision-is-published-%' AND stg_f5560_posts.post_name NOT LIKE 'revision-scheduled-%' AND stg_f5560_posts.post_name NOT LIKE 'revision-is-scheduled-%' AND stg_f5560_posts.post_name NOT LIKE 'revision-declined-%' AND stg_f5560_posts.post_name NOT LIKE 'revision-deferred-or-rejected-%' AND stg_f5560_posts.post_name NOT LIKE 'revision-submission-%' AND stg_f5560_posts.post_name NOT LIKE 'revision-is-submitted-%' AND stg_f5560_posts.post_name NOT LIKE 'new-revision-%' AND stg_f5560_posts.post_name NOT LIKE 'new-revision-created-%' AND stg_f5560_posts.post_name NOT LIKE 'revision-status-changed-%' AND stg_f5560_posts.post_name NOT LIKE 'revision-is-applied-%' AND stg_f5560_posts.post_name NOT LIKE 'revision-is-published-%' AND stg_f5560_posts.post_name NOT IN ('post-status-changed','post-deferred-or-rejected','post-declined') AND stg_f5560_posts.post_name NOT LIKE 'post-status-changed-%' AND stg_f5560_posts.post_name NOT LIKE 'post-deferred-or-rejected-%' AND stg_f5560_posts.post_name NOT LIKE 'post-declined-%'
GROUP BY stg_f5560_posts.ID
ORDER BY stg_f5560_posts.post_date DESC
made by get_default_post_to_edit, wp_after_insert_post, do_action('wp_after_insert_post'), WP_Hook->do_action, WP_Hook->apply_filters, PP_Improved_Notifications->action_update_post, do_action('publishpress_notifications_trigger_workflows'), WP_Hook->do_action, WP_Hook->apply_filters, PublishPress\Notifications\Workflow\WorkflowsController->trigger_workflows, PublishPress\Notifications\Workflow\WorkflowsController->get_workflows_filter_query, WP_Query->__construct, WP_Query->query, WP_Query->get_posts@rizaprihananto were you able to check out the database error in de debug log I provided ?
thanks
Hi again @rizaprihananto @mjuhl2003 ,
I enabled the PHP debug logs in the wpconfig, and see there’s a database error related to the publishpress plugin, the moment a notification should be triggered:
I don’t know if you can access the clean debug log (with only this error):
https://airlineassociations.be/stg_f5560/wp-content/debug.log
I hope this can help clarifying what is going on.
thx- This reply was modified 2 months, 2 weeks ago by sndrs.
Hi @rizaprihananto, @mjuhl2003
I’m having exactly (and I really mean exactly) the same issue. Suddenly no notifications anymore, the notifications log is empty. Emails and smtp configuration works.
Same timeframe as mentioned, since the problems occur, but hard to pin point, as notifications are not sent out on a daily basis.
Also hosting one.com, but I want to confirm that the hosting provider could not find any issues causing this. Btw, a very similar but other site and setup using Planner notifications, works well (also hosted on one.com).
I like to add to that, that by using duplicator and installing the site on a temporary separate environment works.
I’ve tried everything I can think of. I really need assistance on this, and hope we can solve this out.
The issue is very hard to troubleshoot.
Thanks!We found the cause / solution.
apparently, there was a line in my wp-config:
define( ‘WP_ENVIRONMENT_TYPE’, ‘local’ );I really don’t know why it was there, in the production site, or how it got there. I’ll try to figure this out, but anyway, I see Google analytics sessions coming in right away 🙂
Thank you for your time.
Hi Adam, thank you for checking in.
Browserextensions: no luck.
No other updates yet. I’ve just contacted the hosting support.Hi,
It took me a few days, but I’ve setup the wordpress environment, and I’ve setup site kit with my account. However I see the data is “still collecting” in the plugin (expected behavior), I already see the code snippit appearing in the HTML. So that setup seems to work fine.
Regarding Sucuri, I’ve turned off the plugin completely and checked in a separate browser, incognito. No luck.
Any more ideas?Also tried the troubleshooting mode. I think we can rule out a plugin or theme conflict, as the snippet doesn’t seem inserted.
I will send you some security measures that are currently active on the website, via the form. Maybe it’s related to that?I deactivated all plugins except site kit for a while, no luck: the snippet wasn’t inserted.
Hi Adam, thanks for getting back at me.
I’ve setup and created the property via the Sitekit flow. And I did this more than once.
In Google Analytics I see the same for this property: no data.
The property says in the settings it is connected to site kit, but it’s not receiving any data.(I’ve shared some more details via the form)