• Stars
    star
    197
  • Rank 197,722 (Top 4 %)
  • Language
    PHP
  • License
    GNU General Publi...
  • Created about 8 years ago
  • Updated 8 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

🚀 Helper plugins for specific use cases with WP Rocket. ☝️ TEST BEFORE USE! ☝️

WP Rocket Helpers

This repository hosts a number of plugins that target specific use cases for WP Rocket.

WP Rocket is known to be straight-forward and easy to use. However, sometimes a specific use case might require to alter its functionality.

The plugins in this repository provide solutions for some of the more common use cases that still seem too “edge case” to be included as options in WP Rocket’s user interface.

📋 TL;DR

  • Helper Plugins, like WP Rocket, require PHP 5.4+.
  • Helper Plugins by design don’t have version numbers, because we don’t maintain them on a regular basis.
  • Helper Plugins provide a sustainable way to customize WP Rocket’s behaviour, because they’re easier to spot than code snippets hidden in functions.php.
  • 🚀 All plugins from this repository require WP Rocket to be up and running on your WordPress site. If you don’t use WP Rocket on your WordPress site, don’t install any of these plugins.
  • ☝️ Test before use! We don’t maintain all of these helper plugins actively at all times; some may target older versions of WP Rocket, or of other plugins. Some may even become outdated over time.

Table of contents

  1. General notes
  2. Minimum requirements
  3. How to use
  4. Naming conventions
  5. License
  6. Questions?

1. General notes

1.1. What are Helper Plugins?

We use the term “Helper Plugin” to describe a simple WordPress plugin that customizes the behaviour of WP Rocket in some sort of way.

A Helper Plugin usually consists of 1 single PHP file, wrapped in a folder, downloadable and installable as a regular ZIP.

💡 The main idea of Helper Plugins is easy-to-spot customizations.
Other than code snippets dumped into functions.php files, customizations that come wrapped in a little plugin can be spotted at a glance.

1.2. Whom are Helper Plugins for?

Helper Plugins are for all types of WP Rocket users:

  • People who just know how to upload a WordPress plugin
  • Technically well-versed site owners
  • Experienced developers
  • Our own support crew

WP Rocket users

If you don’t write code on a daily basis, you may want to contact our support team before using any of these plugins. (That is, unless you had contacted us already, and we sent you here.)

Developers

For developers and other code-savvy folk, many of WP Rocket’s functions, filters and action hooks used in these plugins are documented in our developer docs.

1.3. What are Helper Plugins not?

Helper Plugins are not works of elaborate software development. They are certainly not OOP, nor even class-based—just simple, procedural functions.

Helper Plugins are not versioned, changelogged, or maintained in the usual sense. We don’t guarantee that all Helper Plugins work with all WP Rocket versions at all times; however, when a Helper Plugin gets published, or updated, it usually sports a basic “Last tested with” section in the README file.

2. Minimum requirements

Helper Plugins fall under the same minimum requirements as WP Rocket: PHP 5.4 or greater, and WordPress 3.1 or greater at the moment of this writing (early 2018).

3. How to use

  • Each sub-folder in this repository contains at least 1 PHP file and 1 ZIP file.
  • PHP files are for code-savvy people to take a look at what the plugin does.
  • The ZIP file is the one you can download and install in WordPress.

💡 Need help with downloading?
Here’s an animated GIF on how to download one of the ZIP files from this repository._

3.1. Installation

  • Download one of the ZIP files from this repository.
  • Don’t unpack it! If your browser unpacks it automatically (can happen e.g. with Safari), you will have to re-ZIP it before proceeding.
  • Install the ZIP file through your WordPress admin interface: Go to Plugins→Add new→Upload, upload the ZIP file and activate the plugin.

3.2. Support

Support for WP Rocket is our business. 🙂
Got a valid license for WP Rocket? Feel free to use our dedicated support form!
Don’t own a valid license? You can get one right here!

4. Naming conventions

💡 Folder names help grouping a folder in a list of other folders.
That’s why folder names for these Helper Plugins start with a wp-rocket- prefix, followed by feature and action keywords.

While file lists are not always sorted by name, it’s the default sort on GitHub and in many FTP clients.

