Coder Social home page Coder Social logo

codekraft-studio / generator-wordpress-plugin Goto Github PK

View Code? Open in Web Editor NEW
15.0 2.0 5.0 528 KB

:wine_glass: The best way to start creating your WordPress plugin projects.

License: Other

JavaScript 54.19% PHP 39.92% CSS 5.89%
wordpress cli-utility yeoman-generator wordpress-plugin wordpress-development scaffolding yeoman

generator-wordpress-plugin's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

generator-wordpress-plugin's Issues

More metabox subgenerator options

Add more command line options to metabox subgenerator to allow the maximum customization of the output.

Some of the options could be:

$screen
(string|array|WP_Screen) (Optional) The screen or screens on which to show the box (such as a post type, 'link', or 'comment'). 
Accepts a single screen ID, WP_Screen object, or array of screen IDs. Default is the current screen.
Default value: null

$context
(string) (Optional) The context within the screen where the boxes should display. 
Available contexts vary from screen to screen. Post edit screen contexts include 'normal', 'side', and 'advanced'. Comments screen contexts include 'normal' and 'side'. Menus meta boxes (accordion sections) all use the 'side' context. Global
Default value: 'advanced'

$priority
(string) (Optional) The priority within the context where the boxes should show ('high', 'low').
Default value: 'default'

snippet above took from WordPress add_metabox codex page.

Extend php-writer use

Since php-writer has great capabilities in terms of manipulating php files, all or most of the wordpress plugin files manipulation should be handled with that.

For example, comments block updates, variables updates and composite files creation, but it requires an investigation and a deepening reading of the code, that will lead to a refactoring.

Check for folder existence on start

If the user tries to generate over a existing folder or a previously generated project, alert him that this operation could possibly broke everything since it will override the basic project files.

This is handled by default from inquirer when trying to copy the files but it should be clear from the beginning before starting to answer the project prompt questions, so the operation can be easily stopped without loosing time.

Keep version in sync when subgenerating

The package templates makes use on the @since tag with the version number at the time when this particular file was generated using the generator.

Since the version is stored in the yo-rc.json file and the real version is presumably updated via npm or yarn commands, the generator needs to keep sync between the two versions.

Do not error when folder not empty

The current beheviour is to throw if the folder is not empty, it should be better to check if folder is empty (when input isn't name passed the current process.pwd folder will be used) and eventually ask for confirmation using inquirer or in case of rejection just exit the program

Check before writing if class already present

Since the new mode has introduced the main-class writing functions, every subgenerator that has this feature enabled will update the main-class file when called (subgenerator).

If it exists another file or class with the same name, don't add it or override it and most important of all, inform in a very verbose way the user about what is going on.

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.