83% easy-coupon-code-wp

Code Review | Easy Coupon Code WP

WordPress plugin Easy Coupon Code WP scored83%from 54 tests.

About plugin

  • Plugin page: easy-coupon-code-wp
  • Plugin version: 2.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-5.7.2
  • WordPress version: 6.3.1
  • First release: Jul 4, 2016
  • Latest release: Jul 9, 2021
  • Number of updates: 11
  • Update frequency: every 166.6 days
  • Top authors: gr8nilay (100%)

Code review

54 tests

User reviews

1 review

Install metrics

300+ active /3,494 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
Install script ran successfully

Server metrics [RAM: ▼0.67MB] [CPU: ▼18.55ms] Passed 4 tests

An overview of server-side resources used by Easy Coupon Code WP
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0337.98 ▼6.32
Dashboard /wp-admin3.33 ▲0.0345.27 ▲1.08
Posts /wp-admin/edit.php3.38 ▲0.0350.33 ▼0.22
Add New Post /wp-admin/post-new.php3.12 ▼2.7733.05 ▼67.26
Media Library /wp-admin/upload.php3.26 ▲0.0335.28 ▼0.38
Add New /wp-admin/post-new.php?post_type=np_coupon_code3.1233.28
Coupon Code /wp-admin/edit.php?post_type=np_coupon_code3.3037.23

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

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 10 new files
Database: no new tables, 7 new options
New WordPress options
db_upgraded
widget_theysaidso_widget
can_compress_scripts
npcc_activated_on
widget_recent-comments
theysaidso_admin_options
widget_recent-posts

Browser metrics Passed 4 tests

This is an overview of browser requirements for Easy Coupon Code WP
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,870 ▲12413.92 ▼0.281.88 ▼0.4842.64 ▼2.75
Dashboard /wp-admin2,251 ▲635.83 ▼0.06114.27 ▲6.3084.89 ▲46.06
Posts /wp-admin/edit.php2,134 ▲452.42 ▲0.3848.04 ▲4.5637.93 ▲1.37
Add New Post /wp-admin/post-new.php1,562 ▲2923.42 ▲0.38636.33 ▲33.0036.91 ▼12.27
Media Library /wp-admin/upload.php1,433 ▲454.98 ▲0.81103.58 ▼1.1081.93 ▲39.68
Add New /wp-admin/post-new.php?post_type=np_coupon_code1,5303.3458.7364.11
Coupon Code /wp-admin/edit.php?post_type=np_coupon_code1,1322.3540.3731.68

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The following items require your attention
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • db_upgraded
    • widget_recent-comments
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-posts
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Please fix the following server-side errors
    • > GET request to /wp-admin/post-new.php?post_type=np_coupon_code
    • > Notice in wp-content/plugins/easy-coupon-code-wp/np-coupon-code.php+138
    Undefined index: social_noncename

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

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration 87% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
These attributes need to be fixed:
  • Screenshots: Please add images for these screenshots: #1 (On the coupon list page, you will get all the details in columns.), #2 (How it looks like in while adding coupon)
  • Plugin Name: Please replace "Plugin Name" with the name of your plugin on the first line ( === easy-coupon-code-wp === )
You can take inspiration from this readme.txt

easy-coupon-code-wp/np-coupon-code.php 85% from 13 tests

This is the main PHP file of "Easy Coupon Code WP" version 2.0, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
You should first fix the following items:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("easy-coupon-code-wp.php" instead of "np-coupon-code.php")
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 309 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
No dangerous file extensions were detected13,006 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript22,0991,15311,769
CSS134491,095
PHP34545142

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.21
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%
Functions10
▷ Named functions10100.00%
▷ Anonymous functions00.00%
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
3 PNG files occupy 0.05MB with 0.03MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png24.89KB12.97KB▼ 47.88%
npcc-icon.png3.68KB1.23KB▼ 66.45%
screenshot-2.png26.73KB14.85KB▼ 44.45%