72% dvs-slider

Code Review | DVS Slider

WordPress plugin DVS Slider scored72%from 54 tests.

About plugin

  • Plugin page: dvs-slider
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-3.5
  • WordPress version: 6.3.1
  • First release: Dec 19, 2012
  • Latest release: Dec 19, 2012
  • Number of updates: 2
  • Update frequency: N/A
  • Top authors: kadirmalak (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

10+ active /2,221 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
This plugin's installer ran successfully

Server metrics [RAM: ▼0.59MB] [CPU: ▼13.00ms] Passed 4 tests

Server-side resources used by DVS Slider
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.56 ▲0.1039.80 ▼4.76
Dashboard /wp-admin3.40 ▲0.1044.44 ▲0.37
Posts /wp-admin/edit.php3.52 ▲0.1648.80 ▲0.31
Add New Post /wp-admin/post-new.php3.25 ▼2.6435.41 ▼47.91
Media Library /wp-admin/upload.php3.32 ▲0.1034.53 ▲2.25
All Dvs Slider Images /wp-admin/edit.php?post_type=dvs_slider_image3.3734.51
Add New /wp-admin/post-new.php?post_type=dvs_slider_image3.2537.17
DVS Slider /wp-admin/options-general.php?page=dvs_slider3.3230.91

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

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

Browser metrics Passed 4 tests

This is an overview of browser requirements for DVS Slider
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,834 ▲9914.75 ▲0.371.72 ▼0.0642.72 ▼2.65
Dashboard /wp-admin2,240 ▲484.81 ▼0.11101.74 ▼5.0939.08 ▼1.04
Posts /wp-admin/edit.php2,123 ▲342.05 ▲0.0639.08 ▲2.6135.08 ▲0.45
Add New Post /wp-admin/post-new.php1,569 ▲3018.24 ▼5.07599.97 ▼24.6055.31 ▼3.57
Media Library /wp-admin/upload.php1,416 ▲284.20 ▼0.0497.85 ▲2.9242.99 ▲2.75
All Dvs Slider Images /wp-admin/edit.php?post_type=dvs_slider_image1,1852.0033.9631.45
Add New /wp-admin/post-new.php?post_type=dvs_slider_image1,7413.6664.7535.89
DVS Slider /wp-admin/options-general.php?page=dvs_slider8162.0423.1728.57

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 75% 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 does not fully uninstall, leaving 6 options in the database
    • can_compress_scripts
    • widget_recent-posts
    • widget_recent-comments
    • db_upgraded
    • theysaidso_admin_options
    • widget_theysaidso_widget

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Smoke test failed, please fix the following
    • > GET request to /wp-admin/post-new.php?post_type=dvs_slider_image
    • > Notice in wp-content/plugins/dvs-slider/DvsSlider.class.php+263
    Undefined index: dvs_nonce
    • > GET request to /wp-admin/options-general.php?page=dvs_slider
    • > Notice in wp-content/plugins/dvs-slider/partials/setting-input.php+6
    Trying to access array offset on value of type bool

SRP 0% from 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
Almost there! Just fix the following items
  • 5× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/dvs-slider/partials/link.php
    • > /wp-content/plugins/dvs-slider/partials/thumb.php
    • > /wp-content/plugins/dvs-slider/partials/slider.php
    • > /wp-content/plugins/dvs-slider/partials/order.php
    • > /wp-content/plugins/dvs-slider/partials/caption.php
  • 16× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Notice
      Undefined variable: domain in wp-content/plugins/dvs-slider/partials/thumb.php on line 1
    • > PHP Fatal error
      Uncaught Error: Call to a member function getOptions() on null in wp-content/plugins/dvs-slider/partials/setting-input.php:3
    • > PHP Warning
      Invalid argument supplied for foreach() in wp-content/plugins/dvs-slider/partials/slider.php on line 4
    • > PHP Notice
      Undefined variable: link in wp-content/plugins/dvs-slider/partials/link.php on line 1
    • > PHP Notice
      Undefined variable: meta_name_order in wp-content/plugins/dvs-slider/partials/order.php on line 1
    • > PHP Notice
      Undefined variable: src in wp-content/plugins/dvs-slider/partials/thumb.php on line 1
    • > PHP Notice
      Undefined variable: domain in wp-content/plugins/dvs-slider/partials/thumb.php on line 1
    • > PHP Notice
      Undefined variable: instance in wp-content/plugins/dvs-slider/partials/setting-input.php on line 3
    • > PHP Fatal error
      Uncaught Error: Class 'DvsSlider' not found in wp-content/plugins/dvs-slider/partials/options.php:4
    • > PHP Notice
      Undefined variable: caption in wp-content/plugins/dvs-slider/partials/caption.php on line 1

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser issues were found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
These attributes need your attention:
  • Plugin Name: You should set the name of your plugin on the first line ( === dvs-slider === )
  • Screenshots: These screenshots do not have images: #1 (Sample result), #2 (Slider image management), #3 (Inserting new slider image), #4 (Using slider shortcode)
The official readme.txt might help

dvs-slider/dvs_slider.php 92% from 13 tests

"DVS Slider" version 1.0's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
You should first fix the following items:
  • Main file name: Name the main plugin file the same as the plugin slug ("dvs-slider.php" instead of "dvs_slider.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
There were no executable files found in this plugin1,373 lines of code in 18 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript37673529
CSS62453473
PHP98127371

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.17
Average class complexity23.00
▷ Minimum class complexity23.00
▷ Maximum class complexity23.00
Average method complexity1.92
▷ Minimum method complexity1.00
▷ Maximum method complexity7.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods24
▷ Static methods28.33%
▷ Public methods2291.67%
▷ Protected methods00.00%
▷ Private methods28.33%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants00.00%
▷ Class constants3100.00%
▷ Public constants3100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
12 PNG files occupy 1.18MB with 0.84MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
themes/light/arrows.png3.17KB0.52KB▼ 83.49%
themes/default/arrows.png0.80KB0.51KB▼ 36.53%
themes/dark/arrows.png3.02KB0.38KB▼ 87.27%
screenshot-2.png358.16KB94.07KB▼ 73.74%
screenshot-3.png318.10KB76.04KB▼ 76.09%