How to disable New User Registration emails EDD

Easy Digital Downloads sends 4 emails per purchase by default, the Sale Receipts and New User Registration. I wanted to disable the New User Registration emails as they don’t provide any value benefit to me or the customer.

Here are few reasons why

  • Keep emails low (I hate unnecessary emails)
  • Everything can be included in the Sales Receipt
  • Allows me to keep using the free Mailjet plan (200 emails per day)
  • Customers not feel like they are getting spammed

After looking at messy ways to disable the email the WordPress Way. I finally found a good solution to disabling the New User Emails in Easy Digital Downloads by using this snippet.

// Remove new user email for admin and user
remove_action( 'edd_insert_user', 'edd_new_user_notification', 10, 2 );

Use the snippet in your child theme functions.php or a custom plugin (I prefer custom plugins).

Hope it helps you! I’ll continue to post small tips and tricks for creating a better experience across WordPress and Easy Digital Downloas.

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/ 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 nag in 3.3.1

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

In the lates WC 3.3.1 update, WooCommerce keeps nagging you to connect your store to
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

[cc lang=”php”]
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.

[cc lang=”bash”]
# BEGIN WordPress

RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ – [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]

# END WordPress[/cc]

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

[cc lang=”css”].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
[cc lang=”bash”]curl -L -o php-cs-fixer

You will see the download begin! Once it’s finished will need to set the correct permissoions using:
[cc lang=”bash”]sudo chmod a+x php-cs-fixer[/cc]
Now let’s use the move command to move PHP-CS-Fixer into the right location.
[cc lang=”bash”]sudo mv php-cs-fixer /usr/local/bin/php-cs-fixer[/cc]

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.

[cc lang=”php”]
// Display on for visitors coming from Google
if (strpos($_SERVER[HTTP_REFERER], “google”) == true) {
// Code for Google vistors
echo “30% off today”;