94% woo-coupon-duplicator

Code Review | WooCommerce Coupon Duplicator

WordPress plugin WooCommerce Coupon Duplicator scored 94% from 54 tests.

About plugin

  • Plugin page: woo-coupon-duplic...
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress version: 5.8.1
  • First release: Feb 27, 2017
  • Latest release: Mar 1, 2017
  • Number of updates: 2
  • Update frequency: N/A
  • Top authors: antubis (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 356 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
This plugin's installer ran successfully

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

Analyzing server-side resources used by WooCommerce Coupon Duplicator
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /2.84 ▲0.1234.83 ▲14.25
Dashboard /wp-admin3.06 ▲0.0144.98 ▼3.23
Posts /wp-admin/edit.php3.11 ▲0.0145.73 ▲0.03
Add New Post /wp-admin/post-new.php5.42 ▼0.0188.49 ▼564.51
Media Library /wp-admin/upload.php3.00 ▲0.0032.08 ▼5.44

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

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 9 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

WooCommerce Coupon Duplicator: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,689 ▲5215.84 ▲0.217.71 ▼5.7644.72 ▼1.08
Dashboard /wp-admin2,979 ▲455.95 ▲0.02144.66 ▼8.96107.97 ▼0.60
Posts /wp-admin/edit.php2,751 ▲122.72 ▲0.0062.64 ▼5.3685.78 ▼7.35
Add New Post /wp-admin/post-new.php1,506 ▼10918.58 ▼2.83390.53 ▲96.82107.57 ▲2.95
Media Library /wp-admin/upload.php1,817 ▲75.04 ▲0.02163.49 ▲16.73118.28 ▼6.23

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
This plugin's uninstaller ran successfully

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
The smoke test was a success, however most plugin functionality was not tested

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
The following issues need your attention
  • 5× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Class 'AbstractExecutor' not found in wp-content/plugins/woo-coupon-duplicator/inc/executors/default.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'AbstractExecutor' not found in wp-content/plugins/woo-coupon-duplicator/inc/executors/mailchimp.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/woo-coupon-duplicator/actions.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/woo-coupon-duplicator/settings.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function apply_filters() in wp-content/plugins/woo-coupon-duplicator/woo-coupon-duplicator.php:15

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser issues were found

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
3 plugin tags: coupon, woocommerce, duplicate

woo-coupon-duplicator/woo-coupon-duplicator.php Passed 13 tests

The main file in "WooCommerce Coupon Duplicator" v. 1.0.0 serves as a complement to information provided in readme.txt and as the entry point to the plugin
97 characters long description:
Use pre-existing WooCommerce/Wordpress events to trigger coupon duplication and execute an action

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
There were no executable files found in this plugin297 lines of code in 8 files:
LanguageFilesBlank linesComment linesLines of code
PHP89446297

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.28
Average class complexity4.20
▷ Minimum class complexity1.00
▷ Maximum class complexity12.00
Average method complexity2.33
▷ Minimum method complexity1.00
▷ Maximum method complexity11.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes5
▷ Abstract classes120.00%
▷ Concrete classes480.00%
▷ Final classes00.00%
Methods14
▷ Static methods17.14%
▷ Public methods964.29%
▷ Protected methods17.14%
▷ Private methods428.57%
Functions8
▷ Named functions562.50%
▷ Anonymous functions337.50%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
No PNG files were detected