keycdn / cache-enabler

A lightweight caching plugin for WordPress that makes your website faster by generating static HTML files.
https://wordpress.org/plugins/cache-enabler/
123 stars 46 forks source link

Fix references to $wp_filesystem->errors #221

Closed stevegrunwell closed 3 years ago

stevegrunwell commented 3 years ago

As noted by @coreykn on the original PR, the error handling for WP filesystem errors was previously a) treating $wp_filesystem as a WP_Error object instead of $wp_filesystem->errors and b) referencing a non-existent $wp_error variable.

This PR updates the error handling to consistently use $wp_filesystem->errors, causing a RuntimeException to be be thrown for [first, if multiple errors are present] error within the $wp->filesystem->errors object.