77% o365-user-authentication

Code Review | Office 365 User Authentication for WordPress

WordPress plugin Office 365 User Authentication for WordPress scored77%from 54 tests.

About plugin

  • Plugin page: o365-user-authent...
  • Plugin version: 2.6
  • PHP compatiblity: 5.6.36+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5.2-6.3.2
  • WordPress version: 6.3.1
  • First release: Oct 26, 2018
  • Latest release: Nov 2, 2023
  • Number of updates: 45
  • Update frequency: every 40.8 days
  • Top authors: wpintegrate (100%)

Code review

54 tests

User reviews

7 reviews

Install metrics

40+ active /6,004 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲0.26MB] [CPU: ▲213.37ms] 75% from 4 tests

An overview of server-side resources used by Office 365 User Authentication for WordPress
Please fix the following
  • Extra CPU: The extra CPU usage must be under 200.00ms (currently 213.37ms on /wp-admin/upload.php)
PageMemory (MB)CPU Time (ms)
Home /3.74 ▲0.28280.94 ▲239.75
Dashboard /wp-admin3.57 ▲0.22265.71 ▲200.03
Posts /wp-admin/edit.php3.69 ▲0.33268.20 ▲218.40
Add New Post /wp-admin/post-new.php6.15 ▲0.26296.18 ▲195.31
Media Library /wp-admin/upload.php3.50 ▲0.26286.31 ▲252.54

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

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 32 new files
Database: no new tables, 7 new options
New WordPress options
can_compress_scripts
theysaidso_admin_options
azure_login_setting_flow
widget_recent-comments
db_upgraded
widget_theysaidso_widget
widget_recent-posts

Browser metrics Passed 4 tests

Office 365 User Authentication for WordPress: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,791 ▲3014.25 ▼0.031.61 ▼0.1736.70 ▼7.61
Dashboard /wp-admin2,207 ▲305.55 ▼0.09108.21 ▲10.7945.26 ▼0.04
Posts /wp-admin/edit.php2,112 ▲121.97 ▼0.0740.21 ▲4.9837.76 ▼3.59
Add New Post /wp-admin/post-new.php1,556 ▲3020.64 ▼2.93624.37 ▼36.3352.48 ▼4.25
Media Library /wp-admin/upload.php1,412 ▲124.20 ▼0.0196.88 ▼7.9442.03 ▼0.15

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
These items require your attention
  • Zombie WordPress options detected upon uninstall: 7 options
    • can_compress_scripts
    • widget_recent-comments
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-posts
    • azure_login_setting_flow
    • widget_theysaidso_widget

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
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
The following issues need your attention
  • 15× PHP files perform the task of outputting text when accessed with GET requests (only 10 are shown):
    • > /wp-content/plugins/o365-user-authentication/function/o365_user_auth_access_token.php
    • > /wp-content/plugins/o365-user-authentication/function/o365_base_plugin_info_msg.php
    • > /wp-content/plugins/o365-user-authentication/libraries/o365-user-auth-online-config.php
    • > /wp-content/plugins/o365-user-authentication/inc/o365_user_auth_online_class.php
    • > /wp-content/plugins/o365-user-authentication/function/o365_user_auth_tab_title_func.php
    • > /wp-content/plugins/o365-user-authentication/function/o365_user_auth_refresh_token.php
    • > /wp-content/plugins/o365-user-authentication/inc/o365_user_auth_online_register_deactivation_hook.php
    • > /wp-content/plugins/o365-user-authentication/function/o365_user_auth_get_azure_user_fields_for_mapping.php
    • > /wp-content/plugins/o365-user-authentication/function/o365_base_plugin_error_msg.php
    • > /wp-content/plugins/o365-user-authentication/inc/o365_user_auth_online_register_activation_hook.php
  • 1× 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/o365-user-authentication/libraries/o365-user-auth-online-plugin-initializer.php:40

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
There were no browser issues found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
These attributes need your attention: The official readme.txt might help

o365-user-authentication/o365-user-auth-online.php 85% from 13 tests

"Office 365 User Authentication for WordPress" version 2.6's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
It is important to fix the following:
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("o365-user-authentication.php" instead of "o365-user-auth-online.php")

Code Analysis Passed 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 plugin2,091 lines of code in 27 files:
LanguageFilesBlank linesComment linesLines of code
PHP241253951,776
CSS117287
JavaScript11317
HTML10111

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.53
Average class complexity20.62
▷ Minimum class complexity1.00
▷ Maximum class complexity87.00
Average method complexity5.24
▷ Minimum method complexity1.00
▷ Maximum method complexity34.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes8
▷ Abstract classes00.00%
▷ Concrete classes8100.00%
▷ Final classes00.00%
Methods37
▷ Static methods2156.76%
▷ Public methods3491.89%
▷ Protected methods00.00%
▷ Private methods38.11%
Functions20
▷ Named functions20100.00%
▷ Anonymous functions00.00%
Constants5
▷ Global constants480.00%
▷ Class constants120.00%
▷ Public constants1100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
3 PNG files occupy 0.19MB with 0.12MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assests/screenshot-3.png21.26KB9.77KB▼ 54.04%
assests/screenshot-1.png140.83KB42.66KB▼ 69.71%
assests/screenshot-2.png35.67KB14.58KB▼ 59.13%