Autodeployment using GitLab Webhooks

GitLab Webhooks GitLab provides various Webhooks to perform automated tasks after a certain event. For e.g. Push events Gitlab webhooks will work exactly similar to post-receive hook in GIT. Only thing is it needs a webpage (mostly on your server) which gets executed after a certain commit is made to the GitLab repository. This webpage can perform tasks like updating the local mirror repository and making the corresponding change in the files in your public_html folder. Read more about webhooks in GitLab Assuming you have a GitLab repository at: git@gitlab.com:username/some_project.git Steps to follow on your production/live server SSH to your production/live server Generate an SSH key for auto deployment to be used by the GitLab server [crayon-59c7ebe935fa8019714646/] Name of the key: gitlab_rsa_deploy, keep the passphrase blank Add the contents of the gitlab_rsa_deploy.pub key to Deyloy Keys section of your Project Settings and Enable it Create a config file in .ssh folder and add below contents to the file. Add your user key added to GitLab user key settings. [crayon-59c7ebe935fb5850264584/] Create...
Read More

Points to consider before installing a new wordpress plugin

Installing a new plugin is very easy in wordpress. All you need to do is to search for your plugin, select it, install and activate. If you do not find it suitable to your needs, just deactivate, delete it and move on. However not many people realise what a plugin does in the background once it gets activated and assume that once a plugin is deleted its all gone which is really not true in most cases. A deleted plugin mostly leaves quite a few traces in your system. Depending upon the plugin these traces can severely affect the performance of your system if you try too many plugins without checking what it does in the background Many plugin developers do not follow WordPress coding standards. They do not provide an unintall function for the plugin. This means you need to manually clean up all the traces of the plugin after it is deactivated and deleted. I am currently not experiencing any performance issue with...
Read More
How to tackle WordPress slow queries

How to tackle WordPress slow queries

Here are some wordpress slow queries i.e. queries which take more than 0.05s. It really depends on your wordpress site i.e. how big is the database, plugins and your site configuration. However if you are facing performance issues related to the Dashboard then it is more likely to be due to the slow wordpress dashboard queries. Query Monitor is good plugin to check/analyse your slow queries. Some Wordpress Slow queries Below query auto populates the custom fields drop down box. [crayon-59c7ebe936708421336932/] For large tables this query can take lot of time like 2secs or so. If you do not need custom fields it is very easy to turn them off using below function. [crayon-59c7ebe936711980638362/] For more information read this interesting post on CSS Tricks Below query runs on every Dashboard page so it is important that your wp_options table is optimised. [crayon-59c7ebe936716358972779/] Depending upon the plugins you have installed, the wp_options table size can grow rapidly. Some plugins use this table to store _transient options. These _transient options are objects stored in cache....
Read More

Types of GIT repositories

Three types of GIT repositories GIT working repository GIT bare repository GIT mirror repository GIT working repository This repository is the one which is on your local machine. This is the respositoy which you work on i.e. add, edit or delete your application files and commit your changes. This repository can be created using below 2 ways git init: Initialises an empty working repository. Necessary files are then added or created later. This command is mostly used when you are starting with a new application in which case the repository is empty when you begin. git clone: This command is used if you already have a working repository on your server, GitHub, GitLab, etc. This will create a Git repository on your local maching with working/application files already inside the repository. This repository has a .git folder with all the version related files inside this folder while your application files reside outside this folder. GIT bare repository This repository is generally created on your server mostly for...
Read More

Prevent your emails going to spam/junk

Emails going to spam folder can be a sticky issue and generally there is no simple way to fix the problem. If you are already facing this issue then either your domain is blacklisted somewhere or you may just be missing a few simple tricks. In any case a preliminary check should be to check if your sending domain or your IP is blacklisted. This would be a preliminary check because if you are already blacklisted then no matter what efforts you make to fix other things your emails will still end up going to spam / junk folder. Check if your site is blacklisted using below tools by adding your site domain or IP address. If you are using cloudflare then try both i.e. your site domain and then your site IP address. This is because if you are using cloudflare, a domain check may not resolve to the true IP of your site. http://mxtoolbox.com/ https://www.senderscore.org/ If your site is blacklisted you will need to request to have...
Read More