84% senpai-software-2fa

Code Review | Senpai Software - Two-factor authentication (2FA) with a key file

WordPress plugin Senpai Software - Two-factor authentication (2FA) with a key file scored84%from 54 tests.

About plugin

  • Plugin page: senpai-software-2fa
  • Plugin version: 2.0.1
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.3
  • WordPress version: 6.3.1
  • First release: Mar 22, 2023
  • Latest release: Oct 11, 2023
  • Number of updates: 14
  • Update frequency: every 14.5 days
  • Top authors: senpaisoftware (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

10+ active /375 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.07MB] [CPU: ▼7.04ms] Passed 4 tests

This is a short check of server-side resources used by Senpai Software - Two-factor authentication (2FA) with a key file
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.52 ▲0.0638.64 ▼0.95
Dashboard /wp-admin3.40 ▲0.0546.57 ▼8.23
Posts /wp-admin/edit.php3.45 ▲0.0949.43 ▲1.16
Add New Post /wp-admin/post-new.php6.00 ▲0.1184.51 ▼20.14
Media Library /wp-admin/upload.php3.33 ▲0.0939.29 ▲3.27
2FA Settings /wp-admin/options-general.php?page=snp_2fa3.2933.89

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 14 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
db_upgraded
widget_theysaidso_widget
widget_recent-comments
theysaidso_admin_options
widget_recent-posts

Browser metrics Passed 4 tests

This is an overview of browser requirements for Senpai Software - Two-factor authentication (2FA) with a key file
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,865 ▲11914.26 ▼0.091.78 ▼0.2530.31 ▼10.29
Dashboard /wp-admin2,203 ▲235.63 ▼0.0282.78 ▼4.2837.52 ▼3.15
Posts /wp-admin/edit.php2,108 ▲82.03 ▲0.0738.92 ▲2.7136.48 ▲3.84
Add New Post /wp-admin/post-new.php1,533 ▲723.48 ▲0.46677.90 ▼13.9558.27 ▼2.81
Media Library /wp-admin/upload.php1,408 ▲114.18 ▼0.18104.40 ▲3.9041.83 ▼0.66
2FA Settings /wp-admin/options-general.php?page=snp_2fa8762.0022.8125.48

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • db_upgraded
    • widget_recent-posts
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-comments
    • theysaidso_admin_options

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)
Even though everything seems fine, this is not an exhaustive test

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
  • 2× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function SenpaiSoftware2FA\\add_action() in wp-content/plugins/senpai-software-2fa/admin/senpai-software-2fa-admin.php:17
    • > PHP Fatal error
      Uncaught Error: Call to undefined function SenpaiSoftware2FA\\add_action() in wp-content/plugins/senpai-software-2fa/senpai-software-2fa-core.php:17

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
8 plugin tags: 2fa, two factor authentication, brute force, disable xml-rpc, senpai software...

senpai-software-2fa/senpai-software-2fa.php Passed 13 tests

This is the main PHP file of "Senpai Software - Two-factor authentication (2FA) with a key file" version 2.0.1, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
115 characters long description:
Unique method two-factor auth (2FA). Limit Login Attempts. Disable XML-RPC. Protection against brute force attacks.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Success! There were no dangerous files found in this plugin493 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code
PHP49079362
PO File1141453
JavaScript1111952
CSS14026

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.22
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions15
▷ Named functions15100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
There were not PNG files found in your plugin