78% grassblade-xapi-learnpress

Code Review | Experience API for LearnPress by GrassBlade

WordPress plugin Experience API for LearnPress by GrassBlade scored78%from 54 tests.

About plugin

  • Plugin page: grassblade-xapi-l...
  • Plugin version: 4.4
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-6.2.2
  • WordPress version: 6.3.1
  • First release: Sep 26, 2019
  • Latest release: Jun 5, 2023
  • Number of updates: 30
  • Update frequency: every 45.0 days
  • Top authors: liveaspankaj (100%)

Code review

54 tests

User reviews

1 review

Install metrics

200+ active /7,978 total downloads

Benchmarks

Plugin footprint 82% 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 gracefully, with no errors

Server metrics [RAM: ▲0.33MB] [CPU: ▼4.32ms] 75% from 4 tests

Analyzing server-side resources used by Experience API for LearnPress by GrassBlade
Please take the time to fix the following items
  • CPU: Try to keep total CPU usage under 500.00ms (currently 5,053.38ms on /wp-admin/admin.php?page=grassblade-addons)
PageMemory (MB)CPU Time (ms)
Home /3.79 ▲0.3254.22 ▲10.67
Dashboard /wp-admin3.64 ▲0.3350.46 ▼11.35
Posts /wp-admin/edit.php3.75 ▲0.3956.84 ▲2.20
Add New Post /wp-admin/post-new.php6.22 ▲0.3392.55 ▼11.63
Media Library /wp-admin/upload.php3.56 ▲0.3339.64 ▲3.51
Add-ons /wp-admin/admin.php?page=grassblade-addons3.845,053.38
LearnPress LMS /wp-admin/admin.php?page=grassblade-learnpress3.5437.33
GrassBlade /wp-admin/admin.php?page=grassblade-lrs-settings3.5433.88

Server storage [IO: ▲0.10MB] [DB: ▲0.03MB] Passed 3 tests

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 10 new files
Database: no new tables, 8 new options
New WordPress options
db_upgraded
widget_theysaidso_widget
can_compress_scripts
widget_recent-comments
theysaidso_admin_options
grassblade_addons
widget_recent-posts
grassblade_free_addons

Browser metrics Passed 4 tests

An overview of browser requirements for Experience API for LearnPress by GrassBlade
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,854 ▲9314.31 ▼0.352.11 ▲0.4042.49 ▼0.29
Dashboard /wp-admin2,232 ▲615.60 ▲0.0292.02 ▼10.9170.39 ▲23.86
Posts /wp-admin/edit.php2,147 ▲472.06 ▲0.0538.43 ▲2.6234.74 ▼2.52
Add New Post /wp-admin/post-new.php1,570 ▲4423.13 ▼0.60687.80 ▲37.6050.85 ▲2.12
Media Library /wp-admin/upload.php1,434 ▲404.26 ▼0.04101.13 ▼1.1972.73 ▲28.81
Add-ons /wp-admin/admin.php?page=grassblade-addons2,8322.1933.3477.62
LearnPress LMS /wp-admin/admin.php?page=grassblade-learnpress9122.1324.6439.70
GrassBlade /wp-admin/admin.php?page=grassblade-lrs-settings9222.1426.6134.64

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
These items require your attention
  • Zombie WordPress options were found after uninstall: 8 options
    • theysaidso_admin_options
    • grassblade_free_addons
    • can_compress_scripts
    • widget_recent-comments
    • widget_recent-posts
    • grassblade_addons
    • db_upgraded
    • widget_theysaidso_widget

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Please fix the following server-side errors
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=grassblade-lrs-settings
    • > Notice in wp-content/plugins/grassblade-xapi-learnpress/functions.php+124
    Undefined variable: xapi_td

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
The following issues need your attention
  • 3× 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-learnpress/functions.php on line 17
    • > 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-learnpress/functions.php on line 17
    • > PHP Warning
      include_once(): Failed opening 'ABSPATHwp-admin/includes/plugin.php' for inclusion (include_path='.:/usr/share/php') in wp-content/plugins/grassblade-xapi-learnpress/functions.php on line 17

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser errors were detected

Optimizations

Plugin configuration 93% 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 need to be fixed:
  • Donate link: Invalid URI ("")
The official readme.txt is a good inspiration

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

"Experience API for LearnPress by GrassBlade" version 4.4's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
It is important to fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("grassblade-xapi-learnpress.php" instead of "functions.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
No dangerous file extensions were detected1,317 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP22941001,317

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.48
Average class complexity139.00
▷ Minimum class complexity116.00
▷ Maximum class complexity162.00
Average method complexity6.30
▷ Minimum method complexity1.00
▷ Maximum method complexity36.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods51
▷ Static methods59.80%
▷ Public methods51100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions1
▷ Named functions00.00%
▷ Anonymous functions1100.00%
Constants1
▷ Global constants1100.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
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/check.png0.98KB0.47KB▼ 52.44%
img/icon_30x30.png4.58KB1.60KB▼ 65.15%
img/gb_logo.png3.43KB0.84KB▼ 75.48%
img/icon_128x128.png22.67KB6.87KB▼ 69.71%
img/icon-gb.png3.43KB0.84KB▼ 75.48%