78% hm-image-slider

Code Review | HM Image Slider

WordPress plugin HM Image Slider scored 78% from 54 tests.

About plugin

  • Plugin page: hm-image-slider
  • Plugin version: 1.0.3
  • PHP version: 7.4.16
  • WordPress compatibility: 3.3-4.4
  • WordPress version: 6.3.1
  • First release: Jan 12, 2016
  • Latest release: Jul 21, 2017
  • Number of updates: 61
  • Update frequency: every 9.1 days
  • Top authors: hamedmoodi (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 1,144 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲0.12MB] [CPU: ▼6.49ms] Passed 4 tests

An overview of server-side resources used by HM Image Slider
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.59 ▲0.1338.11 ▼2.98
Dashboard /wp-admin3.42 ▲0.1244.82 ▼10.34
Posts /wp-admin/edit.php3.53 ▲0.1849.35 ▲1.10
Add New Post /wp-admin/post-new.php6.00 ▲0.1291.23 ▼10.63
Media Library /wp-admin/upload.php3.34 ▲0.1135.07 ▼2.00
All Sliders /wp-admin/edit.php?post_type=hm-image-slider3.3935.20
Subjects /wp-admin/edit-tags.php?taxonomy=slider-subject&post_type=hm-image-slider3.3433.51
Add New /wp-admin/post-new.php?post_type=hm-image-slider3.4144.78

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

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 60 new files
Database: no new tables, 7 new options
New WordPress options
db_upgraded
widget_theysaidso_widget
widget_recent-posts
widget_recent-comments
theysaidso_admin_options
widget_hmis_widget
can_compress_scripts

Browser metrics Passed 4 tests

A check of browser resources used by HM Image Slider
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,836 ▲10113.33 ▼1.041.77 ▼0.1344.00 ▲0.64
Dashboard /wp-admin2,237 ▲494.84 ▼0.06106.83 ▼12.6238.43 ▼5.46
Posts /wp-admin/edit.php2,120 ▲312.05 ▲0.0039.71 ▲2.3636.91 ▲5.92
Add New Post /wp-admin/post-new.php1,540 ▲2117.64 ▼5.72657.07 ▼71.1955.51 ▼0.26
Media Library /wp-admin/upload.php1,419 ▲374.19 ▲0.02105.34 ▲2.8745.50 ▲0.66
All Sliders /wp-admin/edit.php?post_type=hm-image-slider1,1001.9330.1829.05
Subjects /wp-admin/edit-tags.php?taxonomy=slider-subject&post_type=hm-image-slider1,2682.1426.7928.50
Add New /wp-admin/post-new.php?post_type=hm-image-slider2,2133.0265.7694.28

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
You still need to fix the following
  • Zombie WordPress options were found after uninstall: 7 options
    • db_upgraded
    • can_compress_scripts
    • widget_recent-posts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_hmis_widget
    • widget_recent-comments

Smoke tests 50% from 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)
Good news, no errors were detected

SRP 0% 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 items
  • 1× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/hm-image-slider/js/hmsliderimage-front-script.php
  • 7× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/hm-image-slider/inc/shortcodes.php:3
    • > PHP Notice
      Undefined index: uid in wp-content/plugins/hm-image-slider/js/hmsliderimage-front-script.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_post_meta() in wp-content/plugins/hm-image-slider/inc/slider-metabox-setting.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/hm-image-slider/inc/slider-widget.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/hm-image-slider/inc/slider-post-type.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_post_meta() in wp-content/plugins/hm-image-slider/inc/slider-metabox.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/hm-image-slider/inc/slider-metabox-how-use.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
There were no browser issues found

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Please fix the following attributes:
  • Screenshots: Add images for these screenshots: #1 (simple image insert), #2 (simple slider setting pannel), #3 (use jquery easing), #4 (use shortcode and widget)
The official readme.txt might help

hm-image-slider/hm-image-slider.php Passed 13 tests

The main file in "HM Image Slider" v. 1.0.3 serves as a complement to information provided in readme.txt and as the entry point to the plugin
27 characters long description:
this is simple image slider

Code Analysis Passed 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 plugin1,837 lines of code in 19 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript6195204960
PHP99648494
CSS33510212
PO File17171171

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.23
Average class complexity12.00
▷ Minimum class complexity12.00
▷ Maximum class complexity12.00
Average method complexity3.75
▷ Minimum method complexity1.00
▷ Maximum method complexity7.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods4
▷ Static methods00.00%
▷ Public methods4100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions14
▷ Named functions642.86%
▷ Anonymous functions857.14%
Constants5
▷ Global constants5100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
37 PNG files occupy 0.59MB with 0.30MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/swing.png1.28KB0.71KB▼ 44.94%
images/easeInOutQuad.png1.35KB0.73KB▼ 45.86%
screenshot-4.png346.91KB147.26KB▼ 57.55%
screenshot-3.png58.69KB24.54KB▼ 58.18%
images/easeInCirc.png1.40KB0.69KB▼ 50.45%