78% sangar-slider-lite

Code Review | Responsive Slider - Sangar Slider

WordPress plugin Responsive Slider - Sangar Slider scored 78% from 54 tests.

About plugin

  • Plugin page: sangar-slider-lite
  • Plugin version: 1.3.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-4.9
  • WordPress version: 5.8.1
  • First release: Oct 22, 2015
  • Latest release: Jul 10, 2018
  • Number of updates: 50
  • Update frequency: every 19.9 days
  • Top authors: Todi.Adiatmo (100%)

Code review

54 tests

User reviews

20 reviews

Install metrics

600+ active / 24,553 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.44MB] [CPU: ▼142.13ms] 75% from 4 tests

Analyzing server-side resources used by Responsive Slider - Sangar Slider
It is recommended to improve the following
  • CPU: You should keep total CPU usage under 500.00ms (currently 3,260.09ms on /wp-admin/admin.php?page=sslider_about_page)
PageMemory (MB)CPU Time (ms)
Home /3.24 ▲0.5238.40 ▲7.89
Dashboard /wp-admin3.53 ▲0.4739.13 ▼6.17
Posts /wp-admin/edit.php3.58 ▲0.4746.28 ▲1.02
Add New Post /wp-admin/post-new.php5.84 ▲0.4196.31 ▼558.52
Media Library /wp-admin/upload.php3.41 ▲0.4036.05 ▼4.85
All Slider /wp-admin/admin.php?page=sangar_slider_admin3.4436.66
About Sangar Slider /wp-admin/admin.php?page=sslider_about_page3.483,260.09
Add Basic Slider /wp-admin/post-new.php?post_type=sangar_slider3.7771.74

Server storage [IO: ▲6.24MB] [DB: ▲0.01MB] Passed 3 tests

How much does this plugin use your filesystem and database?
The plugin installed successfully
Filesystem: 246 new files
Database: no new tables, 1 new option
New WordPress options
sslider_start_date

Browser metrics Passed 4 tests

A check of browser resources used by Responsive Slider - Sangar Slider
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,754 ▲15815.82 ▲0.358.28 ▲0.4345.41 ▼4.56
Dashboard /wp-admin3,014 ▲835.92 ▼0.04141.56 ▲1.41120.58 ▲17.83
Posts /wp-admin/edit.php2,788 ▲492.58 ▼0.2365.67 ▲0.1192.73 ▲0.53
Add New Post /wp-admin/post-new.php1,674 ▲222.05 ▲3.18287.68 ▼66.16148.26 ▲32.89
Media Library /wp-admin/upload.php1,799 ▼84.99 ▼0.04136.85 ▼28.31142.10 ▲13.39
All Slider /wp-admin/admin.php?page=sangar_slider_admin1,3532.7068.16107.82
About Sangar Slider /wp-admin/admin.php?page=sslider_about_page2,42112.35537.72147.23
Add Basic Slider /wp-admin/post-new.php?post_type=sangar_slider8,34412.14319.03158.41

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
The following items require your attention
  • This plugin does not fully uninstall, leaving 1 option in the database
    • sslider_start_date

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Everything seems fine, however this is by no means an exhaustive test

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
  • 2× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/sangar-slider-lite/free-basic-slider/modal-mobile.php
    • > /wp-content/plugins/sangar-slider-lite/free-basic-slider/modal-layer.php
  • 36× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to a member function print_select() on null in wp-content/plugins/sangar-slider-lite/free-basic-slider/modal-content-options.php:75
    • > PHP Warning
      Use of undefined constant SANGAR_SLIDER_DIR_URL - assumed 'SANGAR_SLIDER_DIR_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/sangar-slider-lite/free-basic-slider/modal-presets.php on line 3
    • > PHP Notice
      Undefined variable: form_lib in wp-content/plugins/sangar-slider-lite/free-basic-slider/modal-content-options.php on line 75
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_activation_hook() in wp-content/plugins/sangar-slider-lite/sangar-core/activate.php:3
    • > PHP Notice
      Undefined variable: form_lib in wp-content/plugins/sangar-slider-lite/free-basic-slider/modal-background.php on line 25
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_get_theme() in wp-content/plugins/sangar-slider-lite/sangar-core/about-page.php:8
    • > PHP Fatal error
      Uncaught Error: Call to a member function print_select() on null in wp-content/plugins/sangar-slider-lite/free-basic-slider/modal-background.php:25
    • > PHP Warning
      Use of undefined constant SANGAR_SLIDER_DIR_URL - assumed 'SANGAR_SLIDER_DIR_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/sangar-slider-lite/free-basic-slider/modal-mobile.php on line 10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/sangar-slider-lite/tonjoo-notice.php:14
    • > PHP Warning
      Use of undefined constant SANGAR_SLIDER_DIR_URL - assumed 'SANGAR_SLIDER_DIR_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/sangar-slider-lite/free-basic-slider/modal-layer.php on line 3

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser issues were found

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
Attributes that require attention:
  • Tags: Please delete some tags, you are using 43 tag instead of maximum 10
The official readme.txt might help

sangar-slider-lite/sangar-slider-lite.php Passed 13 tests

The main file in "Responsive Slider - Sangar Slider" v. 1.3.2 serves as a complement to information provided in readme.txt and as the entry point to the plugin
79 characters long description:
Lite version of Sangar Slider, the modern WordPress slideshow for your project.

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
Success! There were no dangerous files found in this plugin26,511 lines of code in 112 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript372,6391,91415,357
CSS197112335,109
PHP431,0035015,106
HTML81061670
Markdown1280130
JSON30097
SVG10042

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.24
Average class complexity20.75
▷ Minimum class complexity1.00
▷ Maximum class complexity83.00
Average method complexity4.04
▷ Minimum method complexity1.00
▷ Maximum method complexity21.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes8
▷ Abstract classes00.00%
▷ Concrete classes8100.00%
▷ Final classes00.00%
Methods52
▷ Static methods611.54%
▷ Public methods2446.15%
▷ Protected methods11.92%
▷ Private methods2751.92%
Functions65
▷ Named functions6193.85%
▷ Anonymous functions46.15%
Constants10
▷ Global constants10100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
95 PNG files occupy 2.15MB with 1.75MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
sangar-core/assets/images/template/horizontal_image_pagination.png0.64KB0.53KB▼ 17.58%
elements/pattern-images/overlay_carbon.png14.64KB0.11KB▼ 99.27%
sangar-core/assets/images/thumb_video.png21.89KB1.10KB▼ 94.96%
sangar-core/assets/images/transparent/white.png2.70KB0.09KB▼ 96.53%
sangar-core/assets/bower_components/sangar-slider/dist/img/icon_autoplay.png31.28KB0.63KB▼ 97.99%