66% new-image-gallery

Code Review | Image Gallery - Lightbox Gallery, Responsive Photo Gallery, Masonry Gallery

WordPress plugin Image Gallery - Lightbox Gallery, Responsive Photo Gallery, Masonry Gallery scored66%from 54 tests.

About plugin

  • Plugin page: new-image-gallery
  • Plugin version: 1.4.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-6.3.2
  • WordPress version: 6.3.1
  • First release: Jul 22, 2016
  • Latest release: Oct 20, 2023
  • Number of updates: 167
  • Update frequency: every 16.0 days
  • Top authors: awordpresslife (100%)

Code review

54 tests

User reviews

34 reviews

Install metrics

6,000+ active /156,622 total downloads

Benchmarks

Plugin footprint 82% 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: ▲0.52MB] [CPU: ▲4.14ms] 75% from 4 tests

Server-side resources used by Image Gallery - Lightbox Gallery, Responsive Photo Gallery, Masonry Gallery
Please fix the following
  • CPU: Total CPU usage must kept under 500.00ms (currently 655.70ms on /wp-admin/edit.php?post_type=image_gallery&page=fp-page)
PageMemory (MB)CPU Time (ms)
Home /4.00 ▲0.5343.26 ▲7.21
Dashboard /wp-admin3.87 ▲0.5661.24 ▲13.76
Posts /wp-admin/edit.php3.92 ▲0.5648.90 ▲4.74
Add New Post /wp-admin/post-new.php6.39 ▲0.5085.95 ▼0.19
Media Library /wp-admin/upload.php3.73 ▲0.4936.93 ▲4.80
Our Theme /wp-admin/edit.php?post_type=image_gallery&page=ig-sr-theme-page3.7033.71
Docs /wp-admin/edit.php?post_type=image_gallery&page=ig-sr-doc-page3.7034.88
Add Image Gallery /wp-admin/post-new.php?post_type=image_gallery3.9749.38
Install Plugins /wp-admin/themes.php?page=tgmpa-install-plugins3.8039.61
All Image Gallery /wp-admin/edit.php?post_type=image_gallery3.7334.88
Featured Plugins /wp-admin/edit.php?post_type=image_gallery&page=fp-page4.07655.70

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

Filesystem and database footprint
The plugin installed successfully
Filesystem: 79 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
widget_recent-comments
widget_recent-posts
db_upgraded
can_compress_scripts
widget_theysaidso_widget

Browser metrics Passed 4 tests

Checking browser requirements for Image Gallery - Lightbox Gallery, Responsive Photo Gallery, Masonry Gallery
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,948 ▲18713.46 ▼0.688.23 ▲6.5142.09 ▲0.77
Dashboard /wp-admin2,272 ▲945.57 ▼0.0888.07 ▼14.6343.47 ▲0.18
Posts /wp-admin/edit.php2,186 ▲862.03 ▼0.0035.49 ▼1.4035.85 ▲0.46
Add New Post /wp-admin/post-new.php1,592 ▲5723.05 ▲4.65678.45 ▲28.6055.45 ▼11.62
Media Library /wp-admin/upload.php1,488 ▲854.30 ▲0.1193.92 ▼5.6946.76 ▲1.87
Our Theme /wp-admin/edit.php?post_type=image_gallery&page=ig-sr-theme-page1,0132.1825.2577.40
Docs /wp-admin/edit.php?post_type=image_gallery&page=ig-sr-doc-page9572.0225.1443.63
Add Image Gallery /wp-admin/post-new.php?post_type=image_gallery2,6263.8573.06101.40
Install Plugins /wp-admin/themes.php?page=tgmpa-install-plugins1,0842.0523.1930.62
All Image Gallery /wp-admin/edit.php?post_type=image_gallery1,1671.9835.5634.17
Featured Plugins /wp-admin/edit.php?post_type=image_gallery&page=fp-page4,3401.8329.98220.58

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
It is recommended to fix the following
  • The uninstall procedure has failed, leaving 6 options in the database
    • can_compress_scripts
    • widget_recent-posts
    • widget_recent-comments
    • db_upgraded
    • widget_theysaidso_widget
    • theysaidso_admin_options

