84% random-image-gallery-with-fancy-zoom

Code Review | Random image gallery with fancy zoom

WordPress plugin Random image gallery with fancy zoom scored84%from 54 tests.

About plugin

  • Plugin page: random-image-gall...
  • Plugin version: 11.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.4-6.1
  • WordPress version: 6.3.1
  • First release: Sep 5, 2009
  • Latest release: Dec 1, 2022
  • Number of updates: 108
  • Update frequency: every 44.8 days
  • Top authors: gopiplus (100%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active /34,498 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.05MB] [CPU: ▼2.71ms] Passed 4 tests

Server-side resources used by Random image gallery with fancy zoom
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0542.12 ▼3.68
Dashboard /wp-admin3.36 ▲0.0549.01 ▲1.85
Posts /wp-admin/edit.php3.41 ▲0.0554.74 ▲6.94
Add New Post /wp-admin/post-new.php5.94 ▲0.0588.21 ▼2.47
Media Library /wp-admin/upload.php3.28 ▲0.0534.41 ▼6.55
FancyZoom images /wp-admin/options-general.php?page=random-image-gallery-with-fancy-zoom3.2433.74

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

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 31 new files
Database: no new tables, 10 new options
New WordPress options
rigwfz_title
rigwfz_dir
can_compress_scripts
rigwfz_title_yes
widget_recent-posts
rigwfz_width
widget_recent-comments
theysaidso_admin_options
widget_theysaidso_widget
db_upgraded

Browser metrics Passed 4 tests

Checking browser requirements for Random image gallery with fancy zoom
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,925 ▲16413.74 ▼0.645.78 ▲3.7344.13 ▼3.85
Dashboard /wp-admin2,228 ▲224.87 ▲0.01105.34 ▲2.0540.60 ▼8.55
Posts /wp-admin/edit.php2,104 ▲12.01 ▼0.0241.29 ▲2.5337.70 ▼1.81
Add New Post /wp-admin/post-new.php1,548 ▼023.00 ▼0.14690.58 ▲1.6664.12 ▲6.12
Media Library /wp-admin/upload.php1,401 ▲44.21 ▼0.05101.60 ▼15.1944.98 ▼4.08
FancyZoom images /wp-admin/options-general.php?page=random-image-gallery-with-fancy-zoom8962.0224.3226.14

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
It is recommended to fix the following
  • Zombie WordPress options detected upon uninstall: 6 options
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_recent-posts
    • widget_theysaidso_widget
    • can_compress_scripts
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Good news, no errors were detected

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please fix the following
  • 12× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/random-image-gallery-with-fancy-zoom/select-random-image.php:22
    • > PHP Warning
      Division by zero in wp-content/plugins/random-image-gallery-with-fancy-zoom/crop-random-image.php on line 46
    • > PHP Notice
      getimagesize(): Read error! in wp-content/plugins/random-image-gallery-with-fancy-zoom/crop-random-image.php on line 41
    • > PHP Notice
      Trying to access array offset on value of type bool in wp-content/plugins/random-image-gallery-with-fancy-zoom/crop-random-image.php on line 42
    • > PHP Warning
      Division by zero in wp-content/plugins/random-image-gallery-with-fancy-zoom/crop-random-image.php on line 47
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/random-image-gallery-with-fancy-zoom/random-image-gallery-with-fancy-zoom.php:44
    • > PHP Notice
      getimagesize(): read of 8192 bytes failed with errno=21 Is a directory in wp-content/plugins/random-image-gallery-with-fancy-zoom/crop-random-image.php on line 41
    • > PHP Notice
      Undefined index: IMGNAME in wp-content/plugins/random-image-gallery-with-fancy-zoom/crop-random-image.php on line 28
    • > PHP Notice
      Undefined index: DIR in wp-content/plugins/random-image-gallery-with-fancy-zoom/crop-random-image.php on line 25
    • > PHP Notice
      Undefined index: MAXWIDTH in wp-content/plugins/random-image-gallery-with-fancy-zoom/crop-random-image.php on line 29

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration 96% 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
5 plugin tags: gallery, random, zoom, image, fancy

random-image-gallery-with-fancy-zoom/random-image-gallery-with-fancy-zoom.php 92% from 13 tests

The primary PHP file in "Random image gallery with fancy zoom" version 11.1 is used by WordPress to initiate all plugin functionality
Please take the time to fix the following:
  • Description: Please keep the plugin description shorter than 140 characters (currently 156 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Everything looks great! No dangerous files found in this plugin817 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code
PHP46781358
JavaScript103338
PO File24360121

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
No complexity issues detected
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%
Functions11
▷ Named functions11100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
17 PNG files occupy 0.03MB with 0.01MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
ressources/zoom-spin-6.png1.88KB1.39KB▼ 26.36%
ressources/zoom.png1.11KB1.17KB0.00%
ressources/zoom-spin-12.png1.86KB1.42KB▼ 23.71%
ressources/zoom-spin-7.png1.85KB1.37KB▼ 25.97%
ressources/zoom-spin-4.png1.85KB1.37KB▼ 25.56%