99% hybrid-gallery

Code Review | Gallery: Hybrid - Advanced Visual Gallery

WordPress plugin Gallery: Hybrid - Advanced Visual Gallery scored 99% from 54 tests.

About plugin

  • Plugin page: hybrid-gallery
  • Plugin version: 1.4.0.2
  • PHP version: 7.4.16
  • WordPress compatibility: 4.5-4.7
  • WordPress version: 5.8.1
  • First release: Jan 24, 2017
  • Latest release: Apr 28, 2017
  • Number of updates: 55
  • Update frequency: every 1.7 days
  • Top authors: DIVENGINE (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

300+ active / 3,378 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
This plugin's installer ran successfully

Server metrics [RAM: ▲1.07MB] [CPU: ▼633.85ms] Passed 4 tests

An overview of server-side resources used by Gallery: Hybrid - Advanced Visual Gallery
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.85 ▲1.1348.50 ▲18.80
Dashboard /wp-admin4.17 ▲1.1266.73 ▲10.14
Posts /wp-admin/edit.php4.22 ▲1.1265.51 ▲11.64
Add New Post /wp-admin/post-new.php6.45 ▲1.01105.17 ▼2,563.75
Media Library /wp-admin/upload.php4.03 ▲1.0347.85 ▲6.58

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

Analyzing filesystem and database footprints of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 62 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

This is an overview of browser requirements for Gallery: Hybrid - Advanced Visual Gallery
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /4,081 ▲48518.50 ▲2.9121.17 ▲8.6639.05 ▼13.01
Dashboard /wp-admin3,254 ▲3248.32 ▲2.32185.81 ▲10.47148.89 ▲24.20
Posts /wp-admin/edit.php3,064 ▲3254.39 ▲1.6798.98 ▲15.64128.97 ▼10.90
Add New Post /wp-admin/post-new.php1,754 ▲13915.93 ▼5.34426.73 ▲105.53153.40 ▲41.40
Media Library /wp-admin/upload.php1,898 ▲914.99 ▼0.05144.69 ▼23.94148.85 ▲26.43

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
Uninstaller ran successfully

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
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
Looking good! No server-side errors or output on direct access of PHP files

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 88% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
Please fix the following attributes:
  • Plugin Name: Write the name of your plugin instead of "Plugin Name" on the first line ( === hybrid-gallery === )
  • Tags: There are too many tags (48 tag instead of maximum 10)
You can look at the official readme.txt

hybrid-gallery/index.php 92% from 13 tests

The main file in "Gallery: Hybrid - Advanced Visual Gallery" v. 1.4.0.2 serves as a complement to information provided in readme.txt and as the entry point to the plugin
You should first fix the following items:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("hybrid-gallery.php" instead of "index.php")

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Success! There were no dangerous files found in this plugin11,988 lines of code in 31 files:
LanguageFilesBlank linesComment linesLines of code
PHP121,0965537,334
SVG1002,671
PO File59522,0971,952
CSS851320
JavaScript5135211

PHP code 50% from 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
It is recommended to fix the following
  • Cyclomatic complexity of methods has to be reduced to less than 100 (currently 118)
Cyclomatic complexity
Average complexity per logical line of code0.39
Average class complexity57.22
▷ Minimum class complexity1.00
▷ Maximum class complexity204.00
Average method complexity11.54
▷ Minimum method complexity1.00
▷ Maximum method complexity118.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes9
▷ Abstract classes00.00%
▷ Concrete classes9100.00%
▷ Final classes00.00%
Methods48
▷ Static methods36.25%
▷ Public methods4797.92%
▷ Protected methods00.00%
▷ Private methods12.08%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
17 PNG files occupy 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/assets/img/layout.metro.png0.57KB0.21KB▼ 64.04%
engine/assets/img/colorbox/controls.png1.23KB1.28KB0.00%
libs/lightboxes/colorbox/images/controls.png1.23KB1.28KB0.00%
admin/assets/img/layout.justified.png0.60KB0.23KB▼ 61.17%
libs/lightboxes/colorbox/images/border.png0.07KB0.10KB0.00%