84% grassblade-xapi-sensei

Code Review | Experience API for Sensei LMS by GrassBlade

WordPress plugin Experience API for Sensei LMS by GrassBlade scored84%from 54 tests.

About plugin

  • Plugin page: grassblade-xapi-s...
  • Plugin version: 1.0
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-6.2.2
  • WordPress version: 6.3.1
  • First release: May 12, 2022
  • Latest release: Jun 5, 2023
  • Number of updates: 8
  • Update frequency: every 48.9 days
  • Top authors: liveaspankaj (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

10+ active /397 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 gracefully, with no errors

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

Analyzing server-side resources used by Experience API for Sensei LMS by GrassBlade
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0141.89 ▲3.38
Dashboard /wp-admin3.31 ▲0.0148.27 ▼4.83
Posts /wp-admin/edit.php3.37 ▲0.0147.49 ▼12.17
Add New Post /wp-admin/post-new.php5.90 ▲0.0197.13 ▼11.24
Media Library /wp-admin/upload.php3.24 ▲0.0140.21 ▼1.15
Sensei LMS /wp-admin/admin.php?page=grassblade-xapi-sensei3.2631.66
GrassBlade /wp-admin/admin.php?page=grassblade-lrs-settings3.2034.00

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

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

Browser metrics Passed 4 tests

An overview of browser requirements for Experience API for Sensei LMS by GrassBlade
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,827 ▲6614.28 ▼0.382.06 ▲0.1340.98 ▼3.07
Dashboard /wp-admin2,230 ▲535.56 ▼0.1290.73 ▼0.6983.80 ▲41.90
Posts /wp-admin/edit.php2,142 ▲391.99 ▲0.0038.68 ▲3.1534.40 ▼0.75
Add New Post /wp-admin/post-new.php1,713 ▲18522.21 ▼0.87728.20 ▲61.6853.53 ▼3.23
Media Library /wp-admin/upload.php1,441 ▲384.11 ▼0.13101.87 ▼11.2276.14 ▲29.40
Sensei LMS /wp-admin/admin.php?page=grassblade-xapi-sensei8942.0324.5835.53
GrassBlade /wp-admin/admin.php?page=grassblade-lrs-settings9231.9922.5327.62

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • Zombie WordPress options were found after uninstall: 6 options
    • theysaidso_admin_options
    • widget_recent-comments
    • db_upgraded
    • widget_recent-posts
    • can_compress_scripts
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please fix the following items
  • 4× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Warning
      include_once(ABSPATHwp-admin/includes/plugin.php): failed to open stream: No such file or directory in wp-content/plugins/grassblade-xapi-sensei/functions.php on line 35
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/grassblade-xapi-sensei/functions.php on line 35
    • > PHP Warning
      include_once(): Failed opening 'ABSPATHwp-admin/includes/plugin.php' for inclusion (include_path='.:/usr/share/php') in wp-content/plugins/grassblade-xapi-sensei/functions.php on line 35
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/grassblade-xapi-sensei/functions.php:36

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser errors were detected

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
These attributes need your attention:
  • Donate link: Please fix this invalid URI: ""
Please take inspiration from this readme.txt

grassblade-xapi-sensei/functions.php 92% from 13 tests

The main PHP file in "Experience API for Sensei LMS by GrassBlade" ver. 1.0 adds more information about the plugin and also serves as the entry point for this plugin
The following require your attention:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("grassblade-xapi-sensei.php" instead of "functions.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
No dangerous file extensions were detected655 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP216562616
JavaScript114139

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.43
Average class complexity107.00
▷ Minimum class complexity107.00
▷ Maximum class complexity107.00
Average method complexity4.53
▷ Minimum method complexity1.00
▷ Maximum method complexity19.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods30
▷ Static methods620.00%
▷ Public methods30100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants10
▷ Global constants110.00%
▷ Class constants990.00%
▷ Public constants9100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
6 PNG files occupy 0.04MB with 0.02MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
img/icon-gb.png3.43KB0.84KB▼ 75.48%
img/no.png1.01KB0.62KB▼ 39.05%
img/icon_30x30.png4.58KB1.60KB▼ 65.15%
img/gb_logo.png3.43KB0.84KB▼ 75.48%
img/check.png0.98KB0.47KB▼ 52.44%