Getting started with WordPress

Administrator 0
getting-started-with-wordpress

In this article we will see a complete guide to understand WordPress which is a well known open source Content Management System. Firstly we will understand more about what is wordpress, secondly will see different installation types in a step by step manner, thirdly will go through codebase of a WordPress so as to customize it based on your need.

So lets get started!

What is WordPress

WordPress (WP, WordPress.org) is a Content Management System (CMS) which is free and open-source (more on open source software) and can be used with a MySQL or MariaDB database. WordPress is written in PHP.

As of April 2019, WordPress is one of the most popular content management system solutions in use with more than 60 million websites using WordPress, including 33.6 percent of the top 10 million websites.

On May 27, 2003, WordPress was released by its founders, developers Matt Mullenweg and Mike Little as a b2/cafelog fork. The software is released under the licence of GPLv2 (or later).

In order to function, WordPress must be installed on a web server, either part of an Internet hosting service such as WordPress.com, or a computer running the WordPress.org software package, in order to serve as its own network host. For single-user testing and learning purposes, a local computer may be used.

WordPress is a websites factory that is a core analogy that clarifies WordPress’s functions: it stores content and enables a user to create websites and publish them, which require nothing other than a domain and hosting service.

Other open source alternative to WordPress

  • Joomla
  • Drupal
  • TYPO3

GIT repository link

https://github.com/WordPress/WordPress

WordPress Local Installation

 

Advantages of installing WordPress on Local Machine

Well, if you are from a software development background you will definitely understand the use of different environments so I will try to explain this concept for other viewers.

So, in any Software Development company, the development of the product or software happens on the developer’s machine. We call it a local environment. Meaning you will have to set up everything on your machine. For example, application server, database, JDK (for java), PHP (for PHP project) and other dependencies.

Once a developer tests everything on a local machine and everything works perfect on local, he then checkin the code. Once the code is checked in, the CI/CD pipeline starts. I don’t get much details into it as there is a lot more to write.

After code committed into the repository, the build pipeline kicks in and starts the build process on pre pre-production environment.

If build passes, that build is deployed to a pre production server. Then the developer or QA tests the feature on that environment and gets approval from the QA. After this, Production deployment for the release gets planned on a specific date after stakeholders approval and then the production (where actual end users use the software) deployment happens.

The idea behind telling all the above story is, we should not change anything in the production environment which may cause issues to our end users or customers. The change should be thoroughly tested first on the preprod environment and then only should be pushed to Production.

In the same way, the bloggers who are using tools such as WordPress or any other script for that matter, should atleast have a local environment setup. And before doing anything on a hosted application it should be first tested on their local.

Also make sure that your hosted application and local or preprod application are in sync.

Requirements:

Make sure you have below list of softwares already installed

  1. PHP 7.3 or greater. Download and install from here
  2. MySQL 5.6 or MariaDB 10.1 or greater. Download and install from here.

WordPress local installation without AMPPS

Without AMPPS installation is useful for those set of  PHP developer’s who already working on PHP software development. 

