68% advanced-galleria

Code Review | Advanced Galleria

WordPress plugin Advanced Galleria scored68%from 54 tests.

About plugin

  • Plugin page: advanced-galleria
  • Plugin version: 2.0.0.a.1...
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-3.7.1
  • WordPress version: 6.3.1
  • First release: Nov 4, 2013
  • Latest release: Nov 4, 2013
  • Number of updates: 3
  • Update frequency: every 0.3 days
  • Top authors: Lucanos (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,264 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▼1.86MB] [CPU: ▼58.75ms] Passed 4 tests

A check of server-side resources used by Advanced Galleria
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /2.14 ▼1.325.03 ▼37.65
Dashboard /wp-admin2.16 ▼1.186.63 ▼58.87
Posts /wp-admin/edit.php2.16 ▼1.197.72 ▼42.53
Add New Post /wp-admin/post-new.php2.16 ▼3.726.00 ▼95.95
Media Library /wp-admin/upload.php2.16 ▼1.076.53 ▼31.49
Galleria /wp-admin/options-general.php?page=galleria2.166.72

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

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 38 new files
Database: no new tables, 9 new options
New WordPress options
widget_theysaidso_widget
widget_recent-comments
theysaidso_admin_options
can_compress_scripts
advanced_galleria_large
advanced_galleria_thumb
advanced_galleria_theme
db_upgraded
widget_recent-posts

Browser metrics Passed 4 tests

An overview of browser requirements for Advanced Galleria
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,931 ▲14513.73 ▼0.456.39 ▲4.3441.39 ▲0.32
Dashboard /wp-admin2,224 ▲215.90 ▲1.02100.52 ▼1.8239.93 ▼5.70
Posts /wp-admin/edit.php2,115 ▲152.11 ▲0.1234.19 ▼2.8333.88 ▼2.19
Add New Post /wp-admin/post-new.php1,535 ▼223.17 ▼0.05663.93 ▲16.9953.60 ▲1.88
Media Library /wp-admin/upload.php1,415 ▲214.33 ▼0.08101.49 ▲1.7043.42 ▼0.88
Galleria /wp-admin/options-general.php?page=galleria8851.7626.0926.10

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
These items require your attention
  • Uninstall procedure validation failed for this plugin
    • > User notice in wp-includes/functions.php+5905
    Function wp_enqueue_script was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the jquery handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
  • The uninstall procedure has failed, leaving 9 options in the database
    • widget_recent-comments
    • can_compress_scripts
    • widget_recent-posts
    • theysaidso_admin_options
    • advanced_galleria_theme
    • advanced_galleria_large
    • advanced_galleria_thumb
    • widget_theysaidso_widget
    • db_upgraded

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Smoke test failed, please fix the following
    • > GET request to /wp-admin/options-general.php?page=galleria
    • > User notice in wp-includes/functions.php+5905
    Function wp_enqueue_script was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the jquery handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
    • > GET request to /wp-admin/options-general.php?page=galleria
    • > User notice in wp-includes/functions.php+5905
    Function wp_enqueue_script was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the advanced-galleria handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
    • > GET request to /wp-admin/options-general.php?page=galleria
    • > User notice in wp-includes/functions.php+5905
    Function wp_enqueue_script was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the advanced-galleria-theme handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
    • > GET request to /wp-admin/options-general.php?page=galleria
    • > User notice in wp-includes/functions.php+5905
    Function wp_enqueue_style was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the advanced-galleria-style handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)

SRP 50% 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
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/advanced-galleria/advanced-galleria.php:351

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
These attributes need your attention:
  • Plugin Name: Please replace "Plugin Name" with the name of your plugin on the first line ( === advanced-galleria === )
The official readme.txt is a good inspiration

advanced-galleria/advanced-galleria.php 85% from 13 tests

This is the main PHP file of "Advanced Galleria" version 2.0.0.a.1..., providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
It is important to fix the following:
  • Description: Please keep the plugin description shorter than 140 characters (currently 150 characters long)
  • Version: Use only periods and digits for the version number (ex. "1.0.3" instead of "2.0.0.a.1...")

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
Good job! No executable or dangerous file extensions detected6,397 lines of code in 25 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript141,8711,1975,101
CSS61954789
HTML45415272
PHP14571235

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.34
Average class complexity33.00
▷ Minimum class complexity33.00
▷ Maximum class complexity33.00
Average method complexity7.40
▷ Minimum method complexity1.00
▷ Maximum method complexity27.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods5
▷ Static methods00.00%
▷ Public methods5100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
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

PNG files should be compressed to save space and minimize bandwidth usage
5 PNG files occupy 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
galleria/themes/advanced-classic-light/fullscreen.png0.25KB0.14KB▼ 41.67%
galleria/themes/classic/classic-map.png1.80KB0.67KB▼ 62.77%
galleria/themes/advanced-classic/fullscreen.png0.26KB0.14KB▼ 44.94%
galleria/themes/advanced-classic-light/map.png3.58KB1.25KB▼ 65.05%
galleria/themes/advanced-classic/map.png1.80KB0.67KB▼ 62.77%