94% wp-2-step

Code Review | WP 2 Step Authentication

WordPress plugin WP 2 Step Authentication scored 94% from 54 tests.

About plugin

  • Plugin page: wp-2-step
  • Plugin version: 1.5
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-3.9
  • WordPress version: 5.8.1
  • First release: Apr 15, 2014
  • Latest release: Apr 22, 2014
  • Number of updates: 12
  • Update frequency: every 0.7 days
  • Top authors: Scriptonite (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 1,021 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed gracefully, with no errors

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

Server-side resources used by WP 2 Step Authentication
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /2.93 ▲0.0935.71 ▼2.22
Dashboard /wp-admin3.15 ▲0.1048.57 ▼2.64
Posts /wp-admin/edit.php3.20 ▲0.1044.78 ▼4.72
Add New Post /wp-admin/post-new.php5.51 ▲0.0895.25 ▼559.93
Media Library /wp-admin/upload.php3.09 ▲0.0932.32 ▼7.97
WP 2 Step /wp-admin/options-general.php?page=wp2step-settings3.0633.53

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 3 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

This is an overview of browser requirements for WP 2 Step Authentication
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,701 ▲10515.78 ▲0.178.74 ▼2.8544.18 ▼1.84
Dashboard /wp-admin2,969 ▲356.10 ▼0.12156.78 ▼10.01114.99 ▼2.07
Posts /wp-admin/edit.php2,744 ▲52.70 ▲0.0077.37 ▲11.8789.31 ▲7.32
Add New Post /wp-admin/post-new.php1,686 ▼1,97518.26 ▼0.18452.51 ▼17.85124.08 ▲17.40
Media Library /wp-admin/upload.php1,812 ▲55.04 ▲0.01146.99 ▼3.56115.33 ▼1.30
WP 2 Step /wp-admin/options-general.php?page=wp2step-settings1,4442.0956.5398.06

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Uninstall script ran successfully

Smoke tests 75% 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 50% 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
The following issues need your attention
  • 2× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/wp-2-step/wp2step.php:27
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp-2-step/includes/functions.php:927

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% 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:
  • Plugin Name: Write the name of your plugin instead of "Plugin Name" on the first line ( === wp-2-step === )
Please take inspiration from this readme.txt

wp-2-step/wp2step.php 92% from 13 tests

This is the main PHP file of "WP 2 Step Authentication" version 1.5, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
Please make the necessary changes and fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("wp-2-step.php" instead of "wp2step.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Everything looks great! No dangerous files found in this plugin731 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP220915731

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.42
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%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
PNG images were not found in this plugin