Title: Illegal string offset warning
Last modified: August 4, 2017

---

# Illegal string offset warning

 *  [Barry](https://wordpress.org/support/users/barryhughes-1/)
 * (@barryhughes-1)
 * [8 years, 9 months ago](https://wordpress.org/support/topic/illegal-string-offset-warning-6/)
 * Hi! On creating a new product I see the following error:
 * > Warning: Illegal string offset ‘expires’ in wp-content/plugins/ithemes-exchange/
   > lib/product-features/class.downloads.php on line 428
 * This is the relevant code:
 *     ```
       $meta = get_post_meta( $product_id, '_it-exchange-download-meta', true );
       if ( 'limit' == $options['setting'] ) {
           $meta['download-limit'] = $new_value;
       } else if ( 'expires' == $options['setting'] ) {
           $meta['expires'] = (boolean) $new_value;
       } else if ( 'expire-int' == $options['setting'] ) {
           $meta['expire-int'] = $new_value;
       } else if ( 'expire-units' == $options['setting'] ) {
           $meta['expire-units'] = $new_value;
       }
       ```
   
 * However, at least for new products `$meta` may actually be a string, rather than
   an array, triggering this error/warning.
 * Be great to clean it up if possible!
 * (WP 4.8.1/PHP 7.1)

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Plugin Author [Elise Alley](https://wordpress.org/support/users/ecalley/)
 * (@ecalley)
 * [8 years, 9 months ago](https://wordpress.org/support/topic/illegal-string-offset-warning-6/#post-9382177)
 * Hi Barry,
 * Thanks for the feedback; I’ve passed this along to the appropriate people.
 * In case you are not aware, we will be turning the iThemes Exchange project over
   to a very competent leader and long-time WordPress community member, AJ Morris,
   and his team at ExchangeWP.com in early August 2017. You can read more about 
   it here: [https://ithemes.com/2017/07/13/ithemes-exchange-new-home-exchangewpcom/](https://ithemes.com/2017/07/13/ithemes-exchange-new-home-exchangewpcom/)
 * Let us know if you have any additional questions.
 * Thanks,
 * Elise
 *  Thread Starter [Barry](https://wordpress.org/support/users/barryhughes-1/)
 * (@barryhughes-1)
 * [8 years, 9 months ago](https://wordpress.org/support/topic/illegal-string-offset-warning-6/#post-9382373)
 * Thanks Elise, I saw that – exciting times ahead!

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Illegal string offset warning’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/ithemes-exchange_ecedef.svg)
 * [ExchangeWP: Simple WP Ecommerce](https://wordpress.org/plugins/ithemes-exchange/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/ithemes-exchange/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/ithemes-exchange/)
 * [Active Topics](https://wordpress.org/support/plugin/ithemes-exchange/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/ithemes-exchange/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/ithemes-exchange/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [Barry](https://wordpress.org/support/users/barryhughes-1/)
 * Last activity: [8 years, 9 months ago](https://wordpress.org/support/topic/illegal-string-offset-warning-6/#post-9382373)
 * Status: not resolved