Divi Booster Error: Using $this when not in object context

Written by Dan Mossop

If you receive an error similar to the following after updating Divi Booster:

PHP Fatal error: Using $this when not in object context in
/yoursite/htdocs/wp-content/plugins/divi-booster/fixes/064-set-body-font-size/settings-general.php

The problem is not actually with Divi Booster, or with Divi Theme updates. Instead its likely to be a result of old versions of the plugin not being correctly removed from your server.

The Problem

Some services (such as WP Engine) let you set up your site in a "staging" environment and, when you are happy, push the results to the "live" site. Unfortunately such services may be configured to copy changed files and new files to the live site, but not to delete old files. The result is that when you update plugins on the staging site and then copy them to the live site, files which were in an old version of a plugin, but have been removed in newer versions, may still exist on the "live" site, instead of being removed as they should. This mix of old and new plugin files can cause unpredictable behavior and should be avoided.

It is this process that is causing the error above, as the file in question has been removed from Divi Booster and should not be left in the plugin folder.

Please note that this method of copying files from the staging server to a live server without removing deleted files is a general issue which may also affect other plugins. Furthermore, it can pose a security risk as old, potentially vulnerable, files may remain on your live server even after plugin security updates have been applied on the staging server and synced to the live site.

Solving the Problem

Long-term: To solve this problem, it is necessary to remove the old plugin files from the live server when updating plugins. How this is done will depend on the service or setup in question. If you are unsure how to achieve this, it may be necessary to contact your hosting server to request guidance on how to delete old files from the live server when pushing changes from the staging server to the live server.

Short-term: In the short term you may be able to be able to manually work around it by deleting the Divi Booster plugin folder (at /path-to-your-site/wp-content/plugins/divi-booster/) from the live server and then republishing the staging site to the live server.

We may earn a commission when you visit links on our website.

Solve Divi Booster Errors Effortlessly

Eliminate errors like "Using $this when not in object context" by ensuring your plugin files are up-to-date. Avoid unpredictable behavior with Divi Booster by correctly removing old versions.

Latest Posts

Add a Frosted-Glass Background Blur in Divi

Give your Divi layouts a polished, glassmorphism look by blurring the content behind a semi‑transparent Divi section, row or module. This effect enhances readability over busy or textured backgrounds while preserving the visual impact of your imagery and layout. In...

Customize Lightbox Title Styling in the Divi Gallery Module

Adjust the appearance of the lightbox title that appears when visitors open images from a Divi Gallery to align with your brand and improve readability. Refining the title’s color, size, and weight enhances visual hierarchy, accessibility, and overall polish. In this...

Center the Lightbox Image Count in the Divi Gallery Module

Centering the image count in a gallery lightbox creates a cleaner, more balanced presentation and makes it easier for visitors to see where they are in the image set. This simple visual tweak can enhance readability, especially with larger images and longer captions,...

Style the Divi Gallery Module Lightbox Image Count

Tailor the appearance of the image counter in the Divi Gallery module lightbox to match your brand and improve readability. By customizing the counter’s color and typography, you ensure it displays clearly and suits your design. In this guide we show you how to style...

About Dan Mossop

Dan is a Scottish-born web developer, now living in Brisbane with his wife and son. He has been sharing tips and helping users with Divi since 2014. He created Divi Booster, the first Divi plugin, and continues to develop it along with 20+ other Divi plugins. Dan has a PhD in Computer Science, a background in web security and likes a lot of stuff, 

0 Comments

Submit a Comment

Comments are manually moderated and approved at the time they are answered. A preview is shown while pending but may disappear if your are cookies cleared - don't worry though, the comment is still in the queue.

Your email address will not be published. Required fields are marked *.