Title: PHP error with get_string() breaks plugin functionality
Last modified: October 5, 2016

---

# PHP error with get_string() breaks plugin functionality

 *  [oskapt](https://wordpress.org/support/users/oskapt/)
 * (@oskapt)
 * [9 years, 6 months ago](https://wordpress.org/support/topic/php-error-with-get_string-breaks-plugin-functionality/)
 * This is referenced in a bunch of different posts about images being broken or
   caches not reloading, but none of them show the error. Please link other posts
   to this one for discussion.
 * Error:
 *     ```
       Call to a member function get_string() on array in /usr/local/apache2/htdocs/wp-content/plugins/w3-total-cache/Util_Environment.php on line 1042
       ```
   
 * Offending code is here:
 *     ```
               static public function is_w3tc_pro( $config = null ) {
                       $result = $config->get_string( 'plugin.type' ) == 'pro' ||
                               $config->get_string( 'plugin.type' ) == 'pro_dev' ||
                               Util_Environment::is_w3tc_enterprise( $config ) ||
                               ( defined( 'W3TC_PRO' ) && W3TC_PRO );
   
                       return $result;
               }
       ```
   
 * It appears that `$config` is not an object but an array.
 * Workaround suggested [here](https://wordpress.org/support/topic/error-while-purging-caches/)
   is to simply return `false` if you’re not using W3TC Pro:
 *     ```
       	static public function is_w3tc_pro( $config = null ) {
       		return false;
       	}
       ```
   

Viewing 1 replies (of 1 total)

 *  [Scott Hartley](https://wordpress.org/support/users/destac/)
 * (@destac)
 * [9 years, 6 months ago](https://wordpress.org/support/topic/php-error-with-get_string-breaks-plugin-functionality/#post-8260169)
 * Good catch +1

Viewing 1 replies (of 1 total)

The topic ‘PHP error with get_string() breaks plugin functionality’ is closed to
new replies.

 * ![](https://ps.w.org/w3-total-cache/assets/icon-256x256.png?rev=1041806)
 * [W3 Total Cache](https://wordpress.org/plugins/w3-total-cache/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/w3-total-cache/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/w3-total-cache/)
 * [Active Topics](https://wordpress.org/support/plugin/w3-total-cache/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/w3-total-cache/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/w3-total-cache/reviews/)

## Tags

 * [images](https://wordpress.org/support/topic-tag/images/)
 * [upload](https://wordpress.org/support/topic-tag/upload/)

 * 1 reply
 * 2 participants
 * Last reply from: [Scott Hartley](https://wordpress.org/support/users/destac/)
 * Last activity: [9 years, 6 months ago](https://wordpress.org/support/topic/php-error-with-get_string-breaks-plugin-functionality/#post-8260169)
 * Status: not resolved