Giter VIP home page Giter VIP logo

Comments (8)

szepeviktor avatar szepeviktor commented on July 20, 2024 1

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.

szepeviktor avatar szepeviktor commented on July 20, 2024
  1. list of parts
  2. order/dependency
  3. structure, modularity
  4. testability
  5. namespace Company\WordPress\PluginName;

from small-project.

szepeviktor avatar szepeviktor commented on July 20, 2024

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.

cliffordp avatar cliffordp commented on July 20, 2024

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.

szepeviktor avatar szepeviktor commented on July 20, 2024

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.

cliffordp avatar cliffordp commented on July 20, 2024

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.

szepeviktor avatar szepeviktor commented on July 20, 2024

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.

cliffordp avatar cliffordp commented on July 20, 2024

Hi. I skimmed through. Here are some notes:

  1. 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
  2. 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.
  3. 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 );
  4. 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 via apply_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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.