94% adjust-admin-categories

Code Review | Adjust Admin Categories

WordPress plugin Adjust Admin Categories scored 94% from 54 tests.

About plugin

  • Plugin page: adjust-admin-cate...
  • Plugin version: 2.2.5
  • PHP version: 7.4.16
  • WordPress version: 5.9.2
  • First release: Aug 20, 2014
  • Latest release: Feb 16, 2022
  • Number of updates: 129
  • Update frequency: every 21.2 days
  • Top authors: kanakogi (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

10,000+ active / 38,181 total downloads

Benchmarks

Plugin footprint Passed 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.03MB] [CPU: ▼301.14ms] Passed 4 tests

Analyzing server-side resources used by Adjust Admin Categories
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.64 ▲0.1259.15 ▼2.55
Dashboard /wp-admin3.47 ▲0.0640.75 ▼5.74
Posts /wp-admin/edit.php3.70 ▲0.0660.65 ▲7.22
Add New Post /wp-admin/post-new.php6.94 ▼0.04100.31 ▼1,203.48
Media Library /wp-admin/upload.php3.35 ▲0.0550.77 ▲26.33
Adjust Categories /wp-admin/options-general.php?page=adjust_admin_categories3.3624.54

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

How much does this plugin use your filesystem and database?
The plugin installed successfully
Filesystem: 11 new files
Database: no new tables, 1 new option
New WordPress options
aac_options

Browser metrics Passed 4 tests

A check of browser resources used by Adjust Admin Categories
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,790 ▲3315.27 ▼0.376.14 ▼0.302.32 ▼0.39
Dashboard /wp-admin2,897 ▲376.15 ▼0.09118.83 ▼5.60159.10 ▼6.56
Posts /wp-admin/edit.php2,665 ▼293.24 ▲0.0073.94 ▼12.10139.80 ▼1.86
Add New Post /wp-admin/post-new.php1,664 ▲416.10 ▼0.91428.51 ▼56.55179.36 ▲31.02
Media Library /wp-admin/upload.php1,703 ▲25.50 ▼0.00153.08 ▲11.86205.24 ▲26.70
Adjust Categories /wp-admin/options-general.php?page=adjust_admin_categories2,0102.6360.56194.04

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
Uninstall script ran successfully

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)
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 fix the following
  • 8× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Warning
      require_once(AAC_PLUGIN_DIR/admin/admin-functions.php): failed to open stream: No such file or directory in wp-content/plugins/adjust-admin-categories/admin/admin.php on line 2
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATH/wp-admin/includes/template.php' (include_path='.:/usr/share/php') in wp-content/plugins/adjust-admin-categories/includes/class-category-checklist.php on line 2
    • > PHP Warning
      require_once(ABSPATH/wp-admin/includes/template.php): failed to open stream: No such file or directory in wp-content/plugins/adjust-admin-categories/includes/class-category-checklist.php on line 2
    • > PHP Warning
      Use of undefined constant AAC_PLUGIN_DIR - assumed 'AAC_PLUGIN_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/adjust-admin-categories/admin/admin.php on line 2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function delete_option() in wp-content/plugins/adjust-admin-categories/uninstall.php:10
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/adjust-admin-categories/includes/class-category-checklist.php on line 2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_basename() in wp-content/plugins/adjust-admin-categories/adjust-admin-categories.php:13
    • > PHP Fatal error
      require_once(): Failed opening required 'AAC_PLUGIN_DIR/admin/admin-functions.php' (include_path='.:/usr/share/php') in wp-content/plugins/adjust-admin-categories/admin/admin.php on line 2

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
Please fix the following attributes:
  • Requires at least: Invalid plugin version format
The official readme.txt might help

adjust-admin-categories/adjust-admin-categories.php 92% from 13 tests

This is the main PHP file of "Adjust Admin Categories" version 2.2.5, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
Please make the necessary changes and fix the following:
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Good job! No executable or dangerous file extensions detected480 lines of code in 9 files:
LanguageFilesBlank linesComment linesLines of code
PHP56780367
PO File111140
JavaScript2171037
CSS11036

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.37
Average class complexity16.50
▷ Minimum class complexity14.00
▷ Maximum class complexity19.00
Average method complexity2.94
▷ Minimum method complexity1.00
▷ Maximum method complexity14.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods16
▷ Static methods00.00%
▷ Public methods16100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.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
No PNG files were detected