Speckyboy RSS: How a Custom WordPress Plugin Can Help You Manage a Website

Your latest Speckyboy content is here!.

Speckyboy Design Magazine

Design News, Resources & Inspiration

How a Custom WordPress Plugin Can Help You Manage a Website


By Eric Karkovack on Mar 28, 2021 05:08 pm


Whether you’re a WordPress user or build websites for a living, it’s likely you’ve relied on a few plugins along the way. These additional pieces of software enable the content management system (CMS) to perform new and exciting functions. Everything from contact forms, shopping carts to SEO are just a few clicks away.

Even better is that it’s possible to build your own custom WordPress plugin. And, no, it doesn’t have to be anywhere near the scale or depth of big players like WooCommerce or Jetpack. Nor do you have to be an expert in PHP or JavaScript (though some working knowledge helps).

In fact, some of the best reasons to build a custom WordPress plugin aren’t about adding major functionality. They’re more about making your website easier to maintain over the long term. Things that will save you from problems when you switch to a new theme or hand off a site to a client.

That’s only scratching the surface of what a custom plugin can do. To help demonstrate their power and convenience, here are some situations where building a custom WordPress plugin can be a big help.

How Do You Build a WordPress Plugin?

Before we get into the scenarios of why a custom WordPress plugin could make sense for your project, you may be wondering how to go about building one. That’s a pretty deep subject.

There are tons of reference materials and tutorials out there that cover the specifics. Therefore, we won’t go into great depth here.

Instead, we’re going to point you to the WordPress Plugin Handbook – which is the best place to start. It provides all the background information you need to get your project moving forward. In particular, check out the Plugin Basics section, as it will show you the required first steps.

It’s also worth checking out the Hello Dolly plugin that’s included with a default WordPress installation. The entire plugin is contained within a single PHP file. Its simple structure could serve as an inspiration for your own creation.

In addition, you will want to check out the following resources for getting the most out of your custom plugins:

The WordPress Plugin Handbook home page.

Scenario #1: Making Customizations That Survive a Theme Change

So often, WordPress code tutorials mention that you can add a snippet to your active theme’s functions.php file. Why? Because it’s often the easiest path forward for both the writer and the reader.

That doesn’t make it the best solution, however. Think, for example, of a custom WooCommerce hook that displays some text at the bottom of every product page. This little bit of code will work just fine while residing in your theme – but what happens after a redesign?

Switching themes means losing that customization – unless you remember to copy it over to your new one. A more likely scenario is forgetting about that snippet and scrambling to put it into your new theme after you realize it’s missing.

A plugin removes this potential issue because it’s completely separate from your theme. You can switch themes to your heart’s content and that functionality will still be there.

WordPress Themes page.

Scenario #2: When Functionality Has to Travel Between Websites

Building WordPress websites usually means that you’ll eventually need to use the same functionality in multiple places. That could be adding customer support info to each site you manage or even sharing custom post types across a multisite installation.

With the advent of the Gutenberg block editor, custom blocks are also a prime use case. While some blocks may be client-specific, others could be more general purpose. Placing your blocks into a plugin makes them highly portable.

A custom plugin can be a lifesaver in these situations. You don’t have to reinvent the wheel over and over. Instead, the functionality you need is included in a single package. Just install, activate and move on.

However, this is a good time to bring up the subject of plugin maintenance. If you utilize the same custom plugin on multiple websites, you’ll need to have an effective way to update the code when needed. Version control systems such as Git can come in handy for this task.

While that’s a subject for another day, it’s important to think about before you install your plugin on multiple websites. The more places a plugin resides, the harder it is to maintain without some form of automation.

A collection of suitcases.

Scenario #3: Enhancing an Existing Plugin

Many WordPress plugins offer support for various hooks and filters – code that allows you to change or expand its output and functionality. Think of the WooCommerce example mentioned above as one potential use.

These customizations can play a vital role in how specialized projects such as eCommerce or membership sites work. Placing them into a custom plugin can help in a number of ways.

Beyond the aforementioned separation from your theme, a custom plugin will also allow for better organization. Having all of your code snippets in a single spot means never having to search around for them when it’s time for a change.

Then there’s the ability to add on new functionality down the road. As your website evolves, you may want to build further enhancements. Add them to your custom plugin rather than hacking away at your theme.

Of course, there are also times when a trusted third-party plugin is no longer a viable option. Whatever the reason, you can easily deactivate your custom plugin or remove the additional code you wrote when that time comes.

A electrial plug near an outlet.

A Well-Organized Way to Add Functionality

Before you add custom code directly to your WordPress theme, think about its purpose. While it’s a good place for theme-specific items, other types of functionality really don’t belong in your functions.php file.

For everything else, a custom plugin is the better option. It provides a separate space to store vital functions while keeping them well-organized. You’ll even be able to switch to a new theme without losing your hard work.

The result is a website that is easier to maintain, along with functionality that can be quickly replicated for use elsewhere. It’s a great way to level up your WordPress development workflow.

The post How a Custom WordPress Plugin Can Help You Manage a Website appeared first on Speckyboy Design Magazine.



Read in browser »

Recent Articles:

