Support » Plugin: WP2Social Auto Publish » Wrong image (possibly wrong priority?)

  • Hello,

    I am using WordPress Automatic Plugin (https://codecanyon.net/item/wordpress-automatic-plugin/1904470) to post articles to my website. However I noticed that it always posts the wrong image (the first one from the sidebar, rather than the featured image).

    I’ve already been debugging everything for 2 days. The og:image tags are correct, Facebook scrapes the article correctly, however it seems when WordPress Automatic plugin is adding new posts using wordpress cronjob, Facebook Auto Publish does not yet have the featured image.
    This leads me to believe that Facebook Auto Publish is triggered before WP Automatic has fully added the post with the image to WordPress.

    I see Facebook Auto Publish hooks into transition_post_status to get triggered, while WP Automatic uses wp_insert_post via wp cronjob.

    I assume transition_post_status gets triggered before wp_insert_post and that’s why it can’t retrieve the featured image picture?

    What can I do?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Are you using shared link/attach your blog post as the posting method ?
    Facebook auto publish sets the image(from post content/featured image) as og:image so that Facebook pick the correct image.
    It fetches the post contents as well as the featured image from database.
    The plugin auto publish only when the post status is changed to publish,so transition_post_status hook is used .
    Since this is a premium plugin ,i cannot be of much help.
    Please contact support desk.
    Thank you.

    Thread Starter Liddika

    (@liddika)

    Hello,

    Thank you for getting back to me. Yes, that is exactly what I mentioned. If you look up the WordPress documentation, you’ll see that transition_post_status is used before wp_insert_post, and many plugins that are hooked into creating a post, use wp_insert_post.

    I am using WP Automatic https://codecanyon.net/item/wordpress-automatic-plugin/1904470 along with https://wordpress.org/plugins/nelio-content/ to keep the images external.

    Both these plugins use wp_insert_post.

    That’s why I assume, Facebook Auto Publish already shares the link on Facebook before the article has been properly saved in the database, which results in wrong images.

    Facebook Auto Publish should have the lowest priority so that it’s triggered at the very end, to make sure every other plugin related to creating posts, has performed it’s task already.

    When we use ‘wp_insert_post’,it will autoposted at the time of insertion,wordpress posts should be autoposted when it is published in wordpress,that’s why transition_post_status is used.
    The premium plugin is able to schedule posts,that’s a solution to this issue, or you should make the posts as wordpress scheduled posts,so that the article has been properly saved in the database and the plugin will post at wordpress publish time(Or auto post only when editing article).
    Hope it helps.
    Thank you.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Wrong image (possibly wrong priority?)’ is closed to new replies.