Comments (8)
Thank you for all four of your bullet points!
- backslashes will be gone with
use function ...;
- WPCS is an anti-review laser gun :) no wonder PSR-12 exists, WPCS is for beginners and visually impaired people 👉 quote from https://make.wordpress.org/core/handbook/best-practices/coding-standards/php/#declaring-arrays
- filtering the results gives the user an unhealthy dose if liberty, making it pass with requirements unmet equals not checking anything at all - I know the whole WordPress ecosystem is about unhealthy dose if liberty, I think I cannot join...
I come from a decent embedded world where you flip one bit and the whole device goes to the bin 🗑️
from small-project.
- list of parts
- order/dependency
- structure, modularity
- testability
namespace Company\WordPress\PluginName;
from small-project.
Hello @cliffordp! https://twitter.com/TourKick/status/1339807246058975234
This is a theoretical research on main plugin file parts: The Ultimate Main Plugin File.
Would you like to contribute?
from small-project.
Hi, @szepeviktor - I've not seen this repo before and am unsure what you're asking of me - but I don't know if I've ever needed a boilerplate for something temporary, and I'm curious about the use cases you've come across and how this might relate to WordPress.
from small-project.
the use cases you've come across and how this might relate to WordPress.
I just need a solid documentation and implementation examples of main WordPress plugin part (listed above).
It would be nice to link to it when I find a sub-optimal plugin...
from small-project.
OK, thanks for sharing. Feel free to reference https://github.com/cliffordp/cliff-wp-plugin-boilerplate as would be helpful to you.
from small-project.
Done! 😄
@cliffordp Could you take a look at the new main file and classes in src
?
I would be thankful for a code review.
from small-project.
Hi. I skimmed through. Here are some notes:
- It's recommended to not use a closure (anon function) with hooks (action/filter) because then they cannot easily (if at all) be un-hooked
- Personally, I find the global namespace
\
to clutter the code viewing but that's likely just what I'm used to - so no changes if you feel it important. - Code styling from WordPress, should you choose to adopt it (other than
array()
, which I prefer as its short form), would say to have more spacing, e.g.\add_action('admin_notices', ..., 0, 0);
would be\add_action( 'admin_notices', ..., 0, 0 );
- One big use of the Requirements class in an
if
is of course fine for running the code, but personally I'd want to see the Requirements class' result filterable viaapply_filters()
, passing the args used as one of the parameters. Just an idea.
Good luck going forward however you see fit. Keep up the good work :)
from small-project.
Related Issues (9)
- WordPress System Status Query 🧐
- Double activation causes fatal error
- Database migrations
- WordPress performs PHP version checking HOT 2
- Application container/servicemanager + DI HOT 1
- Checklist for working on an existing plugin ✔
- Is list<string> a typo, synonym for array or type I can't find docs on? HOT 2
- History
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from small-project.