Sunny (Connecting CloudFlare and WordPress)


Sunny automatically clears CloudFlare cache. And, protect your WordPress site at DNS level.


  • Integrate with iThemes Security, Contact Form 7 and WordPress Zero Spam
  • Blacklist IP if attempt to login with bad username
  • Automatically clears corresponding CloudFlare caches whenever a post/page/media attachment is updated, commented or trashed.
  • Purge CloudFlare cache from WordPress admin dashboard
  • Test your CloudFlare API key


How does Sunny different from CloudFlare’s offical plugin?

At the time of writting, CloudFlare’s offical plugin doesn’t purge anything for WordPress. It provides the real IP of your visitors and notify CloudFlare when you marking an IP as SPAM. However, it does not include a way to clear the cache or make adjustments to how it works. Here comes Sunny! Sunny focus on cache purging.

Things you need to know

  • You need a CloudFlare account.
  • This plugin was not built by CloudFlare.

How others talking about Sunny?

If you have written an article about Sunny, do let me know.

Who make this plugin?

Tang Rufus, a freelance developer for hire.
I make WP Human also.


  • PHP 5.3 or later


  • Account Settings
  • General Settings
  • Email Settings
  • Tools
  • Integration


  1. Download the plugin.
  2. Go to the WordPress Plugin menu and activate it.
  3. Go to “Settings” –> “Sunny”
  4. Fill in your CloudFlare account info
  5. Test it with Connection Tester (via Settings Page)
  6. That’s it!

Check out this step-by-step guide for detail instructions.


Check out this step-by-step tutorial.

Is this plugin written by CloudFlare, Inc.?

Sunny is written by Tang Rufus

Can I install both Sunny and CloudFlare’s offical plugin at the same time?


When should I install Sunny and CloudFlare’s offical plugin at the same time?

Install Sunny if you want to purge CloudFlare’s cache automatically.
Install the offical plugin if you can’t see the real IP from visitors.

When does Sunny purge my cache?

Every time a published post is updated or commented.
Or, every time post status change from/to published

What pages does it purge when a post is updated?

The post itself, homepage and its catories, tags and taxonomies archive.
Use the URL purger on Tools tab to check what will be cleared for a particular URL.
You can disable this behavior via the General tab.

What if Sunny blacklisted my IP?
  1. Login CloudFlare.
  2. Release you IP on the threat control dashborad.
Parse error: syntax error, unexpected T_FUNCTION in …

If you come across this error, make sure that you have PHP 5.3 or later installed.

Dose it support mulitsite?

Confirmed that it doesn’t work network wide. While this version of Sunny does not intended to support mulitsite, you might want to try activating Sunny on a per site basis (WPMU DEV has a step-by-step tutorial). Please report your findings.

Moreover, I am planning to write a mulitsite version. Drop me a note if you want early asscess.


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


I’m using a free hosting service that has CloudFlare included in its cPanel. Can I use this plugin once I activate CloudFlare fro the cPanel?

Read all 11 reviews

Contributors & Developers

“Sunny (Connecting CloudFlare and WordPress)” is open source software. The following people have contributed to this plugin.




  • Fix: Postboxes not expanding or collapsing on click outside of Sunny
  • Fix: Broken links to WP Human website


  • Fix: Showing empty admin bar for non-logged in users


  • Tweak: Support WordPress installations on their own directories
  • Fix Firefox force reloading Tools tab


  • Fix: Activator incorrect message
  • Fix: ITSEC_Lockout constructor missing argument
  • Security: Add black index files
  • Developer: Rename intergrated_plugin_name –> intergrated_plugin_slug
  • Developer: Remove views files in public folder
  • Developer: Refactor Sunny_Settings & Sunny_Sanitization_Helper with dependency inversion principle
  • Developer: Rename folder plublic to modules\
  • Developer: Modularize Sunny_iThemes_Security and Sunny_Zero_Spam
  • Developer: Sunny_Updater constructor takes version number


  • Fix: update notice not showing
  • Developer: Better file headers
  • Developer: Introduce abstract spam module
  • Deprecated: plugin_screen_hook_suffix


  • New Translation: zh_HK


  • New Feature: Integrate with Contact Form 7
  • Fix: Zero Spam module early quit before getting IPs
  • Developer: WP Plugin Boilerplate – Change name -> plugin_name for consistency. See this commit
  • Developer: WP Plugin Boilerplate – Fixing require() -> require_once(). See this commit
  • Deverloper: WP Plugin Boilerplate – Create functions for activation and deactivation hooks. See this commit



  • Tweak: Use zero_spam_ip_blocked instead of zero_spam_found_spam_registration and zero_spam_found_spam_comment
  • Tweak: Sanitize in Easy Digital Downloads way


  • New Feature: Integrate with iThemes Security
  • Performance boost: Early quit if unnecessary
  • Tweak: Use jQuery UI style on setting pages
  • Fix: Unable to send WordPress Zero Spam blacklist notification emails



  • Update screenshots


  • Add: WP Human tutorial
  • Add: URL input fields
  • Tweak: Use PHP filter_var to validate IPs and check localhost IPs
  • Tweak: Line breaks between input fields and labels
  • Fix: Typo


  • Tweak: Use WP Human newletter signup form
  • Deprecated: zone_ips, Pull recent IPs visiting site


  • Fix: is localhost


  • Fix: Separating admin notices and email notification
  • Fix: Log email notification into php error log only if WP_DEBUG is true


  • Performance: Not loading plugin css
  • Security: Checking page=sunny as referral
  • Fix: check wp_http_referer bugged with question marks
  • Fix: Empty customized bad usernames issue


  • New: Customize bad usernames
  • New: Non-ajax support to Tools Ttb
  • New: Prevent network wide activation


  • Fix: Deactivation hook typo


  • New: Option to disable email notifications
  • Fix: Set default email frequency to immediately
  • Security Fix


  • New: zh_TW Translation


  • Code Rewrite & File Organization
  • New: Defer noticifcation emails
  • New: Ban IP if Login As Administrator
  • New :Purge when status change from/to published
  • Fix: IP being banned twice
  • Fix: Duplicate blacklist notification email
  • Fix: Admin bar always been hided


  • New:Ban IP if Login As Admin


  • Bug Fix


  • New: Mailing List Signup Form


  • Improve Performance


  • New: Support special type top level domains


  • New: Ready for localization
  • Fix: Class ‘Parent’ not found fatal error


  • Bug Fix


  • New: Admin bar hider
  • Code Rewrite
  • UI Improvement
  • Performance Improvement
  • Remove: GitHub Updater


  • Fix: Wrong version number


  • New: URL purger
  • New: Purge related URLs during post update
  • Better Description and Documents


  • Tidy up source code according to WordPress coding standard


  • Tidy ReadMe


  • New: PayPal Donation Link


  • Submit to WordPress Plugin Directory


Initial Release

  • New: Readme.txt
  • New: Screenshots


  • New: GitHub Updater


  • Initial Alpha Test