93% admin-collapse-subpages

Code Review | Admin Collapse Subpages

WordPress plugin Admin Collapse Subpages scored 93% 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: 5.9.2
  • 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

18 reviews

Install metrics

6,000+ active / 32,740 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed successfully, without throwing any errors or notices

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

Server-side resources used by Admin Collapse Subpages
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.0254.78 ▲4.19
Dashboard /wp-admin3.42 ▲0.0134.21 ▼5.38
Posts /wp-admin/edit.php3.65 ▲0.0142.45 ▼13.82
Add New Post /wp-admin/post-new.php6.90 ▼0.07100.11 ▼1,184.31
Media Library /wp-admin/upload.php3.30 ▲0.0022.47 ▼9.82

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

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 17 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

This is an overview of browser requirements for Admin Collapse Subpages
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,763 ▲4116.16 ▲0.616.41 ▼0.642.46 ▼0.21
Dashboard /wp-admin2,895 ▲376.14 ▲0.04117.43 ▼15.44158.47 ▼1.91
Posts /wp-admin/edit.php2,694 ▼03.24 ▼0.0063.61 ▼0.65139.99 ▼2.35
Add New Post /wp-admin/post-new.php1,717 ▲2121.74 ▲0.57431.36 ▼21.85157.22 ▲3.08
Media Library /wp-admin/upload.php1,698 ▼05.54 ▲0.01139.18 ▼8.92184.56 ▼13.13

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
Uninstaller ran successfully

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Everything seems fine, however this is by no means an exhaustive test

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
Please take a closer look at the following
  • 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 a shallow check for browser errors
No browser issues were found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
These attributes need to be fixed:
  • Screenshots: 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.)
  • Tags: You are using too many tags: 18 tag instead of maximum 10
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: Name the main plugin file 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 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Everything looks great! No dangerous 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 brief analysis of cyclomatic complexity and code structure for this plugin
No cyclomatic complexity issues were detected for this plugin
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

Often times overlooked, PNG files can occupy unnecessary space in your plugin
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
images/minus.png0.25KB0.14KB▼ 45.70%
screenshot-1.png23.64KB9.94KB▼ 57.94%
images/plus.png0.25KB0.14KB▼ 45.17%
screenshot-2.png32.80KB13.22KB▼ 59.70%
screenshot-3.png37.87KB14.80KB▼ 60.93%