83% login-with-cognito

Code Review | Login with Cognito

WordPress plugin Login with Cognito scored83%from 54 tests.

About plugin

Code review

54 tests

User reviews

1 review

Install metrics

90+ active /4,492 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Install script ran successfully

Server metrics [RAM: ▲0.64MB] [CPU: ▼2.99ms] Passed 4 tests

This is a short check of server-side resources used by Login with Cognito
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /4.15 ▲0.6943.76 ▲0.61
Dashboard /wp-admin3.98 ▲0.6747.28 ▼2.17
Posts /wp-admin/edit.php4.03 ▲0.6751.51 ▼1.14
Add New Post /wp-admin/post-new.php6.50 ▲0.6191.03 ▼9.25
Media Library /wp-admin/upload.php3.84 ▲0.6137.36 ▲2.76

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

How much does this plugin use your filesystem and database?
This plugin installed successfully
Filesystem: 150 new files
Database: no new tables, 8 new options
New WordPress options
widget_recent-comments
host_name
db_upgraded
widget_mocognito_widget
widget_theysaidso_widget
widget_recent-posts
theysaidso_admin_options
can_compress_scripts

Browser metrics Passed 4 tests

This is an overview of browser requirements for Login with Cognito
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,846 ▲8913.30 ▼0.993.49 ▲1.4338.58 ▼5.69
Dashboard /wp-admin2,218 ▲305.84 ▼0.01107.78 ▼8.1874.84 ▲27.50
Posts /wp-admin/edit.php2,107 ▲181.97 ▼0.0037.27 ▼1.2535.42 ▲0.50
Add New Post /wp-admin/post-new.php1,536 ▼618.07 ▼0.16674.75 ▲35.6661.58 ▲7.34
Media Library /wp-admin/upload.php1,403 ▲124.18 ▲0.0398.36 ▲0.2172.14 ▲26.25

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • This plugin does not fully uninstall, leaving 7 options in the database
    • widget_recent-comments
    • db_upgraded
    • can_compress_scripts
    • widget_recent-posts
    • widget_theysaidso_widget
    • widget_mocognito_widget
    • 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
Good news, no errors were detected

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
The following issues need your attention
  • 2× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/login-with-cognito/class-mocognito-widget.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/login-with-cognito/class-mocognito-widget.php:11

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser errors were detected

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
5 plugin tags: sso, aws, amazon, cognito, oauth 20

login-with-cognito/mo_oauth_settings.php 85% from 13 tests

The principal PHP file in "Login with Cognito" v. 1.5.1 is loaded by WordPress automatically on each request
You should first fix the following items:
  • Main file name: Name the main plugin file the same as the plugin slug ("login-with-cognito.php" instead of "mo_oauth_settings.php")
  • Description: Keep the plugin description shorter than 140 characters (currently 258 characters long)

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Everything looks great! No dangerous files found in this plugin5,484 lines of code in 56 files:
LanguageFilesBlank linesComment linesLines of code
PHP355581,0514,604
SVG100685
JavaScript9536174
JSON10011
CSS100610

PHP code 50% from 2 tests

This is a very shot review of cyclomatic complexity and code structure
Please tend to the following items
  • Cyclomatic complexity of methods should be reduced to less than 100 (currently 158)
Cyclomatic complexity
Average complexity per logical line of code0.43
Average class complexity16.55
▷ Minimum class complexity1.00
▷ Maximum class complexity169.00
Average method complexity4.21
▷ Minimum method complexity1.00
▷ Maximum method complexity158.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes20
▷ Abstract classes00.00%
▷ Concrete classes20100.00%
▷ Final classes00.00%
Methods97
▷ Static methods3232.99%
▷ Public methods8991.75%
▷ Protected methods11.03%
▷ Private methods77.22%
Functions34
▷ Named functions34100.00%
▷ Anonymous functions00.00%
Constants6
▷ Global constants583.33%
▷ Class constants116.67%
▷ Public constants1100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
86 PNG files occupy 0.70MB with 0.20MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/partials/addons/images/page-restriction.png2.46KB1.37KB▼ 44.45%
admin/partials/apps/images/laravel.png20.41KB20.26KB▼ 0.74%
admin/partials/apps/images/invis.png12.86KB7.59KB▼ 40.95%
admin/partials/apps/images/discord.png1.43KB1.37KB▼ 4.36%
admin/partials/apps/images/slack.png12.59KB5.93KB▼ 52.88%