CAll Us: +1 888-999-8231 Submit Ticket

What Automatic Plugin and Theme Updates Mean for Managed WordPress Hosting

As you may have heard, WordPress 5.5 introduces a User Interface (UI) for toggling automatic plugin and theme updates.

The underlying functionality has actually existed in WordPress since automatic core updates were introduced way back in WordPress 3.7, but for the first time WordPress core is shipping with a user interface for controlling what gets updated.

What Automatic WordPress Plugin and Theme Updates Look Like

As of WordPress 5.5, WP Admin contains a column in the plugins table and on individual themes’ detail screens enabling site administrators to enable (or disable) automatic updates.

Twice a day, WordPress will check to see if newer versions of your installed plugins and/or themes are available and, if you’ve opted into automatic updates, install the latest versions.

If any plugin or theme should fail to update, WordPress will revert that change and send an email to the site’s administrator.

Should I enable automatic WordPress plugin and theme updates?

The short answer, unfortunately, is “it depends.”

If you’ve worked with WordPress for a while, you’ve probably heard (or experienced) horror stories about plugin updates going awry: broken functionality, plugin incompatibilities, or even the dreaded “White Screen of Death” (WSoD) have occurred.

For a hobby site or personal blog, these may be a minor annoyance, but for stores running on platforms like WooCommerce, this can have a significant financial impact.

Ultimately, whether or not you enable automatic updates will come down to your risk tolerance and how much you trust the developers behind your favorite plugins and themes.

Note: For Hostdedi customers, you can rest assured that we’re taking daily backups of both your sites’ code and content. We also have visual regression testing to validate that the update went smoothly. If something goes wrong, we can have your site up and running again in short-order.

With that in mind, here are some tips to reduce the chances of an unattended plugin and/or theme update going off the rails:

Use single-purpose plugins from trusted developers

There are hundreds of thousands of WordPress plugins and themes available, but they are not all built the same.

Automattic, the company behind WordPress.com, maintains several of the most popular WordPress plugins: Jetpack, WooCommerce, Akismet, and more. They also have entire teams of developers and support technicians (“Happiness Engineers”) dedicated to the ongoing development of these plugins.

Likewise, companies like iThemes, Yoast, Sandhills Development, and Awesome Motive have built extremely popular plugins and products installed on millions of WordPress sites, but tend to run smaller teams that may be focused on multiple products concurrently.

Not all plugins have this same level of attention, though. In fact, many WordPress plugins are the result of a single developer scratching a particular itch and sharing their work with the world. The developer may not be interested in providing support, or may not have plans to update the plugin moving forward.

If you’re running a plugin that’s maintained by bigger names in the WordPress community, the chances of a plugin update completely breaking your site is likely far smaller than a small developer who may not have the bandwidth for handling support requests nor a solid QA process.

Your best bet is often to stick to plugins and themes from known entities. You might also consider incentivizing the developers of the plugins and themes you depend on; the plugin may have been free to install, but maintenance of a free plugin still takes time.

Similarly, try to avoid using plugins that try to do too much: the less an individual plugin is responsible for, the less likely it is to break in new and spectacular ways or have conflicts with other plugins.

Never modify plugins or themes directly

Sometimes a plugin does almost everything we want or a theme is almost perfect, and it can be tempting to tweak a value in the source and call it a day.

Unfortunately, the next time that plugin or theme gets updated, these changes are wiped away as WordPress replaces the entire plugin/theme directory with the newly-downloaded version.

A better approach is to extend the plugin or theme using actions and filters (collectively “hooks”) to make adjustments without touching the third-party code.

In the case of themes, we can further extend and/or override parts of the theme by creating a child theme.

Follow the development of critical plugins

If there are a handful of plugins that are crucial to your business, it may not be a bad idea to subscribe to any updates the developers might publish.

For instance, a WooCommerce store owner would likely benefit from subscribing to the WooCommerce Developer Blog — even if you’re not a developer, these blogs often hold details about the new features (and potential conflicts) in future releases.

Some of the larger communities (including WooCommerce) have dedicated Slack teams, where users can interface directly with the plugin developers.

Create (and Test!) Regular Backups

Sometimes, things will go wrong; whether an update goes awry, a site gets hacked, or an editor accidentally deletes a very important post, it’s always a good idea to have backups readily available.

