GithubHelp home page GithubHelp logo

wp-blocks / wpmm Goto Github PK

View Code? Open in Web Editor NEW
2.0 1.0 1.0 822 KB

wpmm is a Node.js script designed to streamline the installation process of WordPress, themes, and plugins.

Home Page: https://wp-blocks.github.io/wpmm/

License: ISC License

JavaScript 2.24% Shell 0.10% TypeScript 97.66%
package-manager plugins-wordpress theme-wordpress wordpress

wpmm's Introduction

WordPress Magic Manager ๐Ÿช„

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.

Usage

  1. Create a wp-package.json file with your desired configuration. You can use the command npx wpmm --init to create an empty configuration file or npx wpmm --dump in the root directory of a wordpress website in order to get the configuration of that website.
  2. Run the script using npx wpmm.

Commands and Options

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.

npx wpmm --version

npx wpmm --v

output the current wpmm version

npx wpmm --info

Returns the information for the Wordpress installation in the current folder

npx wpmm --init

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.

npx wpmm --upload-db database/my.sql

Upload a database named my.sql into the wordpress database

npx wpmm --dump-db

Download the current wp database and save it into /backups/${databasename}.sql.gz

npx wpmm --dump

Scan and extract version information from PHP files within themes and plugins.

Configuration

Edit the wp-package.json file to define the WordPress version, language, themes, and plugins to be installed.

Example Configuration

{
  "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"
  ]
}

Features

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

Contributions

Feel free to contribute by opening issues, suggesting features, or submitting pull requests. Your feedback is valuable!

wpmm's People

Stargazers

 avatar  avatar

Watchers

 avatar

Forkers

kilbourne

wpmm's Issues

Install themes and plugins asyncronously

currently the process installs sequentially wordpress plugins and then themes. as far as wordpress is right, it needs to be installed sincronously but the plugins and themes could be installed concurrently

Get the configuration from a remote file

should be something like
npx wpmm --install--template https://gist.githubusercontent.com/erikyo/795746c96f422168121e47c2a876fb31/raw/1ec18a8bc10b6f80221b69944d9dad19c25613c1/wp-package.json

Specify the plugin source in the wp-package.json

to avoid conflicts or issues of any kind we could add an opional field that will correspond to the github url so the program will clone the repo directly from github instead of guessing the source of the plugin, that way the user can avoid conflicts if the plugin is present both in wp repo or github repo

Avoid to request a json file in order to start the wp installation

At the moment running the command without a wp-package.json will fail because the "definitions" file is required but it would be cool to run npx wpmm and install the last WordPress version or to get an interactive command line tools. Additionally we can suggest the language of the user as the default language

Request for Reverse Command to Generate JSON from Site Configuration

Feature Request:

I propose the addition of a reverse command to the wpmm tool that would allow users to generate a JSON configuration file from an existing WordPress site. This feature would provide users with the ability to replicate a site configuration by capturing its current state and settings.

Example Usage:

npx wpmm-dump --output wp-config.json

Benefits:

  • Site Replication: Users can easily capture and reproduce site configurations for backup or deployment purposes.
  • Consistency: Ensures consistency across different environments by enabling easy duplication of site settings.
  • Efficiency: Saves time and effort by automating the generation of the configuration JSON from an existing site.

Add the possibility to import database

We should add the possibility to automatically import wp databases from a folder within the root like imports/, maybe add a CLI option and the possibility to rename the prefix on the go

Enhance wp-package.json to Support Post-Installation Actions

Description:

I am writing to propose an enhancement to the wp-package.json file in the Node.js packager dedicated to installing WordPress plugins and themes. Currently, the packager works seamlessly for installing plugins and themes, but I believe we can add a valuable feature to enhance user experience.

Feature Request:

I would like to suggest the addition of a feature that allows users to specify post-installation actions in the wp-package.json file. These actions could include running commands using wp-cli or any other relevant tasks that users might need after the installation of a WordPress plugin or theme.

Example:

{
  "name": "example",
  "wordpress": [...],
  "themes": [...],
  "plugins": [...],
  "postInstall": [
    "wp-cli command 1",
    "wp-cli command 2",
    // Additional post-installation commands
  ],
  // Other package configurations
}

Important Note:

It's crucial to ensure that users are aware and responsible for the commands they include in the postInstall section. We should provide clear documentation and warnings to guide users in making informed decisions about the commands they execute.

Benefits:

  • Customization: Users can tailor the post-installation process to their specific needs.
  • Automation: Streamlining common tasks with wp-cli commands can enhance efficiency.
  • Flexibility: This feature provides flexibility without compromising the simplicity of package installation.

.lock file

since we are gonna to update packages we need to know the current packages versions and store some data into a lock file

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.