90% couponapi

Code Review | Coupon API

WordPress plugin Coupon API scored90%from 54 tests.

About plugin

  • Plugin page: couponapi
  • Plugin version: 6.0.4
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.2-6.1.3
  • WordPress version: 6.3.1
  • First release: Apr 9, 2019
  • Latest release: Nov 30, 2023
  • Number of updates: 116
  • Update frequency: every 14.6 days
  • Top authors: kamilkhan (100%)

Code review

54 tests

User reviews

5 reviews

Install metrics

400+ active /20,717 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
Installer ran successfully

Server metrics [RAM: ▼0.66MB] [CPU: ▼17.04ms] Passed 4 tests

This is a short check of server-side resources used by Coupon API
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0347.15 ▲7.27
Dashboard /wp-admin3.35 ▼0.0049.90 ▼11.73
Posts /wp-admin/edit.php3.40 ▲0.0458.29 ▲11.91
Add New Post /wp-admin/post-new.php3.16 ▼2.7341.42 ▼69.00
Media Library /wp-admin/upload.php3.27 ▲0.0440.47 ▲5.31
Settings /wp-admin/admin.php?page=couponapi3.2438.70
Coupon Custom Template /wp-admin/admin.php?page=couponapi-custom-template3.3041.35
Brandlogos /wp-admin/admin.php?page=couponapi-brandlogos-settings3.2237.98
Troubleshoot /wp-admin/admin.php?page=couponapi-troubleshoot3.2434.11
Logs /wp-admin/admin.php?page=couponapi-logs3.2336.57
CSV Upload /wp-admin/admin.php?page=couponapi-file-upload3.2336.60

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

Filesystem and database footprint
The plugin installed successfully
Filesystem: 44 new files
Database: 3 new tables, 7 new options
New tables
wp_couponapi_config
wp_couponapi_upload
wp_couponapi_logs
New WordPress options
theysaidso_admin_options
widget_recent-posts
widget_theysaidso_widget
can_compress_scripts
widget_recent-comments
db_upgraded
couponapi_updated_to_4_point_2_point_1

Browser metrics Passed 4 tests

This is an overview of browser requirements for Coupon API
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,829 ▲8214.29 ▼0.051.68 ▼0.0145.20 ▲1.43
Dashboard /wp-admin2,237 ▲565.55 ▼0.1485.59 ▼19.5239.34 ▼5.79
Posts /wp-admin/edit.php2,139 ▲422.00 ▲0.0439.85 ▲3.9039.10 ▲4.92
Add New Post /wp-admin/post-new.php1,557 ▲3123.30 ▲0.05601.01 ▼34.1552.26 ▼8.22
Media Library /wp-admin/upload.php1,439 ▲424.19 ▼0.0394.30 ▼4.2242.66 ▲1.74
Settings /wp-admin/admin.php?page=couponapi1,3311.9031.9382.88
Coupon Custom Template /wp-admin/admin.php?page=couponapi-custom-template1,6477.00152.3777.09
Brandlogos /wp-admin/admin.php?page=couponapi-brandlogos-settings8371.9027.7132.41
Troubleshoot /wp-admin/admin.php?page=couponapi-troubleshoot9501.8925.6538.56
Logs /wp-admin/admin.php?page=couponapi-logs8931.9028.5237.74
CSV Upload /wp-admin/admin.php?page=couponapi-file-upload8621.8926.6935.13

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
Please fix the following items
  • Zombie WordPress options were found after uninstall: 7 options
    • couponapi_updated_to_4_point_2_point_1
    • widget_recent-comments
    • widget_recent-posts
    • widget_theysaidso_widget
    • db_upgraded
    • can_compress_scripts
    • theysaidso_admin_options

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Everything seems fine, however this is by no means an exhaustive test

SRP Passed 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
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 97% from 29 tests

readme.txt 94% from 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
These attributes need to be fixed:
  • Screenshots: These screenshots require images: #1 (Coupon API Settings), #2 (Manual CSV Import), #3 (Process Logs), #4 (Automatic configuration checks)
You can look at the official readme.txt

couponapi/couponapi.php Passed 13 tests

"Coupon API" version 6.0.4's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
104 characters long description:
Automatically import Coupons & Deals from popular Affiliate Networks into your WordPress Coupon Website.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Everything looks great! No dangerous files found in this plugin7,220 lines of code in 25 files:
LanguageFilesBlank linesComment linesLines of code
PHP139022144,330
PO File68889362,553
SVG100288
JavaScript31739
CSS21710

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.42
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%
Functions79
▷ Named functions7898.73%
▷ Anonymous functions11.27%
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
4 PNG files occupy 0.38MB with 0.24MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-4.png102.50KB38.66KB▼ 62.29%
screenshot-1.png90.22KB30.79KB▼ 65.88%
screenshot-2.png26.56KB10.22KB▼ 61.51%
screenshot-3.png173.27KB64.03KB▼ 63.05%