PHPackages                             blacktrs/modern-wp - 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. blacktrs/modern-wp

AbandonedArchivedProject[Framework](/categories/framework)

blacktrs/modern-wp
==================

Symfony based WordPress boilerplate with modern development tools, easier configuration, and an improved folder structure

1.1.0(2y ago)13MITPHPPHP &gt;=8.1

Since Jul 16Pushed 2y ago1 watchersCompare

[ Source](https://github.com/blacktrs/modern-wp)[ Packagist](https://packagist.org/packages/blacktrs/modern-wp)[ Docs](https://github.com/blacktrs/modern-wp)[ RSS](/packages/blacktrs-modern-wp/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (3)Dependencies (68)Versions (3)Used By (0)

Overview
========

[](#overview)

ModernWP is an enhanced WordPress boilerplate based on the pure [Symfony Framework](https://github.com/symfony) and [Roots Bedrock](https://github.com/roots/bedrock).

ModernWP is created for WordPress-based projects that need better structure and tooling. You can use almost everything from Symfony and WordPress at the same time.

This boilerplate could be used for migrating big codebase from classic heavy WordPress-style projects to modern approaches without significant breaking loss of backward compatibility.

Features
--------

[](#features)

- Symfony-driven structure project
- Easier configuration
- All benefits from the modern framework-based solution
- Roots Bedrock inside

Requirements
------------

[](#requirements)

- PHP &gt;= 8.1
- MySQL/MariaDB (due WordPress dependency)

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

[](#installation)

- `composer create-project blacktrs/modern-wp ./project`
- `cd ./project`
- `composer install`
- `yarn install`
- Configure `DATABASE_URL` in `.env`
- Configure other needed env variables or yaml configs

### Docker

[](#docker)

- Copy `docker-compose.dist.yml` to `docker-compose.yml`
- Edit `docker-compose.yml` if needed
- Run `docker-compose up -d --build`

### Potential docker issues

[](#potential-docker-issues)

- If causes HTTP Error `500` after `bin/console cache:clear` remove `var` directory and recreate it with `chmod 0777`

Local environment
-----------------

[](#local-environment)

- Open `https://localhost`

### Custom hostname

[](#custom-hostname)

- Change `NGINX_HOST` with yours in `docker-compose.yml`
- Add entry `127.0.0.1 your_host.local` to `/etc/hosts`

### Local HTTPS

[](#local-https)

- Install [mkcert](https://github.com/FiloSottile/mkcert)
- Run `mkcert -install`

By default, https works for `localhost`

If needed to generate specific SSL certificate for your custom hostname run following command

```
mkcert \
  -cert-file docker/cert/main.crt \
  -key-file docker/cert/main.key \
  your-host.local

```

- Change `your_host.local` with desired hostname
- Update `docker-compose.yml`

Documentation
=============

[](#documentation)

Configuration
-------------

[](#configuration)

By default, configuration should be considered in `confing/**.yaml` files.

The all configuration parameters in `SCREAMING_SNAKE_CASE` will be converted to php const, so WordPress can read it as configuration constant.

For example, following parameters will be converted to PHP constant `WP_DEBUG` with `true` value. More examples could be found in `config/packages/app.yaml`

```
parameters:
  WP_DEBUG: true
```

Controller types
----------------

[](#controller-types)

You can use 2 types of controllers:

- Rest API
- Template pages

Rest API Controllers
--------------------

[](#rest-api-controllers)

- Every Rest API Controller will be available by the address `https://your-site.com/api/controller/path`
- `api` prefix can be changed in `/config/packages/app.yml` in parameter `app.apiPrefix`

Basically any non-template controller will be interpreted as Rest API controller. Examples could be found in `src/Controller/Rest` directory

Template Controllers
--------------------

[](#template-controllers)

- Every template controller will refer to the WordPress page address.
- To declare template controller, the `path` parameter of `Route()` attribute should contain specific template name

For example, if needed controller for any page with a post-type page then declaring the route will look:

```
#[Route(path: 'page.php', name: 'some_page')]
public function page(): Response
{
    return new Response('my page');
}
```

It is possible to declare a route for any WordPress template

More examples could be found in `src/Controller/Frontent` directory

More documentation about controllers in [symfony documentation](https://symfony.com/doc/current/routing.html)

Templating
----------

[](#templating)

By default, templates should be in `twig` format and stored int `templates` directory. More details in [symfony documentation](https://symfony.com/doc/current/templates.html)

Hooks
-----

[](#hooks)

Declarations of the new handlers for WordPress actions and filters are recommended to add in `Kernel::registerHooks()` method

It is also recommended to use as a handler for every hook separate invokable service classes. To prevent Kernel class bloating it is better to store hook declarations as groups in the different classes.

Plugins
-------

[](#plugins)

Plugins can be added from the WordPress admin dashboard or as [Composer packages](https://wpackagist.org)

Working with database
---------------------

[](#working-with-database)

For convenient work with the database it is better to use [Doctrine ORM](https://www.doctrine-project.org/projects/orm.html)

Out-of-the-box in `src/Entity` are generated set of entities for default WP tables.

Boilerplate extending
---------------------

[](#boilerplate-extending)

To achieve deeper configuration please edit following files:

- `config/bootstrap.php` - bootstrap configuration
- `public/app/mu-plugins/register-application-config.php` - boilerplate WordPress loader
- `public/app/themes/site-default/*`- default WP theme

Frontend assets
---------------

[](#frontend-assets)

It is recommended to use `Symfony Encore` and `Symfony Asset` bundles to build and use frontend assets.

Compiled assets better to store in `public` directory (e.g. `public/build`)

Links
=====

[](#links)

- [Symfony Framework](https://symfony.com/doc/current/index.html)
- [Doctrine ORM](https://www.doctrine-project.org/projects/orm.html)
- [Roots Bedrock](https://roots.io/bedrock)

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity57

Maturing project, gaining track record

 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 ~405 days

Total

2

Last Release

995d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/ae67184245cbfc1c24e6f3d5a2c45b87780793f042a0d7fb1bcaaa1e13a13e2d?d=identicon)[taras\_chr](/maintainers/taras_chr)

---

Top Contributors

[![blacktrs](https://avatars.githubusercontent.com/u/34000979?v=4)](https://github.com/blacktrs "blacktrs (5 commits)")

---

Tags

phpsymfonywordpress

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan, Psalm, Rector

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/blacktrs-modern-wp/health.svg)

```
[![Health](https://phpackages.com/badges/blacktrs-modern-wp/health.svg)](https://phpackages.com/packages/blacktrs-modern-wp)
```

###  Alternatives

[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)[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.4k5.6M651](/packages/sylius-sylius)[ec-cube/ec-cube

EC-CUBE EC open platform.

78527.0k1](/packages/ec-cube-ec-cube)[chameleon-system/chameleon-base

The Chameleon System core.

1026.5k3](/packages/chameleon-system-chameleon-base)[shopware/platform

The Shopware e-commerce core

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

121.8k11](/packages/forumify-forumify-platform)

PHPackages © 2026

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