84% two-factor-auth-for-woocommerce

Code Review | Two Factor Auth for WooCommerce

WordPress plugin Two Factor Auth for WooCommerce scored84%from 54 tests.

About plugin

  • Plugin page: two-factor-auth-f...
  • Plugin version: 1.0.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.1.0-3.7
  • WordPress version: 6.3.1
  • First release: Jul 4, 2013
  • Latest release: Oct 25, 2013
  • Number of updates: 10
  • Update frequency: every 11.4 days
  • Top authors: oskarhane (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /953 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
The plugin installed gracefully, with no errors

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

A check of server-side resources used by Two Factor Auth for WooCommerce
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0036.64 ▼2.54
Dashboard /wp-admin3.31 ▲0.0056.87 ▲8.48
Posts /wp-admin/edit.php3.36 ▲0.0049.88 ▼4.61
Add New Post /wp-admin/post-new.php5.89 ▲0.0097.12 ▼15.78
Media Library /wp-admin/upload.php3.23 ▲0.0034.03 ▼0.32

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

Analyzing filesystem and database footprints of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 3 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
widget_recent-posts
can_compress_scripts
db_upgraded
widget_recent-comments
theysaidso_admin_options

Browser metrics Passed 4 tests

A check of browser resources used by Two Factor Auth for WooCommerce
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲4313.28 ▼1.111.67 ▼0.4740.73 ▼6.49
Dashboard /wp-admin2,206 ▲154.85 ▼0.04108.00 ▲3.1745.71 ▲0.91
Posts /wp-admin/edit.php2,086 ▼31.99 ▼0.0439.64 ▼1.7734.59 ▼4.62
Add New Post /wp-admin/post-new.php1,542 ▲2818.60 ▲1.19601.57 ▼85.3355.66 ▲1.39
Media Library /wp-admin/upload.php1,388 ▲34.22 ▲0.0198.58 ▼3.4845.56 ▲0.03

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-comments
    • widget_recent-posts
    • db_upgraded

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
Please take a closer look at the following
  • 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/two-factor-auth-for-woocommerce/tfa-woocommerce.php:27

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
9 plugin tags: hacking, secure, security plugin, security, login...

two-factor-auth-for-woocommerce/tfa-woocommerce.php 92% from 13 tests

The primary PHP file in "Two Factor Auth for WooCommerce" version 1.0.2 is used by WordPress to initiate all plugin functionality
It is important to fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("two-factor-auth-for-woocommerce.php" instead of "tfa-woocommerce.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Good job! No executable or dangerous file extensions detected82 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript115557
PHP16825

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.33
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%
Functions2
▷ Named functions2100.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
No PNG images were found in this plugin