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.

Copyright MBP Ninja Affiliate 2017
Tech Nerd theme designed by Siteturner