73% pretty-grid

Code Review | Pretty Grid - WordPress Images Gallery, Slider, and Carousel Plugin

WordPress plugin Pretty Grid - WordPress Images Gallery, Slider, and Carousel Plugin scored73%from 54 tests.

About plugin

  • Plugin page: pretty-grid
  • Plugin version: 1.3.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-6.4.1
  • WordPress version: 6.3.1
  • First release: Jul 3, 2021
  • Latest release: Dec 2, 2023
  • Number of updates: 47
  • Update frequency: every 18.8 days
  • Top authors: darell (100%)

Code review

54 tests

User reviews

1 review

Install metrics

70+ active /1,746 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
This plugin's installer ran successfully

Server metrics [RAM: ▲5.46MB] [CPU: ▲31.77ms] 75% from 4 tests

A check of server-side resources used by Pretty Grid - WordPress Images Gallery, Slider, and Carousel Plugin
It is recommended to improve the following
  • Extra RAM: Extra memory usage should kept under 5MB (currently 5.46MB on /wp-admin/admin.php?page=freemius)
PageMemory (MB)CPU Time (ms)
Home /9.20 ▲5.7463.81 ▲25.32
Dashboard /wp-admin9.22 ▲5.9280.97 ▲37.08
Posts /wp-admin/edit.php9.22 ▲5.8785.07 ▲37.04
Add New Post /wp-admin/post-new.php10.20 ▲4.31111.83 ▲27.99
Media Library /wp-admin/upload.php9.22 ▲5.9969.06 ▲36.73
Freemius Debug [v.2.5.4.2] /wp-admin/admin.php?page=freemius9.2264.23

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 1,615 new files
Database: no new tables, 9 new options
New WordPress options
fs_active_plugins
widget_recent-posts
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-comments
fs_debug_mode
can_compress_scripts
fs_accounts
db_upgraded

Browser metrics Passed 4 tests

Pretty Grid - WordPress Images Gallery, Slider, and Carousel Plugin: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,958 ▲21113.57 ▼0.8211.37 ▲9.5828.20 ▼9.35
Dashboard /wp-admin2,235 ▲545.66 ▼0.0392.16 ▼25.9040.75 ▼0.97
Posts /wp-admin/edit.php2,138 ▲352.05 ▲0.0739.85 ▼0.5338.57 ▲3.03
Add New Post /wp-admin/post-new.php1,547 ▲2123.57 ▲0.28597.82 ▼50.5067.43 ▲8.36
Media Library /wp-admin/upload.php1,440 ▲404.26 ▼0.0199.09 ▲2.8146.95 ▲6.09
Freemius Debug [v.2.5.4.2] /wp-admin/admin.php?page=freemius1,0892.0726.9127.04

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • The plugin did not uninstall gracefully
    • > Notice in wp-content/plugins/pretty-grid/freemius/includes/class-freemius.php+8486
    Undefined property: stdClass::$plugins
  • Zombie WordPress options were found after uninstall: 9 options
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-posts
    • db_upgraded
    • fs_debug_mode
    • fs_accounts
    • fs_active_plugins
    • widget_recent-comments
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please fix the following
  • 32× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/pretty-grid/admin/views/shortcode/twitter.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/pretty-grid/admin/views/shortcode/vimeo.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/pretty-grid/admin/views/field/wizard/general/post.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/pretty-grid/admin/views/field/wizard/general/vimeo.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function pretty_grid_field_settings_components() in wp-content/plugins/pretty-grid/admin/views/field/wizard/sections/tab-settings.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_url() in wp-content/plugins/pretty-grid/admin/views/shortcode/slider/theme-3.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/pretty-grid/admin/views/field/wizard/general/images.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_url() in wp-content/plugins/pretty-grid/admin/views/shortcode/slider/theme-1.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/pretty-grid/admin/views/field/wizard/general/woocommerce.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/pretty-grid/admin/views/shortcode/images.php:1

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/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 an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
These attributes need to be fixed:
  • Screenshots: These screenshots need descriptions #1, #2, #3, #4, #5, #6, #7, #8 in pretty-grid/assets to your readme.txt
The official readme.txt is a good inspiration

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

The primary PHP file in "Pretty Grid - WordPress Images Gallery, Slider, and Carousel Plugin" version 1.3.0 is used by WordPress to initiate all plugin functionality
53 characters long description:
WordPress Images Gallery, Slider, and Carousel Plugin

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
There were no executable files found in this plugin50,962 lines of code in 1,501 files:
LanguageFilesBlank linesComment linesLines of code
PHP1688,84818,55837,020
JavaScript311,1649166,853
CSS21674915,530
SVG1,280101,345
Markdown1680214

PHP code 50% from 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
Please fix the following
  • Cyclomatic complexity of classes should be reduced to less than 1000 (currently 3,079)
Cyclomatic complexity
Average complexity per logical line of code0.61
Average class complexity66.90
▷ Minimum class complexity1.00
▷ Maximum class complexity3,079.00
Average method complexity4.36
▷ Minimum method complexity1.00
▷ Maximum method complexity94.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes70
▷ Abstract classes68.57%
▷ Concrete classes6491.43%
▷ Final classes00.00%
Methods1,406
▷ Static methods20314.44%
▷ Public methods99870.98%
▷ Protected methods251.78%
▷ Private methods38327.24%
Functions114
▷ Named functions114100.00%
▷ Anonymous functions00.00%
Constants153
▷ Global constants10166.01%
▷ Class constants5233.99%
▷ Public constants52100.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.06MB with 0.03MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
freemius/assets/img/plugin-icon.png9.16KB5.26KB▼ 42.58%
freemius/assets/img/pretty-grid.png22.55KB8.24KB▼ 63.44%
freemius/assets/img/theme-icon.png10.97KB5.78KB▼ 47.37%
assets/images/prettygrid.png21.69KB8.41KB▼ 61.26%