67% photo-image-gallery

Code Review | WordPress Photo Gallery - Image Gallery

WordPress plugin WordPress Photo Gallery - Image Gallery scored67%from 54 tests.

About plugin

  • Plugin page: photo-image-gallery
  • Plugin version: 2.0.4
  • PHP version: 7.4.16
  • WordPress compatibility: 3.3-5.8
  • WordPress version: 6.3.1
  • First release: Jan 26, 2020
  • Latest release: Jul 27, 2021
  • Number of updates: 8
  • Update frequency: every 69.0 days
  • Top authors: uxgallery (100%)

Code review

54 tests

User reviews

12 reviews

Install metrics

800+ active /15,523 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
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.59MB] [CPU: ▼4.25ms] Passed 4 tests

A check of server-side resources used by WordPress Photo Gallery - Image Gallery
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /4.13 ▲0.6643.21 ▲5.78
Dashboard /wp-admin4.27 ▲0.9651.97 ▲8.01
Posts /wp-admin/edit.php4.30 ▲0.9452.73 ▲4.92
Add New Post /wp-admin/post-new.php5.77 ▼0.1256.88 ▼35.69
Media Library /wp-admin/upload.php4.13 ▲0.8944.96 ▲10.30
Albums (PRO) /wp-admin/admin.php?page=galleries_ux_albums4.1243.53
Lightbox Settings /wp-admin/admin.php?page=Options_gallery_lightbox_styles4.3744.43
Template Settings /wp-admin/admin.php?page=Options_gallery_styles6.0261.54
Galleries /wp-admin/admin.php?page=galleries_uxgallery4.2048.87

Server storage [IO: ▲3.75MB] [DB: ▲0.04MB] Passed 3 tests

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 273 new files
Database: 6 new tables, 543 new options
New tables
wp_ux_gallery_like_dislike
wp_ux_gallery_gallerys
wp_ux_gallery_categories
wp_ux_gallery_albums
wp_ux_gallery_images
wp_ux_gallery_album_has_gallery
New WordPress options
uxgallery_light_box_top
uxgallery_ht_view5_linkbutton_font_size
uxgallery_album_popup_blur_text_color
uxgallery_ht_view8_element_animation_speed
uxgallery_ht_blog_likedislike_bg_trans
uxgallery_lightbox_pinterestButton
uxgallery_image_natural_size_thumbnail
uxgallery_ht_album_show_sharing_buttons
uxgallery_thumb_title_font_size
uxgallery_ht_album_mosaic_image_border_radius
...

Browser metrics Passed 4 tests

An overview of browser requirements for WordPress Photo Gallery - Image Gallery
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,934 ▲18813.32 ▼0.991.61 ▼0.4239.53 ▲0.35
Dashboard /wp-admin2,340 ▲1485.90 ▲0.9595.90 ▼7.9471.31 ▲27.63
Posts /wp-admin/edit.php2,227 ▲1382.02 ▼0.0136.38 ▲0.5637.13 ▲0.95
Add New Post /wp-admin/post-new.php6,482 ▲4,93527.90 ▲9.60953.66 ▲300.8640.25 ▼16.42
Media Library /wp-admin/upload.php1,523 ▲1354.20 ▼0.02106.11 ▼3.5448.02 ▲3.39
Albums (PRO) /wp-admin/admin.php?page=galleries_ux_albums1,1923.7761.4037.30
Lightbox Settings /wp-admin/admin.php?page=Options_gallery_lightbox_styles2,9333.9662.6281.77
Template Settings /wp-admin/admin.php?page=Options_gallery_styles7,1084.9790.81133.64
Galleries /wp-admin/admin.php?page=galleries_uxgallery1,2743.4951.6162.42

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
You still need to fix the following
  • Zombie tables detected upon uninstall: 6 tables
    • wp_ux_gallery_albums
    • wp_ux_gallery_like_dislike
    • wp_ux_gallery_album_has_gallery
    • wp_ux_gallery_gallerys
    • wp_ux_gallery_images
    • wp_ux_gallery_categories
  • This plugin did not uninstall successfully, leaving 543 options in the database
    • uxgallery_ht_album_popup_mosaic_image_margin_right_in_px
    • uxgallery_light_box_opacity
    • uxgallery_album_lightbox_category_style
    • uxgallery_lightbox_lightboxView
    • can_compress_scripts
    • uxgallery_ht_album_popup_image_scale_opacity
    • uxgallery_thumb_box_has_background
    • uxgallery_lightbox_overlayClose_new
    • uxgallery_video_ht_view1_loadmore_text
    • uxgallery_album_thumbnail_bottom_text_color
    • ...

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 everything seems fine, this is not an exhaustive test

