78% capability-manager-enhanced

Code Review | PublishPress Capabilities - User Role Editor, Access Permissions, Admin Menus

WordPress plugin PublishPress Capabilities - User Role Editor, Access Permissions, Admin Menus scored78%from 54 tests.

About plugin

  • Plugin page: capability-manage...
  • Plugin version: 2.10.2
  • PHP compatiblity: 7.2.5+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.5-6.4
  • WordPress version: 6.3.1
  • First release: Jul 30, 2012
  • Latest release: Nov 15, 2023
  • Number of updates: 252
  • Update frequency: every 16.4 days
  • Top authors: kevinB (71.03%)publishpress (11.11%)stevejburge (10.32%)olatechpro (8.73%)

Code review

54 tests

User reviews

112 reviews

Install metrics

100,000+ active /2,640,543 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
Installer ran successfully

Server metrics [RAM: ▲0.22MB] [CPU: ▲4.49ms] Passed 4 tests

A check of server-side resources used by PublishPress Capabilities - User Role Editor, Access Permissions, Admin Menus
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.65 ▲0.1846.31 ▲5.71
Dashboard /wp-admin3.57 ▲0.2649.72 ▲0.81
Posts /wp-admin/edit.php3.62 ▲0.2652.58 ▲6.39
Add New Post /wp-admin/post-new.php6.11 ▲0.22106.07 ▲11.01
Media Library /wp-admin/upload.php3.42 ▲0.1939.21 ▲5.04
Capabilities /wp-admin/admin.php?page=pp-capabilities4.1170.04
Admin Features /wp-admin/admin.php?page=pp-capabilities-admin-features3.5844.79
Settings /wp-admin/admin.php?page=pp-capabilities-settings3.5439.21
Roles /wp-admin/admin.php?page=pp-capabilities-roles3.5644.72
Nav Menus /wp-admin/admin.php?page=pp-capabilities-nav-menus3.5839.16
Admin Menus /wp-admin/admin.php?page=pp-capabilities-admin-menus3.4937.27
Editor Features /wp-admin/admin.php?page=pp-capabilities-editor-features3.5737.98
Backup /wp-admin/admin.php?page=pp-capabilities-backup3.6541.08
Profile Features /wp-admin/admin.php?page=pp-capabilities-profile-features3.5538.58
Upgrade to Pro /wp-admin/admin.php?page=pp-capabilities-dashboard-menu-upgrade-link3.4136.48

Server storage [IO: ▲2.76MB] [DB: ▲0.01MB] Passed 3 tests

Input-output and database impact of this plugin
This plugin installed successfully
Filesystem: 218 new files
Database: no new tables, 9 new options
New WordPress options
widget_theysaidso_widget
PUBLISHPRESS_CAPS_VERSION
widget_recent-comments
capsman_version
capability-manager-enhanced_wp_reviews_installed_on
db_upgraded
can_compress_scripts
theysaidso_admin_options
widget_recent-posts

Browser metrics Passed 4 tests

