83% first-purchase-discount-for-woocommerce

Code Review | First Purchase Discount for WooCommerce - The Ultimate First Order Discount Promotion Solution

WordPress plugin First Purchase Discount for WooCommerce - The Ultimate First Order Discount Promotion Solution scored83%from 54 tests.

About plugin

  • Plugin page: first-purchase-di...
  • Plugin version: 1.0.0
  • PHP compatiblity: 5.6.20+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.8-5.7
  • WordPress version: 6.3.1
  • First release: Feb 23, 2020
  • Latest release: Mar 23, 2021
  • Number of updates: 7
  • Update frequency: every 56.9 days
  • Top authors: webwizardsdev (100%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active /1,415 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 gracefully, with no errors

Server metrics [RAM: ▲0.19MB] [CPU: ▼5.83ms] Passed 4 tests

An overview of server-side resources used by First Purchase Discount for WooCommerce - The Ultimate First Order Discount Promotion Solution
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0542.18 ▲1.43
Dashboard /wp-admin3.54 ▲0.2447.49 ▼0.49
Posts /wp-admin/edit.php3.66 ▲0.3045.70 ▼6.72
Add New Post /wp-admin/post-new.php6.12 ▲0.2485.13 ▼17.53
Media Library /wp-admin/upload.php3.47 ▲0.2438.61 ▲7.06

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 64 new files
Database: 1 new table, 6 new options
New tables
wp_woocommerce_first_purchase
New WordPress options
widget_recent-posts
can_compress_scripts
widget_theysaidso_widget
widget_recent-comments
theysaidso_admin_options
db_upgraded

Browser metrics Passed 4 tests

This is an overview of browser requirements for First Purchase Discount for WooCommerce - The Ultimate First Order Discount Promotion Solution
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,829 ▲7213.19 ▼1.211.68 ▼0.5943.34 ▼6.18
Dashboard /wp-admin2,239 ▲485.88 ▲0.82104.55 ▼2.5043.83 ▼0.82
Posts /wp-admin/edit.php2,118 ▲292.05 ▲0.0938.10 ▼6.1331.72 ▼6.74
Add New Post /wp-admin/post-new.php1,551 ▲3723.40 ▲5.80672.66 ▲42.8964.77 ▲16.16
Media Library /wp-admin/upload.php1,414 ▲234.29 ▲0.0992.82 ▼9.8641.33 ▼3.47

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The following items require your attention
  • This plugin does not fully uninstall, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_recent-posts
    • can_compress_scripts
    • widget_recent-comments
    • widget_theysaidso_widget
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
The smoke test was a success, however most plugin functionality was not tested

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 server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/first-purchase-discount-for-woocommerce/includes/templates/popup-display-template.php:8

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
These attributes need your attention:
  • Tags: You are using too many tags: 17 tag instead of maximum 10
You can look at the official readme.txt

first-purchase-discount-for-woocommerce/woocommerce-first-purchase-discount.php 85% from 13 tests

Analyzing the main PHP file in "First Purchase Discount for WooCommerce - The Ultimate First Order Discount Promotion Solution" version 1.0.0
The following require your attention:
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 158 characters long)
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("first-purchase-discount-for-woocommerce.php" instead of "woocommerce-first-purchase-discount.php")

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
Success! There were no dangerous files found in this plugin5,435 lines of code in 23 files:
LanguageFilesBlank linesComment linesLines of code
SVG40122,908
PHP92862121,329
CSS434427848
JavaScript4108129329
Markdown27021

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.08
Average class complexity6.17
▷ Minimum class complexity1.00
▷ Maximum class complexity15.00
Average method complexity1.53
▷ Minimum method complexity1.00
▷ Maximum method complexity7.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes6
▷ Abstract classes00.00%
▷ Concrete classes6100.00%
▷ Final classes00.00%
Methods57
▷ Static methods712.28%
▷ Public methods57100.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

All PNG images should be compressed to minimize bandwidth usage for end users
14 PNG files occupy 0.40MB with 0.25MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/assets/images/popupstyle2.png26.88KB9.41KB▼ 64.99%
includes/emails/images/bottom.png1.18KB0.41KB▼ 65.76%
includes/assets/images/backgroundblue.png47.09KB31.59KB▼ 32.92%
admin/assets/images/header-logo.png3.36KB0.95KB▼ 71.84%
includes/emails/images/top.png1.28KB0.33KB▼ 74.52%