72% saaspass-two-factor-authentication-2fa

Code Review | SAASPASS Two Factor Authentication - 2FA

WordPress plugin SAASPASS Two Factor Authentication - 2FA scored 72% from 54 tests.

About plugin

  • Plugin page: saaspass-two-fact...
  • Plugin version: 1.0.4
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0.0-4.9.8
  • WordPress version: 6.3.1
  • First release: May 2, 2017
  • Latest release: Aug 27, 2018
  • Number of updates: 7
  • Update frequency: every 69.6 days
  • Top authors: saaspass (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 907 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.22MB] [CPU: ▼3.35ms] Passed 4 tests

Analyzing server-side resources used by SAASPASS Two Factor Authentication - 2FA
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.68 ▲0.2240.48 ▲1.94
Dashboard /wp-admin3.53 ▲0.2246.47 ▼3.25
Posts /wp-admin/edit.php3.64 ▲0.2847.74 ▲3.20
Add New Post /wp-admin/post-new.php6.11 ▲0.2285.39 ▼12.06
Media Library /wp-admin/upload.php3.45 ▲0.2236.43 ▼0.02

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

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 486 new files
Database: no new tables, 7 new options
New WordPress options
db_upgraded
saaspass_saml_options
widget_theysaidso_widget
widget_recent-posts
theysaidso_admin_options
widget_recent-comments
can_compress_scripts

Browser metrics Passed 4 tests

SAASPASS Two Factor Authentication - 2FA: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲6913.65 ▼0.531.74 ▲0.1141.32 ▼5.07
Dashboard /wp-admin2,204 ▲525.83 ▲0.1397.70 ▼11.1637.59 ▼2.91
Posts /wp-admin/edit.php2,093 ▲222.04 ▼0.0136.27 ▼4.0730.08 ▼8.85
Add New Post /wp-admin/post-new.php1,531 ▲318.60 ▲0.19637.86 ▼31.2050.07 ▼24.39
Media Library /wp-admin/upload.php1,395 ▲74.17 ▼0.0497.34 ▼11.0541.99 ▼3.02
SAASPASS Two Factor Authentication - 2FA /wp-admin/sso_general.php260.440.0615.10

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • widget_recent-posts
    • widget_recent-comments
    • can_compress_scripts
    • widget_theysaidso_widget
    • saaspass_saml_options
    • db_upgraded
    • theysaidso_admin_options

Smoke tests 25% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 0% 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
Please fix the following
  • 5× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/saaspass-two-factor-authentication-2fa/saml/bin/pwgen.php
    • > /wp-content/plugins/saaspass-two-factor-authentication-2fa/saml/bin/initMDSPdo.php
    • > /wp-content/plugins/saaspass-two-factor-authentication-2fa/saml/templates/includes/header-embed.php
    • > /wp-content/plugins/saaspass-two-factor-authentication-2fa/saml/bin/translation.php
    • > /wp-content/plugins/saaspass-two-factor-authentication-2fa/saml/bin/memcacheSync.php
  • 3× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/saaspass-two-factor-authentication-2fa/saml/templates/login.php:2
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/saaspass-two-factor-authentication-2fa/saml/templates/login-ldapmulti.php:2
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/saaspass-two-factor-authentication-2fa/saml/templates/post.php:14

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Please fix the following user-side errors
    • > GET request to /wp-admin/sso_general.php
    • > Network (severe)
    wp-admin/sso_general.php - Failed to load resource: the server responded with a status of 404 (Not Found)

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
Attributes that need to be fixed:
  • Tags: You are using too many tags: 38 tag instead of maximum 10
The official readme.txt is a good inspiration

saaspass-two-factor-authentication-2fa/saaspass_samlauth.php 92% from 13 tests

The main PHP script in "SAASPASS Two Factor Authentication - 2FA" version 1.0.4 is automatically included on every request by WordPress
Please make the necessary changes and fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("saaspass-two-factor-authentication-2fa.php" instead of "saaspass_samlauth.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
No dangerous file extensions were detected41,103 lines of code in 453 files:
LanguageFilesBlank linesComment linesLines of code
PHP3617,24615,15526,474
JSON23409,294
XSD3537504,303
Markdown81360415
XML191426306
Ant1213125
Perl115483
Bourne Shell116258
YAML411045

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.38
Average class complexity12.84
▷ Minimum class complexity1.00
▷ Maximum class complexity153.00
Average method complexity3.27
▷ Minimum method complexity1.00
▷ Maximum method complexity53.00
Code structure
Namespaces9
Interfaces18
Traits2
Classes248
▷ Abstract classes197.66%
▷ Concrete classes22992.34%
▷ Final classes20.87%
Methods1,452
▷ Static methods37525.83%
▷ Public methods1,22484.30%
▷ Protected methods392.69%
▷ Private methods18913.02%
Functions25
▷ Named functions1768.00%
▷ Anonymous functions832.00%
Constants163
▷ Global constants148.59%
▷ Class constants14991.41%
▷ Public constants149100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
1 compressed PNG file occupies 0.00MB
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
lib/classes/img/button.png1.69KB1.65KB▼ 2.71%