SRP 0% 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
Please fix the following items
  • 4× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/photo-image-gallery/templates/front-end/view/content-slider/content-slider-view.php
    • > /wp-content/plugins/photo-image-gallery/templates/front-end/view/album/album-general.css.php
    • > /wp-content/plugins/photo-image-gallery/templates/admin/gallery-images-list-html.php
    • > /wp-content/plugins/photo-image-gallery/templates/front-end/view/slider/slider-view.php
  • 278× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Notice
      Undefined variable: galleryID in wp-content/plugins/photo-image-gallery/templates/front-end/view/slider/slider-view.php on line 251
    • > PHP Notice
      Undefined variable: galleryID in wp-content/plugins/photo-image-gallery/templates/front-end/view/slider/slider-view.php on line 323
    • > PHP Notice
      Undefined variable: like_dislike in wp-content/plugins/photo-image-gallery/templates/front-end/view/justified/justified-view.php on line 4
    • > PHP Notice
      Undefined variable: galleryID in wp-content/plugins/photo-image-gallery/templates/front-end/view/slider/slider-view.php on line 214
    • > PHP Notice
      Undefined variable: galleryID in wp-content/plugins/photo-image-gallery/templates/front-end/view/content-popup/content-popup-view.css.php on line 3
    • > PHP Notice
      Undefined variable: galleryID in wp-content/plugins/photo-image-gallery/templates/front-end/view/slider/slider-view.php on line 515
    • > PHP Notice
      Undefined variable: galleryID in wp-content/plugins/photo-image-gallery/templates/front-end/view/slider/slider-view.php on line 502
    • > PHP Notice
      Undefined variable: galleryID in wp-content/plugins/photo-image-gallery/templates/front-end/view/slider/slider-view.php on line 481
    • > PHP Notice
      Undefined variable: galleryID in wp-content/plugins/photo-image-gallery/templates/front-end/view/slider/slider-view.php on line 215
    • > PHP Warning
      Invalid argument supplied for foreach() in wp-content/plugins/photo-image-gallery/templates/front-end/view/content-slider/content-slider-view.php on line 10

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Everything seems fine, but this is not an exhaustive test

Optimizations

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

photo-image-gallery/ux-gallery.php 77% from 13 tests

The entry point to "WordPress Photo Gallery - Image Gallery" version 2.0.4 is a PHP file that has certain tags in its header comment area
Please make the necessary changes and fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("photo-image-gallery.php" instead of "ux-gallery.php")
  • Domain Path: The domain path is invalid: folder "/languages" does not exist
  • Description: The description should be shorter than 140 characters (currently 148 characters long)

Code Analysis Passed 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
No dangerous file extensions were detected42,085 lines of code in 143 files:
LanguageFilesBlank linesComment linesLines of code
PHP571,60996121,319
JavaScript381,8177919,493
CSS208784596,192
SVG1102,569
Sass1323241,256
LESS1323331,247
HTML1309

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.35
Average class complexity35.18
▷ Minimum class complexity1.00
▷ Maximum class complexity245.00
Average method complexity7.05
▷ Minimum method complexity1.00
▷ Maximum method complexity41.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes17
▷ Abstract classes00.00%
▷ Concrete classes17100.00%
▷ Final classes15.88%
Methods96
▷ Static methods1717.71%
▷ Public methods8184.38%
▷ Protected methods88.33%
▷ Private methods77.29%
Functions16
▷ Named functions16100.00%
▷ Anonymous functions00.00%
Constants13
▷ Global constants13100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
94 PNG files occupy 0.58MB with 0.35MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/admin_images/right.png1.25KB0.36KB▼ 71.23%
assets/images/admin_images/gradient.black.to.white.png0.96KB0.21KB▼ 78.39%
assets/images/admin_images/gallery-active.png1.38KB0.42KB▼ 69.92%
assets/images/admin_images/post.button.png0.45KB0.62KB0.00%
assets/images/admin_images/duble.png1.17KB0.14KB▼ 87.95%