84% google-authenticator

Code Review | Google Authenticator

WordPress plugin Google Authenticator scored84%from 54 tests.

About plugin

  • Plugin page: google-authenticator
  • Plugin version: 0.54
  • PHP version: 7.4.16
  • WordPress compatibility: 4.5-6.0
  • WordPress version: 6.3.1
  • First release: May 16, 2011
  • Latest release: Jul 4, 2022
  • Number of updates: 93
  • Update frequency: every 43.8 days
  • Top authors: Henrik.Schack (86.02%)ivankk (15.05%)

Code review

54 tests

User reviews

133 reviews

Install metrics

30,000+ active /574,436 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.18MB] [CPU: ▼1.39ms] Passed 4 tests

This is a short check of server-side resources used by Google Authenticator
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.64 ▲0.1837.01 ▼1.45
Dashboard /wp-admin3.49 ▲0.1445.94 ▼9.61
Posts /wp-admin/edit.php3.60 ▲0.2447.57 ▼1.16
Add New Post /wp-admin/post-new.php6.09 ▲0.20113.67 ▲17.03
Media Library /wp-admin/upload.php3.41 ▲0.1838.01 ▲6.67
/wp-admin/admin.php?page=google_authenticator_user_page3.3832.36
Google Authenticator /wp-admin/options-general.php?page=google_authenticator3.3832.19

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

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 29 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
widget_recent-posts
can_compress_scripts
widget_recent-comments
widget_theysaidso_widget
db_upgraded

Browser metrics Passed 4 tests

Google Authenticator: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,824 ▲7813.18 ▼1.201.79 ▲0.0738.91 ▼0.34
Dashboard /wp-admin2,209 ▲175.84 ▲0.9299.56 ▼7.0838.46 ▼5.46
Posts /wp-admin/edit.php2,095 ▲62.00 ▼0.0138.73 ▲2.2734.53 ▼0.30
Add New Post /wp-admin/post-new.php1,542 ▲1918.59 ▼4.58598.11 ▼81.7651.88 ▼4.97
Media Library /wp-admin/upload.php1,394 ▲34.27 ▲0.0593.57 ▼6.9841.67 ▼2.76
/wp-admin/admin.php?page=google_authenticator_user_page9012.2150.6425.00
Google Authenticator /wp-admin/options-general.php?page=google_authenticator8172.0325.8830.59

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
These items require your attention
  • The uninstall procedure has failed, leaving 6 options in the database
    • db_upgraded
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-comments
    • widget_recent-posts
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though everything seems fine, this is not an exhaustive test

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
Almost there! Just fix the following items
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/google-authenticator/google-authenticator.php:67

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)
No browser errors were detected

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
Attributes that need to be fixed:
  • Screenshots: These screenshots have no corresponding images in /assets: #1 (The enhanced log-in box.), #2 (Google Authenticator section on the Profile and Personal options page.), #3 (QR code on the Profile and Personal options page.), #4 (Google Authenticator app on Android)
The official readme.txt is a good inspiration

google-authenticator/google-authenticator.php Passed 13 tests

This is the main PHP file of "Google Authenticator" version 0.54, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
111 characters long description:
Two-Factor Authentication for WordPress using the Android/iPhone/Blackberry app as One Time Password generator.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Success! There were no dangerous files found in this plugin1,708 lines of code in 12 files:
LanguageFilesBlank linesComment linesLines of code
PO File9272312925
PHP2129209755
JavaScript10028

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.33
Average class complexity64.50
▷ Minimum class complexity21.00
▷ Maximum class complexity108.00
Average method complexity5.54
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods28
▷ Static methods27.14%
▷ Public methods28100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants00.00%
▷ Class constants1100.00%
▷ Public constants1100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
No PNG images were found in this plugin