• Resolved Greg Sullivan

    (@gregsullivan)


    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

Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter Greg Sullivan

    (@gregsullivan)

    (For clarity: It’s not just that the logs are empty; WP to Buffer isn’t triggered at all, so nothing is sent to the Buffer API.)

    Plugin Contributor wpzinc

    (@wpzinc)

    We’ll test this suggestion, and if it passes will add to the next version.

    Thanks.

    Thread Starter Greg Sullivan

    (@gregsullivan)

    Great, much appreciated!

    We’ve made this change in production, and WP to Buffer is now working on cron job imports from WP All Import.

    Plugin Contributor wpzinc

    (@wpzinc)

    Added to 3.2.9.

    Thread Starter Greg Sullivan

    (@gregsullivan)

    Awesome, thanks very much!

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Fix for WP All Import via cron resulting in empty logs’ is closed to new replies.