10% responsive-gallery-lightbox

Code Review | Responsive Gallery Lightbox

WordPress plugin Responsive Gallery Lightbox scored10%from 54 tests.

About plugin

  • Plugin page: responsive-galler...
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.0
  • WordPress version: 6.3.1
  • First release: Sep 18, 2014
  • Latest release: Nov 23, 2014
  • Number of updates: 8
  • Update frequency: every 8.3 days
  • Top authors: noor-e-alam (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /2,991 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
These installer errors require your attention
  • Install procedure had errors
    • > Deprecated in wp-content/plugins/responsive-gallery-lightbox/framework/includes/wpalchemy/MetaBox.php+61
    Methods with the same name as their class will not be constructors in a future version of PHP; WPAlchemy_MetaBox has a deprecated constructor

Server metrics [RAM: ▼1.38MB] [CPU: ▼54.57ms] Passed 4 tests

Server-side resources used by Responsive Gallery Lightbox
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /2.60 ▼0.8610.68 ▼33.61
Dashboard /wp-admin2.62 ▼0.6810.31 ▼44.85
Posts /wp-admin/edit.php2.63 ▼0.7310.32 ▼46.02
Add New Post /wp-admin/post-new.php2.62 ▼3.2612.00 ▼93.79
Media Library /wp-admin/upload.php2.62 ▼0.6010.47 ▼28.48
Gallery Category /wp-admin/edit-tags.php?taxonomy=rs_cat&post_type=rs-gallery2.639.45
Gallery Items /wp-admin/edit.php?post_type=rs-gallery2.6310.30
Add New /wp-admin/post-new.php?post_type=rs-gallery2.639.04

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

Analyzing filesystem and database footprints of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 208 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
widget_recent-comments
widget_recent-posts
widget_theysaidso_widget
can_compress_scripts
db_upgraded

Browser metrics Passed 4 tests

This is an overview of browser requirements for Responsive Gallery Lightbox
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,933 ▲14713.40 ▼1.278.17 ▲6.1537.02 ▼14.19
Dashboard /wp-admin2,228 ▲485.64 ▼0.0289.94 ▼1.7836.84 ▼3.60
Posts /wp-admin/edit.php2,133 ▲301.96 ▲0.0140.75 ▲0.3135.39 ▼3.45
Add New Post /wp-admin/post-new.php1,566 ▲4020.89 ▼2.39601.27 ▼49.7742.30 ▼15.03
Media Library /wp-admin/upload.php1,427 ▲244.18 ▲0.07102.92 ▼8.0143.42 ▼4.02
Gallery Category /wp-admin/edit-tags.php?taxonomy=rs_cat&post_type=rs-gallery1,3042.1226.9029.15
Gallery Items /wp-admin/edit.php?post_type=rs-gallery1,1141.9530.0331.22
Add New /wp-admin/post-new.php?post_type=rs-gallery2,3383.8478.23106.62

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
It is recommended to fix the following
  • This plugin did not uninstall without warnings or errors
    • > Deprecated in wp-content/plugins/responsive-gallery-lightbox/framework/includes/wpalchemy/MetaBox.php+61
    Methods with the same name as their class will not be constructors in a future version of PHP; WPAlchemy_MetaBox has a deprecated constructor
  • This plugin does not fully uninstall, leaving 6 options in the database
    • can_compress_scripts
    • widget_recent-comments
    • widget_recent-posts
    • widget_theysaidso_widget
    • db_upgraded
    • theysaidso_admin_options

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
These server-side errors were triggered
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=rs-gallery
    • > Deprecated in wp-content/plugins/responsive-gallery-lightbox/framework/includes/wpalchemy/MetaBox.php+61
    Methods with the same name as their class will not be constructors in a future version of PHP; WPAlchemy_MetaBox has a deprecated constructor
  • 5 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=rs-gallery
    • > Warning in wp-content/plugins/responsive-gallery-lightbox/framework/includes/wpalchemy/MetaBox.php+2657
    count(): Parameter must be an array or an object that implements Countable

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 items
  • 116× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'VP_Option_Control_Group' not found in wp-content/plugins/responsive-gallery-lightbox/framework/classes/option/control/group/menu.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'VP_View' not found in wp-content/plugins/responsive-gallery-lightbox/framework/views/control/slider.php:1
    • > PHP Warning
      Use of undefined constant VP_NAMESPACE - assumed 'VP_NAMESPACE' (this will throw an Error in a future version of PHP) in wp-content/plugins/responsive-gallery-lightbox/framework/autoload.php on line 13
    • > PHP Fatal error
      Uncaught Error: Class 'VP_Security' not found in wp-content/plugins/responsive-gallery-lightbox/framework/data/sources.php:97
    • > PHP Notice
      Undefined variable: is_compact in wp-content/plugins/responsive-gallery-lightbox/framework/views/control/textbox.php on line 1
    • > PHP Notice
      Undefined variable: type in wp-content/plugins/responsive-gallery-lightbox/framework/views/control/html.php on line 3
    • > PHP Fatal error
      Uncaught Error: Class 'VP_View' not found in wp-content/plugins/responsive-gallery-lightbox/framework/views/control/textarea.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/responsive-gallery-lightbox/framework/views/option/impexp.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'VP_Control_Field' not found in wp-content/plugins/responsive-gallery-lightbox/framework/classes/control/field/color.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'VP_Control_FieldMulti' not found in wp-content/plugins/responsive-gallery-lightbox/framework/classes/control/field/radiobutton.php:3

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Please fix the following browser errors
    • > GET request to /wp-admin/post-new.php?post_type=rs-gallery
    • > Javascript (severe) in unknown
    /wp-content/plugins/responsive-gallery-lightbox/framework/public/js/vendor/jquery.tipsy.js?ver=1.0.0a 179:24 Uncaught TypeError: this[binder] is not a function
    • > GET request to /wp-admin/post-new.php?post_type=rs-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: vp.init_ace_editor is not a function" "TypeError: vp.init_ace_editor is not a function\n at vp.init_controls (/wp-content/plugins/responsive-gallery-lightbox/framework/public/js/shared.min.js?ver=1.1:1:18433)\n at HTMLDivElement.\u003Canonymous> (/wp-content/plugins/responsive-gallery-lightbox/framework/public/js/metabox.min.js?ver=6.3.1:1:975)\n at Function.each (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,moxiejs,plupload&ver=6.3.1:2:3129)\n at e.\u003Ccomputed>.each (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,moxiejs,plupload&ver=6.3.1:2:1594)\n at e (/wp-content/plugins/responsive-gallery-lightbox/framework/public/js/metabox.min.js?ver=6.3.1:1:915)\n at HTMLDocument.\u003Canonymous> (/wp-content/plugins/responsive-gallery-lightbox/framework/public/js/metabox.min.js?ver=6.3.1:1:2532)\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
    • > GET request to /wp-admin/post-new.php?post_type=rs-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: vp.init_ace_editor is not a function

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
Attributes that need to be fixed: You can take inspiration from this readme.txt

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

The main PHP file in "Responsive Gallery Lightbox" ver. 1.0 adds more information about the plugin and also serves as the entry point for this plugin
It is important to fix the following:
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 192 characters long)

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Success! There were no dangerous files found in this plugin16,564 lines of code in 162 files:
LanguageFilesBlank linesComment linesLines of code
PHP912,0932,3088,827
CSS151811953,828
JavaScript494472983,240
SVG300480
PO File1404799
Markdown231089
JSON1001

