90% sm-gallery

Code Review | SM Gallery

WordPress plugin SM Gallery scored 90% from 54 tests.

About plugin

  • Plugin page: sm-gallery
  • Plugin version: 1.1.8
  • PHP version: 7.4.16
  • WordPress compatibility: 3.7-4.2
  • WordPress version: 6.3.1
  • First release: Aug 27, 2011
  • Latest release: Jul 27, 2015
  • Number of updates: 42
  • Update frequency: every 34.1 days
  • Top authors: bigj9901 (54.76%)sethmatics (42.86%)sethcarstens (7.14%)

Code review

54 tests

User reviews

4 reviews

Install metrics

30+ active / 20,526 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
This plugin's installer ran successfully

Server metrics [RAM: ▼0.68MB] [CPU: ▼17.90ms] Passed 4 tests

An overview of server-side resources used by SM Gallery
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.45 ▼0.0235.57 ▼8.02
Dashboard /wp-admin3.32 ▲0.0244.20 ▼7.80
Posts /wp-admin/edit.php3.37 ▲0.0147.90 ▲0.68
Add New Post /wp-admin/post-new.php3.15 ▼2.7436.33 ▼56.47
Media Library /wp-admin/upload.php3.24 ▲0.0134.11 ▲0.68

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

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

Browser metrics Passed 4 tests

Checking browser requirements for SM Gallery
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,948 ▲17713.94 ▼0.3311.97 ▲9.7744.76 ▲0.94
Dashboard /wp-admin2,203 ▲295.79 ▼0.07100.29 ▼13.1638.48 ▼14.35
Posts /wp-admin/edit.php2,086 ▼02.03 ▲0.0638.26 ▲0.9431.74 ▼1.55
Add New Post /wp-admin/post-new.php6,618 ▲5,09823.56 ▲0.39895.03 ▲226.2855.13 ▼7.59
Media Library /wp-admin/upload.php1,388 ▼04.23 ▲0.0395.46 ▼10.0240.15 ▼5.48

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
These items require your attention
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_theysaidso_widget
    • widget_recent-posts
    • widget_recent-comments
    • db_upgraded
    • theysaidso_admin_options
    • can_compress_scripts

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
The smoke test was a success, however most plugin functionality was not tested

SRP Passed 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
Congratulations! This plugin passed the SRP test

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser errors were detected

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
Attributes that require attention:
  • Screenshots: Please add images for these screenshots: #1 (Sample of the gallery, which looks similar inline to what you see in this popup modal box.), #2 (Sample of the "featured image gallery" options which links your featured image to a gallery popup.)
The official readme.txt is a good inspiration

sm-gallery/sm-gallery.php Passed 13 tests

This is the main PHP file of "SM Gallery" version 1.1.8, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
119 characters long description:
Gallery plugin thats simple because it leans on existing WordPress gallery features provided by http://sethmatics.com/.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Good job! No executable or dangerous file extensions detected1,731 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript11346794
CSS23354537
PHP36970400

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.34
Average class complexity15.50
▷ Minimum class complexity6.00
▷ Maximum class complexity25.00
Average method complexity3.07
▷ Minimum method complexity1.00
▷ Maximum method complexity15.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods14
▷ Static methods321.43%
▷ Public methods14100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions4
▷ Named functions4100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
21 PNG files occupy 0.42MB with 0.17MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
css/smoothness/images/overlayBg.png0.43KB0.22KB▼ 49.43%
css/smoothness/images/ui-bg_glass_65_ffffff_1x400.png0.10KB0.10KB▼ 5.71%
media/ad_prev.png1.15KB0.26KB▼ 77.55%
screenshot-1.png327.31KB98.69KB▼ 69.85%
css/smoothness/images/ui-icons_cd0a0a_256x240.png4.27KB4.11KB▼ 3.78%