83% niso-carousel-slider

Code Review | Niso Carousel Slider

WordPress plugin Niso Carousel Slider scored83%from 54 tests.

About plugin

  • Plugin page: niso-carousel-slider
  • Plugin version: 1.3.19
  • PHP version: 7.4.16
  • WordPress compatibility: 4.5-6.3
  • WordPress version: 6.3.1
  • First release: Oct 10, 2016
  • Latest release: Aug 12, 2023
  • Number of updates: 41
  • Update frequency: every 60.9 days
  • Top authors: nalam (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

900+ active /26,883 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.91MB] [CPU: ▲7.74ms] Passed 4 tests

An overview of server-side resources used by Niso Carousel Slider
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.64 ▲0.1844.64 ▲1.01
Dashboard /wp-admin4.45 ▲1.1454.52 ▲5.28
Posts /wp-admin/edit.php4.53 ▲1.1756.38 ▲9.50
Add New Post /wp-admin/post-new.php7.05 ▲1.16118.43 ▲25.51
Media Library /wp-admin/upload.php4.37 ▲1.1446.96 ▲15.15
Add New carousel /wp-admin/post-new.php?post_type=niso-carousel5.5668.55
All carousel /wp-admin/edit.php?post_type=niso-carousel4.4247.97

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

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 476 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
widget_recent-comments
db_upgraded
can_compress_scripts
theysaidso_admin_options
widget_recent-posts

Browser metrics Passed 4 tests

An overview of browser requirements for Niso Carousel Slider
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,969 ▲23413.86 ▼0.546.94 ▲4.7844.93 ▼2.48
Dashboard /wp-admin2,269 ▲845.01 ▼0.87104.51 ▲0.1540.49 ▼5.55
Posts /wp-admin/edit.php2,151 ▲622.22 ▲0.2243.94 ▲5.0737.88 ▲5.76
Add New Post /wp-admin/post-new.php1,579 ▲5123.61 ▲0.25615.25 ▼70.0033.65 ▼33.59
Media Library /wp-admin/upload.php1,448 ▲604.36 ▲0.1098.77 ▲1.4943.33 ▼1.77
Add New carousel /wp-admin/post-new.php?post_type=niso-carousel6,1368.21518.75132.29
All carousel /wp-admin/edit.php?post_type=niso-carousel1,1362.0335.3028.23

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
These items require your attention
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-comments
    • widget_recent-posts
    • theysaidso_admin_options
    • db_upgraded
    • can_compress_scripts
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though everything seems fine, this is not an exhaustive test

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 fix the following items
  • 52× 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-slider/includes/niso-carousel-options.php:214
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Text' not found in wp-content/plugins/niso-carousel-slider/admin/src/cmb2/includes/types/CMB2_Type_Oembed.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_File_Base' not found in wp-content/plugins/niso-carousel-slider/admin/src/cmb2/includes/types/CMB2_Type_File_List.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/niso-carousel-slider/admin/niso-carousel-smeta.php:19
    • > PHP Fatal error
      Uncaught Error: Call to undefined function cmb2_dir() in wp-content/plugins/niso-carousel-slider/admin/src/cmb2/includes/rest-api/CMB2_REST_Controller.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Base' not found in wp-content/plugins/niso-carousel-slider/admin/src/cmb2/includes/types/CMB2_Type_Text_Datetime_Timestamp_Timezone.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/niso-carousel-slider/admin/niso-carousel-post.php:61
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Base' not found in wp-content/plugins/niso-carousel-slider/admin/src/cmb2/includes/types/CMB2_Type_Multi_Base.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Taxonomy_Base' not found in wp-content/plugins/niso-carousel-slider/admin/src/cmb2/includes/types/CMB2_Type_Taxonomy_Radio.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Picker_Base' not found in wp-content/plugins/niso-carousel-slider/admin/src/cmb2/includes/types/CMB2_Type_Text_Datetime_Timestamp.php:13

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 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Please fix the following attributes:
  • Tags: Please reduce the number of tags, currently 15 tag instead of maximum 10
The official readme.txt is a good inspiration

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

"Niso Carousel Slider" version 1.3.19's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
The following require your attention:
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Good job! No executable or dangerous file extensions detected67,139 lines of code in 273 files:
LanguageFilesBlank linesComment linesLines of code
PO File12114,51418,70532,747
CSS311,8521,34815,662
PHP712,3576,5849,297
JavaScript261,0699593,559
JSON3003,543
Sass17305251,408
HTML12227551
SVG3250372

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.46
Average class complexity18.38
▷ Minimum class complexity1.00
▷ Maximum class complexity185.00
Average method complexity3.25
▷ Minimum method complexity1.00
▷ Maximum method complexity28.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes71
▷ Abstract classes912.68%
▷ Concrete classes6287.32%
▷ Final classes00.00%
Methods551
▷ Static methods8615.61%
▷ Public methods45983.30%
▷ Protected methods8916.15%
▷ Private methods30.54%
Functions72
▷ Named functions72100.00%
▷ Anonymous functions00.00%
Constants16
▷ Global constants743.75%
▷ Class constants956.25%
▷ Public constants9100.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.56MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
doc/assets/img/m_settings_3.png34.46KB11.54KB▼ 66.50%
doc/assets/img/m_settings_6.png26.72KB10.42KB▼ 61.01%
admin/src/cmb2/images/ui-bg_highlight-soft_75_cccccc_1x100.png0.10KB0.17KB0.00%
doc/assets/img/s_settings.png18.78KB7.79KB▼ 58.50%
admin/src/cmb2/images/ui-icons_2e83ff_256x240.png4.27KB4.11KB▼ 3.78%