90% magic-coupon

Code Review | Magic URL Coupon for WooCommerce

WordPress plugin Magic URL Coupon for WooCommerce scored90%from 54 tests.

About plugin

  • Plugin page: magic-coupon
  • Plugin version: 1.9
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.0
  • WordPress version: 6.3.1
  • First release: Nov 23, 2018
  • Latest release: Jul 7, 2023
  • Number of updates: 51
  • Update frequency: every 33.1 days
  • Top authors: webdados (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

100+ active /2,079 total downloads

Benchmarks

Plugin footprint 83% from 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.19MB] [CPU: ▼17.23ms] Passed 4 tests

An overview of server-side resources used by Magic URL Coupon for WooCommerce
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /2.84 ▼0.6218.80 ▼22.76
Dashboard /wp-admin3.32 ▲0.0247.45 ▼9.13
Posts /wp-admin/edit.php3.19 ▼0.1731.91 ▼12.67
Add New Post /wp-admin/post-new.php5.90 ▲0.0281.07 ▼24.37
Media Library /wp-admin/upload.php3.24 ▲0.0233.97 ▼1.38

Server storage [IO: ▲0.03MB] [DB: ▲0.07MB] Passed 3 tests

How much does this plugin use your filesystem and database?
The plugin installed successfully
Filesystem: 4 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-posts
theysaidso_admin_options
recovery_mode_email_last_sent
db_upgraded
widget_recent-comments
widget_theysaidso_widget
can_compress_scripts

Browser metrics Passed 4 tests

This is an overview of browser requirements for Magic URL Coupon for WooCommerce
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,445 ▼31614.20 ▼0.170.58 ▼1.0419.94 ▼19.96
Dashboard /wp-admin2,195 ▲155.62 ▼0.0595.63 ▲7.9741.76 ▲0.99
Posts /wp-admin/edit.php45 ▼2,0520.42 ▼1.600.08 ▼35.758.46 ▼30.17
Add New Post /wp-admin/post-new.php1,526 ▼523.61 ▲0.31668.99 ▲78.1960.91 ▲13.98
Media Library /wp-admin/upload.php1,400 ▼04.15 ▼0.0897.64 ▼1.3644.57 ▲0.62

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • The uninstall procedure has failed, leaving 7 options in the database
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • can_compress_scripts
    • recovery_mode_email_last_sent
    • db_upgraded
    • widget_recent-posts
    • widget_recent-comments

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP Passed 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
No output text or server-side errors detected on direct access of PHP files

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 96% from 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
4 plugin tags: woocommerce, marketing, promotions, coupons

magic-coupon/magic-coupon.php 92% from 13 tests

This is the main PHP file of "Magic URL Coupon for WooCommerce" version 1.9, 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:
  • Description: Please don't use more than 140 characters for the plugin description (currently 178 characters long)

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
Good job! No executable or dangerous file extensions detected493 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP249112493

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.64
Average class complexity96.00
▷ Minimum class complexity96.00
▷ Maximum class complexity96.00
Average method complexity4.33
▷ Minimum method complexity1.00
▷ Maximum method complexity24.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods28
▷ Static methods13.57%
▷ Public methods2692.86%
▷ Protected methods00.00%
▷ Private methods27.14%
Functions3
▷ Named functions00.00%
▷ Anonymous functions3100.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
PNG images were not found in this plugin