• Resolved sweetheatmn

    (@sweetheatmn)


    The FIFU plugin causes a Fatal error when inserting a new post programmatically using wp_insert_post function when Web Stories plugin is enabled

    WordPress Automatic Plugin is an auto posting plugin that can import from any site to WordPress posts

    The Fatal error that prevented the post insertion was triggered by WebStories when validating the type of the post_parent insider the data array

    our plugin did not set the post_parent to a string but it was passed as integer to your plugin and your FIFU plugin converted its type to a string which then was the root cause of the issue

    Issue was caused on this file where you str_replace the whole data array

    data array contains not only strings but contains Integer also like the post_parent and the menu_order

    passing an array to to the str_replace will loop all keys of this array and result in its value to be a string even if this was integer

    please correct this issue but only doing the search and replace on the content or desired keys and do not apply it to the whole array and convert integers to strings

    to check the types of the array passed by WordPress do use var_dump(data); before doing your modifications and after doing them to see how the types got changed

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Marcel

    (@marceljm)

    Hi, @sweetheatmn.

    The FIFU plugin causes a Fatal error when inserting a new post programmatically using wp_insert_post function when Web Stories plugin is enabled

    Please show me how exactly you are calling wp_insert_post.

    WordPress Automatic Plugin is an auto posting plugin that can import from any site to WordPress posts

    This is not a free plugin. The forum guidelines don’t allow you and me to talk about that here. You can access our website and use the email support.

    our plugin

    What’s your plugin? Did you develop that?

    Thread Starter sweetheatmn

    (@sweetheatmn)

    Hi @marceljm,

    Thanks for your timely response.

    Yes, we developed this plugin that inserts the posts and it uses the official wp_insert_posts plugin normally by providing the post title and post content

    as you has a filter on wp_insert_post_data, WordPress sends you the post array containing all the info before inserting the post but you then use str_replace that will return a string and that converts the post_parent type from an Int to a string

    str_replace can search and replace for a test and returns a text, you have called it on the whole array and this is the issue as shown on the previous screenshot

    as shown on the screenshot, you want to modify the post_content only so please change your code to do the search and replace to the post_content only and not the whole Array

    $data['post_content'] = str_replace( $content, $cleanContent, $data['post_content'];

    Regards,Atef

    Plugin Author Marcel

    (@marceljm)

    Nice to meet you, Atef.

    I’m trying to contact you for a long time to try to make a better integration with WordPress Automatic Plugin.

    We’ll implement all fixes/changes you need. But, as I said, we can’t keep talking about that here because your plugin isn’t free.

    Forum Guidelines

    Please access our website https://fifu.app/ and get our support email. Please attach an updated version of your plugin. Then I can test the changes you’ve suggested. Thanks.

    Plugin Author Marcel

    (@marceljm)

    It’s fixed, @sweetheatmn.

    Please CONTACT ME if you need something else. Maybe we can work together and help each other.

    Many WP Automatic users contact us saying that FIFU doesn’t work because many times the posts created by WP Automatic have no image. I imagine it happens because the feed has no image, but your customers (dozens of them at least) think it’s FIFU fault. If you could make it clear for your customers it would be great for everyone.

    For that situation, we have some scrape features as well. Maybe you could recommend our features with an affiliate link. Then we would pay you 10%, Atef.

    Thread Starter sweetheatmn

    (@sweetheatmn)

    Hi @marceljm ,

    Thanks for your consideration and feedback.

    Regards,Atef

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Compatibility issue with WP Automatic & WEB Stories’ is closed to new replies.