84% affiliate-coupon-lite

Code Review | Affiliate Coupon

WordPress plugin Affiliate Coupon scored84%from 54 tests.

About plugin

  • Plugin page: affiliate-coupon-...
  • Plugin version: 1.0.0
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.5-6.0.1
  • WordPress version: 6.3.1
  • First release: Aug 22, 2022
  • Latest release: Aug 29, 2022
  • Number of updates: 5
  • Update frequency: every 1.8 days
  • Top authors: hassanshakir786 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /689 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Install script ran successfully

Server metrics [RAM: ▲0.24MB] [CPU: ▼1.61ms] Passed 4 tests

An overview of server-side resources used by Affiliate Coupon
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.71 ▲0.2540.14 ▼0.11
Dashboard /wp-admin3.55 ▲0.2050.88 ▼9.89
Posts /wp-admin/edit.php3.66 ▲0.3051.24 ▲5.93
Add New Post /wp-admin/post-new.php6.15 ▲0.2794.91 ▲3.19
Media Library /wp-admin/upload.php3.47 ▲0.2436.26 ▲0.38
All Coupons /wp-admin/edit.php?post_type=coupon3.5136.56
Settings /wp-admin/edit.php?post_type=coupon&page=coupon-plugin-setting3.4633.12
Go Pro ➤ /wp-admin/edit.php?post_type=coupon&page=coupon-plugin-setting&tab=pro_settings3.4732.36
Store /wp-admin/edit-tags.php?taxonomy=coupon-store&post_type=coupon3.4633.06
Category /wp-admin/edit-tags.php?taxonomy=coupon-category&post_type=coupon3.4635.08
Add New /wp-admin/post-new.php?post_type=coupon3.5445.92

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 47 new files
Database: no new tables, 7 new options
New WordPress options
widget_theysaidso_widget
affiliate_coupon_lite_settings
widget_recent-comments
widget_recent-posts
can_compress_scripts
theysaidso_admin_options
db_upgraded

Browser metrics Passed 4 tests

A check of browser resources used by Affiliate Coupon
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,870 ▲12413.32 ▼1.332.18 ▲0.2646.51 ▲2.29
Dashboard /wp-admin2,252 ▲644.85 ▼0.04100.70 ▼14.9343.20 ▼2.32
Posts /wp-admin/edit.php2,132 ▲432.02 ▲0.0140.17 ▲2.5141.12 ▲8.50
Add New Post /wp-admin/post-new.php1,571 ▲5018.34 ▼4.81604.10 ▼88.6961.37 ▲5.27
Media Library /wp-admin/upload.php1,434 ▲464.22 ▼0.0095.97 ▼6.9843.04 ▼1.80
All Coupons /wp-admin/edit.php?post_type=coupon1,1531.9538.4733.38
Settings /wp-admin/edit.php?post_type=coupon&page=coupon-plugin-setting1,5122.8560.0838.93
Go Pro ➤ /wp-admin/edit.php?post_type=coupon&page=coupon-plugin-setting&tab=pro_settings1,0541.9228.9757.01
Store /wp-admin/edit-tags.php?taxonomy=coupon-store&post_type=coupon1,3012.2628.1931.23
Category /wp-admin/edit-tags.php?taxonomy=coupon-category&post_type=coupon1,3012.1426.0031.42
Add New /wp-admin/post-new.php?post_type=coupon1,7652.8756.1240.92

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
The following items require your attention
  • Zombie WordPress options detected upon uninstall: 7 options
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-posts
    • can_compress_scripts
    • db_upgraded
    • affiliate_coupon_lite_settings

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though no errors were found, this is by no means an exhaustive test

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
  • 43× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Warning
      Use of undefined constant AFFILIATE_COUPON_LITE_PATH - assumed 'AFFILIATE_COUPON_LITE_PATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/affiliate-coupon-lite/src/custom/custom.php on line 29
    • > PHP Warning
      Use of undefined constant AFFILIATE_COUPON_LITE_PATH - assumed 'AFFILIATE_COUPON_LITE_PATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/affiliate-coupon-lite/src/custom/custom.php on line 29
    • > PHP Warning
      Use of undefined constant AFFILIATE_COUPON_LITE_PATH - assumed 'AFFILIATE_COUPON_LITE_PATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/affiliate-coupon-lite/src/custom/custom.php on line 29
    • > PHP Fatal error
      Uncaught Error: Call to undefined function AffiliateCoupon\\Custom\\Meta\\add_action() in wp-content/plugins/affiliate-coupon-lite/src/custom/meta/meta-box.php:14
    • > PHP Warning
      include(): Failed opening 'AFFILIATE_COUPON_LITE_PATHsrc/custom/helpers/functions.php' for inclusion (include_path='.:/usr/share/php') in wp-content/plugins/affiliate-coupon-lite/src/custom/custom.php on line 29
    • > PHP Warning
      Use of undefined constant AFFILIATE_COUPON_LITE_PATH - assumed 'AFFILIATE_COUPON_LITE_PATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/affiliate-coupon-lite/src/custom/custom.php on line 29
    • > PHP Warning
      include(AFFILIATE_COUPON_LITE_PATHsrc/custom/meta/term-meta.php): failed to open stream: No such file or directory in wp-content/plugins/affiliate-coupon-lite/src/custom/custom.php on line 29
    • > PHP Warning
      Use of undefined constant AFFILIATE_COUPON_LITE_PATH - assumed 'AFFILIATE_COUPON_LITE_PATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/affiliate-coupon-lite/src/custom/custom.php on line 29
    • > PHP Warning
      include(): Failed opening 'AFFILIATE_COUPON_LITE_PATHsrc/custom/taxonomy/config.php' for inclusion (include_path='.:/usr/share/php') in wp-content/plugins/affiliate-coupon-lite/src/custom/custom.php on line 29
    • > PHP Warning
      include(): Failed opening 'AFFILIATE_COUPON_LITE_PATHsrc/custom/shortcode/shortcode.php' for inclusion (include_path='.:/usr/share/php') in wp-content/plugins/affiliate-coupon-lite/src/custom/custom.php on line 29

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% 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: You can take inspiration from this readme.txt

affiliate-coupon-lite/affiliate-coupon-lite.php 92% from 13 tests

The main file in "Affiliate Coupon" v. 1.0.0 serves as a complement to information provided in readme.txt and as the entry point to the plugin
Please take the time to fix the following:
  • Requires PHP: The required version number must match the one declared in readme.txt ("5.4" instead of "5.6")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Good job! No executable or dangerous file extensions detected1,409 lines of code in 28 files:
LanguageFilesBlank linesComment linesLines of code
PHP181255081,018
PO File2126140306
JavaScript30043
SVG10138
CSS4154

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.30
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
Namespaces8
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%
Functions44
▷ Named functions44100.00%
▷ Anonymous functions00.00%
Constants5
▷ Global constants5100.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
2 PNG files occupy 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/coupon-plugin-guarantee.png19.38KB10.19KB▼ 47.41%
assets/images/coupon-icon.png0.90KB0.80KB▼ 10.43%