78% jquery-collapse-o-matic

Code Review | Collapse-O-Matic

WordPress plugin Collapse-O-Matic scored78%from 54 tests.

About plugin

  • Plugin page: jquery-collapse-o...
  • Plugin version: 1.8.5.5
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.9-6.3.1
  • WordPress version: 6.3.1
  • First release: Nov 19, 2010
  • Latest release: Sep 2, 2023
  • Number of updates: 199
  • Update frequency: every 23.5 days
  • Top authors: baden03 (100%)

Code review

54 tests

User reviews

235 reviews

Install metrics

50,000+ active /1,230,603 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.03MB] [CPU: ▼2.91ms] Passed 4 tests

A check of server-side resources used by Collapse-O-Matic
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0341.80 ▲3.96
Dashboard /wp-admin3.33 ▲0.0346.49 ▼2.22
Posts /wp-admin/edit.php3.38 ▲0.0345.39 ▲5.03
Add New Post /wp-admin/post-new.php5.91 ▲0.0383.72 ▼13.56
Media Library /wp-admin/upload.php3.26 ▲0.0333.76 ▲0.17
Collapse-O-Matic /wp-admin/options-general.php?page=collapse-o-matic-options3.2329.58

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

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

Browser metrics Passed 4 tests

Collapse-O-Matic: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,906 ▲14513.51 ▼0.849.71 ▲8.0644.19 ▲1.16
Dashboard /wp-admin2,196 ▲165.63 ▼0.0396.34 ▲9.6841.39 ▲1.76
Posts /wp-admin/edit.php2,104 ▲11.97 ▼0.0334.48 ▼6.6134.03 ▼3.08
Add New Post /wp-admin/post-new.php1,538 ▲1018.84 ▼4.16631.06 ▲31.4966.46 ▲18.83
Media Library /wp-admin/upload.php1,407 ▲74.16 ▼0.1198.01 ▼0.7341.15 ▼1.40
Collapse-O-Matic /wp-admin/options-general.php?page=collapse-o-matic-options1,88910.60346.4068.99

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The following items require your attention
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-comments
    • widget_recent-posts
    • theysaidso_admin_options
    • db_upgraded
    • can_compress_scripts
    • widget_theysaidso_widget

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Good news, no errors were detected

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
The following issues need your attention
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/jquery-collapse-o-matic/collapse-o-matic.php:851

User-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Please fix the following browser errors
    • > GET request to /wp-admin/options-general.php?page=collapse-o-matic-options
    • > Network (severe)
    wp-content/plugins/jquery-collapse-o-matic/css/admin_style.css?ver=1.0.0 - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/options-general.php?page=collapse-o-matic-options
    • > Network (severe)
    wp-content/plugins/jquery-collapse-o-matic/images/collapse-o-matic-icon.png - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
These attributes need to be fixed:
  • Tags: There are too many tags (19 tag instead of maximum 10)
The official readme.txt might help

jquery-collapse-o-matic/collapse-o-matic.php 92% from 13 tests

The entry point to "Collapse-O-Matic" version 1.8.5.5 is a PHP file that has certain tags in its header comment area
You should first fix the following items:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("jquery-collapse-o-matic.php" instead of "collapse-o-matic.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Good job! No executable or dangerous file extensions detected1,369 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code
PHP19498753
JavaScript29789486
CSS30099
Markdown17031

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.42
Average class complexity110.00
▷ Minimum class complexity110.00
▷ Maximum class complexity110.00
Average method complexity10.91
▷ Minimum method complexity1.00
▷ Maximum method complexity69.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods11
▷ Static methods00.00%
▷ Public methods11100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
5 PNG files occupy 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
css/images/arrow-up-dark.png1.07KB0.24KB▼ 77.63%
css/images/collapse-o-matic-icon.png2.46KB1.75KB▼ 28.97%
css/images/arrow-down.png1.08KB0.24KB▼ 77.93%
css/images/arrow-down-dark.png1.07KB0.24KB▼ 77.65%
css/images/arrow-up.png1.08KB0.24KB▼ 77.83%