10% coupon-x-discount-pop-up

Code Review | Coupon X: Discount Pop Up, Promo Code Pop Ups, Announcement Pop Up

WordPress plugin Coupon X: Discount Pop Up, Promo Code Pop Ups, Announcement Pop Up scored 10% from 54 tests.

About plugin

  • Plugin page: coupon-x-discount...
  • Plugin version: 1.2.7
  • PHP version: 7.4.16
  • WordPress compatibility: 3.1-6.3
  • WordPress version: 6.3.1
  • First release: May 3, 2022
  • Latest release: Jul 27, 2023
  • Number of updates: 48
  • Update frequency: every 9.4 days
  • Top authors: galdub (52.08%)premiocommit (50%)

Code review

54 tests

User reviews

24 reviews

Install metrics

900+ active / 6,408 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The following installer errors require your attention
  • Install procedure validation failed for this plugin
    • > User deprecated in wp-includes/functions.php+5747
    Function add_option was called with an argument that is deprecated since version 2.3.0 with no alternative available.

Server metrics [RAM: ▲0.79MB] [CPU: ▼1.23ms] Passed 4 tests

This is a short check of server-side resources used by Coupon X: Discount Pop Up, Promo Code Pop Ups, Announcement Pop Up
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /4.21 ▲0.7533.68 ▼8.84
Dashboard /wp-admin4.10 ▲0.8055.38 ▲4.56
Posts /wp-admin/edit.php4.21 ▲0.8648.14 ▲3.11
Add New Post /wp-admin/post-new.php6.69 ▲0.8097.56 ▼3.73
Media Library /wp-admin/upload.php4.02 ▲0.7946.67 ▲11.90
Integrations /wp-admin/admin.php?page=cx_integrations3.9934.22
Upgrade to Pro /wp-admin/admin.php?page=couponx_pricing_tbl4.2569.50
Coupon X Pro Features /wp-admin/admin.php?page=couponx_pro_features4.0036.63
Dashboard /wp-admin/admin.php?page=couponx4.0346.51
Create New Widget /wp-admin/admin.php?page=add_couponx4.0339.38
Leads /wp-admin/admin.php?page=leads_list3.9935.71

Server storage [IO: ▲3.27MB] [DB: ▼0.05MB] Passed 3 tests

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 116 new files
Database: 1 new table, 8 new options
New tables
wp_cx_leads
New WordPress options
widget_theysaidso_widget
widget_recent-posts
can_compress_scripts
db_upgraded
theysaidso_admin_options
coupon-x-discount-pop-up_show_review_box_after
widget_recent-comments
cx_signup_popup

Browser metrics Passed 4 tests

Checking browser requirements for Coupon X: Discount Pop Up, Promo Code Pop Ups, Announcement Pop Up
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,990 ▲25513.61 ▼0.777.32 ▲5.4745.75 ▲1.89
Dashboard /wp-admin2,282 ▲915.84 ▲0.96100.32 ▼3.2041.84 ▼6.15
Posts /wp-admin/edit.php2,169 ▲802.07 ▲0.0339.19 ▲2.5231.07 ▼1.75
Add New Post /wp-admin/post-new.php1,583 ▲4118.58 ▲0.10612.80 ▼13.5459.81 ▼10.02
Media Library /wp-admin/upload.php1,467 ▲794.32 ▲0.0896.27 ▼15.1643.26 ▼3.90
Integrations /wp-admin/admin.php?page=cx_integrations9672.0529.5246.42
Upgrade to Pro /wp-admin/admin.php?page=couponx_pricing_tbl3,8332.1548.0880.09
Coupon X Pro Features /wp-admin/admin.php?page=couponx_pro_features9982.1526.6232.37
Dashboard /wp-admin/admin.php?page=couponx1,3163.7965.7484.81
Create New Widget /wp-admin/admin.php?page=add_couponx1,3163.7665.8671.24
Leads /wp-admin/admin.php?page=leads_list1,0323.0057.9337.34

Uninstaller [IO: ▲0.00MB] [DB: ▼0.05MB] 50% from 4 tests

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
The following items require your attention
  • The uninstall procedure failed, leaving 1 table in the database
    • wp_cx_leads
  • This plugin does not fully uninstall, leaving 8 options in the database
    • theysaidso_admin_options
    • coupon-x-discount-pop-up_show_review_box_after
    • widget_theysaidso_widget
    • can_compress_scripts
    • cx_signup_popup
    • widget_recent-posts
    • widget_recent-comments
    • db_upgraded

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Almost there! Just fix the following items
  • 3× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Warning
      require_once(COUPON_X_PATH/inc/class-dashboard.php): failed to open stream: No such file or directory in wp-content/plugins/coupon-x-discount-pop-up/inc/widget_parts/class-cx-widget-coupon.php on line 11
    • > PHP Fatal error
      require_once(): Failed opening required 'COUPON_X_PATH/inc/class-dashboard.php' (include_path='.:/usr/share/php') in wp-content/plugins/coupon-x-discount-pop-up/inc/widget_parts/class-cx-widget-coupon.php on line 11
    • > PHP Warning
      Use of undefined constant COUPON_X_PATH - assumed 'COUPON_X_PATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/coupon-x-discount-pop-up/inc/widget_parts/class-cx-widget-coupon.php on line 11

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
There are user-side issues you should fix
    • > GET request to /wp-admin/admin.php?page=leads_list
    • > Network (severe)
    wp-content/plugins/coupon-x-discount-pop-up/assets/images/sort_both.png - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/admin.php?page=leads_list
    • > Network (severe)
    wp-content/plugins/coupon-x-discount-pop-up/assets/images/sort_asc.png - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
These attributes need to be fixed:
  • Tags: You are using too many tags: 12 tag instead of maximum 10
The official readme.txt is a good inspiration

coupon-x-discount-pop-up/coupon-x-for-wc.php 85% from 13 tests

"Coupon X: Discount Pop Up, Promo Code Pop Ups, Announcement Pop Up" version 1.2.7's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
You should first fix the following items:
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("coupon-x-discount-pop-up.php" instead of "coupon-x-for-wc.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Success! There were no dangerous files found in this plugin22,635 lines of code in 71 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript181,6678089,280
PHP188981,1078,369
CSS14837514,764
SVG2100222

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.29
Average class complexity31.56
▷ Minimum class complexity1.00
▷ Maximum class complexity132.00
Average method complexity5.61
▷ Minimum method complexity1.00
▷ Maximum method complexity38.00
Code structure
Namespaces4
Interfaces0
Traits0
Classes16
▷ Abstract classes00.00%
▷ Concrete classes16100.00%
▷ Final classes00.00%
Methods106
▷ Static methods1110.38%
▷ Public methods106100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants6
▷ Global constants6100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
32 compressed PNG files occupy 0.25MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/img/cx_image_cover.png15.96KB16.24KB0.00%
assets/img/pro-support.png2.16KB2.22KB0.00%
assets/img/cx_images_right1.png32.15KB34.04KB0.00%
assets/img/300x198.png0.11KB0.11KB0.00%
assets/img/agency-price.png12.98KB13.83KB0.00%