84% adjust-admin-categories

Code Review | Adjust Admin Categories

WordPress plugin Adjust Admin Categories scored84%from 54 tests.

About plugin

  • Plugin page: adjust-admin-cate...
  • Plugin version: 2.2.6
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: Aug 20, 2014
  • Latest release: Jun 27, 2022
  • Number of updates: 131
  • Update frequency: every 21.9 days
  • Top authors: kanakogi (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

10,000+ active /54,954 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲0.06MB] [CPU: ▼4.78ms] Passed 4 tests

Analyzing server-side resources used by Adjust Admin Categories
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.52 ▲0.0640.06 ▼3.24
Dashboard /wp-admin3.36 ▲0.0549.82 ▼1.94
Posts /wp-admin/edit.php3.47 ▲0.1247.33 ▼9.96
Add New Post /wp-admin/post-new.php5.94 ▲0.0587.50 ▼3.60
Media Library /wp-admin/upload.php3.28 ▲0.0536.06 ▼2.32
Adjust Categories /wp-admin/options-general.php?page=adjust_admin_categories3.2935.58

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

Filesystem and database footprint
The plugin installed successfully
Filesystem: 11 new files
Database: no new tables, 7 new options
New WordPress options
db_upgraded
aac_options
widget_recent-posts
widget_theysaidso_widget
can_compress_scripts
theysaidso_admin_options
widget_recent-comments

Browser metrics Passed 4 tests

Adjust Admin Categories: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,793 ▲4714.34 ▲0.411.70 ▼0.9240.63 ▼7.17
Dashboard /wp-admin2,202 ▲285.59 ▲0.0684.84 ▼17.2239.68 ▼5.98
Posts /wp-admin/edit.php2,106 ▲32.00 ▼0.0235.08 ▼4.0533.26 ▼5.81
Add New Post /wp-admin/post-new.php1,530 ▲423.42 ▲0.41609.95 ▼95.4650.32 ▼13.74
Media Library /wp-admin/upload.php1,398 ▼24.21 ▲0.0197.25 ▼15.7645.15 ▼1.36
Adjust Categories /wp-admin/options-general.php?page=adjust_admin_categories1,5551.6725.3728.74

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
You still need to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_recent-posts
    • can_compress_scripts
    • widget_theysaidso_widget

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)
Even though no errors were found, this is by no means an exhaustive test

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
Almost there! Just fix the following items
  • 8× PHP files trigger server errors when accessed directly:
    • > 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
      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 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 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 plugin_basename() in wp-content/plugins/adjust-admin-categories/adjust-admin-categories.php:13
    • > 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 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 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 | This is a shallow check for browser errors
There were no browser issues found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
Please fix the following attributes:
  • Requires at least: The plugin version is formatted incorrectly
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.6, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
It is important to fix the following:
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
There were no executable files found in this plugin480 lines of code in 9 files:
LanguageFilesBlank linesComment linesLines of code
PHP56780367
PO File111140
JavaScript2171037
CSS11036

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.36
Average class complexity16.00
▷ Minimum class complexity13.00
▷ Maximum class complexity19.00
Average method complexity2.88
▷ Minimum method complexity1.00
▷ Maximum method complexity13.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

Often times overlooked, PNG files can occupy unnecessary space in your plugin
PNG images were not found in this plugin