77% show-hidecollapse-expand

Code Review | Show-Hide / Collapse-Expand

WordPress plugin Show-Hide / Collapse-Expand scored77%from 54 tests.

About plugin

  • Plugin page: show-hidecollapse...
  • Plugin version: 1.3.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.2-6.1.1
  • WordPress version: 6.3.1
  • First release: Mar 4, 2017
  • Latest release: Mar 19, 2023
  • Number of updates: 36
  • Update frequency: every 61.3 days
  • Top authors: buntegiraffe (100%)

Code review

54 tests

User reviews

20 reviews

Install metrics

10,000+ active /142,625 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Install script ran successfully

Server metrics [RAM: ▼0.22MB] [CPU: ▼25.04ms] Passed 4 tests

This is a short check of server-side resources used by Show-Hide / Collapse-Expand
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.40 ▼0.0624.92 ▼16.38
Dashboard /wp-admin3.08 ▼0.2327.59 ▼27.24
Posts /wp-admin/edit.php3.22 ▼0.1433.70 ▼24.82
Add New Post /wp-admin/post-new.php5.46 ▼0.4369.62 ▼31.70
Media Library /wp-admin/upload.php3.16 ▼0.0731.00 ▼4.69
Show-Hide / Collapse-Expand /wp-admin/tools.php?page=bg_show_hide3.0626.53

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

Analyzing filesystem and database footprints of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 21 new files
Database: no new tables, 11 new options
New WordPress options
can_compress_scripts
bg_shce_stickToBottom
bg_shce_animationSpeed
widget_theysaidso_widget
widget_recent-comments
widget_recent-posts
bg_shce_preset1
theysaidso_admin_options
bg_shce_effectsEnabled
bg_shce_animationEffect
...

Browser metrics Passed 4 tests

An overview of browser requirements for Show-Hide / Collapse-Expand
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,914 ▲15313.53 ▼1.159.74 ▲7.7939.94 ▼6.19
Dashboard /wp-admin2,221 ▲415.63 ▼0.0990.56 ▼7.7840.47 ▼2.92
Posts /wp-admin/edit.php2,126 ▲292.23 ▲0.2334.01 ▼5.1537.98 ▲3.21
Add New Post /wp-admin/post-new.php1,550 ▲317.61 ▼5.70698.23 ▲2.4839.37 ▼26.09
Media Library /wp-admin/upload.php1,423 ▲234.35 ▲0.14115.33 ▲11.6847.95 ▲0.33
Show-Hide / Collapse-Expand /wp-admin/tools.php?page=bg_show_hide9282.2628.8730.12

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
It is recommended to fix the following
  • Zombie WordPress options were found after uninstall: 6 options
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-comments
    • widget_recent-posts
    • db_upgraded

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
These server-side errors were triggered
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/tools.php?page=bg_show_hide
    • > User notice in wp-includes/functions.php+5905
    Function WP_Scripts::localize was called incorrectly. The $l10n parameter must be an array. To pass arbitrary data to scripts, use the wp_add_inline_script() function instead. Please see Debugging in WordPress for more information. (This message was added in version 5.7.0.)

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Almost there! Just fix the following items
  • 2× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/show-hidecollapse-expand/bg_show_hide.php
    • > /wp-content/plugins/show-hidecollapse-expand/ErrorLogging.php

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)
No browser issues were found

Optimizations

Plugin configuration 86% 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
Please fix the following attributes:
  • Tags: Too many tags (14 tag instead of maximum 10); only the first 5 tags are used in your directory listing
You can take inspiration from this readme.txt

show-hidecollapse-expand/bg_show_hide.php 77% from 13 tests

Analyzing the main PHP file in "Show-Hide / Collapse-Expand" version 1.3.0
Please make the necessary changes and fix the following:
  • Domain Path: The domain path folder does not exist ("/languages")
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("show-hidecollapse-expand.php" instead of "bg_show_hide.php")
  • Text Domain: The text domain name should consist of only dashes and lowercase characters

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
Good job! No executable or dangerous file extensions detected1,913 lines of code in 14 files:
LanguageFilesBlank linesComment linesLines of code
PHP916653672
SVG103540
CSS23618470
JavaScript2283231

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.19
Average class complexity1.88
▷ Minimum class complexity1.00
▷ Maximum class complexity3.00
Average method complexity1.16
▷ Minimum method complexity1.00
▷ Maximum method complexity3.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes8
▷ Abstract classes112.50%
▷ Concrete classes787.50%
▷ Final classes00.00%
Methods45
▷ Static methods12.22%
▷ Public methods4395.56%
▷ Protected methods00.00%
▷ Private methods24.44%
Functions18
▷ Named functions18100.00%
▷ Anonymous functions00.00%
Constants6
▷ Global constants6100.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
1 PNG file occupies 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
assets/img/tinymce-button.png3.11KB1.72KB▼ 44.50%