72% new-grid-gallery

Code Review | Grid Gallery - Photo Image Grid Gallery

WordPress plugin Grid Gallery - Photo Image Grid Gallery scored72%from 54 tests.

About plugin

  • Plugin page: new-grid-gallery
  • Plugin version: 1.3.8
  • PHP version: 7.4.16
  • WordPress compatibility: 3.8-6.3.2
  • WordPress version: 6.3.1
  • First release: Oct 7, 2016
  • Latest release: Oct 20, 2023
  • Number of updates: 147
  • Update frequency: every 17.5 days
  • Top authors: awordpresslife (100%)

Code review

54 tests

User reviews

9 reviews

Install metrics

1,000+ active /57,267 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
This plugin's installer ran successfully

Server metrics [RAM: ▲0.52MB] [CPU: ▲4.49ms] Passed 4 tests

An overview of server-side resources used by Grid Gallery - Photo Image Grid Gallery
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /4.01 ▲0.5448.33 ▲11.90
Dashboard /wp-admin3.88 ▲0.5350.87 ▼9.01
Posts /wp-admin/edit.php3.93 ▲0.5754.66 ▲8.80
Add New Post /wp-admin/post-new.php6.40 ▲0.5189.39 ▲8.40
Media Library /wp-admin/upload.php3.74 ▲0.5147.25 ▲9.75
Our Theme /wp-admin/edit.php?post_type=grid_gallery&page=sr-theme-page3.7237.34
Featured Plugins /wp-admin/edit.php?post_type=grid_gallery&page=sr-featured-plugins-page3.93498.01
All Grid Gallery /wp-admin/edit.php?post_type=grid_gallery3.7437.14
Install Plugins /wp-admin/themes.php?page=tgmpa-install-plugins3.8135.57
Upgrade Plugin /wp-admin/edit.php?post_type=grid_gallery&page=sr-upgrade-plugins-page3.7336.31
Add Grid Gallery /wp-admin/post-new.php?post_type=grid_gallery3.9751.67
Docs /wp-admin/edit.php?post_type=grid_gallery&page=sr-doc-page3.7137.70

Server storage [IO: ▲4.61MB] [DB: ▲0.54MB] Passed 3 tests

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 63 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
widget_recent-comments
widget_recent-posts
db_upgraded
theysaidso_admin_options
can_compress_scripts

Browser metrics Passed 4 tests

