78% user-access-manager

Code Review | User Access Manager

WordPress plugin User Access Manager scored 78% from 54 tests.

About plugin

  • Plugin page: user-access-manager
  • Plugin version: 2.2.16
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-5.9
  • WordPress version: 5.8.1
  • First release: Dec 17, 2008
  • Latest release: Jan 25, 2022
  • Number of updates: 462
  • Update frequency: every 10.4 days
  • Top authors: GM_Alex (100%)

Code review

54 tests

User reviews

111 reviews

Install metrics

30,000+ active / 1,114,014 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲1.87MB] [CPU: ▼167.29ms] Passed 4 tests

Analyzing server-side resources used by User Access Manager
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /4.51 ▲1.6742.12 ▲14.59
Dashboard /wp-admin5.02 ▲1.9547.98 ▲4.43
Posts /wp-admin/edit.php5.23 ▲2.1255.57 ▲18.37
Add New Post /wp-admin/post-new.php7.45 ▲2.0088.00 ▼701.21
Media Library /wp-admin/upload.php4.87 ▲1.8737.94 ▲13.03
Setup /wp-admin/admin.php?page=uam_setup4.8939.23
Manage user groups /wp-admin/admin.php?page=uam_user_group5.0338.27
About /wp-admin/admin.php?page=uam_about4.81276.72
Settings /wp-admin/admin.php?page=uam_settings4.9335.74

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

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 167 new files
Database: 2 new tables, 2 new options
New tables
wp_uam_accessgroups
wp_uam_accessgroup_to_object
New WordPress options
uam_db_version
widget_uam_login_widget

Browser metrics Passed 4 tests

Checking browser requirements for User Access Manager
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,719 ▲9315.69 ▲0.005.33 ▼0.4777.79 ▲4.47
Dashboard /wp-admin2,980 ▲816.14 ▼0.04115.89 ▼12.32169.59 ▼2.67
Posts /wp-admin/edit.php3,115 ▲3913.28 ▲0.0467.60 ▲2.00140.81 ▲1.31
Add New Post /wp-admin/post-new.php2,272 ▼1,54320.91 ▲1.52411.64 ▼46.86188.99 ▲26.35
Media Library /wp-admin/upload.php1,802 ▲505.59 ▲0.12125.43 ▼18.52175.54 ▼8.71
Setup /wp-admin/admin.php?page=uam_setup1,2372.6353.84174.79
Manage user groups /wp-admin/admin.php?page=uam_user_group1,5142.6454.58151.23
About /wp-admin/admin.php?page=uam_about1,4182.6154.01126.77
Settings /wp-admin/admin.php?page=uam_settings1,5662.6456.26152.00

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
Please fix the following items
  • This plugin does not fully uninstall, leaving 1 option in the database
    • widget_uam_login_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 everything seems fine, this is not an exhaustive test

SRP 0% 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
  • 2× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/user-access-manager/src/View/SteadyBanner.php
    • > /wp-content/plugins/user-access-manager/src/View/InfoBox.php
  • 121× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to a member function getId() on null in wp-content/plugins/user-access-manager/src/View/AdminForm/Select.php:24
    • > PHP Fatal error
      Uncaught Error: Class 'UserAccessManager\\Setup\\Database\\DatabaseUpdate' not found in wp-content/plugins/user-access-manager/src/Setup/Update/DatabaseUpdate6.php:28
    • > PHP Fatal error
      Uncaught Error: Call to a member function hasUpdateMessage() on null in wp-content/plugins/user-access-manager/src/View/AdminSettings.php:28
    • > PHP Fatal error
      Uncaught Error: Class 'WP_CLI_Command' not found in wp-content/plugins/user-access-manager/src/Command/GroupCommand.php:38
    • > PHP Warning
      Use of undefined constant TXT_UAM_INFO_BOX_DOCUMENTATION_CONTENT - assumed 'TXT_UAM_INFO_BOX_DOCUMENTATION_CONTENT' (this will throw an Error in a future version of PHP) in wp-content/plugins/user-access-manager/src/View/InfoBox.php on line 13
    • > PHP Fatal error
      Uncaught Error: Class 'UserAccessManager\\Controller\\Backend\\ObjectController' not found in wp-content/plugins/user-access-manager/src/Controller/Backend/TermObjectController.php:29
    • > PHP Fatal error
      Uncaught Error: Class 'UserAccessManager\\Controller\\Controller' not found in wp-content/plugins/user-access-manager/src/Controller/Frontend/ShortCodeController.php:32
    • > PHP Fatal error
      Uncaught Error: Class 'UserAccessManager\\UserGroup\\AbstractUserGroup' not found in wp-content/plugins/user-access-manager/src/UserGroup/DynamicUserGroup.php:33
    • > PHP Fatal error
      Uncaught Error: Class 'UserAccessManager\\Controller\\Frontend\\ContentController' not found in wp-content/plugins/user-access-manager/src/Controller/Frontend/TermController.php:40
    • > PHP Fatal error
      Uncaught Error: Interface 'UserAccessManager\\Cache\\CacheProviderInterface' not found in wp-content/plugins/user-access-manager/src/Cache/FileSystemCacheProvider.php:33

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser errors were detected

Optimizations

Plugin configuration 97% 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: Please delete some tags, you are using 16 tag instead of maximum 10
You can look at the official readme.txt

user-access-manager/user-access-manager.php Passed 13 tests

The main PHP file in "User Access Manager" ver. 2.2.16 adds more information about the plugin and also serves as the entry point for this plugin
61 characters long description:
Manage the access to your posts, pages, categories and files.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
No dangerous file extensions were detected16,313 lines of code in 160 files:
LanguageFilesBlank linesComment linesLines of code
PHP1502,7198,22311,971
JSON4003,782
JavaScript3877392
CSS24710164
Markdown1104

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.29
Average class complexity9.98
▷ Minimum class complexity1.00
▷ Maximum class complexity58.00
Average method complexity2.18
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces23
Interfaces4
Traits6
Classes104
▷ Abstract classes1110.58%
▷ Concrete classes9389.42%
▷ Final classes00.00%
Methods882
▷ Static methods182.04%
▷ Public methods71180.61%
▷ Protected methods444.99%
▷ Private methods12714.40%
Functions30
▷ Named functions310.00%
▷ Anonymous functions2790.00%
Constants361
▷ Global constants27275.35%
▷ Class constants8924.65%
▷ Public constants89100.00%

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
2 PNG files occupy 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/gfx/noAccessPic.png6.45KB4.43KB▼ 31.37%
assets/gfx/icon.png2.35KB1.34KB▼ 42.87%