67% h-gallery

Code Review | H Gallery

WordPress plugin H Gallery scored67%from 54 tests.

About plugin

  • Plugin page: h-gallery
  • Plugin version: 0.6.8.3
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-4.7.3
  • WordPress version: 6.3.1
  • First release: Jun 13, 2012
  • Latest release: Mar 9, 2017
  • Number of updates: 69
  • Update frequency: every 25.1 days
  • Top authors: 01241.com (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

20+ active /4,346 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
This plugin's installer ran successfully

Server metrics [RAM: ▼0.91MB] [CPU: ▼34.69ms] Passed 4 tests

Server-side resources used by H Gallery
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0437.73 ▼3.55
Dashboard /wp-admin3.03 ▼0.2725.79 ▼23.15
Posts /wp-admin/edit.php3.03 ▼0.3222.78 ▼25.40
Add New Post /wp-admin/post-new.php3.03 ▼2.8527.87 ▼76.20
Media Library /wp-admin/upload.php3.03 ▼0.2021.56 ▼14.02
H Gallery /wp-admin/options-general.php?page=H-Gallery_Settings3.0324.07

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 20 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
db_upgraded
widget_recent-posts
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-comments

Browser metrics Passed 4 tests

A check of browser resources used by H Gallery
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,928 ▲18214.02 ▼0.3312.34 ▲10.6844.03 ▲1.33
Dashboard /wp-admin2,201 ▲135.03 ▼0.0699.15 ▼8.5638.54 ▼3.57
Posts /wp-admin/edit.php2,090 ▲12.11 ▲0.1239.33 ▲2.5534.44 ▲1.42
Add New Post /wp-admin/post-new.php1,536 ▲323.27 ▼0.06639.30 ▼52.1155.72 ▼0.25
Media Library /wp-admin/upload.php1,383 ▲14.19 ▼0.0798.86 ▲0.0941.26 ▼4.34
H Gallery /wp-admin/options-general.php?page=H-Gallery_Settings8112.0222.9727.05

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
It is recommended to fix the following
  • Uninstall procedure had uncaught errors
    • > Warning in wp-content/plugins/h-gallery/h-gallery.php+266
    Use of undefined constant manage_options - assumed 'manage_options' (this will throw an Error in a future version of PHP)
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • db_upgraded
    • can_compress_scripts
    • widget_recent-posts

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
These server-side errors were triggered
    • > GET request to /wp-admin/options-general.php?page=H-Gallery_Settings
    • > Warning in wp-content/plugins/h-gallery/h-gallery.php+266
    Use of undefined constant manage_options - assumed 'manage_options' (this will throw an Error in a future version of PHP)

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please fix the following items
  • 2× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_nonce_field() in wp-content/plugins/h-gallery/admin/h-gallery-admin.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/h-gallery/h-gallery.php:235

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 83% from 29 tests

readme.txt 75% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
Attributes that require attention:
  • Contributors: The plugin contributors field is missing
  • Plugin Name: Write the name of your plugin instead of "Plugin Name" on the first line ( === h-gallery === )
  • Screenshots: Add an image for screenshot #1 (Plugin overview)
  • Tags: Please delete some tags, you are using 13 tag instead of maximum 10
You can take inspiration from this readme.txt

h-gallery/h-gallery.php 92% from 13 tests

The entry point to "H Gallery" version 0.6.8.3 is a PHP file that has certain tags in its header comment area
Please make the necessary changes and fix the following:
  • Description: The description should be shorter than 140 characters (currently 163 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
No dangerous file extensions were detected527 lines of code in 8 files:
LanguageFilesBlank linesComment linesLines of code
CSS2536241
PHP26519220
JavaScript47966

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.06
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions5
▷ Named functions5100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
8 PNG files occupy 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
css/images/arrows_02.png1.20KB0.53KB▼ 55.76%
css/images/fullscreen_icon_01.png0.61KB0.31KB▼ 48.64%
css/images/arrows_04.png2.56KB1.90KB▼ 25.82%
css/images/fullscreen_icon_02.png0.40KB0.23KB▼ 42.86%
css/images/fullscreen_icon_03.png0.70KB0.37KB▼ 47.77%