Ruhani Rabin
10 min readSep 10, 2021

--

How to Deploy Custom Codes with WPCodeBox to All Your WordPress Sites? Featured Image

One of the most flexible CMS systems is WordPress. And, Every WordPress site needs a good amount of customization. We often find ourselves using plugins that can simplify one or two tasks. Even though we want to reduce the number of plugins every day, it is not always possible because almost everyone has their designated duties. I find myself creating a custom plugin for each WordPress deployment. It contains various code snippets that will apply to that specific website. It is far easier to deploy custom codes with WPCodeBox. It can collect and deploy your custom code snippets across all your WordPress installations, which can dramatically reduce the time and need to copy-paste or upload a new plugin file to every WordPress website.

Table of Contents

What are Code Snippets in WordPress?

In WordPress, a code snippet is a small PHP code that extends your website’s functionality or disables specific capabilities; a plugin-like behavior that will take up less system resource.

If you add a code snippet, you either write it yourself or find it online. The problem here is that your website may be broken by errors, leading to more frustration. To ensure the credibility of the code, you must test it before deploying it.

Using Too Many Plugins Can Slow Down Your WordPress Website

It’s common to observe that people use too many plugins for small feature additions. This process is not necessary and creates performance bottlenecks and security issues.

If you add too many plugins, your site will become slower. PHP will require more processing power to handle additional dynamic content and scripts, which will result in performance problems. There are scripts and assets associated with each plugin. Your website’s performance will be affected in some way by them.

Plugin vulnerabilities are becoming more common when there are too many plugins installed. It’s not that uncommon to find exploitable bugs in even the most popular plugins.

It is also a nightmare when you want to manage too many plugins on multiple websites. It is difficult to identify and troubleshoot as well.

Why Do We Need Code Snippets for WordPress?

  1. Reduce the number of plugins for more straightforward tasks. It is like using hooks to disable/enable or add/remove certain WordPress functionalities. Using code snippets can reduce the number of plugins used on the website.
  2. Code snippets are reusable and resource-friendly.
  3. Code snippets are a way to save a snippet of code needed for a site’s functionality. It can apply to various kinds of usage; for example, you can add google tag manager code to all of your pages. Another example is to use a CSS snippet that applies to a specific page of your website.

What Are The Usual Means of Adding Code Snippets to a WordPress Website?

  • Using a Code Snippet Manager Plugin from WordPress Repository.
  • Create a site-specific custom plugin that contains useful snippets.
  • Add the code snippets into existing functions.php files that are included within the theme folder.

The Current Drawbacks of the Above Mentioned Systems

  • Code Snippet Manager plugins are not currently configured to sync between websites at the time of this writing. This means you need to copy or create files on your other WordPress websites manually.
  • Creating a site-specific plugin will require you to create a small plugin and upload it to the specific WordPress website plugin folder. This can be tiresome if you have more than 3 sites.
  • If you have a single error in the plugin file or functions.php file, your site might be unusable until you fix the code.
  • The functions.php files are generally part of the custom theme you are using, and often they contain theme-specific codes there. If you add it to that file, it might get overwritten when you update the theme. Also, those functions will not work if you switch the active theme.
  • Any code error will break the website as well. It is difficult to track which piece of code broke the website.

What is WPCodeBox?

Deploy Custom Codes with WPCodeBox Cloud
WPCodeBox Screen

WPCodeBox is a WordPress plugin that allows you to save all your code snippets to the Cloud. This lets you share them on any of the websites you run on WordPress. This plugin removes the headaches that you have seen in the Drawbacks section.

In Addition, the WPCodeBox Code Repository has a library of tested and ready-to-use code snippets for developers, so it’s easy to find something specific.

How is WPCodeBox Different from Others?

  • WPCodeBox supports snippets for visual builders such as Divi, Beaver Builder, Elementor, Thrive, and similar.
  • Code error checking is one of the most important features of WPCodeBox
  • WPCodeBox works independently and does not require any custom plugin file, child theme, or a functions.php file.
  • WPCodeBox can synchronize specific code snippets to all your other WordPress sites.
  • An efficient policy of handling Code Errors in Snippets. If a code induces a fatal error on the website, the snippet will be automatically disabled to ensure your website is up and running.
  • It can save your custom code snippets to the cloud, which you can re-use on each of your new or old websites.
  • It also comes with a good selection of ready code snippets that you can start using immediately.
  • It allows you to load the code snippets conditionally, just in the front or backend, or customize it.
  • You can organize your code snippets using folders.
  • You can enable or disable the snippets individually.
  • You can keep custom PHP, JS, CSS, SCSS, and LESS codes in the library.
  • You can add codes to a single post, individual pages, custom post types with conditional statements.

The Process to Deploy Custom Codes with WPCodeBox Cloud

I am going to explain the process of using it. It is fairly simple to get started. At the time of this writing, there are no free versions of WPCodeBox available. But I am assuming if you use and deploy WordPress daily. This should be a no-brainer for you to pick up.

First, Get Your Hands on WPCodeBox Plugin

