84% any-content-carousel

Code Review | Any Content Carousel

WordPress plugin Any Content Carousel scored84%from 54 tests.

About plugin

  • Plugin page: any-content-carousel
  • Plugin version: 1.3.0
  • PHP compatiblity: 5.2.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.8-6.0.0
  • WordPress version: 6.3.1
  • First release: Jun 14, 2021
  • Latest release: May 30, 2022
  • Number of updates: 19
  • Update frequency: every 18.6 days
  • Top authors: treehost (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

30+ active /3,414 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.10MB] [CPU: ▼7.03ms] Passed 4 tests

Analyzing server-side resources used by Any Content Carousel
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.59 ▲0.0943.15 ▲2.43
Dashboard /wp-admin39.38 ▲36.047,365,169.85 ▲7,365,118.89
Posts /wp-admin/edit.php3.55 ▲0.1456.38 ▼1.57
Add New Post /wp-admin/post-new.php6.03 ▲0.1087.06 ▼18.87
Media Library /wp-admin/upload.php3.36 ▲0.0835.26 ▼10.10

Server storage [IO: ▲0.40MB] [DB: ▲0.07MB] Passed 3 tests

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

Browser metrics Passed 4 tests

A check of browser resources used by Any Content Carousel
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,827 ▲6613.29 ▼1.213.44 ▲1.6941.03 ▼5.96
Dashboard /wp-admin2,230 ▲535.91 ▲0.2493.05 ▲3.6741.83 ▼1.34
Posts /wp-admin/edit.php2,143 ▲432.31 ▲0.3442.87 ▲6.4136.21 ▲3.43
Add New Post /wp-admin/post-new.php1,555 ▲2923.17 ▲0.24657.87 ▼14.7134.61 ▼27.24
Media Library /wp-admin/upload.php1,438 ▲384.58 ▲0.36102.74 ▼7.5546.64 ▼0.93

Uninstaller [IO: ▲0.00MB] [DB: ▲0.31MB] 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 6 options in the database
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-comments
    • can_compress_scripts
    • widget_recent-posts
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
The following issues need your attention
  • 7× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Notice
      Undefined variable: posts in wp-content/plugins/any-content-carousel/inc/content-post.php on line 6
    • > PHP Notice
      Undefined variable: prdotti in wp-content/plugins/any-content-carousel/inc/content-product.php on line 5
    • > PHP Notice
      Undefined variable: content in wp-content/plugins/any-content-carousel/inc/content-home.php on line 6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/any-content-carousel/inc/utility.php:41
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/any-content-carousel/inc/dati-strutturati.php:23
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_posts() in wp-content/plugins/any-content-carousel/inc/content-home.php:23
    • > PHP Notice
      Undefined variable: users in wp-content/plugins/any-content-carousel/inc/content-user.php on line 5

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser issues were found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
10 plugin tags: carousel, product carousel, type, shortcode, woocommerce...

any-content-carousel/content-slider.php 92% from 13 tests

"Any Content Carousel" version 1.3.0's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
The following require your attention:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("any-content-carousel.php" instead of "content-slider.php")

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
Everything looks great! No dangerous files found in this plugin4,392 lines of code in 24 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript6881522,255
PHP83712751,245
CSS41916477
Sass2315361
SVG41054

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.21
Average class complexity43.00
▷ Minimum class complexity28.00
▷ Maximum class complexity58.00
Average method complexity4.82
▷ Minimum method complexity1.00
▷ Maximum method complexity15.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods22
▷ Static methods627.27%
▷ Public methods940.91%
▷ Protected methods00.00%
▷ Private methods1359.09%
Functions9
▷ Named functions888.89%
▷ Anonymous functions111.11%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
1 PNG file occupies 0.03MB with 0.02MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
admin/img/sfera.png33.19KB11.09KB▼ 66.57%