Linux 软件免费装
Banner图

SRI Shield

开发者 spinxdigitaldev
更新时间 2026年10月29日 18:48
PHP版本: 8.0 及以上
WordPress版本: 7.1
版权: GPLv2 or later
版权网址: 版权信息

标签

security hardening subresource integrity sri script integrity

下载

1.2.0

详情介绍:

安装:

WordPress Admin Method
  1. In your WordPress admin, go to Plugins > Add New.
  2. Search for SRI Shield.
  3. Click Install Now, then Activate.
  4. Open SRI Shield from the WordPress admin sidebar.
Manual Method
  1. Upload the sri-shield folder to the /wp-content/plugins/ directory.
  2. Open the Plugins screen in WordPress.
  3. Locate SRI Shield and click Activate.
After Activation
  1. Open SRI Shield > Dashboard and confirm the status badge reads "Protection Active".
  2. Configure the hash algorithm, exclusions, and change detection, then save your settings. SHA-384 is the default and is recommended for most sites.
  3. Open Scanner and run your first scan to check your pages.
  4. Open Notifications, enable email alerts, and send a test email. Hashes are recorded as your pages are viewed. After you update a theme, plugin, or WordPress itself, open Hash Records and review any changed files: browsers block a changed file until you approve its new hash.

屏幕截图:

  • General Settings for enabling SRI, the default hash algorithm, excluded asset handles, auto regenerate, and scanner depth
  • Maintenance Tools to reset the hash cache or regenerate every integrity hash
  • Scanner screen with the latest scan summary and per-asset results for valid, missing, tampered, and unreachable assets
  • Hash Records screen to hash an external CDN URL and manage every stored integrity hash
  • Notifications screen with tamper alert emails, email branding options, and Send Test Email
  • Logs screen with activity filtered by level, search, and CSV export

升级注意事项:

1.2.0 Security update: changed scripts and stylesheets now need your approval before their new hash is trusted. After updating themes, plugins, or WordPress, review changed files under SRI Shield > Hash Records — browsers block a changed file until you approve it. Existing trusted hashes are kept. 1.1.0 Adds the Website SRI Scanner, email notifications, and dedicated Scanner and Notifications screens. Includes a database update for scan results. 1.0.0 Initial stable release.

常见问题:

What is Subresource Integrity (SRI)?

It is a browser security feature. Each script or stylesheet tag carries a hash of the file's expected content. Before using the file, the browser checks that its content still matches the hash, and blocks it if it does not.

Does SRI Shield guarantee that my files are safe?

No. SRI confirms that a file matches a hash; it does not decide whether the file is trustworthy. SRI Shield trusts each file's content the first time it is hashed and asks you to approve every later change. Review changes before approving them, and keep using your other security measures.

Do I need technical knowledge to use SRI Shield?

No. Every feature is available through settings screens in your WordPress dashboard, and the plugin works with safe defaults.

Which files does SRI Shield protect?

CSS and JavaScript assets that are enqueued through WordPress, whether they are local, on a CDN, or on another remote service. Scripts and stylesheets added to pages in other ways (hard-coded tags or JavaScript injection) are not given integrity attributes.

Does the scanner find scripts loaded by JavaScript?

No. The scanner analyzes the HTML your server returns and does not run JavaScript, so assets injected at runtime are not detected.

Does this work with CDN assets?

Yes. SRI Shield can hash remote assets via secure HTTP requests when the URL is accessible from your server. If a file cannot be reached or verified, it is left without an integrity attribute rather than causing an error. Cross-origin SRI also requires the CDN to send CORS headers.

Will this process wp-admin assets?

Only when the Process Admin Assets setting is enabled. It is off by default.

Will my visitors notice any difference?

Not while files are unchanged. If a protected file changes and the change has not been approved yet, browsers refuse that file, which can affect the features that depend on it until you review the change.

Will it slow down my site?

Hashes are stored and reused, so files are not re-hashed on every visit. A local file is hashed again only when its modification time or size changes.

Which hash algorithm should I choose?

SHA-384. It is strong, widely supported, and the default. SHA-256 and SHA-512 are also available if you have a specific reason to change it.

Can I re-hash all assets?

Use Re-check Hashes on the Dashboard. New assets are enrolled, unchanged assets keep their hash, and changed assets are flagged for review. It never replaces a trusted hash.

What does a "Hash mismatch" result mean?

On a page, it means the integrity attribute does not match the content currently served, so browsers refuse the file. For a stored hash record, it means the file changed after its hash was trusted. The change appears under Hash Records > Changes Awaiting Review. If you made or expected the change (for example by updating the plugin that ships the file), approve the new hash. If you did not expect it, treat it as a possible security issue and investigate before approving anything.

A script or style stopped working after an update. What should I do?

The file probably changed, and browsers are refusing it because its trusted hash no longer matches. Open Hash Records, review the change, and approve the new hash if the change is expected. If you need the file to load before you can review it, Exclude it temporarily (it then loads without an integrity attribute) and re-include it after review.

What does approving a change do?

SRI Shield fetches the file again and confirms that its content still produces the proposed hash you reviewed; if not, nothing is approved. Approval then makes the new hash trusted. It records that you accept the new content — it does not verify that the content is safe.

An external or CDN file shows an "Error" status. What does that mean?

The file could not be reached when it was first hashed. Confirm the file's address is correct and the service is available, then use Re-check. If it still cannot be verified, exclude it.

I installed a new theme or plugin. Do I need to do anything?

New files are enrolled automatically the first time they are served. Updated versions of files that were already enrolled need your review on the Hash Records screen. Run a scan to confirm the results.

Why am I not receiving alert emails?

Check that Email Notifications is switched on, that the recipient address is valid, and that your site is able to send email. Use Send Test Email on the Notifications screen to confirm delivery.

Who can access SRI Shield?

Only Administrators. The plugin's menus are hidden from all other roles, and hash changes can only be approved by users who can manage site options.

Can I undo an exclusion?

Yes. Any excluded file can be re-included at any time from the Hash Records screen.

How do I reset everything?

Reset Cache clears cached lookups and failed-asset records so they are retried. Trusted hashes and pending reviews are kept on purpose: deleting them would let the next page load trust the current content of a changed file without review. To stop adding an integrity attribute to a file, exclude it. Deleting the plugin removes all of its data.

What happens if I deactivate or delete the plugin?

When you deactivate it, integrity attributes are no longer added and your files are served normally. When you delete it, the plugin runs its uninstall cleanup, which removes its database tables and options.

Does it work on a Multisite network?

Yes. SRI Shield supports Multisite activation, works on each site in the network individually, and cleans up after itself if removed.

Can developers extend SRI Shield?

Yes. See the "Developer Filters and Actions" section for the available filters and actions.

How do I get support?

When opening a support request, please include:

  • What you were doing when the issue occurred
  • The exact wording of any message or status shown by the plugin
  • Any relevant file address shown on the Hash Records or Scanner screens
  • Whether you recently changed your theme, plugins, or site files

更新日志:

1.2.0 1.1.0 1.0.0