First install required software

  1. PHP 7.3 or greater. Download and install from here https://www.php.net/downloads.php
  2. MySQL 5.6 or MariaDB 10.1 or greater. Download and install from here https://dev.mysql.com/downloads/installer/ https://mariadb.org/download/
  3. Download and unzip the WordPress from https://wordpress.org/download/
  4. Create a database for WordPress on your web server, as well as a MySQL (or MariaDB) user who has all privileges for accessing and modifying it.
  5. Upload the WordPress files to the desired location on your web server. Provide path and screenshots for local installation
    • If you want to integrate WordPress into the root of your domain (e.g. http://example.com/), move or upload all contents of the unzipped WordPress directory (excluding the WordPress directory itself) into the root directory of your web server.
    • If you want to have your WordPress installation in its own subdirectory on your website (e.g. http://example.com/blog/), create the blog directory on your server and upload the contents of the unzipped WordPress package to the directory via FTP.wordpress installation folder

Run the WordPress installation script by accessing the URL in a web browser. This should be the URL where you uploaded the WordPress files.

If you installed WordPress in the root directory, you should visit: http://example.com/

If you installed WordPress in its own subdirectory called blog, for example, you should visit: http://example.com/blog/

Enter URL http://127.0.0.1/wordpress in the browser, select language and click Continuewordpress select language

Make sure you have below database details ready

Enter required details. Make sure you have database created , in this case “wp-local”. Click Submit

wordpress database config

Click on Run the installation

wordpress run installation

Setup your blog now!

 

setup-your-blog

Done! You have successfully installed WordPress on your local. Click Log in to login into your admin account

Once login you will be landed on below screen

wordpress dashboard

And this is how your blog looks likewordpress blog

That’s it! WordPress should now be installed.

Local installation using AMPPS (Recommended)

If you are first time installing all required software and not aware of anything, then I recommend using this approach.

What is AMPPS

  • AMPPS is a WAMP/MAMP Stack. It includes Apache, PHP, PERL, Python(mod_wsgi), MySQL, MongoDB, phpMyAdmin, RockMongo, FTP Server – FileZilla Server(Windows) and Pure-FTPd(Mac).
  • AMPPS enables you to focus more on using applications rather than maintaining them and it has a Control Center which controls the Servers like Apache, MySQL, FTP, MongoDB and allows the users to edit the Configuration files of the respective servers and check the Log Files in case of an error.

What is Softaculous

  • Softaculous is a well known auto-installer included in AMPPS.
  • Endusers/Admin Panel in AMPPS is provided by Softaculous, also we call it Softaculous AMPPS. These panels allow users to install, backup, restore and manage the installation of different scripts like WordPress, Joomla, Drupal similarly 280+ scripts.
  • Softaculous AMPPS helps you deploy Apps on your desktop server.
  • With Softaculous AMPPS, you can set up a Server for your small business place.
  • It allows you to create and manage Domains on localhost.

Download AMPPS from here https://ampps.com/download and double click on the setupampps wizard

Accept the agreement and click Next

ampps agreement

Select folder and click Next

ampps destination folder

select folder and click Next

Click Install

ampps install

Install required software

install required software

Done! You will see below screen once installation is complete. Click on the Home icon from below screen

ampps installed

This will open AMPPS dashboard. Go to Blogs -> WordPress

select WordPress

ampps-wordpress

Enter required details and click install

ampps wordpress setup

Done! You have successfully installed WordPress on your local using AMPPS

ampps wordpress success

WordPress will be installed on below path

wordpress install path

Installing WordPress on different Platforms

Installing WordPress using cPanel

If you have already bought a hosting for your website and if it has a cPanel, you can follow below steps to install WordPress.

Login to your cPanel, and look for Software tab and “Softaculous Apps Installer”

cpanel wordpress

This will open same screen as we seen in AMPPS, follow same steps as mentioned above

cpanel wordpress install

WordPress Docker installation

If you have a Docker installed on your machine, you can just pull a WordPress image and start working on it. Follow below steps to install WordPress using Docker

Enter below command on the terminal and click enter. This will download the image to your Docker

docker pull wordpress
wordpress docker

Run below command to start the container

docker run --name wordpress -p 8080 -d wordpress
wordpress docker

Enter URL http://localhost:8080/wordpress on browser and WordPress setup will start. Follow the same steps as mentioned above in this post

Once you start the container you will see that image in the Docker Desktop

docker desktop

WordPress Themes

Users of WordPress may install and switch between different themes. Themes allow users to modify a WordPress website without modifying the core code or content of the website. All the WordPress sites need at least one theme, and every theme should be designed using structured PHP, valid HTML and cascading style sheets, with WordPress standards (CSS). Themes can be installed using a dashboard tool for WordPress ‘appearance’ management or theme folders can be directly copied to the theme directory such as via FTP. Themes can be altered by modifying directly the PHP, HTML, and CSS themes, or by using “kids” to change theme behaviour. WordPress themes are generally classified as Free and Premium in two categories. Users may also create and develop their own custom themes.

WordPress Plugins

The WordPress plugin architecture allows users to extend the features and functionality of a website or blog. As of January 2020, WordPress.org has 55,487 plugins available, each offering custom features and features that allow users to tailor their sites to their specific needs. However this does not include premium plugins that are available approximately 1,500+), which may not be included in the WordPress.org repository. These customizations range from search engine optimization (SEO), to client portals used to display private information for users, to content management systems, to content display features such as adding widgets and navigation bars. Not all available plugins are always up to date with upgrades and as a result, they may not work properly or may not work at all. Most plugins are available through WordPress itself, either by downloading and installing files manually via FTP or the WordPress dashboard.

Walkthrough of WordPress codebase

WordPress codebase is very modular and structured in nature. If you see the package there are 3 main folders

  1. wp-admin
  2. wp-content
  3. wp-includes

wordpress install path

As you can easily guess, wp-admin contains sources related to WordPress admin part.

wp-content has below main features

  1. plugins – Contains plugins installed on your WordPress website
  2. themes – different themes installed. You can update themes as well
  3. upgrade – This is a temporary folder createdby WordPress during upgrade to a newer version.
  4. uploads – contains all images used on your website

 

Common issues and how to resolve them

Refer this link if you come any of issues. Before doing anything on yourself it makes sense to see if there is already solution for the issue because WordPress is very famous and being installed and used by thousands of users, so its likely that the same issues might be faced by others.

WordPress common issues

  • The White Screen of Death
  • Internal Server Error
  • Error Establishing Database Connection
  • Incorrect wp-config.php Information
  • Problems with Your Web Host
  • Compromised Website
  • Failed Auto-Upgrade
  • Connection Timed Out
  • Maintenance Mode Following Upgrade
  • You Make Changes and Nothing Happens
  • Pretty Permalinks 404 and Images not Working
  • Custom Post Type 404 Errors
  • Specific Error Messages
  • PHP Errors
  • Fatal Errors and Warnings
  • Parse errors
  • Use of an undefined constant
  • Database Errors
    • Error 13 – Cannot Create/Write to File
    • CREATE Command Denied to User
    • Error 28
    • Error 145
    • Unknown Column

Please refer this link for more details.

WordPress Community and Enterprise version feature comparison

In the Enterprise version of the WordPress you will get everything ready and dont have to setup on your own. It includes hosting for your website, email support, payment integration, support, custom domain etc.

Conclusion

So to sum up, in this article we learned all about WordPress, starting from its origin, what it is and how to get started with WordPress. We saw how to install WordPress on different platforms and on local machines.

I touched upon the high level structure of WordPress codebase so that you get an idea on where to look for if you want to modify something.

Hopefully this article helped you in some way. Let me know about your thoughts in comments.

References

Wikipedia.org, wordpress.org

Tags:

Leave a Reply