Linux 软件免费装

Include Mastodon Feed

开发者 wolfgang101
更新时间 2025年12月19日 09:34
捐献地址: 去捐款
PHP版本: 7.4 及以上
WordPress版本: 6.9
版权: MIT
版权网址: 版权信息

标签

feed status mastodon

下载

1.9.10 1.9.1 1.9.3 1.9.4 1.9.5 1.2.0 1.4.0 1.0.1 1.3.0 1.9.2 1.1.0 1.4.1 1.4.2 1.8.1 1.3.1 1.6.0 1.7.0 1.8.0 1.5.0 1.9.0 1.9.6 1.9.7 1.9.8 1.9.9 1.10 1.12 1.13 1.11 1.13.1 1.14.0 1.15.0 1.15.1 1.16.0 1.17.0 1.9.11

详情介绍:

Plugin that provides an [include-mastodon-feed] shortcode to easily integrate mastodon feeds into wordpress pages. Supports personal and tag feeds. Account and post images are lazy loaded if preserveImageAspectRatio is set to true (default: false). The plugin is written in PHP and generates native JavaScript to fetch and render the mastodon feed. No special libraries needed.

安装:

  1. Upload the "include-mastodon-feed" directory to the "/wp-content/plugins/" directory.
  2. Activate the plugin through the "Plugins" menu in WordPress.
  3. Insert shortcode into any page.
Shortcode example [include-mastodon-feed instance="YOUR-INSTANCE" account="YOUR-ACCOUNT-ID"] Shortcode attributes Additional customizations You can define several plugin constants to set custom default options that will be applied site-wide (e.g. date options can only be set as php constant to mitigate an XSS vulnerability).
  1. Open your wp-config.php file
  2. Search for the line /* Add any custom values between this line and the "stop editing" line. */
  3. Define the options you want to override between the line from step #2 and /* That's all, stop editing! Happy publishing. */
See the included config-example.php file for a full list of supported settings.

升级注意事项:

1.8.1
  • minor style updates - if you have custom styling make sure to check if all is good
1.3.1
  • plugin constants for setting custom default options have to be defined in wp-config.php, as the previous config.php file gets removed with every automatic plugin update
1.1.0
  • "loading" shortcode attribute was renamed to "text-loading"

常见问题:

How do I find my account ID?

Please feel free to use this handy lookup tool To look your ID up manually there are several ways. As an instance admin you can easily read your user ID in the admin backend. As regular user you can try an API v2 search to find your ID. API v2 notes:

  • Change example.org to your instance
  • Replace username with your handle. Use the following URL to get your ID:
https://example.org/api/v2/search?q=username@example.org&resolve=false&limit=5

How does caching work?

Server-side caching is disabled by default. When disabled every page load will trigger a new API request to your Mastodon instance for every single feed. This is how the public feeds API is intended and usually not a problem. If you have a high-traffic site and want to help out your Mastodon instance you can enable caching globally or per shortcode. When enabled the plugin will cache the feed for 5 minutes as a default. The plugin automatically uses any enabled cache plugin or the Wordpress internal transient cache (= Wordpress database). Only the statuses JSON response is cached - any media is still served from the Mastodon instance directly. Note: If you Mastodon instance needs API authentication server-side caching is automatically enabled for all feeds that use authentication. That way your auth token is not exposed to your website visitors.

API authentication

If your Mastodon server needs API authentication you can use the auth parameter.

NOTE Do NOT add your API auth token directly to the plugin short code To avoid exposing the auth token to website visitors you have to take extra steps to set up authentication support See the very end of config-example.php for an in-depth configuration example
Steps to set up API authentication:
  1. Log into your Mastodon instance and go to Settings > Development (https://yourinstance.example.org/settings/applications)
  2. Create a new Application (any name, only check one single scope read:statuses)
  3. Add the auth mapping configuration to your wp-config.php (See very bottom of the included config-example.php)
  4. Add your custom auth reference to your shortcode

Known Issues / Todo

更新日志:

1.17.0 1.16.0 1.15.1 1.15.0 1.14.0 1.13.1 1.13 Special release for Global Accessibility Awareness Day in collaboration with @oldrup@mastodon.green Happy Accesssibility Day 1.12 1.11 1.10 1.9.11 1.9.10 1.9.9 1.9.8 1.9.7 1.9.6 1.9.5 1.9.4 1.9.3 1.9.2 1.9.1 1.9.0 1.8.1 1.8.0 1.7.0 1.6.0 1.5.0 1.4.2 1.4.1 1.4.0 1.3.1 1.3.0 1.2.0 1.1.0 1.0.1 1.0