61% goauth

Code Review | GOAuth

WordPress plugin GOAuth scored61%from 54 tests.

About plugin

  • Plugin page: goauth
  • Plugin version: 2.20
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-5.9
  • WordPress version: 6.3.1
  • First release: Oct 28, 2018
  • Latest release: Mar 21, 2022
  • Number of updates: 177
  • Update frequency: every 7.0 days
  • Top authors: igroykt (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /2,954 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲4.76MB] [CPU: ▲23.19ms] Passed 4 tests

Analyzing server-side resources used by GOAuth
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /8.52 ▲5.0674.31 ▲30.39
Dashboard /wp-admin8.54 ▲5.1982.20 ▲21.24
Posts /wp-admin/edit.php8.54 ▲5.1880.75 ▲32.09
Add New Post /wp-admin/post-new.php9.50 ▲3.61114.26 ▲12.28
Media Library /wp-admin/upload.php8.54 ▲5.3169.13 ▲28.83
Freemius Debug [v.2.4.3] /wp-admin/admin.php?page=freemius8.5463.16

Server storage [IO: ▲32.40MB] [DB: ▲0.00MB] 67% from 3 tests

Filesystem and database footprint
It is recommended to fix the following issues
  • The filesystem usage should be lower than 25MB (currently using 32.40MB)
Filesystem: 12,122 new files
Database: 1 new table, 11 new options
New tables
wp_goauth_tokens
New WordPress options
fs_accounts
fs_debug_mode
widget_recent-comments
can_compress_scripts
db_upgraded
theysaidso_admin_options
fs_gdpr
widget_theysaidso_widget
widget_recent-posts
fs_active_plugins
...

Browser metrics Passed 4 tests

This is an overview of browser requirements for GOAuth
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,872 ▲12613.69 ▼0.281.78 ▼0.2032.50 ▼13.29
Dashboard /wp-admin2,278 ▲784.91 ▼0.91118.85 ▲13.3146.47 ▲3.66
Posts /wp-admin/edit.php2,158 ▲582.14 ▲0.0938.21 ▼13.7637.23 ▼17.17
Add New Post /wp-admin/post-new.php1,560 ▲1223.04 ▼0.26688.84 ▲9.8258.16 ▲4.65
Media Library /wp-admin/upload.php1,457 ▲574.25 ▲0.07109.68 ▼5.3149.01 ▲0.13
Freemius Debug [v.2.4.3] /wp-admin/admin.php?page=freemius1,0611.6822.7528.03
GOAuth /wp-admin/goauth-admin.php260.440.1116.20

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
You still need to fix the following
  • Uninstall procedure had uncaught errors
    • > Notice in wp-content/plugins/goauth/freemius/includes/class-freemius.php+8575
    Undefined property: stdClass::$plugins
  • Zombie WordPress options were found after uninstall: 11 options
    • fs_accounts
    • fs_debug_mode
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • fs_gdpr
    • widget_recent-posts
    • can_compress_scripts
    • goauth_db_version
    • db_upgraded
    • widget_recent-comments
    • ...

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

SRP 0% 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
Please fix the following items
  • 3× PHP files output text when accessed directly:
    • > /wp-content/plugins/goauth/vendor/sonata-project/google-authenticator/sample/tmpl/login.php
    • > /wp-content/plugins/goauth/vendor/sonata-project/google-authenticator/sample/tmpl/ask-for-otp.php
    • > /wp-content/plugins/goauth/vendor/sonata-project/google-authenticator/sample/tmpl/login-error.php
  • 4095× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Google_Collection' not found in wp-content/plugins/goauth/vendor/google/apiclient-services/src/Google/Service/ServiceUsage/SourceInfo.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'Google_Collection' not found in wp-content/plugins/goauth/vendor/google/apiclient-services/src/Google/Service/Tasks/Tasks.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'Google_Service_Resource' not found in wp-content/plugins/goauth/vendor/google/apiclient-services/src/Google/Service/StreetViewPublish/Resource/Photo.php:26
    • > PHP Fatal error
      Uncaught Error: Class 'Google_Service_Resource' not found in wp-content/plugins/goauth/vendor/google/apiclient-services/src/Google/Service/FirebaseHosting/Resource/SitesVersions.php:26
    • > PHP Fatal error
      Uncaught Error: Class 'Google_Collection' not found in wp-content/plugins/goauth/vendor/google/apiclient-services/src/Google/Service/AdExperienceReport/ViolatingSitesResponse.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'Google_Collection' not found in wp-content/plugins/goauth/vendor/google/apiclient-services/src/Google/Service/ManagedServiceforMicrosoftActiveDirectoryConsumerAPI/TestIamPermissionsResponse.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'Google_Collection' not found in wp-content/plugins/goauth/vendor/google/apiclient-services/src/Google/Service/Bigquery/QueryParameterType.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'Google_Model' not found in wp-content/plugins/goauth/vendor/google/apiclient-services/src/Google/Service/Vault/VaultEmpty.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'Google_Model' not found in wp-content/plugins/goauth/vendor/google/apiclient-services/src/Google/Service/AnalyticsReporting/User.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'Google_Service_Resource' not found in wp-content/plugins/goauth/vendor/google/apiclient-services/src/Google/Service/AndroidEnterprise/Resource/Permissions.php:26

User-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Please fix the following browser errors
    • > GET request to /wp-admin/goauth-admin.php
    • > Network (severe)
    wp-admin/goauth-admin.php - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
These attributes need your attention:
  • Requires php: Version format is invalid
  • Donate link: Invalid url: ""
You can take inspiration from this readme.txt

goauth/goauth.php Passed 13 tests

The entry point to "GOAuth" version 2.20 is a PHP file that has certain tags in its header comment area
27 characters long description:
Go and OAuthenticate plugin

Code Analysis 95% from 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 plugin619,904 lines of code in 12,045 files:
LanguageFilesBlank linesComment linesLines of code
PHP11,95137,447372,954609,872
Markdown431,81705,160
SVG1002,316
JSON19001,691
JavaScript63464274
PO File2120149267
CSS162512178
make217353
YAML26043
XML27440
Dockerfile18010

PHP code 0% from 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
The following items need your attention
  • Cyclomatic complexity of classes has to be reduced to less than 1000 (currently 2,910)
  • Method cyclomatic complexity has to be reduced to less than 100 (currently 106)
Cyclomatic complexity
Average complexity per logical line of code0.07
Average class complexity1.90
▷ Minimum class complexity1.00
▷ Maximum class complexity2,910.00
Average method complexity1.12
▷ Minimum method complexity1.00
▷ Maximum method complexity106.00
Code structure
Namespaces38
Interfaces34
Traits8
Classes11,814
▷ Abstract classes110.09%
▷ Concrete classes11,80399.91%
▷ Final classes190.16%
Methods84,471
▷ Static methods4140.49%
▷ Public methods83,70299.09%
▷ Protected methods1780.21%
▷ Private methods5910.70%
Functions338
▷ Named functions20861.54%
▷ Anonymous functions13038.46%
Constants1,051
▷ Global constants16415.60%
▷ Class constants88784.40%
▷ Public constants887100.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
3 PNG files occupy 0.04MB with 0.02MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
freemius/assets/img/plugin-icon.png9.16KB5.26KB▼ 42.58%
assets/google_logo.png17.88KB7.12KB▼ 60.20%
freemius/assets/img/theme-icon.png10.97KB5.78KB▼ 47.37%