72% wp-responsive-media-gallery

Code Review | WP Responsive Media Gallery

WordPress plugin WP Responsive Media Gallery scored 72% from 54 tests.

About plugin

  • Plugin page: wp-responsive-med...
  • Plugin version: 1.1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-5.8.2
  • WordPress version: 6.3.1
  • First release: Jun 23, 2017
  • Latest release: Dec 7, 2021
  • Number of updates: 20
  • Update frequency: every 81.4 days
  • Top authors: vsourz1td (100%)

Code review

54 tests

User reviews

1 review

Install metrics

40+ active / 1,424 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
This plugin's installer ran successfully

Server metrics [RAM: ▲0.20MB] [CPU: ▲2.84ms] Passed 4 tests

An overview of server-side resources used by WP Responsive Media Gallery
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.65 ▲0.1846.04 ▼0.26
Dashboard /wp-admin3.56 ▲0.2554.75 ▲2.32
Posts /wp-admin/edit.php3.62 ▲0.2655.27 ▲7.48
Add New Post /wp-admin/post-new.php6.08 ▲0.19102.10 ▲12.52
Media Library /wp-admin/upload.php3.40 ▲0.1738.47 ▲1.82
Gallery Category /wp-admin/edit-tags.php?taxonomy=vsz_cat&post_type=vsz_gallery3.4342.48
Gallery /wp-admin/edit.php?post_type=vsz_gallery3.4746.09
Add New /wp-admin/post-new.php?post_type=vsz_gallery3.6758.63

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

Filesystem and database footprint
The plugin installed successfully
Filesystem: 153 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
db_upgraded
can_compress_scripts
widget_theysaidso_widget
widget_recent-comments
theysaidso_admin_options

Browser metrics Passed 4 tests

This is an overview of browser requirements for WP Responsive Media Gallery
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,107 ▲30715.37 ▲2.177.58 ▲2.6542.86 ▼1.17
Dashboard /wp-admin2,394 ▲1916.53 ▲1.71146.52 ▲34.0043.58 ▼2.74
Posts /wp-admin/edit.php2,305 ▲2193.53 ▲1.5159.18 ▲24.3336.41 ▼0.62
Add New Post /wp-admin/post-new.php1,551 ▲1623.61 ▲0.56721.05 ▲43.3142.45 ▼34.32
Media Library /wp-admin/upload.php1,447 ▲594.31 ▼0.0984.09 ▼22.3044.25 ▼3.84
Gallery Category /wp-admin/edit-tags.php?taxonomy=vsz_cat&post_type=vsz_gallery1,6523.3842.4628.27
Gallery /wp-admin/edit.php?post_type=vsz_gallery1,3583.5144.3128.11
Add New /wp-admin/post-new.php?post_type=vsz_gallery2,7083.9569.8198.04

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
You still need to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-comments
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-posts
    • theysaidso_admin_options
    • db_upgraded

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
Please fix the following server-side errors
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/edit-tags.php?taxonomy=vsz_cat&post_type=vsz_gallery
    • > Notice in wp-content/plugins/wp-responsive-media-gallery/admin/partials/vszgallery_category_field.php+105
    Trying to get property 'slug' of non-object

SRP 0% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please fix the following items
  • 4× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/wp-responsive-media-gallery/admin/partials/responsive-media-gallery-admin-display.php
    • > /wp-content/plugins/wp-responsive-media-gallery/public/partials/vsz_gallery_display_front.php
    • > /wp-content/plugins/wp-responsive-media-gallery/public/partials/vsz_gallery_display_front-mesonary.php
    • > /wp-content/plugins/wp-responsive-media-gallery/public/partials/responsive-media-gallery-public-display.php
  • 19× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Notice
      Undefined index: postId in wp-content/plugins/wp-responsive-media-gallery/public/partials/load_more_masonry.php on line 10
    • > PHP Notice
      Undefined index: load_more in wp-content/plugins/wp-responsive-media-gallery/public/partials/load_more_masonry.php on line 6
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Query' not found in wp-content/plugins/wp-responsive-media-gallery/public/partials/load_more_mosaic.php:46
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_enqueue_style() in wp-content/plugins/wp-responsive-media-gallery/public/partials/vsz_gallery_display_front-unitegallery.php:2
    • > PHP Notice
      Undefined index: loadmoreitem in wp-content/plugins/wp-responsive-media-gallery/public/partials/load_more_mosaic.php on line 12
    • > PHP Notice
      Undefined index: galleryCategoryName in wp-content/plugins/wp-responsive-media-gallery/public/partials/load_more_mosaic.php on line 13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_die() in wp-content/plugins/wp-responsive-media-gallery/admin/partials/checkVideoExists.php:14
    • > PHP Notice
      Undefined index: loadmoreitem in wp-content/plugins/wp-responsive-media-gallery/public/partials/load_more.php on line 7
    • > PHP Notice
      Undefined index: postId in wp-content/plugins/wp-responsive-media-gallery/public/partials/load_more_mosaic.php on line 10
    • > PHP Notice
      Undefined index: postId in wp-content/plugins/wp-responsive-media-gallery/public/partials/load_more.php on line 11

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine on the user side

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
10 plugin tags: media-gallery, photo-gallery, gallery, gallery-plugin, image-video-gallery...

wp-responsive-media-gallery/wp-responsive-media-gallery.php 92% from 13 tests

The primary PHP file in "WP Responsive Media Gallery" version 1.1.1 is used by WordPress to initiate all plugin functionality
It is important to fix the following:
  • Description: Please don't use more than 140 characters for the plugin description (currently 165 characters long)

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
There were no executable files found in this plugin17,714 lines of code in 62 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript182,4491,4356,940
PHP307561,5495,131
CSS133581054,988
SVG100655

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.48
Average class complexity16.42
▷ Minimum class complexity1.00
▷ Maximum class complexity60.00
Average method complexity3.57
▷ Minimum method complexity1.00
▷ Maximum method complexity53.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes12
▷ Abstract classes00.00%
▷ Concrete classes12100.00%
▷ Final classes00.00%
Methods72
▷ Static methods79.72%
▷ Public methods6590.28%
▷ Protected methods22.78%
▷ Private methods56.94%
Functions11
▷ Named functions11100.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants4100.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
62 PNG files occupy 0.06MB with 0.02MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
public/skins/default/arrow_grid_up.png0.36KB0.24KB▼ 33.33%
public/skins/default/slider_arrow_left.png0.46KB0.18KB▼ 60.21%
public/skins/default/arrows_strip_left.png0.19KB0.12KB▼ 35.90%
public/themes/default/images/arrow_down_up.png0.23KB0.14KB▼ 38.24%
public/skins/alexis/images/grid_handle_left.png0.75KB0.79KB0.00%