78% grid-plus

Code Review | Grid Plus - Unlimited grid layout

WordPress plugin Grid Plus - Unlimited grid layout scored78%from 54 tests.

About plugin

  • Plugin page: grid-plus
  • Plugin version: 1.3.2
  • PHP version: 7.4.16
  • WordPress compatibility: 4.5-5.5.0
  • WordPress version: 6.3.1
  • First release: Feb 18, 2017
  • Latest release: Nov 30, 2020
  • Number of updates: 142
  • Update frequency: every 9.7 days
  • Top authors: g5theme (100%)

Code review

54 tests

User reviews

22 reviews

Install metrics

6,000+ active /105,973 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.26MB] [CPU: ▼2.41ms] Passed 4 tests

Server-side resources used by Grid Plus - Unlimited grid layout
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.72 ▲0.2544.05 ▲5.65
Dashboard /wp-admin3.56 ▲0.2551.26 ▲4.30
Posts /wp-admin/edit.php3.67 ▲0.3147.52 ▼1.87
Add New Post /wp-admin/post-new.php6.17 ▲0.2886.41 ▼16.93
Media Library /wp-admin/upload.php3.48 ▲0.2535.60 ▲4.87
All grid /wp-admin/admin.php?page=grid_plus3.4736.84
Add grid /wp-admin/admin.php?page=grid_plus_setting3.5844.61

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

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 112 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
can_compress_scripts
widget_recent-posts
widget_recent-comments
db_upgraded
widget_theysaidso_widget

Browser metrics Passed 4 tests

A check of browser resources used by Grid Plus - Unlimited grid layout
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,830 ▲8413.28 ▼1.381.81 ▼0.0544.00 ▼2.06
Dashboard /wp-admin2,236 ▲514.95 ▼1.07102.36 ▲5.2836.90 ▼6.47
Posts /wp-admin/edit.php2,119 ▲302.01 ▲0.0132.89 ▼7.0635.20 ▼2.64
Add New Post /wp-admin/post-new.php6,357 ▲4,84326.32 ▲8.65952.42 ▲305.7237.74 ▼20.46
Media Library /wp-admin/upload.php1,415 ▲274.23 ▲0.01103.30 ▲5.3847.90 ▲5.30
All grid /wp-admin/admin.php?page=grid_plus9772.3141.1035.67
Add grid /wp-admin/admin.php?page=grid_plus_setting4,7536.37205.1192.11

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Please fix the following items
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-comments
    • db_upgraded
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • can_compress_scripts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please fix the following items
  • 2× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/grid-plus/core/post-format-ui/post-format-ui.php
    • > /wp-content/plugins/grid-plus/core/class-g5plus-image-resize.php
  • 40× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/grid-plus/partials/carousel.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_post_meta() in wp-content/plugins/grid-plus/core/post-format-ui/templates/format-gallery.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'Grid_Plus_Base' not found in wp-content/plugins/grid-plus/shortcodes/carousel-shortcode.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html__() in wp-content/plugins/grid-plus/partials/animation.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html__() in wp-content/plugins/grid-plus/partials/layout.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_url() in wp-content/plugins/grid-plus/skins/thumbnail.php:14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/grid-plus/partials/color.php:9
    • > PHP Warning
      Use of undefined constant G5PLUS_GRID_URL - assumed 'G5PLUS_GRID_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/grid-plus/partials/skins.php on line 10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/grid-plus/partials/bar/layout-bar.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'Grid_Plus' not found in wp-content/plugins/grid-plus/partials/skins.php:21

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
These attributes need to be fixed:
  • Screenshots: Please add descriptions for these screenshots #10, #9 in grid-plus/assets to your readme.txt
You can look at the official readme.txt

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

The main PHP file in "Grid Plus - Unlimited grid layout" ver. 1.3.2 adds more information about the plugin and also serves as the entry point for this plugin
52 characters long description:
Grid Plus - Unlimited grid layout for any post type.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Good job! No executable or dangerous file extensions detected31,472 lines of code in 91 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript253,3502,33118,049
CSS16530706,352
PHP442974503,668
SVG2002,713
PO File3255314592
Markdown142098

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.42
Average class complexity29.00
▷ Minimum class complexity4.00
▷ Maximum class complexity68.00
Average method complexity3.19
▷ Minimum method complexity1.00
▷ Maximum method complexity22.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes5
▷ Abstract classes00.00%
▷ Concrete classes5100.00%
▷ Final classes00.00%
Methods64
▷ Static methods1523.44%
▷ Public methods6296.88%
▷ Protected methods00.00%
▷ Private methods23.12%
Functions11
▷ Named functions11100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants3100.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
4 PNG files occupy 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/donate.png3.13KB1.95KB▼ 37.89%
assets/lib/light-gallery/img/vimeo-play.png5.30KB1.56KB▼ 70.65%
assets/lib/light-gallery/img/youtube-play.png5.06KB2.37KB▼ 53.04%
assets/lib/light-gallery/img/video-play.png4.42KB1.05KB▼ 76.27%