Skip to content
This repository has been archived by the owner on Aug 16, 2024. It is now read-only.

Commit

Permalink
Merge branch 'warn-dangerous-user'
Browse files Browse the repository at this point in the history
  • Loading branch information
tangrufus committed Jan 8, 2018
2 parents 56e31a8 + 5f1b39a commit 9a56123
Show file tree
Hide file tree
Showing 2 changed files with 82 additions and 75 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
[![Donate via PayPal](https://img.shields.io/badge/Donate-PayPal-blue.svg)](https://www.typist.tech/donate/sunny/)
[![Hire Typist Tech](https://img.shields.io/badge/Hire-Typist%20Tech-ff69b4.svg)](https://www.typist.tech/contact/)

Automatically purge CloudFlare cache, including cache everything rules.
Automatically purge Cloudflare cache, including cache everything rules.

<!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
Expand Down Expand Up @@ -45,7 +45,7 @@ Automatically purge CloudFlare cache, including cache everything rules.



This repository is a development version of [Sunny](https://wordpress.org/plugins/sunny/) intended to facilitate communication with developers. It is not stable and not intended for installation on production sites.
This repository is a development version of [Sunny](https://wordpress.org/plugins/sunny/) intended to facilitate communication with developers. It is not stable and not intended for installation on production sites.

Bug reports and pull requests are welcome.

Expand Down Expand Up @@ -119,7 +119,7 @@ Under the hood, Sunny uses [WP Contained Hook](https://github.com/TypistTech/wp-

Within the `sunny_register` action, you should only bind things into the container. You should never attempt to register any hooks, actions, filters or any other piece of functionality within `sunny_register` action. Otherwise, you may accidentally use an instance which has not been loaded yet.

The `sunny_boot` action is called after this plugin and all its addons have been registered, meaning you have access to all instance that have been registered by this plugin and its addons.
The `sunny_boot` action is called after this plugin and all its addons have been registered, meaning you have access to all instance that have been registered by this plugin and its addons.



Expand All @@ -139,13 +139,13 @@ The `nightly` branch is built by TravisCI whenever the `master` branch is update

### Donate via PayPal [![Donate via PayPal](https://img.shields.io/badge/Donate-PayPal-blue.svg)](https://www.typist.tech/donate/sunny/)

Love Sunny? Help me maintain Sunny, a [donation here](https://www.typist.tech/donate/sunny/) can help with it.
Love Sunny? Help me maintain Sunny, a [donation here](https://www.typist.tech/donate/sunny/) can help with it.

### Why don't you hire me?

Ready to take freelance WordPress jobs. Contact me via the contact form [here](https://www.typist.tech/contact/) or, via email [[email protected]](mailto:[email protected])

### Want to help in other way? Want to be a sponsor?
### Want to help in other way? Want to be a sponsor?

Contact: [Tang Rufus](mailto:[email protected])

Expand Down
147 changes: 77 additions & 70 deletions README.txt
Original file line number Diff line number Diff line change
@@ -1,23 +1,40 @@
=== Sunny ===
Contributors: typisttech, tangrufus
Donate link: https://www.typist.tech/donate/sunny/
Tags: cloudflare, speed, caching, cache,rest-api
Donate link: https://typist.tech/donation/
Tags: cloudflare, speed, caching, cache, rest-api
Requires at least: 4.7
Requires PHP: 7.0.0
Tested up to: 4.9.1
Stable tag: 2.4.1
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html

Automatically purge CloudFlare cache, including cache everything rules.
Automatically purge Cloudflare cache, including cache everything rules.

== Description ==

Automatically purge CloudFlare cache, including cache everything rules.
Automatically purge Cloudflare cache, including cache everything rules.

= Warning!!! =

This plugin is not for normal users! Read the whole [readme](https://wordpress.org/plugins/sunny/#description) and [FAQ](https://wordpress.org/plugins/sunny/#faq) before installing.

Cloudflare cache everything rules breaks most WordPress dynamic functionalities:

* [WordPress Nonces](https://codex.wordpress.org/WordPress_Nonces) will be cached
* Forms must be loaded via AJAX unless you’re using the USD$ 200 Cloudflare plan. [Learn more](https://github.com/TypistTech/sunny/issues/118#issuecomment-324325599)

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](https://typist.tech/articles/ensure-wp-cron-runs-on-time/)

= Features =

* Automatically purge CloudFlare `cache everything` rules' caches
* Automatically purge Cloudflare `cache everything` rules' caches
* Use the latest Cloudflare API v4
* Support custom post type
* Hide admin bar from public-facing pages
Expand All @@ -32,10 +49,6 @@ Go `Sunny` --> `Debuggers`, it shows:
* 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](https://wordpress.org/plugins/cloudflare/) doesn't purge `cache everything` rules' caches. Here comes Sunny! Sunny focus on purging caches when needed.
Expand All @@ -52,62 +65,41 @@ At the time of writing, Cloudflare's [official plugin](https://wordpress.org/plu
* You need a Cloudflare account (free plan is okay)
* This plugin was not built by [Cloudflare, Inc](https://www.cloudflare.com/)

> If you like the plugin, feel free to [rate it](https://wordpress.org/support/plugin/sunny/reviews/#new-post) or [donate via PayPal](https://www.typist.tech/donate/sunny/). Thanks a lot! :)

= For Bloggers =

If you have written an article about `Sunny`, do [let me know](https://www.typist.tech/contact/). For any questions, shoot me an email at [[email protected]](mailto:[email protected])

= For Developers =

Sunny is open source and hosted on [GitHub](https://github.com/TypistTech/sunny). Feel free to make [pull requests](https://github.com/Typisttech/sunny/pulls).

You can also tweak `Sunny` to work for you by [extending its Laravel-like container](https://github.com/Typisttech/sunny#extending-sunny).

= Who make this plugin? =

[Tang Rufus](mailto:[email protected]), a freelance developer for hire.
I make [Typist Tech](https://www.typist.tech/) also.
> If you like the plugin, feel free to [rate it](https://wordpress.org/support/plugin/sunny/reviews/#new-post) or [donate](https://typist.tech/donation/). Thanks a lot! :)

= Support =

To save time so that we can spend it on development, please read the plugin's [FAQs](https://wordpress.org/plugins/sunny/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.
To save time so that we can spend it on development, please read the plugin's [FAQ](https://wordpress.org/plugins/sunny/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.

We hang out in the WordPress [support forum](https://wordpress.org/support/plugin/sunny) for this plugin.
You can get support via [GitHub issues](https://github.com/Typisttech/sunny/issues)(preferred) and WordPress [support forum](https://wordpress.org/support/plugin/sunny).

If you know what `GitHub` is, use [GitHub issues](https://github.com/Typisttech/sunny/issues) instead.
If you don't provide these information, your support ticket will be ignored:

== Installation ==
* 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

= Via WordPress admin dashboard =

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

= Via Manual Upload =

1. Download the plugin from [wordpress.org](https://downloads.wordpress.org/plugin/sunny.zip)
1. Unzip it
1. Upload it to `wp-content/plugins/`
1. Go to the WordPress plugin menu and activate it
= For Developers =

= Via WP CLI =
Sunny is open source and hosted on [GitHub](https://github.com/TypistTech/sunny). Feel free to make [pull requests](https://github.com/Typisttech/sunny/pulls).

1. `$ wp plugin install sunny --activate`
You can also tweak `Sunny` to work for you by [extending its Laravel-like container](https://github.com/Typisttech/sunny#extending-sunny).

== Frequently Asked Questions ==

= 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](https://github.com/TypistTech/sunny-purge-extra-urls-example).
Post related urls are filterable by `Strategies` and `sunny_post_related_urls`. See examples on [Sunny Purge Extra URLs Example](https://github.com/TypistTech/sunny-purge-extra-urls-example).

If you don't understand the example code, [hire me](https://www.typist.tech/contact/) instead.
If you don't understand the example code, [hire me](https://typist.tech/contact/) instead.

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

Extend its [Laravel-like container](https://github.com/Typisttech/sunny#extending-sunny).

Expand All @@ -127,34 +119,55 @@ If you encountered this error:

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](https://codex.wordpress.org/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](https://github.com/TypistTech/sunny).

= 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](https://blog.cloudflare.com/sunsetting-api-v1-in-favor-of-cloudflares-current-client-api-api-v4/).
Either update your server or uninstall Sunny.
No. Sunny version 1 uses Cloudflare API v1 which [deprecated since 9th November, 2016](https://blog.cloudflare.com/sunsetting-api-v1-in-favor-of-cloudflares-current-client-api-api-v4/). Either update your server or uninstall Sunny.

= Don't know how to update PHP? =

* Contact you hosting company
* Switch to a better hosting such as [WP Engine](https://www.typist.tech/go/wp-engine-isnt-business-worth-29-month/) or [Kinsta](https://www.typist.tech/go/kinsta-staging-environment/)
* Hire me [https://www.typist.tech/contact](https://www.typist.tech/contact)
* Switch to a better hosting such as [WP Engine](https://typist.tech/go/wp-engine-isnt-business-worth-29-month/) or [Kinsta](https://typist.tech/go/kinsta-staging-environment/)
* Hire me [https://typist.tech/contact](https://typist.tech/contact)

= 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 [[email protected]](mailto:[email protected]) or use this [contact form](https://www.typist.tech/contact/).
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 [[email protected]](mailto:[email protected]) or use this [contact form](https://typist.tech/contact/).

= Is this plugin written by Cloudflare, Inc.? =

No.
This plugin is a [Typist Tech](https://www.typist.tech) project.
No. This plugin is a [Typist Tech](https://typist.tech) project.

= Who make this plugin? =

[Tang Rufus](mailto:[email protected]), a freelance developer for hire. I make [Typist Tech](https://typist.tech/) also.

= 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](https://wordpress.org/plugins/wp-cloudflare-guard/) if you want to protect your site from bad IPs
* Install [Sunny](https://wordpress.org/plugins/sunny/) if you want to purge CloudFlare's cache automatically
* Install [Sunny](https://wordpress.org/plugins/sunny/) if you want to purge Cloudflare's cache automatically
* Install the [official plugin](https://wordpress.org/plugins/cloudflare/) if you can't see the real IP from visitors

= Does this plugin available in my language? =
Expand All @@ -167,29 +180,23 @@ You can add your own translation at [translate.wordpress.org](https://translate.

= How to get support? =

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

Make sure you have read the plugin's FAQs at [https://wordpress.org/plugins/sunny/faq/](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](https://github.com/Typisttech/sunny/issues) instead.
Read the whole [readme](https://wordpress.org/plugins/sunny/#description) and [FAQ](https://wordpress.org/plugins/sunny/#faq) first!

= How can I support this plugin? =

If you like the plugin, feel free to:

* Give us a 5-star review on [WordPress.org](https://wordpress.org/support/plugin/sunny/reviews/#new-post)
* Donate via [PayPal](https://www.typist.tech/donate/sunny/). Thanks a lot! :)
* Translate it at [translate.wordpress.org](https://translate.wordpress.org/projects/wp-plugins/sunny).
* Translate it at [translate.wordpress.org](https://translate.wordpress.org/projects/wp-plugins/sunny)
* [Donate](https://typist.tech/donation/). Thanks a lot! :)

Besides, `Sunny` is open source and hosted on [GitHub](https://github.com/TypistTech/sunny). Feel free to make pull requests.

Last but not least, you can hire me. Shoot me an email at [[email protected]](mailto:[email protected]) or use this [contact form](https://www.typist.tech/contact/).
Last but not least, you can hire me. Shoot me an email at [[email protected]](mailto:[email protected]) or use this [contact form](https://typist.tech/contact/).

= What if I want more? =

Hire me!

Shoot me an email at [[email protected]](mailto:[email protected]) or use this [contact form](https://www.typist.tech/contact/).
Hire me! Shoot me an email at [[email protected]](mailto:[email protected]) or use this [contact form](https://typist.tech/contact/).

== Screenshots ==

Expand Down

0 comments on commit 9a56123

Please sign in to comment.