• Resolved rainmanne

    (@rainmanne)


    Every time I make a post or update an existing post, Share on Mastodon gives me an error. This is from the automatic email:

    WordPress version 6.5.5
    Active theme: OceanWP (version 3.5.7)
    Current plugin: Share on Mastodon (version 0.19.0)
    PHP version 7.4.33 Error Details

    An error of type E_ERROR was caused in line 179 of the file /home/domain/website/wp-content/plugins/share-on-mastodon/includes/class-image-handler.php. Error message: Uncaught Error: Call to undefined function Share_On_Mastodon\mime_content_type() in /home/domain/website/wp-content/plugins/share-on-mastodon/includes/class-image-handler.php:179
    Stack trace:

    0 /home/domain/website/wp-content/plugins/share-on-mastodon/includes/class-post-handler.php(212): Share_On_Mastodon\Image_Handler::upload_image(5201, ‘KINSHI MASAMUNE…’, Array)

    /home/domain/website/wp-content/plugins/share-on-mastodon/includes/class-post-handler.php(129): Share_On_Mastodon\Post_Handler->post_to_mastodon(Object(WP_Post))

    /home/domain/website/wp-includes/class-wp-hook.php(326): Share_On_Mastodon\Post_Handler->toot(Object(WP_Post))

    /home/domain/website/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters(NULL, Array)

    /home/domain/website/wp-includes/plugin.php(517): WP_Hook->do_action(Array)

    /home/domain/website/wp-includes/post.php(4817): do_action(‘sa

    The post is published OK, but never shared on Mastodon.

    • This topic was modified 4 months, 3 weeks ago by rainmanne.
Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Jan Boddez

    (@janboddez)

    It looks like you have PHP installed without the mime_content_type function (or rather, the Fileinfo extension). Or that your web host has somehow disabled it.

    I’ll make sure to check for this in a next version of the plugin, although it could still mean posting images is not possible from your specific WordPress installation (but at least things wouldn’t break horribly anymore).

    Alternatively, I may be able to do a quick and dirty check based on file extension (which of course requires that your image have valid extensions). This wouldn’t be as “clean,” but it’s not really an issue (in the end it’s up to Mastodon to properly validate media files).

    Update: I think I may be able to cook up a valid fallback. Meanwhile, it’d be worth asking your hosting provider if or why this extension/function is disabled/blocked. They may be able to still enable it for you.

    • This reply was modified 4 months, 3 weeks ago by Jan Boddez.
    Plugin Author Jan Boddez

    (@janboddez)

    Think I have a working fix, still have to release it, though. Give it a day or two!

    Plugin Author Jan Boddez

    (@janboddez)

    Hi again, took a bit longer than a day or two, but version 0.19.1 should fix this.

Viewing 3 replies - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.