How to Create a Site Specific Plugin

If you’re like many of WordPress’s intermediate users, then I’m sure that you’ve felt an urge to extend or enhance your WordPress site. Sure, there are themes and plugins that vastly improve and extend the capabilities of WordPress, but sometimes coding or adding custom functions yourself gives you a better result. Or sometimes, you want to expand those powerful themes even further by adding your own custom code to manipulate WordPress to your will.

That is the nature of WordPress – it’s hackable (in a good way). The main way to hack WordPress is to add functions and hooks which are mainly done using your theme’s functions.php file. You can directly edit it, but if your theme updates, then all of your edits in the functions.php file will be lost – so the solution? Create a child theme. But what if you want to edit functions that aren’t dependent on your theme? Sure, you can still add them to your child theme, but it’s better to create a site-specific plugin for that. This way, if you ever change a theme, then you don’t have to reapply the theme independent custom functions that you added.

Creating a Site-Specific Plugin for Your WordPress Site

Open your favorite FTP client and connect to your WordPress site. Once you are connected, open your WordPress plugins folder. Inside the folder, create a new folder called site-plugin and inside it, create a new file called site-plugin.php, you can actually name them anything you want, however, so feel free to do so. What’s important is that we create a new folder inside WordPress’s plugin folder and inside that folder, we create a new PHP file that will hold our custom snippets.

Now that you have the PHP file ready, copy the code below and paste it into your PHP file:

<?php
/*
Plugin Name: WHATEVER NAME YOU WANT
Description: Site-specific code changes for example.com
*/

/* Start Adding Functions Below this Line */

/* Stop Adding Functions Below this Line */
?>

You can change the plugin name to whatever you want, perhaps something like “Site Specific Plugin for EXAMPLE.COM” or something. The plugin name and description you put in there will be displayed in your plugins page. Don’t worry, it’s just for aesthetic and won’t impact your site in any way.

Save the file and log in to your WordPress dashboard. Check out the plugins page and you’ll see your new plugin there. Activate it and you’re done! That’s it!

Now, if you found a code snippet online that you want to try on your site, or if you have code snippets now that you want to add, simply open your site-specific plugin PHP file again (pro tip: you can also do it inside your WordPress dashboard, just click the edit button under your plugin name) and paste the code snippet inside after and/or before the lines that say start and stop adding functions. Save your file once you added your code snippet and you’re done!

You can change the plugin name to whatever you want, perhaps something like “Site Specific Plugin for EXAMPLE.COM” or something. The plugin name and description you put in there will be displayed in your plugins page. Don’t worry, it’s just for aesthetic and won’t impact your site in any way.

Save the file and log in to your WordPress dashboard. Check out the plugins page and you’ll see your new plugin there. Activate it and you’re done! That’s it!

Now, if you found a code snippet online that you want to try on your site, or if you have code snippets now that you want to add, simply open your site-specific plugin PHP file again (pro tip: you can also do it inside your WordPress dashboard, just click the edit button under your plugin name) and paste the code snippet inside after and/or before the lines that say start and stop adding functions. Save your file once you added your code snippet and you’re done!

Best Plugins to Backup and Restore WordPress

Losing months of hard work is one of the greatest nightmares of anyone who works in any industry related to computers and web technology. That’s why it’s very important to keep a backup of your work and update it as often as possible or every time a major change happens.

That being said, backing up your WordPress website is easy, thanks to a number of plugins available to us. Here are some of the best plugins to backup and restore WordPress.

UpdraftPlus WordPress Backup Plugin

This is one of the most popular backup plugins for WordPress. According to its plugin page, it has at least a million active installs. It has an active community and the developers, along with the users are cooperating together to solve any issue that one can encounter with the plugin.

What made this plugin so popular is that it an all in one solution – you can backup and restore your site with a single plugin. You can also schedule backups – even on its free version, a very important feature for a backup plugin and with over a million installs, we can infer that it’s compatible with a wide array of WordPress setups, so the chances of encountering a critical error are severely minimized.

Get it from here.

Backup Buddy

If you want a premium solution, then Backup Buddy is for you. You can easily create daily, weekly, or monthly schedule and choose to automatically store your backups in cloud storage services like Dropbox, Amazon S3, Rackspace Cloud and Google Drive. They also have their own cloud storage service called Stash Live.

Perhaps the main strength of Backup Buddy lies from their online backup service – called Stash Live. It can back-up your site in real-time and you can also use it to duplicate your site for migration and/or restoration. Finally, they say that this plugin doesn’t consume too many resources, so even in the worst shared hosting environment, this will work smoothly.

Buy it here.

BackWPUp

A free WordPress backup solution that covers all of your basic needs. It supports backing up to popular cloud services such as Dropbox, S3 Services, Azure, SugarSync, Amazon Glacier, RackSpace cloud and more. It can also optimize and fix a database and of course, back it up. Aside from that, it also gives you the ability to choose what archive type you want your backups zipped and saved to.

Get it here.

