83% o365-wp-restrict

Code Review | Intranet and Extranet with O365 Login

WordPress plugin Intranet and Extranet with O365 Login scored83%from 54 tests.

About plugin

  • Plugin page: o365-wp-restrict
  • Plugin version: 1.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: Sep 29, 2018
  • Latest release: Nov 3, 2023
  • Number of updates: 32
  • Update frequency: every 58.4 days
  • Top authors: wpintegrate (100%)

Code review

54 tests

User reviews

5 reviews

Install metrics

100+ active /3,830 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
This plugin's installer ran successfully

Server metrics [RAM: ▲0.02MB] [CPU: ▼4.06ms] Passed 4 tests

A check of server-side resources used by Intranet and Extranet with O365 Login
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0437.53 ▼4.51
Dashboard /wp-admin3.33 ▼0.0147.77 ▼9.41
Posts /wp-admin/edit.php3.38 ▲0.0341.79 ▼3.35
Add New Post /wp-admin/post-new.php5.91 ▲0.0393.28 ▲1.02
Media Library /wp-admin/upload.php3.25 ▲0.0239.53 ▲5.35

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

Filesystem and database footprint
This plugin installed successfully
Filesystem: 26 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
widget_recent-posts
can_compress_scripts
widget_recent-comments
widget_theysaidso_widget
theysaidso_admin_options

Browser metrics Passed 4 tests

This is an overview of browser requirements for Intranet and Extranet with O365 Login
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,809 ▲6314.38 ▲0.031.61 ▼0.0838.68 ▼4.54
Dashboard /wp-admin2,212 ▲315.57 ▼0.1596.38 ▼5.8541.97 ▲0.14
Posts /wp-admin/edit.php2,120 ▲171.99 ▼0.0339.43 ▲0.2235.17 ▼0.46
Add New Post /wp-admin/post-new.php1,553 ▲2718.33 ▼5.38624.52 ▲22.0665.63 ▲12.05
Media Library /wp-admin/upload.php1,423 ▲264.18 ▼0.0492.79 ▼5.4041.38 ▲0.74

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_theysaidso_widget
    • widget_recent-comments
    • can_compress_scripts
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please take a closer look at the following
  • 7× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/o365-wp-restrict/function/o365_wp_restrict_auto_update_check.php
    • > /wp-content/plugins/o365-wp-restrict/libraries/o365-wp-restrict-config.php
    • > /wp-content/plugins/o365-wp-restrict/action/wp_ajax_o365_wp_restrict_wp_roles.php
    • > /wp-content/plugins/o365-wp-restrict/inc/o365-wp-restrict-deactivation_hook.php
    • > /wp-content/plugins/o365-wp-restrict/o365-wp-restrict.php
    • > /wp-content/plugins/o365-wp-restrict/inc/o365-wp-restrict-activation-hook.php
    • > /wp-content/plugins/o365-wp-restrict/libraries/o365-wp-restrict-plugin-initializer.php

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
5 plugin tags: limited access, office 365, restriction, intranet extranet, protect

o365-wp-restrict/o365-wp-restrict.php 85% from 13 tests

The entry point to "Intranet and Extranet with O365 Login" version 1.6 is a PHP file that has certain tags in its header comment area
Please take the time to fix the following:
  • Description: The description should be shorter than 140 characters (currently 209 characters long)
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug

Code Analysis 97% 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
No dangerous file extensions were detected1,915 lines of code in 16 files:
LanguageFilesBlank linesComment linesLines of code
PHP121451381,114
CSS22125433
JavaScript21619368

PHP code 50% from 2 tests

Analyzing cyclomatic complexity and code structure
These items need your attention
  • Please reduce cyclomatic complexity of methods to less than 100 (currently 158)
Cyclomatic complexity
Average complexity per logical line of code0.89
Average class complexity99.00
▷ Minimum class complexity12.00
▷ Maximum class complexity268.00
Average method complexity17.33
▷ Minimum method complexity1.00
▷ Maximum method complexity158.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods18
▷ Static methods15.56%
▷ Public methods18100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions10
▷ Named functions990.00%
▷ Anonymous functions110.00%
Constants5
▷ Global constants5100.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
7 PNG files occupy 0.24MB with 0.14MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
img/help-pic-hover.png2.10KB1.19KB▼ 43.34%
assets/screenshot-2.png80.88KB26.88KB▼ 66.76%
img/help-picture.png4.82KB1.97KB▼ 59.09%
assets/screenshot-3.png77.18KB25.76KB▼ 66.62%
img/help-pic.png2.07KB1.03KB▼ 50.42%