Fix for WP All Import via cron resulting in empty logs
-
Hello,
After debugging, I was able to determine why WP All Import was triggering WP to Buffer on manual imports, but not on imports via cron jobs. Similar import plugins that are triggered by wp_loaded during a cron job may also be affected. The relevant line of code is this one (in includes/admin/publish.php):
add_action( 'wp_loaded', array( $this, 'register_publish_hooks' ) );
I solved the problem simply by adding a priority of 1:
add_action( 'wp_loaded', array( $this, 'register_publish_hooks' ), 1 );
Without the priority of 1, the add_action was being called after all the posts had already been imported, so WP to Buffer’s publish function was never called, and nothing was logged.
Is this a change you would be open to making to the plugin? Is there somewhere I could submit it as a pull request? (I couldn’t find a public repository accepting pull requests, etc., for this plugin.)
Thanks,
Greg
- The topic ‘Fix for WP All Import via cron resulting in empty logs’ is closed to new replies.