10% codecorun-coupon-discount-rules

Code Review | Codecorun - Coupon Discount Rules

WordPress plugin Codecorun - Coupon Discount Rules scored 10% from 54 tests.

About plugin

  • Plugin page: codecorun-coupon-...
  • Plugin version: 1.3.1
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-6.1.1
  • WordPress version: 6.3.1
  • First release: Jan 20, 2022
  • Latest release: Jan 27, 2023
  • Number of updates: 18
  • Update frequency: every 20.7 days
  • Top authors: codecorun (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 970 total downloads

Benchmarks

Plugin footprint 58% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
These installer errors require your attention
  • This plugin did not install gracefully
    • > User error in wp-content/plugins/codecorun-coupon-discount-rules/codecorun-cdr-plugin.php+34
    Woocommerce plugin is missing

Server metrics [RAM: ▼0.16MB] [CPU: ▼17.59ms] Passed 4 tests

Analyzing server-side resources used by Codecorun - Coupon Discount Rules
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.02 ▼0.4419.57 ▼24.74
Dashboard /wp-admin3.31 ▲0.0133.06 ▼15.86
Posts /wp-admin/edit.php3.39 ▲0.0334.58 ▼10.47
Add New Post /wp-admin/post-new.php5.62 ▼0.2674.58 ▼19.27
Media Library /wp-admin/upload.php3.33 ▲0.1031.88 ▼4.65
Discount Rules Notification /wp-admin/admin.php?page=codecorun-wcdr3.2427.98

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

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 23 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
can_compress_scripts
widget_recent-comments
db_upgraded
theysaidso_admin_options
widget_theysaidso_widget

Browser metrics Passed 4 tests

Checking browser requirements for Codecorun - Coupon Discount Rules
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,463 ▼29413.26 ▼0.690.67 ▼1.2319.56 ▼23.68
Dashboard /wp-admin2,213 ▲344.87 ▼0.02100.03 ▼0.8036.78 ▼4.74
Posts /wp-admin/edit.php2,096 ▲282.04 ▲0.0337.39 ▲0.6129.60 ▼2.49
Add New Post /wp-admin/post-new.php1,521 ▲122.98 ▲0.01590.92 ▼27.9189.93 ▲33.08
Media Library /wp-admin/upload.php1,398 ▲104.27 ▲0.0797.09 ▼4.8742.54 ▼1.87
Discount Rules Notification /wp-admin/admin.php?page=codecorun-wcdr1,7647.22156.39105.74

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
Please fix the following items
  • This plugin does not fully uninstall, leaving 6 options in the database
    • theysaidso_admin_options
    • db_upgraded
    • can_compress_scripts
    • widget_recent-comments
    • widget_recent-posts
    • widget_theysaidso_widget

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
These errors were triggered by the plugin
    • > GET request to /wp-admin/admin.php?page=codecorun-wcdr
    • > User notice in wp-includes/functions.php+5905
    Function WP_Scripts::localize was called incorrectly. The $l10n parameter must be an array. To pass arbitrary data to scripts, use the wp_add_inline_script() function instead. Please see Debugging in WordPress for more information. (This message was added in version 5.7.0.)

SRP 0% 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
  • 4× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/codecorun-coupon-discount-rules/codecorun-cdr-plugin.php
    • > /wp-content/plugins/codecorun-coupon-discount-rules/admin/includes/codecorun-cdr-admin-class.php
    • > /wp-content/plugins/codecorun-coupon-discount-rules/includes/codecorun-cdr-main-class.php
    • > /wp-content/plugins/codecorun-coupon-discount-rules/includes/codecorun-cdr-common-class.php
  • 14× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Notice
      Undefined variable: params in wp-content/plugins/codecorun-coupon-discount-rules/templates/notification.php on line 2
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/codecorun-coupon-discount-rules/templates/notification.php on line 2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_url() in wp-content/plugins/codecorun-coupon-discount-rules/admin/templates/panel-marketing.php:10
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/codecorun-coupon-discount-rules/templates/notification.php on line 2
    • > PHP Warning
      Use of undefined constant CODECORUN_CDR_URL - assumed 'CODECORUN_CDR_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/codecorun-coupon-discount-rules/admin/templates/panel-marketing.php on line 7
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/codecorun-coupon-discount-rules/templates/notification.php on line 2
    • > PHP Notice
      Undefined variable: params in wp-content/plugins/codecorun-coupon-discount-rules/templates/notification.php on line 2
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/codecorun-coupon-discount-rules/templates/notification.php on line 2
    • > PHP Notice
      Undefined variable: params in wp-content/plugins/codecorun-coupon-discount-rules/templates/notification.php on line 2
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/codecorun-coupon-discount-rules/templates/notification.php on line 2

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser issues were found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
5 plugin tags: rules, discounts, auto discounts, coupon, discount rules

codecorun-coupon-discount-rules/codecorun-cdr-plugin.php 92% from 13 tests

This is the main PHP file of "Codecorun - Coupon Discount Rules" version 1.3.1, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
The following require your attention:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("codecorun-coupon-discount-rules.php" instead of "codecorun-cdr-plugin.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
No dangerous file extensions were detected10,779 lines of code in 17 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript41,0971,0478,939
PHP7195336993
CSS38923580
PO File18288197
SVG10169
Markdown1101

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.46
Average class complexity49.33
▷ Minimum class complexity6.00
▷ Maximum class complexity113.00
Average method complexity5.70
▷ Minimum method complexity1.00
▷ Maximum method complexity31.00
Code structure
Namespaces3
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods31
▷ Static methods39.68%
▷ Public methods31100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions6
▷ Named functions350.00%
▷ Anonymous functions350.00%
Constants5
▷ Global constants5100.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
1 PNG file occupies 0.02MB with 0.02MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
admin/assets/codecorun.png18.50KB0.67KB▼ 96.40%