10% openotp-authentication

Code Review | OpenOTP Two-Factor Authentication

WordPress plugin OpenOTP Two-Factor Authentication scored10%from 54 tests.

About plugin

  • Plugin page: openotp-authentic...
  • Plugin version: 1.2.4
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-4.6
  • WordPress version: 6.3.1
  • First release: Oct 14, 2013
  • Latest release: Nov 14, 2016
  • Number of updates: 16
  • Update frequency: every 70.6 days
  • Top authors: rcdevs (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

10+ active /2,716 total downloads

Benchmarks

Plugin footprint 58% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
It is recommended to fix the following installer errors
  • Install procedure had errors
    • > Error in wp-content/plugins/openotp-authentication/openotp.class.php+234
    Uncaught Error: Class 'SoapClient' not found in wp-content/plugins/openotp-authentication/openotp.class.php:234
    Stack trace:
    #0 wp-content/plugins/openotp-authentication/openotp.php(104): require()
    #1 wp-content/plugins/openotp-authentication/openotp.php(89): OpenOTP_auth->setup()
    #2 wp-content/plugins/openotp-authentication/openotp.php(730): OpenOTP_auth::instance()
    #3 wp-admin/includes/plugin.php(2318): include_once('/var/www/wordpr...')
    #4 wp-admin/includes/plugin.php(663): plugin_sandbox_scrape()

Server metrics [RAM: ▲0.00MB] [CPU: ▼0.78ms] Passed 4 tests

Server-side resources used by OpenOTP Two-Factor Authentication
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0037.89 ▼0.64
Dashboard /wp-admin3.31 ▲0.0047.06 ▼1.79
Posts /wp-admin/edit.php3.36 ▲0.0047.18 ▲2.85
Add New Post /wp-admin/post-new.php5.89 ▲0.0084.53 ▼3.37
Media Library /wp-admin/upload.php3.23 ▲0.0036.71 ▲2.70

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

Filesystem and database footprint
This plugin installed successfully
Filesystem: 12 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
widget_recent-comments
widget_recent-posts
can_compress_scripts
db_upgraded
widget_theysaidso_widget

Browser metrics Passed 4 tests

This is an overview of browser requirements for OpenOTP Two-Factor Authentication
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲6513.21 ▼1.171.58 ▼0.0540.10 ▼1.60
Dashboard /wp-admin2,203 ▲126.01 ▲1.1598.82 ▼5.5839.17 ▲0.88
Posts /wp-admin/edit.php2,089 ▼01.99 ▼0.0440.14 ▲6.3835.08 ▼0.15
Add New Post /wp-admin/post-new.php1,528 ▲1423.46 ▲5.55651.59 ▲48.7651.53 ▲1.70
Media Library /wp-admin/upload.php1,391 ▲64.24 ▼0.0693.85 ▼6.9143.21 ▲0.55

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
These items require your attention
  • This plugin does not fully uninstall, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_recent-comments
    • can_compress_scripts
    • db_upgraded
    • widget_recent-posts
    • widget_theysaidso_widget

Smoke tests 75% 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 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
The following issues need your attention
  • 2× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Class 'SoapClient' not found in wp-content/plugins/openotp-authentication/openotp.class.php:234
    • > PHP Fatal error
      Uncaught Error: Class 'SoapClient' not found in wp-content/plugins/openotp-authentication/openotp.class.php:234

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
There were no browser issues found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 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
8 plugin tags: password, login, authenticator, username, rcdevs...

openotp-authentication/openotp.php 85% from 13 tests

The entry point to "OpenOTP Two-Factor Authentication" version 1.2.4 is a PHP file that has certain tags in its header comment area
You should first fix the following items:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("openotp-authentication.php" instead of "openotp.php")
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug

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
Success! There were no dangerous files found in this plugin1,290 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
PHP3155136710
JavaScript2110337468
XML1122112

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.29
Average class complexity29.67
▷ Minimum class complexity4.00
▷ Maximum class complexity72.00
Average method complexity2.79
▷ Minimum method complexity1.00
▷ Maximum method complexity27.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods48
▷ Static methods24.17%
▷ Public methods4083.33%
▷ Protected methods510.42%
▷ Private methods36.25%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
5 PNG files occupy 0.36MB with 0.18MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png248.74KB109.25KB▼ 56.08%
u2f.png17.18KB5.30KB▼ 69.17%
openotp_banner.png26.84KB17.79KB▼ 33.73%
openotp_closebtn.png2.03KB1.31KB▼ 35.62%
screenshot-2.png75.04KB38.18KB▼ 49.12%