78% gallerya

Code Review | Gallerya

WordPress plugin Gallerya scored78%from 54 tests.

About plugin

  • Plugin page: gallerya
  • Plugin version: 3.2.2
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.2
  • WordPress version: 6.3.1
  • First release: Oct 10, 2018
  • Latest release: Nov 6, 2023
  • Number of updates: 124
  • Update frequency: every 15.0 days
  • Top authors: netzstrategen (94.35%)geisthanen (6.45%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /3,182 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
This plugin's installer ran successfully

Server metrics [RAM: ▲0.01MB] [CPU: ▼4.39ms] Passed 4 tests

An overview of server-side resources used by Gallerya
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0237.23 ▼4.93
Dashboard /wp-admin3.31 ▲0.0151.57 ▲1.99
Posts /wp-admin/edit.php3.36 ▲0.0149.46 ▼8.65
Add New Post /wp-admin/post-new.php5.90 ▲0.0194.05 ▼2.70
Media Library /wp-admin/upload.php3.24 ▲0.0132.32 ▼1.27

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

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

Browser metrics Passed 4 tests

This is an overview of browser requirements for Gallerya
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,886 ▲12413.97 ▼0.3214.39 ▲12.7236.66 ▼10.16
Dashboard /wp-admin2,198 ▲185.60 ▼0.0694.28 ▼5.1442.35 ▼1.55
Posts /wp-admin/edit.php2,100 ▼01.95 ▼0.0438.65 ▲3.0235.21 ▼2.66
Add New Post /wp-admin/post-new.php1,541 ▲1125.03 ▲1.83601.02 ▼79.7473.35 ▲17.94
Media Library /wp-admin/upload.php1,406 ▲34.30 ▲0.07101.31 ▲3.6543.88 ▼1.24

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
These items require your attention
  • Zombie WordPress options detected upon uninstall: 6 options
    • can_compress_scripts
    • db_upgraded
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_recent-posts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 0% 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
Almost there! Just fix the following items
  • 1× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/gallerya/templates/layout-grid.php
  • 7× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function Netzstrategen\\Gallerya\\has_image_size() in wp-content/plugins/gallerya/templates/layout-product-variation-slider.php:6
    • > PHP Parse error
      syntax error, unexpected '->' (T_OBJECT_OPERATOR) in wp-content/plugins/gallerya/src/GraphQL.php on line 58
    • > PHP Fatal error
      Uncaught Error: Call to undefined function Netzstrategen\\Gallerya\\apply_filters() in wp-content/plugins/gallerya/templates/layout-slider.php:4
    • > PHP Warning
      Invalid argument supplied for foreach() in wp-content/plugins/gallerya/templates/layout-grid.php on line 7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function Netzstrategen\\Gallerya\\has_image_size() in wp-content/plugins/gallerya/templates/layout-grid-slider.php:5
    • > PHP Notice
      Undefined variable: images in wp-content/plugins/gallerya/templates/layout-grid.php on line 7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function Netzstrategen\\Gallerya\\apply_filters() in wp-content/plugins/gallerya/templates/settings.php:4

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 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
10 plugin tags: responsive gallery, image slider, image gallery, lightbox, gallery...

gallerya/plugin.php 92% from 13 tests

The primary PHP file in "Gallerya" version 3.2.2 is used by WordPress to initiate all plugin functionality
The following require your attention:
  • Main file name: The principal plugin file should be the same as the plugin slug ("gallerya.php" instead of "plugin.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Success! There were no dangerous files found in this plugin18,357 lines of code in 33 files:
LanguageFilesBlank linesComment linesLines of code
JSON30015,695
PHP12153408842
JavaScript964159733
Sass2977523
CSS61113488
PO File1313176

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.40
Average class complexity15.00
▷ Minimum class complexity1.00
▷ Maximum class complexity30.00
Average method complexity2.81
▷ Minimum method complexity1.00
▷ Maximum method complexity11.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes6
▷ Abstract classes00.00%
▷ Concrete classes6100.00%
▷ Final classes00.00%
Methods44
▷ Static methods44100.00%
▷ Public methods44100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions2
▷ Named functions150.00%
▷ Anonymous functions150.00%
Constants5
▷ Global constants00.00%
▷ Class constants5100.00%
▷ Public constants5100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
No PNG images were found in this plugin