84% badgeos-learndash-gateway

Code Review | BadgeOS Learndash Gateway

WordPress plugin BadgeOS Learndash Gateway scored 84% from 54 tests.

About plugin

  • Plugin page: badgeos-learndash...
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-4.9.8
  • WordPress version: 6.3.1
  • First release: Aug 24, 2020
  • Latest release: Sep 7, 2020
  • Number of updates: 4
  • Update frequency: every 4.5 days
  • Top authors: learningtimes (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 410 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
The plugin installed successfully, without throwing any errors or notices

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

An overview of server-side resources used by BadgeOS Learndash Gateway
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0036.60 ▼5.29
Dashboard /wp-admin3.31 ▲0.0045.72 ▼5.27
Posts /wp-admin/edit.php3.36 ▲0.0048.20 ▼2.74
Add New Post /wp-admin/post-new.php5.89 ▲0.0092.84 ▼0.38
Media Library /wp-admin/upload.php3.23 ▲0.0036.31 ▲4.14

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

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 21 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
can_compress_scripts
widget_recent-posts
db_upgraded
theysaidso_admin_options
widget_theysaidso_widget

Browser metrics Passed 4 tests

A check of browser resources used by BadgeOS Learndash Gateway
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,841 ▲8413.32 ▼1.054.82 ▲2.3940.92 ▼5.44
Dashboard /wp-admin2,206 ▲184.85 ▼0.01108.12 ▼7.1044.03 ▼6.58
Posts /wp-admin/edit.php2,092 ▲62.01 ▼0.0141.27 ▲6.0136.37 ▲1.11
Add New Post /wp-admin/post-new.php1,537 ▲123.59 ▲0.36641.06 ▼23.4658.05 ▲5.28
Media Library /wp-admin/upload.php1,385 ▼64.17 ▼0.0596.39 ▼9.0041.11 ▼7.85

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
These items require your attention
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_recent-posts
    • can_compress_scripts
    • theysaidso_admin_options
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though everything seems fine, this is not 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
Almost there! Just fix the following items
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/badgeos-learndash-gateway/badgeos-learndash-gateway.php:356

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
There were no browser issues found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
Attributes that need to be fixed:
  • Tags: Too many tags (17 tag instead of maximum 10); only the first 5 tags are used in your directory listing
You can take inspiration from this readme.txt

badgeos-learndash-gateway/badgeos-learndash-gateway.php 92% from 13 tests

The main file in "BadgeOS Learndash Gateway" v. 1.0 serves as a complement to information provided in readme.txt and as the entry point to the plugin
It is important to fix the following:
  • Description: The description should be shorter than 140 characters (currently 218 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Good job! No executable or dangerous file extensions detected1,444 lines of code in 17 files:
LanguageFilesBlank linesComment linesLines of code
PHP114024301,290
JavaScript3266118
Markdown116027
CSS2009

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.39
Average class complexity28.80
▷ Minimum class complexity12.00
▷ Maximum class complexity48.00
Average method complexity3.57
▷ Minimum method complexity1.00
▷ Maximum method complexity19.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes5
▷ Abstract classes00.00%
▷ Concrete classes5100.00%
▷ Final classes00.00%
Methods54
▷ Static methods11.85%
▷ Public methods5092.59%
▷ Protected methods00.00%
▷ Private methods47.41%
Functions4
▷ Named functions4100.00%
▷ Anonymous functions00.00%
Constants9
▷ Global constants888.89%
▷ Class constants111.11%
▷ Public constants1100.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