78% random-image-gallery-with-pretty-photo-zoom

Code Review | Random image gallery with pretty photo zoom

WordPress plugin Random image gallery with pretty photo zoom scored78%from 54 tests.

About plugin

  • Plugin page: random-image-gall...
  • Plugin version: 9.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-6.4
  • WordPress version: 6.3.1
  • First release: Dec 13, 2011
  • Latest release: Oct 29, 2023
  • Number of updates: 46
  • Update frequency: every 94.3 days
  • Top authors: gopi_plus (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

400+ active /32,473 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
This plugin's installer ran successfully

Server metrics [RAM: ▲0.00MB] [CPU: ▼5.79ms] Passed 4 tests

Server-side resources used by Random image gallery with pretty photo zoom
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0139.02 ▼0.47
Dashboard /wp-admin3.32 ▼0.0345.09 ▼15.82
Posts /wp-admin/edit.php3.37 ▲0.0146.26 ▼3.25
Add New Post /wp-admin/post-new.php5.90 ▲0.0191.49 ▼1.29
Media Library /wp-admin/upload.php3.24 ▲0.0134.68 ▼2.78
R I G W PP Z /wp-admin/options-general.php?page=random-image-gallery-with-pretty-photo-zoom3.2131.49

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

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 52 new files
Database: no new tables, 12 new options
New WordPress options
widget_recent-comments
widget_theysaidso_widget
rigwppz_dir2
widget_recent-posts
rigwppz_dir
theysaidso_admin_options
db_upgraded
rigwppz_dir3
rigwppz_dir4
rigwppz_dir5
...

Browser metrics Passed 4 tests

This is an overview of browser requirements for Random image gallery with pretty photo zoom
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,901 ▲14413.42 ▼0.958.46 ▲5.9341.65 ▼18.59
Dashboard /wp-admin2,199 ▲195.62 ▲0.0291.10 ▼9.4041.05 ▼0.54
Posts /wp-admin/edit.php2,104 ▲71.99 ▼0.0538.87 ▼0.0936.15 ▼5.40
Add New Post /wp-admin/post-new.php1,529 ▲123.11 ▲0.11631.34 ▼61.7953.16 ▼4.45
Media Library /wp-admin/upload.php1,401 ▲14.25 ▲0.0296.41 ▼15.6042.05 ▼9.91
R I G W PP Z /wp-admin/options-general.php?page=random-image-gallery-with-pretty-photo-zoom8821.9922.5629.70

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
Please fix the following items
  • The uninstall procedure has failed, leaving 6 options in the database
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-comments

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP 0% 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
  • 1× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/random-image-gallery-with-pretty-photo-zoom/random-image-gallery-with-pretty-photo-zoom.php
  • 11× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Notice
      Undefined index: MAXWIDTH in wp-content/plugins/random-image-gallery-with-pretty-photo-zoom/crop-random-image.php on line 11
    • > PHP Warning
      Division by zero in wp-content/plugins/random-image-gallery-with-pretty-photo-zoom/crop-random-image.php on line 28
    • > PHP Fatal error
      Uncaught Error: Call to undefined function notfound() in wp-content/plugins/random-image-gallery-with-pretty-photo-zoom/crop-random-image.php:83
    • > PHP Notice
      getimagesize(): Read error! in wp-content/plugins/random-image-gallery-with-pretty-photo-zoom/crop-random-image.php on line 23
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/random-image-gallery-with-pretty-photo-zoom/select-random-image.php:3
    • > PHP Notice
      Undefined index: DIR in wp-content/plugins/random-image-gallery-with-pretty-photo-zoom/crop-random-image.php on line 7
    • > PHP Warning
      Division by zero in wp-content/plugins/random-image-gallery-with-pretty-photo-zoom/crop-random-image.php on line 29
    • > PHP Notice
      getimagesize(): read of 8192 bytes failed with errno=21 Is a directory in wp-content/plugins/random-image-gallery-with-pretty-photo-zoom/crop-random-image.php on line 23
    • > PHP Notice
      Trying to access array offset on value of type bool in wp-content/plugins/random-image-gallery-with-pretty-photo-zoom/crop-random-image.php on line 25
    • > PHP Notice
      Undefined index: IMGNAME in wp-content/plugins/random-image-gallery-with-pretty-photo-zoom/crop-random-image.php on line 10

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
There were no browser issues found

Optimizations

Plugin configuration 93% from 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
3 plugin tags: random image, pretty photo, gallery

random-image-gallery-with-pretty-photo-zoom/random-image-gallery-with-pretty-photo-zoom.php 85% from 13 tests

The primary PHP file in "Random image gallery with pretty photo zoom" version 9.2 is used by WordPress to initiate all plugin functionality
The following require your attention:
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 155 characters long)
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
No dangerous file extensions were detected1,297 lines of code in 8 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript118395633
PHP47445352
CSS100170
PO File25276142

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.25
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%
Functions7
▷ Named functions7100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.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
27 PNG files occupy 0.04MB with 0.02MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/prettyPhoto/default/sprite_y.png1.13KB0.13KB▼ 88.81%
images/prettyPhoto/light_rounded/btnNext.png1.38KB1.14KB▼ 17.29%
images/prettyPhoto/facebook/contentPatternTop.png0.14KB0.11KB▼ 21.13%
images/prettyPhoto/facebook/btnPrevious.png0.81KB0.58KB▼ 27.90%
images/prettyPhoto/dark_rounded/btnNext.png1.38KB1.14KB▼ 17.29%