Title: Update to wordpress
Last modified: August 20, 2016

---

# Update to wordpress

 *  [LFD](https://wordpress.org/support/users/fdeflint/)
 * (@fdeflint)
 * [13 years, 5 months ago](https://wordpress.org/support/topic/update-to-wordpress-1/)
 * Hello. After update to 3.5 appears this message:
 * Notice: Undefined offset: 1 in /usr/home/cinema2000.es/web/wp-content/plugins/
   simple-ads-manager/admin.class.php on line 129
 * How can i resolve this?
    Thank you
 * [http://wordpress.org/extend/plugins/simple-ads-manager/](http://wordpress.org/extend/plugins/simple-ads-manager/)

Viewing 1 replies (of 1 total)

 *  [NelsNose](https://wordpress.org/support/users/nelsnose/)
 * (@nelsnose)
 * [13 years, 4 months ago](https://wordpress.org/support/topic/update-to-wordpress-1/#post-3272596)
 * I’m trying to figure this out, too.
 * I’ve changed that line from:
    `$version['spec'] = $subver[1];` to `$version['
   spec'] = isset($subver[1]) ? $subver[1] : NULL;`
 * **Still testing, not guaranteed to work.**
 * My process:
    Here is the function in admin.class.php that includes line 129:
 *     ```
       public function getWpVersion() {
             global $wp_version;
             $version = array();
   
             $ver = explode('.', $wp_version);
             $version['major'] = $ver[0];
             $vc = count($ver);
             if($vc == 2) {
               $subver = explode('-', $ver[1]);
               $version['minor'] = $subver[0];
               $version['spec'] = $subver[1];
               $version['str'] = $version['major'].'.'.$version['minor'].((!empty($version['spec'])) ? ' ('.$version['spec'].')' : '');
             }
             else {
               $version['minor'] = $ver[1];
               $version['build'] = $ver[2];
               $version['str'] = $wp_version;
             } 
   
             return $version;
           }
       ```
   
 * What I notice is that $wp_version is “3.5” in the latest WP.
    $ver is an array
   of the version parts (as separated by ‘.’), e.g. array(3, 5).
 * $vc therefor equals 2.
 * $subver is trying to create an array of the “5” part of “3.5”, splitting at “-”
   which doesn’t exist, so we have $subver = array(5) and $subver[1] doesn’t exist(
   illegal offset).
 * I’m not sure where this is being called, but it’s safe to assume that $version(
   the returned variable) needs to be an array, so we can’t just assign $version
   the value of $wp_version.
 * We can do a shorthand conditional statement instead, assigning $version[‘spec’]
   the value NULL if $subver[1] is not set.

Viewing 1 replies (of 1 total)

The topic ‘Update to wordpress’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/simple-ads-manager_73687f.svg)
 * [Simple Ads Manager](https://wordpress.org/plugins/simple-ads-manager/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/simple-ads-manager/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/simple-ads-manager/)
 * [Active Topics](https://wordpress.org/support/plugin/simple-ads-manager/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/simple-ads-manager/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/simple-ads-manager/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [NelsNose](https://wordpress.org/support/users/nelsnose/)
 * Last activity: [13 years, 4 months ago](https://wordpress.org/support/topic/update-to-wordpress-1/#post-3272596)
 * Status: not resolved