10% wp-2-stage-login

Code Review | WP 2-Stage Login

WordPress plugin WP 2-Stage Login scored10%from 54 tests.

About plugin

  • Plugin page: wp-2-stage-login
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-3.5
  • WordPress version: 6.3.1
  • First release: Aug 25, 2013
  • Latest release: Sep 3, 2013
  • Number of updates: 12
  • Update frequency: every 0.9 days
  • Top authors: debobrata (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /795 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
It is recommended to fix the following installer errors
  • The plugin did not install without errors
    • > Deprecated in wp-content/plugins/wp-2-stage-login/plugin-functions.php+63
    Array and string offset access syntax with curly braces is deprecated

Server metrics [RAM: ▼1.87MB] [CPU: ▼61.39ms] Passed 4 tests

Analyzing server-side resources used by WP 2-Stage Login
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /2.11 ▼1.355.33 ▼41.45
Dashboard /wp-admin2.13 ▼1.176.06 ▼45.69
Posts /wp-admin/edit.php2.13 ▼1.226.49 ▼44.70
Add New Post /wp-admin/post-new.php2.13 ▼3.756.04 ▼113.73
Media Library /wp-admin/upload.php2.13 ▼1.096.32 ▼32.24

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

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 61 new files
Database: no new tables, 11 new options
New WordPress options
wp2sl_gl_page_id
can_compress_scripts
_wp2sl_glogin_form_template
widget_theysaidso_widget
widget_recent-comments
wp2sl_gl_page_slug
theysaidso_admin_options
_wp2sl_gl_page_bg
db_upgraded
_wp2sl_gl_page_logo
...

Browser metrics Passed 4 tests

An overview of browser requirements for WP 2-Stage Login
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,942 ▲19613.49 ▼1.0710.30 ▲8.4944.46 ▼2.91
Dashboard /wp-admin2,227 ▲475.66 ▲0.0493.32 ▲3.4568.15 ▲24.34
Posts /wp-admin/edit.php2,135 ▲352.14 ▲0.1741.61 ▲3.6134.93 ▲1.28
Add New Post /wp-admin/post-new.php1,712 ▲18622.40 ▼1.11713.90 ▲38.2264.67 ▲1.97
Media Library /wp-admin/upload.php1,423 ▲234.24 ▲0.04104.08 ▲0.8271.37 ▲30.77

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
The following items require your attention
  • The plugin did not uninstall gracefully
    • > Deprecated in wp-content/plugins/wp-2-stage-login/plugin-functions.php+63
    Array and string offset access syntax with curly braces is deprecated
  • This plugin did not uninstall successfully, leaving 11 options in the database
    • can_compress_scripts
    • _wp2sl_gl_page_logo
    • theysaidso_admin_options
    • db_upgraded
    • wp2sl_gl_page_id
    • widget_theysaidso_widget
    • _wp2sl_gl_page_bg
    • widget_recent-comments
    • wp2sl_gl_page_slug
    • widget_recent-posts
    • ...

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
The smoke test was a success, however most plugin functionality was not tested

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please fix the following items
  • 1× PHP files output text when accessed directly:
    • > /wp-content/plugins/wp-2-stage-login/templates/forms/login/form_footer.php
  • 14× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp-2-stage-login/ajax-functions.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/wp-2-stage-login/templates/forms/login/form_header.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp-2-stage-login/plugin-functions.php:105
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp-2-stage-login/settings/menu_settings.php:4
    • > PHP Warning
      include_once(ABSPATHwp-load.php): failed to open stream: No such file or directory in wp-content/plugins/wp-2-stage-login/templates/forms/login/form_header.php on line 7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/wp-2-stage-login/templates/tpl_generic_login.php:7
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/wp-2-stage-login/templates/forms/login/form_header.php on line 7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/wp-2-stage-login/templates/forms/login/form_header.php:10
    • > PHP Warning
      include_once(): Failed opening 'ABSPATHwp-load.php' for inclusion (include_path='.:/usr/share/php') in wp-content/plugins/wp-2-stage-login/templates/forms/login/form_header.php on line 7
    • > PHP Warning
      include_once(): Failed opening 'ABSPATHwp-load.php' for inclusion (include_path='.:/usr/share/php') in wp-content/plugins/wp-2-stage-login/templates/forms/login/form_header.php on line 7

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 96% from 29 tests

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
4 plugin tags: 2 stage authentication, wp authentication, login, wp 2-stage login

wp-2-stage-login/2stage-login.php 92% from 13 tests

The entry point to "WP 2-Stage Login" version 1.0 is a PHP file that has certain tags in its header comment area
Please make the necessary changes and fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("wp-2-stage-login.php" instead of "2stage-login.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
Good job! No executable or dangerous file extensions detected2,174 lines of code in 18 files:
LanguageFilesBlank linesComment linesLines of code
CSS41951071,253
PHP9157139584
SVG100255
JavaScript4181382

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.21
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%
Functions31
▷ Named functions31100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.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
26 PNG files occupy 0.23MB with 0.16MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
templates/forms/login/images/noise.png5.33KB2.35KB▼ 55.91%
templates/forms/login/images/success_icon_256px.png19.68KB8.73KB▼ 55.63%
images/banner-lock-icon-64.png10.98KB3.53KB▼ 67.83%
images/icon-lock-2.png1.65KB0.40KB▼ 75.89%
templates/forms/login/images/mailicon.png2.91KB0.33KB▼ 88.79%