10% collapsing-pages

Code Review | Collapsing Pages

WordPress plugin Collapsing Pages scored10%from 54 tests.

About plugin

  • Plugin page: collapsing-pages
  • Plugin version: 2.0.2
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.4.1
  • WordPress version: 6.3.1
  • First release: Apr 29, 2008
  • Latest release: Dec 1, 2023
  • Number of updates: 172
  • Update frequency: every 33.1 days
  • Top authors: robfelty (93.6%)Bernhard Reiter (6.98%)

Code review

54 tests

User reviews

1 review

Install metrics

300+ active /38,355 total downloads

Benchmarks

Plugin footprint 58% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
These installer errors require your attention
  • Install procedure had errors
    • > Notice in wp-content/plugins/collapsing-pages/collapsPage.php+53
    compact(): Undefined variable: selected

Server metrics [RAM: ▲0.01MB] [CPU: ▼11.75ms] Passed 4 tests

An overview of server-side resources used by Collapsing Pages
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.43 ▼0.0425.94 ▼14.85
Dashboard /wp-admin3.35 ▼0.0043.75 ▼20.18
Posts /wp-admin/edit.php3.40 ▲0.0445.29 ▼2.00
Add New Post /wp-admin/post-new.php5.93 ▲0.0492.89 ▼9.97
Media Library /wp-admin/upload.php3.27 ▲0.0435.01 ▲0.78

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 63 new files
Database: no new tables, 11 new options
New WordPress options
collapsPageStyle
widget_recent-comments
collapsPageDefaultStyles
collapsPageVersion
theysaidso_admin_options
collapsPageOrigStyle
can_compress_scripts
collapsPageSidebarId
widget_theysaidso_widget
db_upgraded
...

Browser metrics Passed 4 tests

A check of browser resources used by Collapsing Pages
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,821 ▲7414.22 ▼0.421.98 ▲0.3136.19 ▼5.86
Dashboard /wp-admin2,198 ▲215.60 ▼0.0792.83 ▼5.8942.00 ▼4.56
Posts /wp-admin/edit.php2,100 ▼32.01 ▼0.0140.24 ▲4.1937.23 ▲3.07
Add New Post /wp-admin/post-new.php6,366 ▲4,84027.70 ▲4.52890.99 ▲297.5753.59 ▼9.04
Media Library /wp-admin/upload.php1,394 ▼64.15 ▼0.0595.98 ▲2.6441.58 ▲0.40

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
These items require your attention
  • This plugin does not fully uninstall, leaving 11 options in the database
    • can_compress_scripts
    • widget_theysaidso_widget
    • collapsPageSidebarId
    • db_upgraded
    • theysaidso_admin_options
    • collapsPageStyle
    • collapsPageVersion
    • widget_recent-posts
    • collapsPageDefaultStyles
    • collapsPageOrigStyle
    • ...

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)
The smoke test was a success, however most plugin functionality was not tested

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
The following issues need your attention
  • 10× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Notice
      Undefined variable: expand in wp-content/plugins/collapsing-pages/2.0.1/symbols.php on line 5
    • > PHP Notice
      Undefined variable: expand in wp-content/plugins/collapsing-pages/symbols.php on line 2
    • > PHP Notice
      Undefined variable: expand in wp-content/plugins/collapsing-pages/2.0.1/symbols.php on line 2
    • > PHP Notice
      Undefined variable: expand in wp-content/plugins/collapsing-pages/symbols.php on line 8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/collapsing-pages/collapsPage.php:33
    • > PHP Notice
      Undefined variable: expand in wp-content/plugins/collapsing-pages/2.0.1/symbols.php on line 8
    • > PHP Notice
      Undefined variable: expand in wp-content/plugins/collapsing-pages/2.0.1/symbols.php on line 15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/collapsing-pages/2.0.1/collapsPage.php:33
    • > PHP Notice
      Undefined variable: expand in wp-content/plugins/collapsing-pages/symbols.php on line 5
    • > PHP Notice
      Undefined variable: expand in wp-content/plugins/collapsing-pages/symbols.php on line 15

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 on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
Attributes that require attention:
  • Screenshots: Please add images for these screenshots: #1 (a few expanded pages with default theme, showing nested pages), #2 (a few expanded pages with default theme, showing drop down version)
You can look at the official readme.txt

collapsing-pages/collapsPage.php 92% from 13 tests

The main file in "Collapsing Pages" v. 2.0.2 serves as a complement to information provided in readme.txt and as the entry point to the plugin
Please make the necessary changes and fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("collapsing-pages.php" instead of "collapsPage.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Success! There were no dangerous files found in this plugin19,240 lines of code in 26 files:
LanguageFilesBlank linesComment linesLines of code
JSON40017,512
PHP8851271,027
JavaScript828101549
PO File14681120
Sass22018
Bourne Again Shell12113
CSS2101

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.49
Average class complexity11.00
▷ Minimum class complexity11.00
▷ Maximum class complexity11.00
Average method complexity3.00
▷ Minimum method complexity1.00
▷ Maximum method complexity7.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods10
▷ Static methods10100.00%
▷ Public methods10100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions10
▷ Named functions10100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
12 PNG files occupy 0.07MB with 0.02MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
img/custom.png3.12KB1.94KB▼ 37.83%
screenshot-2.png17.23KB7.41KB▼ 56.98%
2.0.1/img/block.png2.14KB1.59KB▼ 25.69%
2.0.1/img/default.png2.18KB1.59KB▼ 26.95%
img/noArrows.png1.68KB1.11KB▼ 33.82%