WP-DB-Backup

This is a very simple, yet popular plugin with more than 300,000 active installs. However, this one can only be used to back up your database. This is perfect for a website with little to no multimedia content. It makes creating and restoring backup faster and easier.

Get it here.

Make Your Site Respond Faster with W3 Total Cache

Make Your Site Respond Faster with W3 Total Cache

These days speed is a big factor on the web. Your website taking a couple more seconds to load can mean bad news, and there’s no doubt you’ll see the results by optimising your site’s code and loading times. After optimising mine, I noticed a decrease in bounce rate the next day, so it does make a difference. Search engines are starting to take this in as well so practising these SEO skills will help in the long run.

Luckily, if you’re using one of those content management systems that have extremely wide ranges of support options and extensions such as WordPress, then there are some simple solutions. There are a lot of plugins available that claim to instantly speed up your website, so there’s a lot to name, but none of them compares to W3 Total Cache. With all my experience in bespoke web development where I have to optimise static or dynamic websites that don’t have these plugins available; this one for WordPress does cover all the important factors as makes the biggest difference compared to the rest.

Super charge your website with W3 Cache

So What’s So Good About W3 Cache?

This plugin has been worked very hard on and deserves all the credit it gets. I’m surprised the plugin isn’t be sold instead of being available for free. Just by configuring the plugin properly, you can save 80% of your bandwidth and improve the loading times for your pages by at least ten times. It also gives you a Yahoo! YSlow A Grade which ranks your optimisation on some factors, YSlow is the website speed debugging tool by Yahoo! just like Google has PageSpeed and even in PageSpeed you’ll notice massive improvements in your score. It can integrate perfectly with shared hosting servers, but if you’re using a VPS, dedicated server or a cluster based service, then you can make good use of the amount of power available by using Opcode or Memcache for multiple servers which are compelling caching services.

Features and Settings

And that’s only half the story! Each feature categorises the W3 Total Cache settings. The first one is Page Cache; it caches all your pages that make queries using up server resources and time so a static one can instantly be produced to a visitor. The second one is Minify; I don’t use this one, so I left the box un-ticked meaning Total Cache will minify nothing. I had some problems using this feature because I didn’t notice anything being minified what-so-ever when debugging and have always had this problem. A lot of other people have had this problem, and the cause of the issue is yet to be investigated, but I found a better solution for this anyway so there’s no point.

While having the Minify feature disabled in Total Cache, I’ve got the WP-Minify plugin installed which is useful, it minifies all the CSS and JavaScript files into two separate documents and then presents them in the code with a ‘pretty URL’ without parameters, so it works out well. I was a bit disappointed because the W3 Minify features allow you to move separate stylesheets and scripts to different parts of the document and can be removed from a certain page if not used, so it’s even more optimised. Nonetheless, the other plugin does the job quite well, and I’ve never had any problems with it.

5 WordPress Plugins Every Blogger Needs

5 WordPress Plugins Every Blogger Needs

Just wading through the WordPress plugin repository can be overwhelming for someone who wants to start a blog or is thinking of starting one. There are thousands of plugins to choose from at any time. Let’s just look at five plugins that every serious blogger should have on their blog.

Simple Share Buttons

Sharing is caring. So when you write your posts and publish them, you should make it easy for both visitors and readers to share them. Simple Share Buttons is a good plugin for that purpose. It’s easy to set up and customize. This nifty plugin gives you the option to create floating social media sharing buttons as well as fixed buttons that you can embed either at the top or bottom of your posts.

WP Super Cache

Page load time is one of those things that you shouldn’t compromise as a blogger. No one wants to access a post that takes 5-10 seconds to load in their browser. To speed up content delivery, install WP Super Cache. It’ll serve cached static files and reduce memory usage and ultimately speed up your blog dramatically.

Yoast SEO

You’ve heard the hackneyed phrase, “SEO is King“. That phrase just holds true. If you’re going to set up your blog, you’re going to need an SEO plugin to take care of on page/post optimization. None does a better job than Yoast SEO. You can use it to create meta descriptions, SEO titles, sitemaps, and even check for keyword appearance as well as the readability of your text. There is a free version and a premium one.  Here is how to set up Yoast.

Contact Form 7

As a blogger, you need to have a form that readers and visitors can use to contact you. There are many plugins that can do this job but one stands out – Contact Form 7. It’s easy to setup and customize. You can create multiple forms with various fields to capture names, emails, and phone numbers and embed them to various pages. What’s more? You can easily style your forms. No CSS knowledge or special coding is required.

Akismet

Chances are this is one of those plugins whose notification is gonna pop up the moment you install your blogging theme. And rightly so because a lot of bloggers out there are bombarded with spam. Seriously, you don’t want to wake up each morning to delete hundreds of spam comments in your dashboard. Just install Akismet, register an account at their main site, add the API key, and you’ll never have to worry about spam ever.

Copyright MBP Ninja Affiliate 2017
Tech Nerd theme designed by Siteturner