83% vonage-2fa

Code Review | Vonage 2FA

WordPress plugin Vonage 2FA scored83%from 54 tests.

About plugin

  • Plugin page: vonage-2fa
  • Plugin version: 1.0.2
  • PHP compatiblity: 8.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.7-5.9.2
  • WordPress version: 6.3.1
  • First release: Mar 29, 2022
  • Latest release: Jun 13, 2022
  • Number of updates: 5
  • Update frequency: every 16.2 days
  • Top authors: jimseconde (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /302 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Installer ran successfully

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

A check of server-side resources used by Vonage 2FA
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.52 ▲0.0637.64 ▼2.06
Dashboard /wp-admin3.36 ▲0.0245.22 ▼14.68
Posts /wp-admin/edit.php3.41 ▲0.0647.25 ▼5.92
Add New Post /wp-admin/post-new.php5.94 ▲0.0589.40 ▼5.48
Media Library /wp-admin/upload.php3.28 ▲0.0636.86 ▲4.08

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

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

Browser metrics Passed 4 tests

This is an overview of browser requirements for Vonage 2FA
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,843 ▲7214.75 ▲0.161.88 ▼0.0944.64 ▲0.60
Dashboard /wp-admin2,246 ▲556.05 ▲1.15109.42 ▲4.4742.92 ▼0.47
Posts /wp-admin/edit.php2,135 ▲462.03 ▲0.0141.58 ▲2.6035.54 ▲0.27
Add New Post /wp-admin/post-new.php1,546 ▲3223.04 ▲5.26669.85 ▼26.8664.33 ▲8.71
Media Library /wp-admin/upload.php1,435 ▲504.23 ▼0.01104.49 ▲2.1345.85 ▲3.09

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
You still need to fix the following
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-posts
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-comments
    • db_upgraded
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
The smoke test was a success, however most plugin functionality was not tested

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
The following issues need your attention
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/vonage-2fa/vonage2fa.php:304

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser issues were found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% 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:
  • Screenshots: A description for screenshot #4 is missing in vonage-2fa/assets to your readme.txt
  • Plugin Name: "Plugin Name" should be replaced with the name of your plugin on the first line ( === vonage-2fa === )
You can take inspiration from this readme.txt

vonage-2fa/vonage2fa.php 92% from 13 tests

The main PHP file in "Vonage 2FA" ver. 1.0.2 adds more information about the plugin and also serves as the entry point for this plugin
You should first fix the following items:
  • Main file name: The principal plugin file should be the same as the plugin slug ("vonage-2fa.php" instead of "vonage2fa.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
There were no executable files found in this plugin288 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP15614241
Markdown117032
SVG11015

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.28
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
Namespaces0
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%
Functions13
▷ Named functions13100.00%
▷ Anonymous functions00.00%
Constants7
▷ Global constants114.29%
▷ Class constants685.71%
▷ Public constants6100.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
7 PNG files occupy 0.22MB with 0.15MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/admin-menu.png67.61KB21.66KB▼ 67.96%
assets/vonage-api-screenshot.png29.99KB11.30KB▼ 62.33%
assets/vonage-login-pin.png20.12KB5.91KB▼ 70.62%
assets/vonage-user-settings.png37.20KB11.79KB▼ 68.31%
assets/vonagexwordpress.png37.50KB13.16KB▼ 64.91%