What up!

You will see a lot of terminal commands on here, as I’m currently diving into the deep end of VPS servers.
I’m putting up snippets to help me remember and hopefully help someone else out 🙂

Fix invalid active developer path ( macOS Mojave )

I was just about to do my latest SVN push to to the WordPress repo when I got the “invalid active developer path” error in my Terminal. This is why my Git and SVN wasn’t working after upgrading to mac OS Mojave.

xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun

I’m not sure why it happened, but don’t worry! It’s an easy fix.

We just need to reinstall the XCode command-line developer tools using the following command

xcode-select --install

An installation will then pop up and you should be ready to go!

You might need to reset the developer tools path in some cases (I didn’t). You can use the following commands as an example.

xcode-select --switch /Applications/Xcode.app
xcode-select --switch /Library/Developer/CommandLineTools

You may also try to reset xcode if you are running out of options.

xcode-select --reset

Migrate Yoast SEO to The SEO Framework Plugin

I had always been using The SEO by Yoast plugin on my WordPress sites. But recently I tried The SEO Framework Plugin, and I’m liking it!
It’s faster and cleaner. I really enjoy plugins that aren’t pushing their branding too much in the WordPress Admin.
Now follow along if you are like me. Let’s export our sites SEO data from Yoast, then import into The SEO Framework. Don’t worry, its easy ☺

Roots.io  lays out their reasons for switching plugin.

“We’ve migrated to The SEO Framework. Some highlights include:

  • This plugin is written with massive and busy (multi-)sites in mind.
  • This plugin is 197% to 867% faster compared to other popular SEO plugins.
  • This plugin consumes 177% to 260% fewer server resources than other popular SEO plugins.
  • 100% fewer database interactions (numbers may vary on this one depending on plugin compatibility).
  • 100% fewer advertisements. Let’s keep it that way.

>The author created this as a response to the other heavy, bloated SEO plugins — no bells and whistles, just straight up functionality. Technically speaking, this plugin uses only ~20 PHP files, compared to 200+ in other SEO plugins. Less complexity, less code for your server to run, less crap to cache. Also, the author is very helpful and communicative, and develops his plugin in the open on GitHub.”

Always Backup your site and Database before making major changes! You don’t want to lose your SEO rank! Continue reading “Migrate Yoast SEO to The SEO Framework Plugin”

White Label WordPress Plugin for Agencies

My 3rd WordPress plugin has been Approved on WordPress.org!  This time around I’ve created a Plugin for White labelling WordPress. I’m developing it with my own use in mind. I wanted to be able to quickly customise the WordPress login logo, admin text, add dashboard widget, just to name a few things.

The screenshots here are just quick examples. If you want to showcase how your site looks please send some shots!

White Label WordPress with your brand and logo

The goal is for White Label to become fully customisable for professional freelancers, businesses and web agencies. They should be able to give their clients a seamless website hand-over experience. Some clients are confused about WordPress and it’s logos, I replace them all with my business logo from now on.

Provide Support in the admin area

Everyone’s tech levels are different so why don’t agencies provide a built in support structure? It will save the agency and the client time!

So, I created the ability to add a live chat, create a custom dashboard widget, or a complete new dashboard page for the admin area in WordPress. These features all tie into my other goal, of finding a better way to offer on-going support to clients.

New White Label features for WordPress

The White Label Plugin was only released today with what I’d called the essential features, It’s no where near done. I want to improve and add a ton of customisation features so there’s a long road ahead. I hope you will join me! Please send me any feedback you have. If you are using it please consider leaving a 5 star review! It helps me a lot!

White Label is made for freelancers, businesses or web agencies that sell WordPress websites to clients. You can find the free White Label version here.

WP enqueue scripts on specific admin page (Only)

Got custom CSS and JavaScript running in your WordPress plugin? Let’s make sure that WordPress only applies the custom styles and JS to your admin pages. It’s a good practice to limit where resources load to make sure that WordPress sites stay fast and secure.

Here are two quick ways to check for the page names.

