這個外掛並未在最新的 3 個 WordPress 主要版本上進行測試。開發者可能不再對這個外掛進行維護或提供技術支援,並可能會與更新版本的 WordPress 產生使用上的相容性問題。

Sunny

描述

Automatically purge Cloudflare cache, including cache everything rules.

Warning!!!

This plugin is not for normal users! Read the whole readme and FAQ before installing.

Cloudflare cache everything rules breaks most WordPress dynamic functionalities:

Sunny shows a few admin notices in WP admin dashboard promoting the author’s web development services every 2 weeks.They are dismissible via the X button on the right corner. See faq for more info.This is a free plugin, free as in free of charge and in freedom. You can always remove those notices without breaking other parts of Sunny.

The next major release of Sunny(v3.0.0) will require:

  • PHP 7.1
  • WordPress 4.9
  • Properly working WP Cron

功能

  • 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
  • Extendable Laravel-like container

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

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.

相容性

注意事項

  • You need PHP 7.0 or later
  • You need WordPress 4.7 or later
  • 你而要 Cloudflare 帳號 (免費版亦可)
  • This plugin was not built by Cloudflare, Inc

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

支援

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

You can get support via GitHub issues(preferred) and WordPress support forum.

If you don’t provide these information, your support ticket will be ignored:

  • PHP version number (if you say latest, your ticket will be closed without replies)
  • WordPress version number
  • Sunny version number
  • What is the current behavior
  • What is the expected or desired behavior
  • Step to reproduce current behavior
  • Does it behave the same when Sunny is disabled
  • Does it behave the same when only Sunny is enabled
  • What have you tried to resolve the issue

給開發者

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

You can also tweak Sunny to work for you by extending its Laravel-like container.

螢幕截圖

  • Cloudflare 設定
  • 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
  • Annoying Sunny v1 deprecated notice

常見問題

How can I purge extra URLs?

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

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

How can I tweak Sunny to work for my special needs?

Extend its Laravel-like container.

支持 PHP 版本?

PHP 7.0 或以上。

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.

Unable to dismiss advertisements

Sunny shows a few admin notices in WP admin dashboard promoting the author’s web development services every 2 weeks.
They are dismissible via the X button on the right corner.

Why do they don’t go away?
Your caching settings are incorrect! Possible issues:

  • Database query caches not purged when updated
  • Object cache expire time too long
  • Cloudflare is caching wp-admin

Sunny works with database query caching and object caching. This plugin won’t fix improper server configuration.

But… other plugins don’t have this issue?

I doubt. Sunny saves/retrieves those notices via Options API which commonly used in plugins. Thus, other plugins should get outdated options as well. Hire a developer to check your site!

If you still not convinced, submit a pull request with failing test case via GitHub.

Should I install Sunny version 1 because of PHP 5 incompatibles?

No. Sunny version 1 uses Cloudflare API v1 which deprecated since 9th November, 2016. Either update your server or uninstall Sunny.

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, prepare for being rejected 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.?

不。此外掛由 Typist Tech 開發。

Who make this plugin?

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

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

是,全部彼此相容。

  • 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
此外掛有哪種語言翻譯?

英語開箱即用。

Traditional Chinese language pack is available here.

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

如何取得支援?

Read the whole readme and FAQ first!

如何提供支援?

如果你喜歡這外掛:

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.

想要更多?

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

評價

2018年12月28日
I used to purge one by one or just purge all the cache from Cloudflare admin. Since I use this plugin, setting up Cloudflare it just something like set up and forget.
2017年10月6日 2 replies
I used to love this plugin until I discovered it was displaying ads (inside alerts) for the author’s web design services on dozens and dozens of my client’s websites that I look after. This looks very unprofessional. Will have to stop using this plugin now and remove it from all of my client’s sites.
閱讀全部25個評價

貢獻者及開發者

“Sunny” 是一個開源的軟體。以下的人對這個外掛作出了貢獻。

貢獻者

Sunny 外掛目前已有 2 個本地化語言版本。 感謝所有譯者為這個外掛做出的貢獻。

將 Sunny 外掛本地化為台灣繁體中文版。

對開發相關資訊感興趣?

任何人均可瀏覽程式碼、查看 SVN 存放庫,或透過 RSS 訂閱開發記錄

修改日誌

Full change log available at GitHub

2.5.0

  • Remove class I18n
  • Update dependencies
  • Update readme

2.4.1

  • Add required php version to README.txt
  • Apply code style patches and minor refactoring
  • Test on PHP nightly
  • Update dependencies

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

  • 更新至 Cloudflare API v4
  • Codebase rewrite