79% simply-gallery-block

Code Review | Gallery Blocks with Lightbox. Image Gallery, (HTML5 video , YouTube, Vimeo) Video Gallery and Lightbox for native gallery

WordPress plugin Gallery Blocks with Lightbox. Image Gallery, (HTML5 video , YouTube, Vimeo) Video Gallery and Lightbox for native gallery scored79%from 54 tests.

About plugin

  • Plugin page: simply-gallery-block
  • Plugin version: 3.1.8
  • PHP compatiblity: 5.3.8+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.8.0-6.4
  • WordPress version: 6.3.1
  • First release: Oct 5, 2019
  • Latest release: Nov 14, 2023
  • Number of updates: 131
  • Update frequency: every 11.5 days
  • Top authors: gallerycreator (100%)

Code review

54 tests

User reviews

95 reviews

Install metrics

30,000+ active /529,546 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
Installer ran successfully

Server metrics [RAM: ▲5.26MB] [CPU: ▲29.38ms] 75% from 4 tests

Server-side resources used by Gallery Blocks with Lightbox. Image Gallery, (HTML5 video , YouTube, Vimeo) Video Gallery and Lightbox for native gallery
Please fix the following
  • Extra RAM: The extra memory usage must be under 5MB (currently 5.26MB on /wp-admin/admin.php?page=freemius)
PageMemory (MB)CPU Time (ms)
Home /9.02 ▲5.5569.07 ▲25.67
Dashboard /wp-admin9.04 ▲5.7380.09 ▲31.49
Posts /wp-admin/edit.php9.04 ▲5.6878.53 ▲29.38
Add New Post /wp-admin/post-new.php9.98 ▲4.09132.25 ▲30.99
Media Library /wp-admin/upload.php9.04 ▲5.8075.65 ▲41.20
Freemius Debug [v.2.6.0] /wp-admin/admin.php?page=freemius9.0467.61

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

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 268 new files
Database: no new tables, 11 new options
New WordPress options
widget_theysaidso_widget
fs_debug_mode
widget_recent-comments
widget_pgc_sgb_widget_gallery
fs_accounts
fs_active_plugins
theysaidso_admin_options
db_upgraded
pgc_sgb_global_lightbox_use
can_compress_scripts
...

Browser metrics Passed 4 tests

Gallery Blocks with Lightbox. Image Gallery, (HTML5 video , YouTube, Vimeo) Video Gallery and Lightbox for native gallery: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,013 ▲22616.44 ▲2.0913.44 ▲11.5231.37 ▼13.19
Dashboard /wp-admin2,353 ▲1737.12 ▲1.50240.77 ▲143.5951.83 ▲10.23
Posts /wp-admin/edit.php2,148 ▲512.02 ▲0.0741.73 ▲2.7940.03 ▲5.52
Add New Post /wp-admin/post-new.php6,433 ▲4,90729.03 ▲5.61836.08 ▲171.3734.45 ▼26.63
Media Library /wp-admin/upload.php1,447 ▲534.23 ▲0.0096.71 ▲0.1545.24 ▲2.66
Freemius Debug [v.2.6.0] /wp-admin/admin.php?page=freemius1,1161.6625.7030.82

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
You still need to fix the following
  • The plugin did not uninstall gracefully
    • > Notice in wp-content/plugins/simply-gallery-block/freemius/includes/class-freemius.php+8546
    Undefined property: stdClass::$plugins
  • This plugin does not fully uninstall, leaving 10 options in the database
    • theysaidso_admin_options
    • fs_debug_mode
    • widget_pgc_sgb_widget_gallery
    • widget_theysaidso_widget
    • fs_accounts
    • widget_recent-comments
    • widget_recent-posts
    • fs_active_plugins
    • db_upgraded
    • can_compress_scripts

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Even though everything seems fine, this is not an exhaustive test

SRP Passed 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Looking good! No server-side errors or output on direct access of PHP files

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser issues were found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
6 plugin tags: gallery, block, wordpress gallery plugin, image gallery, video gallery...

simply-gallery-block/plugin.php 85% from 13 tests

The main PHP script in "Gallery Blocks with Lightbox. Image Gallery, (HTML5 video , YouTube, Vimeo) Video Gallery and Lightbox for native gallery" version 3.1.8 is automatically included on every request by WordPress
You should first fix the following items:
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 330 characters long)
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("simply-gallery-block.php" instead of "plugin.php")

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
No dangerous file extensions were detected36,049 lines of code in 187 files:
LanguageFilesBlank linesComment linesLines of code
PHP1268,29817,53435,582
JavaScript223459213
JSON800135
CSS3110119

PHP code 50% from 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
Please tend to the following items
  • Cyclomatic complexity of classes should be reduced to less than 1000 (currently 3,096)
Cyclomatic complexity
Average complexity per logical line of code0.62
Average class complexity82.78
▷ Minimum class complexity1.00
▷ Maximum class complexity3,096.00
Average method complexity4.55
▷ Minimum method complexity1.00
▷ Maximum method complexity94.00
Code structure
Namespaces0
Interfaces1
Traits0
Classes54
▷ Abstract classes23.70%
▷ Concrete classes5296.30%
▷ Final classes00.00%
Methods1,296
▷ Static methods19915.35%
▷ Public methods89368.90%
▷ Protected methods201.54%
▷ Private methods38329.55%
Functions175
▷ Named functions16896.00%
▷ Anonymous functions74.00%
Constants155
▷ Global constants10869.68%
▷ Class constants4730.32%
▷ Public constants47100.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
13 compressed PNG files occupy 0.19MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/coverAlbum-400x400.png17.28KB16.45KB▼ 4.79%
assets/woocommerce_128x128.png3.35KB2.54KB▼ 24.18%
assets/itemsManager.png34.69KB34.33KB▼ 1.04%
freemius/assets/img/plugin-icon.png9.16KB5.26KB▼ 42.58%
assets/cPanel.png21.56KB21.20KB▼ 1.65%