79% controlled-admin-access

Code Review | Controlled Admin Access

WordPress plugin Controlled Admin Access scored 79% from 54 tests.

About plugin

  • Plugin page: controlled-admin-...
  • Plugin version: 2.0.13
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-6.3
  • WordPress version: 6.3.1
  • First release: Dec 6, 2015
  • Latest release: Aug 12, 2023
  • Number of updates: 122
  • Update frequency: every 23.0 days
  • Top authors: waseem_senjer (100%)

Code review

54 tests

User reviews

39 reviews

Install metrics

10,000+ active / 133,167 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Installer ran successfully

Server metrics [RAM: ▲0.33MB] [CPU: ▲0.68ms] Passed 4 tests

Server-side resources used by Controlled Admin Access
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.79 ▲0.3243.32 ▼1.27
Dashboard /wp-admin3.66 ▲0.3651.76 ▲5.39
Posts /wp-admin/edit.php3.71 ▲0.3656.49 ▲13.21
Add New Post /wp-admin/post-new.php6.18 ▲0.2991.51 ▼11.67
Media Library /wp-admin/upload.php3.59 ▲0.3643.63 ▲10.25

Server storage [IO: ▲0.27MB] [DB: ▲0.34MB] Passed 3 tests

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 42 new files
Database: no new tables, 9 new options
New WordPress options
widget_recent-posts
_wpruby_caa_lite_latest_migrated_version
theysaidso_admin_options
widget_recent-comments
db_upgraded
can_compress_scripts
_wpruby_caa_lite_migration_200
widget_theysaidso_widget
_caa_all_menu_slugs

Browser metrics Passed 4 tests

Controlled Admin Access: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,812 ▲6613.33 ▼0.921.71 ▼0.6345.35 ▲1.59
Dashboard /wp-admin2,221 ▲304.87 ▼0.0197.79 ▼2.9737.89 ▼8.67
Posts /wp-admin/edit.php2,101 ▲122.01 ▼0.0139.38 ▲3.6233.66 ▲0.71
Add New Post /wp-admin/post-new.php1,543 ▲123.57 ▲5.37666.83 ▲57.0355.64 ▲1.24
Media Library /wp-admin/upload.php1,403 ▲124.20 ▲0.0197.14 ▲0.7443.14 ▲2.10

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
You still need to fix the following
  • This plugin did not uninstall successfully, leaving 9 options in the database
    • _wpruby_caa_lite_latest_migrated_version
    • theysaidso_admin_options
    • can_compress_scripts
    • _caa_all_menu_slugs
    • widget_theysaidso_widget
    • _wpruby_caa_lite_migration_200
    • widget_recent-posts
    • db_upgraded
    • widget_recent-comments

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please fix the following
  • 1× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/controlled-admin-access/core/app/backend/endpoints/views/view-email-login-link.php
  • 18× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Warning
      require_once(ABSPATHWPINC/user.php): failed to open stream: No such file or directory in wp-content/plugins/controlled-admin-access/core/app/backend/endpoints/class-delete-user-endpoint.php on line 5
    • > PHP Fatal error
      Uncaught Error: Class 'WPRuby_CAA\\Core\\App\\Backend\\Endpoints\\Abstract_Endpoint' not found in wp-content/plugins/controlled-admin-access/core/app/backend/endpoints/class-get-settings-endpoint.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_bloginfo() in wp-content/plugins/controlled-admin-access/core/app/backend/endpoints/views/view-email-login-link.php:118
    • > PHP Fatal error
      Uncaught Error: Class 'WPRuby_CAA\\Core\\App\\Backend\\Endpoints\\Abstract_Endpoint' not found in wp-content/plugins/controlled-admin-access/core/app/backend/endpoints/class-deactivate-user-endpoint.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_current_user_id() in wp-content/plugins/controlled-admin-access/core/app/frontend/views/app.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'WPRuby_CAA\\Core\\App\\Backend\\Endpoints\\Abstract_Endpoint' not found in wp-content/plugins/controlled-admin-access/core/app/backend/endpoints/class-get-user-endpoint.php:8
    • > PHP Notice
      Undefined variable: nonce in wp-content/plugins/controlled-admin-access/core/app/frontend/views/app.php on line 2
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHWPINC/user.php' (include_path='.:/usr/share/php') in wp-content/plugins/controlled-admin-access/core/app/backend/endpoints/class-delete-user-endpoint.php on line 5
    • > PHP Fatal error
      Uncaught Error: Class 'WPRuby_CAA\\Core\\App\\Backend\\Endpoints\\Abstract_Endpoint' not found in wp-content/plugins/controlled-admin-access/core/app/backend/endpoints/class-activate-user-endpoint.php:8
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/controlled-admin-access/core/app/backend/endpoints/class-delete-user-endpoint.php on line 5

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 Passed 29 tests

readme.txt Passed 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
9 plugin tags: access, post, access manager, user, page...

controlled-admin-access/controlled-admin-access.php Passed 13 tests

This is the main PHP file of "Controlled Admin Access" version 2.0.13, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
49 characters long description:
Grant a temporary limited admin access to others.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Good job! No executable or dangerous file extensions detected1,594 lines of code in 36 files:
LanguageFilesBlank linesComment linesLines of code
PHP335022941,459
PO File15470131
JavaScript10113
CSS1001

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.27
Average class complexity5.31
▷ Minimum class complexity1.00
▷ Maximum class complexity18.00
Average method complexity1.86
▷ Minimum method complexity1.00
▷ Maximum method complexity14.00
Code structure
Namespaces8
Interfaces1
Traits0
Classes28
▷ Abstract classes13.57%
▷ Concrete classes2796.43%
▷ Final classes00.00%
Methods135
▷ Static methods1410.37%
▷ Public methods11887.41%
▷ Protected methods42.96%
▷ Private methods139.63%
Functions7
▷ Named functions00.00%
▷ Anonymous functions7100.00%
Constants14
▷ Global constants00.00%
▷ Class constants14100.00%
▷ Public constants14100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
1 PNG file occupies 0.03MB with 0.02MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
core/app/frontend/views/internal-plugins-pages.png28.33KB11.53KB▼ 59.29%