93% wc-return-product

Code Review | WC Return products

WordPress plugin WC Return products scored 93% from 54 tests.

About plugin

  • Plugin page: wc-return-product
  • Plugin version: 1.5
  • PHP version: 7.4.16
  • WordPress compatibility: 3.8.1-4.7.3
  • WordPress version: 5.8.1
  • First release: Jun 4, 2015
  • Latest release: Mar 12, 2017
  • Number of updates: 44
  • Update frequency: every 14.8 days
  • Top authors: pco_58 (100%)

Code review

54 tests

User reviews

8 reviews

Install metrics

200+ active / 7,722 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed gracefully, with no errors

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

A check of server-side resources used by WC Return products
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /2.84 ▲0.1234.44 ▲13.29
Dashboard /wp-admin3.06 ▲0.0043.27 ▲4.41
Posts /wp-admin/edit.php3.11 ▲0.0043.46 ▼0.47
Add New Post /wp-admin/post-new.php5.42 ▼0.0287.13 ▼564.28
Media Library /wp-admin/upload.php3.00 ▲0.0030.24 ▼2.08

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

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 20 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

A check of browser resources used by WC Return products
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,703 ▲10715.76 ▲0.2710.22 ▲0.5247.50 ▼4.08
Dashboard /wp-admin2,992 ▲585.91 ▼0.16136.48 ▼2.04103.98 ▼13.51
Posts /wp-admin/edit.php2,736 ▼32.68 ▼0.0165.53 ▼4.0190.72 ▲1.90
Add New Post /wp-admin/post-new.php1,504 ▼55318.56 ▼0.78350.11 ▼19.48106.57 ▼0.88
Media Library /wp-admin/upload.php1,810 ▲35.01 ▼0.00167.21 ▲27.96117.94 ▲1.87

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
Uninstaller ran successfully

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 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please fix the following items
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/wc-return-product/includes/wc_functions.php:25

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
These attributes need your attention:
  • Plugin Name: Write the name of your plugin instead of "Plugin Name" on the first line ( === wc-return-product === )
The official readme.txt is a good inspiration

wc-return-product/wc_return_product.php 85% from 13 tests

Analyzing the main PHP file in "WC Return products" version 1.5
It is important to fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("wc-return-product.php" instead of "wc_return_product.php")
  • Text Domain: Please use dashes and lowercase characters for text domains

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
There were no executable files found in this plugin900 lines of code in 12 files:
LanguageFilesBlank linesComment linesLines of code
PHP69073560
PO File576147254
JavaScript114886

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.32
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions15
▷ Named functions15100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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 PNG files occupy 0.16MB with 0.11MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/screenshot-1.png162.00KB48.29KB▼ 70.19%
assets/CustomOrderStatus.png1.95KB0.74KB▼ 61.99%