As an example my admin page url is be https://morgan.com/wp-admin/admin.php?page=morgan-settings

 function morgan_enqueue_scripts($hook) {
    if ( $hook = 'morgan-settings'  ) {  // the page name
 
       wp_enqueue_style('morgan-css', plugins_url('includes/morgan.css',__FILE__ ));
       wp_enqueue_script('morgan-js', plugins_url('includes/morgan.js',__FILE__ ));

     }
    }

    add_action('admin_enqueue_scripts', 'morgan_enqueue_scripts');

The second way to check for the admin page and enqeue scripts looks like this

    function morgan_enqueue_scripts() {
    if(isset( $_GET['page'] ) && $_GET['page'] == 'morgan-settings' ) {
 
       wp_enqueue_style('morgan-css', plugins_url('includes/morgan.css',__FILE__ ));
       wp_enqueue_script('morgan-js', plugins_url('includes/morgan.js',__FILE__ ));

     }
    }

    add_action('admin_enqueue_scripts', 'morgan_enqueue_scripts');

If someone knows the exact pros/cons of each method please drop a comment. Otherwise if you used the code drop a comment as well ? Hope it helped make your plugins run better!

Adsense Auto Ads on WordPress (Easy multiple pages)

On February 21 Google announced their new Adsense Auto Ads. Yesterday My new plugin Better Google Adsense got accepted on the WordPress.org repository!

Auto Ads dynamically place themselves on the page where the script is loaded and it’s been working really well for me, But I only wanted to display ads on specific WordPress pages and post categories.

So I got working on the Better Google Adsense Plugin. Let’s go over how eas Continue reading “Adsense Auto Ads on WordPress (Easy multiple pages)”

My WooCommerce Timer accepted on WordPress.org! ?

I happy to announce my first plugin WooCommerce Checkout Countdown Timer has been accepted on WordPress.org! ? Download the free version there!

Getting the WooCommerce plugin released on the offical WP repo was fairly easy but not without one hiccup. Team turned down my plugin  24 hours after I submitted it, It was just a prefix issue.

I was using cc_ as prefix for functions within the plugin.

“Don’t try to use two letter slugs anymore. We have over 60 THOUSAND plugins on WordPress.org alone, you’re going to run into conflicts.

Similarly, don’t use __ (double underscores), wp_ , or _ (single underscore) as a prefix. Those are reserved for WordPress itself. You can use them inside your classes, but not as stand-alone function.

Remember: Good names are unique and distinct. This will help you and the next person in debugging, as well as prevent conflicts.”

I resolved the issue after an hour of renaming and testing all functions, variables, classes etc.. (to ccfwoo_) Then emailed the WordPress.org team back with the new version of the checkout timer.

Another 24 hours passed and I got the exciting email!

“Congratulations, your plugin hosting request for Checkout Countdown for WooCommerce has been approved.”

This is just the beginning and I am already working hard on the next update. Also a new upcoming Plugin to optimise WordPress Speed and Security.

Let me know if you use the CC Plugin to improve your WooCommerce conversion! I’m always happy to receive feedback

 

 

 

Start of Checkout Countdown for WooCommerce

I’ve been developing the Checkout Countdown Plugin for WooCommerce since the end of Janurary 2018, we are now at version 1.0.3

We are now approaching May and I’d like to say thank you, to everyone who has downloaded the plugin before this post. A special thanks to those of you who took the time to each out with suggestions and feedback! (Check your emails!) ? Continue reading “Start of Checkout Countdown for WooCommerce”

The SEO Framework Plugin Remove Credit & Comments from Source

I’ve completely moved my whole WordPress site over to The SEO Framework from Yoast. I’m extremely happy with TSF so far! I always aim to keep my site as clean and fast as possible. The SEO Framework does not include any advertising or junk.

The plugin only leaves a few comments in the frontend source code. It’s easily removed by using the following snippet in your WordPress child theme’s functions.php or custom plugin.

Remove The SEO Framework HTML Comments

add_filter('the_seo_framework_indicator', '__return_false');

The comments will be disabled and gone after you’ve added the snippet!

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.