73% gallery-by-supsystic

Code Review | Photo Gallery by Supsystic

WordPress plugin Photo Gallery by Supsystic scored 73% from 54 tests.

About plugin

  • Plugin page: gallery-by-supsystic
  • Plugin version: 1.15.14
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: Jan 26, 2015
  • Latest release: Sep 29, 2023
  • Number of updates: 224
  • Update frequency: every 14.1 days
  • Top authors: supsystic.com (100%)

Code review

54 tests

User reviews

473 reviews

Install metrics

40,000+ active / 1,886,076 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.42MB] [CPU: ▲4.23ms] 75% from 4 tests

Analyzing server-side resources used by Photo Gallery by Supsystic
Please have a look at the following items
  • CPU: Try to keep total CPU usage under 500.00ms (currently 816.17ms on /wp-admin/admin.php?page=supsystic-gallery&module=overview)
PageMemory (MB)CPU Time (ms)
Home /3.86 ▲0.3997.29 ▲26.49
Dashboard /wp-admin3.78 ▲0.48102.60 ▼3.15
Posts /wp-admin/edit.php3.83 ▲0.48101.77 ▲4.69
Add New Post /wp-admin/post-new.php6.30 ▲0.42172.29 ▲14.38
Media Library /wp-admin/upload.php3.62 ▲0.3971.49 ▲0.98
Image Optimize /wp-admin/admin.php?page=supsystic-gallery&module=optimization2.3023.74
Settings /wp-admin/admin.php?page=supsystic-gallery&module=settings4.76132.38
Galleries /wp-admin/admin.php?page=supsystic-gallery&module=galleries6.48131.04
New gallery /wp-admin/admin.php?page=supsystic-gallery&module=galleries&action=showPresets4.4686.55
Photo Gallery by Supsystic /wp-admin/admin.php?page=supsystic-gallery4.3397.40
Overview /wp-admin/admin.php?page=supsystic-gallery&module=overview4.72816.17

Server storage [IO: ▲9.06MB] [DB: ▲0.01MB] Passed 3 tests

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 759 new files
Database: 15 new tables, 11 new options
New tables
wp_gg_galleries
wp_gg_settings_sets
wp_gg_folders
wp_gg_galleries_excluded
wp_gg_photos_settings
wp_gg_photos_pos
wp_gg_image_optimize
wp_gg_photos
wp_gg_tags
wp_gg_galleries_resources
...
New WordPress options
sgg_plug_welcome_show
can_compress_scripts
widget_recent-posts
db_upgraded
grid_gallery_last_version
widget_recent-comments
widget_theysaidso_widget
theysaidso_admin_options
sg_plugin_version
sg_welcome_page_was_showed
...

Browser metrics Passed 4 tests

