78% wordpress-2-step-verification

Code Review | Wordpress 2-step verification

WordPress plugin Wordpress 2-step verification scored78%from 54 tests.

About plugin

  • Plugin page: wordpress-2-step-...
  • Plugin version: 2.6.0
  • PHP compatiblity: 5.6.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.5-6.4.1
  • WordPress version: 6.3.1
  • First release: Aug 10, 2012
  • Latest release: Nov 28, 2023
  • Number of updates: 190
  • Update frequency: every 21.7 days
  • Top authors: as247 (100%)

Code review

54 tests

User reviews

26 reviews

Install metrics

2,000+ active /58,862 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
This plugin's installer ran successfully

Server metrics [RAM: ▲0.43MB] [CPU: ▼8.22ms] Passed 4 tests

Server-side resources used by Wordpress 2-step verification
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.87 ▲0.4038.26 ▼9.19
Dashboard /wp-admin3.76 ▲0.4148.54 ▼15.82
Posts /wp-admin/edit.php3.81 ▲0.4552.83 ▲1.84
Add New Post /wp-admin/post-new.php6.36 ▲0.4792.03 ▼9.70
Media Library /wp-admin/upload.php3.68 ▲0.4537.95 ▲2.36

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

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 114 new files
Database: no new tables, 7 new options
New WordPress options
widget_theysaidso_widget
db_upgraded
widget_recent-comments
can_compress_scripts
theysaidso_admin_options
widget_recent-posts
woocommerce_queue_flush_rewrite_rules

Browser metrics Passed 4 tests

A check of browser resources used by Wordpress 2-step verification
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲3214.22 ▼0.021.62 ▼0.2936.34 ▼7.14
Dashboard /wp-admin2,206 ▲325.63 ▼0.0293.02 ▼9.1037.80 ▼6.60
Posts /wp-admin/edit.php2,111 ▲141.94 ▼0.0740.85 ▲3.6936.30 ▲2.37
Add New Post /wp-admin/post-new.php1,535 ▲923.56 ▲0.38596.04 ▼52.6850.33 ▲3.99
Media Library /wp-admin/upload.php1,411 ▲144.24 ▼0.0595.63 ▼2.5042.20 ▲0.20

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
These items require your attention
  • This plugin does not fully uninstall, leaving 7 options in the database
    • db_upgraded
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-posts
    • theysaidso_admin_options
    • woocommerce_queue_flush_rewrite_rules
    • widget_recent-comments

Smoke tests 50% 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)
Good news, no errors were detected

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 items
  • 1× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/wordpress-2-step-verification/template/front/form-others.php
  • 25× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/wordpress-2-step-verification/template/setup/backup-codes-txt.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'Wp2sv_Session_Tokens_Abstract' not found in wp-content/plugins/wordpress-2-step-verification/includes/Wp2sv_Session_Tokens.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'Wp2sv_Abstract' not found in wp-content/plugins/wordpress-2-step-verification/includes/Wp2sv_Base.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'Wp2sv_Abstract' not found in wp-content/plugins/wordpress-2-step-verification/includes/Wp2sv_Admin.php:3
    • > PHP Notice
      Undefined variable: have_backup_codes in wp-content/plugins/wordpress-2-step-verification/template/front/form-others.php on line 45
    • > PHP Fatal error
      Uncaught Error: Class 'Wp2sv_Base' not found in wp-content/plugins/wordpress-2-step-verification/includes/Wp2sv_Force.php:3
    • > PHP Notice
      Undefined variable: can_recovery in wp-content/plugins/wordpress-2-step-verification/template/front/form-others.php on line 56
    • > PHP Fatal error
      Uncaught Error: Call to undefined function do_action() in wp-content/plugins/wordpress-2-step-verification/template/setup/index.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'Wp2sv_Base' not found in wp-content/plugins/wordpress-2-step-verification/includes/Wp2sv_Backup_Code.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/wordpress-2-step-verification/template/setup/force-notice.php:11

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
Please fix the following attributes:
  • Tags: Please delete some tags, you are using 35 tag instead of maximum 10
Please take inspiration from this readme.txt

wordpress-2-step-verification/wordpress-2-step-verification.php 85% from 13 tests

The primary PHP file in "Wordpress 2-step verification" version 2.6.0 is used by WordPress to initiate all plugin functionality
The following require your attention:
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 250 characters long)
  • Requires PHP: Required version does not match the one declared in readme.txt ("7.3" instead of "5.6.0")

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
No dangerous file extensions were detected17,802 lines of code in 86 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript123972,21111,731
PHP363106683,184
LESS191321241,549
Vuejs Component138081,319
JSON20015
CSS4004

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.30
Average class complexity13.56
▷ Minimum class complexity1.00
▷ Maximum class complexity47.00
Average method complexity2.19
▷ Minimum method complexity1.00
▷ Maximum method complexity12.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes27
▷ Abstract classes27.41%
▷ Concrete classes2592.59%
▷ Final classes00.00%
Methods288
▷ Static methods124.17%
▷ Public methods21976.04%
▷ Protected methods6723.26%
▷ Private methods20.69%
Functions34
▷ Named functions1338.24%
▷ Anonymous functions2161.76%
Constants11
▷ Global constants11100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
19 PNG files occupy 0.39MB with 0.14MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
public/assets/images/close-x.png0.28KB0.39KB0.00%
resources/images/email.png4.36KB1.63KB▼ 62.53%
public/assets/images/all.png42.76KB17.31KB▼ 59.51%
resources/images/all.png42.76KB17.31KB▼ 59.51%
resources/images/arrow_right_2x.png0.15KB0.26KB0.00%