Skip to content

jmucak/wp-plugin-template

Repository files navigation

wp plugin template

Table of contents

  1. Project info
  2. Requirements
  3. Installation
  4. Development scripts
  5. Code style standards and best practices

Project info

This is a plugin description

  • repository: ``
  • figma: ``

Requirements

  • PHP > 8.1
  • composer v2
  • node v21 or higher
  • npm v10 or higher

Installation

Environment setup

  • Upload the plugin files to /wp-content/plugins folder, or install the plugin through the WordPress plugins screen directly.
  • Activate the plugin through the 'Plugins' screen in WordPress

Development scripts

  • npm run dev: watches and compiles files on change
  • npm run build: creates production ready versions of css and js inside static folder

Code style standards and best practices

PHP

  • write clean and OOP code
  • every class, functions or any logic should exists only in app folder

WordPress

  • WordPress coding standards github and docs should be applied
  • exception of naming classes because of autoloader, classes should be named with CamelCase
  • No shorthand PHP Tags => use <?php ... ?>
  • Single and Double Quotes => If you’re not evaluating anything in the string, use single quotes
  • Methods and Functions should be named with snake_case, Example: get_posts(), get_data()
  • Brace Style => Braces should always be used in all code blocks, Example: if($some_condition) { // Do something}
  • When declaring a function or a class braces are added at the end of the line, not in the new line
  • Declaring Arrays => Arrays must be declared using long array syntax, Example: array(1,2,3);
  • Using import use statements => Import use statements should be at the top of the file and follow the namespaces declaration

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages