64% civicrm-admin-utilities

Code Review | CiviCRM Admin Utilities

WordPress plugin CiviCRM Admin Utilities scored64%from 54 tests.

About plugin

  • Plugin page: civicrm-admin-uti...
  • Plugin version: 1.0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.9-6.2
  • WordPress version: 6.3.1
  • First release: Jan 19, 2015
  • Latest release: Jul 12, 2023
  • Number of updates: 101
  • Update frequency: every 30.7 days
  • Top authors: needle (100%)

Code review

54 tests

User reviews

6 reviews

Install metrics

1,000+ active /38,560 total downloads

Benchmarks

Plugin footprint 48% from 16 tests

Installer Passed 1 test

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

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

Analyzing server-side resources used by CiviCRM Admin Utilities
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0537.11 ▼5.22
Dashboard /wp-admin3.34 ▲0.0445.45 ▼2.09
Posts /wp-admin/edit.php3.39 ▲0.0449.31 ▲2.97
Add New Post /wp-admin/post-new.php5.92 ▲0.0487.06 ▼9.61
Media Library /wp-admin/upload.php3.26 ▲0.0435.19 ▼1.05

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 83 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
theysaidso_admin_options
db_upgraded
widget_recent-posts
can_compress_scripts
widget_theysaidso_widget

Browser metrics Passed 4 tests

A check of browser resources used by CiviCRM Admin Utilities
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲6513.24 ▼1.141.64 ▼0.3243.72 ▼2.41
Dashboard /wp-admin2,206 ▲185.82 ▲0.01103.87 ▼0.1338.98 ▼2.76
Posts /wp-admin/edit.php2,089 ▼32.03 ▼0.0234.07 ▼2.7633.85 ▼0.71
Add New Post /wp-admin/post-new.php1,537 ▲423.17 ▲0.21679.42 ▲4.6755.35 ▲4.89
Media Library /wp-admin/upload.php1,388 ▼34.25 ▲0.0595.57 ▼4.4141.63 ▼4.67

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
You still need to fix the following
  • This plugin cannot be uninstalled
    • > Error in wp-content/plugins/civicrm-admin-utilities/civicrm-admin-utilities.php+269
    Uncaught Error: Call to a member function deactivate_theme() on null in wp-content/plugins/civicrm-admin-utilities/civicrm-admin-utilities.php:269
    Stack trace:
    #0 wp-includes/class-wp-hook.php(310): CiviCRM_Admin_Utilities->deactivate()
    #1 wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters()
    #2 wp-includes/plugin.php(517): WP_Hook->do_action()
    #3 wp-admin/includes/plugin.php(816): do_action()
  • Incomplete uninstall procedure, leaving 83 files (1.25MB) in the plugin directory
    • (new file) assets/civicrm/template-menu/.editorconfig
    • (new file) assets/css/civicrm-admin-utilities-admin-5-3-plus.css
    • (new file) assets/civicrm/template-access/CRM/ACL/Form/WordPress/Permissions.tpl
    • (new file) assets/civicrm/template-nav/.editorconfig
    • (new file) assets/civicrm/template-menu/CRM/common/navigation.js.tpl
    • (new file) assets/civicrm/cautheme/civicrm-admin-utilities-resolver.php
    • (new file) assets/civicrm/template-access/.editorconfig
    • (new file) assets/civicrm/cautheme/civicrm-admin-utilities-theme.php
    • (new file) assets/civicrm/template-nav/CRM/common/navigation.js.tpl
    • (new file) assets/civicrm/.editorconfig
    • ...
  • This plugin does not fully uninstall, leaving 7 options in the database
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-posts
    • widget_theysaidso_widget
    • recovery_mode_email_last_sent
    • db_upgraded
    • widget_recent-comments

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: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please take a closer look at the following
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/civicrm-admin-utilities/assets/templates/metaboxes/site-metabox-access-form.php:2

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
5 plugin tags: civicrm, utility, menu, styling, admin

civicrm-admin-utilities/civicrm-admin-utilities.php Passed 13 tests

"CiviCRM Admin Utilities" version 1.0.1's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
93 characters long description:
Optionally modifies CiviCRM's behaviour and appearance in single site and multisite installs.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Everything looks great! No dangerous files found in this plugin13,961 lines of code in 58 files:
LanguageFilesBlank linesComment linesLines of code
CSS111,3476497,717
PHP382,3884,5485,124
JavaScript5190208641
Smarty32174413
HTML14566

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.38
Average class complexity75.22
▷ Minimum class complexity4.00
▷ Maximum class complexity244.00
Average method complexity3.27
▷ Minimum method complexity1.00
▷ Maximum method complexity29.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes9
▷ Abstract classes00.00%
▷ Concrete classes9100.00%
▷ Final classes00.00%
Methods266
▷ Static methods10.38%
▷ Public methods266100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions4
▷ Named functions250.00%
▷ Anonymous functions250.00%
Constants5
▷ Global constants5100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
4 PNG files occupy 0.01MB with 0.01MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/civicrm-legacy/stop-icon.png0.58KB0.46KB▼ 20.00%
assets/images/civicrm-legacy/contribute/cut_line.png5.23KB1.81KB▼ 65.45%
assets/js/twentytwenty/img/after.png3.12KB0.34KB▼ 89.24%
assets/js/twentytwenty/img/before.png3.23KB0.39KB▼ 87.91%