Title: Plugin causes corruption of theme
Last modified: November 3, 2025

---

# Plugin causes corruption of theme

 *  Resolved [redwall68](https://wordpress.org/support/users/redwall68/)
 * (@redwall68)
 * [6 months ago](https://wordpress.org/support/topic/plugin-causes-corruption-of-theme/)
 * I use a theme called Portfolio View, and after i upgraded Envira Gallery Lite
   I’ve had several issues: WP-admin page does not display, just a blank page, my
   media library only shows in list-view, grid-view only shows the same blank page
   with a spinning grey circle. Functionality restores when I go to standard twenty-
   twenty five theme and the uninstalls Portfolio View and reinstall it. Then i 
   activate Envira gallery lite again and it crashes again. Is there a way for me
   to go back one version of the gallery lite plugin or can this be fixed?
 * BR

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

 *  Plugin Support [Mihai](https://wordpress.org/support/users/mceban/)
 * (@mceban)
 * [6 months ago](https://wordpress.org/support/topic/plugin-causes-corruption-of-theme/#post-18709744)
 * Hi [@redwall68](https://wordpress.org/support/users/redwall68/),
 * I’m sorry to hear about the issue.
 * I suggest enabling **WP Debug** mode to get the actual error code when you activate
   the Envira Gallery Lite plugin.
 * You can find instructions on how to do this in this article: [How to Easily Enable WordPress Debug Mode to Fix Site Errors](https://www.wpbeginner.com/wp-tutorials/how-to-easily-enable-wordpress-debug-mode-to-fix-site-errors/).
 * Please provide us with the error code, as it should contain more details about
   what’s happening.
 * Thanks,
   Mihai
 *  Plugin Support [Will Derichsweiler](https://wordpress.org/support/users/williamdersh/)
 * (@williamdersh)
 * [5 months, 3 weeks ago](https://wordpress.org/support/topic/plugin-causes-corruption-of-theme/#post-18718632)
 * Hey [@redwall68](https://wordpress.org/support/users/redwall68/) ,
 * It’s been a while since we’ve heard from you so we’ll be closing this thread.
 * Please feel welcome to reach out with any other details or questions!
 * Thanks!
 *  Thread Starter [redwall68](https://wordpress.org/support/users/redwall68/)
 * (@redwall68)
 * [5 months, 2 weeks ago](https://wordpress.org/support/topic/plugin-causes-corruption-of-theme/#post-18725565)
 * **Warning**: Cannot modify header information – headers already sent by (output
   started at /home/6/s/stallrb/www/wp-content/themes/portfolio-view-old/libs/plugin-
   recommend/plugin-recommendations.php:1) in **/home/6/s/stallrb/www/wp-includes/
   functions.php** on line **7168**
   **Warning**: Cannot modify header information–
   headers already sent by (output started at /home/6/s/stallrb/www/wp-content/themes/
   portfolio-view-old/libs/plugin-recommend/plugin-recommendations.php:1) in **/
   home/6/s/stallrb/www/wp-includes/functions.php** on line **7144****Warning**:
   Cannot modify header information – headers already sent by (output started at/
   home/6/s/stallrb/www/wp-content/themes/portfolio-view-old/libs/plugin-recommend/
   plugin-recommendations.php:1) in **/home/6/s/stallrb/www/wp-admin/admin-header.
   php** on line **14**
 *  Thread Starter [redwall68](https://wordpress.org/support/users/redwall68/)
 * (@redwall68)
 * [5 months, 2 weeks ago](https://wordpress.org/support/topic/plugin-causes-corruption-of-theme/#post-18725575)
 * I have also upgraded the problematic plugin, and the page is almost back to normal,
   but:
 * I need to change an image as the theme has gone back to default image on the 
   front page. When I go to BACKGROUND under themes to change the image, there is
   no media, just a blank page with a grey, spinning circle that never stops….
 *  Thread Starter [redwall68](https://wordpress.org/support/users/redwall68/)
 * (@redwall68)
 * [5 months, 2 weeks ago](https://wordpress.org/support/topic/plugin-causes-corruption-of-theme/#post-18725582)
 * …and when I go to Media in the WP control panel, I get the same blank page with
   the spinning wheel in grid mode/vies, but all the images are showing when in 
   list mode/view.
 *  Plugin Support [Mihai](https://wordpress.org/support/users/mceban/)
 * (@mceban)
 * [2 months ago](https://wordpress.org/support/topic/plugin-causes-corruption-of-theme/#post-18842995)
 * Hi [@redwall68](https://wordpress.org/support/users/redwall68/),
 * I apologize for the delayed response.
 * After a thorough investigation, it seems the issue arises from the output starting
   at line 1 in `portfolio-view/libs/plugin-recommend/plugin-recommendations.php`.
   
   This output is due to a UTF-8 BOM (Byte Order Mark) — an invisible byte sequence(\
   xEF\xBB\xBF) some editors insert before the `<?php` tag. PHP treats this as literal
   output, which sends data before any headers, causing issues with AJAX calls and
   making JSON responses invalid.
 * WordPress detects this output and logs a warning because headers can’t be sent
   correctly.
 * As a workaround, you can use a plugin like WPCode to add the following PHP snippet,
   which attempts to fix the issue:
 *     ```wp-block-code
       ob_start( function ( $buffer ) {
           // Strip UTF-8 BOM if present at the start of the output
           if ( str_starts_with( $buffer, "\xEF\xBB\xBF" ) ) {
               return substr( $buffer, 3 );
           }
           return $buffer;
       } );
       ```
   
 * Note that we recommend reaching out with these details to the theme support team
   to see if they can find a better solution for you.
 * Best regards,

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

You must be [logged in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fplugin-causes-corruption-of-theme%2F%3Foutput_format%3Dmd&locale=en_US)
to reply to this topic.

 * ![](https://ps.w.org/envira-gallery-lite/assets/icon-256x256.png?rev=2022837)
 * [Envira Gallery - Image Photo Gallery, Albums, Video Gallery, Slideshows & More](https://wordpress.org/plugins/envira-gallery-lite/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/envira-gallery-lite/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/envira-gallery-lite/)
 * [Active Topics](https://wordpress.org/support/plugin/envira-gallery-lite/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/envira-gallery-lite/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/envira-gallery-lite/reviews/)

 * 7 replies
 * 3 participants
 * Last reply from: [Mihai](https://wordpress.org/support/users/mceban/)
 * Last activity: [2 months ago](https://wordpress.org/support/topic/plugin-causes-corruption-of-theme/#post-18842995)
 * Status: resolved