10% sso-oauth-discord-by-path-digital

Code Review | SSO OAuth for Discord by path digital

WordPress plugin SSO OAuth for Discord by path digital scored10%from 54 tests.

About plugin

  • Plugin page: sso-oauth-discord...
  • Plugin version: 3.1.3
  • PHP compatiblity: 5.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-6.3.1
  • WordPress version: 6.3.1
  • First release: Aug 26, 2021
  • Latest release: Nov 5, 2023
  • Number of updates: 53
  • Update frequency: every 15.1 days
  • Top authors: pathdigital (100%)

Code review

54 tests

User reviews

9 reviews

Install metrics

10+ active /2,743 total downloads

Benchmarks

Plugin footprint 58% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Please fix the following installer errors
  • The plugin cannot be installed
    • > Deprecated in wp-includes/class-wp-hook.php+310
    Non-static method PD_Discord_OAuth::activation() should not be called statically

Server metrics [RAM: ▼0.04MB] [CPU: ▼15.59ms] Passed 4 tests

A check of server-side resources used by SSO OAuth for Discord by path digital
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.32 ▼0.1423.77 ▼16.62
Dashboard /wp-admin3.73 ▲0.4247.26 ▼4.16
Posts /wp-admin/edit.php3.84 ▲0.4946.71 ▲0.46
Add New Post /wp-admin/post-new.php5.02 ▼0.8742.05 ▼42.05
Media Library /wp-admin/upload.php3.65 ▲0.4245.57 ▲9.69

Server storage [IO: ▲0.28MB] [DB: ▲0.07MB] Passed 3 tests

How much does this plugin use your filesystem and database?
This plugin installed successfully
Filesystem: 34 new files
Database: no new tables, 10 new options
New WordPress options
_pd_discord_bot_configuration_settings
widget_recent-posts
_pd_discord_oauth_configuration_settings
theysaidso_admin_options
db_upgraded
can_compress_scripts
widget_theysaidso_widget
_pd_discord_oauth_user_sessions
widget_recent-comments
_pd_discord_oauth_general_settings

Browser metrics Passed 4 tests

A check of browser resources used by SSO OAuth for Discord by path digital
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,948 ▲18613.41 ▼0.948.52 ▲6.8438.43 ▼5.50
Dashboard /wp-admin2,242 ▲655.55 ▼0.0395.21 ▼6.8972.68 ▲30.16
Posts /wp-admin/edit.php2,151 ▲512.11 ▲0.1741.31 ▲4.9436.96 ▲4.17
Add New Post /wp-admin/post-new.php1,722 ▲19621.02 ▼2.13762.34 ▲85.6658.14 ▲6.91
Media Library /wp-admin/upload.php1,447 ▲534.24 ▼0.02104.04 ▲4.4073.20 ▲30.39

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

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

Smoke tests 75% 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)
Good news, no errors were detected

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
The following issues need your attention
  • 2× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function language_attributes() in wp-content/plugins/sso-oauth-discord-by-path-digital/templates/maintainance.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function language_attributes() in wp-content/plugins/sso-oauth-discord-by-path-digital/templates/login.php:8

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser errors were detected

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
6 plugin tags: social login, login, discord, oauth, discord login...

sso-oauth-discord-by-path-digital/pathdigital-discord-oauth.php 92% from 13 tests

The main PHP script in "SSO OAuth for Discord by path digital" version 3.1.3 is automatically included on every request by WordPress
It is important to fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("sso-oauth-discord-by-path-digital.php" instead of "pathdigital-discord-oauth.php")

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Everything looks great! No dangerous files found in this plugin2,569 lines of code in 13 files:
LanguageFilesBlank linesComment linesLines of code
PHP10664882,393
CSS210132
JavaScript121044

PHP code 50% from 2 tests

A short review of cyclomatic complexity and code structure
Please fix the following
  • Cyclomatic complexity of methods should be reduced to less than 100 (currently 122)
Cyclomatic complexity
Average complexity per logical line of code0.69
Average class complexity102.80
▷ Minimum class complexity3.00
▷ Maximum class complexity161.00
Average method complexity8.35
▷ Minimum method complexity1.00
▷ Maximum method complexity122.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes5
▷ Abstract classes00.00%
▷ Concrete classes5100.00%
▷ Final classes00.00%
Methods54
▷ Static methods4379.63%
▷ Public methods4990.74%
▷ Protected methods00.00%
▷ Private methods59.26%
Functions11
▷ Named functions19.09%
▷ Anonymous functions1090.91%
Constants6
▷ Global constants6100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
11 PNG files occupy 0.15MB with 0.13MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/images/pathdigital_128x128.png17.17KB1.40KB▼ 91.87%
admin/images/icon_16x16.png15.10KB0.56KB▼ 96.27%
images/icon_16x16.png15.10KB0.56KB▼ 96.27%
admin/images/icon_32x32.png16.15KB1.00KB▼ 93.81%
images/icon_256x256.png4.34KB1.90KB▼ 56.15%