Solution for SNAP Not Works with Scheduled Posts WordPress
Last week i met such problem in the website of friend: NextScripts: Social Networks Auto-Poster (SNAP) could publish any post to social media when you publish wp post manually. But when you scheduled it and then WP Cron publihed it, SNAP failed each time.
I googled the problem and in my surprise saw that there was no any evident solution for that. Every responders told that it should work by default. But it didn’t. So, i investigated it myself and solved the problem.
The problem was in another plugin’s code.
Some plugins have piece of code which are inserted to code without WP hooks. And we the Cron calls WP, that’s un-hooked codes cause fatal error. WP publishing happends, but after that some un-hooked code cause fatal error and process stops. That’s why SNAP can’t event start publishing because of system’s fatal error.
So we should just detect such plugins and remove/disable them. That will solve the problem.
How to detect them.
It is easy.
- Go to your wp-config.php, change WP_DEBUG constant value from false to true.
- Add this two lines after wp_debug defined row.
define( 'WP_DEBUG_LOG', true );
define( 'WP_DEBUG_DISPLAY', false );
- Schedule any post for 1-2 minutes later and wait schedule happening.
- Then go to your wp-content folder, you will see WP log file there. Open it.
- You should see some fatal error there. See which plugin causes that and remove that plugin.
- Schedule any post again, SNAP will work now!