10% collapsing-archives

Code Review | Collapsing Categories

WordPress plugin Collapsing Categories scored10%from 54 tests.

About plugin

  • Plugin page: collapsing-archives
  • 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: 312
  • Update frequency: every 18.6 days
  • Top authors: robfelty (100%)

Code review

54 tests

User reviews

19 reviews

Install metrics

4,000+ active /130,169 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
It is recommended to fix the following installer errors
  • This plugin did not install gracefully
    • > Notice in wp-content/plugins/collapsing-archives/collapscat.php+57
    compact(): Undefined variable: selected

Server metrics [RAM: ▲0.16MB] [CPU: ▼4.15ms] Passed 4 tests

Server-side resources used by Collapsing Categories
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.64 ▲0.1741.22 ▼0.65
Dashboard /wp-admin3.47 ▲0.1247.88 ▼12.85
Posts /wp-admin/edit.php3.58 ▲0.2248.35 ▲3.43
Add New Post /wp-admin/post-new.php6.06 ▲0.1790.85 ▼6.52
Media Library /wp-admin/upload.php3.39 ▲0.1635.21 ▲3.49

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 35 new files
Database: no new tables, 12 new options
New WordPress options
theysaidso_admin_options
collapsCatVersion
can_compress_scripts
widget_recent-posts
db_upgraded
collapsCatOrigStyle
collapsCatDefaultStyles
widget_recent-comments
widget_theysaidso_widget
collapsCatSidebarId
...

Browser metrics Passed 4 tests

Checking browser requirements for Collapsing Categories
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,793 ▲2114.24 ▼0.101.81 ▼0.0442.68 ▼0.97
Dashboard /wp-admin2,198 ▲185.67 ▼0.0090.92 ▼2.3140.36 ▼5.07
Posts /wp-admin/edit.php2,103 ▲32.09 ▲0.1038.78 ▲3.5036.14 ▲2.95
Add New Post /wp-admin/post-new.php6,366 ▲4,83527.60 ▲4.84928.19 ▲266.3263.89 ▲10.51
Media Library /wp-admin/upload.php1,403 ▼04.19 ▼0.0093.14 ▼1.1238.97 ▼2.54

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
These items require your attention
  • Zombie WordPress options were found after uninstall: 12 options
    • widget_recent-comments
    • collapsCatDefaultStyles
    • collapsCatOptions
    • collapsCatStyle
    • widget_theysaidso_widget
    • collapsCatOrigStyle
    • can_compress_scripts
    • collapsCatVersion
    • db_upgraded
    • widget_recent-posts
    • ...

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please take a closer look at the following
  • 9× PHP files trigger server errors when accessed directly:
    • > PHP Notice
      Undefined variable: expand in wp-content/plugins/collapsing-archives/symbols.php on line 5
    • > PHP Notice
      Undefined variable: expand in wp-content/plugins/collapsing-archives/symbols.php on line 2
    • > PHP Notice
      Undefined variable: number in wp-content/plugins/collapsing-archives/processOptions.php on line 2
    • > PHP Notice
      Undefined variable: expand in wp-content/plugins/collapsing-archives/symbols.php on line 8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/collapsing-archives/collapscat.php:34
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/collapsing-archives/defaults.php:3
    • > PHP Notice
      Undefined variable: expand in wp-content/plugins/collapsing-archives/symbols.php on line 18
    • > PHP Notice
      Undefined variable: expand in wp-content/plugins/collapsing-archives/symbols.php on line 15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/collapsing-archives/processOptions.php:33

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 describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
Attributes that require attention:
  • Screenshots: Please add an image for screenshot #3 (Advanced options)
Please take inspiration from this readme.txt

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

"Collapsing Categories" version 3.0.8's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
It is important to fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("collapsing-archives.php" instead of "collapscat.php")
  • Description: If Twitter did it, so should we! Keep the description under 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

Cyclomatic complexity and code structure are the fingerprint of this plugin
Great job! No cyclomatic complexity issues were detected in 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/custom.png3.12KB1.94KB▼ 37.83%
img/default.png2.18KB1.59KB▼ 26.95%
screenshot-2.png266.92KB83.09KB▼ 68.87%
img/block.png2.14KB1.59KB▼ 25.69%
screenshot-1.png73.78KB25.04KB▼ 66.06%