elias-knodel / wordpress-oop-plugin

WordPress OOP attempts and best practices.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Caution

There are too many components I would need to write from scratch. Hence, in my second approach,
I used the Symfony Components, which are by default standalone and usable: elias-knodel/wordpress-x-symfony

wordpress-oop-plugin

WordPress OOP attempts and best practices.

Development

  1. Install Composer Dependencies
composer install
  1. Start Local Instance
docker compose up -d
  1. Install Composer Dependencies
docker compose exec wordpress composer install
  1. Go to http://localhost:8080 and install WordPress and change permalink settings OR

  2. Wait until you see the installation page and then execute these two commands

docker compose run --rm --remove-orphans wpcli core install --url="localhost:8000" --title="Local WordPress" --admin_user="admin" --admin_password="admin" --admin_email="admin@example.com"
docker compose run --rm --remove-orphans wpcli option update permalink_structure '/%postname%/'

Other Commands

  1. Stop Local Instance
docker compose down
  1. If you want you can easily reset the database
docker compose down -v

Description

  • All the code is an example of how you would implement modern Software architecture with WordPress.
  • It uses the Rest API, a Serializer and more to allow easy synchronization between an extern and the WP Intern Database.
  • Goal is to make this something like a boilerplate for future projects.
  • Because it's just a boilerplate and under the MIT license, you can use it freely as a starting point for your own projects.

(Planned) Features and Inspiration

  • Backend Settings for api mappings
  • Queue system to sync something again / back if a job has failed
  • Serializer for easier work with woocommerce.
    • Example: Receiving a product as json and converting it to a WC_Product / saving it to the database.

About

WordPress OOP attempts and best practices.

License:MIT License


Languages

Language:PHP 100.0%