How to remove the Bitnami Banner Google Cloud

If you spin up a new WordPress site using the Bitnami installer on Google Compute Engine, then you will see the bitnami banner in the bottom right.

The banner links to useful information about your Bitnami install which could be a security issue. I have seen people try to hide it using CSS, DO NOT use CSS to hide the banner. The code for the banner will still visible.

The correct way to remove the Bitnami banner is to run the following commands. SSH into your VM and run:

Disable Bitnami Banner

sudo /opt/bitnami/apps/wordpress/bnconfig --disable_banner 1

Restart Bitnami Apache

sudo  /opt/bitnami/ctlscript.sh restart apache

You should always restart the Bitnami Apache server to make sure all changes take affect.

That’s it!

How to show hidden files and folders on macOS High Sierra

If you are bit more hands on like me, then you’ll most likely benefit from being able to see hidden files and folders, on your Mac.

There isn’t a small setting for this so the easiest way is to run a simple command in terminal. Don’t worry, it’s not hard or complicated.

First up let’s find and open the Terminal app. You can find it few ways, either go to Mission Control or spotlight search.

Open terminal on a macbook
Continue reading “How to show hidden files and folders on macOS High Sierra”

How to remove connect to WooCommerce.com nag in 3.3.1

Let’s remove “Connect your store to WooCommerce.com to receive extensions updates and support.”

In the lates WC 3.3.1 update, WooCommerce keeps nagging you to connect your store to woocommerce.com
If for some reason you don’t want to and it’s annoying you, then you can turn it off by putting the following filter snippet into your theme’s functions.php or into a Plugin.

Filter to remove the WooCommerce Nag

add_filter( 'woocommerce_helper_suppress_admin_notices', '__return_true' );

That’s all! Make sure it’s in your active theme’s function.php or a Plugin.

Error 500 Importing site into Local by Flywheel

I was exicted to use the site importing feature in Local by Flywheel (localhost development software for WordPress. It should be as creating a zip of the site and make sure the .sql file in the root directory, of that zip.

Just drag and drop the zip into Local’s window and watch it work! Local installed my WordPress site and told me it was ready to go. Oh no! Error 500 when accessing the site using Local by Flywheel!

Don’t worry, it’s and easy fix. Turns out local can corrupt your .htaccess file. All you need to do is replace the .htaccess with a default WordPress one.

Here is the defaut htaccess for WordPress.

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

# END WordPress

Now try loading up your imported WordPress site again ?

Happy blogging!

Easy vertical and horizontal CSS centring

Centering veritally with CSS can be a challenge at times, but not with easy snippet. Make sure the parent class has a relative postion. You can then create the child content to be centered within the parent. This CSS trick centers vertically and horizontally while being 100% responsive.

CSS Centering Snippet

.parent {
  position: relative;
}
.child {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

How fix Atom PHP Beautify – Couldn’t find PHP-CS-Fixer

My Atom installation wasn’t allowing me to beautify PHP in the editor. So if you are having the same issue then don’t worry! It’s simple to install PHP-CS-Fixer on Mac High Sierra.

First we will need to run a couple of commands to download and install PHP-CS-Fixer.
You can find the lastest info in the Github repo, otherwise just follow along here.

First you will need to open terminal and download the lastest version. Just run the below command

curl -L http://cs.sensiolabs.org/download/php-cs-fixer-v2.phar -o php-cs-fixer

You will see the download begin! Once it’s finished will need to set the correct permissoions using:

sudo chmod a+x php-cs-fixer

Now let’s use the move command to move PHP-CS-Fixer into the right location.

sudo mv php-cs-fixer /usr/local/bin/php-cs-fixer

That’s all! Now we will run PHP-CS-Fixer in the terminal to verify that it’s installed system wide.

Let’s head into Atom and beautify some PHP!


Success! apart from some small gaps. I’ll have to optimise the settings to get it perfect.

Display WordPress content only for visitors from Google

Sometimes we want to display dynamic content based on where the visitor has come from. The place where the vistor link your website link from is called a “Referer”, so when someone clicks your link on Google, then Google is the referer. Using PHP we can target users coming from Google, we can then show them unique content or a deal. The code below simply echo’s a string as an example. You will need wrap your specific content inside the brackets.

// Display on for visitors coming from Google
if (strpos($_SERVER&#91;HTTP_REFERER&#93;, "google") == true) {
   // Code for Google vistors
    echo "30% off today";
}

Uncheck “Ship to different address” in WooCommerce by Default

Always try to speed up the WooCommerce checkout as much as your can for your customers. A quick tip is to uncheck the “Ship to different address” checkbox by default. Customers do not commonly use this features and it’s a waste of their time having to untick it. So let’s speed up the time checkout process! Simply drop the following code snippet into your Child theme’s functions.php.
Continue reading “Uncheck “Ship to different address” in WooCommerce by Default”