Uncaught TypeError in wordpress-popular-posts/src/Activation/Activator | WordPress.org


Hi @grahamunr,

Curiously someone else reached out to me yesterday via email to report this issue too.

Funny thing is that today we tried installing the plugin again and it worked without issues, no error messagea at all. This leads me to believe that there’s possibly a WordPress bug somewhere that under some circumstances (yet to be determined) causes this error as consequence.

Since you’re having this trouble too I’ll have to add a new check to the plugin to make sure to account for this situation so thanks for reporting this.

For the time being, please:

  1. Make sure the plugin is not active (although it’s probably not given the error message you’re receiving haha).
  2. Go to WP Dashboard > Plugins > Plugin Editor and select WordPress Popular Posts to edit it.
  3. Click on src > Activation > Activator.php to edit this file.
  4. Find this line and replace bool $network_wide with just $network_wide.

If you followed these instructions correctly said line of code should look something like this:

public static function activate($network_wide)

If so click on the Update File button to save changes, then try activating the plugin again and report back.

@hcabrera, thank you for the quick response. I updated the activator.php file as you recommended and the plugin now passes the tests. I’ll go ahead and mark this as resolved.

Thanks again for your help!

Terrific. I’ll push a new update with this “patch” soon as I’m sure there are more people out there having this problem as well (and not everyone comes here to report issues sadly).

Again, thanks for the heads up. I really appreciate it.


This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer