72% carousel-horizontal-posts-content-slider

Code Review | Carousel Horizontal Posts Content Slider

WordPress plugin Carousel Horizontal Posts Content Slider scored72%from 54 tests.

About plugin

  • Plugin page: carousel-horizont...
  • Plugin version: 3.3.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.6-6.2
  • WordPress version: 6.3.1
  • First release: Dec 30, 2012
  • Latest release: Jun 11, 2023
  • Number of updates: 161
  • Update frequency: every 23.7 days
  • Top authors: subhansanjaya (100%)

Code review

54 tests

User reviews

76 reviews

Install metrics

4,000+ active /235,789 total downloads

Benchmarks

Plugin footprint 83% from 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.39MB] [CPU: ▼4.76ms] Passed 4 tests

Server-side resources used by Carousel Horizontal Posts Content Slider
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.86 ▲0.3942.71 ▲3.84
Dashboard /wp-admin3.69 ▲0.3551.47 ▼14.20
Posts /wp-admin/edit.php3.80 ▲0.4554.80 ▲4.60
Add New Post /wp-admin/post-new.php6.29 ▲0.4197.46 ▼9.40
Media Library /wp-admin/upload.php3.62 ▲0.3939.11 ▲0.71
Settings /wp-admin/edit.php?post_type=wa_chpcs&page=wa_chpcs3.5937.60
CHPC slider /wp-admin/edit.php?post_type=wa_chpcs3.6640.16
Add New /wp-admin/post-new.php?post_type=wa_chpcs3.6945.88

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

Input-output and database impact of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 41 new files
Database: no new tables, 9 new options
New WordPress options
widget_recent-comments
widget_recent-posts
theysaidso_admin_options
db_upgraded
can_compress_scripts
widget_wa_chpcs_widget
wa_chpcs_version
wa_chpcs_review_notice_dismiss
widget_theysaidso_widget

Browser metrics Passed 4 tests

A check of browser resources used by Carousel Horizontal Posts Content Slider
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,986 ▲24014.21 ▲0.037.19 ▲5.3740.53 ▲1.19
Dashboard /wp-admin2,262 ▲745.51 ▲0.61122.06 ▲2.6782.36 ▲36.14
Posts /wp-admin/edit.php2,164 ▲722.37 ▲0.3644.77 ▲3.9935.09 ▼0.64
Add New Post /wp-admin/post-new.php6,419 ▲4,90028.70 ▲5.42923.93 ▲298.0440.12 ▼13.84
Media Library /wp-admin/upload.php1,447 ▲624.84 ▲0.61107.40 ▲4.6189.08 ▲45.89
Settings /wp-admin/edit.php?post_type=wa_chpcs&page=wa_chpcs1,0212.3429.9828.54
CHPC slider /wp-admin/edit.php?post_type=wa_chpcs1,1442.5141.8432.51
Add New /wp-admin/post-new.php?post_type=wa_chpcs3,3423.4689.09100.10

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
It is recommended to fix the following
  • This plugin did not uninstall successfully, leaving 9 options in the database
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • wa_chpcs_version
    • wa_chpcs_review_notice_dismiss
    • widget_wa_chpcs_widget
    • db_upgraded
    • widget_recent-posts
    • can_compress_scripts
    • widget_recent-comments

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
Please fix the following server-side errors
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=wa_chpcs
    • > Notice in wp-content/plugins/carousel-horizontal-posts-content-slider/views/wa_chpcs_type_meta_box.php+184
    Trying to get property 'slug' of non-object
    • > GET request to /wp-admin/post-new.php?post_type=wa_chpcs
    • > Notice in wp-content/plugins/carousel-horizontal-posts-content-slider/views/wa_chpcs_options_meta_box.php+60
    Undefined index: contents_order
    • > GET request to /wp-admin/post-new.php?post_type=wa_chpcs
    • > Warning in wp-content/plugins/carousel-horizontal-posts-content-slider/views/wa_chpcs_options_meta_box.php+682
    file_get_contents(http://wp.com/wp-content/plugins/carousel-horizontal-posts-content-slider/views/webfonts.json): failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found

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
Please take a closer look at the following
  • 2× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/carousel-horizontal-posts-content-slider/views/wa_chpcs_banner_meta_box.php
    • > /wp-content/plugins/carousel-horizontal-posts-content-slider/views/wa_chpcs_shortcode_meta_box.php
  • 30× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Notice
      Undefined variable: slider_gallery in wp-content/plugins/carousel-horizontal-posts-content-slider/templates/mouse-overlay/mouse-overlay.php on line 4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function submit_button() in wp-content/plugins/carousel-horizontal-posts-content-slider/views/wa_chpcs_custom_publish_meta_box.php:17
    • > PHP Notice
      Undefined variable: wa_chpcs_show_controls in wp-content/plugins/carousel-horizontal-posts-content-slider/templates/card/card.php on line 351
    • > PHP Notice
      Undefined variable: wa_chpcs_show_controls in wp-content/plugins/carousel-horizontal-posts-content-slider/templates/mouse-overlay/mouse-overlay.php on line 258
    • > PHP Notice
      Undefined variable: myposts in wp-content/plugins/carousel-horizontal-posts-content-slider/templates/basic/basic.php on line 9
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/carousel-horizontal-posts-content-slider/includes/class-wa-chpcs-widget.php:2
    • > PHP Notice
      Undefined variable: wa_chpcs_query_posts_item_height in wp-content/plugins/carousel-horizontal-posts-content-slider/templates/card/card.php on line 7
    • > PHP Notice
      Undefined variable: post_status in wp-content/plugins/carousel-horizontal-posts-content-slider/views/wa_chpcs_custom_publish_meta_box.php on line 7
    • > PHP Notice
      Undefined variable: wa_chpcs_show_paging in wp-content/plugins/carousel-horizontal-posts-content-slider/templates/card/card.php on line 367
    • > PHP Warning
      Invalid argument supplied for foreach() in wp-content/plugins/carousel-horizontal-posts-content-slider/templates/basic/basic.php on line 9

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
There were no browser issues found

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
These attributes need to be fixed:
  • Tags: Please reduce the number of tags, currently 57 tag instead of maximum 10
You can take inspiration from this readme.txt

carousel-horizontal-posts-content-slider/carousel-horizontal-posts-content-slider.php Passed 13 tests

"Carousel Horizontal Posts Content Slider" version 3.3.1's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
118 characters long description:
A simple posts content slider, product, images, videos, related posts, custom post type carousel plugin for WordPress.

Code Analysis 97% from 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
Everything looks great! No dangerous files found in this plugin8,189 lines of code in 29 files:
LanguageFilesBlank linesComment linesLines of code
PHP111,3172163,443
JavaScript12121372,693
CSS6296922,053

PHP code 50% from 2 tests

This is a very shot review of cyclomatic complexity and code structure
The following items need your attention
  • Method cyclomatic complexity has to be reduced to less than 100 (currently 106)
Cyclomatic complexity
Average complexity per logical line of code0.40
Average class complexity133.00
▷ Minimum class complexity4.00
▷ Maximum class complexity262.00
Average method complexity4.72
▷ Minimum method complexity1.00
▷ Maximum method complexity106.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods71
▷ Static methods11.41%
▷ Public methods71100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions1
▷ Named functions00.00%
▷ Anonymous functions1100.00%
Constants5
▷ Global constants5100.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
7 PNG files occupy 0.33MB with 0.12MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/icon.png0.77KB0.72KB▼ 6.94%
assets/images/hover.png3.10KB0.31KB▼ 90.11%
assets/js/shortcode/b_img.png0.57KB0.96KB0.00%
assets/images/banner-772x2502.png313.11KB97.13KB▼ 68.98%
assets/js/shortcode/icon.png0.77KB0.72KB▼ 6.94%