74% sudo-oauth

Code Review | Sudo Oauth

WordPress plugin Sudo Oauth scored74%from 54 tests.

About plugin

  • Plugin page: sudo-oauth
  • Plugin version: 2.0.5
  • PHP version: 7.4.16
  • WordPress compatibility: 4.5-5.3
  • WordPress version: 6.3.1
  • First release: Mar 13, 2015
  • Latest release: Apr 8, 2020
  • Number of updates: 21
  • Update frequency: every 88.2 days
  • Top authors: caotu (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /2,065 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.08MB] [CPU: ▼10.31ms] Passed 4 tests

A check of server-side resources used by Sudo Oauth
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.52 ▲0.0641.13 ▼1.42
Dashboard /wp-admin3.40 ▲0.0543.53 ▼10.76
Posts /wp-admin/edit.php3.51 ▲0.1548.36 ▲4.79
Add New Post /wp-admin/post-new.php6.00 ▲0.1182.64 ▼30.77
Media Library /wp-admin/upload.php3.32 ▲0.0935.53 ▲1.73

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

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 13 new files
Database: 1 new table, 8 new options
New tables
wp_sudo_users
New WordPress options
widget_theysaidso_widget
widget_recent-comments
db_upgraded
sudooauth_option_activeplugin
sudooauth_option_uploadfiles
widget_recent-posts
theysaidso_admin_options
can_compress_scripts

Browser metrics Passed 4 tests

Sudo Oauth: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,819 ▲7313.57 ▼0.801.72 ▼0.5736.82 ▼5.50
Dashboard /wp-admin2,225 ▲375.84 ▼0.0796.13 ▼4.4163.86 ▲23.65
Posts /wp-admin/edit.php2,111 ▲192.04 ▲0.0137.63 ▼2.8132.74 ▼3.92
Add New Post /wp-admin/post-new.php1,546 ▲1218.40 ▼4.90682.59 ▲74.5472.64 ▲11.32
Media Library /wp-admin/upload.php1,401 ▲104.20 ▲0.0397.66 ▼2.2875.62 ▲33.80

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
These items require your attention
  • Zombie tables were found after uninstall: 1 table
    • wp_sudo_users
  • This plugin did not uninstall successfully, leaving 8 options in the database
    • widget_recent-posts
    • sudooauth_option_uploadfiles
    • can_compress_scripts
    • widget_theysaidso_widget
    • sudooauth_option_activeplugin
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 50% 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
  • 7× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/sudo-oauth/includes/admin.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'Walker' not found in wp-content/plugins/sudo-oauth/classes/sudo-walker.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_activation_hook() in wp-content/plugins/sudo-oauth/includes/data.php:17
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/sudo-oauth/classes/sudo-rewrite.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_role() in wp-content/plugins/sudo-oauth/includes/role.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/sudo-oauth/sudo-oauth.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/sudo-oauth/SudoOauth.php:2

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 93% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Attributes that require attention:
  • Screenshots: A description for screenshot #2 is required in sudo-oauth/assets to your readme.txt
The official readme.txt is a good inspiration

sudo-oauth/sudo-oauth.php 92% from 13 tests

The entry point to "Sudo Oauth" version 2.0.5 is a PHP file that has certain tags in its header comment area
Please take the time to fix the following:
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 165 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Everything looks great! No dangerous files found in this plugin686 lines of code in 11 files:
LanguageFilesBlank linesComment linesLines of code
PHP94041605
CSS10061
JavaScript11120

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.28
Average class complexity2.00
▷ Minimum class complexity1.00
▷ Maximum class complexity3.00
Average method complexity1.23
▷ Minimum method complexity1.00
▷ Maximum method complexity2.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods13
▷ Static methods17.69%
▷ Public methods13100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions16
▷ Named functions16100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
1 PNG file occupies 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
icon.png3.99KB1.83KB▼ 54.25%