helsingborg-stad/wpmu-security 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

helsingborg-stad/wpmu-security

Composer 安装命令:

composer require helsingborg-stad/wpmu-security

包简介

A WordPress MU Plugin for security enhancements

README 文档

README

A lightweight WordPress plugin focused on modern security hardening best practices without unnecessary bloat.

🚀 Features

  • ✅ Generic login error messages (prevent user enumeration)
  • ✅ Generic password reset responses
  • ✅ HTTP Strict Transport Security (HSTS)
  • ✅ CORS configuration
  • ✅ Subresource Integrity (SRI) for scripts and styles
  • ✅ XML-RPC disabling
  • ✅ Comment sanitization (anti-XSS)
  • ✅ Content Security Policy (CSP)
  • Custom port number support (development environments, custom setups)
  • ✅ Api Rate Limiter

⚙️ Configuration

This plugin is designed to be hassle free, however if you like to add domains that are not detected in the content security policy. Please use the following filter:

add_filter(
    'WpSecurity/Csp',
    function ($domains) {
        if(!isset($domains['connect-src'])) {
            $domains['connect-src'] = [];
        }
        $domains['connect-src'][] = 'https://*.domain.com';
        $domains['connect-src'][] = 'https://*.domain.net';
        return $domains;
    }
);

🔧 Custom Port Support

The plugin fully supports WordPress installations running on custom ports (e.g., localhost:8080 for development). All security features work correctly with custom ports:

  • ✅ CSP headers include port numbers in domain policies
  • ✅ CORS headers respect the full URL with port
  • ✅ SRI verification works with local assets on custom ports
  • ✅ All URL parsing and domain matching handles ports correctly

No additional configuration is needed - the plugin automatically detects and handles custom ports from your WordPress site URL.

For detailed information about custom port support, see CUSTOM_PORTS.md.

统计信息

  • 总下载量: 2.59k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 0
  • Forks: 3
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-05-27