83% admin-users-advances-permissions

Code Review | Admin users advanced permissions

WordPress plugin Admin users advanced permissions scored83%from 54 tests.

About plugin

  • Plugin page: admin-users-advan...
  • Plugin version: 1.03
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.0
  • WordPress version: 6.3.1
  • First release: Nov 14, 2014
  • Latest release: Nov 19, 2014
  • Number of updates: 12
  • Update frequency: every 0.4 days
  • Top authors: mr_mat (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,665 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed gracefully, with no errors

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

Server-side resources used by Admin users advanced permissions
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0443.77 ▼1.52
Dashboard /wp-admin3.34 ▲0.0349.78 ▼3.32
Posts /wp-admin/edit.php3.39 ▲0.0349.67 ▲0.05
Add New Post /wp-admin/post-new.php5.92 ▲0.0390.46 ▼6.36
Media Library /wp-admin/upload.php3.26 ▲0.0334.97 ▼1.28

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

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 10 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
can_compress_scripts
theysaidso_admin_options
widget_theysaidso_widget
db_upgraded
widget_recent-comments

Browser metrics Passed 4 tests

Checking browser requirements for Admin users advanced permissions
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.21 ▼0.051.76 ▼0.0046.65 ▲1.30
Dashboard /wp-admin2,195 ▲215.59 ▲0.0889.68 ▼14.4137.56 ▼6.98
Posts /wp-admin/edit.php2,100 ▼02.00 ▲0.0539.97 ▲3.3834.78 ▼3.72
Add New Post /wp-admin/post-new.php1,526 ▼223.07 ▲0.03671.37 ▼2.1748.70 ▼4.05
Media Library /wp-admin/upload.php1,400 ▼34.20 ▼0.0295.99 ▼12.6841.08 ▼7.03

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The following items require your attention
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-comments
    • can_compress_scripts
    • widget_recent-posts
    • widget_theysaidso_widget
    • db_upgraded
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
The smoke test was a success, however most plugin functionality was not tested

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please fix the following items
  • 3× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/admin-users-advances-permissions/inc/admin-restrict-cat-tax.php:31
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/admin-users-advances-permissions/inc/admin-users.php:39
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/admin-users-advances-permissions/admin-users-advanced-permissions.php:13

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser errors were detected

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Attributes that need to be fixed:
  • Screenshots: Add an image for screenshot #1 (Setting permission on new user form or user edit form)
  • Plugin Name: "Plugin Name" should be replaced with the name of your plugin on the first line ( === admin-users-advances-permissions === )
The official readme.txt is a good inspiration

admin-users-advances-permissions/admin-users-advanced-permissions.php 92% from 13 tests

"Admin users advanced permissions" version 1.03's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
It is important to fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("admin-users-advances-permissions.php" instead of "admin-users-advanced-permissions.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Good job! No executable or dangerous file extensions detected179 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
PHP42539127
JavaScript14630
PO File13522

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.50
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%
Functions8
▷ Named functions8100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants3100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
1 PNG file occupies 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png24.06KB10.68KB▼ 55.61%