78% wcf-smart-coupon-email

Code Review | WCF Smart Coupon Email

WordPress plugin WCF Smart Coupon Email scored78%from 54 tests.

About plugin

  • Plugin page: wcf-smart-coupon-...
  • Plugin version: 1.0
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: Jun 14, 2022
  • Latest release: Jun 22, 2022
  • Number of updates: 9
  • Update frequency: every 0.9 days
  • Top authors: wecode123 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /885 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
This plugin's installer ran successfully

Server metrics [RAM: ▲0.06MB] [CPU: ▼0.38ms] Passed 4 tests

An overview of server-side resources used by WCF Smart Coupon Email
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.52 ▲0.0644.30 ▲4.90
Dashboard /wp-admin3.37 ▲0.0652.41 ▼1.06
Posts /wp-admin/edit.php3.42 ▲0.0647.89 ▲0.96
Add New Post /wp-admin/post-new.php5.97 ▲0.0885.83 ▼2.18
Media Library /wp-admin/upload.php3.29 ▲0.0638.26 ▲0.75
WCF Smart Coupon /wp-admin/admin.php?page=wcf-smart-coupon-email3.2733.23
Logs Report /wp-admin/admin.php?page=wcf-smart-coupon-logs3.2630.43

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

Analyzing filesystem and database footprints of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 29 new files
Database: 3 new tables, 6 new options
New tables
wp_wcf_orderdata
wp_wcf_userdata
wp_wcf_cooa_logs
New WordPress options
db_upgraded
widget_recent-posts
widget_recent-comments
widget_theysaidso_widget
theysaidso_admin_options
can_compress_scripts

Browser metrics Passed 4 tests

WCF Smart Coupon Email: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,847 ▲11213.60 ▼0.781.77 ▼0.1345.97 ▼3.09
Dashboard /wp-admin2,250 ▲595.33 ▲0.42109.91 ▼4.6838.17 ▼8.58
Posts /wp-admin/edit.php2,136 ▲442.50 ▲0.4440.35 ▲2.7033.57 ▼4.25
Add New Post /wp-admin/post-new.php1,723 ▲18925.42 ▲2.32594.81 ▼88.9834.28 ▼27.02
Media Library /wp-admin/upload.php1,508 ▲1204.67 ▲0.5187.40 ▼17.5838.27 ▼12.91
WCF Smart Coupon /wp-admin/admin.php?page=wcf-smart-coupon-email1,0232.0727.6624.38
Logs Report /wp-admin/admin.php?page=wcf-smart-coupon-logs9752.8341.7024.64

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
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-posts
    • widget_recent-comments
    • db_upgraded
    • can_compress_scripts
    • widget_theysaidso_widget
    • theysaidso_admin_options

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Good news, no errors were detected

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 fix the following items
  • 7× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_activation_hook() in wp-content/plugins/wcf-smart-coupon-email/wcf_smart_coupon_email.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/wcf-smart-coupon-email/min_amnt_log.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function update_option() in wp-content/plugins/wcf-smart-coupon-email/template/coupon_template1.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function update_option() in wp-content/plugins/wcf-smart-coupon-email/template/coupon_template2.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/wcf-smart-coupon-email/order_amount_form.php:31
    • > PHP Fatal error
      Uncaught Error: Call to undefined function update_option() in wp-content/plugins/wcf-smart-coupon-email/template/coupon_template3.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/wcf-smart-coupon-email/order_amount_form.php:31

User-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Please fix the following browser errors
    • > GET request to /wp-admin/admin.php?page=wcf-smart-coupon-logs
    • > Network (severe)
    wp-content/plugins/wcf-smart-coupon-email/asset/images/sort_both.png - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/admin.php?page=wcf-smart-coupon-logs
    • > Network (severe)
    wp-content/plugins/wcf-smart-coupon-email/asset/images/sort_asc.png - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
3 plugin tags: woocommerce coupon, email coupons, coupon email

wcf-smart-coupon-email/wcf_smart_coupon_email.php 92% from 13 tests

The principal PHP file in "WCF Smart Coupon Email" v. 1.0 is loaded by WordPress automatically on each request
It is important to fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("wcf-smart-coupon-email.php" instead of "wcf_smart_coupon_email.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Good job! No executable or dangerous file extensions detected17,629 lines of code in 14 files:
LanguageFilesBlank linesComment linesLines of code
CSS41,747639,973
JavaScript32,0046,8556,487
PHP7236271,169

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.07
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%
Functions13
▷ Named functions13100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
13 PNG files occupy 0.32MB with 0.21MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
template/images/image-17.png135.20KB57.63KB▼ 57.38%
template/images/image-2.png2.22KB0.79KB▼ 64.69%
template/images/image-13.png6.59KB2.73KB▼ 58.63%
template/images/image-5.png5.03KB1.42KB▼ 71.74%
template/images/image-4.png73.49KB15.74KB▼ 78.58%