88% lightweight-slider

Code Review | Lightweight Slider

WordPress plugin Lightweight Slider scored 88% from 54 tests.

About plugin

  • Plugin page: lightweight-slider
  • Plugin version: 1.0
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.1-5.3
  • WordPress version: 5.8.1
  • First release: Feb 5, 2020
  • Latest release: Feb 6, 2020
  • Number of updates: 3
  • Update frequency: every 1.7 days
  • Top authors: markbanf (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

30+ active / 453 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▼0.26MB] [CPU: ▼151.47ms] Passed 4 tests

Analyzing server-side resources used by Lightweight Slider
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /2.91 ▲0.0839.40 ▲5.29
Dashboard /wp-admin3.15 ▲0.1043.68 ▼2.29
Posts /wp-admin/edit.php3.24 ▲0.1343.36 ▲9.84
Add New Post /wp-admin/post-new.php4.13 ▼1.3045.81 ▼608.41
Media Library /wp-admin/upload.php3.09 ▲0.0931.56 ▼0.47
Add New /wp-admin/post-new.php?post_type=lightweight-slider3.0233.60
Settings /wp-admin/edit.php?post_type=lightweight-slider&page=my-setting-admin3.0541.21
All Slides /wp-admin/edit.php?post_type=lightweight-slider3.1334.03

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

Filesystem and database footprint
The plugin installed successfully
Filesystem: 5 new files
Database: no new tables, 6 new options
New WordPress options
lws_transition
lws_pagination
lws_slide_height
lws_controls
lws_animation
lws_delay

Browser metrics Passed 4 tests

This is an overview of browser requirements for Lightweight Slider
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,861 ▲26516.15 ▲0.3412.88 ▲3.2044.95 ▲1.42
Dashboard /wp-admin3,016 ▲825.91 ▼0.18134.98 ▼21.62112.27 ▼2.09
Posts /wp-admin/edit.php2,779 ▲402.68 ▲0.0164.76 ▼3.7785.72 ▼6.58
Add New Post /wp-admin/post-new.php1,529 ▼5218.83 ▼1.83366.40 ▲2.07109.83 ▼5.90
Media Library /wp-admin/upload.php1,849 ▲425.02 ▼0.00149.26 ▲8.17117.33 ▲3.10
Add New /wp-admin/post-new.php?post_type=lightweight-slider2,3174.58104.8681.53
Settings /wp-admin/edit.php?post_type=lightweight-slider&page=my-setting-admin1,1742.1460.6985.71
All Slides /wp-admin/edit.php?post_type=lightweight-slider1,4632.6365.2878.99

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
Uninstaller ran successfully

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Please fix the following server-side errors
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=lightweight-slider
    • > Notice in wp-content/plugins/lightweight-slider/lightweight-slider.php+71
    Undefined index: slide_caption
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=lightweight-slider
    • > Notice in wp-content/plugins/lightweight-slider/lightweight-slider.php+94
    Trying to get property 'ID' of non-object
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=lightweight-slider
    • > Notice in wp-content/plugins/lightweight-slider/lightweight-slider.php+80
    Undefined index: slide_link
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=lightweight-slider
    • > Notice in wp-content/plugins/lightweight-slider/lightweight-slider.php+80
    Trying to access array offset on value of type null

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please take a closer look at the following
  • 1× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/lightweight-slider/lightweight-slider.php

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
Attributes that need to be fixed:
  • Screenshots: Screenshot #1 (Easy to use settings screen) image not found
  • Donate link: Please fix this invalid url: ""
The official readme.txt might help

lightweight-slider/lightweight-slider.php Passed 13 tests

This is the main PHP file of "Lightweight Slider" version 1.0, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
41 characters long description:
Simple non-bloated WordPress Image Slider

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Good job! No executable or dangerous file extensions detected731 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP25231363
JavaScript11614191
CSS121177

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.18
Average class complexity10.00
▷ Minimum class complexity10.00
▷ Maximum class complexity10.00
Average method complexity1.75
▷ Minimum method complexity1.00
▷ Maximum method complexity7.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods12
▷ Static methods00.00%
▷ Public methods12100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions12
▷ Named functions12100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
PNG images were not found in this plugin