wp-advads
v1.0.40
Published
Create an Advanced Ads WordPress plugin ecosystem.
Readme
wp-advads
CLI scaffolding for an existing Advanced Ads WordPress plugin. It writes wp.advads and file stubs (class, view, updates, js, css). It does not generate a plugin from scratch.
Requires Node.js 18+. Created by Shakeeb Ahmed.
Installation
npx wp-advadsnpx wp-advads <command> [options]Config
Commands (except init) need a wp.advads file. The CLI uses the nearest ancestor that already has one. init writes wp.advads in the current directory.
If the file is missing, the CLI exits and tells you to run wp-advads init. It does not prompt.
Commands
init
Creates wp.advads in the current directory.
npx wp-advads initbuild
Installs PHP dependencies into packages/ (COMPOSER_VENDOR_DIR=packages), dumps the autoloader, runs npm run build when package.json has a scripts.build, then generates a .pot.
npx wp-advads buildStandalone build does not touch release git messages. During release, commit bullets are passed in explicitly.
release
Bumps the version, changelog, translations, build, and git (explicit file list, hooks run). Stops on the first failed step.
npx wp-advads releasechangelog
Prints pending .changelog entries to the console. Does not write changelog.txt or readme.txt.
npx wp-advads changelogclass <classname> [options]
Writes a PHP class under paths.php. Combine --heading with a template flag (-i / -g / -r / -s).
npx wp-advads class MyClass --heading "Class Heading" --description "Description" -s<classname>– Class name (namespaces with\, e.g.Foo\Bar)--heading <heading>– File heading--description <description>– File description-i– Initializer-g– Integration-r– REST-s– Singleton (__constructis private)--force– Overwrite if the file exists
view <viewname> [heading]
Writes a PHP view under paths.views. Nested names accept / or \.
npx wp-advads view sidebar "Sidebar View"
npx wp-advads view admin/settings<viewname>– View file name[heading]– Heading comment--force– Overwrite if the file exists
updates <version>
Writes an upgrade file under paths.updates. misc.prefix from wp.advads is required (empty prefix is an error).
npx wp-advads updates 1.2.3<version>– Target version (e.g.1.2.3)--force– Overwrite if the file exists
js <filename> [options]
Writes a JavaScript file under paths.javascript. Nested names accept / or \.
npx wp-advads js script -h "Main JS" -d "Handles the frontend logic"<filename>– Name without extension-h <heading>– Heading comment-d <description>– Description comment--force– Overwrite if the file exists
css <filename> [options]
Writes a CSS file under paths.css. Nested names accept / or \.
npx wp-advads css styles -h "Main CSS" -d "Plugin styles"<filename>– Name without extension-h <heading>– Heading comment-d <description>– Description comment--force– Overwrite if the file exists
pot
Creates a .pot translation template (wp i18n make-pot).
npx wp-advads potPOT headers (Last-Translator, Language-Team) use author.name and author.email from wp.advads.
translations
Downloads .po / .mo files from GlotPress into glotpress.destination (default ./languages/). Locale ids must be [a-zA-Z0-9_]+; non-OK HTTP responses are skipped.
npx wp-advads translationsNotes
class, view, updates, js, and css will not overwrite an existing file unless you pass --force. Writes cannot escape the project root.
Tests
npm testThat runs node --experimental-test-module-mocks --test. Node 18+ is required (engines.node).
Author
Shakeeb Ahmed
GitHub: @meshakeeb
