PHPackages                             abetter/wordpress - 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. [Security](/categories/security)
4. /
5. abetter/wordpress

ActiveLibrary[Security](/categories/security)

abetter/wordpress
=================

A Better Laravel + Wordpress integration, for exceptionally fast web applications.

1.6.26(3y ago)114445[2 issues](https://github.com/abetterstory/abetter-wordpress/issues)[2 PRs](https://github.com/abetterstory/abetter-wordpress/pulls)MITPHP

Since May 28Pushed 3y ago3 watchersCompare

[ Source](https://github.com/abetterstory/abetter-wordpress)[ Packagist](https://packagist.org/packages/abetter/wordpress)[ RSS](/packages/abetter-wordpress/feed)WikiDiscussions master Synced 3w ago

READMEChangelogDependencies (3)Versions (180)Used By (0)

A Better Wordpress
==================

[](#a-better-wordpress)

[![Packagist Version](https://camo.githubusercontent.com/335c716d226d47628ddfd71f2b6d5b16b26642df6585c77f726a29d9edd6347c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f616265747465722f776f726470726573732e737667)](https://packagist.org/packages/abetter/wordpress)[![Latest Stable Version](https://camo.githubusercontent.com/5ce104d524ca616a70dd8fdd7caf43381644b316ffac071ecaab7cfa74c313d5/68747470733a2f2f706f7365722e707567782e6f72672f616265747465722f776f726470726573732f762f737461626c652e737667)](https://packagist.org/packages/abetter/wordpress)[![Total Downloads](https://camo.githubusercontent.com/f47a8dc778a9dbc27cde77460a27690f4a651898a6c156a09d48b00dc7782d78/68747470733a2f2f706f7365722e707567782e6f72672f616265747465722f776f726470726573732f646f776e6c6f6164732e737667)](https://packagist.org/packages/abetter/wordpress)[![License](https://camo.githubusercontent.com/69639b6b3c055482dcd0a6912150f0168f42a056c2318956bf329b7ec203ba48/68747470733a2f2f706f7365722e707567782e6f72672f616265747465722f776f726470726573732f6c6963656e73652e737667)](https://packagist.org/packages/abetter/wordpress)

ABetter Wordpress is a turnkey solution for using Wordpress on top of Laravel to build exceptionally fast web applications – while still using the worlds most popular CMS to manage content and translations.

Our methodology to fast web applications is all about Separation of Concerns (SoC) and Scalable Static Caching. We let Wordpress handle the content back-end and Laravel the standalone front-end. Additional API and web services for dynamic content are also routed through Laravel.

With the ABetter Toolkit we give Laravel/Blade some new powerful directives helping us separate as much as possible in standalone and resusable components – much inspired by ReactJS/VueJS.

---

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

[](#requirements)

- PHP 7.2+
- Imagick 3+
- MySQL 5.7+
- Composer 1.6+
- Laravel 5.8+
- Deployer 6+
- Node 10.0+
- NPM 6.4+

---

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

[](#installation)

Via Composer:

```
composer create-project --prefer-dist laravel/laravel . "6.*"
composer require abetter/wordpress
```

#### Laravel modifications

[](#laravel-modifications)

Add post install/update script to composer.json:

```
"scripts": {
	"post-install-cmd": [
		"ABetter\\Wordpress\\ComposerScripts::postInstall"
	],
	"post-update-cmd": [
		"ABetter\\Wordpress\\ComposerScripts::postUpdate"
	]
}
```

Note: The script will modify any core files using the global \_\_() method for string translations and add a cross-framework workaround. Sadly wordpress core do not check for function\_exists before defining global \_\_(), which breaks Laravel + Wordpress compatibility without modification.

Add middleware to app/Http/Kernel.php:

```
protected $middleware = [
	\ABetter\Toolkit\SandboxMiddleware::class,
	\ABetter\Wordpress\Middleware::class,
];
```

Note: The middleware helps Blade clear the view cache when developing many nested components.

---

Preparations
------------

[](#preparations)

- Setup a local host domain using .loc, (e.g. [www.abetter.loc](http://www.abetter.loc))
- Point the host to /public
- Create a local mysql database

Setup Laravel
-------------

[](#setup-laravel)

Edit .env settings

```
APP_NAME=
APP_VERSION=
APP_KEY=base64:insert/base64/encoded/aes256/encryption/key=
APP_ENV=
APP_DEBUG=
APP_URL=
APP_PROXY=
DB_DATABASE=
DB_USERNAME=
DB_PASSWORD=
WP_THEME=
WP_AUTOLOGIN=
WP_REQUIRELOGIN=
```

Note: Use APP\_ENV=sandbox when developing with browsersync.

Add routes to /routes/web.php

```
// ABetter Toolkit services
Route::any('image/{style?}/{path}', '\ABetterToolkitController@handle')->where('path','.*');
Route::any('proxy/{path}', '\ABetterToolkitController@handle')->where('path','.*');
Route::any('browsersync/{event?}/{path}', '\ABetterToolkitController@handle')->where('path','.*');
Route::any('service/{path?}.{type}', '\ABetterToolkitController@handle')->where(['path'=>'.*','type'=>'json']);

// ABetter Wordpress main route
Route::any('{path}', '\ABetterWordpressController@handle')->where('path','^(?!nova-api|nova-vendor|nova|api).*$');
```

Note: Remove any other routes for root or wp paths (i.e default Welcome).

Copy the Deployer file to root and run setup once:

```
cp vendor/abetter/toolkit/deploy/deploy.php deploy.php
dep setuponce local
```

Run audit fix if needed:

```
npm audit fix
```

Note: Only run the setuponce on fresh projects, since it will replace files in /resources and /public.

Test to build the app:

```
dep build local
```

Setup Wordpress
---------------

[](#setup-wordpress)

Go to host in browser (e.g. ) and follow install instructions.

Go to /Appearance/Themes, and activate ABetter theme.

Go to /Plugins, and activate:

- Advanced Custom Fields.
- Disable Gutenberg (full support is coming soon...).
- ... Any other of the supported plugins you need.

Add default pages:

```
 :  :  :
Start : start : default : -1
News : news : default : 200
Privacy Policy : privacy-policy : default : 200
Search : search : search : 400
403 Forbidden : 403-forbidden : error : 403
404 Not found : 404-not-found : error : 404
```

Go to /Settings/Reading:

- Select Start as homepage
- Select News as post page

Finaly, go to host in browser:

**Congratulations to your new site!**

---

Usage
-----

[](#usage)

#### Development

[](#development)

Use npm to start webpack and browsersync:

```
npm run watch
```

... or if using php artisan serve:

```
php artisan serve & npm run watch
```

NOTE: With "php artisan serve" you need to modify APP\_PROXY in .env to .

#### Component file structure

[](#component-file-structure)

```
.
├── public                                   # Handled by build script (will be overwritten)
├── routes                                   # Add any development routes to /web.php
├── resources                                #
│   ├── scripts                              # Global scripts in "app.js"
│   ├── styles                               # Global styles in "app.scss"
│   ├── fonts                                # Fonts here (will copy to /public on build)
│   ├── images                               # Images here (will copy to /public on build)
│   ├── videos                               # Videos here (will copy to /public on build)
│   ├── views                                #
│   │   ├──                           # Subfolder defined in .env / WP_THEME
│   │   │   ├── template.blade.php           # Template file requested in route
│   │   │   │   ├── components               #
│   │   │   │   │   ├── menu                 # Component subfolder:
│   │   │   │   │   │   ├── menu.blade.php   # Template file : @component('components.menu',TRUE)
│   │   │   │   │   │   ├── menu.scss        # Sass file : @style('menu.scss')
│   │   │   │   │   │   ├── menu.js          # Javascript file : @script('menu.js')
...

/vendor/abetter/wordpress/                   # Default components will be used if not overridden!
├── views                                    # (e.g. html head start/end is rendered from here)
│   ├── default                              #
│   │   ├── robots.blade.php                 # Default Robots.txt template
│   │   ├── sitemap.blade.php                # Default Sitemap.xml template
│   │   ├── components                       #
│   │   │   │   ├── html                     # Default HTML head components
│   │   │   │   ├── missing                  # Default debugging for missing components
│   │   │   │   ├── robots                   # Default Robots.txt component
│   │   │   │   ├── sitemap                  # Default Sitemap.xml component
...

```

Note: Component names will be auto-resolved if the blade file has same basename as folder.

Note: Linked JS/Sass files in components will be external files in development to support browsersync live, but will be embedded in html source on Stage/Production environments for better caching.

Note: You can auto-terminate a @component with TRUE as the second paramater, to avoid writing out @endcomponent, e.g when not using any slots or nested content.

#### Deployment

[](#deployment)

(coming soon)

---

Contributors
============

[](#contributors)

[Johan Sjöland](https://www.abetterstory.com/%5D)
Senior Product Developer: ABetter Story Sweden AB.

License
-------

[](#license)

MIT license. Please see the [license file](LICENSE) for more information.

###  Health Score

37

—

LowBetter than 81% of packages

Maintenance16

Infrequent updates — may be unmaintained

Popularity21

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity82

Battle-tested with a long release history

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

Recently: every ~74 days

Total

177

Last Release

1399d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/9a82ce146c604f52fb87f37ecdbce1cab95301b4a60f3e07e36b9f720d2742c7?d=identicon)[abetter](/maintainers/abetter)

---

Top Contributors

[![sjoland](https://avatars.githubusercontent.com/u/5939589?v=4)](https://github.com/sjoland "sjoland (28 commits)")

---

Tags

laravelperfomancesecurityspeedwordpress

### Embed Badge

![Health badge](/badges/abetter-wordpress/health.svg)

```
[![Health](https://phpackages.com/badges/abetter-wordpress/health.svg)](https://phpackages.com/packages/abetter-wordpress)
```

###  Alternatives

[mews/captcha

Laravel 5/6/7/8/9/10/11/12 Captcha Package

2.6k5.8M88](/packages/mews-captcha)[tempest/framework

The PHP framework that gets out of your way.

2.2k34.4k13](/packages/tempest-framework)[unopim/unopim

UnoPim Laravel PIM

10.5k2.4k](/packages/unopim-unopim)[code16/sharp

Laravel Content Management Framework

79164.7k7](/packages/code16-sharp)[pressbooks/pressbooks

Pressbooks is an open source book publishing tool built on a WordPress multisite platform. Pressbooks outputs books in multiple formats, including PDF, EPUB, web, and a variety of XML flavours, using a theming/templating system, driven by CSS.

45444.2k1](/packages/pressbooks-pressbooks)[symfony/ux-cropperjs

Cropper.js integration for Symfony

19346.6k3](/packages/symfony-ux-cropperjs)

PHPackages © 2026

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