94% headless-single-sign-on

Code Review | Headless SSO Plugin for WP

WordPress plugin Headless SSO Plugin for WP scored 94% from 54 tests.

About plugin

  • Plugin page: headless-single-s...
  • Plugin version: 1.3.1
  • PHP compatiblity: 5.7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.7-5.9
  • WordPress version: 5.9.2
  • First release: May 31, 2021
  • Latest release: Mar 15, 2022
  • Number of updates: 8
  • Update frequency: every 36.4 days
  • Top authors: cyberlord92 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 351 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed successfully, without throwing any errors or notices

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

Analyzing server-side resources used by Headless SSO Plugin for WP
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.0256.77 ▼0.01
Dashboard /wp-admin3.45 ▲0.0437.16 ▼2.32
Posts /wp-admin/edit.php3.67 ▲0.0342.83 ▲4.26
Add New Post /wp-admin/post-new.php6.91 ▼0.0698.61 ▼1,165.36
Media Library /wp-admin/upload.php3.32 ▲0.0329.65 ▲3.16

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

A short overview of filesystem and database impact
This plugin was installed successfully
Filesystem: 31 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

This is an overview of browser requirements for Headless SSO Plugin for WP
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,827 ▲10416.56 ▲0.865.69 ▼0.492.29 ▼0.46
Dashboard /wp-admin2,921 ▲606.91 ▲0.74135.11 ▲3.19183.91 ▲22.32
Posts /wp-admin/edit.php2,704 ▲103.01 ▼0.2368.22 ▲0.99144.02 ▼3.58
Add New Post /wp-admin/post-new.php1,699 ▼7417.37 ▼3.69418.88 ▼44.03215.37 ▲60.47
Media Library /wp-admin/upload.php1,742 ▲476.03 ▲0.57125.94 ▼22.21212.19 ▲26.21

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
The plugin uninstalled completely, with no zombie files or tables

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Good news, no errors were detected

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please fix the following items
  • 2× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/headless-single-sign-on/headless-sso.php:20
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/headless-single-sign-on/headless-sso.php:20

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
Please fix the following attributes:
  • Tags: There are too many tags (11 tag instead of maximum 10)
You can take inspiration from this readme.txt

headless-single-sign-on/headless-sso.php 92% from 13 tests

The principal PHP file in "Headless SSO Plugin for WP" v. 1.3.1 is loaded by WordPress automatically on each request
It is important to fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("headless-single-sign-on.php" instead of "headless-sso.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Everything looks great! No dangerous files found in this plugin4,322 lines of code in 19 files:
LanguageFilesBlank linesComment linesLines of code
CSS7251983,084
PHP7176801,228
JavaScript4096
SVG1004

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.25
Average class complexity11.50
▷ Minimum class complexity3.00
▷ Maximum class complexity20.00
Average method complexity2.31
▷ Minimum method complexity1.00
▷ Maximum method complexity8.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods16
▷ Static methods00.00%
▷ Public methods16100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions19
▷ Named functions19100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
9 PNG files occupy 0.16MB with 0.05MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/sad.png18.16KB8.79KB▼ 51.62%
images/angry.png20.40KB9.65KB▼ 52.68%
images/logo.png2.84KB1.59KB▼ 44.03%
images/miniorange.png1.49KB1.34KB▼ 10.35%
images/61456.png3.64KB3.62KB▼ 0.62%