Jan Boddez
Forum Replies Created
-
Forum: Plugins
In reply to: [Share on Mastodon] WP static permalinkOh, I hadn’t yet heard of that use case!
You should be able to filter the status messages, like use PHP’s
str_replace()to replace the local with your public domain. This of course requires you’re able to add code snippets someplace, like infunctions.php, a custom (must-use) plugin, or through the use of a separate “code snippets” plugin:Just a quick example:
add_filter( 'share_on_mastodon_status', function( $status, $post ) {
$status = str_replace( 'http://localhost.test/', 'https://www.example.org/', $status );
return $status;
}, 10, 2 );This would modify the message before it gets sent to your Mastodon server.
Of course, depending on how or when the static pages are pushed to your web host, Mastodon instances might temporarily hit a 404 and cache the wrong link preview data. (It might be possible to work around that by setting a delay, under the plugin’s advanced settings. But maybe I’m overthinking things.)
The “facepile” setting “removes” reactions (likes, etc.) from the default “comments loop” so that they can then be displayed in a separate “Facepile” block. The “auto-insert” setting automatically adds such a “Facepile” block in front of the “regular” comments block—alternatively, it can be added by hand in the Site Editor (e.g., in the Comments template part).
I’m assuming ActivityPub’s blocks do something similar but in a slightly different manner. And Webmention also does something similar, or at least used to, although when I last checked it out it did not really have “advanced” block support.
Long story short, it is possible that something broke …
Forum: Plugins
In reply to: [Share on Mastodon] Doesn’t work anymoreStrange indeed. Sounds like maybe it was a temporary server hiccup after all. Or some caching thing. Either way, good it’s working again!
Forum: Plugins
In reply to: [Share on Mastodon] Doesn’t work anymoreHmm. It seems to work for me, still (both crossposting and requesting a new access token). The plugin did not get any updates for months, either (but you never know). Also tested on the latest WP 6.8.
If you’re able to enable both WordPress’ debug logging (via
wp-config.php) and the debug logging setting under Settings > Share on Mastodon > Debugging, you should be able to find any erroneous server responses in yourdebug.log(the filename and location may vary across web hosts, but it can most often be found in thewp-contentfolder).If that doesn’t work, you might be able to troubleshoot further by manually installing the latest “GitHub version” (click Code, then Download ZIP). You’ll want to unzip, then rename the resulting folder to
share-on-mastodon, and then replace the entire plugin. (Your settings will not be removed.)Forum: Plugins
In reply to: [Share on Mastodon] Suddenly, only one post per day is sharedHm, that’s weird. Wondering if it’s the Mastodon server somehow. Did it work okay before? There hasn’t been a plugin update for like 2 months …
Other possibilities:
- Are these posts different somehow? Longer? With/without pictures? There might be a clue there.
- Do you use the “opt-in” setting? Delayed posting? One of the other “advanced” plugin settings?
- Have you otherwise customized the plugin (like, through a PHP code snippet)? Do you use any custom filters or …? (It could be a bug in a callback function …)
What could help find out what’s up is enable WordPress’ debug logging (you’ll need to define both the
WP_DEBUGand theWP_DEBUG_LOGconstant in wp-config.php) as well as enable the “debug” setting in WordPress’ Settings > Share on Mastodon screen (under the Debugging tab).And then try again and look for errors in WordPress’ debug log (often under wp-content/debug.log, but it depends on your web host).
- This reply was modified 1 year, 8 months ago by Jan Boddez. Reason: Added additional questions
Forum: Plugins
In reply to: [Share on Mastodon] Plugin causes an errorHi again, took a bit longer than a day or two, but version 0.19.1 should fix this.
Before I do that (afraid I can’t just give WP-Admin access), I just noticed the
update_23_7function inlib/Updater.php, which seems to hold exactly the changes I was missing.I was able to run, essentially,
ALTER TABLE wp_bookly_customers ADD COLUMN tags TEXT DEFAULT NULL AFTER info_fields. The problem looks solved. (While I was at it, I also added the newly introduced option to the options table.)No idea why the migration failed to run when the plugin was first updated.
Forum: Plugins
In reply to: [Share on Mastodon] Plugin causes an errorThink I have a working fix, still have to release it, though. Give it a day or two!
Forum: Plugins
In reply to: [Share on Mastodon] Plugin causes an errorIt 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 1 year, 11 months ago by Jan Boddez.
Forum: Plugins
In reply to: [Share on Mastodon] Separate Mastodon Accounts for each Website Author?Thanks for the kind words!
Yes, the “challenge” is storing per-user auth details (and even client details, as different users could be on different Mastodon instances). Not really a problem but it requires rewriting part of the code plus deciding where to show the necessary form fields and so on …
Like, I’m actually looking into this, but it’s going to take … a few weeks at least. (And even then I can’t really guarantee anything, sorry!)
Forum: Plugins
In reply to: [Share on Mastodon] Separate Mastodon Accounts for each Website Author?Hi! At the moment this isn’t possible, sorry. Maybe in a future version!
Forum: Plugins
In reply to: [Sync OPML to Blogroll] features?Thanks for the input! These are things I may consider in the future. I don’t think I can get those from the OPML itself (I’m not 100% sure though), but I guess I could always try to poll the feeds/sites themselves. (My feed reader plugin supports feed icons, for instance.)
Forum: Plugins
In reply to: [Share on Pixelfed] Excerpt length, (set by plugin or by WordPress?)So, it gets the WordPress excerpt but then cuts it off at (only) 125 characters.
What you can do is create an “mu-plugin” with the following code in it:
<?php // Prevent direct access. if ( ! defined( 'ABSPATH' ) ) { exit; } add_filter( 'share_on_pixelfed_excerpt_length', function () { return 400; // Or whatever number works for you. } );Or instead of an mu-plugin, you could also add it to your theme’s
functions.phpas long as you ensure it won’t get overwritten by subsequent theme updates, or you could add it through some plugin of sorts.Not sure what max length Pixelfed instances typically allow, plus if you’re also going to include tags, etc., you may want to stay a little bit below the 500 or whatever characters is the real maximum.
You could also make that code a bit smarter, as long as it returns an appropriate number.
- This reply was modified 2 years, 4 months ago by Jan Boddez.
Forum: Plugins
In reply to: [Share on Mastodon] does not work on scheduled postsHmm, guessing there’s somehow a conflict with some of your custom code, or perhaps another plugin.
In any case, Share on Mastodon itself just uses
get_permalink( $post_id ), like WordPress itself.And to initiate sharing, it uses the
save_post_{$post->post_type}hook, with a priority of 20.So if you were to somehow overwrite post slugs whenever, e.g., the
save_postorwp_insert_posthook runs, and thus after the hook Share on Mastodon uses, it could be there’s a kind of “conflict” there. Not really a “race condition,” but similar.Have you tried setting a delay? If it’s a prio thing, that actually may work. Just 60 seconds or so.
If you use the Gutenberg editor but have not enabled the plugin’s “classic meta box” option, and you publish immediately, sharing to Mastodon doesn’t actually happen until the
rest_after_insert_{$post->post_type}hook, which does run later in time, so that could indicate why it works in that case …Forum: Plugins
In reply to: [Share on Mastodon] How to troubleshoot?The delay relies on WP-Cron, which is triggered only when an actual request reaches your site. Like, if you were to serve all of your pages from Cloudflare’s edge cache, it could simply be the case that there isn’t enough traffic reaching WordPress and that the 5 minute delay becomes a 1 hour delay (or something). But you browsing the admin interface would be such a request, so … I mean, it should still work, probably. Merely protecting the login page likely isn’t the culprit (but who knows).
But you might wanna disable the delay just in case. There could be something else preventing WP-Cron from working reliably. (The WP Crontrol plugin can give some insights here.)