Inside the WordPress plugin folder, a Helper Plugin should be listed next to WP Rocket itself, so a user or support agent can easily spot it.

In this GitHub repository, plugins that address the same feature (cache, lazyload, .htaccess rewrites …) are listed in groups, thus making it easier to skim the repo for a specific plugin.

4.1. Namespaces and functions

💡 We use PHP namespaces to improve readability.
Replacing verbose function prefixes with a PHP namespace can make actual function names more comprehensive, and our code remains easy to read.

It’s easy to over-engineer naming conventions, so we stick to a pragmatic rule of thumb when in doubt:

  1. Namespaces should be unique and consistent.
  2. Function names should be descriptive.

We rely on one consistent namespace for all Helper Plugins, and descriptive subnamespaces for each plugin:

namespace WP_Rocket\Helpers\{subnamespace(s)}

Or more specifically:

namespace WP_Rocket\Helpers\{feature}\{what_this_plugin_does}

Example:

namespace WP_Rocket\Helpers\cache\no_cache_for_admins;

function handle_cache_for_admins() {
    // Handle caching for logged-in administrators.
}
add_action( 'init', __NAMESPACE__ . '\handle_cache_for_admins' );

4.2. Naming placeholder URLs, domains, values

There is one domain on the internet for the sole purpose of “illustrative examples in documents”: example.com

You can safely use it as anything you want:

https://example.com
http://example.com
https://sub-domain.example.com
[email protected]
ftp.example.com

💡 Placeholders must be replaced!
Whenever you see example.com in the code of a Helper Plugin, make sure you replace it with a custom value before you activate the plugin!

5. License

All plugins in this repository, like WordPress and WP Rocket, are licensed under GNU General Public License v2 or later.

6. Questions?

Shoot us a message at: wp-rocket.me/contact/

More Repositories

1

wp-rocket

Performance optimization plugin for WordPress
PHP
662
star
2

adminimize

Adminimize is a WordPress plugin that lets you hide 'unnecessary' items from the WordPress backend.
PHP
100
star
3

search-and-replace

A simple search for find strings in your WordPress database and replace the string.
PHP
90
star
4

backwpup

BackWPup - WordPress Backup Plugin
PHP
88
star
5

wp-rocket-cli

WP CLI interface for the WP Rocket plugin
PHP
72
star
6

imagify-plugin

Speed up your website with lighter images without losing quality.
PHP
70
star
7

rocket-lazy-load

Standalone LazyLoad plugin for WordPress (based on WP Rocket)
PHP
23
star
8

imagify-php

Imagify API client library for PHP
PHP
12
star
9

imagify-helpers

🖼 Helper plugins for specific use cases with Imagify. ☝️ TEST BEFORE USE! ☝️
PHP
11
star
10

heartbeat-control

Heartbeat control for WordPress
PHP
6
star
11

rocket-lazyload-common

Common code between WP Rocket and Lazyload by WP Rocket plugins
HTML
6
star
12

imagify-tools

A WordPress plugin helping debug in Imagify.
PHP
4
star
13

package-template

Repository template for our packages
PHP
4
star
14

phpunit

PHPUnit Common Testing Suite
PHP
3
star
15

module-cloudflare

Cloudflare API module
PHP
3
star
16

background-processing

Async & Background Tasks Processing based on https://github.com/deliciousbrains/wp-background-processing
PHP
3
star
17

imagify-cli

CLI tool for Imagify
2
star
18

module-event-manager

Event management system module for the WordPress Plugin API
PHP
2
star
19

module-rocketcdn

RocketCDN integration module
PHP
2
star
20

imagify-node

Imagify API client library for node.js
JavaScript
1
star
21

rocketcdn-plugin

RocketCDN automatically rewrites all URLs to be served by our content delivery network (CDN). Easy CDN deployment to WordPress.
HTML
1
star
22

imagify-counter

Optimized images realtime counter
CSS
1
star
23

upload-max-file-size

Increase upload file size limit to any value with one click. https://wordpress.org/plugins/upload-max-file-size/
PHP
1
star
24

imagify-python

Imagify API Wrapper for Python
Python
1
star
25

template-loader-plugin

Load any template
PHP
1
star
26

apply-filters-typed

Library for usage of WordPress filters in a typesafe way
PHP
1
star