For Hostdedi customers, you can rest assured that we’re taking daily backups of both your sites’ code and content. If something goes wrong, we can have your site up and running again in short-order.

If you want to have a second backup of your site (or first, if your host doesn’t offer backups), you may consider a plugin like UpdraftPlus or BlogVault, which let you schedule backups to external services.

It’s not enough just to create the backup, though; on a semi-regular basis, you should be restoring site backups to a development or staging environment to make sure everything you’re expecting to see is present. Don’t wait until you’re restoring a broken site to discover that some crucial data wasn’t included in your archives!

Automate the Testing of Updates

There’s a big movement towards automation these days, and you can take advantage of these tools and techniques to make sure your sites are always behaving as you expect.

For example, you might use a service like Reflect to write a series of automated tests for your site. Specify key URLs, tell the service where to click and what to look for, and instruct it to run the tests every few hours. Should the tests ever fail, you’ll get an email alerting you to the fact that something has gone wrong.

Of course, if you’re running tests every 12 hours but plugin updates are happening somewhere between those intervals, you may find that your site is broken for hours before you even know about it!

This is where your web host comes in: if you’re on any sort of Managed WordPress hosting plan, your host should be proactive in letting you know if updates are breaking your site.

For example: at Hostdedi, we don’t simply apply every plugin update as it becomes available. Instead, we perform what’s known as Visual Regression Testing before each and every plugin update. Here’s how it works:

First, we determine a set of important, representative URLs on a site: the homepage, shopping carts, product catalogs, blog posts, etc.

Next, we create a copy of your site within our network, and take screenshots of these key URLs; these serve as the “before” snapshots.

Once we have a set of screenshots, we upgrade the plugin on the cloned site, then take fresh screenshots of those same URLs to get our “after” images.

Finally, with both before and after screenshots in-hand, we compare these images to see if anything has changed on any of the pages and/or if any errors have popped up; if nothing has changed, we go ahead and upgrade the plugin on the production site. If however we do detect differences, we alert you (and show our work) so you can decide whether or not to upgrade the plugin in question.

What’s the point of Managed WordPress hosting if I have automatic updates?

Whether you opt for WordPress’ native automatic updates or the more sophisticated offerings included in your Hostdedi Managed WordPress/WooCommerce hosting, keeping your site performant, secure, and online extends beyond just keeping things up-to-date.

Every day, we’re tweaking configurations and building new features to squeeze every bit of performance out of our platforms, built by people who know WordPress inside and out. From auto-scaling to Content Delivery Networks (CDNs), our platform is designed from the ground-up for speed, security, and ease of use. At the same time, we’re partnering with industry leaders to deliver the best of the WordPress community for a low, monthly price and backing it all up with best-in-class, 24/7 support.

Whether you opt to use WordPress core’s automatic updates or trust us to handle them for you, know that Hostdedi is there for you every step of the way.

Source link

Use WordPress Testing Tools to Build Your Plugin & Run Unit Tests in Github Actions

We’ve been talking a bunch about unit tests lately, starting with the basics, and then moving up to adding tests to a plugin, so you could see it in practice. We’ve also covered how to use Github Actions to deploy your site automatically to your host. Today, we’re going to take pieces from both of these concepts and combine them, so that we’re running our tests automatically with Github actions when we push new code to the repository.

The easiest way I’ve found to get started is with WP Testing Tools from Valu Digital. The team at Valu Digital has provided a fairly easy way to get your tests up and running on Github Actions. We’re only going to cover how to use their base template to start from scratch with your plugin development so that you can run tests. Adding their test setup to an existing plugin takes a bit more work.

Add WP Testing Tools Setup to an Existing Plugin

To start, clone the repository onto your local computer.

[email protected]:valu-digital/wp-testing-tools.git your-plugin-name

Next, we need to grab the plugins folder from inside the repository as that will be the base for our plugin. Migrate that folder to where you want your new plugin and rename it to match the plugin name you want to use. 

Dealing with Composer

This testing setup requires Composer, which you don’t need to be intimately familiar with today. I’ll cover Composer in detail in a future post. For now, you’ll need to run composer install to install the required dependencies for WP Testing Tools.

Unfortunately, I’ve found that the repository is missing some required Composer packages so we’ll need to make sure these are also installed with the following commands.

composer require codeception/module-rest --dev 

composer require codeception/module-phpbrowser --dev

composer require codeception/module-db --dev

composer require codeception/module-asserts --dev

composer install

Wait, I got memory errors with Composer. Help! It probably doesn’t matter and you shouldn’t get them in Github Actions so you can ignore it for now.

Now we have the proper tools installed, you can push to Github and you’ll see that the unit tests run without issue. This plugin still isn’t ready for us to build on though so let’s get to renaming the other strings in it and make it our own.

Setting Up Plugin Files

We can start by renaming the plugin header information found in plugin.php. Name it whatever suits your plugin and make the author yourself. We’ll also need to change the namespace and class entries so that we’ve named them properly for our project. I’m changing the namespace to my company name and using PluginBase as my class name for this tutorial. You can see my working renamed file below. I’ve also cleaned up the comments to make it easier to read.

<?php

/**

 * Plugin Name: Hostdedi - Github Actions Unit Tests

 * Plugin URI: https://nexcess.net

 * Description: Plugin base that runs unit tests with Github Actions

 * Author: Curtis McHale

 * Version: 0.1.0

 *

 * @package example

 */

 if (!class_exists('SfndesignPluginBase')) {

    require_once __DIR__ . '/vendor/autoload.php';

 }

SfndesignPluginBase::init();

Now in composer.json, we have a few things to change around as well. Make sure that you’re listed as the author of the plugin and change the links to Github Issues and Source to match your repository. You’ll also need to change the namespace of your plugin under the autoload entry. I’m using my company name so mine says Sfndesign. You can see my changed composer.json file below.

{

  "name": "sfndesign/pluginbase",

  "description": "Actions Plugin",

  "type": "wordpress-plugin",

  "license": "GPL-2.0-or-later",

  "authors": [

    {

      "name": "Curtis McHale",

      "email": "[email protected]",

      "role": "developer"

    }

  ],

  "require-dev": {

    "valu/wp-testing-tools": "^0.4.0",

    "lucatume/wp-browser": "~2.2",

    "codeception/module-rest": "^1.2",

    "codeception/module-phpbrowser": "^1.0",

    "codeception/module-db": "^1.0",

    "codeception/module-asserts": "^1.3"

  },

  "autoload": {

    "psr-4": {

      "Sfndesign\": "src/"

    }

  },

  "scripts": {

    "wp-install": "wp-install --full --env-file .env --wp-composer-file composer.wp-install.json",

    "wpunit": "codecept run wpunit",

    "functional": "codecept run functional",

    "test": [

      "@wpunit",

      "@functional"

    ]

  },

  "config": {

    "optimize-autoloader": true

  },

  "support": {

    "issues": "https://github.com/example/example/issues",

    "source": "https://github.com/example/example"

  }

}

Now we need to change the name of the Example.php file found in the src directory. I’m going to call it PluginBase.php to stick with the format we’ve been using. Next, open that file and change the namespace to Sfndesign and the class name to PluginBase. You can see the adjusted file below.

<?php

namespace Sfndesign;

class PluginBase {

    public static function init() {

        define( 'EXAMPLE', 'initialized' );

        add_action('the_title', function () {

            return 'EXAMPLE TITLE MOD';

        });

    }

}

Now that we’ve made these adjustments we need to run composer update again so that Composer registers the new autoload paths that are needed with our renamed files.

Finally, to make sure the whole thing is working well, I find it easier to change their initial test found in tests/ExampleTest.php to something that will return true no matter what. You can see this code below.

 public function testInit()

    {

        $this->assertTrue(true);

    }

Now that we’re set up, you can initialize your plugin as a git repository and then push it to Github. Once you’ve done this you should see an action running under the Actions tab for your repository and everything will come back green because your unit test has been run.

Throughout the last few posts, we’ve written tests and used Github Actions to automate parts of our process. Now, it’s up to you to use these tools in your client projects. You won’t write tests later, so make sure you start your projects with tests from the beginning. If you want to go even deeper with testing there is an excellent course by Fränk Klein that explains Unit Testing in WordPress. It’s already on my list to go over so that I can get better at my testing practices.

Source link

Why WooCommerce is a Powerful Affiliate Marketing Platform

