62% grid

Code Review | Grid

WordPress plugin Grid scored62%from 54 tests.

About plugin

  • Plugin page: grid
  • Plugin version: 2.3.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-5.9.3
  • WordPress version: 6.3.1
  • First release: Dec 9, 2014
  • Latest release: Feb 8, 2023
  • Number of updates: 173
  • Update frequency: every 17.3 days
  • Top authors: EdwardBock (97.11%)mkernel (3.47%)

Code review

54 tests

User reviews

4 reviews

Install metrics

100+ active /39,022 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Installer ran successfully

Server metrics [RAM: ▲3.90MB] [CPU: ▲17.07ms] Passed 4 tests

This is a short check of server-side resources used by Grid
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /7.47 ▲3.9764.84 ▲18.27
Dashboard /wp-admin7.49 ▲4.1568.75 ▲20.63
Posts /wp-admin/edit.php7.49 ▲4.1074.50 ▲17.97
Add New Post /wp-admin/post-new.php9.33 ▲3.41118.74 ▲11.41
Media Library /wp-admin/upload.php7.49 ▲4.2265.50 ▲27.56
The Grid AJAX /wp-admin/admin.php?page=grid_ajax7.4956.84
Styles /wp-admin/admin.php?page=grid_styles7.4953.70
delete reuse box /wp-admin/admin.php?page=grid_delete_reuse_box7.4955.74
Settings /wp-admin/admin.php?page=grid_settings7.5161.69
Container types /wp-admin/admin.php?page=grid_containers7.5156.96
Privileges /wp-admin/admin.php?page=grid_privileges7.5153.70
The Grid /wp-admin/admin.php?page=grid7.5157.16
Reusable container /wp-admin/admin.php?page=grid_reuse_containers7.5158.67
Reusable boxes /wp-admin/admin.php?page=grid_reuse_boxes7.5162.65
edit reuse box /wp-admin/admin.php?page=grid_edit_reuse_box7.5151.75

Server storage [IO: ▲15.13MB] [DB: ▲0.02MB] Passed 3 tests

How much does this plugin use your filesystem and database?
The plugin installed successfully
Filesystem: 3,031 new files
Database: 14 new tables, 12 new options
New tables
wp_grid_slot_style
wp_grid_container_type
wp_grid_container
wp_grid_slot
wp_grid_container2slot
wp_grid_nodes
wp_grid_box
wp_grid_grid
wp_grid_box_style
wp_grid_container_style
...
New WordPress options
recovery_mode_email_last_sent
theysaidso_admin_options
widget_recent-comments
can_compress_scripts
grid
widget_recent-posts
grid_post_search_enabled
db_upgraded
widget_theysaidso_widget
grid_landing_page_enabled
...

Browser metrics Passed 4 tests

