elementor / wp2static

WordPress static site generator for security, performance and cost benefits
https://wp2static.com
The Unlicense
1.42k stars 270 forks source link

fix getting active plugins in multisite environment #788

Closed stefanullinger closed 3 years ago

stefanullinger commented 3 years ago

Fixes #730

As discussed in #730 WordPress stores network active plugins of a Wordpress multisite environment in the active_sitewide_plugins option of the wp_sitemeta table. This option can be accessed using get_site_option.

We need to merge these plugins with the blog's active plugins in order to get a list of all active plugins for a single blog.

leonstafford commented 3 years ago

This one will need to fix to satisfy the code quality checks.

You can run locally composer test to replicate what's happening in GitHub Actions. Or per-test type, like composer phpcs (can find the available commands within the composer.json.

I'd also suggest if possible to merge some of those lines in to avoid unnecessary "temporary variable assignments", like:

array_merge(
  other_func(
     other_func())

If that makes sense ;) If not, fine as is, if tests pass.

stefanullinger commented 3 years ago

Alright, I've updated the PR.

I'd also suggest if possible to merge some of those lines in to avoid unnecessary "temporary variable assignments"

I've also changed this, but I have the feeling that it loses some valuable context and makes the code harder to understand.

leonstafford commented 3 years ago

Many thx, @stefanullinger!

Yeah, I totally get the preference, probably just a style I'm getting used to.