84% wc-return-products

Code Review | WC return products

WordPress plugin WC return products scored84%from 54 tests.

About plugin

  • Plugin page: wc-return-products
  • Plugin version: 1.0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.8
  • WordPress version: 6.3.1
  • First release: Aug 3, 2017
  • Latest release: Aug 7, 2017
  • Number of updates: 10
  • Update frequency: every 2.0 days
  • Top authors: wcexperts (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,794 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: ▼2.84ms] Passed 4 tests

A check of server-side resources used by WC return products
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0037.26 ▼8.56
Dashboard /wp-admin3.31 ▲0.0054.39 ▲0.80
Posts /wp-admin/edit.php3.36 ▲0.0049.42 ▲1.05
Add New Post /wp-admin/post-new.php5.89 ▲0.0096.50 ▼2.72
Media Library /wp-admin/upload.php3.23 ▲0.0035.16 ▼0.88

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

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 6 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
widget_recent-comments
can_compress_scripts
widget_recent-posts
theysaidso_admin_options
widget_theysaidso_widget

Browser metrics Passed 4 tests

A check of browser resources used by WC return products
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,814 ▲2814.37 ▼0.002.11 ▼0.0642.34 ▲0.13
Dashboard /wp-admin2,195 ▲185.65 ▼0.0290.83 ▼12.4041.43 ▼3.17
Posts /wp-admin/edit.php2,100 ▲32.04 ▼0.0040.23 ▼0.8635.00 ▲0.02
Add New Post /wp-admin/post-new.php1,526 ▼017.70 ▲0.02650.65 ▲29.9473.27 ▲19.70
Media Library /wp-admin/upload.php1,400 ▼04.18 ▼0.09106.26 ▼2.1144.40 ▼0.58

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
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_recent-comments
    • widget_recent-posts
    • db_upgraded
    • widget_theysaidso_widget
    • can_compress_scripts
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though no errors were found, this is by no means 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 fix the following items
  • 3× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to a member function get_items() on null in wp-content/plugins/wc-return-products/includes/html-wc-return-form-template.php:185
    • > PHP Fatal error
      Uncaught Error: Call to undefined function apply_filters() in wp-content/plugins/wc-return-products/return-product.php:14
    • > PHP Notice
      Undefined variable: order in wp-content/plugins/wc-return-products/includes/html-wc-return-form-template.php on line 185

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser issues were found

Optimizations

Plugin configuration 96% 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
5 plugin tags: woocommerce return order, return product, woocommerce, order, return order

wc-return-products/return-product.php 92% from 13 tests

The primary PHP file in "WC return products" version 1.0.1 is used by WordPress to initiate all plugin functionality
It is important to fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("wc-return-products.php" instead of "return-product.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
No dangerous file extensions were detected387 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
PHP43220384
CSS1003

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.33
Average class complexity4.33
▷ Minimum class complexity2.00
▷ Maximum class complexity7.00
Average method complexity2.11
▷ Minimum method complexity1.00
▷ Maximum method complexity5.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods9
▷ Static methods00.00%
▷ Public methods9100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.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