| 开发者 | nirosuite |
|---|---|
| 更新时间 | 2026年10月4日 20:16 |
| PHP版本: | 8.0 及以上 |
| WordPress版本: | 7.1 |
| 版权: | GPLv2 or later |
| 版权网址: | 版权信息 |
[niroroadmap] shortcode or the Roadmap block.niroroadmap/v1, a dozen filters and actions, and a regular custom post type.[niroroadmap] shortcode or the Roadmap block.[niroroadmap] shows every item.
[niroroadmap product="12"] shows only the items of one product. Use the term ID from NiroRoadmap → Products.
[niroroadmap toolbar="yes" sort="votes" filters="search,tag"] adds a search, sort and filter toolbar. toolbar is yes or no; sort is manual, votes, newest, oldest or commented; filters is a comma list of search, tag and product (or none). Without these options a board follows Settings → Toolbar. The Roadmap block has the same options in its sidebar.
[niroroadmap view="timeline" switcher="yes" group="month"] opens the board as a timeline and lets visitors switch views. view is board, list or timeline; switcher is yes or no; group is quarter, month or nownext (Now / Next / Later). Without these options a board follows Settings → Views. Visitors can share a link to a view with ?nr_view=list in the address. The Roadmap block has the same options in its sidebar.
[niroroadmap submissions="yes"] shows a "Suggest an idea" button on that board even when it is off site-wide; submissions="no" hides it.
Options combine, for example [niroroadmap product="12" toolbar="yes" sort="votes" submissions="yes"].
The older [roadmap] shortcode still works.
For developers
Filters:
niroroadmap_setting_{$key}: filter any setting value, e.g. niroroadmap_setting_comments_enabled.niroroadmap_show_stage_links: return true to link each column title to its status archive.niroroadmap_get_posts: filter the items loaded for a column.niroroadmap-localized_vars: filter the variables passed to the front-end scripts.niroroadmap_vote_fingerprint, niroroadmap_voter_ip: change or disable how anonymous voters are recognised.niroroadmap_vote_rate_limit, niroroadmap_comment_rate_limit, niroroadmap_submission_rate_limit: change the rate limits (array( count, seconds )).niroroadmap_comment_max_length, niroroadmap_comment_show_avatars: limit comment length, or hide avatars.niroroadmap_completed_status_slugs: the status slugs that count as completed for closing comments (default completed).niroroadmap_submission_verify: return false or a WP_Error to reject an idea, for example to add a CAPTCHA.niroroadmap_submission_max_title, niroroadmap_submission_max_description, niroroadmap_submission_min_time: limits for the suggestion form.niroroadmap_submission_notify_to: change the recipient of the new-idea email.niroroadmap_comment_created: fires after a visitor's comment is saved.niroroadmap_submission_created: fires after an idea is submitted.niroroadmap/v1): GET /tasks/{id}, POST /tasks/{id}/vote, GET and POST /tasks/{id}/comments, POST /tasks/submit and GET /tasks/search are public and rate limited. Moving and ordering items and statuses (/tasks/{id}/move, /tasks/order, /stages/order) need an editor or administrator.
The board's look can be changed by overriding these CSS custom properties on .nr-kanban-columns and .nr-modal-overlay: --nr-bg, --nr-card, --nr-border, --nr-text, --nr-muted, --nr-accent, --nr-radius.
Helper: niroroadmap_get_setting( $key ) returns a plugin setting.
Roadmap data is stored as a regular custom post type (niroroadmap_item) with the taxonomies niroroadmap_status, niroroadmap_product and niroroadmap_tag, so it works with the standard WordPress APIs.
Source code and build tools
The full source code is publicly available at github.com/codexpertio/niroroadmap.
The only compiled file is the block script in build/roadmap/. Its human-readable source ships with the plugin in app/Blocks/roadmap/. To rebuild it, run npm install and then npm run build:blocks (uses @wordpress/scripts). PHP dependencies are listed in composer.json; run composer install to install them.
Privacy
NiroRoadmap makes no requests to external services. To allow one vote per visitor per item, it recognises voters like this:
niroroadmap_voter (1 year, SameSite=Lax, HttpOnly, Secure on HTTPS), set when they first vote. They are also recognised by a salted hash (HMAC-SHA256, keyed with your site's WordPress salts) of their IP address and browser user agent, so clearing cookies doesn't reset their votes.niroroadmap_vote_fingerprint filter; votes are then recognised by cookie only. Votes are also shown as plain counts on each item, and the visitor's browser keeps a list of the items it has voted on in local storage (niroroadmap_votes) to display the buttons correctly. That list is never sent to the server. A short-lived counter keyed by a hash of the IP address limits how fast votes can be sent. Vote data is deleted when you uninstall with "Delete all data" turned on.
When comments are turned on, a comment is a standard WordPress comment. WordPress stores the commenter's name, email address, IP address and browser user agent with it, the same as on any post, and your spam plugin may send these to its own service. The roadmap board never shows email addresses or IP addresses. It does show each commenter's avatar, which for people without a profile picture is a Gravatar image whose address contains a hash of their email; return false from the niroroadmap_comment_show_avatars filter to turn avatars off. A hidden form field and a per-IP rate limit (using a hash of the IP address, as for votes) help keep out spam. Comments are deleted with their item, and when you uninstall with "Delete all data" turned on.
When visitors can suggest ideas, an idea is stored as a pending item, like any other. If you ask for a name and email, or the person is logged in, those are stored privately with the idea so you can follow up. They are shown only in the admin Items list, and never on the board or in the public API. The idea itself becomes public only when you publish it. A hidden form field, a minimum fill-in time and a per-IP rate limit (using a hash of the IP address, as for votes) help keep out spam, and a filter lets you add a CAPTCHA. If you turn on the email notification, the idea and the submitter's name and email are sent to the address you choose. Ideas, and the name and email stored with them, are deleted with the item, and when you uninstall with "Delete all data" turned on.
Item details: the target is shown to visitors only if you turn that on in Settings → General. The release date, version, link and cover image are shown when filled in. The effort size and the internal notes are for your team only: they are never shown on the board or returned by the public API.
Status history: each time an item moves to another status, the plugin records which status, when, and the ID of the user who moved it (0 when it was done by code or by a visitor's submission). Only your team sees who; the optional timeline shown to visitors has statuses and dates only. The history is deleted with the item, and when you uninstall with "Delete all data" turned on.
niroroadmap folder to /wp-content/plugins/ and activate it from the Plugins screen.No, unless you want them to. Anyone can upvote or downvote an item, and each visitor gets one vote per item. To require a login, change Settings → Voting → Who can vote.
Yes, when you turn on Settings → Comments. Comments show in the item popup and are moderated like any WordPress comment. You can require a login, close comments on one item from its Discussion box, or close them automatically when an item is completed.
Yes, when you turn on Settings → Submissions, or add submissions="yes" to one board. Ideas are saved as Pending and stay hidden until you approve them from the Items list. Visitors see similar items while they type, which cuts down on duplicates.
Both forms use a hidden honeypot field, a per-IP rate limit and (for ideas) a minimum fill-in time. Comments also pass through your usual WordPress moderation and spam plugins. To add a CAPTCHA to the idea form, use the niroroadmap_submission_verify filter.
Yes. Choose Dark or Auto (follows the visitor's device) under Settings → Appearance.
Editors and administrators. They can drag items directly on the public board while logged in. Everyone else sees a read-only board.
Go to NiroRoadmap → Statuses and drag the rows into the order you want. The order is saved right away and used on the public board.
Edit the status under NiroRoadmap → Statuses and pick a color. It's used for the column's top border and status dot.
Yes. Assign items to a product, then use [niroroadmap product="ID"] with that product's term ID. To pick the product for boards that don't name one, set Settings → General → Default product.
Under NiroRoadmap → All Items. Add or edit an item like any post: give it a title, a description, a status, and optionally a product, tags, a Featured image (shown as its cover) and the Roadmap details.
Add the Roadmap block, or a Shortcode block with [niroroadmap]. The page chosen in Settings → General → Roadmap page is just the page the plugin created for you, so you can also build your own and ignore it.
A date written YYYY-MM-DD (for example 2026-12-31) or a quarter such as Q4 2026 (also q4-2026). Anything else is rejected with a message and the old value is kept. Visitors see the target only if you turn on Settings → General → Show an item's target date or quarter in its popup.
Turn on Settings → General → Show an item's status timeline in its popup. Visitors see statuses and dates. Only your team ever sees who moved the item.
No. They are for your team and are never shown on the board or returned by the public API.
Yes. Use the Pin to the top of its column and Hide votes switches in the Roadmap details box of the item. Pinned items stay at the top of their column whatever the sort order.
Not easily. Besides the cookie, votes are matched by a salted hash of the visitor's IP address and browser. If you prefer to use cookies only, return an empty string from the niroroadmap_vote_fingerprint filter. See "Privacy" below.
When Settings → Voting → Let voters change their vote is on, a voter can switch between an up vote and a down vote. A vote can't be withdrawn. When the setting is off, a vote is final.
Yes. Turn off Settings → General → Show the downvote button. The server then rejects downvotes too. To keep downvotes but hide the numbers, use Settings → Voting → Show downvote counts to.
Anyone, unless you turn on Require login to comment (or WordPress requires registered users to comment). Guests give a name and email; the email is kept private. Logged-in users aren't asked.
Like any other WordPress comments, from the Comments screen. Roadmap comments follow your Settings → Discussion rules (for example "hold for moderation"), and a visitor sees their own held comment as awaiting moderation. Roadmap comments are also open to your spam plugin.
Open the item and use its Discussion box on the edit screen. To close them automatically, turn on Settings → Comments → Close comments when an item is moved to Completed.
Yes, one level deep: a visitor can reply to a comment, but not to a reply. Long threads load a page at a time.
They are saved as Pending items. Open NiroRoadmap → All Items, look at the Submitted by column and click Approve to publish one, or edit it first. A published idea appears on the board in the status you picked under Settings → Submissions → Status for new ideas.
Yes, by default, at the site's admin address. Change the address, or turn it off, under Settings → Submissions. The niroroadmap_submission_notify_to filter can change the recipient from code.
Yes. Turn on Settings → Submissions → Only logged-in users can suggest ideas. You can also set Ask visitors for their name and email to Don't ask, Ask, but optional or Ask, and require both.
Yes, when you have products, the dialog shows a Product field. On a board limited to one product, the idea is filed under that product automatically.
By default a comment can be 2000 characters, an idea title 200 and its details 2000. A visitor can send 5 comments per 10 minutes and 3 ideas per hour, and 30 votes per 10 minutes. An idea can't be sent within 2 seconds of the dialog opening. Developers can change all of these with filters (see "For developers").
Yes. It ignores accents and capital letters, so "cafe" finds "Café".
Yes. The search, sort, filters and the chosen view (Board, List or Timeline) are kept in the page address, so copy the address from your browser.
A sorted or filtered view doesn't show every item in its manual order, so saving a drag would store a misleading order. Clear the search or put the sort back on Manual order to drag again.
Yes. The columns scroll sideways with snapping, and the toolbar collapses into a Sort & filter button. The list and timeline views stack to fit a narrow screen, and Settings → Views → Open boards as a list on narrow screens makes the list the first thing phone visitors see.
Cards can be opened with the keyboard, the popup and the dialogs can be closed with Esc, vote and toolbar messages are announced to screen readers, and the zoom animation becomes a plain fade for visitors who prefer reduced motion.
Yes. The text domain is niroroadmap and a template file is in the languages folder. You can also translate it from translate.wordpress.org once the plugin is listed there.
Yes. Paste it into Settings → Appearance → Custom CSS, or override the CSS custom properties listed under "For developers" from your theme. The accent color and corner radius have their own settings.
Administrators change the settings. Editors and administrators can edit items and drag them on the board. Visitors can vote, and comment or suggest ideas when you allow it.
It makes no requests to outside services. A first-party cookie is set the first time a visitor votes. See "Privacy" for the details. Comment avatars use Gravatar like the rest of WordPress, unless you turn them off.
Yes, under /wp-json/niroroadmap/v1/. See "For developers" for the routes.
It uses your theme's fonts and a neutral design. To adjust the colors, override the CSS custom properties listed under "For developers".
Yes. Turn on Settings → Views → Let visitors switch between Board, List and Timeline, or use [niroroadmap switcher="yes"] on one board. To show a view without a switcher, use [niroroadmap view="list"] or view="timeline". The timeline groups items by their target, so turn on Show an item's target date or quarter in the General tab first. Items without a target are listed last under Later / Unscheduled, and a group with no items is left out. The List is a table of title, status, tags, comments, votes and target; click a heading to sort it. All three views show the same items, follow the same search and filters, and open the same popup, so voting and comments work in each. Dragging works on the Board only.
Yes. The [niroroadmap] shortcode and the Roadmap block take their own options (product, toolbar, sort, filters, view, switcher, group and submissions), so every board can have its own settings.
Yes. Turn on Settings → Toolbar, or use [niroroadmap toolbar="yes"] on one board. Visitors can then search, sort by votes, newest, oldest or most commented, and filter by tag and product. Sorting applies inside each column, and the search highlights the matching words.
Yes. Settings → Advanced → Reset to defaults restores every setting on all tabs. Your items, statuses, products and tags are not affected.
No. The Roadmap page is created once, and only if no page already shows the roadmap. The default statuses are added once, and only if you have none. If you delete them, they won't come back.
By default, nothing but a few internal options is removed: your roadmap items (with their votes and comments), statuses, products, tags, settings and the Roadmap page are kept. To remove everything, turn on Settings → Advanced → Delete all data when the plugin is uninstalled before you delete the plugin. The Roadmap page is always kept.
?nr_view= links.view, switcher and group shortcode attributes and matching block sidebar options.niroroadmap_submission_verify filter for CAPTCHA. Works on cached pages.submissions shortcode attribute and block option.nr_q, nr_sort, nr_tag, nr_product), so filtered boards can be shared.toolbar, sort and filters shortcode attributes and block options. Several boards on one page work independently.niroroadmap_vote_fingerprint, niroroadmap_vote_rate_limit, niroroadmap_comment_created, niroroadmap_comment_max_length, niroroadmap_comment_rate_limit, niroroadmap_comment_show_avatars, niroroadmap_completed_status_slugs and niroroadmap_submission_verify.
GET/POST /tasks/{id}/comments), idea submission (POST /tasks/submit) and similar ideas (GET /tasks/search).composer test.