83% authorizer

Code Review | Authorizer

WordPress plugin Authorizer scored 83% from 54 tests.

About plugin

  • Plugin page: authorizer
  • Plugin version: 3.3.0
  • PHP compatiblity: 7.2.5+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4-5.9
  • WordPress version: 5.8.1
  • First release: Apr 1, 2015
  • Latest release: Mar 3, 2022
  • Number of updates: 199
  • Update frequency: every 14.2 days
  • Top authors: figureone (100%)

Code review

54 tests

User reviews

16 reviews

Install metrics

4,000+ active / 80,337 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲2.51MB] [CPU: ▼171.07ms] Passed 4 tests

A check of server-side resources used by Authorizer
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /5.29 ▲2.4539.17 ▲9.92
Dashboard /wp-admin5.65 ▲2.5950.09 ▲7.51
Posts /wp-admin/edit.php5.69 ▲2.5849.35 ▲11.06
Add New Post /wp-admin/post-new.php7.93 ▲2.5087.76 ▼712.76
Media Library /wp-admin/upload.php5.51 ▲2.5143.09 ▲17.92

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

Filesystem and database footprint
The plugin installed successfully
Filesystem: 962 new files
Database: no new tables, 5 new options
New WordPress options
auth_settings_access_users_blocked
auth_settings
auth_version
auth_settings_access_users_pending
auth_settings_access_users_approved

Browser metrics Passed 4 tests

Checking browser requirements for Authorizer
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /4,194 ▲59316.26 ▲0.604.91 ▼0.3871.57 ▼7.43
Dashboard /wp-admin3,450 ▲5516.70 ▲0.50121.22 ▼9.73176.42 ▲1.04
Posts /wp-admin/edit.php2,760 ▲203.24 ▲0.1664.15 ▼0.75139.19 ▼2.55
Add New Post /wp-admin/post-new.php3,732 ▼918.72 ▲0.00410.51 ▼25.62158.65 ▼16.75
Media Library /wp-admin/upload.php1,775 ▲235.51 ▼0.01140.96 ▲1.83182.73 ▲1.60

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
The following items require your attention
  • Zombie WordPress options were found after uninstall: 4 options
    • auth_version
    • auth_settings_access_users_approved
    • auth_settings_access_users_blocked
    • auth_settings_access_users_pending

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
Everything seems fine, however this is by no means 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
Almost there! Just fix the following items
  • 442× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Monolog\\Handler\\AbstractProcessingHandler' not found in wp-content/plugins/authorizer/vendor/monolog/monolog/src/Monolog/Handler/NewRelicHandler.php:28
    • > PHP Fatal error
      Uncaught Error: Interface 'CAS_Languages_LanguageInterface' not found in wp-content/plugins/authorizer/vendor/apereo/phpcas/source/CAS/Languages/English.php:43
    • > PHP Fatal error
      Uncaught Error: Class 'Monolog\\Handler\\Handler' not found in wp-content/plugins/authorizer/vendor/monolog/monolog/src/Monolog/Handler/FingersCrossedHandler.php:41
    • > PHP Fatal error
      Uncaught Error: Class 'Monolog\\Handler\\AbstractProcessingHandler' not found in wp-content/plugins/authorizer/vendor/monolog/monolog/src/Monolog/Handler/FirePHPHandler.php:24
    • > PHP Fatal error
      Uncaught Error: Class 'Monolog\\Handler\\AbstractProcessingHandler' not found in wp-content/plugins/authorizer/vendor/monolog/monolog/src/Monolog/Handler/MailHandler.php:24
    • > PHP Fatal error
      Uncaught Error: Class 'Monolog\\Processor\\MemoryProcessor' not found in wp-content/plugins/authorizer/vendor/monolog/monolog/src/Monolog/Processor/MemoryUsageProcessor.php:20
    • > PHP Fatal error
      Uncaught Error: Class 'phpseclib3\\Crypt\\EC\\BaseCurves\\Binary' not found in wp-content/plugins/authorizer/vendor/phpseclib/phpseclib/phpseclib/Crypt/EC/Curves/sect571r1.php:21
    • > PHP Fatal error
      Uncaught Error: Class 'Google\\Service\\Resource' not found in wp-content/plugins/authorizer/vendor/google/apiclient-services/src/Webfonts/Resource/Webfonts.php:30
    • > PHP Fatal error
      Uncaught Error: Class 'League\\OAuth2\\Client\\Provider\\AbstractProvider' not found in wp-content/plugins/authorizer/vendor/thenetworg/oauth2-azure/src/Provider/Azure.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'phpseclib3\\Crypt\\Common\\AsymmetricKey' not found in wp-content/plugins/authorizer/vendor/phpseclib/phpseclib/phpseclib/Crypt/EC.php:58

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine on the user side

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:
  • Tags: Too many tags (11 tag instead of maximum 10); only the first 5 tags are used in your directory listing
You can take inspiration from this readme.txt

authorizer/authorizer.php 92% from 13 tests

The primary PHP file in "Authorizer" version 3.3.0 is used by WordPress to initiate all plugin functionality
The following require your attention:
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 143 characters long)

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Success! There were no dangerous files found in this plugin97,419 lines of code in 907 files:
LanguageFilesBlank linesComment linesLines of code
PHP77914,23450,64067,890
JavaScript184,6744,36716,782
Markdown402,02205,878
JSON39203,172
PO File26298932,534
Sass24853548
CSS82015229
YAML8141141
XML667117
Python1222572
HTML113239
make1409
Dockerfile1375
Bourne Shell1203

PHP code 50% from 2 tests

A short review of cyclomatic complexity and code structure
It is recommended to fix the following
  • Cyclomatic complexity of methods should be reduced to less than 100 (currently 127)
Cyclomatic complexity
Average complexity per logical line of code0.38
Average class complexity13.25
▷ Minimum class complexity1.00
▷ Maximum class complexity661.00
Average method complexity3.34
▷ Minimum method complexity1.00
▷ Maximum method complexity127.00
Code structure
Namespaces91
Interfaces61
Traits21
Classes691
▷ Abstract classes22232.13%
▷ Concrete classes46967.87%
▷ Final classes5211.09%
Methods4,038
▷ Static methods75618.72%
▷ Public methods3,01674.69%
▷ Protected methods49512.26%
▷ Private methods52713.05%
Functions182
▷ Named functions3921.43%
▷ Anonymous functions14378.57%
Constants539
▷ Global constants468.53%
▷ Class constants49391.47%
▷ Public constants46193.51%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
4 PNG files occupy 0.11MB with 0.06MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/authorizer-banner-800x600.png69.62KB24.89KB▼ 64.24%
images/authorizer-banner-400x300.png36.64KB12.84KB▼ 64.96%
vendor/components/multi-select/img/switch.png3.01KB0.64KB▼ 78.70%
sample-theme-add-branding/extend/authorizer/example/images/w-logo-blue.png3.04KB3.09KB0.00%