84% learnworlds-sso

Code Review | Learnworlds-SSO

WordPress plugin Learnworlds-SSO scored84%from 54 tests.

About plugin

  • Plugin page: learnworlds-sso
  • Plugin version: 1.6
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.8-6.0.1
  • WordPress version: 6.3.1
  • First release: Mar 27, 2019
  • Latest release: Jul 21, 2022
  • Number of updates: 28
  • Update frequency: every 43.5 days
  • Top authors: learnworlds (100%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active /2,035 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
This plugin's installer ran successfully

Server metrics [RAM: ▼0.64MB] [CPU: ▼15.63ms] Passed 4 tests

Analyzing server-side resources used by Learnworlds-SSO
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0539.17 ▲3.87
Dashboard /wp-admin3.34 ▲0.0445.95 ▼1.61
Posts /wp-admin/edit.php3.39 ▲0.0343.19 ▼7.29
Add New Post /wp-admin/post-new.php3.21 ▼2.6733.67 ▼55.94
Media Library /wp-admin/upload.php3.26 ▲0.0436.08 ▲2.32
Learnworlds SSO /wp-admin/options-general.php?page=options-learnworlds-sso3.2330.55

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

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 7 new files
Database: no new tables, 12 new options
New WordPress options
widget_recent-posts
widget_recent-comments
learnworlds_sso_client_id
learnworlds_sso_api_server_url
can_compress_scripts
widget_learnworlds_sso_widget
widget_theysaidso_widget
learnworlds_sso_access_token_expires_on
theysaidso_admin_options
learnworlds_sso_access_token
...

Browser metrics Passed 4 tests

An overview of browser requirements for Learnworlds-SSO
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,818 ▲6814.42 ▼0.142.06 ▲0.3843.19 ▲3.15
Dashboard /wp-admin2,199 ▲255.71 ▲0.1394.56 ▼5.7941.89 ▼2.28
Posts /wp-admin/edit.php2,104 ▲41.96 ▼0.0537.34 ▼4.1632.94 ▼1.33
Add New Post /wp-admin/post-new.php1,540 ▲1418.07 ▼4.91623.33 ▼43.7153.06 ▼6.43
Media Library /wp-admin/upload.php1,404 ▲44.19 ▼0.0096.46 ▼0.3742.99 ▼4.97
Learnworlds SSO /wp-admin/options-general.php?page=options-learnworlds-sso8452.0024.2240.75

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
It is recommended to fix the following
  • Zombie WordPress options were found after uninstall: 12 options
    • learnworlds_sso_access_token
    • learnworlds_sso_client_id
    • learnworlds_sso_client_secret
    • widget_theysaidso_widget
    • db_upgraded
    • can_compress_scripts
    • learnworlds_sso_access_token_expires_on
    • widget_recent-posts
    • learnworlds_sso_api_server_url
    • widget_recent-comments
    • ...

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 | 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
Almost there! Just fix the following items
  • 2× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/learnworlds-sso/class.learnworlds-sso-widget.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/learnworlds-sso/class.learnworlds-sso-widget.php:3

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 Passed 29 tests

readme.txt Passed 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
7 plugin tags: login, learnworlds, woocommerce, register, reset...

learnworlds-sso/learnworlds-sso.php Passed 13 tests

The principal PHP file in "Learnworlds-SSO" v. 1.6 is loaded by WordPress automatically on each request
81 characters long description:
Give your students access to their school account right from your WordPress page.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
No dangerous file extensions were detected595 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
PHP69637595

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.37
Average class complexity18.20
▷ Minimum class complexity2.00
▷ Maximum class complexity67.00
Average method complexity3.65
▷ Minimum method complexity1.00
▷ Maximum method complexity16.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes5
▷ Abstract classes00.00%
▷ Concrete classes5100.00%
▷ Final classes00.00%
Methods27
▷ Static methods311.11%
▷ Public methods27100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions13
▷ Named functions00.00%
▷ Anonymous functions13100.00%
Constants8
▷ Global constants00.00%
▷ Class constants8100.00%
▷ Public constants8100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

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