72% wp-responsive-gallery

Code Review | WP Responsive Gallery

WordPress plugin WP Responsive Gallery scored72%from 54 tests.

About plugin

  • Plugin page: wp-responsive-gal...
  • Plugin version: 4.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-4.2.2
  • WordPress version: 6.3.1
  • First release: Jul 10, 2015
  • Latest release: Jul 10, 2015
  • Number of updates: 3
  • Update frequency: every 284.7 days
  • Top authors: zafarullah212 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,503 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Install script ran successfully

Server metrics [RAM: ▲0.06MB] [CPU: ▼1.36ms] Passed 4 tests

Server-side resources used by WP Responsive Gallery
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.56 ▲0.0539.08 ▼4.42
Dashboard /wp-admin3.42 ▲0.0751.48 ▲2.98
Posts /wp-admin/edit.php3.53 ▲0.1458.25 ▲7.60
Add New Post /wp-admin/post-new.php6.00 ▲0.0794.00 ▼5.75
Media Library /wp-admin/upload.php3.32 ▲0.0538.49 ▲1.76
Add New /wp-admin/post-new.php?post_type=gallery3.3544.37
Pr-Gallery /wp-admin/edit.php?post_type=gallery3.3947.55

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

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 16 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
widget_recent-comments
widget_theysaidso_widget
theysaidso_admin_options
db_upgraded
widget_recent-posts

Browser metrics Passed 4 tests

An overview of browser requirements for WP Responsive Gallery
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,961 ▲20014.45 ▲0.101.79 ▼0.0740.90 ▼9.47
Dashboard /wp-admin2,361 ▲1876.25 ▲0.68118.45 ▲25.8542.31 ▲2.71
Posts /wp-admin/edit.php2,295 ▲1953.37 ▲1.3455.60 ▲19.4234.53 ▼0.30
Add New Post /wp-admin/post-new.php1,554 ▲2823.23 ▲0.20617.91 ▼37.4035.65 ▼29.32
Media Library /wp-admin/upload.php1,435 ▲354.11 ▼0.0682.78 ▼21.2042.34 ▼3.38
Add New /wp-admin/post-new.php?post_type=gallery1,6593.6065.4830.84
Pr-Gallery /wp-admin/edit.php?post_type=gallery1,2663.3744.1826.13

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

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Almost there, just fix the following server-side errors
    • > GET request to /wp-admin/post-new.php?post_type=gallery
    • > Warning in wp-content/plugins/wp-responsive-gallery/plugin.class.php+98
    Invalid argument supplied for foreach()

SRP 50% 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 fix the following
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp-responsive-gallery/plugin.class.php:9

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Please fix the following user-side errors
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=gallery
    • > Console-api (warning) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,moxiejs,plupload&ver=6.3.1 1:28609 "jQuery.Deferred exception: jQuery(...).live is not a function" "TypeError: jQuery(...).live is not a function\n at HTMLDocument.\u003Canonymous> (/wp-content/plugins/wp-responsive-gallery/admin/admin.js?ver=6.3.1:6:40)\n at e (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,moxiejs,plupload&ver=6.3.1:2:26990)\n at t (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,moxiejs,plupload&ver=6.3.1:2:27292)" undefined
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=gallery
    • > Javascript (severe) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,moxiejs,plupload&ver=6.3.1 1:28721 Uncaught TypeError: jQuery(...).live is not a function

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
Attributes that need to be fixed:
  • Tags: You are using too many tags: 16 tag instead of maximum 10
The official readme.txt is a good inspiration

wp-responsive-gallery/index.php 85% from 13 tests

"WP Responsive Gallery" version 4.0's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
It is important to fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("wp-responsive-gallery.php" instead of "index.php")
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6

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
Good job! No executable or dangerous file extensions detected1,531 lines of code in 11 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript5342945866
SVG100504
PHP24333147
CSS30314

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.17
Average class complexity6.00
▷ Minimum class complexity6.00
▷ Maximum class complexity6.00
Average method complexity1.56
▷ Minimum method complexity1.00
▷ Maximum method complexity3.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods9
▷ Static methods00.00%
▷ Public methods9100.00%
▷ Protected methods00.00%
▷ Private methods00.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
There were not PNG files found in your plugin