78% badgeos-group-management-add-on

Code Review | BadgeOS Group Management Add-on

WordPress plugin BadgeOS Group Management Add-on scored78%from 54 tests.

About plugin

  • Plugin page: badgeos-group-man...
  • Plugin version: 1.0.1.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-4.8.3
  • WordPress version: 6.3.1
  • First release: Jun 7, 2016
  • Latest release: Nov 6, 2017
  • Number of updates: 10
  • Update frequency: every 52.1 days
  • Top authors: learningtimes (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /3,385 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.00MB] [CPU: ▼8.26ms] Passed 4 tests

This is a short check of server-side resources used by BadgeOS Group Management Add-on
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0043.62 ▲3.27
Dashboard /wp-admin3.31 ▲0.0049.16 ▼2.55
Posts /wp-admin/edit.php3.36 ▲0.0048.93 ▼8.83
Add New Post /wp-admin/post-new.php5.89 ▲0.0088.39 ▼21.38
Media Library /wp-admin/upload.php3.23 ▲0.0037.66 ▼0.29
Roles /wp-admin/admin.php?page=badgeos-group-management-settings3.0023.97
Create Schools /wp-admin/admin.php?page=badgeos-group-management3.0023.63

Server storage [IO: ▲0.12MB] [DB: ▲0.07MB] Passed 3 tests

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 12 new files
Database: no new tables, 8 new options
New WordPress options
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-comments
widget_recent-posts
badgeos_group_management_student_role
badgeos_group_management_teacher_role
db_upgraded
can_compress_scripts

Browser metrics Passed 4 tests

BadgeOS Group Management Add-on: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,826 ▲6514.73 ▲0.091.75 ▼0.0144.16 ▼3.03
Dashboard /wp-admin2,189 ▲125.65 ▼0.0492.19 ▼22.4640.63 ▼16.92
Posts /wp-admin/edit.php2,103 ▼01.97 ▼0.0339.89 ▼6.5435.40 ▼3.26
Add New Post /wp-admin/post-new.php1,546 ▼123.49 ▲0.06657.67 ▲40.0659.31 ▲4.02
Media Library /wp-admin/upload.php1,397 ▼04.24 ▼0.01104.12 ▼0.7742.72 ▼6.47
Roles /wp-admin/admin.php?page=badgeos-group-management-settings280.440.084.42
Create Schools /wp-admin/admin.php?page=badgeos-group-management280.440.083.72

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
These items require your attention
  • This plugin did not uninstall successfully, leaving 8 options in the database
    • badgeos_group_management_teacher_role
    • can_compress_scripts
    • widget_recent-posts
    • db_upgraded
    • widget_recent-comments
    • widget_theysaidso_widget
    • badgeos_group_management_student_role
    • theysaidso_admin_options

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please fix the following
  • 5× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/badgeos-group-management-add-on/includes/badgeos-group-management-functions.php:27
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/badgeos-group-management-add-on/includes/badgeos-users.php:31
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/badgeos-group-management-add-on/includes/badgeos-user-list.php:19
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/badgeos-group-management-add-on/includes/submission-filters.php:39
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_basename() in wp-content/plugins/badgeos-group-management-add-on/badgeos-group-management.php:21

User-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Please fix the following user-side errors
    • > GET request to /wp-admin/admin.php?page=badgeos-group-management-settings
    • > Network (severe)
    wp-admin/admin.php?page=badgeos-group-management-settings - Failed to load resource: the server responded with a status of 403 (Forbidden)
    • > GET request to /wp-admin/admin.php?page=badgeos-group-management
    • > Network (severe)
    wp-admin/admin.php?page=badgeos-group-management - Failed to load resource: the server responded with a status of 403 (Forbidden)

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
These attributes need your attention:
  • Tags: Too many tags (22 tag instead of maximum 10); only the first 5 tags are used in your directory listing
You can look at the official readme.txt

badgeos-group-management-add-on/badgeos-group-management.php 85% from 13 tests

The main PHP script in "BadgeOS Group Management Add-on" version 1.0.1.2 is automatically included on every request by WordPress
Please make the necessary changes and fix the following:
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("badgeos-group-management-add-on.php" instead of "badgeos-group-management.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Everything looks great! No dangerous files found in this plugin1,346 lines of code in 8 files:
LanguageFilesBlank linesComment linesLines of code
PHP63764581,224
PO File1243084
JavaScript15338

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.51
Average class complexity24.00
▷ Minimum class complexity24.00
▷ Maximum class complexity24.00
Average method complexity3.56
▷ Minimum method complexity1.00
▷ Maximum method complexity9.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods9
▷ Static methods111.11%
▷ Public methods9100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions38
▷ Named functions38100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
There were not PNG files found in your plugin