73% nic-image-gallery

Code Review | Nic Image Gallery

WordPress plugin Nic Image Gallery scored73%from 54 tests.

About plugin

  • Plugin page: nic-image-gallery
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.2-3.9.1
  • WordPress version: 6.3.1
  • First release: Jun 7, 2013
  • Latest release: Jun 20, 2014
  • Number of updates: 9
  • Update frequency: every 42.0 days
  • Top authors: jignesh_dekavadiya (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

20+ active /6,408 total downloads

Benchmarks

Plugin footprint 83% 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 gracefully, with no errors

Server metrics [RAM: ▼0.58MB] [CPU: ▼14.80ms] Passed 4 tests

Analyzing server-side resources used by Nic Image Gallery
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.56 ▲0.1040.06 ▼9.49
Dashboard /wp-admin3.41 ▲0.1060.63 ▲8.03
Posts /wp-admin/edit.php3.46 ▲0.1055.06 ▲1.47
Add New Post /wp-admin/post-new.php3.25 ▼2.6336.78 ▼58.79
Media Library /wp-admin/upload.php3.33 ▲0.1042.47 ▲7.60
Settings /wp-admin/edit.php?post_type=nic_image&page=nic_image_options3.3035.03
All Images /wp-admin/edit.php?post_type=nic_image3.3841.00
Add Image /wp-admin/post-new.php?post_type=nic_image3.1934.63

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

How much does this plugin use your filesystem and database?
The plugin installed successfully
Filesystem: 101 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
widget_theysaidso_widget
db_upgraded
widget_recent-comments
theysaidso_admin_options
can_compress_scripts

Browser metrics Passed 4 tests

This is an overview of browser requirements for Nic Image Gallery
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,945 ▲19913.87 ▼0.514.90 ▲2.9141.27 ▼3.21
Dashboard /wp-admin2,254 ▲695.37 ▼0.48113.76 ▼8.4889.57 ▲45.48
Posts /wp-admin/edit.php2,181 ▲922.35 ▲0.3746.69 ▲9.2559.43 ▲24.36
Add New Post /wp-admin/post-new.php1,727 ▲21322.65 ▲5.01587.67 ▼86.7727.17 ▼28.23
Media Library /wp-admin/upload.php1,472 ▲844.66 ▲0.4396.71 ▼10.7976.68 ▲32.19
Settings /wp-admin/edit.php?post_type=nic_image&page=nic_image_options9062.3030.7361.23
All Images /wp-admin/edit.php?post_type=nic_image1,1512.5237.5161.71
Add Image /wp-admin/post-new.php?post_type=nic_image2,3157.86189.15143.87

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • This plugin does not fully uninstall, leaving 6 options in the database
    • db_upgraded
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-comments
    • widget_recent-posts

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Almost there, just fix the following server-side errors
  • 5 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=nic_image
    • > Notice in wp-content/plugins/nic-image-gallery/nic-image-gallery.php+291
    Undefined index: ID
    • > GET request to /wp-admin/post-new.php?post_type=nic_image
    • > Notice in wp-content/plugins/nic-image-gallery/nic-image-gallery.php+287
    Undefined index: is_hover
    • > GET request to /wp-admin/post-new.php?post_type=nic_image
    • > Notice in wp-content/plugins/nic-image-gallery/nic-image-gallery.php+288
    Undefined index: image1
    • > GET request to /wp-admin/post-new.php?post_type=nic_image
    • > Notice in wp-content/plugins/nic-image-gallery/nic-image-gallery.php+289
    Undefined index: image2
    • > GET request to /wp-admin/post-new.php?post_type=nic_image
    • > Notice in wp-content/plugins/nic-image-gallery/nic-image-gallery.php+290
    Undefined index: image3
    • > GET request to /wp-admin/post-new.php?post_type=nic_image
    • > Notice in wp-content/plugins/nic-image-gallery/nic-image-gallery.php+291
    Undefined index: image4
    • > GET request to /wp-admin/post-new.php?post_type=nic_image
    • > Deprecated in wp-admin/includes/template.php+1443
    Non-static method iNIC_images::nic_imageboxes() should not be called statically

SRP 50% 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
The following issues need your attention
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/nic-image-gallery/nic-image-gallery.php:424

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
There are user-side issues you should fix
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=nic_image
    • > Console-api (warning) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,wp-polyfill-inert,regenerator-runtime,wp-polyfill,wp-hooks&ver=6.3.1 1:28609 "jQuery.Deferred exception: $(...).live is not a function" "TypeError: $(...).live is not a function\n at HTMLDocument.\u003Canonymous> (/wp-content/plugins/nic-image-gallery/js/get-images.js?ver=6.3.1:20:26)\n at e (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,wp-polyfill-inert,regenerator-runtime,wp-polyfill,wp-hooks&ver=6.3.1:2:26990)\n at t (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,wp-polyfill-inert,regenerator-runtime,wp-polyfill,wp-hooks&ver=6.3.1:2:27292)" undefined
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=nic_image
    • > Javascript (severe) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,wp-polyfill-inert,regenerator-runtime,wp-polyfill,wp-hooks&ver=6.3.1 1:28721 Uncaught TypeError: $(...).live is not a function

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
5 plugin tags: image rollover effect, image gallery plugin, indianic image slide show, indianic gallery, indianic easy image gallery with small group images

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

The primary PHP file in "Nic Image Gallery" version 1.0 is used by WordPress to initiate all plugin functionality
80 characters long description:
An easy image gallery with rollover effect and image slideshow with discription.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Good job! No executable or dangerous file extensions detected3,244 lines of code in 9 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript4101682,173
CSS46719724
PHP1929347

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.14
Average class complexity28.00
▷ Minimum class complexity28.00
▷ Maximum class complexity28.00
Average method complexity3.70
▷ Minimum method complexity1.00
▷ Maximum method complexity14.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods10
▷ Static methods00.00%
▷ Public methods10100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
86 PNG files occupy 0.16MB with 0.04MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/prev_red_off.png1.62KB1.43KB▼ 11.74%
images/nic_default.png17.83KB7.87KB▼ 55.89%
images/next_black_t.png1.67KB1.54KB▼ 7.91%
images/controls.png2.83KB1.28KB▼ 54.82%
images/close_blue.png1.60KB1.42KB▼ 10.93%