Title: PHP errors upon new theme install
Last modified: January 17, 2020

---

# PHP errors upon new theme install

 *  Resolved [abuzon](https://wordpress.org/support/users/abuzon/)
 * (@abuzon)
 * [6 years, 6 months ago](https://wordpress.org/support/topic/php-errors-upon-new-theme-install/)
 * Just installed the regular BB parent theme on a new site and got the following
   PHP errors upon Theme install…???
 *     ```
       Warning: Illegal string offset 'sizes' in //public_html/dev/wp-content/plugins/sg-cachepress/core/Images_Optimizer/Images_Optimizer_Webp.php on line 441
   
       Warning: Invalid argument supplied for foreach() in //public_html/dev/wp-content/plugins/sg-cachepress/core/Images_Optimizer/Images_Optimizer_Webp.php on line 441
   
       Warning: implode(): Invalid arguments passed in /public_html/dev/wp-content/plugins/sg-cachepress/core/Images_Optimizer/Images_Optimizer_Webp.php on line 445
   
       Warning: Illegal string offset 'sizes' in /public_html/dev/wp-content/plugins/sg-cachepress/core/Images_Optimizer/Images_Optimizer_Webp.php on line 441
   
       Warning: Invalid argument supplied for foreach() in /public_html/dev/wp-content/plugins/sg-cachepress/core/Images_Optimizer/Images_Optimizer_Webp.php on line 441
   
       Warning: implode(): Invalid arguments passed in /public_html/dev/wp-content/plugins/sg-cachepress/core/Images_Optimizer/Images_Optimizer_Webp.php on line 445
       ```
   

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

 *  [Jairo Ochoa](https://wordpress.org/support/users/jairoochoa/)
 * (@jairoochoa)
 * [6 years, 6 months ago](https://wordpress.org/support/topic/php-errors-upon-new-theme-install/#post-12338141)
 * Hi [@abuzon](https://wordpress.org/support/users/abuzon/)
 * I’ve got the same messages.
 * I thing that **SG Optimizer is trying to optimize everything is uploaded** to
   Media, including ZIP, PDF or DOC files.
 * Images Optimizer should only optimize IMAGES.
 * Simply execute a filter by file extension before optimizing to avoid this errors.
 * Thanks.
 *  Plugin Author [Stanimir Stoyanov](https://wordpress.org/support/users/sstoqnov/)
 * (@sstoqnov)
 * SiteGround Representative
 * [6 years, 5 months ago](https://wordpress.org/support/topic/php-errors-upon-new-theme-install/#post-12343004)
 * Hi,
 * It seems your theme or the image you are trying to delete doesn’t have image 
   sizes.
 * We will fix the issue in the next version.
 * Regards,
    Stanimir
 *  [Jairo Ochoa](https://wordpress.org/support/users/jairoochoa/)
 * (@jairoochoa)
 * [6 years, 5 months ago](https://wordpress.org/support/topic/php-errors-upon-new-theme-install/#post-12343929)
 * Hi [@sstoqnov](https://wordpress.org/support/users/sstoqnov/),
 * Obviously, we are trying to upload a Theme or a Plugin not an image.
    ZIP files
   would never have image sizes.
 * Simple check filetype before applying optimization.
 * Thanks
 *  Plugin Author [Hristo Pandjarov](https://wordpress.org/support/users/hristo-sg/)
 * (@hristo-sg)
 * SiteGround Representative
 * [6 years, 5 months ago](https://wordpress.org/support/topic/php-errors-upon-new-theme-install/#post-12343973)
 * [@jairoochoa](https://wordpress.org/support/users/jairoochoa/) the issue has 
   nothing to do with what you’re suggesting. Themes do not reside in the upload
   folder, neither do plugins. The issue is as mentioned by Stanimir with missing
   image sizes and will be patched in the next minor update.
 *  [Jairo Ochoa](https://wordpress.org/support/users/jairoochoa/)
 * (@jairoochoa)
 * [6 years, 5 months ago](https://wordpress.org/support/topic/php-errors-upon-new-theme-install/#post-12344149)
 * [@hristo-sg](https://wordpress.org/support/users/hristo-sg/) I’m not sure why,
   I just know when the bug occurs. And it happens when uploading a new Theme or
   Plugin.
 * > It seems your theme or **the image you are trying to delete** doesn’t have 
   > image sizes.
 * I do not try to delete anything, I’m just uploading a new Theme.
 *  Plugin Author [Hristo Pandjarov](https://wordpress.org/support/users/hristo-sg/)
 * (@hristo-sg)
 * SiteGround Representative
 * [6 years, 5 months ago](https://wordpress.org/support/topic/php-errors-upon-new-theme-install/#post-12344177)
 * Well, please open a new thread and provide us with an URL to check out and instructions
   on how to recreate it on our end and we will do our best to assist you further.
 *  [Jairo Ochoa](https://wordpress.org/support/users/jairoochoa/)
 * (@jairoochoa)
 * [6 years, 5 months ago](https://wordpress.org/support/topic/php-errors-upon-new-theme-install/#post-12345229)
 * Hi [@hristo-sg](https://wordpress.org/support/users/hristo-sg/)
 * As [@abuzon](https://wordpress.org/support/users/abuzon/) said when she started
   the topic, she was installing a Theme.
    Same happened to me. I added a new Theme
   in one site.
 * Please notice that **it only happens when uploading a Theme or Plugin**. If the
   Theme is got from WordPress repository the are no warning message.
    Also, there
   is no error if the file is uploaded to Media. Just when uploading and installing
   new Theme or Plugin.
 * SG Optimizer 5.4.1 + WP 5.3.2 + PHP 7.1 (Managed PHP service)
 * Thanks
 *  Plugin Author [Stanimir Stoyanov](https://wordpress.org/support/users/sstoqnov/)
 * (@sstoqnov)
 * SiteGround Representative
 * [6 years, 5 months ago](https://wordpress.org/support/topic/php-errors-upon-new-theme-install/#post-12348169)
 * We’ve fixed the issue in version 5.4.2
 *  [Jairo Ochoa](https://wordpress.org/support/users/jairoochoa/)
 * (@jairoochoa)
 * [6 years, 5 months ago](https://wordpress.org/support/topic/php-errors-upon-new-theme-install/#post-12362412)
 * Great [@sstoqnov](https://wordpress.org/support/users/sstoqnov/)

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

The topic ‘PHP errors upon new theme install’ is closed to new replies.

 * ![](https://ps.w.org/sg-cachepress/assets/icon-256x256.gif?rev=2971889)
 * [Speed Optimizer - The All-In-One Performance-Boosting Plugin](https://wordpress.org/plugins/sg-cachepress/)
 * [Support Threads](https://wordpress.org/support/plugin/sg-cachepress/)
 * [Active Topics](https://wordpress.org/support/plugin/sg-cachepress/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/sg-cachepress/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/sg-cachepress/reviews/)

 * 9 replies
 * 4 participants
 * Last reply from: [Jairo Ochoa](https://wordpress.org/support/users/jairoochoa/)
 * Last activity: [6 years, 5 months ago](https://wordpress.org/support/topic/php-errors-upon-new-theme-install/#post-12362412)
 * Status: resolved