starter-plugin
starter-plugin copied to clipboard
Template for WordPress plugins, it took 7️⃣ years to write
- PHP version: - WordPress version: - List of active Plugins: _screenshot(s) of `/wp-admin/plugins.php?plugin_status=active`_ - Important Plugin Version: - Active Theme:
### How to write commit messages? `$temp: $late` ### How to name PR branches? `$temp-$late` ### What code should we write daily? 1. openly procedural 2. masqueraded as a class,...
Take a look at that! From what core version on?
What options do we have? 🔍
`src/functions.php` gets loaded twice by Composer.
When making a plugin template, some instruction may be nice to have. Like: How to/Location of name replacements (e.g: plugin-name, pluginClassName, etc)
https://developer.woocommerce.com/docs/category/extension-development/ - meta header: `Requires Plugins: woocommerce` - version check meta headers https://developer.woocommerce.com/2017/08/28/new-version-check-in-woocommerce-3-2/ - declare [HPOS compatibility](https://developer.woocommerce.com/docs/hpos-extension-recipe-book/#2-supporting-high-performance-order-storage-in-your-extension) `Automattic\WooCommerce\Utilities\FeaturesUtil` - start in `woocommerce_init` action
That _Anything else_ from the README. 1. Hooking (actions, filters) 2. Templating (core has no template engine) 3. Routing (core has complicated mechanism for adding a route) 4. Handling user...
Use wp_prime_option_caches! https://developer.wordpress.org/reference/functions/wp_prime_option_caches/