68% advanced-galleria

Code Review | Advanced Galleria

WordPress plugin Advanced Galleria scored 68% 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: 5.9.2
  • 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,088 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▼2.41MB] [CPU: ▼345.69ms] Passed 4 tests

This is a short check of server-side resources used by Advanced Galleria
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /1.95 ▼1.564.69 ▼54.90
Dashboard /wp-admin1.97 ▼1.434.77 ▼29.50
Posts /wp-admin/edit.php1.97 ▼1.674.83 ▼32.35
Add New Post /wp-admin/post-new.php1.97 ▼5.006.22 ▼1,265.99
Media Library /wp-admin/upload.php1.97 ▼1.326.53 ▼21.74
Galleria /wp-admin/options-general.php?page=galleria1.974.67

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

Input-output and database impact of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 38 new files
Database: no new tables, 3 new options
New WordPress options
advanced_galleria_large
advanced_galleria_thumb
advanced_galleria_theme

Browser metrics Passed 4 tests

This is an overview of browser requirements for Advanced Galleria
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,925 ▲17116.37 ▲0.8413.03 ▲6.212.62 ▼0.35
Dashboard /wp-admin2,907 ▲496.13 ▼0.03120.88 ▼23.66162.63 ▼27.04
Posts /wp-admin/edit.php2,685 ▲283.26 ▲0.0166.25 ▼4.29143.68 ▼2.26
Add New Post /wp-admin/post-new.php1,720 ▲5921.21 ▲5.82561.82 ▲86.14182.75 ▲22.41
Media Library /wp-admin/upload.php1,713 ▲155.58 ▲0.05160.66 ▲7.99218.39 ▲26.21
Galleria /wp-admin/options-general.php?page=galleria1,1042.7055.53132.36

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
The following items require your attention
  • Uninstall procedure had uncaught errors
    • > User notice in wp-includes/functions.php+5768
    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.)
  • This plugin did not uninstall successfully, leaving 3 options in the database
    • advanced_galleria_large
    • advanced_galleria_thumb
    • advanced_galleria_theme

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
These errors were triggered by the plugin
    • > GET request to /wp-admin/options-general.php?page=galleria
    • > User notice in wp-includes/functions.php+5768
    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+5768
    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+5768
    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+5768
    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 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please take a closer look at the following
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > 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 | This is a smoke test targeting browser errors/issues
There were no browser issues found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Attributes that require attention:
  • Plugin Name: You should set 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

The primary PHP file in "Advanced Galleria" version 2.0.0.a.1... is used by WordPress to initiate all plugin functionality
You should first fix the following items:
  • Description: The description should be shorter than 140 characters (currently 150 characters long)
  • Version: The version number should be digits and periods (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 considered dangerous and should not be included with any WordPress plugin
Everything looks great! No dangerous files found in this plugin6,397 lines of code in 25 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript141,8711,1975,101
CSS61954789
HTML45415272
PHP14571235

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
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

Often times overlooked, PNG files can occupy unnecessary space in your plugin
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/map.png1.80KB0.67KB▼ 62.77%
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%