PHPackages                             creatuity/magento2-interceptors - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. creatuity/magento2-interceptors

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

creatuity/magento2-interceptors
===============================

Creatuity Compiled Interceptors Module

1.3.7(1y ago)136116.5k↑37.5%19[5 issues](https://github.com/creatuity/magento2-interceptors/issues)[1 PRs](https://github.com/creatuity/magento2-interceptors/pulls)1MITPHP

Since Jun 6Pushed 1y ago21 watchersCompare

[ Source](https://github.com/creatuity/magento2-interceptors)[ Packagist](https://packagist.org/packages/creatuity/magento2-interceptors)[ RSS](/packages/creatuity-magento2-interceptors/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)DependenciesVersions (14)Used By (1)

### ABOUT

[](#about)

This component changes the way Magento 2 generates Interceptor classes (a mechanism that allows plugins to work together).

Instead of generating boilerplate code it compiles the Interceptor using information from source code. This makes plugins slightly faster and as Magento uses a lot of plugins, even at its core, it lowers request time by ~10%. This is important in places where there is a lot of non-cached PHP logic going on (for example admin panel is noticeably faster).

The default method uses code that is called on nearly each method to see if there are any plugins connected, in generated code this is not required and call-stack is reduced.

Having plugins called directly also makes code easier to debug and bugs easier to find.

The Interceptors generated by this plugin are 100% compatible with the ones generated by Magento by default, so there is no need to change anything in your plugins.

### VERSIONS

[](#versions)

As Magento 2.4 introduced changes in Interceptors generator which are not backward compatible this module has separate branch for both Magento versions:

- use 1.3.\* for Magento 2.4 (branch: master)
- use 1.2.\* for Magento 2.3 (branch: magento23)

### CONFIGURATION

[](#configuration)

This module adds following preference to work in developer mode:

```

```

And following preferences to work in production or default modes:

```

```

Those are enabled by default in module `di.xml`.

However this module does not touch the default generation method so you can override above preferences to fallback to the default mechanism for all or selected modes.

### TECHNICAL DETAILS

[](#technical-details)

Instead of interceptors that read plugins config at runtime like this:

```
public function methodX($arg) {
    $pluginInfo = $this->pluginList->getNext($this->subjectType, 'methodX');
    if (!$pluginInfo) {
        return parent::methodX($arg);
    } else {
        return $this->___callPlugins('methodX', func_get_args(), $pluginInfo);
    }
}

```

This generator generates static interceptors like this:

```
public function methodX($arg) {
    switch(getCurrentScope()){
        case 'frontend':
            $this->_get_example_plugin()->beforeMethodX($this, $arg);
            $this->_get_another_plugin()->beforeMethodX($this, $arg);
            $result = $this->_get_around_plugin()->aroundMethodX($this, function($arg){
                return parent::methodX($arg);
            });
            return $this->_get_after_plugin()->afterMethodX($this, $result);
        case 'adminhtml':
            // ...
        default:
            return parent::methodX($arg);
    }
}

```

#### PROS

[](#pros)

- Easier debugging.

    - If you ever stumbled upon `___callPlugins` when debugging you should know how painful it is to debug issues inside plugins.
    - Generated code is decorated with PHPDoc for easier debugging in IDE
- Fastest response time (5%-15% faster in developer and production mode)

    - No redundant calls to `___callPlugins` in call stack.
    - Methods with no plugins are not overridden in parent at all.
- Implemented as a module and can be easily reverted to the default `Generator\Interceptor`

#### CONS

[](#cons)

- Each time after making change in etc plugins config, `generated/code/*` and `var/cache/*` needs to be purged
- As this does not load plugins at runtime, might not work in an edge case of plugging into core Magento classes like `PluginsList` etc.

###  Health Score

50

—

FairBetter than 96% of packages

Maintenance46

Moderate activity, may be stable

Popularity50

Moderate usage in the ecosystem

Community26

Small or concentrated contributor base

Maturity66

Established project with proven stability

 Bus Factor1

Top contributor holds 74.5% 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 ~237 days

Recently: every ~93 days

Total

10

Last Release

399d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/0998200db85ed30d30e182230c837875edd8abf02ca4d64389eccd730584e5cc?d=identicon)[creatuitydevelopers](/maintainers/creatuitydevelopers)

---

Top Contributors

[![fsw](https://avatars.githubusercontent.com/u/784083?v=4)](https://github.com/fsw "fsw (35 commits)")[![rhoerr](https://avatars.githubusercontent.com/u/13335952?v=4)](https://github.com/rhoerr "rhoerr (2 commits)")[![melindash](https://avatars.githubusercontent.com/u/11895784?v=4)](https://github.com/melindash "melindash (2 commits)")[![oleksandr-semchyshyn-vaimo](https://avatars.githubusercontent.com/u/255937518?v=4)](https://github.com/oleksandr-semchyshyn-vaimo "oleksandr-semchyshyn-vaimo (2 commits)")[![maaarghk](https://avatars.githubusercontent.com/u/3168648?v=4)](https://github.com/maaarghk "maaarghk (2 commits)")[![YevSent](https://avatars.githubusercontent.com/u/2736528?v=4)](https://github.com/YevSent "YevSent (1 commits)")[![ProcessEight](https://avatars.githubusercontent.com/u/16059110?v=4)](https://github.com/ProcessEight "ProcessEight (1 commits)")[![sambolek](https://avatars.githubusercontent.com/u/5627631?v=4)](https://github.com/sambolek "sambolek (1 commits)")[![Swahjak](https://avatars.githubusercontent.com/u/4386577?v=4)](https://github.com/Swahjak "Swahjak (1 commits)")

### Embed Badge

![Health badge](/badges/creatuity-magento2-interceptors/health.svg)

```
[![Health](https://phpackages.com/badges/creatuity-magento2-interceptors/health.svg)](https://phpackages.com/packages/creatuity-magento2-interceptors)
```

PHPackages © 2026

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