WordPress Installer is a Node.js script designed to streamline the installation process of WordPress, themes, and plugins. It simplifies the configuration through a wp-package.json file, allowing you to specify the WordPress version, language, themes, and plugins for installation.
- Create a
wp-package.json
file with your desired configuration. You can use the commandnpx wpmm --init
to create an empty configuration file ornpx wpmm --dump
in the root directory of a wordpress website in order to get the configuration of that website. - Run the script using
npx wpmm
.
Installs the WordPress version, themes, and plugins defined in wp-package.json Whenever the configuration file is not found, the command will install the last WordPress version.
output the current wpmm version
Returns the information for the Wordpress installation in the current folder
Initialize the project and create a sample wp-package.json file.
npx wpmm --template https://gist.githubusercontent.com/erikyo/795746c96f422168121e47c2a876fb31/raw/1ec18a8bc10b6f80221b69944d9dad19c25613c1/wp-package.json
Initialize the project using a template wp-package.json file.
Upload a database named my.sql into the wordpress database
Download the current wp database and save it into /backups/${databasename}.sql.gz
Scan and extract version information from PHP files within themes and plugins.
Edit the wp-package.json
file to define the WordPress version, language, themes, and plugins to be installed.
{
"name": "my-blog",
"wordpress": {
"version": "6.4.1",
"language": "en_US",
"config": {
"DB_NAME": "your_database_name",
"DB_USER": "your_database_user",
"DB_PASSWORD": "your_database_password",
"DB_HOST": "localhost",
"DB_CHARSET": "utf8",
"DB_COLLATE": "",
"table_prefix": "wp_",
"WP_DEBUG": true,
"WP_SITEURL": "http://example.com",
"WP_HOME": "http://example.com",
"WP_CONTENT_DIR": "/path/to/custom/content",
"WP_CONTENT_URL": "http://example.com/custom/content",
"DISALLOW_FILE_EDIT": true
}
},
"database": {
"type": "mysql",
"filename": "databases/database.sql",
"backup-folder": "backups"
},
"themes": [
{
"name": "modul-r",
"version": "1.4.4",
"source": "https://github.com/wp-blocks/modul-r.git"
}
],
"plugins": [
{
"name": "contact-form-7",
"version": "5.8.4"
},
{
"name": "cf7-antispam",
"version": "0.4.5",
"source": "https://github.com/wp-blocks/cf7-antispam/archive/refs/heads/main.zip"
}
],
"postInstall": [
"wp cache flush",
"wp plugin install $(wp plugin list --field=name) --force"
]
}
- WordPress Installation: Easily install a specific version of WordPress with configurable settings.
- Theme Installation: Specify themes and their versions to be installed.
- Plugin Installation: Install plugins directly from GitHub or other sources.
- Version Detection: Automatically extract version information from PHP files within themes and plugins.
Feel free to contribute by opening issues, suggesting features, or submitting pull requests. Your feedback is valuable!