56% winsome-gallery

Code Review | Winsome Gallery

WordPress plugin Winsome Gallery scored56%from 54 tests.

About plugin

  • Plugin page: winsome-gallery
  • Plugin version: 1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-4.1
  • WordPress version: 6.3.1
  • First release: Jun 1, 2015
  • Latest release: Jun 1, 2015
  • Number of updates: 2
  • Update frequency: every 12.0 days
  • Top authors: masumabdullah (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /579 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Installer ran successfully

Server metrics [RAM: ▼1.02MB] [CPU: ▼43.56ms] Passed 4 tests

Server-side resources used by Winsome Gallery
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /2.94 ▼0.529.25 ▼33.43
Dashboard /wp-admin3.00 ▼0.3112.79 ▼33.55
Posts /wp-admin/edit.php3.00 ▼0.3618.49 ▼31.54
Add New Post /wp-admin/post-new.php3.00 ▼2.8914.71 ▼75.71
Media Library /wp-admin/upload.php3.00 ▼0.2315.40 ▼18.40
Youtube video /wp-admin/edit.php?post_type=utube-gallery3.0012.12
Add New /wp-admin/post-new.php?post_type=image-gallery3.0015.71
youtube category /wp-admin/edit-tags.php?taxonomy=utube-category&post_type=utube-gallery3.0012.68
Images /wp-admin/edit.php?post_type=image-gallery3.0014.23
Image category /wp-admin/edit-tags.php?taxonomy=image-category&post_type=image-gallery3.0014.29
Add New /wp-admin/post-new.php?post_type=utube-gallery3.0015.49

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

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

Browser metrics Passed 4 tests

Checking browser requirements for Winsome Gallery
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,012 ▲27713.87 ▼0.456.11 ▲4.3940.77 ▼4.99
Dashboard /wp-admin2,293 ▲1084.92 ▼0.87120.34 ▲21.7844.23 ▲0.50
Posts /wp-admin/edit.php2,176 ▲842.13 ▲0.0937.49 ▼5.5429.64 ▼5.69
Add New Post /wp-admin/post-new.php6,358 ▲4,84419.03 ▲1.501,042.87 ▲354.0847.05 ▼8.14
Media Library /wp-admin/upload.php1,475 ▲874.27 ▲0.06112.37 ▲1.3647.33 ▲1.03
Youtube video /wp-admin/edit.php?post_type=utube-gallery1,1602.0837.4330.51
Add New /wp-admin/post-new.php?post_type=image-gallery2,3417.89176.2265.58
youtube category /wp-admin/edit-tags.php?taxonomy=utube-category&post_type=utube-gallery1,3461.9730.1926.77
Images /wp-admin/edit.php?post_type=image-gallery1,1542.0834.3128.07
Image category /wp-admin/edit-tags.php?taxonomy=image-category&post_type=image-gallery1,3461.8429.8228.87
Add New /wp-admin/post-new.php?post_type=utube-gallery1,8963.9168.78112.95

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
  • Uninstall procedure validation failed for this plugin
    • > Deprecated in wp-content/plugins/winsome-gallery/vafpress/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 did not uninstall successfully, leaving 7 options in the database
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-comments
    • can_compress_scripts
    • db_upgraded
    • widget_recent-posts
    • gallery_option

Smoke tests 0% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
These errors were triggered by the plugin
  • 8 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=utube-gallery
    • > Deprecated in wp-content/plugins/winsome-gallery/vafpress/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

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
  • 1× PHP files output text when accessed directly:
    • > /wp-content/plugins/winsome-gallery/css/lightGallery.php
  • 116× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/winsome-gallery/admin/option/option.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function untrailingslashit() in wp-content/plugins/winsome-gallery/vafpress/constant.php:11
    • > PHP Notice
      Undefined variable: is_compact in wp-content/plugins/winsome-gallery/vafpress/views/control/checkimage.php on line 1
    • > PHP Fatal error
      Uncaught Error: Class 'VP_Control_FieldMulti' not found in wp-content/plugins/winsome-gallery/vafpress/classes/control/field/multiselect.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/winsome-gallery/vafpress/views/option/restore.php:4
    • > PHP Notice
      Undefined variable: is_compact in wp-content/plugins/winsome-gallery/vafpress/views/control/slider.php on line 1
    • > PHP Fatal error
      Uncaught Error: Class 'VP_Control_Field' not found in wp-content/plugins/winsome-gallery/vafpress/classes/control/fieldmulti.php:6
    • > PHP Notice
      Undefined variable: is_compact in wp-content/plugins/winsome-gallery/vafpress/views/control/wpeditor.php on line 1
    • > PHP Fatal error
      Uncaught Error: Class 'VP_Control_Field' not found in wp-content/plugins/winsome-gallery/vafpress/classes/control/field/slider.php:3
    • > PHP Warning
      Use of undefined constant VP_PUBLIC_URL - assumed 'VP_PUBLIC_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/winsome-gallery/vafpress/config/dependencies.php on line 124

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
These are user-side errors you should fix
    • > GET request to /wp-admin/post-new.php?post_type=utube-gallery
    • > Javascript (severe) in unknown
    /wp-content/plugins/winsome-gallery/vafpress/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=utube-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/winsome-gallery/vafpress/public/js/shared.min.js?ver=1.1:1:18433)\n at HTMLDivElement.\u003Canonymous> (/wp-content/plugins/winsome-gallery/vafpress/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/winsome-gallery/vafpress/public/js/metabox.min.js?ver=6.3.1:1:915)\n at HTMLDocument.\u003Canonymous> (/wp-content/plugins/winsome-gallery/vafpress/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=utube-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

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
These attributes need to be fixed:
  • Contributors: Plugin contributors not specified
The official readme.txt is a good inspiration

winsome-gallery/plugin-main.php 92% from 13 tests

The main file in "Winsome Gallery" v. 1.1 serves as a complement to information provided in readme.txt and as the entry point to the plugin
Please take the time to fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("winsome-gallery.php" instead of "plugin-main.php")

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Everything looks great! No dangerous files found in this plugin17,326 lines of code in 163 files:
LanguageFilesBlank linesComment linesLines of code
PHP922,1642,3959,351
CSS161821983,925
JavaScript484472992,960
SVG4001,000
Markdown231089
JSON1001

PHP code 50% from 2 tests

Analyzing cyclomatic complexity and code structure
It is recommended to fix the following
  • Method cyclomatic complexity 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%
Functions34
▷ Named functions34100.00%
▷ Anonymous functions00.00%
Constants36
▷ Global constants3391.67%
▷ Class constants38.33%
▷ 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
22 PNG files occupy 0.05MB with 0.02MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
vafpress/public/css/vendor/jqueryui/themes/smoothness/images/ui-bg_glass_65_ffffff_1x400.png0.10KB0.10KB▼ 5.71%
vafpress/public/img/vp_shortcode_icon_sprite.png1.55KB0.42KB▼ 73.10%
vafpress/public/css/vendor/jqueryui/themes/smoothness/images/ui-icons_888888_256x240.png4.27KB4.11KB▼ 3.78%
vafpress/public/img/bootstrap-colorpicker/hue.png2.90KB0.50KB▼ 82.71%
vafpress/public/css/vendor/jqueryui/themes/smoothness/images/ui-bg_glass_75_e6e6e6_1x400.png0.11KB0.14KB0.00%