title: How to fix "illegal string offset" in wordpress theme
body: <p>I have some themes from WooThemes I bought about a year ago and now I'm getting around to using them. I keep getting the "illegal string offset" error. Code posted. Please advise. Thanks.</p>
  
  <p>Error Messages:</p>
  
  <pre><code>Warning: Illegal string offset 'version' in C:\xampp\apps\wordpress\htdocs\wp-content\themes\flashnews\functions\admin-interface.php on line 1613
  
  Warning: Illegal string offset 'version' in C:\xampp\apps\wordpress\htdocs\wp-content\themes\flashnews\functions\admin-interface.php on line 1659
  </code></pre>
  
  <p>Lines 1612 - 1659:</p>
  
  <pre><code>//Check if version is the latest - assume standard structure x.x.x
      $pieces_rss = explode( '.', $latest_version_via_rss['version'] );
      $pieces_local = explode( '.', $local_version );
  
      //account for null values in second position x.2.x
  
      if( isset( $pieces_rss[0] ) &amp;&amp; $pieces_rss[0] != 0 ) {
          if ( ! isset( $pieces_rss[1] ) )
              $pieces_rss[1] = '0';
  
          if ( ! isset( $pieces_local[1] ) )
              $pieces_local[1] = '0';
  
          //account for null values in third position x.x.3
          if ( ! isset( $pieces_rss[2] ) )
              $pieces_rss[2] = '0';
  
          if ( ! isset( $pieces_local[2] ) )
              $pieces_local[2] = '0';
  
          //do the comparisons
          $version_sentinel = false;
          $status = 'bugfix';
  
          // Setup update statuses
          $statuses = array(
              'new_version' =&gt; __( 'New Version', 'woothemes' ),
              'new_feature' =&gt; __( 'New Feature', 'woothemes' ),
              'bugfix' =&gt; __( 'Bugfix', 'woothemes' )
          );
  
          // New version
          if ( $pieces_rss[0] &gt; $pieces_local[0] ) {
              $version_sentinel = true;
              $status = 'new_version';
          }
          // New feature
          if ( ( $pieces_rss[1] &gt; $pieces_local[1] ) &amp;&amp; ( $version_sentinel == false ) &amp;&amp; ( $pieces_rss[0] == $pieces_local[0] ) ) {
              $version_sentinel = true;
              $status = 'new_feature';
          }
          // Bugfix
          if ( ( $pieces_rss[2] &gt; $pieces_local[2] ) &amp;&amp; ( $version_sentinel == false ) &amp;&amp; ( $pieces_rss[0] == $pieces_local[0] ) &amp;&amp; ( $pieces_rss[1] == $pieces_local[1] ) ) {
              $version_sentinel = true;
              $status = 'bugfix';
          }
  
          return array( 'is_update' =&gt; $version_sentinel, 'version' =&gt; $latest_version_via_rss['version'], 'status' =&gt; $statuses[$status], 'theme_name' =&gt; $theme_name );
  </code></pre>