• Resolved BumpStop

    (@bumpstop)


    Hello Jeff,

    I’m been testing User Submitted Posts Lite on my site to showcase vanity license plates. So far, it’s been great and we would like to upgrade, but we are having a slight programming/timing issue with a plugin called WordPress to Buffer Pro. Basically, this other plugin takes a post as it’s been created, packages it up to push to the Buffer service, which in turn publishes the post on various social media sites. This all happens instantaneously as the post is being created and published.

    The BP plugin works great, except for using with Instagram, it never detects the featured image during the initial creation process. The featured image works if you manually bulk publish posts or force it to run an one off push to Instagram after the fact that it’s being created. This is not ideal as the whole idea of this Buffer Pro plugin was to automate publishing posts to social media without intervention from our staff.

    After some back and forth with the developer, they are saying logic that is used in USP plugin is creating the post and triggers is not the default WP logic which is causing the issue.

    (I’m just cutting and pasting what they sent me below)

    ——–

    USP Logic (reason why the featured image isn’t seen on post creation)
    – creates a new WordPress Post in draft mode, using wp_insert_post()
    – updates the post, transitioning its status from draft to publish, using wp_update_post(). WordPress to Buffer Pro rightly acts on this post transition status (as many editorial and other content-related Plugins do), and attempts to send status(es) to Buffer per Plugin configuration,
    – THEN, on save, it uploads the the Featured Image (assuming this is defined in USP settings) – The featured image is then not attached to the post ID which we rely upon. It is assigned until after the fact, hence you get that featured image is missing issue you are seeing in your WordPress to Buffer Pro logs and not posting to Instagram automatically. It works for you after the fact as the ID is attached and you are manually re-running the trigger again or bulk publishing. The feature image is seen and Instagram is happy.

    WP Buffer Pro Logic based on WP default logic
    – when you create a new Post, it is immediately assigned a Post ID and its status set to draft
    – upload an image as a Featured Image, which attaches it to the Post ID
    – upon publishing a Post, transitioning its status from draft to publish, using wp_insert_post(). WordPress to Buffer Pro rightly acts on this post transition status (as many editorial and other content-related Plugins do), and attempts to send status(es) to Buffer per Plugin configuration. As a Featured Image is available during this and attached to the Post, it will succeed for Instagram. Problem solved. Cron doesn’t solve this as we are getting our logic for Buffer from the transition status and it would still fail later.

    If they changed their logic to rely on the default posting logic and trigger of uploading the featured image during creation, it would see the Featured Image ID initially, then your Instagram issue would be resolved. Of course we could provide a special patch for you, but changing the logic that’s outside of the default WP logic is not ideal for us and wouldn’t really be supported for future enhancements of either plugin.

    We suggest using another User Submitted Post plugin or ask the developer to change their code slightly to upload the image during the creation of the post instead of loading after.

    ————-

    In the end, it sounds like if the featured image was uploaded during the creation process of the User Submitted post, instead of uploading during the save, this would solve the issue as the ID would be assigned already for that draft to publish status.

    Is this something that can easily be done in User Submitted Posts on future releases or does that force you to change your model too drastically?

    Any help or thoughts appreciated. This would solve a lot of headache of trying to automate our process and it could help others with issues like this too.

    Thanks,
    Garrett

    The page I need help with: [log in to see the link]

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author Jeff Starr

    (@specialk)

    Hey Garrett, I’ve made the suggested changes in the next version of USP (20200817), so that the featured image is set immediately after post creation, so the ID is assigned properly. Should do the trick, let me know if any further adjustments need made. New version should be available within the next couple of days.

    • This reply was modified 4 years, 3 months ago by Jeff Starr. Reason: adds info
    Thread Starter BumpStop

    (@bumpstop)

    Thank you. I look forward to trying it and will let you know.

    Thread Starter BumpStop

    (@bumpstop)

    Hi Jeff,

    I think this just rolled out and I have tested it. Unfortunately, this didn’t make a change. Should I contact the other developer and tell them what you did? Can you give a little more specifics?

    The issue is on the initial. That’s where they are grabbing the info and sending it over to Buffer Pro, but the featured image ID is not set. If I re-run a manual push after the save fact, it always works, it’s just this initial save.

    Any ideas?

    Garrett

    Plugin Author Jeff Starr

    (@specialk)

    I reworked a lot of code to try and accommodate the other plugin. Everything described in the above post has been implemented as described. Not sure what else to do. Maybe if you want to ask the developer what else needs to happen, I can see about doing that as well. Glad to help with integration with other plugins, but I have only so much time for it.

    Thread Starter BumpStop

    (@bumpstop)

    Sorry for the delay, it went to my spam and I didn’t check back in. I’m asking the other developer for any ideas. I will get back to you once I know. I appreciate the quick response.

    Garrett

    Plugin Author Jeff Starr

    (@specialk)

    Yeah ask the person to be specific with any code that needs to be changed. Knowing exactly what needs to happen will help to ensure it works, etc.

    @specialk

    In usp_createPublicSubmission(), You need to call usp_attach_images() before the wp_update_post() which performs the Post’s status transition from pending to publish.

    WordPress to Buffer, as well as numerous editorial Plugins, rely on status transitions to perform a number of tasks, and reasonably expect a published Post to have complete data (including a Featured Image, if supplied). WordPress does the same, ensuring that any supplied Featured Image is attached to the Post before it is published or updated.

    I believe this is a feasible change, but if this isn’t possible, let me know.

    Thanks.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Featured Image issue when using with WordPress to Buffer Pro’ is closed to new replies.