A check of browser resources used by Grid Gallery - Photo Image Grid Gallery
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,977 ▲19113.83 ▼0.528.07 ▲6.2537.56 ▼1.24
Dashboard /wp-admin2,276 ▲1065.57 ▲0.0383.14 ▼12.2541.57 ▲2.26
Posts /wp-admin/edit.php2,193 ▲932.07 ▲0.0939.98 ▲6.8142.15 ▲7.81
Add New Post /wp-admin/post-new.php1,599 ▲7123.02 ▼0.07679.48 ▲2.1850.31 ▼5.51
Media Library /wp-admin/upload.php1,489 ▲864.14 ▼0.07112.68 ▲18.9055.06 ▲14.62
Our Theme /wp-admin/edit.php?post_type=grid_gallery&page=sr-theme-page1,0142.3429.3783.52
Featured Plugins /wp-admin/edit.php?post_type=grid_gallery&page=sr-featured-plugins-page3,4691.7843.93197.67
All Grid Gallery /wp-admin/edit.php?post_type=grid_gallery1,1681.9832.5733.59
Install Plugins /wp-admin/themes.php?page=tgmpa-install-plugins1,0882.0622.5931.28
Upgrade Plugin /wp-admin/edit.php?post_type=grid_gallery&page=sr-upgrade-plugins-page1,0212.0624.6359.19
Add Grid Gallery /wp-admin/post-new.php?post_type=grid_gallery2,4194.1878.11161.37
Docs /wp-admin/edit.php?post_type=grid_gallery&page=sr-doc-page9492.0229.1444.75

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
These items require your attention
  • Zombie WordPress options were found after uninstall: 6 options
    • can_compress_scripts
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-comments
    • widget_theysaidso_widget
    • widget_recent-posts

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Please fix the following server-side errors
    • > GET request to /wp-admin/edit.php?post_type=grid_gallery
    • > Notice in wp-content/plugins/new-grid-gallery/grid-gallery.php+100
    Undefined variable: columns
    • > GET request to /wp-admin/edit.php?post_type=grid_gallery
    • > Notice in wp-content/plugins/new-grid-gallery/grid-gallery.php+100
    Trying to access array offset on value of type null
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=grid_gallery&page=sr-doc-page
    • > request to
    • > Notice in wp-config.php+20
    Undefined index: REQUEST_METHOD

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
Almost there! Just fix the following items
  • 2× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_enqueue_style() in wp-content/plugins/new-grid-gallery/featured-plugins/featured-plugins.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_enqueue_script() in wp-content/plugins/new-grid-gallery/our-theme/awp-theme.php:3

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
These are user-side errors you should fix
    • > GET request to /wp-admin/edit.php?post_type=grid_gallery&page=sr-featured-plugins-page
    • > Network (severe)
    wp-content/plugins/new-grid-gallery/js/bootstrap.js?ver=6.3.1 - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/edit.php?post_type=grid_gallery&page=sr-featured-plugins-page
    • > Network (severe)
    wp-content/plugins/new-grid-gallery/js/featured-plugins/acl-media-upload-script.js?ver=6.3.1 - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/edit.php?post_type=grid_gallery&page=sr-featured-plugins-page
    • > Network (severe)
    wp-content/plugins/new-grid-gallery/js/featured-plugins/bootstrap.min.js?ver=6.3.1 - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/edit.php?post_type=grid_gallery&page=sr-featured-plugins-page
    • > Network (severe)
    wp-content/plugins/new-grid-gallery/featured-plugins/fonts/bootstrap/glyphicons-halflings-regular-2.html - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/edit.php?post_type=grid_gallery&page=sr-featured-plugins-page
    • > Network (severe)
    wp-content/plugins/new-grid-gallery/featured-plugins/fonts/bootstrap/glyphicons-halflings-regular-3.html - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration 93% 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
5 plugin tags: portfolio gallery, grid gallery, image gallery, wordpress gallery plugin, photo gallery

new-grid-gallery/grid-gallery.php 85% from 13 tests

The principal PHP file in "Grid Gallery - Photo Image Grid Gallery" v. 1.3.8 is loaded by WordPress automatically on each request
You should first fix the following items:
  • Main file name: Name the main plugin file the same as the plugin slug ("new-grid-gallery.php" instead of "grid-gallery.php")
  • Text Domain: The text domain should only use lowercase characters and dashes

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
No dangerous file extensions were detected34,409 lines of code in 34 files:
LanguageFilesBlank linesComment linesLines of code
CSS141,9651,98028,723
PHP96261,7223,625
SVG3001,628
PO File1150151340
JavaScript784293

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.40
Average class complexity43.50
▷ Minimum class complexity1.00
▷ Maximum class complexity206.00
Average method complexity3.79
▷ Minimum method complexity1.00
▷ Maximum method complexity34.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes8
▷ Abstract classes00.00%
▷ Concrete classes8100.00%
▷ Final classes00.00%
Methods122
▷ Static methods54.10%
▷ Public methods9779.51%
▷ Protected methods2520.49%
▷ Private methods00.00%
Functions7
▷ Named functions7100.00%
▷ Anonymous functions00.00%
Constants10
▷ Global constants770.00%
▷ Class constants330.00%
▷ Public constants3100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
5 PNG files occupy 1.29MB with 0.81MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
css/new-slide.png2.54KB1.19KB▼ 53.21%
img/grid-gallery-responsive.png1,012.00KB304.66KB▼ 69.90%
img/2017-12-09_17-58-48.png92.91KB29.79KB▼ 67.93%
our-theme/img/aneeq-premium.png165.42KB57.84KB▼ 65.04%
img/pricing-table.png52.90KB22.60KB▼ 57.28%