56% max-grid

Code Review | Max Grid

WordPress plugin Max Grid scored56%from 54 tests.

About plugin

  • Plugin page: max-grid
  • Plugin version: 1.1.2
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-5.3
  • WordPress version: 6.3.1
  • First release: Jul 5, 2019
  • Latest release: Dec 6, 2019
  • Number of updates: 29
  • Update frequency: every 5.3 days
  • Top authors: wpemaker (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /703 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
This plugin's installer ran successfully

Server metrics [RAM: ▲2.71MB] [CPU: ▲12.25ms] Passed 4 tests

A check of server-side resources used by Max Grid
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /5.99 ▲2.5246.96 ▲4.32
Dashboard /wp-admin6.09 ▲2.7964.39 ▲14.86
Posts /wp-admin/edit.php6.14 ▲2.7867.10 ▲20.42
Add New Post /wp-admin/post-new.php8.97 ▲3.08101.50 ▲9.40
Media Library /wp-admin/upload.php5.99 ▲2.7660.32 ▲27.11
Extensions /wp-admin/admin.php?page=maxgrid-extentions5.9950.07
Grid Builder /wp-admin/admin.php?page=maxgrid-builder5.8942.05
Settings /wp-admin/admin.php?page=maxgrid-settings5.9847.30

Server storage [IO: ▲2.16MB] [DB: ▲0.08MB] Passed 3 tests

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 115 new files
Database: 1 new table, 7 new options
New tables
wp_maxgrid_grid_templates_tbl
New WordPress options
theysaidso_admin_options
widget_theysaidso_widget
recovery_mode_email_last_sent
db_upgraded
widget_recent-comments
can_compress_scripts
widget_recent-posts

Browser metrics Passed 4 tests

This is an overview of browser requirements for Max Grid
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,554 ▲80817.49 ▲2.7470.19 ▲68.4388.41 ▲40.66
Dashboard /wp-admin2,405 ▲2206.92 ▲2.04136.43 ▲11.3441.57 ▼11.70
Posts /wp-admin/edit.php2,314 ▲2253.73 ▲1.7152.08 ▲17.9931.32 ▼6.06
Add New Post /wp-admin/post-new.php1,879 ▲36021.09 ▼1.97667.56 ▲17.5849.97 ▼8.59
Media Library /wp-admin/upload.php1,447 ▲564.50 ▲0.1797.81 ▼8.3446.82 ▲3.78
Extensions /wp-admin/admin.php?page=maxgrid-extentions1,1873.4452.61112.80
Grid Builder /wp-admin/admin.php?page=maxgrid-builder5,7583.0975.3558.74
Settings /wp-admin/admin.php?page=maxgrid-settings9431.9926.0247.47

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • The uninstall procedure failed, leaving 1 table in the database
    • wp_maxgrid_grid_templates_tbl
  • This plugin does not fully uninstall, leaving 7 options in the database
    • widget_theysaidso_widget
    • recovery_mode_email_last_sent
    • widget_recent-comments
    • widget_recent-posts
    • can_compress_scripts
    • theysaidso_admin_options
    • db_upgraded

Smoke tests 0% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
These server-side errors were triggered
    • > GET request to /wp-admin/admin.php?page=maxgrid-builder
    • > Notice in wp-content/plugins/max-grid/builder/class-builder.php+175
    Undefined variable: my_exclude_cats
    • > GET request to /wp-admin/admin.php?page=maxgrid-builder
    • > Error in wp-content/plugins/max-grid/assets/admin/class-html-elements.php+544
    Uncaught Error: Call to undefined method MaxGrid\Form::SaveChanges() in wp-content/plugins/max-grid/assets/admin/class-html-elements.php:544
    Stack trace:
    #0 wp-content/plugins/max-grid/assets/admin/class-settings-page.php(457): MaxGrid\Form->render()
    #1 wp-admin/includes/template.php(1824): Max_Grid_Settings_Page->builder_settings()
    #2 wp-admin/includes/template.php(1778): do_settings_fields()
    #3 wp-content/plugins/max-grid/assets/admin/class-settings-page.php(108): do_settings_sections()
    #4 wp-includes/class-wp-hook.php(310): Max_Grid_Settings_Page::builder_page()
    #5 wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters()
    #6 wp-includes/plugin.php(517): WP_Hook->do_action()
    #7 wp-admin/admin.php(259): do_action()
    #8 {main}
    thrown
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=maxgrid-settings
    • > Notice in wp-content/plugins/max-grid/assets/admin/class-html-elements.php+285
    Undefined variable: id
    • > GET request to /wp-admin/admin.php?page=maxgrid-settings
    • > Notice in wp-content/plugins/max-grid/assets/admin/class-html-elements.php+285
    Undefined variable: name
    • > GET request to /wp-admin/admin.php?page=maxgrid-settings
    • > Notice in wp-content/plugins/max-grid/assets/admin/class-html-elements.php+285
    Undefined variable: current
    • > GET request to /wp-admin/admin.php?page=maxgrid-settings
    • > Notice in wp-content/plugins/max-grid/assets/admin/class-html-elements.php+285
    Undefined variable: target
    • > GET request to /wp-admin/admin.php?page=maxgrid-settings
    • > Notice in wp-content/plugins/max-grid/assets/admin/class-html-elements.php+286
    Undefined index: id
    • > GET request to /wp-admin/admin.php?page=maxgrid-settings
    • > Error in wp-content/plugins/max-grid/assets/admin/class-html-elements.php+544
    Uncaught Error: Call to undefined method MaxGrid\Form::CheckBox() in wp-content/plugins/max-grid/assets/admin/class-html-elements.php:544
    Stack trace:
    #0 wp-content/plugins/max-grid/assets/admin/class-settings-page.php(1074): MaxGrid\Form->render()
    #1 wp-admin/includes/template.php(1824): Max_Grid_Settings_Page->forms_settings()
    #2 wp-admin/includes/template.php(1778): do_settings_fields()
    #3 wp-content/plugins/max-grid/assets/admin/class-settings-page.php(201): do_settings_sections()
    #4 wp-includes/class-wp-hook.php(310): Max_Grid_Settings_Page::settings_page()
    #5 wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters()
    #6 wp-includes/plugin.php(517): WP_Hook->do_action()
    #7 wp-admin/admin.php(259): do_action()
    #8 {main}
    thrown

SRP 0% 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
Please fix the following
  • 1× PHP files output text when accessed directly:
    • > /wp-content/plugins/max-grid/builder/loader.php
  • 4× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_header() in wp-content/plugins/max-grid/includes/preview-mode-template.php:1
    • > PHP Warning
      require_once(ABSPATHwp-includes/pluggable.php): failed to open stream: No such file or directory in wp-content/plugins/max-grid/tinymce/mce-max-grid.php on line 6
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/max-grid/tinymce/mce-max-grid.php on line 6
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-includes/pluggable.php' (include_path='.:/usr/share/php') in wp-content/plugins/max-grid/tinymce/mce-max-grid.php on line 6

User-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
These are user-side errors you should fix
    • > GET request to /wp-admin/admin.php?page=maxgrid-builder
    • > Console-api (warning) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,moxiejs,plupload&ver=6.3.1 1:28609 "jQuery.Deferred exception: Cannot read properties of null (reading 'options')" "TypeError: Cannot read properties of null (reading 'options')\n at maxgrid_is_option_exist (/wp-content/plugins/max-grid/builder/js/builder-functions.js?ver=NULL:34:25)\n at HTMLDocument.\u003Canonymous> (/wp-content/plugins/max-grid/builder/js/builder.js?ver=6.3.1:170:8)\n at e (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,moxiejs,plupload&ver=6.3.1:2:26990)\n at t (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,moxiejs,plupload&ver=6.3.1:2:27292)" undefined
    • > GET request to /wp-admin/admin.php?page=maxgrid-builder
    • > Console-api (warning) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,moxiejs,plupload&ver=6.3.1 1:28609 "jQuery.Deferred exception: $(...).wpColorPicker is not a function" "TypeError: $(...).wpColorPicker is not a function\n at HTMLDocument.\u003Canonymous> (/wp-content/plugins/max-grid/builder/js/maxgrid-preview-mode.js?ver=NULL:13:26)\n at e (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,moxiejs,plupload&ver=6.3.1:2:26990)\n at t (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,moxiejs,plupload&ver=6.3.1:2:27292)" undefined
    • > GET request to /wp-admin/admin.php?page=maxgrid-builder
    • > Javascript (severe) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,moxiejs,plupload&ver=6.3.1 1:28721 Uncaught TypeError: Cannot read properties of null (reading 'options')
    • > GET request to /wp-admin/admin.php?page=maxgrid-builder
    • > Javascript (severe) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,moxiejs,plupload&ver=6.3.1 1:28721 Uncaught TypeError: $(...).wpColorPicker is not a function

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
Attributes that need to be fixed:
  • Requires php: Invalid version format
  • Tags: There are too many tags (11 tag instead of maximum 10)
Please take inspiration from this readme.txt

max-grid/max-grid.php 92% from 13 tests

The entry point to "Max Grid" version 1.1.2 is a PHP file that has certain tags in its header comment area
You should first fix the following items:
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 147 characters long)

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Good job! No executable or dangerous file extensions detected29,900 lines of code in 94 files:
LanguageFilesBlank linesComment linesLines of code
PHP381,9512,43812,542
CSS2334361310,047
JavaScript301,2549176,785
PO File1191230468
SVG20058

