63% carousel-widget

Code Review | Carousel Widget

WordPress plugin Carousel Widget scored63%from 54 tests.

About plugin

  • Plugin page: carousel-widget
  • Plugin version: 2.7.0
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: Apr 26, 2013
  • Latest release: Jun 11, 2021
  • Number of updates: 113
  • Update frequency: every 26.3 days
  • Top authors: ujw0l (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

30+ active /6,825 total downloads

Benchmarks

Plugin footprint 48% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.08MB] [CPU: ▼4.88ms] Passed 4 tests

Server-side resources used by Carousel Widget
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.0736.05 ▼18.82
Dashboard /wp-admin3.39 ▲0.0949.56 ▼1.86
Posts /wp-admin/edit.php3.51 ▲0.1552.41 ▲7.39
Add New Post /wp-admin/post-new.php5.97 ▲0.0993.99 ▼1.13
Media Library /wp-admin/upload.php3.29 ▲0.0738.21 ▲2.29

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

Analyzing filesystem and database footprints of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 13 new files
Database: 1 new table, 7 new options
New tables
wp_url_table
New WordPress options
db_upgraded
widget_carousel_widget
can_compress_scripts
theysaidso_admin_options
widget_recent-posts
widget_theysaidso_widget
widget_recent-comments

Browser metrics Passed 4 tests

An overview of browser requirements for Carousel Widget
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,967 ▲22114.71 ▲0.341.89 ▲0.1338.83 ▼4.99
Dashboard /wp-admin2,369 ▲1846.44 ▲1.56130.43 ▲23.5840.90 ▼4.04
Posts /wp-admin/edit.php2,275 ▲1833.32 ▲1.3353.96 ▲19.0135.19 ▲1.49
Add New Post /wp-admin/post-new.php1,534 ▼017.67 ▼5.40560.97 ▼91.4433.70 ▼34.77
Media Library /wp-admin/upload.php1,414 ▲264.20 ▼0.1979.01 ▼27.6840.40 ▼2.32

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 25% 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 did not uninstall without warnings or errors
    • > Notice in wp-content/plugins/carousel-widget/carousel_widget.php+72
    Undefined variable: tableName
  • Zombie tables were found after uninstall: 1 table
    • wp_url_table
  • This plugin does not fully uninstall, leaving 7 options in the database
    • widget_carousel_widget
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-comments
    • widget_recent-posts
    • can_compress_scripts
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 50% 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 fix the following items
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/carousel-widget/carousel_widget.php:271

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 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
Please fix the following attributes:
  • Screenshots: These screenshots require images: #1 (Screenshot of the carousel), #2 (Screenshot of widget), #3 (Screenshot of settings/info section), #4 (Screenshot of Item list on carousel), #5 (Screenshot of carousel demo in backend)
  • Requires at least: Version format is invalid
You can take inspiration from this readme.txt

carousel-widget/carousel_widget.php 92% from 13 tests

The main PHP file in "Carousel Widget" ver. 2.7.0 adds more information about the plugin and also serves as the entry point for this plugin
It is important to fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("carousel-widget.php" instead of "carousel_widget.php")

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 detected1,528 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript4261145930
CSS112839315
PHP110741255
JSON10028

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.24
Average class complexity14.50
▷ Minimum class complexity6.00
▷ Maximum class complexity23.00
Average method complexity2.50
▷ Minimum method complexity1.00
▷ Maximum method complexity9.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods18
▷ Static methods00.00%
▷ Public methods18100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
2 PNG files occupy 1.79MB with 1.25MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-2.png788.12KB226.08KB▼ 71.31%
screenshot-1.png1,045.81KB328.50KB▼ 68.59%