Skip to content

Souptik2001/wordpress.setup

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

58 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

My WordPress Lando Setup ~ Souptik Datta

Many folder structure conventions are my personal choice. If you want to edit the folder structure then make sure to change the places where this folder structure is used(mainly in the .lando.yml and setup.sh files), otherwise the setup will break.

Along with the super easy setup one more benefit you will get is that wordpress-core will be present only once, yet providing the flexibility to edit customizable files like wp-config.php, wp-contents directory, server and php configuration files, etc.

Blogs✍

Before Using:

  • Before using my this setup be sure you have the following things installed (External dependencies):
    • Docker.
    • Lando.
    • Git.
    • And obviously a little knowledge about WordPress(🤔) is good.

Credentials:

After creating a site:

  • Your site will have a username and password(both same) of - admin.
  • And the database name will be wordpress. And the username will be wordpress and password will be also wordpress. After creating a site with VIP template:
  • Your site will have a username and password(both same) of - sadmin.
  • The database name, username and password will be the same as above.

Steps to set-up:

  • Clone this repo in folder ~/wordpress/ using the command:
git clone https://github.com/Souptik2001/wordpress.setup.git ~/wordpress/wordpress.setup-DO-NOT-DELETE

OR

git clone [email protected]:Souptik2001/wordpress.setup.git ~/wordpress/wordpress.setup-DO-NOT-DELETE

( The name used here wordpress.setup-DO-NOT-DELETE is important because that name is used in the lando config file ).

  • Now you can just run lando start here only and that's it you have a WordPress site ready.
  • But if you are more into development you most probably will have the wp-content folder's content already.

From here you have two ways to go

Automated😎 -

  • Just make sure you have cloned the wordpress.setup repo in ~/wordpress/wordpress.setup-DO-NOT-DELETE.
  • And now there inside there you will find a script named setup.sh.
  • Just run the script as so - setup.sh app_name /path/where/the/proj/should/be/created wp-content_repo_url(optional).
  • And your app is ready!

Manual🧐 -

  • So, in a different folder copy the .lando.yml, wp-content(fallback), .lando files.
  • And now you can get your's wp-content folder and replace this default wp-content folder.
  • In the first line of .lando.yml file edit the name parameter. ( Important ).
  • Now run lando start.
  • Here only you will get a wp-config.php file which you can edit as per you wish.

Arguments:

There are a lot of arguments you can pass in the command to customize the WordPress installation you create, like WordPress, PHP and node version, whether we wan't multisite or not, etc.

Usage: setup.sh [name_of_the_project] [path/to/the/folder/to/setup/project] [(optional)ssh_or_https_link_to_clone_wp_content_repo]

Arguments:
--wp : WordPress version.
--php: PHP version.
--node: Node version.
--multisite: Whether to create multisite or single site. yes OR no.
--multisitetype: Type of multisite. subdomain OR subdirectory.
--vip: Whether to create VIP template site or not. yes OR no.
--help: Display this help menu.

Example: setup.sh [project_name] ~/wordpress --multisite=yes --vip=yes --wp=6.2.2 [email protected]:[repo]

Or you can get this help instructions by executing ./setup.sh --help.

Memcache support:

Memcache( or persistent object cache ) is present with every site installation. But to use it follow the following steps-

  • Go to wp-content/plugins/memcached
  • Copy the file object-cache.php to wp-content directory.

TO-DO:

  • Ability to add separate wp-config.php files for different sites.
  • Add a shell script to complete the setup following the above steps ( only contains basic level of error handling ).
  • Add far better error handling in the shell script.
  • The WordPress directory in the project directory should have a only read link to the original WordPress directory so that we get autocompletion.( High Priority)
  • In the project directory there should be a hard symlink to the wordpress core and the permissions should be only read as written in the above point.
  • The project should use that hard-symlink as the wordpress core( because that from one project user does't upgrade WordPress core ).
  • Because of the above point you will not be able to upgrade WordPress from the admin dashboard. For that we have to somehow select that from command line utility. Keep some versions of the wordpress core in the repo. And user can select the one they wish.
  • Check why the original wp-config is changing and not the copied one.
  • Provide multisite support.
  • Provide VIP site support.
  • Provide memcache support.