83% twi-woocommerce-gridslidercarousel-lite

Code Review | TWI Woocommerce Grid/Slider/Carousel Lite

WordPress plugin TWI Woocommerce Grid/Slider/Carousel Lite scored 83% from 54 tests.

About plugin

  • Plugin page: twi-woocommerce-g...
  • Plugin version: 2.0.0
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-5.3.2
  • WordPress version: 6.3.1
  • First release: Jul 23, 2015
  • Latest release: Feb 17, 2020
  • Number of updates: 28
  • Update frequency: every 59.9 days
  • Top authors: khairulalamruet (100%)

Code review

54 tests

User reviews

6 reviews

Install metrics

10+ active / 5,617 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
Install script ran successfully

Server metrics [RAM: ▲0.00MB] [CPU: ▼5.83ms] Passed 4 tests

Analyzing server-side resources used by TWI Woocommerce Grid/Slider/Carousel Lite
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0034.78 ▼10.49
Dashboard /wp-admin3.31 ▲0.0144.18 ▼2.97
Posts /wp-admin/edit.php3.37 ▲0.0149.02 ▲4.05
Add New Post /wp-admin/post-new.php5.90 ▲0.0186.12 ▼11.03
Media Library /wp-admin/upload.php3.24 ▲0.0034.21 ▲1.19

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

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

Browser metrics Passed 4 tests

This is an overview of browser requirements for TWI Woocommerce Grid/Slider/Carousel Lite
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,809 ▲6314.47 ▲0.111.56 ▼0.4338.17 ▲0.65
Dashboard /wp-admin2,215 ▲244.84 ▼0.05108.21 ▲5.1740.85 ▼5.84
Posts /wp-admin/edit.php2,098 ▲91.97 ▼0.0940.03 ▼1.6838.31 ▼1.02
Add New Post /wp-admin/post-new.php1,542 ▲823.04 ▲0.28588.10 ▲15.0249.28 ▲1.72
Media Library /wp-admin/upload.php1,397 ▲64.24 ▼0.0294.03 ▼13.9044.14 ▼0.08

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-comments
    • db_upgraded
    • widget_recent-posts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please take a closer look at the following
  • 133× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Warning
      Use of undefined constant VP_PUBLIC_URL - assumed 'VP_PUBLIC_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/twi-woocommerce-gridslidercarousel-lite/inc/config/dependencies.php on line 32
    • > PHP Notice
      Undefined variable: is_compact in wp-content/plugins/twi-woocommerce-gridslidercarousel-lite/inc/views/control/date.php on line 1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function untrailingslashit() in wp-content/plugins/twi-woocommerce-gridslidercarousel-lite/inc/constant.php:11
    • > PHP Notice
      Undefined variable: type in wp-content/plugins/twi-woocommerce-gridslidercarousel-lite/inc/views/control/template_control_head.php on line 1
    • > PHP Fatal error
      Uncaught Error: Call to a member function get_title() on null in wp-content/plugins/twi-woocommerce-gridslidercarousel-lite/inc/views/option/set.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/twi-woocommerce-gridslidercarousel-lite/lang.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/twi-woocommerce-gridslidercarousel-lite/inc/views/option/impexp.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function vp_metabox() in wp-content/plugins/twi-woocommerce-gridslidercarousel-lite/template/variables/variables.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/twi-woocommerce-gridslidercarousel-lite/inc/includes/wpalchemy/MetaBox.php:22
    • > PHP Notice
      Undefined variable: is_compact in wp-content/plugins/twi-woocommerce-gridslidercarousel-lite/inc/views/control/radiobutton.php on line 1

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
No browser issues were found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
5 plugin tags: woocommerce slider, woocommerce grid, woocommerce product slider, woocommerce carousel, woocommerce product carousel

twi-woocommerce-gridslidercarousel-lite/twi-awesome-woocommerce-slider-carousel-free.php 92% from 13 tests

The main PHP file in "TWI Woocommerce Grid/Slider/Carousel Lite" ver. 2.0.0 adds more information about the plugin and also serves as the entry point for this plugin
You should first fix the following items:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("twi-woocommerce-gridslidercarousel-lite.php" instead of "twi-awesome-woocommerce-slider-carousel-free.php")

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Everything looks great! No dangerous files found in this plugin17,018 lines of code in 171 files:
LanguageFilesBlank linesComment linesLines of code
PHP1012,1062,3759,716
JavaScript494442912,973
CSS15521582,816
SVG200979
PO File12081,347444
Markdown231089
JSON1001

PHP code 50% from 2 tests

An overview of cyclomatic complexity and code structure
Please tend to the following items
  • Method cyclomatic complexity should be reduced to less than 100 (currently 102)
Cyclomatic complexity
Average complexity per logical line of code0.43
Average class complexity21.40
▷ Minimum class complexity1.00
▷ Maximum class complexity272.00
Average method complexity3.37
▷ Minimum method complexity1.00
▷ Maximum method complexity102.00
Code structure
Namespaces0
Interfaces2
Traits0
Classes56
▷ Abstract classes47.14%
▷ Concrete classes5292.86%
▷ Final classes00.00%
Methods505
▷ Static methods8917.62%
▷ Public methods47293.47%
▷ Protected methods193.76%
▷ Private methods142.77%
Functions39
▷ Named functions39100.00%
▷ Anonymous functions00.00%
Constants38
▷ Global constants3592.11%
▷ Class constants37.89%
▷ Public constants3100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
27 PNG files occupy 0.50MB with 0.22MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
inc/public/css/vendor/jqueryui/themes/smoothness/images/ui-bg_flat_75_ffffff_40x100.png0.17KB0.08KB▼ 51.12%
inc/public/img/vp_shortcode_icon.png1.13KB0.18KB▼ 84.22%
inc/public/img/bootstrap-colorpicker/hue.png2.90KB0.50KB▼ 82.71%
inc/public/css/vendor/jqueryui/themes/smoothness/images/ui-icons_888888_256x240.png4.27KB4.11KB▼ 3.78%
inc/public/css/vendor/jqueryui/themes/smoothness/images/ui-bg_glass_75_dadada_1x400.png0.11KB0.16KB0.00%