84% endroit-related-products-slider

Code Review | WC Related Products Slider By Endroit

WordPress plugin WC Related Products Slider By Endroit scored 84% from 54 tests.

About plugin

  • Plugin page: endroit-related-p...
  • Plugin version: 2.0.2
  • PHP compatiblity: 5.2.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-5.4
  • WordPress version: 5.8.1
  • First release: Jun 10, 2020
  • Latest release: Jul 19, 2020
  • Number of updates: 12
  • Update frequency: every 3.3 days
  • Top authors: pawansahai (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 232 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▼0.26MB] [CPU: ▼155.09ms] Passed 4 tests

This is a short check of server-side resources used by WC Related Products Slider By Endroit
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /1.77 ▼1.065.73 ▼31.27
Dashboard /wp-admin3.07 ▲0.0249.88 ▼5.68
Posts /wp-admin/edit.php3.13 ▲0.0249.25 ▼0.59
Add New Post /wp-admin/post-new.php5.43 ▼0.0094.92 ▼581.39
Media Library /wp-admin/upload.php3.02 ▲0.0234.26 ▼2.01
Related Products /wp-admin/admin.php?page=endroit_related_products3.0133.67

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

Input-output and database impact of this plugin
This plugin installed successfully
Filesystem: 17 new files
Database: no new tables, 1 new option
New WordPress options
endroit_related_products_data

Browser metrics Passed 4 tests

Checking browser requirements for WC Related Products Slider By Endroit
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,799 ▲22716.37 ▲0.8218.53 ▼4.8146.79 ▼8.95
Dashboard /wp-admin2,973 ▲395.93 ▼0.04142.39 ▼15.5397.34 ▼16.32
Posts /wp-admin/edit.php2,736 ▼32.72 ▼0.0065.49 ▼16.2594.51 ▲6.36
Add New Post /wp-admin/post-new.php1,498 ▼2,14818.83 ▲0.72405.30 ▼135.79108.39 ▲1.66
Media Library /wp-admin/upload.php1,807 ▼05.05 ▲0.02164.71 ▼15.00119.61 ▲2.25
Related Products /wp-admin/admin.php?page=endroit_related_products1,2212.7466.3377.45

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • Zombie WordPress options were found after uninstall: 1 option
    • endroit_related_products_data

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 | 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
  • 2× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Class 'ENDROIT_RelatedProductsFrontend' not found in wp-content/plugins/endroit-related-products-slider/frontend/templates/endroit-related-products.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function menu_page_url() in wp-content/plugins/endroit-related-products-slider/admin/class.endroit-related-products-admin.php:10

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
There were no browser issues found

Optimizations

Plugin configuration 93% 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
4 plugin tags: related by tag, related products, product slider, related by category

endroit-related-products-slider/endroit-related-products.php 85% from 13 tests

"WC Related Products Slider By Endroit" version 2.0.2's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
You should first fix the following items:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("endroit-related-products-slider.php" instead of "endroit-related-products.php")
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug

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
Everything looks great! No dangerous files found in this plugin594 lines of code in 14 files:
LanguageFilesBlank linesComment linesLines of code
PHP65780332
CSS4151219
JavaScript41643

PHP code Passed 2 tests

Analyzing 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.22
Average class complexity3.75
▷ Minimum class complexity1.00
▷ Maximum class complexity7.00
Average method complexity1.92
▷ Minimum method complexity1.00
▷ Maximum method complexity4.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods12
▷ Static methods00.00%
▷ Public methods1083.33%
▷ Protected methods216.67%
▷ Private methods00.00%
Functions6
▷ Named functions6100.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants4100.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
2 compressed PNG files occupy 0.00MB
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/delete-icon.png1.27KB1.39KB0.00%
assets/images/add-icon.png1.48KB1.57KB0.00%