83% remove-admin-menus-by-role

Code Review | Remove admin menus by roles

WordPress plugin Remove admin menus by roles scored83%from 54 tests.

About plugin

  • Plugin page: remove-admin-menu...
  • Plugin version: 1.35
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-6.3
  • WordPress version: 6.3.1
  • First release: Feb 16, 2016
  • Latest release: Jul 31, 2023
  • Number of updates: 38
  • Update frequency: every 71.7 days
  • Top authors: manu225 (100%)

Code review

54 tests

User reviews

14 reviews

Install metrics

6,000+ active /48,548 total downloads

Benchmarks

Plugin footprint 83% from 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 gracefully, with no errors

Server metrics [RAM: ▲0.03MB] [CPU: ▼2.47ms] Passed 4 tests

An overview of server-side resources used by Remove admin menus by roles
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0235.46 ▼2.96
Dashboard /wp-admin3.34 ▲0.0343.44 ▼1.63
Posts /wp-admin/edit.php3.39 ▲0.0346.10 ▲0.61
Add New Post /wp-admin/post-new.php5.92 ▲0.0390.32 ▼5.89
Media Library /wp-admin/upload.php3.26 ▲0.0337.36 ▲0.72

Server storage [IO: ▲0.05MB] [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: 9 new files
Database: 1 new table, 6 new options
New tables
wp_remove_menu_admin_profiles
New WordPress options
db_upgraded
widget_recent-posts
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-comments
can_compress_scripts

Browser metrics Passed 4 tests

Remove admin menus by roles: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,813 ▲4213.78 ▼0.421.67 ▼0.3042.69 ▲3.67
Dashboard /wp-admin2,216 ▲334.95 ▲0.0399.90 ▼12.8177.50 ▲32.06
Posts /wp-admin/edit.php2,102 ▲131.99 ▼0.0439.39 ▲2.7438.46 ▲1.84
Add New Post /wp-admin/post-new.php1,526 ▲517.50 ▼5.57753.10 ▲60.6056.26 ▲2.70
Media Library /wp-admin/upload.php1,398 ▲104.13 ▼0.05117.72 ▲0.2547.92 ▼1.16

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 did not uninstall successfully, leaving 6 options in the database
    • can_compress_scripts
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-posts
    • widget_recent-comments
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
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
Please fix the following
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_activation_hook() in wp-content/plugins/remove-admin-menus-by-role/remove-admin-menus-by-role.php:14

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 81% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
These attributes need your attention:
  • Plugin Name: Please specify the plugin name on the first line ( === remove-admin-menus-by-role === )
  • Tags: Please reduce the number of tags, currently 20 tag instead of maximum 10
  • Screenshots: Please describe screenshot #1 in remove-admin-menus-by-role/assets to your readme.txt
The official readme.txt might help

remove-admin-menus-by-role/remove-admin-menus-by-role.php Passed 13 tests

The main PHP script in "Remove admin menus by roles" version 1.35 is automatically included on every request by WordPress
28 characters long description:
Remove admin menus by roles.

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
There were no executable files found in this plugin267 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP26217204
PO File191033
CSS12030

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.41
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions7
▷ Named functions7100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
3 PNG files occupy 0.03MB with 0.01MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/pro_version.png32.40KB10.34KB▼ 68.08%
images/fb.png1.59KB1.00KB▼ 37.42%
images/icon.png0.97KB0.99KB0.00%