78% tokenizer-two-factor-authentication

Code Review | Two Factor Authentication

WordPress plugin Two Factor Authentication scored78%from 54 tests.

About plugin

  • Plugin page: tokenizer-two-fac...
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-3.6.1
  • WordPress version: 6.3.1
  • First release: Oct 31, 2014
  • Latest release: Nov 18, 2014
  • Number of updates: 16
  • Update frequency: every 1.2 days
  • Top authors: frankbroersen (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /821 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
Install script ran successfully

Server metrics [RAM: ▲0.09MB] [CPU: ▼3.29ms] Passed 4 tests

Server-side resources used by Two Factor Authentication
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.0631.19 ▼10.47
Dashboard /wp-admin3.41 ▲0.1045.97 ▼0.10
Posts /wp-admin/edit.php3.52 ▲0.1648.76 ▼3.98
Add New Post /wp-admin/post-new.php5.99 ▲0.1089.90 ▲1.39
Media Library /wp-admin/upload.php3.33 ▲0.1038.64 ▲6.39
Tokenizer Stats /wp-admin/index.php?page=tokenizer-stats-display3.2731.16
Tokenizer /wp-admin/plugins.php?page=tokenizer-key-config3.3731.34

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

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 11 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
theysaidso_admin_options
db_upgraded
widget_theysaidso_widget
widget_recent-posts
can_compress_scripts

Browser metrics Passed 4 tests

Checking browser requirements for Two Factor Authentication
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,653 ▼10413.76 ▼0.821.35 ▼0.6942.14 ▼6.70
Dashboard /wp-admin2,222 ▲374.81 ▼0.06109.78 ▼5.0039.45 ▼8.99
Posts /wp-admin/edit.php2,104 ▲122.01 ▲0.0239.56 ▲2.3736.15 ▲0.88
Add New Post /wp-admin/post-new.php1,531 ▲1223.12 ▼0.21657.59 ▲13.0060.99 ▲1.77
Media Library /wp-admin/upload.php1,401 ▲104.18 ▼0.0298.87 ▲0.5042.14 ▼0.20
Tokenizer Stats /wp-admin/index.php?page=tokenizer-stats-display7542.0526.2222.00
Tokenizer /wp-admin/plugins.php?page=tokenizer-key-config8302.0624.4130.15

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
These items require your attention
  • This plugin does not fully uninstall, leaving 6 options in the database
    • db_upgraded
    • widget_recent-comments
    • widget_recent-posts
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_theysaidso_widget

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Smoke test failed, please fix the following
    • > GET request to /wp-admin/index.php?page=tokenizer-stats-display
    • > Warning in wp-includes/class-wp-hook.php+310
    call_user_func_array() expects parameter 1 to be a valid callback, function 'tokenizer_stats_display' not found or invalid function name
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/plugins.php?page=tokenizer-key-config
    • > Notice in wp-content/plugins/tokenizer-two-factor-authentication/admin.php+87
    Undefined variable: key_status

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 fix the following
  • 2× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/tokenizer-two-factor-authentication/tokenizer.php:27
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/tokenizer-two-factor-authentication/admin.php:3

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)
There were no browser issues found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
Attributes that require attention: You can take inspiration from this readme.txt

tokenizer-two-factor-authentication/tokenizer.php 92% from 13 tests

The primary PHP file in "Two Factor Authentication" version 1.0 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 ("tokenizer-two-factor-authentication.php" instead of "tokenizer.php")

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
There were no executable files found in this plugin512 lines of code in 10 files:
LanguageFilesBlank linesComment linesLines of code
PHP10136190512

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.39
Average class complexity6.12
▷ Minimum class complexity1.00
▷ Maximum class complexity19.00
Average method complexity2.58
▷ Minimum method complexity1.00
▷ Maximum method complexity7.00
Code structure
Namespaces3
Interfaces0
Traits0
Classes8
▷ Abstract classes00.00%
▷ Concrete classes8100.00%
▷ Final classes00.00%
Methods26
▷ Static methods13.85%
▷ Public methods2284.62%
▷ Protected methods00.00%
▷ Private methods415.38%
Functions12
▷ Named functions1191.67%
▷ Anonymous functions18.33%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
PNG images were not found in this plugin