94% post-and-page-protect-azure

Code Review | Post and Page Protect with Azure AD

WordPress plugin Post and Page Protect with Azure AD scored 94% from 54 tests.

About plugin

  • Plugin page: post-and-page-pro...
  • Plugin version: 1.2.0
  • PHP compatiblity: 5.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.5-5.5
  • WordPress version: 5.8.1
  • First release: Aug 15, 2019
  • Latest release: Aug 10, 2020
  • Number of updates: 6
  • Update frequency: every 60.2 days
  • Top authors: justingreerbbi (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 352 total downloads

Benchmarks

Plugin footprint Passed 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 successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.00MB] [CPU: ▼141.91ms] Passed 4 tests

Analyzing server-side resources used by Post and Page Protect with Azure AD
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /2.84 ▲0.0036.41 ▲1.10
Dashboard /wp-admin3.06 ▲0.0146.93 ▲0.05
Posts /wp-admin/edit.php3.11 ▲0.0143.91 ▼0.18
Add New Post /wp-admin/post-new.php5.42 ▼0.0187.16 ▼564.30
Media Library /wp-admin/upload.php3.01 ▲0.0028.94 ▼3.22

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

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 9 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

Post and Page Protect with Azure AD: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,703 ▲10715.90 ▲0.379.44 ▼0.9046.28 ▼4.23
Dashboard /wp-admin2,964 ▲305.95 ▼0.01145.70 ▼10.67115.07 ▼4.74
Posts /wp-admin/edit.php2,739 ▼02.72 ▼0.0074.68 ▲4.0984.25 ▼3.03
Add New Post /wp-admin/post-new.php1,782 ▼9017.98 ▼1.14372.54 ▼64.40112.77 ▲4.03
Media Library /wp-admin/upload.php1,807 ▼05.03 ▼0.03148.76 ▼9.15121.30 ▲1.41

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
The plugin uninstalled successfully, without leaving any zombie files or tables

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
Good news, no errors were detected

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 fix the following
  • 5× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_CLI_Command' not found in wp-content/plugins/post-and-page-protect-azure/vendors/wp-session-manager/includes/wp-cli.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'Recursive_ArrayAccess' not found in wp-content/plugins/post-and-page-protect-azure/vendors/wp-session-manager/includes/class-wp-session.php:19
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/post-and-page-protect-azure/vendors/wp-session-manager/includes/wp-session.php:91
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/post-and-page-protect-azure/vendors/wp-session-manager/includes/wp-session.php:91
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/post-and-page-protect-azure/post-and-page-protect-azure.php:14

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser errors were detected

Optimizations

Plugin configuration Passed 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
3 plugin tags: azure oauth, oauth, azure ad

post-and-page-protect-azure/post-and-page-protect-azure.php Passed 13 tests

Analyzing the main PHP file in "Post and Page Protect with Azure AD" version 1.2.0
83 characters long description:
Add protection to individual posts and pages using Azure Active Directory OAuth 2.0

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
There were no executable files found in this plugin625 lines of code in 8 files:
LanguageFilesBlank linesComment linesLines of code
PHP7180577606
JSON10019

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.32
Average class complexity15.00
▷ Minimum class complexity9.00
▷ Maximum class complexity20.00
Average method complexity2.37
▷ Minimum method complexity1.00
▷ Maximum method complexity9.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes125.00%
Methods41
▷ Static methods1331.71%
▷ Public methods3482.93%
▷ Protected methods614.63%
▷ Private methods12.44%
Functions16
▷ Named functions16100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
PNG images were not found in this plugin