83% award-role-add-on-for-badgeos

Code Review | Award Role Add-on for BadgeOS

WordPress plugin Award Role Add-on for BadgeOS scored83%from 54 tests.

About plugin

  • Plugin page: award-role-add-on...
  • Plugin version: 1.1.1
  • PHP compatiblity: 5.5.9+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.6.0-5.5.3
  • WordPress version: 6.3.1
  • First release: Jun 2, 2016
  • Latest release: Nov 27, 2020
  • Number of updates: 5
  • Update frequency: every 327.8 days
  • Top authors: konnektiv (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,560 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Install script ran successfully

Server metrics [RAM: ▼0.01MB] [CPU: ▼10.86ms] Passed 4 tests

This is a short check of server-side resources used by Award Role Add-on for BadgeOS
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0034.83 ▼1.55
Dashboard /wp-admin3.31 ▼0.0443.74 ▼17.33
Posts /wp-admin/edit.php3.36 ▲0.0045.76 ▼3.52
Add New Post /wp-admin/post-new.php5.89 ▲0.0082.29 ▼17.92
Media Library /wp-admin/upload.php3.23 ▲0.0033.87 ▼4.67

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

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

Browser metrics Passed 4 tests

An overview of browser requirements for Award Role Add-on for BadgeOS
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,795 ▲914.34 ▼0.011.61 ▼0.2141.23 ▲0.77
Dashboard /wp-admin2,198 ▲275.63 ▲0.0985.61 ▼2.9338.16 ▼1.21
Posts /wp-admin/edit.php2,100 ▼01.97 ▲0.0034.91 ▼6.0436.86 ▲1.18
Add New Post /wp-admin/post-new.php1,537 ▲1118.30 ▼4.73602.46 ▼77.8276.76 ▲10.00
Media Library /wp-admin/upload.php1,400 ▲34.21 ▼0.0997.47 ▼5.5750.20 ▲5.65

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
Please fix the following items
  • The uninstall procedure has failed, leaving 6 options in the database
    • can_compress_scripts
    • db_upgraded
    • widget_recent-comments
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_theysaidso_widget

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
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please fix the following
  • 4× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/award-role-add-on-for-badgeos/includes/actions-filters.php on line 4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_basename() in wp-content/plugins/award-role-add-on-for-badgeos/badgeos-award-role.php:37
    • > PHP Warning
      require_once(ABSPATH/wp-admin/includes/user.php): failed to open stream: No such file or directory in wp-content/plugins/award-role-add-on-for-badgeos/includes/actions-filters.php on line 4
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATH/wp-admin/includes/user.php' (include_path='.:/usr/share/php') in wp-content/plugins/award-role-add-on-for-badgeos/includes/actions-filters.php on line 4

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser issues were found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Attributes that require attention:
  • Tags: You are using too many tags: 19 tag instead of maximum 10
You can take inspiration from this readme.txt

award-role-add-on-for-badgeos/badgeos-award-role.php 85% from 13 tests

Analyzing the main PHP file in "Award Role Add-on for BadgeOS" version 1.1.1
You should first fix the following items:
  • Main file name: The principal plugin file should be the same as the plugin slug ("award-role-add-on-for-badgeos.php" instead of "badgeos-award-role.php")
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6

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
There were no executable files found in this plugin79 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP2276369
JSON10010

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.33
Average class complexity6.00
▷ Minimum class complexity6.00
▷ Maximum class complexity6.00
Average method complexity1.83
▷ Minimum method complexity1.00
▷ Maximum method complexity3.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods6
▷ Static methods116.67%
▷ Public methods6100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions2
▷ Named functions00.00%
▷ Anonymous functions2100.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
There are no PNG files in this plugin