Skip to content

Commit 52da99f

Browse files
committed
ready to use
1 parent e58e124 commit 52da99f

File tree

3 files changed

+31
-61
lines changed

3 files changed

+31
-61
lines changed

build.sh

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -21,36 +21,26 @@ progress_message "Preparing build directory..."
2121
rm -rf ./"$plugin_name" ./"$plugin_name".zip
2222
mkdir ./"$plugin_name"
2323

24-
25-
# build assets
26-
progress_message "Building admin template..."
27-
npm --prefix ./assets run build
28-
2924
# copy all files for production
3025
progress_message "Copying files for production..."
31-
cp -R ./composer.json ./*.php src assets/dist readme.txt ./"$plugin_name"/ --parents
26+
cp -R ./composer.json ./*.php src assets readme.txt ./"$plugin_name"/ --parents
3227

3328
# Install PHP dependencies
3429
progress_message "Installing PHP dependencies..."
3530
composer install --working-dir=./"$plugin_name" --no-dev
3631
rm ./"$plugin_name"/composer.json
3732

38-
# Remove dev data
39-
progress_message "Removing dev data..."
40-
sed -i '67,70d;' ./"$plugin_name"/src/Controllers/AdminController.php
41-
rm ./"$plugin_name"/assets/dist/index.html
42-
4333
# Add index.php to every directory
4434
progress_message "Adding index.php to every directory..."
4535
find ./"$plugin_name" -type d -exec sh -c "echo '<?php // silence' > {}/index.php" \;
46-
./vendor/bin/phpcbf ./"$plugin_name"/src --standard=WordPress-Extra -s --report=source
36+
4737
# Create zip archive
4838
progress_message "Creating zip archive..."
39+
# TODO: update zip path based on your OS.
4940
"C:\Program Files\7-Zip\7z.exe" a ./"$plugin_name".zip ./"$plugin_name"/*
5041

5142
# Revert changes for production
5243
progress_message "Reverting changes..."
53-
rm -rf ./assets/dist
5444
rm -rf ./"$plugin_name"
5545

5646
# Completion message

install.sh

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -38,16 +38,8 @@ find ./ -type f \( -name "*.php" -o -name "*.js" -o -name "*.json" -o -name "*.h
3838
# run composer dump-autoload
3939
progress_message "Running composer dump-autoload..."
4040
composer dump-autoload
41-
# cd into assets
42-
progress_message "Building assets..."
43-
cd ./assets
44-
# run npm install on assets dir
45-
npm install
46-
# run npm run build on assets dir
47-
npm run build
4841
# delete this file
49-
progress_message "Deleting install.sh..."
50-
cd ..
51-
rm install.sh
52-
rm -rf .github
53-
rm -rf .idea
42+
progress_message "Deleting unnecessary files..."
43+
rm -rf ./.github
44+
rm ./readme.md
45+
rm ./install.sh

readme.md

Lines changed: 24 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,53 +1,41 @@
1-
# WordPress Plugin
1+
# WordPress Plugin - PHP
22

3-
A simple WordPress plugin boilerplate for Admin related tasks.
4-
5-
## Technologies
6-
7-
- [**vue.js**](https://vuejs.org/) The Progressive JavaScript Framework.
8-
- [**Vite**](https://vitejs.dev/) Next Generation Frontend Tooling.
9-
- [**tailwindcss**](https://tailwindcss.com/) Rapidly build modern websites without ever leaving your HTML.
10-
- [**Notyf**](https://github.com/caroso1222/notyf) A minimalistic JavaScript library for toast notifications.
3+
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!
114

125
### Features
136

14-
- Check used [Technologies](#technologies) features.
15-
- It replaces all placeholder strings during plugin creation.
16-
- It generates independent styles for backend without any conflict with WordPress core and any plugin or themes.
17-
- It makes zip for test plugin throughout a team by one command.
18-
- You can manage your plugin license and support with this. N.B. You will need a management system. you can check out my [WordPress Plugin Management System](https://github.com/devkabir/wordpress-plugin-management-system)
7+
- It helps you change placeholder names when creating your plugin, so you don’t have to worry about replacing everything manually.
8+
- It keeps your plugin’s style separate from the rest of WordPress and other plugins, so it won’t mess anything up.
9+
- You can make a **ZIP** file of your plugin easily so you can share it with your friends or team with just one command.
10+
- 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](https://github.com/devkabir/wordpress-plugin-management-system).
1911

20-
## Requirements
12+
## What You Need (Requirements)
2113

22-
- **node.js** v18.8.0
23-
- **npm** v8.18.0
24-
- **PHP** v7.4 or higher
25-
- **VS Code extension** check recommendations.
26-
- **bash** Any bash script compatible terminal. You may use Git Bash for this. For **Laragon** Users, You have already all tools, just add to path.
14+
- **PHP** version 7.4 or higher (this is the programming language WordPress uses).
15+
- **VS Code** (this is a free program you can use to write your code). Make sure to check for any recommended extensions.
16+
- **Bash Terminal** (this helps you run commands). If you have **Git Bash** or **Laragon**, you're all set!
2717

28-
## For Fresh Start
18+
## Getting Started (Fresh Start)
2919

30-
- Dev version with dummy content
20+
To start making your own plugin, follow these steps:
21+
22+
1. Open a **Bash** terminal (or **Git Bash**).
23+
2. Run this command (copy and paste it):
3124

3225
```bash
33-
composer create-project devkabir/wordpress-plugin:dev-only-admin <your-plugin-name>
26+
composer create-project devkabir/wordpress-plugin:dev-only-php <your-plugin-name>
3427
```
3528

36-
## Documentation
29+
3. Replace `<your-plugin-name>` with what you want to call your plugin.
30+
4. Hit **Enter** and let it do its magic!
31+
5. You’re ready to start creating something amazing for WordPress!
32+
33+
Happy coding!
3734

38-
- [How to install](https://github.com/devkabir/wordpress-plugin/wiki#how-to-install)
39-
- [Project Organization](https://github.com/devkabir/wordpress-plugin/wiki#project-organization)
40-
- Components
41-
- [List](https://github.com/devkabir/wordpress-plugin/wiki/DataList)
42-
- [Table](https://github.com/devkabir/wordpress-plugin/wiki/DataTable)
35+
## Build
4336

44-
## Recommended Plugins
4537

46-
- For nice error page, [WordPress Debugger](https://github.com/devkabir/wordpress-plugin-debugger)
4738

48-
## For visual learners
39+
## Extra Plugins (Recommended)
4940

50-
- How to start
51-
- [![Video Title](https://img.youtube.com/vi/ZXu4Y2Wt3-k/0.jpg)](https://www.youtube.com/watch?v=ZXu4Y2Wt3-k)
52-
- How to debug
53-
- [![Video Title](https://img.youtube.com/vi/rdTug4q5tEM/0.jpg)](https://www.youtube.com/watch?v=rdTug4q5tEM)
41+
If you want some extra tools to help with debugging (fixing errors), you can use [Zero Debugger](https://github.com/devkabir/0-debugger).

0 commit comments

Comments
 (0)