10% kads-slider

Code Review | Kads Slider

WordPress plugin Kads Slider scored 10% from 54 tests.

About plugin

  • Plugin page: kads-slider
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.2-4.9.1
  • WordPress version: 5.8.1
  • First release: Mar 31, 2018
  • Latest release: Mar 31, 2018
  • Number of updates: 2
  • Update frequency: N/A
  • Top authors: huynhduy1985 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 460 total downloads

Benchmarks

Plugin footprint 58% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Please fix the following installer errors
  • The plugin cannot be installed
    • > Deprecated in wp-content/plugins/kads-slider/includes/kads-class.php+60
    Array and string offset access syntax with curly braces is deprecated

Server metrics [RAM: ▼1.85MB] [CPU: ▼188.75ms] Passed 4 tests

Analyzing server-side resources used by Kads Slider
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /1.79 ▼0.945.20 ▼18.38
Dashboard /wp-admin1.80 ▼1.265.23 ▼48.22
Posts /wp-admin/edit.php1.81 ▼1.316.37 ▼37.65
Add New Post /wp-admin/post-new.php1.80 ▼3.635.42 ▼643.15
Media Library /wp-admin/upload.php1.80 ▼1.205.21 ▼25.97
Sliders /wp-admin/admin.php?page=kads-slider-sliders-items1.815.20
Add New /wp-admin/admin.php?page=kads-slider1.815.24

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

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 70 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

Checking browser requirements for Kads Slider
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,708 ▲10216.22 ▲0.568.75 ▼0.2748.35 ▼18.68
Dashboard /wp-admin3,002 ▲685.93 ▼0.24132.64 ▼32.97110.25 ▼22.88
Posts /wp-admin/edit.php2,768 ▲292.72 ▼0.0068.86 ▲5.1993.79 ▲1.20
Add New Post /wp-admin/post-new.php1,895 ▲39519.16 ▲0.54370.14 ▼7.58109.29 ▲6.71
Media Library /wp-admin/upload.php1,836 ▲295.07 ▲0.03144.22 ▼0.65117.12 ▼3.73
Sliders /wp-admin/admin.php?page=kads-slider-sliders-items1,3904.1170.5495.40
Add New /wp-admin/admin.php?page=kads-slider7,0776.31148.86118.34

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
It is recommended to fix the following
  • The plugin did not uninstall gracefully
    • > Deprecated in wp-content/plugins/kads-slider/includes/kads-class.php+60
    Array and string offset access syntax with curly braces is deprecated

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Smoke test failed, please fix the following
  • 14 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=kads-slider
    • > Deprecated in wp-content/plugins/kads-slider/includes/kads-class.php+70
    Array and string offset access syntax with curly braces is deprecated
    • > GET request to /wp-admin/admin.php?page=kads-slider-sliders-items
    • > Notice in wp-content/plugins/kads-slider/templates/slider-admin.php+14
    Undefined variable: max_images
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=kads-slider
    • > Notice in wp-content/plugins/kads-slider/templates/slider-add.php+63
    Trying to get property 'ID' of non-object
    • > GET request to /wp-admin/admin.php?page=kads-slider
    • > Notice in wp-content/plugins/kads-slider/templates/slider-add.php+32
    Trying to get property 'contents' of non-object
    • > GET request to /wp-admin/admin.php?page=kads-slider
    • > Notice in wp-content/plugins/kads-slider/templates/slider-add.php+76
    Trying to get property 'post_title' of non-object
    • > GET request to /wp-admin/admin.php?page=kads-slider
    • > Notice in wp-content/plugins/kads-slider/templates/slider-add.php+82
    Trying to get property 'post_name' of non-object

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
The following issues need your attention
  • 3× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/kads-slider/includes/kads-class.php
    • > /wp-content/plugins/kads-slider/kads-slider.php
    • > /wp-content/plugins/kads-slider/includes/kads-functions.php
  • 2× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Notice
      Undefined variable: slider in wp-content/plugins/kads-slider/templates/slider.php on line 11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_localize_script() in wp-content/plugins/kads-slider/templates/slider-admin.php:13

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
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 uses markdown syntax to describe your plugin to the world
Please fix the following attributes:
  • Screenshots: No descriptions were found for these screenshots #1, #2, #3, #4, #5, #6 in kads-slider/assets to your readme.txt
Please take inspiration from this readme.txt

kads-slider/kads-slider.php 92% from 13 tests

The primary PHP file in "Kads Slider" version 1.0.0 is used by WordPress to initiate all plugin functionality
You should first fix the following items:
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 242 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Success! There were no dangerous files found in this plugin34,205 lines of code in 47 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript132,8123,51612,048
CSS1051126610,069
Sass1396947,255
SVG1002,671
PHP61352141,942
Markdown1840127
JSON30093

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.49
Average class complexity8.00
▷ Minimum class complexity8.00
▷ Maximum class complexity8.00
Average method complexity2.75
▷ Minimum method complexity1.00
▷ Maximum method complexity6.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods4
▷ Static methods00.00%
▷ Public methods125.00%
▷ Protected methods00.00%
▷ Private methods375.00%
Functions33
▷ Named functions33100.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
8 PNG files occupy 0.03MB with 0.01MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/css/images/ui-icons_ffffff_256x240.png6.15KB4.17KB▼ 32.13%
assets/css/images/ui-icons_333333_256x240.png6.81KB4.17KB▼ 38.71%
assets/images/time-ruler.png0.15KB0.11KB▼ 29.68%
assets/css/images/ui-icons_b70404_256x240.png4.44KB4.17KB▼ 6.02%
assets/images/kads.video.play.png4.86KB2.74KB▼ 43.61%