83% review-for-discount

Code Review | Review for Discount for WooCommerce

WordPress plugin Review for Discount for WooCommerce scored83%from 54 tests.

About plugin

  • Plugin page: review-for-discount
  • Plugin version: 1.0.3
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.3
  • WordPress version: 6.3.1
  • First release: Nov 12, 2021
  • Latest release: Oct 6, 2023
  • Number of updates: 11
  • Update frequency: every 64.6 days
  • Top authors: xfinitysoft (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

50+ active /871 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
This plugin's installer ran successfully

Server metrics [RAM: ▼0.01MB] [CPU: ▼9.76ms] Passed 4 tests

A check of server-side resources used by Review for Discount for WooCommerce
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0051.29 ▲13.25
Dashboard /wp-admin3.31 ▼0.0443.07 ▼16.45
Posts /wp-admin/edit.php3.36 ▲0.0045.46 ▼5.68
Add New Post /wp-admin/post-new.php5.89 ▲0.0088.88 ▼14.97
Media Library /wp-admin/upload.php3.23 ▲0.0033.75 ▼1.93

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

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

Browser metrics Passed 4 tests

A check of browser resources used by Review for Discount for WooCommerce
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.38 ▲0.021.81 ▲0.2143.18 ▲0.76
Dashboard /wp-admin2,195 ▲155.53 ▼0.0582.76 ▼4.9237.47 ▼4.71
Posts /wp-admin/edit.php2,103 ▲32.04 ▲0.0835.32 ▼4.4833.06 ▼10.81
Add New Post /wp-admin/post-new.php1,535 ▲918.23 ▼4.80590.11 ▼36.6059.97 ▲2.66
Media Library /wp-admin/upload.php1,400 ▲34.18 ▼0.0095.19 ▼7.7040.40 ▼3.93

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • can_compress_scripts
    • theysaidso_admin_options
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-posts
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Good news, no errors were detected

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
  • 4× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/review-for-discount/admin/partials/wc-review-discounts-support.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function settings_fields() in wp-content/plugins/review-for-discount/admin/partials/wc-review-discounts-admin-settings.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function sanitize_text_field() in wp-content/plugins/review-for-discount/admin/partials/wc-review-discounts-admin-display.php:14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_nonce_field() in wp-content/plugins/review-for-discount/admin/partials/wc-review-discounts-meta-box.php:1

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
There were no browser issues found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
5 plugin tags: customer reviews, discount coupons, review for discount, product review, email for discounts

review-for-discount/review-for-review.php 77% from 13 tests

This is the main PHP file of "Review for Discount for WooCommerce" version 1.0.3, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
Please make the necessary changes and fix the following:
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("review-for-discount.php" instead of "review-for-review.php")
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 309 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
There were no executable files found in this plugin1,802 lines of code in 17 files:
LanguageFilesBlank linesComment linesLines of code
PHP131605061,462
CSS2116174
JavaScript251166

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.41
Average class complexity16.14
▷ Minimum class complexity1.00
▷ Maximum class complexity52.00
Average method complexity4.03
▷ Minimum method complexity1.00
▷ Maximum method complexity37.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods35
▷ Static methods25.71%
▷ Public methods3085.71%
▷ Protected methods00.00%
▷ Private methods514.29%
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

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
PNG images were not found in this plugin