83% token2-hardware-tokens

Code Review | Token2 Hardware Tokens

WordPress plugin Token2 Hardware Tokens scored83%from 54 tests.

About plugin

  • Plugin page: token2-hardware-t...
  • Plugin version: 0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.8-4.9.4
  • WordPress version: 6.3.1
  • First release: Jul 21, 2015
  • Latest release: Mar 22, 2018
  • Number of updates: 7
  • Update frequency: every 140.0 days
  • Top authors: token2 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /951 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.02MB] [CPU: ▼4.07ms] Passed 4 tests

This is a short check of server-side resources used by Token2 Hardware Tokens
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0241.46 ▼2.07
Dashboard /wp-admin3.32 ▲0.0245.90 ▼0.39
Posts /wp-admin/edit.php3.37 ▲0.0146.79 ▼3.48
Add New Post /wp-admin/post-new.php5.92 ▲0.0383.71 ▼10.35
Media Library /wp-admin/upload.php3.24 ▲0.0135.91 ▼0.12

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

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

Browser metrics Passed 4 tests

An overview of browser requirements for Token2 Hardware Tokens
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,817 ▲4613.20 ▼1.121.78 ▼0.5943.32 ▲2.46
Dashboard /wp-admin2,211 ▲235.86 ▲0.9596.11 ▼17.2140.36 ▼2.46
Posts /wp-admin/edit.php2,091 ▼52.02 ▼0.0336.62 ▼4.7137.76 ▲5.18
Add New Post /wp-admin/post-new.php1,540 ▲1718.39 ▼4.78607.01 ▼83.3753.67 ▼8.40
Media Library /wp-admin/upload.php1,393 ▲24.23 ▲0.03100.70 ▼1.6042.56 ▲0.44

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
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-comments
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-posts

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
Good news, no errors were detected

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
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/token2-hardware-tokens/google-authenticator.php:55

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
There were no browser issues found

Optimizations

Plugin configuration 83% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
These attributes need to be fixed:
  • Screenshots: Add images for these screenshots: #1 (Token2 Hardware Tokens section on the Profile and Personal options page.), #2 (The login form with second factor field.)
  • Tags: You are using too many tags: 14 tag instead of maximum 10
You can look at the official readme.txt

token2-hardware-tokens/google-authenticator.php 77% from 13 tests

The principal PHP file in "Token2 Hardware Tokens" v. 0.1 is loaded by WordPress automatically on each request
Please take the time to fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("token2-hardware-tokens.php" instead of "google-authenticator.php")
  • Description: Keep the plugin description shorter than 140 characters (currently 190 characters long)
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Everything looks great! No dangerous files found in this plugin801 lines of code in 8 files:
LanguageFilesBlank linesComment linesLines of code
PHP2110142398
PO File5112137375
JavaScript10028

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.23
Average class complexity27.00
▷ Minimum class complexity21.00
▷ Maximum class complexity33.00
Average method complexity4.47
▷ Minimum method complexity1.00
▷ Maximum method complexity12.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods15
▷ Static methods213.33%
▷ Public methods15100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
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
2 PNG files occupy 0.17MB with 0.14MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-2.png70.89KB9.22KB▼ 86.99%
screenshot-1.png99.76KB13.86KB▼ 86.11%