78% google-authenticator-encourage-user-activation

Code Review | Encourage User Activation for Google Authenticator

WordPress plugin Encourage User Activation for Google Authenticator scored78%from 54 tests.

About plugin

  • Plugin page: google-authentica...
  • Plugin version: 0.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.1-4.9.8
  • WordPress version: 6.3.1
  • First release: Dec 15, 2013
  • Latest release: Apr 23, 2021
  • Number of updates: 18
  • Update frequency: every 149.2 days
  • Top authors: iandunn (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

100+ active /8,120 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Install script ran successfully

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

A check of server-side resources used by Encourage User Activation for Google Authenticator
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0138.41 ▲0.79
Dashboard /wp-admin3.31 ▼0.0345.32 ▼15.77
Posts /wp-admin/edit.php3.36 ▲0.0043.56 ▼2.78
Add New Post /wp-admin/post-new.php5.89 ▲0.0082.02 ▼12.34
Media Library /wp-admin/upload.php3.24 ▲0.0034.57 ▼12.18

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

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

Browser metrics Passed 4 tests

Encourage User Activation for Google Authenticator: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,843 ▲7213.25 ▼1.135.02 ▲3.1843.56 ▲2.55
Dashboard /wp-admin2,246 ▲545.80 ▲0.8495.21 ▼10.6341.95 ▼0.13
Posts /wp-admin/edit.php2,129 ▲372.14 ▲0.1334.33 ▼2.4631.99 ▼1.61
Add New Post /wp-admin/post-new.php1,570 ▲3723.22 ▲0.05651.37 ▼37.5653.03 ▼4.12
Media Library /wp-admin/upload.php1,428 ▲404.19 ▼0.06110.43 ▼2.5249.02 ▲3.29

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The following items require your attention
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_theysaidso_widget
    • db_upgraded
    • can_compress_scripts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
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
  • 2× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/google-authenticator-encourage-user-activation/views/force-notice.php
    • > /wp-content/plugins/google-authenticator-encourage-user-activation/bootstrap.php
  • 5× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Warning
      Use of undefined constant GAEUA_REQUIRED_PHP_VERSION - assumed 'GAEUA_REQUIRED_PHP_VERSION' (this will throw an Error in a future version of PHP) in wp-content/plugins/google-authenticator-encourage-user-activation/views/requirements-error.php on line 5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_url() in wp-content/plugins/google-authenticator-encourage-user-activation/views/nag-notice.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function checked() in wp-content/plugins/google-authenticator-encourage-user-activation/views/settings-fields.php:5
    • > PHP Warning
      Use of undefined constant GAEUA_REQUIRED_WP_VERSION - assumed 'GAEUA_REQUIRED_WP_VERSION' (this will throw an Error in a future version of PHP) in wp-content/plugins/google-authenticator-encourage-user-activation/views/requirements-error.php on line 9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html() in wp-content/plugins/google-authenticator-encourage-user-activation/views/requirements-error.php:10

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
2 plugin tags: google authenticator, two factor authentication

google-authenticator-encourage-user-activation/bootstrap.php 92% from 13 tests

The principal PHP file in "Encourage User Activation for Google Authenticator" v. 0.2 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 ("google-authenticator-encourage-user-activation.php" instead of "bootstrap.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
No dangerous file extensions were detected197 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code
PHP75595197

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.25
Average class complexity6.50
▷ Minimum class complexity4.00
▷ Maximum class complexity9.00
Average method complexity1.79
▷ Minimum method complexity1.00
▷ Maximum method complexity5.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods14
▷ Static methods00.00%
▷ Public methods14100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.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
There are no PNG files in this plugin