84% next-purchase-discount-for-woocommerce

Code Review | Next Purchase Discount for WooCommerce

WordPress plugin Next Purchase Discount for WooCommerce scored 84% from 54 tests.

About plugin

  • Plugin page: next-purchase-dis...
  • Plugin version: 1.0.1
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.1-5.2.2
  • WordPress version: 6.3.1
  • First release: Sep 8, 2019
  • Latest release: Sep 8, 2019
  • Number of updates: 3
  • Update frequency: every 2.3 days
  • Top authors: laszlomdrsz (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 480 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 successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.02MB] [CPU: ▼5.35ms] Passed 4 tests

Analyzing server-side resources used by Next Purchase Discount for WooCommerce
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0235.50 ▼3.74
Dashboard /wp-admin3.32 ▲0.0245.96 ▼5.83
Posts /wp-admin/edit.php3.37 ▲0.0247.41 ▲0.16
Add New Post /wp-admin/post-new.php5.90 ▲0.0282.31 ▼10.97
Media Library /wp-admin/upload.php3.24 ▲0.0233.93 ▼0.84

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

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 6 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
db_upgraded
widget_recent-posts
widget_recent-comments
can_compress_scripts
widget_theysaidso_widget

Browser metrics Passed 4 tests

This is an overview of browser requirements for Next Purchase Discount for WooCommerce
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,818 ▲6113.25 ▼1.191.78 ▼0.2140.91 ▲1.90
Dashboard /wp-admin2,222 ▲314.85 ▼0.03110.33 ▲5.1941.26 ▼2.09
Posts /wp-admin/edit.php2,108 ▲192.05 ▲0.0439.32 ▲4.1234.00 ▲2.23
Add New Post /wp-admin/post-new.php1,546 ▲1122.88 ▼0.30644.08 ▼40.6552.47 ▼23.45
Media Library /wp-admin/upload.php1,401 ▲134.17 ▼0.0699.34 ▼17.5844.22 ▼4.67

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 detected upon uninstall: 6 options
    • can_compress_scripts
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
The smoke test was a success, however most plugin functionality was not tested

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please fix the following
  • 3× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/next-purchase-discount-for-woocommerce/settings.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/next-purchase-discount-for-woocommerce/function.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/next-purchase-discount-for-woocommerce/display.php:6

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
7 plugin tags: bonus, reward, woocommerce, loyalty, discount...

next-purchase-discount-for-woocommerce/next-purchase-discount-for-woocommerce.php 92% from 13 tests

"Next Purchase Discount for WooCommerce" version 1.0.1's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
Please make the necessary changes and fix the following:
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
No dangerous file extensions were detected278 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
PHP411548276
CSS1102

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.16
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%
Functions27
▷ Named functions27100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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