File tree Expand file tree Collapse file tree 1 file changed +2
-10
lines changed Expand file tree Collapse file tree 1 file changed +2
-10
lines changed Original file line number Diff line number Diff line change @@ -72,16 +72,8 @@ Please see [WooCommerce Stubs](https://github.com/php-stubs/woocommerce-stubs)
72
72
- Write clean OOP code: 1 class per file, no other code in class files outside ` class Name { ... } `
73
73
- Structure your code: uniform class names (WPCS or PSR-4), keep classes in a separate directory ` inc/ `
74
74
- Add proper PHPDoc blocks to classes, properties, methods, functions
75
- - Handle these only in your [ main plugin file] ( https://github.com/kingkero/wordpress-demoplugin/blob/master/wordpress-demoplugin.php ) .
76
- Here is another [ main plugin file] ( https://github.com/pryley/site-reviews/blob/v5.0.1/site-reviews.php ) example.
77
- - Define constants, e.g. ` MYPLUGIN_PATH `
78
- - Call ` register_activation_hook() ` , ` register_deactivation_hook() ` , ` register_uninstall_hook() `
79
- - Load class autoloader
80
- - Load translations
81
- - Support WP-CLI
82
- - Decide [ what to load] ( https://github.com/szepeviktor/Toolkit4WP/blob/master/src/Is.php#L64-L73 )
83
- - Start your plugin in a hook (` plugins_loaded ` ) - without direct execution
84
- - Avoid using core constants, use core functions or ` MYPLUGIN_PATH `
75
+ - Choose your [ main plugin file parts] ( https://github.com/szepeviktor/small-project/blob/master/MAIN-FILE-PARTS.md ) .
76
+ - Avoid using core constants, use core functions
85
77
- Avoid bad parts of PHP
86
78
- functions: ` eval ` , ` extract ` , ` compact ` , ` list `
87
79
- [ type juggling] ( https://www.php.net/manual/en/language.types.type-juggling.php ) : ` $a = '15'; if ($a) ... `
You can’t perform that action at this time.
0 commit comments