The goal of ecommerce marketing is to expose a store’s products to people most likely to buy them. There are many ways to achieve that goal: display advertising, email marketing, content marketing, and more.
Affiliate marketing is one of the most popular marketing strategies: 80 percent of brands use affiliate marketing to promote their products. It’s also one of the most cost-effective; unlike display advertising or content marketing, there are few upfront costs because affiliates take on the burden of content creation and promotion.
WooCommerce is an excellent platform for building an affiliate marketing program. A WooCommerce store combines WordPress’s strengths as a content management system and WooCommerce’s sophisticated ecommerce features. With the addition of one of the affiliate marketing plugins we are about to discuss, WooCommerce is fully capable of supporting the largest and most complex affiliate marketing programs.

What is Affiliate Marketing?

Affiliate marketing provides rewards, typically a percentage of the value of a sale, to third parties that refer customers to an ecommerce store. The affiliate fees give marketers, bloggers, and other retailers an incentive to promote the store’s product. Amazon’s affiliate program is a great example. Many blogs and review sites are supported entirely by money paid by Amazon to affiliates who refer customers.
A retailer of high-end audio equipment might create an affiliate program to encourage audiophile blogs to write about their products, for example. The bloggers write reviews, make YouTube demonstration videos, and promote the products on social media. Because the blogger already has an audience of audiophiles, the products are promoted to customers who are already inclined to buy.
It would be expensive for the retailer to pay for social media promotion, blog articles, and video content, but with an affiliate program they don’t pay anything unless a customer is referred and buys a product.

How Does Affiliate Marketing Work?

First, a retailer creates an affiliate marketing program on their store. Then, prospective affiliates join the program. Affiliates are given links with identifying codes to use when promoting the store’s products. When a customer clicks on a link on the affiliate’s site, the store knows whose link was used. Any products bought by the referred customers are recorded by the store, and, at fixed periods, the affiliate marketer is paid their percentage of the sale value.
That’s the nutshell explanation of affiliate marketing, which can get a good deal more complicated, but with a decent affiliate marketing plugin, most of the details are automated. An affiliate marketing plugin also provides a range of analytics tools to help ecommerce retailers to optimize their affiliate program.

Affiliate Marketing Plugins for WooCommerce

There are many affiliate marketing plugins available for WooCommerce, but we’ll highlight two of the best, one premium and one free.

AffiliateWP

AffiliateWP is a premium affiliate marketing plugin with a comprehensive array of features and its own add-on ecosystem. AffiliateWP is designed to be easy to use, and anyone familiar with WooCommerce should have no trouble installing it and configuring a basic affiliate marketing program.
Standout features include excellent integration with WooCommerce and membership plugins, powerful affiliate management features and analytics with real-time reporting, reliable affiliate tracking, and handy asset management for providing affiliates with branded visual resources and text links.

Affiliates Manager

Affiliates Manager is a free WordPress affiliate plugin that integrates with WooCommerce and other WordPress ecommerce plugins. It’s not quite as feature rich or slickly designed as AffiliateWP, but it has all the features a WooCommerce user needs to recruit, manage, and track their affiliates.

Source link

How the Success of WordPress is Due to its Plugin Ecosystem



WordPress’s plugin ecosystem is one of its greatest strengths. As we write, there are over 50,000 plugins in the official repository, a number that doesn’t include premium plugins and custom plugins created for individual WordPress sites. Plugins range in functionality from tiny interface tweaks to full-featured ecommerce applications, all taking advantage of the hooks and frameworks built into WordPress by its developers.
About a third of the web runs on WordPress — tens of millions of sites — so we’re used to statistics about WordPress involving big numbers. However, it’s worth taking a moment to think about what a staggering achievement the WordPress plugin ecosystem is and how many thousands of hours of developer time have been dedicated to creating plugins, the vast majority of which are free and open source.
When Matt Mullenweg started work on WordPress in 2003, it was by no means a certainty that there would be a plugin ecosystem. Many early blogging engines were not designed with a modular architecture. Towards the end of 2003, Ryan Boren joined the nascent WordPress project and his work led to the creation of the plugin system we know today.
Mullenweg created Blogtimes, one of the first useful plugins which is still in the plugin repository, although it was last updated 14 years ago. He also created Hello Dolly, which was bundled with WordPress installations to demonstrate how to build plugins.

What Makes Plugins So Powerful?

