| 开发者 | baharhussain99 |
|---|---|
| 更新时间 | 2026年10月30日 14:53 |
| PHP版本: | 7.4 及以上 |
| WordPress版本: | 7.1 |
| 版权: | GPLv2 or later |
| 版权网址: | 版权信息 |
[bhcr_reactions] shortcode, and PHP helpers.Enable automatic placement under Content Reactions > General. You can also place reaction buttons manually with the Content Reactions block or the [bhcr_reactions] shortcode. Enable the Like reaction and disable other reactions if you want to show only a like button.
Yes. Enable guest reactions in the plugin settings. A first-party cookie identifies returning guests after their first reaction; clearing cookies creates a new anonymous identity.
This plugin is the renamed successor of Post Reactions 2.3.0. Install and activate it, then deactivate Post Reactions; while Post Reactions is active, this plugin waits and shows a notice. On the next page load it moves the reactions table, settings, reaction definitions, and per-post choices. Existing [bh_post_reactions] shortcodes and Post Reactions blocks keep rendering on the site, and guests keep their reactions. Delete Post Reactions only after the move (if it was already deleted with "Keep reaction data" on, its data is still moved). On multisite, each site moves its own data on its first page load. Theme code that calls bh_post_reactions_render() or uses bh_post_reactions_* filters must switch to the bhcr_ names.
No. Reaction data stays in the site's WordPress database.
When a guest reacts for the first time, the site sets a first-party, HTTP-only cookie named bhcr_visitor that holds a random anonymous identifier for one year. Viewing reactions does not set the cookie. The database stores a keyed hash of the identifier, not the cookie value or an IP address. Clearing cookies creates a new anonymous identity, so guest reactions are not a strong one-person-one-vote mechanism.
Reaction writes are rate limited per visitor identity and per network address for each piece of content. The network limit uses a keyed hash of the connecting IP address in a short-lived cache entry (at most 10 minutes). Behind a reverse proxy that does not pass the visitor address to PHP, use the bhcr_rate_limits filter to adjust or disable the network limit. Limits are exact with a persistent object cache; without one they are approximate under bursts of simultaneous requests. Rate limiting slows scripted voting; it does not make anonymous voting abuse-proof.
Yes. Pages contain no personal reaction state; each visitor's state is loaded from the REST API, whose responses are sent with Cache-Control: private, no-store. If a CDN or proxy is set to cache everything regardless of headers, exclude /wp-json/bhcr/ and bypass the cache for signed-in visitors, or visitors may see each other's selections.
Choose "Manual only" under Content Reactions > General > Automatic placement, then use the Content Reactions block, [bhcr_reactions], or bhcr_render() in a theme. The shortcode accepts post_id, reactions (comma-separated keys), and layout (one of the six layout keys). A block placed in a site-editor template or template part is detected, so automatic placement does not add a second component.
Check that the reaction is enabled, that its position is within "Maximum reactions shown", and, for a single post, whether the post's Content Reactions box uses "Use all enabled reactions" or a specific selection.
Frontend styles are scoped to the component and use high-specificity selectors so that generic theme button styles do not change it. To customize it, target the component's own bh-post-reactions classes with a selector of equal or higher specificity.
Data is preserved by default. Disable "Keep reaction data" under Content Reactions > Tools before deleting the plugin to remove plugin options, post meta, and the custom table. On multisite, each site's own setting is respected.
No. PNG and WebP Media Library images are supported. SVG upload stays disabled because safely accepting arbitrary SVG requires a dedicated sanitizer.
bhcr prefix; data from Post Reactions is moved automatically (see the FAQ).switch_to_blog() removed the current site's reactions instead.