DEV Community

Cover image for SWORD: the merge of Symfony and WordPress
William Arin
William Arin

Posted on

SWORD: the merge of Symfony and WordPress

It could be a new beginning in the WordPress era. Imagine WordPress being WordPress, but also being Symfony. Not a subset of WordPress and a subset of Symfony. Both WordPress and Symfony at their full potential, at the same time, on the same application.

Sounds like a dream? It's now reality.

Meet Sword. The best of both worlds.

So, what Sword really is and what problems does it solve? If you've heard of Bedrock, it's similar but with Symfony.
Sword is Symfony running WordPress.

It allows you to:

  • use a centralized composer for WordPress core and plugins as well as other libs
  • extend a WordPress website well outside its bounds, into the modern framework territory
  • give WordPress code standardized and modern style and patterns
  • bring all the good things of Symfony into WordPress, be it dependency injection, translator, Symfony UX, etc...

There's no limit to what you can do.
You want Symfony routes bypassing WordPress? No problem, it's a Symfony app.
You need Symfony UX into your WordPress theme? Sure.
You need a specific page to be 100% Symfony with API calls to WordPress API? Yes you can.

Full installation with Docker takes one command. Zero configuration. No Docker knowledge needed (recommended for further usage though).
Your Sword app should be ready in one or two minutes.

Performance wise, it seems fast enough. Pure Symfony performance is not impacted, the WordPress side is maybe 90ms slower. No big deal given the superpowers you get in exchange.

Here's the link: https://getsword.com

If you like it please give a star on the Github repo and share it!

GitHub logo phpsword / sword-bundle

Modern WordPress development with Symfony

Sword Logo


Github Workflow

Introduction

Modern WordPress development with Symfony.

Documentation

Visit https://getsword.com/ for official documentation.

Contributions

Feel free to submit issues and pull requests.

License

MIT

Copyright (c) 2022, William Arin




I previously posted on Reddit, it got some attention with interesting comments. Check it out eventually:

Reddit Logo Symfony meets WordPress. I call it Sword.

Few months ago I came here to introduce a library to work with WordPress database from a third party app (WordpressInterop). I use it to work in a Symfony app that connects to some WordPress websites.

And then I had a monolithic dream. While the world is falling apart into microservices, I had a vision of WordPress and Symfony merging…

Top comments (3)

Collapse
 
romaixn profile image
Romain

This project looks very promising ! 🔥

Collapse
 
williarin profile image
William Arin

Thanks!

Collapse
 
icolomina profile image
Nacho Colomina Torregrosa

This is amazing !