84% bp-group-sites

Code Review | BP Group Sites

WordPress plugin BP Group Sites scored84%from 54 tests.

About plugin

  • Plugin page: bp-group-sites
  • Plugin version: 0.3.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.2.1-6.0
  • WordPress version: 6.3.1
  • First release: Jun 21, 2016
  • Latest release: Sep 16, 2022
  • Number of updates: 22
  • Update frequency: every 125.8 days
  • Top authors: needle (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,754 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
This plugin's installer ran successfully

Server metrics [RAM: ▲0.02MB] [CPU: ▼2.04ms] Passed 4 tests

A check of server-side resources used by BP Group Sites
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0339.79 ▼0.53
Dashboard /wp-admin3.32 ▲0.0250.25 ▲2.04
Posts /wp-admin/edit.php3.37 ▲0.0243.81 ▼5.75
Add New Post /wp-admin/post-new.php5.90 ▲0.0281.79 ▼3.90
Media Library /wp-admin/upload.php3.24 ▲0.0235.88 ▲3.68

Server storage [IO: ▲0.23MB] [DB: ▲0.00MB] Passed 3 tests

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 22 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
can_compress_scripts
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-comments
widget_recent-posts

Browser metrics Passed 4 tests

BP Group Sites: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5413.28 ▼1.371.81 ▼0.0043.79 ▲0.79
Dashboard /wp-admin2,206 ▲244.86 ▼0.99113.54 ▲10.6642.69 ▲3.10
Posts /wp-admin/edit.php2,089 ▼02.03 ▲0.0335.25 ▼1.5930.88 ▼2.90
Add New Post /wp-admin/post-new.php1,514 ▼017.62 ▲0.07688.88 ▲92.2058.79 ▲8.01
Media Library /wp-admin/upload.php1,391 ▲94.23 ▲0.03104.16 ▲5.0047.32 ▲1.52

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 75% from 4 tests

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
Please fix the following items
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-posts
    • widget_recent-comments
    • theysaidso_admin_options
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Good news, no errors were detected

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Almost there! Just fix the following items
  • 5× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_header() in wp-content/plugins/bp-group-sites/assets/templates/twentysixteen/index.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_header() in wp-content/plugins/bp-group-sites/assets/templates/bpgsites/index.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_url() in wp-content/plugins/bp-group-sites/bp-group-sites.php:26
    • > PHP Fatal error
      Uncaught Error: Call to undefined function do_action() in wp-content/plugins/bp-group-sites/assets/templates/twentysixteen/bpgsites-loop.php:16
    • > PHP Fatal error
      Uncaught Error: Call to undefined function do_action() in wp-content/plugins/bp-group-sites/assets/templates/bpgsites/bpgsites-loop.php:16

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
There were no browser issues found

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
4 plugin tags: reading groups, buddypress, sites, groups

bp-group-sites/bp-group-sites.php Passed 13 tests

Analyzing the main PHP file in "BP Group Sites" version 0.3.1
81 characters long description:
Creates many-to-many relationships between BuddyPress Groups and WordPress Sites.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Success! There were no dangerous files found in this plugin3,397 lines of code in 19 files:
LanguageFilesBlank linesComment linesLines of code
PHP142,0583,0382,990
JavaScript3304415308
CSS2374499

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.35
Average class complexity38.14
▷ Minimum class complexity2.00
▷ Maximum class complexity174.00
Average method complexity3.86
▷ Minimum method complexity1.00
▷ Maximum method complexity33.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods91
▷ Static methods00.00%
▷ Public methods8997.80%
▷ Protected methods22.20%
▷ Private methods00.00%
Functions86
▷ Named functions86100.00%
▷ Anonymous functions00.00%
Constants9
▷ Global constants9100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
No PNG images were found in this plugin