68% justified-gallery

Code Review | Justified Gallery

WordPress plugin Justified Gallery scored68%from 54 tests.

About plugin

  • Plugin page: justified-gallery
  • Plugin version: 1.8.1
  • PHP compatiblity: 5.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-6.2
  • WordPress version: 6.3.1
  • First release: Jun 4, 2016
  • Latest release: Jul 8, 2023
  • Number of updates: 36
  • Update frequency: every 71.9 days
  • Top authors: matczar (61.11%)damian-gora (41.67%)

Code review

54 tests

User reviews

193 reviews

Install metrics

10,000+ active /149,461 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
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲5.20MB] [CPU: ▲23.21ms] 75% from 4 tests

A check of server-side resources used by Justified Gallery
It is recommended to improve the following
  • Extra RAM: Extra memory usage should kept under 5MB (currently 5.20MB on /wp-admin/admin.php?page=freemius)
PageMemory (MB)CPU Time (ms)
Home /8.88 ▲5.4172.20 ▲34.69
Dashboard /wp-admin8.90 ▲5.5579.54 ▲14.06
Posts /wp-admin/edit.php8.90 ▲5.5488.41 ▲41.92
Add New Post /wp-admin/post-new.php10.17 ▲4.28112.67 ▲14.34
Media Library /wp-admin/upload.php8.90 ▲5.6771.20 ▲29.76
Freemius Debug [v.2.5.10] /wp-admin/admin.php?page=freemius8.9067.21

Server storage [IO: ▲4.01MB] [DB: ▲0.01MB] Passed 3 tests

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 269 new files
Database: no new tables, 12 new options
New WordPress options
theysaidso_admin_options
widget_recent-comments
dgwt_jg_activation_date
can_compress_scripts
dgwt_jg_settings
fs_debug_mode
widget_recent-posts
db_upgraded
fs_accounts
fs_active_plugins
...

Browser metrics Passed 4 tests

This is an overview of browser requirements for Justified Gallery
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,979 ▲21814.61 ▲0.261.56 ▼0.1027.10 ▼17.07
Dashboard /wp-admin2,388 ▲2076.34 ▲0.63118.77 ▲12.5389.07 ▲42.75
Posts /wp-admin/edit.php2,314 ▲2143.50 ▲1.4847.94 ▲8.6669.74 ▲36.56
Add New Post /wp-admin/post-new.php1,527 ▼15221.70 ▼0.48679.04 ▼23.3537.45 ▼14.01
Media Library /wp-admin/upload.php1,453 ▲564.30 ▲0.1084.68 ▼24.0189.24 ▲44.99
Freemius Debug [v.2.5.10] /wp-admin/admin.php?page=freemius1,2743.2739.9260.02

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
These items require your attention
  • This plugin cannot be uninstalled
    • > Notice in wp-content/plugins/justified-gallery/includes/fs/lib/includes/class-freemius.php+8486
    Undefined property: stdClass::$plugins
  • The uninstall procedure has failed, leaving 12 options in the database
    • widget_recent-comments
    • fs_accounts
    • fs_debug_mode
    • theysaidso_admin_options
    • dgwt_jg_settings
    • fs_active_plugins
    • widget_theysaidso_widget
    • db_upgraded
    • dgwt_jg_activation_date
    • widget_recent-posts
    • ...

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 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please fix the following
  • 1× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/justified-gallery/includes/Block.php
  • 5× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/justified-gallery/includes/TilesStyle/Simple/promobox.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/justified-gallery/includes/Lightbox/Swipebox/promobox.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/justified-gallery/includes/TilesStyle/Layla/promobox.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/justified-gallery/includes/TilesStyle/JGStandard/promobox.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/justified-gallery/includes/Lightbox/Photoswipe/promobox.php:2

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser issues were found

Optimizations

Plugin configuration Passed 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: justified gallery, wordpress gallery, gutenberg block, gallery grid, best gallery plugin

justified-gallery/justified-gallery.php Passed 13 tests

The primary PHP file in "Justified Gallery" version 1.8.1 is used by WordPress to initiate all plugin functionality
94 characters long description:
Display native WordPress galleries in a responsive justified image grid and a pretty Lightbox.

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Everything looks great! No dangerous files found in this plugin45,073 lines of code in 207 files:
LanguageFilesBlank linesComment linesLines of code
PHP1548,70618,79737,160
JavaScript221,4019405,859
CSS253311451,974
Sass16042
Markdown117029
SVG4009

PHP code 50% from 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
Please fix the following
  • Class cyclomatic complexity should be reduced to less than 1000 (currently 3,073)
Cyclomatic complexity
Average complexity per logical line of code0.62
Average class complexity66.11
▷ Minimum class complexity1.00
▷ Maximum class complexity3,073.00
Average method complexity4.36
▷ Minimum method complexity1.00
▷ Maximum method complexity94.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes75
▷ Abstract classes45.33%
▷ Concrete classes7194.67%
▷ Final classes11.41%
Methods1,471
▷ Static methods23315.84%
▷ Public methods1,06072.06%
▷ Protected methods211.43%
▷ Private methods39026.51%
Functions118
▷ Named functions10185.59%
▷ Anonymous functions1714.41%
Constants172
▷ Global constants10963.37%
▷ Class constants6336.63%
▷ Public constants63100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
8 PNG files occupy 0.09MB with 0.04MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/img/jg-logo-128.png18.54KB12.57KB▼ 32.20%
includes/Lightbox/Photoswipe/assets/white-light-skin/skin.png15.02KB0.72KB▼ 95.22%
includes/fs/lib/assets/img/plugin-icon.png9.16KB5.26KB▼ 42.58%
includes/Lightbox/Photoswipe/assets/default-skin/default-skin.png0.53KB0.72KB0.00%
includes/Lightbox/Swipebox/assets/img/icons.png0.71KB0.43KB▼ 39.64%