71% gs-woocommerce-products-slider

Code Review | GS Products Slider for WooCommerce

WordPress plugin GS Products Slider for WooCommerce scored71%from 54 tests.

About plugin

  • Plugin page: gs-woocommerce-pr...
  • Plugin version: 1.6.1
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 2.6-6.3
  • WordPress version: 6.3.1
  • First release: Sep 20, 2017
  • Latest release: Aug 31, 2023
  • Number of updates: 53
  • Update frequency: every 41.0 days
  • Top authors: samdani (100%)

Code review

54 tests

User reviews

7 reviews

Install metrics

300+ active /23,034 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
This plugin's installer ran successfully

Server metrics [RAM: ▲0.72MB] [CPU: ▲2.40ms] 75% from 4 tests

Analyzing server-side resources used by GS Products Slider for WooCommerce
Please have a look at the following items
  • CPU: Total CPU usage should be kept under 500.00ms (currently 648.99ms on /wp-admin/edit.php?post_type=gs_wps_cpt&page=gs-wcps-plugins-premium)
PageMemory (MB)CPU Time (ms)
Home /4.16 ▲0.7048.81 ▲7.96
Dashboard /wp-admin4.08 ▲0.7762.36 ▲10.44
Posts /wp-admin/edit.php4.11 ▲0.7566.34 ▲14.94
Add New Post /wp-admin/post-new.php6.84 ▲0.9584.39 ▼21.24
Media Library /wp-admin/upload.php3.91 ▲0.6849.29 ▲12.43
GS Plugins Lite /wp-admin/edit.php?post_type=gs_wps_cpt&page=gs-wcps-plugins-lite4.19700.65
GS Plugins Pro /wp-admin/edit.php?post_type=gs_wps_cpt&page=gs-wcps-plugins-premium4.08648.99
Woo Product Slider /wp-admin/admin.php?page=wooproduct-settings3.9150.44
Help & Usage /wp-admin/edit.php?post_type=gs_wps_cpt&page=gs-wcps-plugins-help3.9147.41
Add New Product Shortcode /wp-admin/post-new.php?post_type=gs_wps_cpt4.0350.09
Generate Shortcode /wp-admin/edit.php?post_type=gs_wps_cpt4.0466.28

Server storage [IO: ▲0.83MB] [DB: ▲0.05MB] Passed 3 tests

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

Browser metrics Passed 4 tests

A check of browser resources used by GS Products Slider for WooCommerce
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,411 ▲66521.70 ▲7.05168.79 ▲166.9835.72 ▼4.50
Dashboard /wp-admin2,471 ▲2837.01 ▲2.12130.79 ▲29.21110.82 ▲67.76
Posts /wp-admin/edit.php2,394 ▲3053.60 ▲1.5961.48 ▲21.5686.36 ▲51.40
Add New Post /wp-admin/post-new.php6,391 ▲4,84928.09 ▲9.65926.11 ▲253.7145.24 ▼28.24
Media Library /wp-admin/upload.php1,534 ▲1494.99 ▲0.89101.42 ▼15.6476.03 ▲28.29
GS Plugins Lite /wp-admin/edit.php?post_type=gs_wps_cpt&page=gs-wcps-plugins-lite2,7713.7963.78119.60
GS Plugins Pro /wp-admin/edit.php?post_type=gs_wps_cpt&page=gs-wcps-plugins-premium2,4303.6444.56103.34
Woo Product Slider /wp-admin/admin.php?page=wooproduct-settings2,6586.60158.97126.43
Help & Usage /wp-admin/edit.php?post_type=gs_wps_cpt&page=gs-wcps-plugins-help1,1723.6844.0742.59
Add New Product Shortcode /wp-admin/post-new.php?post_type=gs_wps_cpt2,1474.6682.4531.08
Generate Shortcode /wp-admin/edit.php?post_type=gs_wps_cpt1,3103.4749.7026.80

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
You still need to fix the following
  • This plugin does not fully uninstall, leaving 8 options in the database
    • widget_recent-comments
    • widget_theysaidso_widget
    • can_compress_scripts
    • gs_wps_general
    • db_upgraded
    • gs_wps_style
    • widget_recent-posts
    • theysaidso_admin_options

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Smoke test failed, please fix the following
  • 6 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=gs_wps_cpt
    • > Notice in wp-content/plugins/gs-woocommerce-products-slider/gswps-files/gs-wps-metabox.php+102
    Trying to get property 'slug' of non-object
  • 6 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=gs_wps_cpt
    • > Notice in wp-content/plugins/gs-woocommerce-products-slider/gswps-files/gs-wps-metabox.php+102
    Trying to get property 'name' of non-object

SRP 50% 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
  • 8× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'GS_wps_WeDevs_Settings_API' not found in wp-content/plugins/gs-woocommerce-products-slider/gswps-files/gswps-admin/gs_wps_options_config.php:19
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/gs-woocommerce-products-slider/gswps-files/gs-wps-metabox.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/gs-woocommerce-products-slider/gswps-files/gs-common-pages/gs-wcps-common-pages.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/gs-woocommerce-products-slider/gswps-files/gs-wps-media-button.php:29
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/gs-woocommerce-products-slider/gswps-files/gs-wps-cpt.php:53
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/gs-woocommerce-products-slider/gs-woocommerce-products-slider.php:25
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_image_size() in wp-content/plugins/gs-woocommerce-products-slider/gswps-files/gs-wps-shortcode.php:15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/gs-woocommerce-products-slider/gswps-files/gs-wps-script.php:14

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Please fix the following browser errors
    • > GET request to /wp-admin/admin.php?page=wooproduct-settings
    • > Security (warning) in unknown
    security - Error with Permissions-Policy header: Unrecognized feature: 'ambient-light-sensor'.
    • > GET request to /wp-admin/admin.php?page=wooproduct-settings
    • > Security (warning) in unknown
    security - Error with Permissions-Policy header: Unrecognized feature: 'bluetooth'.

Optimizations

Plugin configuration 86% from 29 tests

readme.txt 94% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
These attributes need your attention:
  • Tags: There are too many tags (37 tag instead of maximum 10)
You can take inspiration from this readme.txt

gs-woocommerce-products-slider/gs-woocommerce-products-slider.php 77% from 13 tests

"GS Products Slider for WooCommerce" version 1.6.1's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
The following require your attention:
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug
  • Requires at least: Required version must match the one declared in readme.txt ("4.3" instead of "2.6")
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 261 characters long)

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
No dangerous file extensions were detected6,411 lines of code in 38 files:
LanguageFilesBlank linesComment linesLines of code
PHP168539213,467
CSS10170521,886
Sass11016521
JavaScript913195515
JSON10021
SVG1001

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.41
Average class complexity36.71
▷ Minimum class complexity3.00
▷ Maximum class complexity70.00
Average method complexity2.69
▷ Minimum method complexity1.00
▷ Maximum method complexity10.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods138
▷ Static methods10.72%
▷ Public methods10475.36%
▷ Protected methods64.35%
▷ Private methods2820.29%
Functions46
▷ Named functions4597.83%
▷ Anonymous functions12.17%
Constants7
▷ Global constants7100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
1 PNG file occupies 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
gswps-files/gswps-admin/img/icon-128x128.png5.02KB2.84KB▼ 43.50%