Linux 软件免费装
Banner图

WireCore REST Control

开发者 wirecore
更新时间 2026年11月10日 03:40
PHP版本: 7.4 及以上
WordPress版本: 7.1
版权: GPLv2 or later
版权网址: 版权信息

标签

privacy security rest api json api disable rest api

下载

1.0.0

详情介绍:

WireCore REST Control restricts access to the WordPress REST API without breaking the block editor or the plugins your visitors rely on. Instead of an all-or-nothing switch, you decide per namespace and per route who may read and who may write. The route list shows every registered route – WordPress core, themes and all other plugins – and tells you which plugin or theme registered it. Rules Advanced exceptions per namespace or route Automatic allowances Some plugins need the REST API for visitors on the front end. Their namespaces are public as long as you do not set a custom rule. Each of them can be switched off in the settings: Global settings and hardening Log and tools Coverage Rules apply to every real REST request, including embedded responses (_embed) and sub-requests of the batch endpoint (/batch/v1). Internal rest_do_request() calls made by PHP – for example when the block editor preloads data – are not affected. Multisite Settings are stored per site, because every site has its own routes and plugins. The plugin can be network-activated; uninstalling removes the settings of all sites. For developers Privacy The plugin does not send any data to external services and does not set cookies. If you enable the log, it stores the method, route, IP address (in full, shortened or not at all – configurable), user ID and the reason of blocked requests in the database of your site. The self-test sends requests from your server to its own REST API. Source code and third-party resources The settings page uses the WireLayer component library (MIT). assets/wirelayer/wirelayer.css is generated from the npm package @wirecore/wirelayer-css with npm run build:css; the source code of the plugin, including package.json, is available at github.com/WireCore/WP-Rest-Control. Bundled with it:

安装:

  1. Install the plugin via Plugins → Add New or upload the plugin folder to /wp-content/plugins/.
  2. Activate the plugin. From now on, logged-out visitors can no longer use the REST API, except for the automatically allowed namespaces.
  3. Go to Settings → REST API to review the route list and adjust the rules.
With Composer, the plugin can be installed from WPackagist: composer require wpackagist-plugin/wirecore-rest-control.

屏幕截图:

  • Rules per namespace and route for reading and writing, with exceptions and the effective rule.
  • The "Advanced" dialog: allow and deny IP addresses, roles and users per namespace or route.
  • Settings: automatic allowances for front-end plugins, error response, hardening and log.
  • Log of blocked requests with shortened IP addresses.

升级注意事项:

1.0.0 Initial release.

常见问题:

A rule locked me out of the admin area. What can I do?

Add the following line to your wp-config.php. It disables all rules until you remove it again: define( 'WIRECORE_RC_OFF', true );

Will administrators be blocked?

Not by default: the option "Never block administrators" is enabled after activation, because the block editor needs the REST API. Deny lists (IP addresses, roles) always apply, also to administrators.

My contact form or shop checkout stopped working.

Check Settings → REST API → Settings → Automatic allowances. If the plugin is not listed there, search for its namespace in the route list and set it to "Public".

Does it also restrict routes of other plugins?

Yes. The route list contains every registered route and shows which plugin or theme registered it. Some plugins only register routes during REST requests; the list is therefore loaded through the REST API itself so that these routes are included as well.

How can I check what visitors see?

Use Tools → Self-test on the settings page, or open /wp-json/ in a private browser window.

Is the plugin translated?

The plugin ships with German translations (formal and informal). Further translations are welcome on translate.wordpress.org.

更新日志:

1.0.0