Linux 软件免费装
Banner图

MaxtDesign REST API Control

开发者 slaacr
更新时间 2026年6月18日 23:53
PHP版本: 8.2 及以上
WordPress版本: 7.0
版权: GPLv2 or later
版权网址: 版权信息

标签

security rest api json api disable rest api api control

下载

1.0.5

详情介绍:

MaxtDesign REST API Control gives you complete control over who can access your WordPress REST API and which endpoints are available. By default, WordPress exposes a REST API to the public, which can reveal usernames, post data, and site structure to anyone. This plugin lets you lock down the REST API for unauthenticated visitors while keeping it fully functional for logged-in users and the plugins that need it. Key Features How It Works The plugin uses the rest_authentication_errors filter — the correct, modern WordPress approach — to intercept REST API requests early in the lifecycle, before any endpoint logic executes. This means blocked requests have virtually zero performance impact. Built for Performance This plugin follows the MaxtDesign performance-first philosophy:

安装:

  1. Upload the maxtdesign-rest-api-control folder to /wp-content/plugins/.
  2. Activate the plugin through the Plugins menu in WordPress.
  3. Go to Settings > REST API Control to configure.
  4. The REST API is blocked for unauthenticated users by default. Adjust the whitelist as needed.

屏幕截图:

  • Endpoint whitelist — auto-discovered endpoints with collapsible namespace tree.
  • Per-role controls — restrict REST API access for individual user roles.
  • Import/Export — easily transfer settings between sites.

升级注意事项:

1.0.5 Internationalization fix so the plugin is translatable via WordPress.org. No functional change. 1.0.4 Plugin renamed to "MaxtDesign REST API Control." Cosmetic only — your settings and behaviour are unchanged. 1.0.3 Fixes route-level whitelisting for parameterized endpoints (namespace whitelisting was already fine) and makes multi-role access most-permissive. Recommended for anyone using per-route or per-role rules. 1.0.2 Security fix. Closes a fail-open on the REST API root (/wp-json/) that left the discovery endpoint exposed even when the plugin was active. Update immediately. 1.0.1 WordPress 7.0 compatibility confirmed. Hardens settings import and the activation path. Recommended for all users. 1.0.0 Initial release. Take full control of your WordPress REST API.

常见问题:

Will this break my site?

No. The plugin only affects REST API requests. Your website's frontend, admin dashboard, and all standard WordPress functionality remain completely unaffected. Logged-in users have full REST API access by default.

Does this work with Contact Form 7?

Yes. Contact Form 7 requires the REST API for form submissions. The plugin automatically detects CF7 on activation and whitelists its endpoints. If you activate CF7 after this plugin, simply check the contact-form-7 namespace in the endpoint whitelist.

Does this work with WooCommerce?

Yes. The plugin automatically detects WooCommerce on activation and whitelists the Store API endpoints (wc/store) needed for cart and checkout blocks. The WooCommerce admin API endpoints are available to logged-in users by default.

What happens when I deactivate the plugin?

Your REST API returns to normal WordPress behavior — fully open. Your settings are preserved so they'll be restored if you reactivate. Settings are only deleted when you delete the plugin through the WordPress admin.

Does this affect the WordPress block editor (Gutenberg)?

No. By default the plugin only restricts unauthenticated requests, and every logged-in user keeps full REST API access — so the block editor, which talks to the REST API as the logged-in author, is completely unaffected. The "Allow REST API for all logged-in users" toggle is on out of the box specifically to keep the editor, dashboard, and admin AJAX working. You would only see editor issues if you deliberately turn that toggle off and restrict your own role without whitelisting wp/v2 — which the per-role UI makes explicit.

Can I restrict specific user roles?

Yes. The Per-Role Controls section lets you restrict REST API access for individual roles (subscriber, contributor, author, editor, etc.) and configure a custom endpoint whitelist for each restricted role.

What happens if a user has more than one role?

The most permissive role wins. If a user holds any role that is not restricted, they keep full REST API access. If every one of their roles is restricted, the plugin combines the whitelists of all those roles and allows a request that any of them permits. This prevents a single restricted role (for example a stray subscriber capability) from unexpectedly locking out a user who also has an unrestricted role.

Does this work with custom REST API endpoints?

Yes. The plugin auto-discovers all registered REST API endpoints, including those from themes and other plugins. Any custom endpoints will appear in the whitelist tree.

How do I transfer settings to another site?

Use the Export Settings button to download a JSON file, then use Import Settings on the other site to upload it.

更新日志:

1.0.5 1.0.4 1.0.3 1.0.2 1.0.1 1.0.0