This is an overview of browser requirements for PublishPress Capabilities - User Role Editor, Access Permissions, Admin Menus
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,864 ▲10214.67 ▲0.401.70 ▼0.0434.55 ▼11.11
Dashboard /wp-admin2,272 ▲955.60 ▲0.0694.66 ▼4.0148.61 ▲5.56
Posts /wp-admin/edit.php2,180 ▲772.02 ▲0.0843.54 ▲3.7338.12 ▲3.67
Add New Post /wp-admin/post-new.php1,584 ▲5823.01 ▲0.04664.80 ▼60.5154.02 ▼7.24
Media Library /wp-admin/upload.php1,474 ▲774.34 ▲0.1999.62 ▼17.6444.81 ▼1.33
Capabilities /wp-admin/admin.php?page=pp-capabilities5,7952.3049.9748.00
Admin Features /wp-admin/admin.php?page=pp-capabilities-admin-features2,2612.1733.1554.81
Settings /wp-admin/admin.php?page=pp-capabilities-settings1,4212.1836.3242.98
Roles /wp-admin/admin.php?page=pp-capabilities-roles1,4911.9931.5743.66
Nav Menus /wp-admin/admin.php?page=pp-capabilities-nav-menus1,3441.8529.8741.97
Admin Menus /wp-admin/admin.php?page=pp-capabilities-admin-menus1,0381.8528.0555.09
Editor Features /wp-admin/admin.php?page=pp-capabilities-editor-features2,8321.9230.1048.60
Backup /wp-admin/admin.php?page=pp-capabilities-backup2,0321.8729.7044.37
Profile Features /wp-admin/admin.php?page=pp-capabilities-profile-features1,3742.0933.4744.87
Upgrade to Pro /wp-admin/admin.php?page=pp-capabilities-dashboard-menu-upgrade-link2,7242.4945.8881.59

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
These items require your attention
  • Zombie WordPress options detected upon uninstall: 9 options
    • widget_recent-comments
    • capsman_version
    • capability-manager-enhanced_wp_reviews_installed_on
    • PUBLISHPRESS_CAPS_VERSION
    • db_upgraded
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-posts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please fix the following
  • 31× PHP files perform the task of outputting text when accessed with GET requests (only 10 are shown):
    • > /wp-content/plugins/capability-manager-enhanced/includes/plugin-capabilities/publishpress.php
    • > /wp-content/plugins/capability-manager-enhanced/includes/plugin-capabilities/backwpup.php
    • > /wp-content/plugins/capability-manager-enhanced/includes/plugin-capabilities/fluent-forms.php
    • > /wp-content/plugins/capability-manager-enhanced/includes/plugin-capabilities/sfwd-lms.php
    • > /wp-content/plugins/capability-manager-enhanced/includes/plugin-capabilities/give.php
    • > /wp-content/plugins/capability-manager-enhanced/includes/plugin-capabilities/seo-by-rank-math.php
    • > /wp-content/plugins/capability-manager-enhanced/lib/vendor/publishpress/wordpress-version-notices/templates/menu-link/menu-link-script.php
    • > /wp-content/plugins/capability-manager-enhanced/includes/plugin-capabilities/google-site-kit.php
    • > /wp-content/plugins/capability-manager-enhanced/includes/plugin-capabilities/buddypress.php
    • > /wp-content/plugins/capability-manager-enhanced/includes/plugin-capabilities/gravityview.php
  • 69× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Warning
      require_once(./includes/features/frontend-features/frontend-features-data.php): failed to open stream: No such file or directory in wp-content/plugins/capability-manager-enhanced/includes/features/frontend-features/frontend-features.php on line 24
    • > PHP Fatal error
      Uncaught Error: Class 'PP_Capabilities_Test_User' not found in wp-content/plugins/capability-manager-enhanced/includes/test-user-ui.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/capability-manager-enhanced/includes/manager.php:36
    • > PHP Warning
      Use of undefined constant CME_FILE - assumed 'CME_FILE' (this will throw an Error in a future version of PHP) in wp-content/plugins/capability-manager-enhanced/includes/features/frontend-features/frontend-features.php on line 24
    • > PHP Fatal error
      Uncaught Error: Interface 'PublishPress\\Psr\\Container\otFoundExceptionInterface' not found in wp-content/plugins/capability-manager-enhanced/lib/vendor/publishpress/pimple-pimple/lib/pimple/pimple/src/Pimple/Exception/UnknownIdentifierException.php:39
    • > PHP Warning
      require_once(./includes/features/frontend-features/frontend-features-data.php): failed to open stream: No such file or directory in wp-content/plugins/capability-manager-enhanced/includes/features/frontend-features/frontend-features-metaboxes.php on line 7
    • > PHP Fatal error
      require_once(): Failed opening required './includes/features/restrict-editor-features.php' (include_path='.:/usr/share/php') in wp-content/plugins/capability-manager-enhanced/includes/features/editor-features.php on line 21
    • > PHP Notice
      Trying to get property 'roles' of non-object in wp-content/plugins/capability-manager-enhanced/includes/features/nav-menus.php on line 22
    • > PHP Warning
      Class 'PublishPress\\WordpressVersionNotices\\Template\\TemplateLoaderInterface' not found in wp-content/plugins/capability-manager-enhanced/lib/vendor/publishpress/wordpress-version-notices/src/deprecated.php on line 29
    • > PHP Fatal error
      require_once(): Failed opening required './includes/features/restrict-admin-features.php' (include_path='.:/usr/share/php') in wp-content/plugins/capability-manager-enhanced/includes/features/admin-features.php on line 21

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
These attributes need to be fixed:
  • Tags: You are using too many tags: 30 tag instead of maximum 10
Please take inspiration from this readme.txt

capability-manager-enhanced/capsman-enhanced.php 85% from 13 tests

The primary PHP file in "PublishPress Capabilities - User Role Editor, Access Permissions, Admin Menus" version 2.10.2 is used by WordPress to initiate all plugin functionality
It is important to fix the following:
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6
  • Main file name: The principal plugin file should be the same as the plugin slug ("capability-manager-enhanced.php" instead of "capsman-enhanced.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
No dangerous file extensions were detected33,916 lines of code in 175 files:
LanguageFilesBlank linesComment linesLines of code
PHP1443,5024,88015,883
PO File94,2635,39311,457
JavaScript94202613,567
CSS95081342,514
JSON300476
Markdown14019

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.55
Average class complexity27.01
▷ Minimum class complexity1.00
▷ Maximum class complexity291.00
Average method complexity4.82
▷ Minimum method complexity1.00
▷ Maximum method complexity69.00
Code structure
Namespaces18
Interfaces6
Traits0
Classes65
▷ Abstract classes11.54%
▷ Concrete classes6498.46%
▷ Final classes23.12%
Methods474
▷ Static methods10321.73%
▷ Public methods38681.43%
▷ Protected methods336.96%
▷ Private methods5511.60%
Functions157
▷ Named functions9560.51%
▷ Anonymous functions6239.49%
Constants30
▷ Global constants2273.33%
▷ Class constants826.67%
▷ Public constants8100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
7 PNG files occupy 0.08MB with 0.03MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
common/libs/chosen-v1.8.7/chosen-sprite.png0.53KB0.88KB0.00%
images/play.png2.08KB1.10KB▼ 46.87%
common/img/publishpress-logo.png8.69KB8.91KB0.00%
common/img/publishpress-logo-icon.png13.05KB4.10KB▼ 68.61%
common/img/capabilities-wp-logo.png40.38KB21.28KB▼ 47.29%