83% admin-collapse-subpages

Code Review | Admin Collapse Subpages

WordPress plugin Admin Collapse Subpages scored 83% from 54 tests.

About plugin

  • Plugin page: admin-collapse-su...
  • Plugin version: 2.4
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-5.2.2
  • WordPress version: 6.3.1
  • First release: Sep 12, 2011
  • Latest release: Jul 9, 2019
  • Number of updates: 33
  • Update frequency: every 86.6 days
  • Top authors: bravokeyl (93.94%)lupka (9.09%)

Code review

54 tests

User reviews

19 reviews

Install metrics

5,000+ active / 38,685 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Installer ran successfully

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

An overview of server-side resources used by Admin Collapse Subpages
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0135.88 ▼4.12
Dashboard /wp-admin3.32 ▲0.0143.59 ▼2.49
Posts /wp-admin/edit.php3.37 ▲0.0147.48 ▲1.29
Add New Post /wp-admin/post-new.php5.90 ▲0.0192.80 ▼2.29
Media Library /wp-admin/upload.php3.24 ▲0.0135.83 ▼0.54

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 17 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
widget_recent-comments
widget_theysaidso_widget
widget_recent-posts
theysaidso_admin_options
db_upgraded

Browser metrics Passed 4 tests

Checking browser requirements for Admin Collapse Subpages
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5413.20 ▼1.031.60 ▼0.0838.76 ▼6.03
Dashboard /wp-admin2,203 ▲124.88 ▼1.0199.80 ▲1.4237.59 ▼5.26
Posts /wp-admin/edit.php2,089 ▼01.99 ▼0.0242.08 ▲6.9134.63 ▼0.07
Add New Post /wp-admin/post-new.php1,538 ▲2423.25 ▲5.82604.06 ▼54.8359.09 ▲5.01
Media Library /wp-admin/upload.php1,385 ▼34.13 ▼0.09104.30 ▼9.5245.76 ▼4.65

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
It is recommended to fix the following
  • The uninstall procedure has failed, leaving 6 options in the database
    • can_compress_scripts
    • db_upgraded
    • widget_recent-comments
    • widget_recent-posts
    • widget_theysaidso_widget
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though everything seems fine, this is not 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
Almost there! Just fix the following items
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/admin-collapse-subpages/admin_collapse_subpages.php:38

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% 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 your attention:
  • Tags: You are using too many tags: 18 tag instead of maximum 10
  • Screenshots: Please add images for these screenshots: #1 (Example Edit Page menu.), #2 (Same menu with a group of subpages minimized.), #3 (Same menu completely minimized.), #4 (Expand/collapse all buttons at the top of the page.)
Please take inspiration from this readme.txt

admin-collapse-subpages/admin_collapse_subpages.php 92% from 13 tests

The principal PHP file in "Admin Collapse Subpages" v. 2.4 is loaded by WordPress automatically on each request
The following require your attention:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("admin-collapse-subpages.php" instead of "admin_collapse_subpages.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
There were no executable files found in this plugin323 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript26761266
PHP1182541
CSS10016

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.73
Average class complexity7.00
▷ Minimum class complexity7.00
▷ Maximum class complexity7.00
Average method complexity1.00
▷ Minimum method complexity1.00
▷ Maximum method complexity1.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods4
▷ Static methods00.00%
▷ Public methods4100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
6 PNG files occupy 0.12MB with 0.07MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-3.png37.87KB14.80KB▼ 60.93%
images/plus.png0.25KB0.14KB▼ 45.17%
images/minus.png0.25KB0.14KB▼ 45.70%
screenshot-1.png23.64KB9.94KB▼ 57.94%
screenshot-4.png32.01KB12.52KB▼ 60.87%