78% grid-accordion

Code Review | Grid Accordion

WordPress plugin Grid Accordion scored78%from 54 tests.

About plugin

  • Plugin page: grid-accordion
  • Plugin version: 1.9.8
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-6.4
  • WordPress version: 6.3.1
  • First release: Jun 18, 2014
  • Latest release: Nov 15, 2023
  • Number of updates: 29
  • Update frequency: every 118.5 days
  • Top authors: bqworks (100%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active /2,560 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.88MB] [CPU: ▲3.78ms] Passed 4 tests

A check of server-side resources used by Grid Accordion
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /4.08 ▲0.6142.32 ▼3.11
Dashboard /wp-admin4.31 ▲1.0155.73 ▲0.65
Posts /wp-admin/edit.php4.37 ▲1.0054.63 ▲7.39
Add New Post /wp-admin/post-new.php6.84 ▲0.95101.08 ▲10.19
Media Library /wp-admin/upload.php4.18 ▲0.9467.85 ▲33.72
Add New /wp-admin/admin.php?page=grid-accordion-new4.2344.61
Documentation /wp-admin/admin.php?page=grid-accordion-documentation4.1848.07
Plugin Settings /wp-admin/admin.php?page=grid-accordion-settings4.1940.89
Add-ons /wp-admin/admin.php?page=grid-accordion-add-ons4.28169.00
All Accordions /wp-admin/admin.php?page=grid-accordion4.2242.55

Server storage [IO: ▲2.82MB] [DB: ▲0.01MB] Passed 3 tests

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 125 new files
Database: 3 new tables, 8 new options
New tables
wp_gridaccordion_layers
wp_gridaccordion_panels
wp_gridaccordion_accordions
New WordPress options
grid_accordion_version
widget_recent-comments
widget_bqw-grid-accordion-widget
theysaidso_admin_options
db_upgraded
can_compress_scripts
widget_recent-posts
widget_theysaidso_widget

Browser metrics Passed 4 tests

Checking browser requirements for Grid Accordion
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,828 ▲6614.32 ▼0.031.75 ▲0.1042.56 ▲0.53
Dashboard /wp-admin2,218 ▲415.53 ▼0.1297.16 ▲9.8569.08 ▲26.17
Posts /wp-admin/edit.php2,144 ▲441.96 ▼0.0541.10 ▲0.8134.89 ▼3.06
Add New Post /wp-admin/post-new.php1,714 ▲17522.48 ▼0.69783.65 ▲139.1741.57 ▼24.41
Media Library /wp-admin/upload.php1,435 ▲354.24 ▲0.02146.64 ▲40.9559.06 ▲16.12
Add New /wp-admin/admin.php?page=grid-accordion-new2,4295.98103.5071.14
Documentation /wp-admin/admin.php?page=grid-accordion-documentation3,4274.0082.07154.89
Plugin Settings /wp-admin/admin.php?page=grid-accordion-settings1,2263.6443.6675.22
Add-ons /wp-admin/admin.php?page=grid-accordion-add-ons1,1283.6348.8678.02
All Accordions /wp-admin/admin.php?page=grid-accordion1,1743.6444.6555.36

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
You still need to fix the following
  • This plugin does not fully uninstall, leaving 7 options in the database
    • widget_bqw-grid-accordion-widget
    • widget_recent-comments
    • can_compress_scripts
    • widget_recent-posts
    • db_upgraded
    • widget_theysaidso_widget
    • theysaidso_admin_options

Smoke tests 50% 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 0% 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 fix the following items
  • 2× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/grid-accordion/admin/views/panel/panel.php
    • > /wp-content/plugins/grid-accordion/admin/views/add-ons/add-on-more-details.php
  • 44× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Notice
      Undefined variable: panel_type in wp-content/plugins/grid-accordion/admin/views/panel/panel.php on line 16
    • > PHP Notice
      Undefined variable: panel_type in wp-content/plugins/grid-accordion/admin/views/panel/panel.php on line 12
    • > PHP Warning
      Invalid argument supplied for foreach() in wp-content/plugins/grid-accordion/admin/views/accordion-settings/default-panel.php on line 4
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/grid-accordion/admin/views/accordion-settings/default-panel.php on line 4
    • > PHP Notice
      Undefined variable: panel_type in wp-content/plugins/grid-accordion/admin/views/panel/panel.php on line 6
    • > PHP Fatal error
      Uncaught Error: Class 'BQW_GA_Layer_Renderer' not found in wp-content/plugins/grid-accordion/public/class-video-layer-renderer.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'BQW_GA_Dynamic_Panel_Renderer' not found in wp-content/plugins/grid-accordion/public/class-posts-panel-renderer.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/grid-accordion/admin/views/panel-editors/html-editor.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/grid-accordion/admin/views/accordions/accordions.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'BQW_GA_Panel_Renderer' not found in wp-content/plugins/grid-accordion/public/class-dynamic-panel-renderer.php:7

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 Passed 29 tests

readme.txt Passed 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
7 plugin tags: lightbox grid, post grid, image grid, grid accordion, grid plugin...

grid-accordion/grid-accordion.php Passed 13 tests

This is the main PHP file of "Grid Accordion" version 1.9.8, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
44 characters long description:
Responsive and touch-enabled grid accordion.

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
There were no executable files found in this plugin48,377 lines of code in 88 files:
LanguageFilesBlank linesComment linesLines of code
JSON40028,338
JavaScript162,9712,65210,102
PHP531,0392,1845,604
CSS11507792,607
HTML116501,622
SVG10040
Markdown113038
Sass14026

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.41
Average class complexity23.12
▷ Minimum class complexity2.00
▷ Maximum class complexity140.00
Average method complexity3.70
▷ Minimum method complexity1.00
▷ Maximum method complexity34.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes25
▷ Abstract classes00.00%
▷ Concrete classes25100.00%
▷ Final classes00.00%
Methods205
▷ Static methods3014.63%
▷ Public methods13867.32%
▷ Protected methods5526.83%
▷ Private methods125.85%
Functions3
▷ Named functions266.67%
▷ Anonymous functions133.33%
Constants3
▷ Global constants133.33%
▷ Class constants266.67%
▷ Public constants2100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
21 PNG files occupy 0.50MB with 0.21MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/assets/css/images/all-buttons.png1.25KB0.89KB▼ 28.43%
admin/assets/css/images/video-placeholder-button.png0.84KB0.93KB0.00%
documentation/assets/images/add-posts-panels-2.png23.61KB9.75KB▼ 58.70%
documentation/assets/images/layers-editor.png17.73KB7.57KB▼ 57.29%
documentation/assets/images/add-image-panels.png121.05KB43.27KB▼ 64.25%