78% google-authenticator-per-user-prompt

Code Review | Per User Prompt for Google Authenticator

WordPress plugin Per User Prompt for Google Authenticator scored78%from 54 tests.

About plugin

  • Plugin page: google-authentica...
  • Plugin version: 0.7
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4-4.9
  • WordPress version: 6.3.1
  • First release: Dec 11, 2013
  • Latest release: Apr 23, 2021
  • Number of updates: 92
  • Update frequency: every 29.2 days
  • Top authors: iandunn (100%)

Code review

54 tests

User reviews

10 reviews

Install metrics

700+ active /18,271 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.01MB] [CPU: ▼7.43ms] Passed 4 tests

Server-side resources used by Per User Prompt for Google Authenticator
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0136.90 ▼5.00
Dashboard /wp-admin3.31 ▲0.0146.79 ▼10.98
Posts /wp-admin/edit.php3.36 ▲0.0151.08 ▼6.60
Add New Post /wp-admin/post-new.php5.89 ▲0.0187.01 ▼5.99
Media Library /wp-admin/upload.php3.23 ▲0.0131.77 ▼6.14

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

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 18 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
widget_recent-posts
widget_theysaidso_widget
theysaidso_admin_options
can_compress_scripts
widget_recent-comments

Browser metrics Passed 4 tests

Per User Prompt for Google Authenticator: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,857 ▲9613.31 ▼1.314.79 ▲2.5542.03 ▼5.22
Dashboard /wp-admin2,263 ▲574.84 ▼0.05105.93 ▼3.7242.20 ▲1.78
Posts /wp-admin/edit.php2,143 ▲462.18 ▲0.1840.36 ▲1.0650.87 ▲18.89
Add New Post /wp-admin/post-new.php1,581 ▲3623.47 ▲0.06678.00 ▲39.6851.77 ▼4.99
Media Library /wp-admin/upload.php1,445 ▲454.29 ▲0.1399.97 ▼17.3745.10 ▼0.93

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
Please fix the following items
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_theysaidso_widget
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_recent-comments
    • can_compress_scripts

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
Even though no errors were found, this is by no means an exhaustive test

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
The following issues need your attention
  • 1× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/google-authenticator-per-user-prompt/bootstrap.php
  • 7× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Warning
      Use of undefined constant GAPUP_REQUIRED_PHP_VERSION - assumed 'GAPUP_REQUIRED_PHP_VERSION' (this will throw an Error in a future version of PHP) in wp-content/plugins/google-authenticator-per-user-prompt/views/requirements-error.php on line 7
    • > PHP Notice
      Undefined variable: error_message in wp-content/plugins/google-authenticator-per-user-prompt/views/token-prompt.php on line 7
    • > PHP Fatal error
      Uncaught Error: Class 'Codeception\\Actor' not found in wp-content/plugins/google-authenticator-per-user-prompt/tests/_helpers/WebGuy.php:19
    • > PHP Fatal error
      Uncaught Error: Class 'Codeception\\Module' not found in wp-content/plugins/google-authenticator-per-user-prompt/tests/_helpers/WebHelper.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html() in wp-content/plugins/google-authenticator-per-user-prompt/views/requirements-error.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_url() in wp-content/plugins/google-authenticator-per-user-prompt/views/token-prompt.php:13
    • > PHP Warning
      Use of undefined constant GAPUP_REQUIRED_WP_VERSION - assumed 'GAPUP_REQUIRED_WP_VERSION' (this will throw an Error in a future version of PHP) in wp-content/plugins/google-authenticator-per-user-prompt/views/requirements-error.php on line 11

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
2 plugin tags: two factor authentication, google authenticator

google-authenticator-per-user-prompt/bootstrap.php 92% from 13 tests

The entry point to "Per User Prompt for Google Authenticator" version 0.7 is a PHP file that has certain tags in its header comment area
The following require your attention:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("google-authenticator-per-user-prompt.php" instead of "bootstrap.php")

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
There were no executable files found in this plugin1,238 lines of code in 13 files:
LanguageFilesBlank linesComment linesLines of code
PHP103222,830934
SQL15178275
YAML26729

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.13
Average class complexity8.50
▷ Minimum class complexity1.00
▷ Maximum class complexity34.00
Average method complexity1.28
▷ Minimum method complexity1.00
▷ Maximum method complexity6.00
Code structure
Namespaces2
Interfaces0
Traits1
Classes5
▷ Abstract classes00.00%
▷ Concrete classes5100.00%
▷ Final classes00.00%
Methods160
▷ Static methods21.25%
▷ Public methods14691.25%
▷ Protected methods148.75%
▷ Private methods00.00%
Functions3
▷ Named functions266.67%
▷ Anonymous functions133.33%
Constants21
▷ Global constants29.52%
▷ Class constants1990.48%
▷ Public constants19100.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
There are no PNG files in this plugin