PHPackages                             graft/framework-core - 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. [Framework](/categories/framework)
4. /
5. graft/framework-core

ActiveLibrary[Framework](/categories/framework)

graft/framework-core
====================

Framework Core for WordPress Plugin Development.

v1.0.0(6y ago)11071MITPHPPHP ^7.2

Since Mar 18Pushed 6y agoCompare

[ Source](https://github.com/Zusoy/graft-framework-core)[ Packagist](https://packagist.org/packages/graft/framework-core)[ RSS](/packages/graft-framework-core/feed)WikiDiscussions develop Synced 3d ago

READMEChangelogDependencies (7)Versions (14)Used By (1)

Graft Framework
===============

[](#graft-framework)

Graft is an little Framework for WordPress Plugins development. It give you clean code architecture for OOP and MVC pattern in your Plugin.

Why Graft ?
===========

[](#why-graft-)

For OOP
-------

[](#for-oop)

I am an developer who love OOP, so when i began WordPress Development i was frustrated that some Plugins don't use OOP.

Of course, I understand that some little Plugins don't have to use OOP, so this Framework is destinated for big Plugins with complex features.

Make more Developer Friendly Plugins
------------------------------------

[](#make-more-developer-friendly-plugins)

During my experience of WordPress Developer, when i was using some Plugin i often asked sames questions :

- Which Hooks uses this Plugin ?
- Is this Plugin give some availables Filters ?
- Is it possible to override this Plugin's Templates ?

Main Graft Features
===================

[](#main-graft-features)

OOP
---

[](#oop)

In an WordPress Plugin you do not have to make OOP Code (you can use only functions) But with Graft, all things is only Object for better code quality.

MVC Pattern and Template Overriding from Theme
----------------------------------------------

[](#mvc-pattern-and-template-overriding-from-theme)

Graft use the Twig Template Engine to allow you to doing MVC Pattern in your Plugin. And Graft allow developers to override all Plugin's Template from their Theme (if you give permission)

Annotations
-----------

[](#annotations)

In Graft, due to the OOP, all basics WordPress functions like `add_action('wp_head')` or `add_filter()` are Annotations like `@Action(name="wp_head")`, so you don't have to specify any callback, it use the specified Method.

Container
---------

[](#container)

All Plugins made with Graft have an Dependency Injection Container (PHP-DI Container) for using autowiring with your Classes or with Graft Injectable Components.

And the container have the list of all WordPress Components used by the Plugin (Action, Filter, Admin Page ...)

Example
=======

[](#example)

This is code example with Graft Framework

```
use Graft\Framework\Annotation\Filter;   //use Filter Annotation
use Graft\Framework\Injectable\Renderer;

/**
 * Class that will be construct by the Factory
 * This class can be injected with autowiring in other Class.
 */
class MyHookManager
{
    /**
     * HookManager Renderer
     * Use for Template Rendering
     *
     * @var Renderer
     */
    private $renderer;

    /**
     * MyHookManager Constructor
     * using autowiring for dependency injection
     *
     * @param Renderer $renderer
     */
    public function __construct(Renderer $renderer)
    {
        $this->renderer = $renderer;
    }

    /**
     * This Method will be add to 'the_title' Filter by Annotation
     *
     * And 'the_title' Filter will be added in the Plugin Container
     * for other developers who want to know wich Hooks this Plugin using.
     *
     * @Filter(name="the_title")
     *
     * @param string $title Current Title
     *
     * @return string
     */
    public function titleFilterHook(string $title)
    {
        //some example code...
        $title = trim($title);

        // using Twig for Custom Title HTML...
        // this template can be override in the Theme in
        // (wp-content/themes/mytheme/currentPluginName/filter/title.html.twig) for example.
        return $this->renderer->render('filter/title.html.twig', ['title' => $title]);
    }
}
```

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 100% 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 ~19 days

Recently: every ~37 days

Total

10

Last Release

2443d ago

Major Versions

v0.0.9 → v1.0.02019-09-05

### Community

Maintainers

![](https://www.gravatar.com/avatar/d14ece4af95240b090b9e193a69619429e904b49a8af53187c693d54eee9dde6?d=identicon)[Zusoy](/maintainers/Zusoy)

---

Top Contributors

[![Zusoy](https://avatars.githubusercontent.com/u/22716036?v=4)](https://github.com/Zusoy "Zusoy (106 commits)")

### Embed Badge

![Health badge](/badges/graft-framework-core/health.svg)

```
[![Health](https://phpackages.com/badges/graft-framework-core/health.svg)](https://phpackages.com/packages/graft-framework-core)
```

###  Alternatives

[shopware/platform

The Shopware e-commerce core

3.3k1.5M3](/packages/shopware-platform)[sulu/sulu

Core framework that implements the functionality of the Sulu content management system

1.3k1.3M152](/packages/sulu-sulu)[prestashop/prestashop

PrestaShop is an Open Source e-commerce platform, committed to providing the best shopping cart experience for both merchants and customers.

9.0k15.4k](/packages/prestashop-prestashop)[ec-cube/ec-cube

EC-CUBE EC open platform.

78527.0k1](/packages/ec-cube-ec-cube)[drupal/core

Drupal is an open source content management platform powering millions of websites and applications.

19462.3M1.3k](/packages/drupal-core)[contao/core-bundle

Contao Open Source CMS

1231.6M2.4k](/packages/contao-core-bundle)

PHPackages © 2026

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