83% authorizer

Code Review | Authorizer

WordPress plugin Authorizer scored83%from 54 tests.

About plugin

  • Plugin page: authorizer
  • Plugin version: 3.6.3.1
  • PHP compatiblity: 7.2.5+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4-6.2
  • WordPress version: 6.3.1
  • First release: Apr 1, 2015
  • Latest release: Apr 28, 2023
  • Number of updates: 227
  • Update frequency: every 14.3 days
  • Top authors: figureone (100%)

Code review

54 tests

User reviews

17 reviews

Install metrics

4,000+ active /116,116 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: ▲3.28MB] [CPU: ▲13.87ms] 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 /6.72 ▲3.2553.25 ▲14.86
Dashboard /wp-admin6.60 ▲3.3064.83 ▲19.24
Posts /wp-admin/edit.php6.65 ▲3.2964.90 ▲17.17
Add New Post /wp-admin/post-new.php9.18 ▲3.29111.32 ▲9.33
Media Library /wp-admin/upload.php6.52 ▲3.2951.90 ▲14.10

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

Filesystem and database footprint
The plugin installed successfully
Filesystem: 977 new files
Database: no new tables, 11 new options
New WordPress options
auth_settings_access_users_pending
auth_settings_access_users_approved
widget_recent-posts
widget_recent-comments
auth_version
auth_settings_access_users_blocked
theysaidso_admin_options
db_upgraded
widget_theysaidso_widget
auth_settings
...

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 /3,176 ▲43013.28 ▼1.011.87 ▲0.1740.94 ▼2.13
Dashboard /wp-admin2,578 ▲3984.88 ▼0.7299.91 ▲8.9048.70 ▲9.70
Posts /wp-admin/edit.php2,116 ▲162.03 ▲0.0239.47 ▲2.5636.19 ▲1.78
Add New Post /wp-admin/post-new.php1,539 ▲1323.65 ▲0.67601.45 ▼55.5259.15 ▲3.14
Media Library /wp-admin/upload.php1,416 ▲164.30 ▲0.1794.73 ▼17.4240.15 ▼8.12

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: 6 options
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-posts
    • db_upgraded
    • widget_recent-comments
    • widget_theysaidso_widget

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
  • 440× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'phpseclib3\\Crypt\\EC\\BaseCurves\\KoblitzPrime' not found in wp-content/plugins/authorizer/vendor/phpseclib/phpseclib/phpseclib/Crypt/EC/Curves/secp224k1.php:19
    • > PHP Fatal error
      Uncaught Error: Class 'phpseclib3\\Crypt\\EC\\BaseCurves\\Prime' not found in wp-content/plugins/authorizer/vendor/phpseclib/phpseclib/phpseclib/Crypt/EC/Curves/prime192v3.php:19
    • > PHP Fatal error
      Uncaught Error: Class 'Monolog\\Handler\\Handler' not found in wp-content/plugins/authorizer/vendor/monolog/monolog/src/Monolog/Handler/GroupHandler.php:24
    • > PHP Fatal error
      Uncaught Error: Interface 'Google\\Auth\\FetchAuthTokenInterface' not found in wp-content/plugins/authorizer/vendor/google/auth/src/CredentialsLoader.php:31
    • > PHP Fatal error
      Uncaught Error: Class 'League\\OAuth2\\Client\\OptionProvider\\PostAuthOptionProvider' not found in wp-content/plugins/authorizer/vendor/league/oauth2-client/src/OptionProvider/HttpBasicAuthOptionProvider.php:23
    • > PHP Fatal error
      Uncaught Error: Interface 'Monolog\\Processor\\ProcessorInterface' not found in wp-content/plugins/authorizer/vendor/monolog/monolog/src/Monolog/Processor/ProcessIdProcessor.php:19
    • > PHP Fatal error
      Uncaught Error: Class 'phpseclib3\\Crypt\\Common\\SymmetricKey' not found in wp-content/plugins/authorizer/vendor/phpseclib/phpseclib/phpseclib/Crypt/Common/BlockCipher.php:22
    • > PHP Fatal error
      Uncaught Error: Class 'Monolog\\Handler\\AbstractHandler' not found in wp-content/plugins/authorizer/vendor/monolog/monolog/src/Monolog/Handler/BufferHandler.php:28
    • > PHP Fatal error
      Uncaught Error: Class 'Monolog\\Handler\\SocketHandler' not found in wp-content/plugins/authorizer/vendor/monolog/monolog/src/Monolog/Handler/InsightOpsHandler.php:22
    • > PHP Fatal error
      Uncaught Error: Class 'phpseclib3\\Math\\BigInteger\\Engines\\Engine' not found in wp-content/plugins/authorizer/vendor/phpseclib/phpseclib/phpseclib/Math/BigInteger/Engines/PHP.php:24

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 (12 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.6.3.1 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 151 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 plugin102,656 lines of code in 915 files:
LanguageFilesBlank linesComment linesLines of code
PHP78714,77450,40371,979
JavaScript184,6754,36716,790
Markdown462,24106,351
JSON37203,465
PO File27221,1222,930
Sass24853550
CSS72015226
YAML8142220
XML44789
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 147)
Cyclomatic complexity
Average complexity per logical line of code0.39
Average class complexity13.97
▷ Minimum class complexity1.00
▷ Maximum class complexity670.00
Average method complexity3.43
▷ Minimum method complexity1.00
▷ Maximum method complexity147.00
Code structure
Namespaces92
Interfaces63
Traits22
Classes695
▷ Abstract classes22632.52%
▷ Concrete classes46967.48%
▷ Final classes6614.07%
Methods4,169
▷ Static methods79919.17%
▷ Public methods3,10074.36%
▷ Protected methods51412.33%
▷ Private methods55513.31%
Functions187
▷ Named functions3820.32%
▷ Anonymous functions14979.68%
Constants558
▷ Global constants458.06%
▷ Class constants51391.94%
▷ Public constants46791.03%

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
sample-theme-add-branding/extend/authorizer/example/images/w-logo-blue.png3.04KB3.09KB0.00%
vendor/components/multi-select/img/switch.png3.01KB0.64KB▼ 78.70%
images/authorizer-banner-400x300.png36.64KB12.84KB▼ 64.96%
images/authorizer-banner-800x600.png69.62KB24.89KB▼ 64.24%