83% two-factor-authentication-sms-otp-security

Code Review | WP OTP - One-time password (OTP) 2FA for WordPress

WordPress plugin WP OTP - One-time password (OTP) 2FA for WordPress scored 83% from 54 tests.

About plugin

  • Plugin page: two-factor-authen...
  • Plugin version: 1.0.1
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.9-6.1
  • WordPress version: 6.3.1
  • First release: Nov 4, 2022
  • Latest release: Nov 5, 2022
  • Number of updates: 6
  • Update frequency: every 0.2 days
  • Top authors: santerref (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 191 total downloads

Benchmarks

Plugin footprint 83% 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.13MB] [CPU: ▼6.74ms] Passed 4 tests

An overview of server-side resources used by WP OTP - One-time password (OTP) 2FA for WordPress
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.59 ▲0.1340.60 ▼11.05
Dashboard /wp-admin3.43 ▲0.1348.42 ▼3.08
Posts /wp-admin/edit.php3.55 ▲0.1945.00 ▼4.67
Add New Post /wp-admin/post-new.php6.01 ▲0.1383.20 ▼8.17
Media Library /wp-admin/upload.php3.36 ▲0.1337.38 ▲2.00

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 8 new files
Database: no new tables, 9 new options
New WordPress options
widget_recent-comments
wpotp_balance
db_upgraded
widget_theysaidso_widget
can_compress_scripts
theysaidso_admin_options
widget_recent-posts
wpotp_token
wpotp_email

Browser metrics Passed 4 tests

A check of browser resources used by WP OTP - One-time password (OTP) 2FA for WordPress
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,816 ▲7013.25 ▼0.971.65 ▼0.4145.66 ▲1.37
Dashboard /wp-admin2,222 ▲344.85 ▼1.03110.69 ▼5.7143.14 ▲0.23
Posts /wp-admin/edit.php2,108 ▲162.01 ▲0.0135.30 ▼2.9132.94 ▼1.12
Add New Post /wp-admin/post-new.php1,547 ▲3323.36 ▲5.79633.76 ▼35.7169.96 ▲6.38
Media Library /wp-admin/upload.php1,398 ▲74.24 ▲0.0297.22 ▼2.9341.74 ▼1.91

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 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 detected upon uninstall: 9 options
    • widget_theysaidso_widget
    • wpotp_balance
    • wpotp_token
    • can_compress_scripts
    • wpotp_email
    • widget_recent-posts
    • db_upgraded
    • widget_recent-comments
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Everything seems fine, however this is by no means an exhaustive test

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 take a closer look at the following
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/two-factor-authentication-sms-otp-security/class-wp-otp.php:19

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine on the user side

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
Attributes that need to be fixed:
  • Tags: There are too many tags (11 tag instead of maximum 10)
Please take inspiration from this readme.txt

two-factor-authentication-sms-otp-security/wpotp.php 85% from 13 tests

Analyzing the main PHP file in "WP OTP - One-time password (OTP) 2FA for WordPress" version 1.0.1
Please make the necessary changes and fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("two-factor-authentication-sms-otp-security.php" instead of "wpotp.php")
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
No dangerous file extensions were detected780 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
PHP3104163621
JavaScript1140125
CSS16023
SVG11011

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.36
Average class complexity37.00
▷ Minimum class complexity21.00
▷ Maximum class complexity53.00
Average method complexity2.44
▷ Minimum method complexity1.00
▷ Maximum method complexity9.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods33
▷ Static methods00.00%
▷ Public methods2987.88%
▷ Protected methods412.12%
▷ Private methods00.00%
Functions3
▷ Named functions266.67%
▷ Anonymous functions133.33%
Constants2
▷ Global constants00.00%
▷ Class constants2100.00%
▷ Public constants2100.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