67% image-carousel-for-divi

Code Review | Image Carousel For Divi

WordPress plugin Image Carousel For Divi scored67%from 54 tests.

About plugin

  • Plugin page: image-carousel-fo...
  • Plugin version: 1.6.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.9.8-6.3
  • WordPress version: 6.3.1
  • First release: Jul 17, 2019
  • Latest release: Aug 24, 2023
  • Number of updates: 16
  • Update frequency: every 93.8 days
  • Top authors: wpt00ls (100%)

Code review

54 tests

User reviews

6 reviews

Install metrics

2,000+ active /19,509 total downloads

Benchmarks

Plugin footprint 64% 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 gracefully, with no errors

Server metrics [RAM: ▲5.40MB] [CPU: ▲26.36ms] 50% from 4 tests

An overview of server-side resources used by Image Carousel For Divi
The following require your attention
  • CPU: You should keep total CPU usage under 500.00ms (currently 1,914.72ms on /wp-admin/admin.php?page=image-carousel-for-divi)
  • Extra RAM: Try to keep extra memory usage under 5MB (currently 5.40MB on /wp-admin/admin.php?page=freemius)
PageMemory (MB)CPU Time (ms)
Home /9.24 ▲5.7873.22 ▲26.24
Dashboard /wp-admin9.26 ▲5.9672.78 ▲21.60
Posts /wp-admin/edit.php9.26 ▲5.9179.43 ▲27.03
Add New Post /wp-admin/post-new.php9.85 ▲3.96122.82 ▲30.56
Media Library /wp-admin/upload.php9.26 ▲6.0382.14 ▲45.46
Image Carousel Using Divi /wp-admin/admin.php?page=image-carousel-for-divi9.261,914.72
Freemius Debug [v.2.5.10] /wp-admin/admin.php?page=freemius9.2662.81

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

Filesystem and database footprint
The plugin installed successfully
Filesystem: 246 new files
Database: no new tables, 9 new options
New WordPress options
fs_active_plugins
fs_debug_mode
widget_theysaidso_widget
can_compress_scripts
fs_accounts
widget_recent-posts
widget_recent-comments
theysaidso_admin_options
db_upgraded

Browser metrics Passed 4 tests

Checking browser requirements for Image Carousel For Divi
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,806 ▲4514.27 ▼0.011.72 ▲0.1430.95 ▼13.49
Dashboard /wp-admin2,212 ▲325.64 ▼0.0285.21 ▼6.3443.88 ▲1.21
Posts /wp-admin/edit.php2,118 ▲181.98 ▼0.0539.90 ▲2.0740.09 ▲2.96
Add New Post /wp-admin/post-new.php1,539 ▲924.47 ▲1.01673.94 ▼10.7169.40 ▼0.91
Media Library /wp-admin/upload.php1,417 ▲174.22 ▲0.0599.76 ▲0.4949.72 ▲6.22
Image Carousel Using Divi /wp-admin/admin.php?page=image-carousel-for-divi9791.6528.4954.38
Freemius Debug [v.2.5.10] /wp-admin/admin.php?page=freemius1,0671.8326.7927.70

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
The following items require your attention
  • Uninstall procedure validation failed for this plugin
    • > Notice in wp-content/plugins/image-carousel-for-divi/freemius/includes/class-freemius.php+8486
    Undefined property: stdClass::$plugins
  • Zombie WordPress options detected upon uninstall: 9 options
    • fs_debug_mode
    • fs_active_plugins
    • fs_accounts
    • db_upgraded
    • widget_recent-posts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-comments

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 0% 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
Almost there! Just fix the following items
  • 1× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/image-carousel-for-divi/resources/views/wptools-divi-carousel-image-item.php
  • 20× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Pimple\\Container' not found in wp-content/plugins/image-carousel-for-divi/src/Loader.php:9
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Container\otFoundExceptionInterface' not found in wp-content/plugins/image-carousel-for-divi/vendor/pimple/pimple/src/Pimple/Exception/UnknownIdentifierException.php:36
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Container\\ContainerInterface' not found in wp-content/plugins/image-carousel-for-divi/vendor/pimple/pimple/src/Pimple/Psr11/Container.php:37
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Container\\ContainerInterface' not found in wp-content/plugins/image-carousel-for-divi/vendor/pimple/pimple/src/Pimple/Psr11/ServiceLocator.php:38
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/image-carousel-for-divi/resources/views/wptools-divi-carousel-images.php:1
    • > PHP Notice
      Undefined variable: module_classes in wp-content/plugins/image-carousel-for-divi/resources/views/wptools-divi-carousel-images.php on line 1
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Container\\ContainerExceptionInterface' not found in wp-content/plugins/image-carousel-for-divi/vendor/pimple/pimple/src/Pimple/Exception/FrozenServiceException.php:36
    • > PHP Notice
      Undefined variable: props in wp-content/plugins/image-carousel-for-divi/resources/views/wptools-divi-carousel-image-item.php on line 5
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/image-carousel-for-divi/resources/views/wptools-divi-carousel-image-item.php on line 2
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Container\otFoundExceptionInterface' not found in wp-content/plugins/image-carousel-for-divi/vendor/pimple/pimple/src/Pimple/Exception/InvalidServiceIdentifierException.php:36

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
3 plugin tags: divi module, divi, image carousel

image-carousel-for-divi/image-carousel-for-divi.php 85% from 13 tests

The entry point to "Image Carousel For Divi" version 1.6.1 is a PHP file that has certain tags in its header comment area
Please take the time to fix the following:
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6
  • Domain Path: The domain path points to an invalid folder, "/languages" does not exist

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
No dangerous file extensions were detected37,622 lines of code in 189 files:
LanguageFilesBlank linesComment linesLines of code
PHP1518,28918,17834,377
JavaScript108911232,362
CSS17445289
LESS2236239
JSON300174
reStructuredText19613997
YAML17139
XML12016
SVG11013
Markdown1508
Ruby1208

PHP code 50% from 2 tests

This is a very shot review of cyclomatic complexity and code structure
Please fix the following
  • Class cyclomatic complexity has to be reduced to less than 1000 (currently 3,073)
Cyclomatic complexity
Average complexity per logical line of code0.62
Average class complexity65.10
▷ Minimum class complexity1.00
▷ Maximum class complexity3,073.00
Average method complexity4.42
▷ Minimum method complexity1.00
▷ Maximum method complexity94.00
Code structure
Namespaces12
Interfaces4
Traits0
Classes67
▷ Abstract classes22.99%
▷ Concrete classes6597.01%
▷ Final classes23.08%
Methods1,363
▷ Static methods21615.85%
▷ Public methods97171.24%
▷ Protected methods181.32%
▷ Private methods37427.44%
Functions107
▷ Named functions10093.46%
▷ Anonymous functions76.54%
Constants145
▷ Global constants9867.59%
▷ Class constants4732.41%
▷ Public constants47100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
3 PNG files occupy 0.03MB with 0.01MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
freemius/assets/img/theme-icon.png10.97KB5.78KB▼ 47.37%
freemius/assets/img/plugin-icon.png9.16KB5.26KB▼ 42.58%
freemius/assets/img/image-carousel-for-divi.png7.65KB3.41KB▼ 55.37%