Forum Replies Created

Viewing 15 replies - 1 through 15 (of 45 total)
  • Plugin Author Wolfgang

    (@wolfgang101)

    Looked into implementing this and I’m sorry to say that this will not be added anytime soon to the plugin.

    If it was just filtering tags as string it would be very trivial. The Mastodon API returns the post content as HTML markup and the plugin would have to parse and manipulate the elements.

    Plugin Author Wolfgang

    (@wolfgang101)

    Glad you found it!

    Plugin Author Wolfgang

    (@wolfgang101)

    Update after more debugging (and for other users that face a similar issue).

    We tested the Custom HTML and Shortcode block inside a sidebar widget. The Custom HTML block produced clean output, but the shortcode block added <p> tags.

    After further research this seems to be a known issue since 17 years https://core.trac.www.ads-software.com/ticket/6984

    There are even plugins that try to mitigate the issue, but an easy workaround that seems to work fine right now is to just wrap the shortcode inside a <div>.

    This worked inside a shortcode block inside a sidebar widget:

    <div>[include-mastodon-feed instance="chaos.social" account="111784504453496359"]</div>
    Plugin Author Wolfgang

    (@wolfgang101)

    Hi. I looked at your blog and if I’m not mistaken you are using this theme that is from 2016? https://www.ads-software.com/themes/ari/

    The additional <p> tags are not produced by the plugin, but rather your WordPress installation. Best recommendation I can give is to use a contemporary theme that supports modern features like the WordPress Gutenberg block editor.

    When using either the “custom HTML” or “shortcode” block you will not get the <p> tags. Not sure what the corresponding widgets pre Guttenberg were. IIRC there was a “custom HTML” widget element too. Maybe also a shortcode element? Using those instead of a WISYWIG element will get rid of the <p> tags.

    Plugin Author Wolfgang

    (@wolfgang101)

    Thank you for the feedback.

    Can you help me understand better? Not sure if you want to completely hide the end tags, or if you would like the behavior of the vanilla mastodon UI:

    • separate end tags from the content
    • tease a few tags as buttons with a “more” link that reveals all of the tags if there are many

    Or something different?

    Plugin Author Wolfgang

    (@wolfgang101)

    @pkingtiger With version 1.9.4 you can now hide date/time or status meta information completely. Not yet sure how to go about avatar placement.

    The status meta information contains multiple elements and it seems overkill to make toggles for all elements and in addition multiple placements within the container. Affected elements:

    • Avatar (= Link to user feed)
    • Date/Time (= Link to toot)
    • “edited” indicator
    • “boost” indicator
    Plugin Author Wolfgang

    (@wolfgang101)

    Thank you for the high praise! Glad you like the plugin.

    Interesting ideas too. No promises on timeline, but makes sense to add those options.

    Plugin Author Wolfgang

    (@wolfgang101)

    Thank you so much for this high praise! Happy you like the plugin.

    Plugin Author Wolfgang

    (@wolfgang101)

    Glad I could help and that you got it running now!

    Another option might be to raise a support request with the theme developer, so that they can fix the wonky code injection.

    Plugin Author Wolfgang

    (@wolfgang101)

    Some image lazy loading plugin seems to break the JavaScript code. It tries to inject lazy loading code, but breaks the JavaScript code in the process:

    return string.replace(':' + emoji.shortcode + ':', '<img src="data:image/svg+xml,%3Csvg%20xmlns=%27https://www.w3.org/2000/svg%27%20width='0'%20height='0'%20viewBox=%270%200%200%200%27%3E%3C/svg%3E" loading="lazy" data-lazy="1" decoding="async" class="tf_svg_lazy emoji" data-tf-src="' + emoji.url + '" title="' + emoji.shortcode + '" /><noscript><img class="emoji" data-tf-not-load src="' + emoji.url + '" title="' + emoji.shortcode + '" /></noscript>');

    The original source code of the mastodon plugin looks like this:

    return string.replace(':' + emoji.shortcode + ':', '<img class="emoji" src="' + emoji.url + '" title="' + emoji.shortcode + '" />');

    Typically those optimization plugins allow to define exceptions. If you can define an exception for all images with the class “emoji” it should stop breaking the plugin.

    Other quick-fix would be to disable the plugin that breaks the JavaScript code.

    Can you provide me with the name of the image lazy loading / optimization / caching plugin that you are using? I might find some time to look into it a bit deeper.

    Plugin Author Wolfgang

    (@wolfgang101)

    You can add custom date options which the JavaScript function toLocaleString1 uses to display the date.

    Try this example:

    [include-mastodon-feed instance="SERVER-DOMAIN" account="YOUR-ID-HERE" date-locale="en-US" date-options="{year: 'numeric', month: 'short', day: 'numeric'}"]

    1. See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toLocaleString for more information

    Plugin Author Wolfgang

    (@wolfgang101)

    Thank you for your interest in the plugin and your feedback.

    From the plugin description

    Plugin that provides an [include-mastodon-feed] shortcode to easily integrate mastodon feeds into wordpress pages.

    The plugin is written in PHP and generates native JavaScript to fetch and render the mastodon feed. No special libraries needed.

    It does not generate any IFrames or wordpress posts at all. It does generate JavaScript that then injects the feed as HTML content right where the shortcode is placed. I’ll try to make the description clearer in future releases.

    Screenshots would not help to demonstrate this technical point, as the rendered representation of the feed would look all the same to the page visitor. But I get what you are saying and I do find too, that screenshots help site administrators in deciding if it is the right plugin for them.

    I am mostly worried about outdated screenshots and having to continuously generate and host new ones. Also demo pages. Don’t have the capacity to do that right now. I’ll try to address that in future releases.

    Plugin Author Wolfgang

    (@wolfgang101)

    I think there are two things going on.

    The first thing is that your public feed only shows posts from Oct 6, 2022 and before: https://mastodon.radio/@kj7t Not sure where your newer posts are, but even your home instance does not show anything after Oct 6th.

    My second observation is that your instance seems to have disabled queries for users that are not logged in. The plugin would load data from https://mastodon.radio/api/v1/accounts/123456789123456789/statuses I only get “{“error”:”Record not found”}” instead of data. Also could not look up your user id directly on your instance. That means that only website visitors that are logged in to mastodon.radio with a valid user account can see feed data on your website. Most likely most users would not see any posts. You can test this by visiting your site in an incognito browser window.

    I tried fetching your public feed through another instance (in my test mastodon.social) which is not ideal. I would recommend only going through the original home instance always, but wanted to see what happened. The interesting thing is that it only shows posts up until September 17, 2022. You can see for yourself here: https://mastodon.social/@[email protected]

    My conclusion is that mastodon.radio sadly is not suitable if you want to use my plugin, as the public API is not available. You could try to kindly ask the instance maintainer to enable access, but they might have a reason why they disabled it in the first place.

    Plugin Author Wolfgang

    (@wolfgang101)

    Perfect!

    Plugin Author Wolfgang

    (@wolfgang101)

    Not bothering me at all. You were so close with code #3 ??

    Please try

    [include-mastodon-feed instance="mastodon.social" account="111335950128699046"]

    • This reply was modified 1 year ago by Wolfgang.
    • This reply was modified 1 year ago by Wolfgang.
Viewing 15 replies - 1 through 15 (of 45 total)