Sunny

Description

Automatically purge CloudFlare cache, including cache everything rules.

Features

  • Automatically purge CloudFlare cache everything rules’ caches
  • Use the latest Cloudflare API v4
  • Support custom post type
  • Hide admin bar from public-facing pages
  • WP REST API support
  • Purge extra URLs by extending Sunny

Debuggers

Go Sunny –> Debuggers, it shows:

  • All related urls to be purged for a given post
  • Show targeted urls which always be purged
  • Cache Status of a given URL

Coming soon

  • WP CLI support

How does Sunny different from Cloudflare’s official plugin?

At the time of writing, Cloudflare’s official plugin doesn’t purge cache everything rules’ caches. Here comes Sunny! Sunny focus on purging caches when needed.

Compatibility

Things You Need to Know

  • You need PHP 7.0 or later
  • You need WordPress 4.7 or later
  • You need a Cloudflare account (free plan is okay)
  • This plugin was not built by Cloudflare, Inc

If you like the plugin, feel free to rate it or donate via PayPal. Thanks a lot! 🙂

For Bloggers

If you have written an article about Sunny, do let me know. For any questions, shoot me an email at info@typist.tech

For Developers

Sunny is open source and hosted on GitHub. Feel free to make pull requests.

Who make this plugin?

Tang Rufus, a freelance developer for hire.
I make Typist Tech also.

Support

To save time so that we can spend it on development, please read the plugin’s FAQs first.
Before requesting support, and ensure that you have updated Sunny and WordPress to the latest released version and installed PHP 7 or later.

We hang out in the WordPress support forum for this plugin.

If you know what GitHub is, use GitHub issues instead.

Screenshots

  • Cloudflare Settings
  • Admin Bar Settings
  • Purge when Post Updated
  • Debuggers - Cache Status for a Given URL
  • Debuggers - Related URLs for a Given Post
  • Debuggers - Additional URLs for Every Purge

Installation

Via WordPress admin dashboard

  1. Log in to your site’s Dashboard (e.g. www.your-domain.com/wp-admin)
  2. Click on the Plugins tab in the left panel, then click “Add New”
  3. Search for Sunny and the latest version will appear at the top of the list of results
  4. Install it by clicking the Install Now link
  5. When installation finishes, click Activate Plugin

Via Manual Upload

  1. Download the plugin from wordpress.org
  2. Unzip it
  3. Upload it to wp-content/plugins/
  4. Go to the WordPress plugin menu and activate it

Via WP CLI

  1. $ wp plugin install sunny --activate

FAQ

Installation Instructions

Via WordPress admin dashboard

  1. Log in to your site’s Dashboard (e.g. www.your-domain.com/wp-admin)
  2. Click on the Plugins tab in the left panel, then click “Add New”
  3. Search for Sunny and the latest version will appear at the top of the list of results
  4. Install it by clicking the Install Now link
  5. When installation finishes, click Activate Plugin

Via Manual Upload

  1. Download the plugin from wordpress.org
  2. Unzip it
  3. Upload it to wp-content/plugins/
  4. Go to the WordPress plugin menu and activate it

Via WP CLI

  1. $ wp plugin install sunny --activate
How can I purge extra URLs?

Post related urls are filterable by Strategies, sunny_targets and sunny_post_related_urls. See examples on Sunny Purge Extra URLs Example.

If you don’t understand the example code, hire me instead.

What version of PHP do I need?

PHP 7.0 or later.

What version of WordPress do I need?

WordPress 4.7 or later.

What to do when `Parse error: syntax error`?

If you encountered this error:

Parse error: syntax error, unexpected ‘:’, expecting ‘;’ or ‘{‘ in wp-content/plugins/sunny/src/Sunny.php on line XX

You probably running on a old version of PHP. Upgrade your server to PHP 7.0 or later.

Don’t know how to update PHP?
Will you support older versions of PHP or WordPress?

Depends. I accept this kind of custom coding jobs. However, I’ll reject if the requirement doesn’t make sense.
Shoot me an email at info@typist.tech or use this contact form.

Is this plugin written by Cloudflare, Inc.?

No.
This plugin is a Typist Tech project.

Can I install Sunny, Sunny and Cloudflare’s official plugin at the same time?

Yes, all of them work together without problems.

  • Install WP Cloudflare Guard if you want to protect your site from bad IPs
  • Install Sunny if you want to purge CloudFlare’s cache automatically
  • Install the official plugin if you can’t see the real IP from visitors
Does this plugin available in my language?

English works out of the box.

Traditional Chinese language pack is available here.

You can add your own translation at translate.wordpress.org.

How to get support?

Use the WordPress support forum for this plugin at https://wordpress.org/support/plugin/sunny.

Make sure you have read the plugin’s FAQs at https://wordpress.org/plugins/sunny/faq/. And, updated Sunny and WordPress to the latest released version before asking questions.

If you know what GitHub is, use GitHub issues instead.

How can I support this plugin?

If you like the plugin, feel free to:

Besides, Sunny is open source and hosted on GitHub. Feel free to make pull requests.

Last but not least, you can hire me. Shoot me an email at info@typist.tech or use this contact form.

What if I want more?

Hire me!

Shoot me an email at info@typist.tech or use this contact form.

Reviews

Great, simple, saved our server.

Just works! Caching stats show caching is working fine, the server is barely loaded, and I’ve never had a situation where I’ve had stale caches I’ve needed to manually clear. But if I need to, it’s dead easy to do so. Very good, simple plugin.

A few months ago I had some crazy DDOS hack attempts going on (over 500000 attempts per month, 700-1000 an hour, gigabytes of traffic) and cloudflare / sunny handled it brilliantly. Now it’s tailed off, obviously the protection worked.

Thanks!

Mi site is down

The last update (2.0.0) broke mi site. I had to uninstall the plug-in. Please Fix it

works great but problem uninstalling

since I first installed this plugin I noticed that it can’t be uninstalled via wp-admin, only through FTP.

in_array() expects parameter 2 to be array, null given in
public_html/wp-content/plugins/sunny/uninstall.php on line 46

Read all 15 reviews

Contributors & Developers

“Sunny” is open source software. The following people have contributed to this plugin.

Contributors

“Sunny” has been translated into English (Canada). Thank you to the translators for their contributions.

Translate “Sunny” into your language.

Interested in development?

Browse the code or subscribe to the development log by RSS.

Changelog

Full change log available at GitHub

2.4.0

  • Extract targets service provider
  • Show post type name in purge initiated notices

2.3.0

  • Expose Container via WordPress action in Laravel style

2.2.1

  • Fix: Ensure admins have a chance to view PHP 5.x unsupported notice
  • Fix: Do not force sticky notice when WP_DEBUG is true

2.2.0

  • Purge adjacent posts urls
  • Debugger: Check whether a url is cached by Cloudflare
  • Add lots of tests

2.1.0

  • Better WP REST API support
  • Purge homepage (both dynamic and static)
  • Add Debugger: Show all urls to be purged for a given post
  • Add Debugger: Show targeted urls which always be purged
  • Fix: Missing post url when purging

2.0.1

  • Self deactivate if PHP version is older than 7.0.0

2.0.0

  • Update to Cloudflare API v4
  • Codebase rewrite