This is an overview of browser requirements for Photo Gallery by Supsystic
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,035 ▲28914.93 ▲0.909.00 ▲5.5675.60 ▲2.02
Dashboard /wp-admin2,443 ▲2646.80 ▲1.94253.03 ▲66.9680.68 ▼8.03
Posts /wp-admin/edit.php2,325 ▲2363.53 ▲1.5299.69 ▼1.1966.12 ▼14.99
Add New Post /wp-admin/post-new.php1,410 ▲5117.74 ▲0.19923.57 ▼20.8258.81 ▼21.01
Media Library /wp-admin/upload.php1,488 ▲1004.41 ▲0.20183.72 ▼4.0687.68 ▼11.89
Image Optimize /wp-admin/admin.php?page=supsystic-gallery&module=optimization1,74112.43701.10156.95
Settings /wp-admin/admin.php?page=supsystic-gallery&module=settings1,6575.08192.33173.59
Galleries /wp-admin/admin.php?page=supsystic-gallery&module=galleries1,8725.85240.3493.35
New gallery /wp-admin/admin.php?page=supsystic-gallery&module=galleries&action=showPresets1,6295.41167.21260.45
Photo Gallery by Supsystic /wp-admin/admin.php?page=supsystic-gallery1,8695.89223.9897.83
Overview /wp-admin/admin.php?page=supsystic-gallery&module=overview3,02625.821,115.86122.05

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
It is recommended to fix the following
  • The plugin did not uninstall successfully, leaving 6 tables in the database
    • wp_gg_tags
    • wp_gg_galleries_resources
    • wp_gg_galleries
    • wp_gg_photos
    • wp_gg_settings_sets
    • wp_gg_attributes
  • This plugin does not fully uninstall, leaving 11 options in the database
    • sgg_plug_welcome_show
    • sg_welcome_page_was_showed
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-comments
    • db_upgraded
    • widget_recent-posts
    • can_compress_scripts
    • grid_gallery_last_version
    • widget_sggwidget
    • ...

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Almost there! Just fix the following items
  • 218× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Interface 'Twig_SupTwgSgg_LoaderInterface' not found in wp-content/plugins/gallery-by-supsystic/vendor/Twig/Loader/Filesystem.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'Twig_SupTwgSgg_Node_Expression' not found in wp-content/plugins/gallery-by-supsystic/vendor/Twig/Node/Expression/Conditional.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'RscSgg_Mvc_Module' not found in wp-content/plugins/gallery-by-supsystic/src/GridGallery/Developer/Module.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'Twig_SupTwgSgg_Node_Expression_Conditional' not found in wp-content/plugins/gallery-by-supsystic/vendor/Twig/Node/Expression/NullCoalesce.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'Twig_SupTwgSgg_Node_Include' not found in wp-content/plugins/gallery-by-supsystic/vendor/Twig/Node/Embed.php:17
    • > PHP Fatal error
      Uncaught Error: Interface 'Twig_SupTwgSgg_LoaderInterface' not found in wp-content/plugins/gallery-by-supsystic/vendor/Twig/Loader/Array.php:26
    • > PHP Fatal error
      Uncaught Error: Class 'Twig_SupTwgSgg_Node' not found in wp-content/plugins/gallery-by-supsystic/vendor/Twig/Node/Text.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'Twig_SupTwgSgg_TokenParser' not found in wp-content/plugins/gallery-by-supsystic/vendor/Twig/TokenParser/Import.php:21
    • > PHP Fatal error
      Uncaught Error: Class 'GridGallery_Core_BaseModel' not found in wp-content/plugins/gallery-by-supsystic/src/GridGallery/Galleries/Model/SocialSharing.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'GridGallery_Core_Module' not found in wp-content/plugins/gallery-by-supsystic/src/GridGallery/Galleries/Module.php:10

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

Optimizations

Plugin configuration 90% 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: Please take inspiration from this readme.txt

gallery-by-supsystic/index.php 85% from 13 tests

The main PHP script in "Photo Gallery by Supsystic" version 1.15.14 is automatically included on every request by WordPress
The following require your attention:
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("gallery-by-supsystic.php" instead of "index.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Success! There were no dangerous files found in this plugin87,719 lines of code in 556 files:
LanguageFilesBlank linesComment linesLines of code
PO File1912,0682,66326,414
PHP3365,41110,56024,577
JavaScript992,8002,09416,370
CSS431,48651312,554
Twig577922247,745
JSON10030
SVG10029

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.41
Average class complexity10.29
▷ Minimum class complexity1.00
▷ Maximum class complexity161.00
Average method complexity2.60
▷ Minimum method complexity1.00
▷ Maximum method complexity77.00
Code structure
Namespaces0
Interfaces34
Traits0
Classes295
▷ Abstract classes165.42%
▷ Concrete classes27994.58%
▷ Final classes10.36%
Methods2,013
▷ Static methods1095.41%
▷ Public methods1,74986.89%
▷ Protected methods2019.99%
▷ Private methods633.13%
Functions52
▷ Named functions52100.00%
▷ Anonymous functions00.00%
Constants81
▷ Global constants33.70%
▷ Class constants7896.30%
▷ Public constants78100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
104 PNG files occupy 1.08MB with 0.24MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
src/GridGallery/Galleries/assets/images/prettyPhoto/default/sprite.png6.53KB3.21KB▼ 50.87%
src/GridGallery/Galleries/assets/css/images/ui-icons_c98000_256x240.png4.44KB4.17KB▼ 6.02%
src/GridGallery/Galleries/assets/images/sort_both.png0.20KB0.29KB0.00%
src/GridGallery/Galleries/assets/images/prettyPhoto/dark_rounded/btnPrevious.png1.41KB1.19KB▼ 15.74%
app/assets/css/images/ui-icons_cccccc_256x240.png6.81KB4.17KB▼ 38.71%