83% az-product-slider-for-woocommerce

Code Review | AZ Product Slider For WooCommerce

WordPress plugin AZ Product Slider For WooCommerce scored83%from 54 tests.

About plugin

  • Plugin page: az-product-slider...
  • Plugin version: 1.0.5
  • PHP compatiblity: 4.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-5.4
  • WordPress version: 6.3.1
  • First release: Dec 9, 2019
  • Latest release: May 19, 2020
  • Number of updates: 13
  • Update frequency: every 12.5 days
  • Top authors: azplugins (100%)

Code review

54 tests

User reviews

1 review

Install metrics

30+ active /914 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.28MB] [CPU: ▼2.93ms] Passed 4 tests

Analyzing server-side resources used by AZ Product Slider For WooCommerce
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.67 ▲0.2041.46 ▲0.18
Dashboard /wp-admin3.68 ▲0.3751.77 ▲2.71
Posts /wp-admin/edit.php3.73 ▲0.3754.96 ▲6.42
Add New Post /wp-admin/post-new.php6.17 ▲0.2884.05 ▼20.13
Media Library /wp-admin/upload.php3.51 ▲0.2840.38 ▲5.51
AZ Product Options /wp-admin/admin.php?page=azpswc_options3.5136.78

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

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 22 new files
Database: no new tables, 7 new options
New WordPress options
can_compress_scripts
azpswc_settings_styling
widget_recent-comments
db_upgraded
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-posts

Browser metrics Passed 4 tests

This is an overview of browser requirements for AZ Product Slider For WooCommerce
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,070 ▲32415.26 ▲0.835.71 ▲4.1140.35 ▲1.39
Dashboard /wp-admin2,383 ▲2096.60 ▲1.72138.81 ▲32.1941.38 ▼1.90
Posts /wp-admin/edit.php2,291 ▲2023.65 ▲1.6753.38 ▲11.5830.81 ▼4.35
Add New Post /wp-admin/post-new.php1,544 ▲1123.43 ▲0.28652.78 ▲14.5536.28 ▼20.35
Media Library /wp-admin/upload.php1,422 ▲314.41 ▲0.1485.36 ▼20.4943.68 ▼1.49
AZ Product Options /wp-admin/admin.php?page=azpswc_options3,6084.48161.4331.16

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 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
  • Zombie WordPress options detected upon uninstall: 7 options
    • widget_recent-comments
    • db_upgraded
    • theysaidso_admin_options
    • azpswc_settings_styling
    • can_compress_scripts
    • widget_recent-posts
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

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

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
Please take a closer look at the following
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Class 'AZPSWC_Settings_API' not found in wp-content/plugins/az-product-slider-for-woocommerce/admin/plugin-options.php:12

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine on the user side

Optimizations

Plugin configuration 90% 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
4 plugin tags: featured product, woocommerce, product carousel, product slider

az-product-slider-for-woocommerce/plugin-main.php 77% from 13 tests

The main file in "AZ Product Slider For WooCommerce" v. 1.0.5 serves as a complement to information provided in readme.txt and as the entry point to the plugin
It is important to fix the following:
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("az-product-slider-for-woocommerce.php" instead of "plugin-main.php")
  • Description: The description should be shorter than 140 characters (currently 215 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Everything looks great! No dangerous files found in this plugin6,335 lines of code in 14 files:
LanguageFilesBlank linesComment linesLines of code
SVG1044,663
PHP51922351,229
CSS6817366
JavaScript21477

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.32
Average class complexity36.00
▷ Minimum class complexity3.00
▷ Maximum class complexity69.00
Average method complexity2.40
▷ Minimum method complexity1.00
▷ Maximum method complexity8.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods36
▷ Static methods00.00%
▷ Public methods36100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions12
▷ Named functions1191.67%
▷ Anonymous functions18.33%
Constants3
▷ Global constants3100.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
There were not PNG files found in your plugin