/wordpress-plugin

A simple WordPress plugin boilerplate with Vite, Vue and Tailwind in OOP Principle

Primary LanguagePHP

WordPress Plugin - PHP

This is a simple template (called a "boilerplate") to help you build your own WordPress plugin. You don't need to know about fancy tools to use it, but if you want, you can add extra things like Alpine.js, Vue.js, or other libraries to make it even cooler!

Features

  • It helps you change placeholder names when creating your plugin, so you don’t have to worry about replacing everything manually.
  • You can make a ZIP file of your plugin easily so you can share it with your friends or team with just one command.
  • If you want, you can manage plugin licenses and support. To do that, you will need a system. You can check out my WordPress Plugin Management System.

What You Need (Requirements)

  • PHP version 7.4 or higher (this is the programming language WordPress uses).
  • VS Code (this is a free program you can use to write your code). Make sure to check for any recommended extensions.
  • Bash Terminal (this helps you run commands). If you have Git Bash or Laragon, you're all set!

Getting Started (Fresh Start)

To start making your own plugin, follow these steps:

  1. Open a Bash terminal (or Git Bash).
  2. Run this command (copy and paste it):
composer create-project devkabir/wordpress-plugin:dev-only-php <your-plugin-name>
  1. Replace <your-plugin-name> with what you want to call your plugin.
  2. Hit Enter and let it do its magic!
  3. You’re ready to start creating something amazing for WordPress!

Happy coding!

Building Your Plugin (Creating a ZIP File)

When you're done and want to share your plugin, follow these steps to make a ZIP file:

  1. In your terminal, run the following command:
./build.sh
  1. This command will create a ZIP file of your plugin, so you can upload it to WordPress or share it with others.

Extra Plugins (Recommended)

If you want some extra tools to help with debugging (fixing errors), you can use Zero Debugger.

Want More? Check Out Other Branches.