PHP code 50% from 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
Please fix the following
  • Method cyclomatic complexity should be reduced to less than 100 (currently 515)
Cyclomatic complexity
Average complexity per logical line of code0.50
Average class complexity74.74
▷ Minimum class complexity1.00
▷ Maximum class complexity535.00
Average method complexity10.53
▷ Minimum method complexity1.00
▷ Maximum method complexity515.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes31
▷ Abstract classes00.00%
▷ Concrete classes31100.00%
▷ Final classes13.23%
Methods227
▷ Static methods4118.06%
▷ Public methods20992.07%
▷ Protected methods00.00%
▷ Private methods187.93%
Functions55
▷ Named functions5294.55%
▷ Anonymous functions35.45%
Constants29
▷ Global constants2586.21%
▷ Class constants413.79%
▷ Public constants4100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
9 PNG files occupy 0.18MB with 0.11MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
tinymce/css/woo-icon.png0.95KB0.97KB0.00%
assets/images/max-grid-icon-blue.png58.58KB0.32KB▼ 99.45%
assets/images/max-grid-icon-light.png58.61KB0.32KB▼ 99.45%
assets/images/max-grid-icon.png58.55KB0.38KB▼ 99.35%
tinymce/css/mce-grid-icon.png0.14KB0.15KB0.00%