PHPackages                             mikica/clickjacking-middleware - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [HTTP &amp; Networking](/categories/http)
4. /
5. mikica/clickjacking-middleware

ActiveLibrary[HTTP &amp; Networking](/categories/http)

mikica/clickjacking-middleware
==============================

Provides clickjacking protection via the X-Frame-Options header.

1.07(7y ago)71.2k1BSD-3-ClausePHPPHP &gt;=5.3

Since Nov 1Pushed 7y ago1 watchersCompare

[ Source](https://github.com/mikicaivosevic/clickjacking-middleware)[ Packagist](https://packagist.org/packages/mikica/clickjacking-middleware)[ RSS](/packages/mikica-clickjacking-middleware/feed)WikiDiscussions master Synced today

READMEChangelog (5)Dependencies (3)Versions (8)Used By (0)

Clickjacking Protection Middleware
==================================

[](#clickjacking-protection-middleware)

PSR-7 Middleware that provides clickjacking protection via the X-Frame-Options header.

Middleware that sets the X-Frame-Options HTTP header in HTTP responses. Does not set the header if it's already set. By default, sets the X-Frame-Options header to 'SAMEORIGIN', meaning the response can only be loaded on a frame within the same site.

Note: older browsers will quietly ignore this header, thus other clickjacking protection techniques should be used if protection in those browsers is required.

Installation
------------

[](#installation)

`composer require mikica/clickjacking-middleware`

Usage
-----

[](#usage)

In Slim 3:

```
//new Clickjacking\Middleware\XFrameOptions("DENY")
$app->add(new Clickjacking\Middleware\XFrameOptions());

$app->get('/', function ($request, $response, $args) {
    return $response;
});
```

###  Health Score

31

—

LowBetter than 66% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity20

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity63

Established project with proven stability

 Bus Factor1

Top contributor holds 77.8% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~178 days

Recently: every ~267 days

Total

7

Last Release

2826d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/2887620?v=4)[Mikica Ivosevic](/maintainers/mikicaivosevic)[@mikicaivosevic](https://github.com/mikicaivosevic)

---

Top Contributors

[![mikicaivosevic](https://avatars.githubusercontent.com/u/2887620?v=4)](https://github.com/mikicaivosevic "mikicaivosevic (14 commits)")[![schnittstabil](https://avatars.githubusercontent.com/u/6059032?v=4)](https://github.com/schnittstabil "schnittstabil (4 commits)")

---

Tags

psr-7middlewareX-Frame-Optionsclickjacking

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/mikica-clickjacking-middleware/health.svg)

```
[![Health](https://phpackages.com/badges/mikica-clickjacking-middleware/health.svg)](https://phpackages.com/packages/mikica-clickjacking-middleware)
```

###  Alternatives

[guzzlehttp/psr7

PSR-7 message implementation that also provides common utility methods

8.0k1.1B4.0k](/packages/guzzlehttp-psr7)[mezzio/mezzio

PSR-15 Middleware Microframework

3923.8M125](/packages/mezzio-mezzio)[laminas/laminas-stratigility

PSR-7 middleware foundation for building and dispatching middleware pipelines

587.2M101](/packages/laminas-laminas-stratigility)[mezzio/mezzio-authentication-oauth2

OAuth2 (server) authentication middleware for Mezzio and PSR-7 applications.

28591.3k3](/packages/mezzio-mezzio-authentication-oauth2)[mezzio/mezzio-authentication

Authentication middleware for Mezzio and PSR-7 applications

131.7M39](/packages/mezzio-mezzio-authentication)[phpro/http-tools

HTTP tools for developing more consistent HTTP implementations.

28150.5k](/packages/phpro-http-tools)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