Plugins are powerful because they allow anyone to create a feature for WordPress without it having to be included in every WordPress site. WordPress’s history would be very different if every possible feature had to be included in WordPress Core. It would be bloated beyond recognition if even a tiny fraction of the features available as plugins were installed as part of the application, not least because it would lead to a horrendously complex interface.
Plugins serve a purpose beyond allowing WordPress to maintain a slimline application and a manageable user experience. The WordPress 5.0 release lists 12 lead developers and 423 contributors. That’s a lot for an open source project, and it’s challenging to organize so many people, especially when most contribute for free. However, a conservative estimate for the number of people working on plugins is hundreds of times the number working on WordPress itself.
For all practical purposes, it’s impossible to organize that many people to work on a monolithic application while hitting deadlines, maintaining security, and adhering to quality standards. Plugins can be developed independently of the core application, by organizations and individuals that manage themselves, that aren’t tied to the needs and release schedules of the main application, and that can create features that are useful to thousands but that aren’t a good use of the core developer’s time.
Without the plugin system, WordPress as we know it wouldn’t exist. It may not have existed at all in 2019, perhaps being remembered only by historians of content management systems. How many WordPress users are familiar with b2/cafelog, the CMS that WordPress replaced?
Thanks to its modularity and the dedication of thousands of developers, WordPress went from strength to strength and is today one of the most important pieces of software in the world.

Source link

WooCommerce Is The Ideal Solution For B2B Sales



WooCommerce has gained massive popularity in the B2C eCommerce market, but it is also an excellent choice for businesses that sell primarily to other businesses.
Compared to consumer eCommerce, B2B eCommerce developed along a different path because it was subject to different pressures. B2B buyers expect more interaction with salespeople, buyers spend more and more products are bought at the same time, and B2B buyers, especially in larger corporations, have requirements that consumers do not. In consequence, B2B eCommerce was slow to take off and was often built on “enterprise” eCommerce solutions with a hefty price tag.
But, in recent years, B2B sellers have adopted many of the lessons learned by their colleagues in the B2C space. Millennial buyers, when appointed to buying roles within their business, expect the same convenience and customer-focused approach from B2B as B2C. The rise of B2B eCommerce makes comparing and assessing suppliers easier than ever before. The double pressures of a fluid market and greater expectations have influenced B2B sellers to up their game.
As Michael Del Gigante puts it, “With so much of their bottom line on the line, B2B e-commerce companies need to start evolving their businesses by reorganizing their websites to serve their business clients as consumers.”

B2B with WooCommerce?

One of the ways B2B eCommerce users can adapt to B2C-shaped expectations is through the tools evolved to serve the needs of consumer-focused eCommerce businesses. Estimates vary, but about a quarter of the eCommerce sites on the web use WooCommerce, and, although primarily designed to serve the needs of B2C retailers, WooCommerce can easily be made into a powerful B2B sales platform.
But what does it take to turn WooCommerce into the ideal B2B eCommerce application? Not a lot. Out of the box, WooCommerce is secure, reliable, and battle-tested. It is capable of supporting many thousands of products and product variants. Its category and tag hierarchies allow for complex custom catalogs. It is free but so popular that support is widely available. If vendor support concerns cause hesitation with WooCommerce adoption, you needn’t worry. Many businesses exist to provide that support.

Bringing B2B Features To WooCommerce

WooCommerce lacks some features that are necessary for B2B and wholesale selling, but they are available as free or paid extensions. As a WordPress plugin, WooCommerce benefits from both WordPress’ massive plugin ecosystem and its own range of extensions.
Dynamic Pricing adds the ability to configure bulk discounts. It includes custom configurations for building finely graded pricing plans that can be applied according to volume purchased or to specific groups of buyers.
B2B sellers often need to restrict categories of products to groups of buyers. There are several WooCommerce extensions for restricting product access according to various criteria. With WooCommerce Protected Categories, sellers can password protect product groups according to category and lock-down product categories by role or user. The extension can be used to create private areas for individual clients and separate B2C and B2B or wholesale areas. The related WooCommerce Private Store can lock-down a store to create a members-only WooCommerce site.
WooCommerce, with the addition of a small number of plugins, is a robust and reliable B2B sales platform, capable of growing as your business grows and adapting to its changing needs.

Source link