Smoke tests 0% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Almost there, just fix the following server-side errors
    • > GET request to /wp-admin/edit.php?post_type=image_gallery
    • > Notice in wp-content/plugins/new-image-gallery/new-image-gallery.php+121
    Undefined variable: columns
    • > GET request to /wp-admin/edit.php?post_type=image_gallery
    • > Notice in wp-content/plugins/new-image-gallery/new-image-gallery.php+121
    Trying to access array offset on value of type null

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
Please fix the following items
  • 1× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/new-image-gallery/include/docs.php
  • 9× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_enqueue_style() in wp-content/plugins/new-image-gallery/include/nig-bootstrap-lightbox.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function did_action() in wp-content/plugins/new-image-gallery/class-tgm-plugin-activation.php:2129
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_enqueue_style() in wp-content/plugins/new-image-gallery/featured-plugins/featured-plugins.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/new-image-gallery/new-image-gallery.php:445
    • > PHP Notice
      Undefined variable: image_gallery_id in wp-content/plugins/new-image-gallery/include/nig-no-lightbox.php on line 6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_enqueue_script() in wp-content/plugins/new-image-gallery/our-theme/awp-theme.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_post_meta() in wp-content/plugins/new-image-gallery/include/gallery-settings.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/new-image-gallery/include/shortcode.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Query' not found in wp-content/plugins/new-image-gallery/include/nig-no-lightbox.php:10

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Please take a look at the following user-side issues
    • > GET request to /wp-admin/edit.php?post_type=image_gallery&page=ig-sr-theme-page
    • > Network (severe)
    wp-content/plugins/new-image-gallery/js/bootstrap.min.js?ver=6.3.1 - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/edit.php?post_type=image_gallery&page=fp-page
    • > Network (severe)
    wp-content/plugins/new-image-gallery/css/bootstrap.css?ver=6.3.1 - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/edit.php?post_type=image_gallery&page=fp-page
    • > Network (severe)
    wp-content/plugins/new-image-gallery/js/bootstrap.js?ver=6.3.1 - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/edit.php?post_type=image_gallery&page=fp-page
    • > Network (severe)
    wp-content/plugins/new-image-gallery/js/featured-plugins/acl-media-upload-script.js?ver=6.3.1 - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/edit.php?post_type=image_gallery&page=fp-page
    • > Network (severe)
    wp-content/plugins/new-image-gallery/js/featured-plugins/bootstrap.min.js?ver=6.3.1 - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/edit.php?post_type=image_gallery&page=fp-page
    • > Network (severe)
    wp-content/plugins/new-image-gallery/featured-plugins/fonts/bootstrap/glyphicons-halflings-regular-2.html - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/edit.php?post_type=image_gallery&page=fp-page
    • > Network (severe)
    wp-content/plugins/new-image-gallery/featured-plugins/fonts/bootstrap/glyphicons-halflings-regular-3.html - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Attributes that require attention: The official readme.txt is a good inspiration

new-image-gallery/new-image-gallery.php Passed 13 tests

Analyzing the main PHP file in "Image Gallery - Lightbox Gallery, Responsive Photo Gallery, Masonry Gallery" version 1.4.2
87 characters long description:
The best image gallery plugin with responsive design multiple columns lightbox preview.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
There were no executable files found in this plugin37,452 lines of code in 40 files:
LanguageFilesBlank linesComment linesLines of code
CSS154,2518,60428,680
PHP106331,7703,504
JavaScript106941,0223,309
SVG3001,628
PO File2156170331

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.41
Average class complexity43.25
▷ Minimum class complexity1.00
▷ Maximum class complexity206.00
Average method complexity3.79
▷ Minimum method complexity1.00
▷ Maximum method complexity34.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes8
▷ Abstract classes00.00%
▷ Concrete classes8100.00%
▷ Final classes00.00%
Methods121
▷ Static methods54.13%
▷ Public methods9679.34%
▷ Protected methods2520.66%
▷ Private methods00.00%
Functions7
▷ Named functions7100.00%
▷ Anonymous functions00.00%
Constants10
▷ Global constants770.00%
▷ Class constants330.00%
▷ Public constants3100.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
10 compressed PNG files occupy 1.17MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
include/lightbox/bootstrap/images/next.png1.32KB1.58KB0.00%
include/lightbox/ld-lightbox/images/next.png1.32KB1.58KB0.00%
our-theme/img/aneeq-premium.png165.42KB57.84KB▼ 65.04%
include/lightbox/bootstrap/images/close.png0.27KB0.29KB0.00%
include/lightbox/ld-lightbox/images/close.png0.27KB0.29KB0.00%