73% st-gallery-wp

Code Review | ST Gallery WP

WordPress plugin ST Gallery WP scored73%from 54 tests.

About plugin

  • Plugin page: st-gallery-wp
  • Plugin version: 1.0.8
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0.1-4.1
  • WordPress version: 6.3.1
  • First release: Oct 2, 2014
  • Latest release: Dec 2, 2015
  • Number of updates: 47
  • Update frequency: every 9.1 days
  • Top authors: beautifultemplates (100%)

Code review

54 tests

User reviews

6 reviews

Install metrics

100+ active /8,593 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.41MB] [CPU: ▼4.47ms] Passed 4 tests

A check of server-side resources used by ST Gallery WP
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.82 ▲0.3642.21 ▲1.34
Dashboard /wp-admin3.71 ▲0.4047.20 ▲0.54
Posts /wp-admin/edit.php3.81 ▲0.4559.45 ▲9.82
Add New Post /wp-admin/post-new.php6.41 ▲0.5277.71 ▼18.95
Media Library /wp-admin/upload.php3.66 ▲0.4335.28 ▼0.81
All Gallery /wp-admin/admin.php?page=st_gallery3.5531.38
Add New /wp-admin/admin.php?page=st_gallery&action=add3.6741.05

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 35 new files
Database: no new tables, 7 new options
New WordPress options
can_compress_scripts
widget_recent-posts
widget_recent-comments
widget_theysaidso_widget
widget_st_gallery_widget
theysaidso_admin_options
db_upgraded

Browser metrics Passed 4 tests

This is an overview of browser requirements for ST Gallery WP
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,946 ▲18913.86 ▼0.729.12 ▲6.9245.07 ▼0.92
Dashboard /wp-admin2,284 ▲965.56 ▲0.68118.91 ▲12.5138.01 ▼5.33
Posts /wp-admin/edit.php2,136 ▲472.34 ▲0.3141.08 ▲0.0133.37 ▼4.94
Add New Post /wp-admin/post-new.php1,582 ▲3723.40 ▲5.20660.58 ▲38.0537.41 ▼16.53
Media Library /wp-admin/upload.php1,471 ▲804.73 ▲0.4994.97 ▼8.1440.45 ▼4.89
All Gallery /wp-admin/admin.php?page=st_gallery1,0622.3134.3556.17
Add New /wp-admin/admin.php?page=st_gallery&action=add2,1243.6449.7234.94

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
It is recommended to fix the following
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-posts
    • widget_st_gallery_widget
    • theysaidso_admin_options
    • widget_recent-comments
    • db_upgraded

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Almost there, just fix the following server-side errors
    • > GET request to /wp-admin/admin.php?page=st_gallery
    • > Warning in wp-content/plugins/st-gallery-wp/st-gallery.php+282
    Invalid argument supplied for foreach()

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
The following issues need your attention
  • 3× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/st-gallery-wp/classes/st-widget.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/st-gallery-wp/classes/st-widget.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/st-gallery-wp/classes/st-widget.php:7

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Please fix the following browser errors
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=st_gallery&action=add
    • > Console-api (warning) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,wp-polyfill-inert,regenerator-runtime,wp-polyfill,wp-hooks&ver=6.3.1 1:28609 "jQuery.Deferred exception: $(...).live is not a function" "TypeError: $(...).live is not a function\n at HTMLDocument.\u003Canonymous> (/wp-content/plugins/st-gallery-wp/admin/js/script.js?ver=6.3.1:6:19)\n at e (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,wp-polyfill-inert,regenerator-runtime,wp-polyfill,wp-hooks&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,wp-polyfill-inert,regenerator-runtime,wp-polyfill,wp-hooks&ver=6.3.1:2:27292)" undefined
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=st_gallery&action=add
    • > Javascript (severe) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,wp-polyfill-inert,regenerator-runtime,wp-polyfill,wp-hooks&ver=6.3.1 1:28721 Uncaught TypeError: $(...).live is not a function

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
These attributes need your attention:
  • Tags: Please reduce the number of tags, currently 30 tag instead of maximum 10
You can take inspiration from this readme.txt

st-gallery-wp/st-gallery-wp.php Passed 13 tests

The principal PHP file in "ST Gallery WP" v. 1.0.8 is loaded by WordPress automatically on each request
68 characters long description:
Create gallery from your image post with Galleria library & Skitter.

Code Analysis Passed 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 plugin12,756 lines of code in 21 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript112,5911,5589,043
CSS5129431,915
PHP41391451,375
PO File1202216423

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.33
Average class complexity53.50
▷ Minimum class complexity8.00
▷ Maximum class complexity180.00
Average method complexity5.38
▷ Minimum method complexity1.00
▷ Maximum method complexity67.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods48
▷ Static methods00.00%
▷ Public methods4695.83%
▷ Protected methods12.08%
▷ Private methods12.08%
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

Using a strong compression for your PNG files is a great way to speed-up your plugin
8 PNG files occupy 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/sprite-default.png2.60KB1.33KB▼ 49.02%
admin/images/icon_gallery.png4.01KB1.33KB▼ 66.82%
images/sprite-square.png1.21KB0.66KB▼ 44.98%
themes/classic/classic-map.png3.94KB0.90KB▼ 77.27%
themes/v2/images/map.png4.08KB0.86KB▼ 79.04%