62% palto-carousel

Code Review | Palto Carousel

WordPress plugin Palto Carousel scored 62% from 54 tests.

About plugin

  • Plugin page: palto-carousel
  • Plugin version: 1.2.6
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-5.6
  • WordPress version: 6.3.1
  • First release: Jul 7, 2016
  • Latest release: Jan 30, 2021
  • Number of updates: 19
  • Update frequency: every 87.8 days
  • Top authors: nalam (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

10+ active / 2,204 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Installer ran successfully

Server metrics [RAM: ▼0.47MB] [CPU: ▼34.94ms] Passed 4 tests

This is a short check of server-side resources used by Palto Carousel
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.57 ▲0.1137.12 ▼2.50
Dashboard /wp-admin3.53 ▲0.2221.08 ▼25.71
Posts /wp-admin/edit.php3.53 ▲0.1723.03 ▼33.22
Add New Post /wp-admin/post-new.php3.53 ▼2.3622.09 ▼66.74
Media Library /wp-admin/upload.php3.53 ▲0.3022.05 ▼14.08
Add New carousel /wp-admin/post-new.php?post_type=palto-carousel3.5321.15
All carousel /wp-admin/edit.php?post_type=palto-carousel3.5328.49

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

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 422 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
widget_recent-posts
theysaidso_admin_options
widget_recent-comments
db_upgraded
can_compress_scripts

Browser metrics Passed 4 tests

Palto Carousel: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,925 ▲19013.77 ▼0.446.38 ▲4.7138.54 ▼7.56
Dashboard /wp-admin2,233 ▲424.87 ▼0.18107.88 ▲2.9340.27 ▲1.06
Posts /wp-admin/edit.php2,116 ▲272.00 ▼0.0239.10 ▲1.0034.67 ▲3.13
Add New Post /wp-admin/post-new.php1,554 ▲4017.71 ▲0.29665.57 ▲34.0337.38 ▼21.14
Media Library /wp-admin/upload.php1,415 ▲304.19 ▼0.0297.41 ▼4.2341.81 ▼2.71
Add New carousel /wp-admin/post-new.php?post_type=palto-carousel1,4272.5746.6630.87
All carousel /wp-admin/edit.php?post_type=palto-carousel1,0961.9530.1530.28

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • The plugin did not uninstall gracefully
    • > Warning in wp-content/plugins/palto-carousel/admin/src/cmb2/includes/helper-functions.php+44
    include_once(wp-content/plugins/palto-carousel/admin/src/cmb2/includes/CMB2_Hookup.php): failed to open stream: No such file or directory
  • The uninstall procedure has failed, leaving 6 options in the database
    • db_upgraded
    • widget_recent-comments
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-posts

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
These server-side errors were triggered
  • 6 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=palto-carousel
    • > POST request to /wp-admin/admin-ajax.php
    • > Warning in wp-content/plugins/palto-carousel/admin/src/cmb2/includes/helper-functions.php+44
    include_once(wp-content/plugins/palto-carousel/admin/src/cmb2/includes/CMB2_Hookup.php): failed to open stream: No such file or directory
  • 6 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=palto-carousel
    • > POST request to /wp-admin/admin-ajax.php
    • > Warning in wp-content/plugins/palto-carousel/admin/src/cmb2/includes/helper-functions.php+44
    include_once(): Failed opening 'wp-content/plugins/palto-carousel/admin/src/cmb2/includes/CMB2_Hookup.php' for inclusion (include_path='.:/usr/share/php')
  • 6 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=palto-carousel
    • > POST request to /wp-admin/admin-ajax.php
    • > Warning in wp-includes/class-wp-hook.php+310
    call_user_func_array() expects parameter 1 to be a valid callback, class 'CMB2_Hookup' not found

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Almost there! Just fix the following items
  • 46× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Textarea' not found in wp-content/plugins/palto-carousel/admin/src/cmb2/includes/types/CMB2_Type_Textarea_Code.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Counter_Base' not found in wp-content/plugins/palto-carousel/admin/src/cmb2/includes/types/CMB2_Type_Textarea.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Text' not found in wp-content/plugins/palto-carousel/admin/src/cmb2/includes/types/CMB2_Type_Picker_Base.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Hookup_Base' not found in wp-content/plugins/palto-carousel/admin/src/cmb2/includes/CMB2_hookup.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Base' not found in wp-content/plugins/palto-carousel/admin/src/cmb2/includes/types/CMB2_Type_Multi_Base.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/palto-carousel/admin/src/cmb2-field-slider/cmb2_field_slider.php:15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/palto-carousel/admin/pcarousel-post-type.php:60
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Taxonomy_Select' not found in wp-content/plugins/palto-carousel/admin/src/cmb2/includes/types/CMB2_Type_Taxonomy_Select_Hierarchical.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/palto-carousel/admin/src/pcarousel-meta.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Taxonomy_Base' not found in wp-content/plugins/palto-carousel/admin/src/cmb2/includes/types/CMB2_Type_Taxonomy_Select.php:13

User-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Please fix the following user-side errors
    • > GET request to /wp-admin/post-new.php?post_type=palto-carousel
    • > Network (severe)
    wp-content/plugins/palto-carousel/admin/src/cmb2/js/cmb2-conditionals.js?ver=1.0.2 - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
Please fix the following attributes:
  • Tags: Too many tags (15 tag instead of maximum 10); only the first 5 tags are used in your directory listing
The official readme.txt is a good inspiration

palto-carousel/palto-carousel.php 92% from 13 tests

The entry point to "Palto Carousel" version 1.2.6 is a PHP file that has certain tags in its header comment area
Please make the necessary changes and fix the following:
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6

Code Analysis Passed 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 detected49,701 lines of code in 244 files:
LanguageFilesBlank linesComment linesLines of code
PO File12114,45418,65032,624
PHP642,2136,3128,011
CSS233671,2875,757
JavaScript154436971,794
Sass17306291,410
SVG323059
JSON10046

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.71
▷ Minimum class complexity1.00
▷ Maximum class complexity186.00
Average method complexity3.28
▷ Minimum method complexity1.00
▷ Maximum method complexity31.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes70
▷ Abstract classes912.86%
▷ Concrete classes6187.14%
▷ Final classes00.00%
Methods548
▷ Static methods8816.06%
▷ Public methods45683.21%
▷ Protected methods8916.24%
▷ Private methods30.55%
Functions46
▷ Named functions46100.00%
▷ Anonymous functions00.00%
Constants13
▷ Global constants538.46%
▷ Class constants861.54%
▷ Public constants8100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
31 PNG files occupy 0.36MB with 0.16MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/css/themes/prev.png3.11KB0.32KB▼ 89.67%
assets/css/themes/close@2x.png3.02KB0.34KB▼ 88.83%
admin/src/cmb2/images/ui-bg_flat_75_ffffff_40x100.png0.17KB0.08KB▼ 51.12%
admin/src/cmb2/images/ui-bg_highlight-soft_75_cccccc_1x100.png0.10KB0.17KB0.00%
admin/src/cmb2/images/ui-bg_glass_55_fbf9ee_1x400.png0.12KB0.14KB0.00%