Wordpress Post Sync - import not working

I just installed the plugin on WP and I created only 1 post on my Patreon. When I try to import it I have a message that tells me that the import is in progress, but after two hours of waiting I think there’s a problem but I don’t know witch one.

Can you access your web host’s logs to see if there are any errors logged?

Here are the relevant logs I found, thanks for your help.

[21-Jun-2020 18:15:07 UTC] PHP Notice:  Undefined index: page in /home/nawiellild/www/wp-content/plugins/patron-plugin-pro/plugin/plugin.php on line 5142
[21-Jun-2020 18:15:07 UTC] PHP Warning:  Declaration of Quiet_Skin::feedback($string) should be compatible with WP_Upgrader_Skin::feedback($string, ...$args) in /home/nawiellild/www/wp-content/plugins/patron-plugin-pro/plugin/includes/upgrader_skin.php on line 25
[21-Jun-2020 18:15:07 UTC] PHP Notice:  Undefined index: activated in /home/nawiellild/www/wp-content/plugins/patron-plugin-pro/plugin/plugin.php on line 1095
[21-Jun-2020 18:15:09 UTC] PHP Notice:  Undefined index: L’authenticité de <span class="code">patron-button-and-widgets-by-codebard.2.0.9.zip</span> n'a pas pu être vérifiée car aucune signature n’a été trouvée. in /home/nawiellild/www/wp-content/plugins/patron-plugin-pro/plugin/includes/upgrader_skin.php on line 17
[21-Jun-2020 18:56:31 UTC] PHP Notice:  Trying to get property 'ID' of non-object in /home/nawiellild/www/wp-content/plugins/patron-plugin-pro/plugin/plugin.php on line 2254
[21-Jun-2020 18:56:31 UTC] PHP Notice:  Trying to get property 'ID' of non-object in /home/nawiellild/www/wp-content/plugins/patron-plugin-pro/plugin/plugin.php on line 2293

There doesnt seem anything that is relevant to post sync in the logs.

There may be a chance that cron at your WP site may not be working. Post sync requires cron to work.

After a few tests, it seems I had a auth error, so I disconnected and reconnected my Patreon to my WP, and I don’t have this error anymore, but I have a new one

[22-Jun-2020 17:06:55 UTC] PHP Fatal error:  Uncaught ArgumentCountError: Too few arguments to function Patreon_Content_Sync::check_replace_patreon_images_with_local_images(), 2 passed in /home/nawiellild/www/wp-content/plugins/patreon-connect/classes/patreon_content_sync.php on line 173 and exactly 3 expected in /home/nawiellild/www/wp-content/plugins/patreon-connect/classes/patreon_content_sync.php:315
Stack trace:
#0 /home/nawiellild/www/wp-content/plugins/patreon-connect/classes/patreon_content_sync.php(173): Patreon_Content_Sync->check_replace_patreon_images_with_local_images('<p><img data-me...', Array)
#1 /home/nawiellild/www/wp-content/plugins/patreon-connect/classes/patreon_content_sync.php(131): Patreon_Content_Sync->add_new_patreon_post(Array)
#2 /home/nawiellild/www/wp-content/plugins/patreon-connect/classes/patreon_content_sync.php(89): Patreon_Content_Sync->add_update_patreon_post(Array)
#3 /home/nawiellild/www/wp-content/plugins/patreon-connect/classes/patreon_wordpress.php(2780): Patreon_Content_Sync->import_posts_from_patreon()
#4 /home in /home/nawiellild/www/wp-content/plugins/patreon-connect/classes/patreon_content_sync.php on line 315

Do you have any plugins that modify images, media library or image handling at your site?

I have few plugins who may do this :

  • Regenerate Thumbnails
  • Recent Posts Widget With Thumbnails
  • Jetpack (I have an option to optimize image loading)

After digging through the Patreon Wordpress (patreon-connect) plugin code, I’ve found the method Patreon_Content_Sync::check_replace_patreon_images_with_local_images must be always called with 3 parameters, but the third parameter $post_id is missing when being called in Patreon_Content_Sync::add_new_patreon_post method, throwing the fatal error and interrupting the post import. This only happens if there are some images in the post content.

For the record, I’ve been developing a quick fix by doing the following in the patreon-connect/classes/patreon_content_sync.php file:

  • move the lines 168:172 to line 203 (handle images after post has been inserted)
  • add $inserted_post_id as 3rd parameter to $this->check_replace_patreon_images_with_local_images
1 Like

Yes, indeed - thats why i asked: when the image processing functions cannot identify or pass in between them the image or detect the attachment, this issue may happen.

What is the Jetpack image feature you are using?

This is my settings

Can you try disabling Jetpack for a while and start an import and see if this will make any difference?

Unfortunately it does not work. I could only make the import thanks to the modification i was talking about earlier.

Are the images properly coming in right now, or still not?

Yes the initial import is finally done, thanks to the little fix I’ve written down in one of my previous comments.

This is a good find. A better way to do it may be to separately set the featured image by processing already inserted post. This will prevent having to update the post immediately after inserting to have the images added. Ill arrange a package with this change and i will provide it soon.

The below branch is now updated with the changes based on your finding:

Just give it a try and let me know.

If its easier, here is a zipped package from dropbox which you can directly install after deleting your existing Patreon Wordpress:

1 Like

Hello, I am having the same issue with importing my posts. However, I am not as savvy as the other person who was having an issue. I have no idea how to fix or look at my web host logs. Is there any way that you could walk me through how to fix this issue. Thank you in advance. Chantelle

What’s the exact issue Chantelle? Posts not importing despite WP saying a post import is in progress?

Yes, it has said post importing for over a day but nothing is happening. Thank you for the quick response.