|
1 === Include Mastodon Feed === |
|
2 Contributors: wolfgang101 |
|
3 Donate link: https://www.buymeacoffee.com/w101 |
|
4 Tags: mastodon, status, feed |
|
5 Requires at least: 6.0 |
|
6 Tested up to: 6.5 |
|
7 Requires PHP: 7.4 |
|
8 Stable tag: 1.9.4 |
|
9 License: Expat License |
|
10 License URI: https://directory.fsf.org/wiki/License:Expat |
|
11 |
|
12 Plugin that provides a shortcode to easily integrate mastodon feeds into wordpress pages. |
|
13 |
|
14 == Description == |
|
15 Plugin that provides an `[include-mastodon-feed]` shortcode to easily integrate mastodon feeds into wordpress pages. Supports personal and tag feeds. |
|
16 |
|
17 The plugin is written in PHP and generates native JavaScript to fetch and render the mastodon feed. No special libraries needed. |
|
18 |
|
19 == Installation == |
|
20 |
|
21 1. Upload the "include-mastodon-feed" directory to the "/wp-content/plugins/" directory. |
|
22 1. Activate the plugin through the "Plugins" menu in WordPress. |
|
23 1. Insert shortcode into any page. |
|
24 |
|
25 = Shortcode example = |
|
26 `[include-mastodon-feed instance="YOUR-INSTANCE" account="YOUR-ACCOUNT-ID"]` |
|
27 |
|
28 = Shortcode attributes = |
|
29 * **account** (required) |
|
30 The account ID (a long number - see FAQ on how to get it) |
|
31 |
|
32 * **tag** |
|
33 Use **tag** instead of **account** if you want to embed a tag feed instead of a personal feed |
|
34 |
|
35 * **instance** (required) |
|
36 Domain name of the instance without https:// (e.g. example.org) |
|
37 |
|
38 * **limit** |
|
39 Maximum number of statuses (Default: 20) |
|
40 |
|
41 * **excludeReplies** |
|
42 Exclude replies to other accounts (Default: false) |
|
43 |
|
44 * **excludeConversationStarters** |
|
45 Exclude statuses that start with a user mention (Default: false) |
|
46 |
|
47 * **excludeBoosts** |
|
48 Exclude boosted statuses (Default: false) |
|
49 |
|
50 * **onlyPinned** |
|
51 Show only pinned statuses (Default: false) |
|
52 |
|
53 * **onlyMedia** |
|
54 Show only statuses containing media (Default: false) |
|
55 |
|
56 * **preserveImageAspectRatio** |
|
57 Preserve image aspect ratio (Default: false) |
|
58 |
|
59 * **tagged** |
|
60 Show only statuses that are tagged with given tag name (Default: false) |
|
61 No leading #, case insensitive, e.g.: tagged="tagname" |
|
62 |
|
63 * **linkTarget** |
|
64 Target for all links e.g. new tab would be "_blank" (Default: _self) |
|
65 |
|
66 * **showPreviewCards** |
|
67 Show preview cards (Default: true) |
|
68 |
|
69 * **hideStatusMeta** |
|
70 Hide status meta information, automatically also hides date and time (Default: false) |
|
71 |
|
72 * **hideDateTime** |
|
73 Hide date and time from status meta information (Default: false) |
|
74 |
|
75 * **darkmode** |
|
76 Enable dark mode (Default: false) |
|
77 |
|
78 * **text-loading** |
|
79 Loading text (Default: Loading Mastodon feed...) |
|
80 |
|
81 * **text-noStatuses** |
|
82 Text if no statuses are available (Default: No statuses available) |
|
83 |
|
84 * **text-boosted** |
|
85 Text indicating boosted statuses (Default: boosted 🚀) |
|
86 |
|
87 * **text-viewOnInstance** |
|
88 View status on instance link text (Default: view on instance) |
|
89 |
|
90 * **text-showContent** |
|
91 Text for content warning buttons (Default: Show content) |
|
92 |
|
93 * **text-permalinkPre** |
|
94 Text before post permalink (date & time) (Default: on) |
|
95 |
|
96 * **text-permalinkPost** |
|
97 Text after post permalink (date & time) (Default: ) |
|
98 |
|
99 * **text-edited** |
|
100 Text indicating edited posts (Default: (edited)) |
|
101 |
|
102 * **date-locale** |
|
103 Locale for date string, used in toLocaleString() (Default: en-US) |
|
104 |
|
105 * **date-options** |
|
106 Format options directly fed into toLocaleString() (Default: {}) |
|
107 |
|
108 = Additional customizations = |
|
109 |
|
110 You can define several plugin constants to set custom default options that will be applied site-wide. |
|
111 |
|
112 1. Open your `wp-config.php` file |
|
113 2. Search for the line `/* Add any custom values between this line and the "stop editing" line. */` |
|
114 3. Define the options you want to override between the line from step #2 and `/* That's all, stop editing! Happy publishing. */` |
|
115 |
|
116 See the included `config-example.php` file for a full list of supported settings. |
|
117 |
|
118 |
|
119 == Frequently Asked Questions == |
|
120 |
|
121 = How do I find my account ID? = |
|
122 Please feel free to use [this handy lookup tool](https://wolfgang.lol/code/include-mastodon-feed-wordpress-plugin/) |
|
123 |
|
124 To look your ID up manually there are several ways. |
|
125 |
|
126 As an instance admin you can easily read your user ID in the admin backend. |
|
127 |
|
128 As regular user you can try an API v2 search to find your ID. |
|
129 |
|
130 **API v2 notes:** |
|
131 * Change `example.org` to your instance |
|
132 * Replace `username` with your handle. |
|
133 |
|
134 Use the following URL to get your ID: |
|
135 |
|
136 `https://example.org/api/v2/search?q=username@example.org&resolve=false&limit=5` |
|
137 |
|
138 |
|
139 |
|
140 = Known Issues / Todo = |
|
141 * improve support for video and audio media attachment types |
|
142 * integrate i18n into translate.wordpress.org instead of text constants |
|
143 * re-build plugin as custom gutenberg block |
|
144 |
|
145 == Screenshots == |
|
146 |
|
147 * No screenshots |
|
148 |
|
149 == Changelog == |
|
150 |
|
151 = 1.9.4 = |
|
152 * added option to hide status meta information and date/time (thank you @PaulKingtiger@dice.camp) |
|
153 * added tag support - you can now embed tag feeds (thank you @martin@openedtech.social) |
|
154 * added option to show embedded images in original aspect ratio (thank you @beach@illo.social) |
|
155 * fix: correctly inject repeating emojis in display names and status texts (thank you @kanigsson@discuss.systems) |
|
156 |
|
157 = 1.9.3 = |
|
158 * fix: improved excludeConversationStarters detection (did not work correctly) |
|
159 * fix: undid last refactor to load JS inline with markup instead footer to fix problem with JS that was added to footer even if shortcode was not visibly rendered |
|
160 |
|
161 = 1.9.2 = |
|
162 * fix: style for embedded videos / GIFs |
|
163 * refactor: play gifv on mouseover |
|
164 * refactor: load markup related javascript in footer instead of embedding it directly with the html markup |
|
165 |
|
166 = 1.9.1 = |
|
167 * refactor: show meaningful message if no statuses are available |
|
168 * fix: broken excludeConversationStarters logic |
|
169 |
|
170 = 1.9.0 = |
|
171 * added option to exclude conversation starters (posts that start with a user mention) |
|
172 |
|
173 = 1.8.1 = |
|
174 * fix: boolean param validation was wonky |
|
175 * fix: stop links from overflowing (thanks to https://github.com/moan0s for contributing) |
|
176 * refactoring: improved styling of embedded images |
|
177 |
|
178 = 1.8.0 = |
|
179 * added option to show/hide preview cards |
|
180 * refactoring: introducing plugin namespace |
|
181 * refactoring: improved debug console output |
|
182 |
|
183 = 1.7.0 = |
|
184 * bumped tested wordpress version to 6.2 |
|
185 * added option to customize permalink text (before and after date/time) |
|
186 * added option to customize text indicating edited posts |
|
187 |
|
188 = 1.6.0 = |
|
189 * image attachments are now clickable (link to original status) |
|
190 |
|
191 = 1.5.0 = |
|
192 * added option to show only statuses with specific tag |
|
193 * added option to set link target to make links open in new tab |
|
194 * added option to set maximum number of statuses |
|
195 |
|
196 = 1.4.2 = |
|
197 * fixed styling issue with emojis in account display name |
|
198 |
|
199 = 1.4.1 = |
|
200 * fixed styling issue with boosted account links |
|
201 |
|
202 = 1.4.0 = |
|
203 * removed "view on instance" link and made date info clickable instead |
|
204 * added custom date locale and format option |
|
205 * fixed emoji and inline link styling issues in content blocks |
|
206 * fixed an issue with gifv media attachments |
|
207 * refactored option sanitizing and filtering |
|
208 |
|
209 = 1.3.1 = |
|
210 * updated documentation that 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 |
|
211 * removed `config.php` support |
|
212 |
|
213 = 1.3.0 = |
|
214 * added new feed options: excludeReplies, onlyPinned, onlyMedia |
|
215 |
|
216 = 1.2.0 = |
|
217 * fixed broken JavaScript if post included media attachments other than images |
|
218 * fixed custom "view on instance" option |
|
219 * added option for custom content warning button text |
|
220 * added option to exclude boosted statuses |
|
221 * added support for gifv media attachments |
|
222 |
|
223 = 1.1.0 = |
|
224 * added support for more custom text overrides (loading, boosted, view on instnace) |
|
225 * switched to showing static avatars, animated avatars only on hover |
|
226 |
|
227 = 1.0.1 = |
|
228 * escaped options when echoing them |
|
229 * secured local file inclusion |
|
230 * changed versioning to semantic versioning - now including patch number |
|
231 |
|
232 = 1.0 = |
|
233 * Initial release |
|
234 |
|
235 == Upgrade Notice == |
|
236 |
|
237 = 1.8.1 = |
|
238 * minor style updates - if you have custom styling make sure to check if all is good |
|
239 |
|
240 = 1.3.1 = |
|
241 * 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 |
|
242 |
|
243 = 1.1.0 = |
|
244 * "loading" shortcode attribute was renamed to "text-loading" |