57% photoblocks-grid-gallery

Code Review | Gallery PhotoBlocks

WordPress plugin Gallery PhotoBlocks scored 57% from 54 tests.

About plugin

  • Plugin page: photoblocks-grid-...
  • Plugin version: 1.3.0
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.2-6.3
  • WordPress version: 6.3.1
  • First release: Feb 28, 2018
  • Latest release: Aug 9, 2023
  • Number of updates: 126
  • Update frequency: every 15.8 days
  • Top authors: GreenTreeLabs (80.95%)giucu91 (11.9%)raldea89 (5.56%)machothemes (3.17%)wpchill (1.59%)

Code review

54 tests

User reviews

73 reviews

Install metrics

5,000+ active / 106,591 total downloads

Benchmarks

Plugin footprint 48% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.62MB] [CPU: ▲0.02ms] Passed 4 tests

This is a short check of server-side resources used by Gallery PhotoBlocks
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /4.13 ▲0.6736.08 ▼4.63
Dashboard /wp-admin4.00 ▲0.6951.87 ▲2.95
Posts /wp-admin/edit.php4.05 ▲0.6957.14 ▲11.97
Add New Post /wp-admin/post-new.php6.51 ▲0.6386.97 ▼8.44
Media Library /wp-admin/upload.php3.74 ▲0.5143.59 ▲10.18
Freemius Debug [v.2.5.10] /wp-admin/admin.php?page=freemius4.1240.92

Server storage [IO: ▲3.82MB] [DB: ▲0.08MB] Passed 3 tests

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 256 new files
Database: 1 new table, 11 new options
New tables
wp_photoblocks
New WordPress options
widget_recent-posts
fs_debug_mode
widget_theysaidso_widget
widget_recent-comments
fs_active_plugins
theysaidso_admin_options
can_compress_scripts
photoblocks_review
db_upgraded
photoblocks_db_version
...

Browser metrics Passed 4 tests

Checking browser requirements for Gallery PhotoBlocks
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,100 ▲36515.53 ▲0.977.06 ▲5.2329.34 ▼16.35
Dashboard /wp-admin2,379 ▲1916.78 ▲1.66168.95 ▲53.3683.48 ▲35.72
Posts /wp-admin/edit.php2,305 ▲2163.71 ▲1.7051.09 ▲13.4481.48 ▲46.40
Add New Post /wp-admin/post-new.php1,703 ▲18422.55 ▼0.68629.15 ▼44.4929.95 ▼40.39
Media Library /wp-admin/upload.php1,447 ▲594.50 ▲0.2987.78 ▼8.5384.15 ▲38.29
Freemius Debug [v.2.5.10] /wp-admin/admin.php?page=freemius1,2963.3743.4768.16

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
It is recommended to fix the following
  • This plugin did not uninstall without warnings or errors
    • > Notice in wp-content/plugins/photoblocks-grid-gallery/freemius/includes/class-freemius.php+8486
    Undefined property: stdClass::$plugins
  • The plugin did not uninstall successfully, leaving 1 table in the database
    • wp_photoblocks
  • Zombie WordPress options were found after uninstall: 11 options
    • fs_accounts
    • theysaidso_admin_options
    • fs_debug_mode
    • can_compress_scripts
    • photoblocks_review
    • photoblocks_db_version
    • widget_recent-comments
    • db_upgraded
    • fs_active_plugins
    • 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
Everything seems fine, however 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
Almost there! Just fix the following items
  • 2× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/photoblocks-grid-gallery/admin/partials/photoblocks-troubleshooting.php
    • > /wp-content/plugins/photoblocks-grid-gallery/admin/partials/field-type/filters_claim.php
  • 28× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_kses_post() in wp-content/plugins/photoblocks-grid-gallery/admin/partials/field-type/text.php:3
    • > PHP Notice
      Undefined variable: field in wp-content/plugins/photoblocks-grid-gallery/admin/partials/field-type/select.php on line 1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/photoblocks-grid-gallery/admin/partials/drawer-sections/image.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_kses_post() in wp-content/plugins/photoblocks-grid-gallery/admin/partials/field-type/checkbox.php:2
    • > PHP Notice
      Undefined variable: field in wp-content/plugins/photoblocks-grid-gallery/admin/partials/field-type/toggle.php on line 1
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/photoblocks-grid-gallery/admin/partials/fields-markup.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_kses_post() in wp-content/plugins/photoblocks-grid-gallery/admin/partials/field-type/dynamic_list.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_kses_post() in wp-content/plugins/photoblocks-grid-gallery/admin/partials/field-type/number.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/photoblocks-grid-gallery/admin/partials/photoblocks-dashboard.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_kses_post() in wp-content/plugins/photoblocks-grid-gallery/admin/partials/field-type/help_social.php:2

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
There were no browser issues found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Please fix the following attributes:
  • Tags: There are too many tags (13 tag instead of maximum 10)
The official readme.txt might help

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

The primary PHP file in "Gallery PhotoBlocks" version 1.3.0 is used by WordPress to initiate all plugin functionality
It is important to fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("photoblocks-grid-gallery.php" instead of "photoblocks.php")
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Everything looks great! No dangerous files found in this plugin45,190 lines of code in 193 files:
LanguageFilesBlank linesComment linesLines of code
PHP1538,32817,91736,910
JavaScript131,0521,1164,994
CSS21204692,768
PO File2188328443
SVG42175

PHP code 50% from 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
These items need your attention
  • Cyclomatic complexity of classes should be reduced to less than 1000 (currently 3,073)
Cyclomatic complexity
Average complexity per logical line of code0.61
Average class complexity81.66
▷ Minimum class complexity1.00
▷ Maximum class complexity3,073.00
Average method complexity4.49
▷ Minimum method complexity1.00
▷ Maximum method complexity94.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes58
▷ Abstract classes23.45%
▷ Concrete classes5696.55%
▷ Final classes00.00%
Methods1,371
▷ Static methods20114.66%
▷ Public methods97170.82%
▷ Protected methods171.24%
▷ Private methods38327.94%
Functions102
▷ Named functions102100.00%
▷ Anonymous functions00.00%
Constants148
▷ Global constants10168.24%
▷ Class constants4731.76%
▷ Public constants47100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
7 PNG files occupy 0.10MB with 0.03MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/css/chosen-sprite@2x.png0.72KB0.83KB0.00%
admin/icon.png1.22KB0.55KB▼ 54.89%
freemius/assets/img/theme-icon.png10.97KB5.78KB▼ 47.37%
admin/css/chosen-sprite.png0.53KB0.88KB0.00%
admin/css/jquery.minicolors.png67.02KB34.31KB▼ 48.80%