10% collapsing-categories

Code Review | Collapsing Categories

WordPress plugin Collapsing Categories scored10%from 54 tests.

About plugin

  • Plugin page: collapsing-catego...
  • Plugin version: 3.0.8
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.4.1
  • WordPress version: 6.3.1
  • First release: Jan 7, 2008
  • Latest release: Dec 1, 2023
  • Number of updates: 489
  • Update frequency: every 11.9 days
  • Top authors: robfelty (100%)

Code review

54 tests

User reviews

56 reviews

Install metrics

6,000+ active /271,730 total downloads

Benchmarks

Plugin footprint 58% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The following installer errors require your attention
  • The plugin cannot be installed
    • > Notice in wp-content/plugins/collapsing-categories/collapscat.php+57
    compact(): Undefined variable: selected

Server metrics [RAM: ▲0.17MB] [CPU: ▼3.05ms] Passed 4 tests

An overview of server-side resources used by Collapsing Categories
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.64 ▲0.1738.30 ▼3.36
Dashboard /wp-admin3.47 ▲0.1649.62 ▼1.68
Posts /wp-admin/edit.php3.59 ▲0.2248.08 ▲0.50
Add New Post /wp-admin/post-new.php6.06 ▲0.1790.09 ▼7.65
Media Library /wp-admin/upload.php3.40 ▲0.1637.40 ▲3.56

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

Filesystem and database footprint
This plugin installed successfully
Filesystem: 35 new files
Database: no new tables, 12 new options
New WordPress options
theysaidso_admin_options
collapsCatOptions
collapsCatDefaultStyles
widget_recent-posts
db_upgraded
collapsCatStyle
can_compress_scripts
collapsCatSidebarId
widget_theysaidso_widget
widget_recent-comments
...

Browser metrics Passed 4 tests

This is an overview of browser requirements for Collapsing Categories
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,793 ▲3114.67 ▲0.411.52 ▼0.0836.12 ▼8.48
Dashboard /wp-admin2,198 ▲185.58 ▼0.0793.72 ▲2.5341.81 ▲1.51
Posts /wp-admin/edit.php2,103 ▲31.98 ▼0.0239.29 ▼1.3735.80 ▼0.88
Add New Post /wp-admin/post-new.php6,366 ▲4,84027.52 ▲4.56822.38 ▲199.9963.37 ▲15.02
Media Library /wp-admin/upload.php1,400 ▲34.20 ▲0.0196.42 ▼3.2242.81 ▼0.42

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 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
  • Zombie WordPress options were found after uninstall: 12 options
    • collapsCatSidebarId
    • can_compress_scripts
    • collapsCatOptions
    • widget_recent-posts
    • collapsCatVersion
    • widget_theysaidso_widget
    • collapsCatDefaultStyles
    • collapsCatOrigStyle
    • db_upgraded
    • collapsCatStyle
    • ...

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 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
The following issues need your attention
  • 9× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Notice
      Undefined variable: expand in wp-content/plugins/collapsing-categories/symbols.php on line 15
    • > PHP Notice
      Undefined variable: expand in wp-content/plugins/collapsing-categories/symbols.php on line 8
    • > PHP Notice
      Undefined variable: number in wp-content/plugins/collapsing-categories/processOptions.php on line 2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/collapsing-categories/collapscat.php:34
    • > PHP Notice
      Undefined variable: expand in wp-content/plugins/collapsing-categories/symbols.php on line 5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/collapsing-categories/processOptions.php:33
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/collapsing-categories/defaults.php:3
    • > PHP Notice
      Undefined variable: expand in wp-content/plugins/collapsing-categories/symbols.php on line 18
    • > PHP Notice
      Undefined variable: expand in wp-content/plugins/collapsing-categories/symbols.php on line 2

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
Attributes that need to be fixed:
  • Screenshots: Screenshot #3 (Advanced options) image missing
You can take inspiration from this readme.txt

collapsing-categories/collapscat.php 85% from 13 tests

This is the main PHP file of "Collapsing Categories" version 3.0.8, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
The following require your attention:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("collapsing-categories.php" instead of "collapscat.php")
  • Description: The description should be shorter than 140 characters (currently 291 characters long)

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
There were no executable files found in this plugin1,851 lines of code in 22 files:
LanguageFilesBlank linesComment linesLines of code
PHP7661041,183
JavaScript62281470
PO File23217090
JSON20076
Sass22018
Bourne Again Shell12113
CSS2101

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.52
Average class complexity27.00
▷ Minimum class complexity27.00
▷ Maximum class complexity27.00
Average method complexity4.25
▷ Minimum method complexity1.00
▷ Maximum method complexity12.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods8
▷ Static methods8100.00%
▷ Public methods675.00%
▷ Protected methods00.00%
▷ Private methods225.00%
Functions18
▷ Named functions1794.44%
▷ Anonymous functions15.56%
Constants0
▷ Global constants00.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
6 PNG files occupy 0.34MB with 0.15MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
img/default.png2.18KB1.59KB▼ 26.95%
img/custom.png3.12KB1.94KB▼ 37.83%
img/block.png2.14KB1.59KB▼ 25.69%
screenshot-1.png73.78KB25.04KB▼ 66.06%
screenshot-2.png266.92KB83.09KB▼ 68.87%