If you find this script useful, you can support me here:
This script automates the process of installing WordPress, adding themes, managing plugins, and creating multiple administrator users. It leverages WP-CLI for interacting with WordPress.
-
WordPress Installation:
- Downloads WordPress core if not installed.
- Generates
wp-config.php
with database credentials.
-
Theme Installation:
- Installs and activates the Divi theme (
divi.zip
) from the script directory.
- Installs and activates the Divi theme (
-
Plugin Management:
- Installs and updates plugins listed in a provided configuration file.
- Uninstalls plugins from a provided list.
-
User Management:
- Creates multiple administrator users with credentials from the configuration file.
- WP-CLI: The script automatically downloads WP-CLI if it's not present.
- PHP: Ensure PHP is installed and available from the command line.
- Database Access: MySQL credentials for creating a connection.
- Files:
lin-wp-install-plugins-config.txt
: Configuration file.lin-wp-plugins-list.txt
: List of plugins to install.lin-wp-plugins-to-uninstall.txt
: List of plugins to remove.divi.zip
: Theme file located in the script directory.
Create a file named lin-wp-install-plugins-config.txt
with the following structure:
WP_PATH=/path/to/wordpress
DB_NAME=your_db_name
DB_USER=your_db_user
DB_PASSWORD=your_db_password
DB_HOST=localhost
PLUGINS_FILE=lin-wp-plugins-list.txt
TO_UNINSTALL_FILE=lin-wp-plugins-to-uninstall.txt
WP_ADMINS=admin1:password1:email1@example.com,admin2:password2:email2@example.com
- WP_PATH: The directory where WordPress will be installed.
- DB_NAME, DB_USER, DB_PASSWORD, DB_HOST: MySQL credentials.
- PLUGINS_FILE: File containing a list of plugins to install.
- TO_UNINSTALL_FILE: File containing a list of plugins to uninstall.
- WP_ADMINS: Comma-separated list of administrators with the format
username:password:email
.
- Place the script in the desired directory.
- Place
divi.zip
,lin-wp-install-plugins-config.txt
,lin-wp-plugins-list.txt
, andlin-wp-plugins-to-uninstall.txt
in the same directory. - Make the script executable:
chmod +x lin-wp-install-plugins.sh
- Run the script:
./lin-wp-install-plugins.sh
lin-wp-install-plugins.sh
: Main script.lin-wp-install-plugins-config.txt
: Configuration file.lin-wp-plugins-list.txt
: Plugins to install.lin-wp-plugins-to-uninstall.txt
: Plugins to remove.divi.zip
: Divi theme.
wordpress-seo # SEO plugin
updraftplus # Backup plugin
wordfence # Security plugin
hello-dolly
akismet
This project is licensed under the MIT License - see the LICENSE file for details.