A check of browser resources used by Grid
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,840 ▲7913.89 ▼0.481.92 ▲0.0636.81 ▼8.34
Dashboard /wp-admin2,229 ▲525.59 ▲0.0588.45 ▼5.6475.61 ▲34.00
Posts /wp-admin/edit.php2,143 ▲462.00 ▼0.0235.74 ▼3.6436.16 ▼3.32
Add New Post /wp-admin/post-new.php1,564 ▲3622.46 ▼0.69610.96 ▼30.6879.09 ▲24.61
Media Library /wp-admin/upload.php1,446 ▲494.13 ▼0.05102.39 ▼0.4067.90 ▲22.93
The Grid AJAX /wp-admin/admin.php?page=grid_ajax7071.516.6217.57
Styles /wp-admin/admin.php?page=grid_styles9312.0031.4627.78
delete reuse box /wp-admin/admin.php?page=grid_delete_reuse_box7261.126.8721.11
Settings /wp-admin/admin.php?page=grid_settings1,1822.1924.1528.33
Container types /wp-admin/admin.php?page=grid_containers1,3123.0939.5670.50
Privileges /wp-admin/admin.php?page=grid_privileges1,0732.0023.5126.94
The Grid /wp-admin/admin.php?page=grid8191.9924.1223.67
Reusable container /wp-admin/admin.php?page=grid_reuse_containers1,0505.06131.4976.38
Reusable boxes /wp-admin/admin.php?page=grid_reuse_boxes1,0445.14135.1767.64
edit reuse box /wp-admin/admin.php?page=grid_edit_reuse_box1,3885.94106.73112.92

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • The uninstall procedure failed, leaving 14 tables in the database
    • wp_grid_slot2box
    • wp_grid_nodes
    • wp_grid_box_style
    • wp_grid_box_type
    • wp_grid_grid
    • wp_grid_container_type
    • wp_grid_box
    • wp_grid_container2slot
    • wp_grid_slot_style
    • wp_grid_schema
    • ...
  • Zombie WordPress options detected upon uninstall: 9 options
    • theysaidso_admin_options
    • grid_post_search_enabled
    • db_upgraded
    • recovery_mode_email_last_sent
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-posts
    • widget_recent-comments
    • grid_page_search_enabled

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Almost there, just fix the following server-side errors
    • > GET request to /wp-admin/admin.php?page=grid_ajax
    • > Warning in wp-content/plugins/grid/lib/grid/classes/API.php+103
    Cannot modify header information - headers already sent by (output started at wp-includes/script-loader.php:2838)
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=grid_edit_reuse_box
    • > Notice in wp-content/plugins/grid/classes/ReuseBox.php+35
    Undefined index: boxid
    • > GET request to /wp-admin/admin.php?page=grid_delete_reuse_box
    • > Error in wp-content/plugins/grid/classes/ReuseBox.php+52
    Uncaught Error: Call to a member function getReuseBoxEditor() on null in wp-content/plugins/grid/classes/ReuseBox.php:52
    Stack trace:
    #0 wp-includes/class-wp-hook.php(310): Palasthotel\Grid\WordPress\ReuseBox->delete_reuse_box()
    #1 wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters()
    #2 wp-includes/plugin.php(517): WP_Hook->do_action()
    #3 wp-admin/admin.php(259): do_action()
    #4 {main}
    thrown
    • > GET request to /wp-admin/admin.php?page=grid
    • > Notice in wp-content/plugins/grid/classes/TheGrid.php+69
    Undefined index: postid
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=grid_edit_reuse_box
    • > POST request to /wp-admin/admin.php?noheader=1&page=grid_ajax
    • > Notice in wp-content/plugins/grid/lib/grid/classes/Storage.php+202
    Trying to access array offset on value of type null

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
Almost there! Just fix the following items
  • 6× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/grid/lib/grid/css/grid-frontend/flexbox.css.php
    • > /wp-content/plugins/grid/core/templates/wordpress/grid-box-search_form-editmode.tpl.php
    • > /wp-content/plugins/grid/core/templates/wordpress/grid-box-media-editmode.tpl.php
    • > /wp-content/plugins/grid/lib/grid/js/grid_htmlbox_ckeditor_config.js.php
    • > /wp-content/plugins/grid/lib/grid/css/grid-frontend/table.css.php
    • > /wp-content/plugins/grid/lib/grid/templates/components/grid.tpl.php
  • 90× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Warning
      Invalid argument supplied for foreach() in wp-content/plugins/grid/lib/grid/js/grid_htmlbox_ckeditor_config.js.php on line 28
    • > PHP Fatal error
      Uncaught Error: Class 'Palasthotel\\Grid\\WordPress\\PositionInPost' not found in wp-content/plugins/grid/deprecated-namespace.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'grid_static_base_box' not found in wp-content/plugins/grid/lib/grid/components/grid_plaintext_box.php:3
    • > PHP Warning
      count(): Parameter must be an array or an object that implements Countable in wp-content/plugins/grid/lib/grid/js/grid_htmlbox_ckeditor_config.js.php on line 43
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/grid/core/templates/wordpress/grid-box-media.tpl.php:9
    • > PHP Warning
      Invalid argument supplied for foreach() in wp-content/plugins/grid/lib/grid/css/grid-frontend/flexbox.css.php on line 24
    • > PHP Fatal error
      Uncaught Error: Class 'grid_html_box' not found in wp-content/plugins/grid/core/classes/wordpress/grid_wp_html_box.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'Palasthotel\\Grid\\WordPress\\_Component' not found in wp-content/plugins/grid/classes/ReuseBox.php:12
    • > PHP Notice
      Undefined variable: ckeditor_plugins in wp-content/plugins/grid/lib/grid/js/grid_htmlbox_ckeditor_config.js.php on line 83
    • > PHP Fatal error
      Uncaught Error: Class 'Palasthotel\\Grid\\WordPress\\_Component' not found in wp-content/plugins/grid/classes/Settings.php:19

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine on the user side

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
6 plugin tags: grid, editor, admin, containerist, landingpage...

grid/wordpress_plugin.php 92% from 13 tests

The main PHP file in "Grid" ver. 2.3.0 adds more information about the plugin and also serves as the entry point for this plugin
Please make the necessary changes and fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("grid.php" instead of "wordpress_plugin.php")

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Everything looks great! No dangerous files found in this plugin116,712 lines of code in 2,747 files:
LanguageFilesBlank linesComment linesLines of code
SVG810078,729
PHP1143,0487,21821,133
JavaScript2,482312,6856,197
CSS1021,2156636,003
Markdown151,13003,793
HTML195619434
PO File2136153332
JSON50091

PHP code 50% from 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
Please fix the following
  • Method cyclomatic complexity has to be reduced to less than 100 (currently 808)
Cyclomatic complexity
Average complexity per logical line of code0.54
Average class complexity32.19
▷ Minimum class complexity1.00
▷ Maximum class complexity949.00
Average method complexity4.92
▷ Minimum method complexity1.00
▷ Maximum method complexity808.00
Code structure
Namespaces8
Interfaces4
Traits0
Classes114
▷ Abstract classes43.51%
▷ Concrete classes11096.49%
▷ Final classes00.00%
Methods960
▷ Static methods788.12%
▷ Public methods90794.48%
▷ Protected methods333.44%
▷ Private methods202.08%
Functions32
▷ Named functions1753.12%
▷ Anonymous functions1546.88%
Constants121
▷ Global constants7057.85%
▷ Class constants5142.15%
▷ Public constants51100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
211 PNG files occupy 0.63MB with 0.13MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
lib/grid/assets/ckeditor/plugins/smiley/images/shades_smile.png1.18KB1.25KB0.00%
lib/grid/assets/ckeditor/plugins/flash/images/placeholder.png0.25KB0.26KB0.00%
lib/grid/assets/ckeditor/plugins/forms/icons/hidpi/radio.png1.39KB0.57KB▼ 59.40%
lib/grid/assets/ckeditor/plugins/icons.png12.48KB6.46KB▼ 48.26%
lib/grid/assets/ckeditor/plugins/smiley/images/embarrassed_smile.png1.12KB1.29KB0.00%