Skip to content

Developer Guide

Ebrahim Shafiei edited this page Mar 9, 2025 · 2 revisions

πŸ›‘οΈ Abdal Security Headers

Abdal Security Headers Plugin Screenshot

πŸ“ Description

Abdal Security Headers is a WordPress plugin that enhances your website's security by implementing and managing HTTP security headers. This plugin provides a simple interface for configuring security headers and Content Security Policy (CSP) directives.

✨ Features

Security Headers Management

  • πŸ”’ X-XSS-Protection header to prevent cross-site scripting attacks
  • πŸ›‘οΈ X-Frame-Options header to prevent clickjacking
  • πŸ” X-Content-Type-Options header to prevent MIME-type sniffing
  • 🌐 Strict-Transport-Security (HSTS) header to enforce HTTPS connections
  • 🚫 Referrer-Policy header to control information leakage
  • πŸ›‘ Content Security Policy (CSP) with real-time preview and configuration

Content Security Policy Features

  • πŸ“ Visual CSP directive editor
  • πŸ‘οΈ Real-time CSP header preview
  • 🎨 CSP directive syntax highlighting
  • βœ… CSP syntax validation
  • πŸ“Š CSP violation reporting configuration

WordPress Security Enhancements

  • 🎭 Hide WordPress version information
  • ⚑ Remove unnecessary headers
  • πŸ”Œ XML-RPC protection
  • πŸ”‘ REST API access control
  • πŸ“’ Hide server information

User Interface

  • πŸ’« Modern UI with iOS-style switches
  • πŸŽ›οΈ Accordion sections for better organization
  • 🌐 Full RTL support for multilingual sites
  • πŸ’‘ Helpful tooltips and documentation
  • 🎯 User-friendly settings panel

Additional Features

  • πŸ“± Mobile-responsive admin interface
  • πŸ”„ Settings import/export capability
  • πŸ“ Security event logging
  • βš™οΈ Fine-grained control over each security feature
  • πŸ› οΈ Developer-friendly hooks and filters

πŸš€ Installation

  1. Upload plugin files to /wp-content/plugins/abdal-security-headers
  2. Activate the plugin through WordPress plugins screen
  3. Use Settings -> Security Headers to configure the plugin

βš™οΈ Configuration

  1. Go to Settings -> Security Headers in WordPress admin panel
  2. Enable/disable security headers using the switches
  3. Configure CSP directives if needed
  4. Save settings

πŸ”§ Requirements

  • WordPress 5.0 or higher
  • PHP 7.2 or higher
  • Modern web browser for admin interface

πŸ› Issue Reporting

If you encounter any issues or need configuration help, please contact us at Prof.Shafiei@Gmail.com. You can also report issues on GitLab or GitHub.

❀️ Support

If you found this project helpful and would like to support further development, please consider making a donation:

🀡 Developer

Made with love by Ebrahim Shafiei (EbraSha)

πŸ“œ License

This project is licensed under GPLv2 or later - see the LICENSE file for details.

Table of Contents

Introduction

The Abdal Security Headers plugin is a security enhancement tool for WordPress that provides management of security headers and additional security features.

Installation & Setup

  1. Clone the repository:
git clone https://github.com/ebrasha/abdal-security-headers.git
  1. Install dependencies:
composer install
  1. Copy files to WordPress plugins folder

Project Structure

abdal-security-headers/
β”œβ”€β”€ docs/                    # Documentation
β”œβ”€β”€ includes/               # Core classes
β”‚   β”œβ”€β”€ class-ash-admin.php  # Admin panel management
β”‚   └── class-ash-headers.php # Headers implementation
β”œβ”€β”€ languages/              # Translation files
β”œβ”€β”€ assets/                # CSS and JS files
└── abdal-security-headers.php # Main plugin file

Key APIs and Functions

ASH_Headers Class

Responsible for managing security headers and security features:

// Set security headers
public function set_security_headers()

// Disable XML-RPC
public function ash_block_xmlrpc_access()

// Restrict REST API
public function ash_disable_rest_api()

ASH_Admin Class

Manages admin panel interface:

// Create settings page
public function create_admin_page()

// Register settings
public function page_init()

Contribution Guide

  1. Create a new branch for feature or bug fix
  2. Make your changes
  3. Run tests
  4. Create Pull Request

Troubleshooting

  • Enable WP_DEBUG in wp-config.php
  • Check error logs
  • Use security headers checking tools like SecurityHeaders.com

For more information, visit the complete documentation.