PHP code 50% from 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
Please tend to the following items
  • Cyclomatic complexity of methods should be reduced to less than 100 (currently 102)
Cyclomatic complexity
Average complexity per logical line of code0.43
Average class complexity21.38
▷ Minimum class complexity1.00
▷ Maximum class complexity271.00
Average method complexity3.36
▷ Minimum method complexity1.00
▷ Maximum method complexity102.00
Code structure
Namespaces0
Interfaces2
Traits0
Classes56
▷ Abstract classes47.14%
▷ Concrete classes5292.86%
▷ Final classes00.00%
Methods505
▷ Static methods8917.62%
▷ Public methods47293.47%
▷ Protected methods193.76%
▷ Private methods142.77%
Functions33
▷ Named functions33100.00%
▷ Anonymous functions00.00%
Constants40
▷ Global constants3792.50%
▷ Class constants37.50%
▷ Public constants3100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
23 PNG files occupy 0.06MB with 0.02MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
framework/public/css/vendor/jqueryui/themes/smoothness/images/ui-bg_glass_95_fef1ec_1x400.png0.12KB0.14KB0.00%
framework/public/img/bootstrap-colorpicker/alpha.png3.19KB1.68KB▼ 47.45%
framework/public/img/bootstrap-colorpicker/hue.png2.90KB0.50KB▼ 82.71%
framework/public/css/vendor/jqueryui/themes/smoothness/images/ui-bg_highlight-soft_75_cccccc_1x100.png0.10KB0.17KB0.00%
framework/public/css/vendor/jqueryui/themes/smoothness/images/ui-bg_glass_75_e6e6e6_1x400.png0.11KB0.14KB0.00%