WPCodeBox has 3 pricing tiers available

1. Solo — $29 — One Domain — Lifetime (Pay one time, and you will get all the future update to the plugin)

2. Team — $49–5 Domains — Lifetime (Pay one time, and you will get all the future update to the plugin)

3. Agency — $119 — Unlimited Domains — Lifetime (Pay one time, and you will get all the future update to the plugin)

When I understood what the plugin does and how useful it is, I went for the Agency plan; in that way, I can use it for all my old and new sites.

Wpcodebox Offer

WPCodeBox Lifetime Deal

Here is a perk for you, you can use the coupon code: FBSPECIAL to get a 20% discount code on any of these pricing tiers.

Give Me Now!

That means you can get the Agency Plan just for $89.xx. I think it is a steal; check my video above or continue reading to learn how easy to use this plugin.

Step 1 — Installing WPCodeBox on One of Your WordPress Site

Once you have made the purchase, the plugin download file will be available in your account. Download the file to your local disk. Go to the Plugins > Add New > Upload button in your WordPress Dashboard and upload the plugin file.

Click on Activate button to activate the plugin.

It already contains the license that will be applied to your WordPress site automatically.

Step 2 — Access WPCodeBox

The plugin can be accessed via the left toolbar on your WordPress admin panel after being installed and activated. Use the icon to access the interface.

Wpcodebox Interface

Step 3 — Choose A Code Snippet from Library or Create Your Own

At this point, you can download a snippet from the online repository, or you can create your own.

Repository
WPCodeBox Repository

Once you have downloaded or created a code, you need to submit it to your cloud collection.

Step 4 — Upload Your Snippets to The Cloud Storage

Use the “Upload to the Cloud” button to save it to your personal WPCodeBox cloud. Now the item you have sent out to the cloud will have a cloud icon attached to it.

Wpcodebox Cloud Upload
Cloud Upload

Once it is uploaded, you will be able to use this snippet from any of your WordPress websites.

Step 5 — Install and Access WPCodeBox on Another WordPress Site

Switch to another WordPress website and Follow Steps 1 and 2. Now, Click on the “Cloud Snippets” option on the WPCloudBox interface. The snippets that were saved to the cloud will be shown in a list.

Wpcodebox Items Saved In The Cloud
Items Saved In The Cloud

Step 6 — Download Your Snippets from The Cloud

Pick one of the items by clicking on it now. On top of the editor interface, click “Download from Cloud.” The item will be shown in your main list on the left within a few seconds.

Wpcodebox Download Snippet
Download Snippet

Step 7 — Apply Custom Codes with WPCodeBox into the New Website

Click on the downloaded item, and select the state from Disabled to Enabled. Then, click the SAVE button. Now the item is activated on your other website.

Wpcodebox Activate Snippet
Activate Snippet

You can repeat this process from Steps 5,6 and 7 to download any other snippet and activate them.

Advantages for Deploying Code Snippets with WPCodeBox

Automatically Disable Snippets When there is an Error

WPCodeBox will automatically disable any snippet that causes an error, so you or your customers will not have any downtime even if you add a bad snippet.

Conditional Loading of Code Snippets

You can choose which pages code snippets should run on or not. The admin area and the frontend of WordPress can also be used for running PHP/JS/CSS code.

Multiple Types of Snippets Support

WPCodeBox can enhance your WordPress site with PHP snippets. WordPress-aware auto-complete is available in the Code Editor. You can easily add JS code to your sites, such as tracking codes or custom functionality, without having to mess with FTP or “functions.php.” Update your CSS on your WordPress site, then let the changes auto-reload.

WPCodeBox Features Wishlist

  • Batch download and upload snippets
  • Folder Synchronization

WPCodeBox Upcoming Features

More features are coming next on the roadmap. Here is a quick list of those

Chrome Extension

Chrome Extension for adding snippets to your WPCodeBox account from sites like StackOverflow and GitHub.

Multiple API Keys

You can create deploy-only API keys that you can leave on your customers’ websites, so they have limited access to your cloud code snippets.

Generate WordPress Plugin

Once the development is done, you can generate a custom plugin with PHP, JS, and CSS snippets to optimize performance.

Conclusion to Deploy Custom Codes with WPCodeBox Cloud

I have used many plugins in my WordPress journey since 2004. This is one of the good ones I would strongly recommend if you manage multiple WordPress sites. The feature vs. simplicity vs. cost is a no-brainer. Do not miss the lifetime deal. Grab it while it is still available as a lifetime deal. I would always recommend not to overuse the number of plugins on your website. There are many code snippets available where you are using a full plugin for that named feature. Remember, Google is strongly leaning towards fast-loading sites. Share your thoughts on this. Have you used WPCodeBox, or does this post entice you to get it?

Drop by my Twitter or Facebook to discuss this matter.

Happy WordPressing!

Originally posted at RuhaniRabin.com. Click here to subscribe now

--

--

Ruhani Rabin

Ruhani Rabin being a tech and product evangelist for two decades. He was VP, GM, CPO for various digital companies. Obsessed with Generative AI now.