67% gallery-image-gallery-photo

Code Review | Image Gallery - Grid Gallery

WordPress plugin Image Gallery - Grid Gallery scored 67% from 54 tests.

About plugin

  • Plugin page: gallery-image-gal...
  • Plugin version: 1.1.7
  • PHP version: 7.4.16
  • WordPress compatibility: 4.2-6.0
  • WordPress version: 6.3.1
  • First release: Oct 22, 2016
  • Latest release: Sep 2, 2022
  • Number of updates: 58
  • Update frequency: every 36.9 days
  • Top authors: richteam (100%)

Code review

54 tests

User reviews

16 reviews

Install metrics

100+ active / 7,711 total downloads

Benchmarks

Plugin footprint 65% 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.03MB] [CPU: ▼2.49ms] Passed 4 tests

This is a short check of server-side resources used by Image Gallery - Grid Gallery
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0436.09 ▼5.41
Dashboard /wp-admin3.34 ▲0.0343.65 ▼5.36
Posts /wp-admin/edit.php3.39 ▲0.0347.80 ▲0.75
Add New Post /wp-admin/post-new.php5.94 ▲0.0595.23 ▲7.44
Media Library /wp-admin/upload.php3.26 ▲0.0335.00 ▲0.08

Server storage [IO: ▲5.32MB] [DB: ▲0.02MB] Passed 3 tests

Input-output and database impact of this plugin
This plugin was installed successfully
Filesystem: 173 new files
Database: 8 new tables, 7 new options
New tables
wp_rich_web_gallery_font_family
wp_rich_web_gallery_image_instal
wp_rich_web_gallery_effects_data_2
wp_rich_web_questions
wp_rich_web_gallery_effects_data_1
wp_rich_web_gallery_image_manager
wp_rich_web_gallery_id
wp_rich_web_gallery_effects_data
New WordPress options
db_upgraded
widget_rich_web_gallery_image
widget_recent-posts
theysaidso_admin_options
widget_recent-comments
widget_theysaidso_widget
can_compress_scripts

Browser metrics Passed 4 tests

A check of browser resources used by Image Gallery - Grid Gallery
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,045 ▲31015.84 ▲1.4511.29 ▲9.5837.51 ▼11.94
Dashboard /wp-admin2,273 ▲826.04 ▲1.00129.97 ▲21.7186.08 ▲43.20
Posts /wp-admin/edit.php2,155 ▲633.23 ▲1.2358.47 ▲17.6734.80 ▼2.02
Add New Post /wp-admin/post-new.php1,727 ▲18925.29 ▲2.15574.78 ▼104.9627.33 ▼33.56
Media Library /wp-admin/upload.php1,455 ▲705.04 ▲0.83123.94 ▲24.1983.72 ▲40.46
Gallery Manager /wp-admin/admin.php?page=Rich-Web Gallery Admin?Rich_Web_IGallery_Nonce=b344d5573d280.440.073.74
Gallery Options /wp-admin/admin.php?page=Rich-Web Gallery General?Rich_Web_IGallery_Nonce=b344d5573d280.440.073.30
Our Products /wp-admin/admin.php?page=Rich-Web Gallery Products1,0102.8942.3648.16

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Please fix the following items
  • The uninstall procedure failed, leaving 8 tables in the database
    • wp_rich_web_gallery_font_family
    • wp_rich_web_gallery_image_manager
    • wp_rich_web_gallery_effects_data
    • wp_rich_web_gallery_effects_data_1
    • wp_rich_web_gallery_image_instal
    • wp_rich_web_gallery_effects_data_2
    • wp_rich_web_gallery_id
    • wp_rich_web_questions
  • Zombie WordPress options were found after uninstall: 7 options
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-posts
    • widget_rich_web_gallery_image
    • widget_theysaidso_widget
    • widget_recent-comments
    • can_compress_scripts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP 50% 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
  • 5× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_sql() in wp-content/plugins/gallery-image-gallery-photo/Rich-Web-Gallery-Image-Install.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/gallery-image-gallery-photo/Rich-Web-Gallery-Image-Ajax.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/gallery-image-gallery-photo/Rich-Web-Gallery-Image-Widget.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/gallery-image-gallery-photo/Gallery.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/gallery-image-gallery-photo/Rich-Web-Gallery-Image-Shortcode.php:11

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Please fix the following browser errors
    • > GET request to /wp-admin/admin.php?page=Rich-Web Gallery Admin?Rich_Web_IGallery_Nonce=b344d5573d
    • > Network (severe)
    wp-admin/admin.php?page=Rich-Web%20Gallery%20Admin?Rich_Web_IGallery_Nonce=b344d5573d - Failed to load resource: the server responded with a status of 403 (Forbidden)
    • > GET request to /wp-admin/admin.php?page=Rich-Web Gallery General?Rich_Web_IGallery_Nonce=b344d5573d
    • > Network (severe)
    wp-admin/admin.php?page=Rich-Web%20Gallery%20General?Rich_Web_IGallery_Nonce=b344d5573d - Failed to load resource: the server responded with a status of 403 (Forbidden)

Optimizations

Plugin configuration 87% from 29 tests

readme.txt 88% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
These attributes need to be fixed:
  • Screenshots: These screenshots need descriptions #6, #7, #8, #9 in gallery-image-gallery-photo/assets to your readme.txt
  • Screenshots: These screenshots require images: #13 (Lighbox), #14 (Justified / Translate Effect), #15 (Justified Image / Scale Effect), #16 (Justified Gallery / Lighbox 2)
The official readme.txt is a good inspiration

gallery-image-gallery-photo/Gallery.php 85% from 13 tests

The primary PHP file in "Image Gallery - Grid Gallery" version 1.1.7 is used by WordPress to initiate all plugin functionality
The following require your attention:
  • Description: Please don't use more than 140 characters for the plugin description (currently 152 characters long)
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("gallery-image-gallery-photo.php" instead of "Gallery.php")

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
No dangerous file extensions were detected15,982 lines of code in 116 files:
LanguageFilesBlank linesComment linesLines of code
PHP121201289,033
CSS321,077494,752
JavaScript67642771,284
SVG401911
Markdown1102

PHP code 50% from 2 tests

This is a very shot review of cyclomatic complexity and code structure
Please fix the following
  • Cyclomatic complexity of methods has to be reduced to less than 100 (currently 273)
Cyclomatic complexity
Average complexity per logical line of code0.14
Average class complexity274.00
▷ Minimum class complexity274.00
▷ Maximum class complexity274.00
Average method complexity92.00
▷ Minimum method complexity1.00
▷ Maximum method complexity273.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods3
▷ Static methods00.00%
▷ Public methods3100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions20
▷ Named functions20100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
13 compressed PNG files occupy 0.11MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
Images/Products/Forms.png3.40KB3.38KB▼ 0.66%
Images/transparency-grid.png2.58KB2.80KB0.00%
Images/Products/Coming-Soon.png5.13KB4.25KB▼ 17.20%
Images/Products/Timeline.png3.70KB2.72KB▼ 26.45%
Images/Products/Slider-Video.png3.09KB2.93KB▼ 5.43%