Ipstenu / varnish-http-purge

Proxy Cache Purge
Apache License 2.0
46 stars 47 forks source link

Fix db version condition #83

Closed mathieuhays closed 5 years ago

mathieuhays commented 5 years ago

Environment: Plugin version: 4.8 WordPress version: 5.1.1 Using object caching

It was recently brought to my attention that the object cache was constantly receiving flush calls. Disabling Varnish HTTP Purge did stop that behaviour.

After some investigating I found a condition testing for the DB version that kept returning false even though the DB version is up to date.

get_option( 'db_version' ) !== $wp_db_version turns out get_option returns a string and $wp_db_version is a int