83% niso-carousel

Code Review | Niso Carousel

WordPress plugin Niso Carousel scored83%from 54 tests.

About plugin

  • Plugin page: niso-carousel
  • Plugin version: 1.1.3
  • PHP version: 7.4.16
  • WordPress compatibility: 4.5-5.4
  • WordPress version: 6.3.1
  • First release: Sep 21, 2016
  • Latest release: Apr 12, 2020
  • Number of updates: 23
  • Update frequency: every 56.5 days
  • Top authors: nalam (100%)

Code review

54 tests

User reviews

1 review

Install metrics

80+ active /2,744 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.13MB] [CPU: ▲2.12ms] Passed 4 tests

This is a short check of server-side resources used by Niso Carousel
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0561.68 ▲20.87
Dashboard /wp-admin3.45 ▲0.1553.35 ▲0.43
Posts /wp-admin/edit.php3.56 ▲0.2057.42 ▲3.97
Add New Post /wp-admin/post-new.php6.05 ▲0.17100.05 ▲3.49
Media Library /wp-admin/upload.php3.37 ▲0.1437.41 ▲0.57
All carousel /wp-admin/edit.php?post_type=niso-carousel3.4137.48
Add New carousel /wp-admin/post-new.php?post_type=niso-carousel3.8960.48

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

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 171 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
widget_theysaidso_widget
db_upgraded
theysaidso_admin_options
can_compress_scripts
widget_recent-posts

Browser metrics Passed 4 tests

A check of browser resources used by Niso Carousel
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,958 ▲19713.52 ▼0.8515.34 ▲13.7845.76 ▲3.05
Dashboard /wp-admin2,236 ▲685.66 ▲0.0490.71 ▲1.1843.38 ▼2.51
Posts /wp-admin/edit.php2,138 ▲382.05 ▼0.1343.79 ▲7.5541.20 ▲11.36
Add New Post /wp-admin/post-new.php1,579 ▲3423.53 ▲0.27632.92 ▲2.3636.06 ▼13.84
Media Library /wp-admin/upload.php1,435 ▲354.18 ▼0.01102.23 ▼0.9544.04 ▼1.76
All carousel /wp-admin/edit.php?post_type=niso-carousel1,1261.9837.8830.65
Add New carousel /wp-admin/post-new.php?post_type=niso-carousel5,7275.71539.63120.21

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
It is recommended to fix the following
  • Zombie WordPress options were found after uninstall: 6 options
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-posts
    • db_upgraded
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please fix the following
  • 13× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/niso-carousel/includes/niso-carousel-options.php:214
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/niso-carousel/admin/src/cmb-field-select2/cmb-field-select2.php:28
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/niso-carousel/admin/niso-carousel-meta-tab.php:19
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/niso-carousel/admin/niso-button-tinymce.php:24
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/niso-carousel/admin/niso-carousel-column-set.php:62
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/niso-carousel/admin/src/cmb2tab/tab.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/niso-carousel/admin/niso-carousel-update-massage.php:47
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/niso-carousel/admin/niso-carousel-admin-role.php:33
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/niso-carousel/admin/src/cmb2/cmb2-conditionals.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/niso-carousel/includes/niso-carousel-shortcode.php:183

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
These attributes need your attention:
  • Screenshots: These screenshots do not have images: #1 (Niso carousel backend editor), #2 (Video carousel .), #3 (Niso carousel awesome settings)
  • Tags: You are using too many tags: 16 tag instead of maximum 10
The official readme.txt might help

niso-carousel/niso-carousel.php 92% from 13 tests

The primary PHP file in "Niso Carousel" version 1.1.3 is used by WordPress to initiate all plugin functionality
Please make the necessary changes and fix the following:
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug

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
Good job! No executable or dangerous file extensions detected29,549 lines of code in 89 files:
LanguageFilesBlank linesComment linesLines of code
CSS262,6742,21519,319
PHP271,1552,4784,825
JavaScript198484692,697
Sass11168231,116
PO File2306340669
HTML12227551
SVG3250372

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.48
Average class complexity41.47
▷ Minimum class complexity1.00
▷ Maximum class complexity130.00
Average method complexity3.63
▷ Minimum method complexity1.00
▷ Maximum method complexity17.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes15
▷ Abstract classes00.00%
▷ Concrete classes15100.00%
▷ Final classes00.00%
Methods231
▷ Static methods229.52%
▷ Public methods21994.81%
▷ Protected methods93.90%
▷ Private methods31.30%
Functions51
▷ Named functions51100.00%
▷ Anonymous functions00.00%
Constants9
▷ Global constants555.56%
▷ Class constants444.44%
▷ Public constants4100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
51 PNG files occupy 1.48MB with 0.78MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
doc/assets/img/item_list.png30.50KB13.50KB▼ 55.72%
admin/src/cmb2/images/ui-bg_flat_0_aaaaaa_40x100.png0.18KB0.08KB▼ 51.67%
assets/img/input-unchecked.png0.15KB0.15KB0.00%
assets/css/themes/close.png2.88KB0.24KB▼ 91.76%
doc/assets/img/video_link.png24.03KB8.38KB▼ 65.14%