62% hb-audio-gallery

Code Review | HB AUDIO GALLERY

WordPress plugin HB AUDIO GALLERY scored62%from 54 tests.

About plugin

  • Plugin page: hb-audio-gallery
  • Plugin version: 3.0
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-5.8.1
  • WordPress version: 6.3.1
  • First release: Apr 20, 2021
  • Latest release: Nov 18, 2021
  • Number of updates: 5
  • Update frequency: every 42.6 days
  • Top authors: hbwebsol (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /574 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
Install script ran successfully

Server metrics [RAM: ▲0.51MB] [CPU: ▼2.20ms] Passed 4 tests

This is a short check of server-side resources used by HB AUDIO GALLERY
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /4.12 ▲0.6640.52 ▲4.28
Dashboard /wp-admin3.86 ▲0.5151.25 ▼10.26
Posts /wp-admin/edit.php3.90 ▲0.5550.98 ▲0.58
Add New Post /wp-admin/post-new.php6.35 ▲0.4797.43 ▼3.40
Media Library /wp-admin/upload.php3.72 ▲0.4943.97 ▲9.50
Add New /wp-admin/post-new.php?post_type=hbag_audio_gallery3.8759.69
Categories /wp-admin/edit-tags.php?taxonomy=hb_ag_category&post_type=hbag_audio_gallery3.7142.29
HB Audio Gallery /wp-admin/options-general.php?page=hb-ag-setting3.6837.85
HB Audio Gallery /wp-admin/edit.php?post_type=hbag_audio_gallery3.7741.62

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

Filesystem and database footprint
This plugin installed successfully
Filesystem: 196 new files
Database: 3 new tables, 8 new options
New tables
wp_hbag_audios
wp_hbag_audio_favourites
wp_hbag_audio_track_record
New WordPress options
can_compress_scripts
theysaidso_admin_options
db_upgraded
widget_recent-comments
widget_recent-posts
hb_ag_options
widget_theysaidso_widget
count

Browser metrics Passed 4 tests

A check of browser resources used by HB AUDIO GALLERY
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,390 ▲65517.32 ▲2.947.16 ▲5.4738.27 ▼6.79
Dashboard /wp-admin2,588 ▲4007.42 ▲1.57192.49 ▲63.72115.64 ▲57.97
Posts /wp-admin/edit.php2,232 ▲1434.36 ▲2.3749.41 ▲10.5263.06 ▲26.25
Add New Post /wp-admin/post-new.php1,637 ▲12324.86 ▲7.26614.91 ▼15.44120.11 ▲68.63
Media Library /wp-admin/upload.php1,521 ▲1335.92 ▲1.7192.82 ▼10.7280.29 ▲31.86
Add New /wp-admin/post-new.php?post_type=hbag_audio_gallery2,0315.4080.82115.00
Categories /wp-admin/edit-tags.php?taxonomy=hb_ag_category&post_type=hbag_audio_gallery1,3874.1740.1167.69
HB Audio Gallery /wp-admin/options-general.php?page=hb-ag-setting1,2984.8056.4456.13
HB Audio Gallery /wp-admin/edit.php?post_type=hbag_audio_gallery1,2204.3340.6461.30

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • This plugin cannot be uninstalled
    • > Deprecated in wp-includes/class-wp-hook.php+310
    Non-static method hbag_wp_Loader::hbag_plugin_uninstall() should not be called statically
  • The uninstall procedure has failed, leaving 7 options in the database
    • can_compress_scripts
    • widget_recent-posts
    • widget_theysaidso_widget
    • widget_recent-comments
    • db_upgraded
    • theysaidso_admin_options
    • count

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Please fix the following server-side errors
    • > GET request to /wp-admin/edit.php?post_type=hbag_audio_gallery
    • > Notice in wp-content/plugins/hb-audio-gallery/gallery/gallery.php+162
    Undefined variable: colums
    • > GET request to /wp-admin/edit.php?post_type=hbag_audio_gallery
    • > Warning in wp-content/plugins/hb-audio-gallery/gallery/gallery.php+162
    count(): Parameter must be an array or an object that implements Countable

SRP 0% 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 fix the following items
  • 1× PHP files output text when accessed directly:
    • > /wp-content/plugins/hb-audio-gallery/templates/single_audio.php
  • 63× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/hb-audio-gallery/templates/single_audio.php on line 13
    • > PHP Notice
      Undefined variable: args in wp-content/plugins/hb-audio-gallery/templates/single_audio.php on line 13
    • > PHP Notice
      Trying to get property 'prefix' of non-object in wp-content/plugins/hb-audio-gallery/lib/audioDB.php on line 7
    • > PHP Fatal error
      Uncaught Error: Class 'GeoIp2\\Exception\\GeoIp2Exception' not found in wp-content/plugins/hb-audio-gallery/vendor/geoip2/geoip2/src/Exception/OutOfQueriesException.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'GeoIp2\\Record\\Country' not found in wp-content/plugins/hb-audio-gallery/vendor/geoip2/geoip2/src/Record/RepresentedCountry.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'GeoIp2\\Exception\\GeoIp2Exception' not found in wp-content/plugins/hb-audio-gallery/vendor/geoip2/geoip2/src/Exception/AddressNotFoundException.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'GeoIp2\\Record\\AbstractRecord' not found in wp-content/plugins/hb-audio-gallery/vendor/geoip2/geoip2/src/Record/MaxMind.php:15
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/class-wp-list-table.php' (include_path='.:/usr/share/php') in wp-content/plugins/hb-audio-gallery/gallery/gallery-function.php on line 900
    • > PHP Fatal error
      Uncaught Error: Class 'GeoIp2\\Model\\AbstractModel' not found in wp-content/plugins/hb-audio-gallery/vendor/geoip2/geoip2/src/Model/Domain.php:21
    • > PHP Fatal error
      Uncaught Error: Class 'MaxMind\\Exception\\InvalidRequestException' not found in wp-content/plugins/hb-audio-gallery/vendor/maxmind/web-service-common/src/Exception/IpAddressNotFoundException.php:7

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% 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 to be fixed:
  • Screenshots: These screenshots have no corresponding images in /assets: #1 (Demo Page.), #2 (Settings page.), #3 (Main page.), #4 (Editing Page.)
You can take inspiration from this readme.txt

hb-audio-gallery/hb-audio-gallery.php 92% from 13 tests

"HB AUDIO GALLERY" version 3.0's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
Please take the time to fix the following:
  • Description: Please keep the plugin description shorter than 140 characters (currently 169 characters long)

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
No dangerous file extensions were detected71,951 lines of code in 157 files:
LanguageFilesBlank linesComment linesLines of code
PHP7641,27027,69444,381
JavaScript316,3867,96922,703
CSS111,5023362,450
Markdown73900932
C111724665
JSON500426
SVG2200255
XML14059
Bourne Shell120040
m418032
C/C++ Header14128

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.32
Average class complexity8.36
▷ Minimum class complexity1.00
▷ Maximum class complexity57.00
Average method complexity2.97
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces14
Interfaces2
Traits0
Classes54
▷ Abstract classes35.56%
▷ Concrete classes5194.44%
▷ Final classes00.00%
Methods204
▷ Static methods2813.73%
▷ Public methods15575.98%
▷ Protected methods10.49%
▷ Private methods4823.53%
Functions48
▷ Named functions4491.67%
▷ Anonymous functions48.33%
Constants36
▷ Global constants1850.00%
▷ Class constants1850.00%
▷ Public constants211.11%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
14 compressed PNG files occupy 0.10MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/default.png2.04KB2.17KB0.00%
lib/leaflet/js/images/marker-icon-2x.png2.41KB2.52KB0.00%
images/not-favourite_16.png0.67KB0.81KB0.00%
gallery/images/music_icon.png8.87KB4.66KB▼ 47.46%
lib/leaflet/js/images/layers.png0.68KB1.05KB0.00%