Weekly News for Designers № 585
Waking Up the Taste Buds of Your Design Clients
Are Google’s Core Web Vitals Metrics Unreasonable?
8 Common Website Layouts Built with CSS Grid
Weekly News for Designers № 584
Share
Tweet
+1
Share
Forward
Copyright © 2021 Speckyboy Design Magazine, All rights reserved.
You signed up for daily Speckyboy Design Magazine email alerts either via Feedburner or directly through our site.

Our mailing address is:
Speckyboy Design Magazine
27 Braeside Park
Inverness, Scotland IV2 7HL
United Kingdom

Add us to your address book


Want to change how you receive these emails?
You can update your preferences or unsubscribe from this list.

Older messages

Speckyboy RSS: Weekly News for Designers № 585

Friday, March 26, 2021

Your latest Speckyboy content is here!. Speckyboy Design Magazine Design News, Resources & Inspiration Weekly News for Designers № 585 By Speckyboy on Mar 26, 2021 10:48 am Envato Elements 100

Speckyboy RSS: Waking Up the Taste Buds of Your Design Clients

Wednesday, March 24, 2021

Your latest Speckyboy content is here!. Speckyboy Design Magazine Design News, Resources & Inspiration Waking Up the Taste Buds of Your Design Clients By Addison Duvall on Mar 24, 2021 07:18 am One

Speckyboy RSS: Are Google’s Core Web Vitals Metrics Unreasonable?

Tuesday, March 23, 2021

Your latest Speckyboy content is here!. Speckyboy Design Magazine Design News, Resources & Inspiration Are Google's Core Web Vitals Metrics Unreasonable? By Eric Karkovack on Mar 23, 2021 08:15

Speckyboy RSS: 8 Common Website Layouts Built with CSS Grid

Monday, March 22, 2021

Your latest Speckyboy content is here!. Speckyboy Design Magazine Design News, Resources & Inspiration 8 Common Website Layouts Built with CSS Grid By Eric Karkovack on Mar 21, 2021 05:42 pm Among

Speckyboy RSS: Weekly News for Designers № 584

Saturday, March 20, 2021

Your latest Speckyboy content is here!. Speckyboy Design Magazine Design News, Resources & Inspiration Weekly News for Designers № 584 By Speckyboy on Mar 19, 2021 07:43 pm Envato Elements The 20

You Might Also Like

Pierce & Ward’s Secret Sources, Business Advice You Can’t Afford to Miss, and More

Friday, April 19, 2024

View in your browser | Update your preferences ADPro “Minimalism is not my strong suit.” So says Emma Roberts, the muse behind AD's May cover story. (Celebrities—they're just like us!)

World Press Photo Contest, Speedometer 3.0, Anchor Position, Sliding Frame, Meta Llama 3

Friday, April 19, 2024

The 5 best design links, every day. Curated by a selection of great editors. Email not displaying properly? View browser version. Sidebar April 19 2024 The World Press Photo Contest Documents War,

Car UX, DevTools Tips, CSS Patterns, iOS404, Internet Cables

Thursday, April 18, 2024

The 5 best design links, every day. Curated by a selection of great editors. Email not displaying properly? View browser version. Sidebar April 18 2024 Steering the future: a new vision for car UX

Big Tents, Pistachio Palettes, and Other Late-Breaking Milan Discoveries

Wednesday, April 17, 2024

View in your browser | Update your preferences We've had a remodel! From now on, you'll be hearing from AD PRO in your inbox twice a week—once with a deep dive into trends to watch and subjects

163 / Dieter Rams inspired Framer components, America's national parks and more free resources…

Wednesday, April 17, 2024

Product Disrupt Logo Product Disrupt Half-Monthly Apr 2024 • Part 1 View in browser Welcome to Issue 163! I'm comfortable talking to a human on camera, but talking at the camera, not so much. The

Logo System, BCWA Identity, War Robots, 84—24, 19th-Century Atlas

Wednesday, April 17, 2024

The 5 best design links, every day. Curated by a selection of great editors. Email not displaying properly? View browser version. Sidebar April 17 2024 Logo System: Explore 400+ logo designs logosystem

Emma Roberts's Home: AD100 Firm Pierce & Ward Share Their Secret Sources

Tuesday, April 16, 2024

Plus, the best exterior house colors View in your browser | Update your preferences Architectural Digest AD PRO Logo exterior of two residential buildings painted with blue trim with a brick patio and

#452: Design Workflow

Tuesday, April 16, 2024

How to choose the right idea, navigate difficult conversations and communicate design. Issue #452 • Apr 16, 2024 • View in the browser Smashing Newsletter Iyi akşamlar Smashing Friends, Design workflow

Mario & Pareto, faces.js, Sleep vs Blog, Dark Mode, DOM Folding

Tuesday, April 16, 2024

The 5 best design links, every day. Curated by a selection of great editors. Email not displaying properly? View browser version. Sidebar April 16 2024 Mario meets Pareto mayerowitz.io Discover how to

Gap, Teenagers, Artistic Intelligence, Should Designers Code, CSS in RSCs

Tuesday, April 16, 2024

The 5 best design links, every day. Curated by a selection of great editors. Email not displaying properly? View browser version. Sidebar April 15 2024 Gap is the new Margin frontendmasters.com In 2020