62% nr-image-gallery

Code Review | NR Image Gallery

WordPress plugin NR Image Gallery scored 62% from 54 tests.

About plugin

  • Plugin page: nr-image-gallery
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.9-4.1
  • WordPress version: 5.8.1
  • First release: Feb 16, 2015
  • Latest release: Feb 17, 2015
  • Number of updates: 2
  • Update frequency: every 0.5 days
  • Top authors: nazmur.r (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 1,584 total downloads

Benchmarks

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

Analyzing server-side resources used by NR Image Gallery
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /2.79 ▼0.0425.35 ▼5.87
Dashboard /wp-admin3.11 ▲0.0546.40 ▲1.39
Posts /wp-admin/edit.php3.16 ▲0.0444.71 ▼12.42
Add New Post /wp-admin/post-new.php5.46 ▲0.0394.04 ▼572.11
Media Library /wp-admin/upload.php3.05 ▲0.0536.16 ▲4.67
Edit Gallery /wp-admin/admin.php?page=edit-gallery3.0731.89
Add Images /wp-admin/admin.php?page=add-images3.0730.93
Add Gallery /wp-admin/admin.php?page=add-gallery3.0429.65
NR Image Gallery /wp-admin/admin.php?page=nri-admin3.0328.45
Custom CSS /wp-admin/admin.php?page=custom-css3.0228.45

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

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 18 new files
Database: 2 new tables, 2 new options
New tables
wp_nr_image_gallery
wp_nr_image_gallery_images
New WordPress options
wp_nr_image_gallery_defaults
nr_image_gallery_db_version

Browser metrics Passed 4 tests

NR Image Gallery: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,868 ▲23116.66 ▲1.3815.72 ▲1.6446.66 ▲0.93
Dashboard /wp-admin3,021 ▲845.88 ▼0.05150.90 ▲0.82119.89 ▲12.53
Posts /wp-admin/edit.php2,790 ▲512.84 ▲0.1268.73 ▲3.4591.78 ▲4.93
Add New Post /wp-admin/post-new.php1,905 ▲22219.23 ▲0.79401.50 ▼9.45103.94 ▼2.95
Media Library /wp-admin/upload.php1,858 ▲485.04 ▲0.01153.05 ▲3.01119.55 ▲7.64
Edit Gallery /wp-admin/admin.php?page=edit-gallery1,0902.5867.0571.90
Add Images /wp-admin/admin.php?page=add-images1,1092.6065.6971.21
Add Gallery /wp-admin/admin.php?page=add-gallery1,4002.6159.6871.64
NR Image Gallery /wp-admin/admin.php?page=nri-admin1,1292.0956.6463.61
Custom CSS /wp-admin/admin.php?page=custom-css1,0752.0854.6365.50

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The following items require your attention
  • This plugin does not fully uninstall, leaving 2 tables in the database
    • wp_nr_image_gallery
    • wp_nr_image_gallery_images
  • This plugin does not fully uninstall, leaving 2 options in the database
    • wp_nr_image_gallery_defaults
    • nr_image_gallery_db_version

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
These server-side errors were triggered
    • > GET request to /wp-admin/admin.php?page=add-images
    • > Warning in wp-content/plugins/nr-image-gallery/admin/add-images.php+144
    count(): Parameter must be an array or an object that implements Countable

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
  • 5× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/nr-image-gallery/admin/add-gallery.php
    • > /wp-content/plugins/nr-image-gallery/admin/overview.php
    • > /wp-content/plugins/nr-image-gallery/admin/custom-css.php
    • > /wp-content/plugins/nr-image-gallery/admin/edit-gallery.php
    • > /wp-content/plugins/nr-image-gallery/admin/add-images.php
  • 4× PHP files trigger server errors when accessed directly:
    • > PHP Notice
      Trying to get property 'prefix' of non-object in wp-content/plugins/nr-image-gallery/nr-image-gallery.php on line 20
    • > PHP Notice
      Trying to get property 'prefix' of non-object in wp-content/plugins/nr-image-gallery/nr-image-gallery.php on line 21
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/nr-image-gallery/includes/mr-image-resize.php:23
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_activation_hook() in wp-content/plugins/nr-image-gallery/nr-image-gallery.php:24

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
These attributes need to be fixed:
  • Screenshots: These screenshots do not have images: #1 (NR Image Gallery add gallery page), #2 (NR Image Gallery add image page)
The official readme.txt might help

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

The main file in "NR Image Gallery" v. 1.0 serves as a complement to information provided in readme.txt and as the entry point to the plugin
31 characters long description:
Simple responsive image gallery

Code Analysis Passed 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 detected1,067 lines of code in 14 files:
LanguageFilesBlank linesComment linesLines of code
PHP7172122934
JavaScript4224376
CSS37157

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.38
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions18
▷ Named functions18100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants3100.00%
▷ Class constants00.00%
▷ Public constants00.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
2 PNG files occupy 0.06MB with 0.04MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png24.57KB8.29KB▼ 66.25%
screenshot-2.png35.23KB11.98KB▼ 65.99%