78% responsive-image-gallery

Code Review | Responsive Image Gallery

WordPress plugin Responsive Image Gallery scored 78% from 54 tests.

About plugin

  • Plugin page: responsive-image-...
  • Plugin version: 4.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-5.4.2
  • WordPress version: 6.3.1
  • First release: Oct 7, 2013
  • Latest release: Jul 29, 2020
  • Number of updates: 40
  • Update frequency: every 62.2 days
  • Top authors: Sajesh Bahing (100%)

Code review

54 tests

User reviews

14 reviews

Install metrics

100+ active / 17,066 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Install script ran successfully

Server metrics [RAM: ▲0.04MB] [CPU: ▲1.90ms] Passed 4 tests

Server-side resources used by Responsive Image Gallery
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0441.15 ▲4.07
Dashboard /wp-admin3.34 ▲0.0446.72 ▲4.26
Posts /wp-admin/edit.php3.39 ▲0.0347.19 ▼2.71
Add New Post /wp-admin/post-new.php5.93 ▲0.0593.03 ▲4.12
Media Library /wp-admin/upload.php3.26 ▲0.0333.77 ▲2.10
Responsive Image Galleries /wp-admin/edit.php?post_type=responsive_gallery3.3133.48
Add New /wp-admin/post-new.php?post_type=responsive_gallery3.3240.56

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

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

Browser metrics Passed 4 tests

A check of browser resources used by Responsive Image Gallery
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,830 ▲9513.68 ▼0.704.44 ▲2.7039.17 ▼3.37
Dashboard /wp-admin2,233 ▲484.82 ▼0.24107.78 ▼8.5042.10 ▼2.13
Posts /wp-admin/edit.php2,116 ▲272.02 ▲0.0140.65 ▲1.5935.93 ▼0.34
Add New Post /wp-admin/post-new.php1,557 ▲2423.11 ▼0.01641.86 ▲21.5550.20 ▲7.45
Media Library /wp-admin/upload.php1,415 ▲274.16 ▼0.1693.33 ▼4.5341.77 ▼1.93
Responsive Image Galleries /wp-admin/edit.php?post_type=responsive_gallery1,0861.9333.7330.24
Add New /wp-admin/post-new.php?post_type=responsive_gallery2,2294.47103.0842.48

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
These items require your attention
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-posts
    • theysaidso_admin_options
    • can_compress_scripts
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-comments

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though everything seems fine, this is not an exhaustive test

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 take a closer look at the following
  • 1× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/responsive-image-gallery/index.php
  • 2× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/responsive-image-gallery/ResponsiveImageGalleryAdmin.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Utility' not found in wp-content/plugins/responsive-image-gallery/ResponsiveImageGalleryAdmin.php:2

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser errors were detected

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
Please fix the following attributes:
  • Tags: Please reduce the number of tags, currently 27 tag instead of maximum 10
You can look at the official readme.txt

responsive-image-gallery/image-gallery.php 92% from 13 tests

The main PHP script in "Responsive Image Gallery" version 4.0 is automatically included on every request by WordPress
You should first fix the following items:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("responsive-image-gallery.php" instead of "image-gallery.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Success! There were no dangerous files found in this plugin1,899 lines of code in 16 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript6216159944
PHP410932494
CSS47534416
JSON10037
Markdown1908

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.40
Average class complexity23.00
▷ Minimum class complexity4.00
▷ Maximum class complexity48.00
Average method complexity3.64
▷ Minimum method complexity1.00
▷ Maximum method complexity19.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods25
▷ Static methods00.00%
▷ Public methods2496.00%
▷ Protected methods00.00%
▷ Private methods14.00%
Functions0
▷ Named functions00.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
3 compressed PNG files occupy 0.00MB
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admins/writing.png0.83KB0.85KB0.00%
admins/remove.png1.39KB1.28KB▼ 7.74%
tinymce/icon.png0.11KB0.10KB▼ 2.73%