73% ketchup-coupons

Code Review | Ketchup Coupons

WordPress plugin Ketchup Coupons scored 73% from 54 tests.

About plugin

  • Plugin page: ketchup-coupons
  • Plugin version: 0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5.1-4.0
  • WordPress version: 5.8.1
  • First release: Nov 20, 2014
  • Latest release: Nov 20, 2014
  • Number of updates: 3
  • Update frequency: N/A
  • Top authors: alexitsios (100%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active / 7,753 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Installer ran successfully

Server metrics [RAM: ▼0.71MB] [CPU: ▼178.90ms] Passed 4 tests

A check of server-side resources used by Ketchup Coupons
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /2.89 ▲0.1723.24 ▼1.20
Dashboard /wp-admin2.94 ▼0.1119.41 ▼25.45
Posts /wp-admin/edit.php2.94 ▼0.1619.16 ▼27.43
Add New Post /wp-admin/post-new.php2.94 ▼2.4918.56 ▼643.97
Media Library /wp-admin/upload.php2.94 ▼0.0618.85 ▼18.74
Coupon Tags /wp-admin/edit-tags.php?taxonomy=ketchup-coupon-tag&post_type=ketchup-coupon2.9418.41
All Coupons /wp-admin/edit.php?post_type=ketchup-coupon2.9419.26
Add New /wp-admin/post-new.php?post_type=ketchup-coupon2.9418.19
Coupon Categories /wp-admin/edit-tags.php?taxonomy=ketchup-coupon-category&post_type=ketchup-coupon2.9419.26

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 32 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

An overview of browser requirements for Ketchup Coupons
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,945 ▲37317.38 ▲1.3611.38 ▼0.8444.31 ▼4.49
Dashboard /wp-admin3,224 ▲2937.85 ▲1.86168.65 ▲15.34119.43 ▲4.76
Posts /wp-admin/edit.php3,006 ▲2674.15 ▲1.4394.08 ▲22.0489.20 ▼2.07
Add New Post /wp-admin/post-new.php1,688 ▲18821.99 ▲3.16292.97 ▼105.32111.62 ▼0.91
Media Library /wp-admin/upload.php1,855 ▲484.80 ▼0.23118.72 ▼40.90121.03 ▼0.79
Coupon Tags /wp-admin/edit-tags.php?taxonomy=ketchup-coupon-tag&post_type=ketchup-coupon1,9793.7481.0877.23
All Coupons /wp-admin/edit.php?post_type=ketchup-coupon1,6974.0381.1471.33
Add New /wp-admin/post-new.php?post_type=ketchup-coupon2,8015.39129.09111.51
Coupon Categories /wp-admin/edit-tags.php?taxonomy=ketchup-coupon-category&post_type=ketchup-coupon2,0103.7384.9987.93

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
These items require your attention
  • Uninstall procedure validation failed for this plugin
    • > Warning in wp-content/plugins/ketchup-coupons/includes/metaboxes/init.php+746
    count(): Parameter must be an array or an object that implements Countable

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
  • 5 occurences, only the last one shown
    • > GET request to /wp-admin/edit-tags.php?taxonomy=ketchup-coupon-category&post_type=ketchup-coupon
    • > Warning in wp-content/plugins/ketchup-coupons/includes/metaboxes/init.php+746
    count(): Parameter must be an array or an object that implements Countable

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please fix the following items
  • 1× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/ketchup-coupons/ketchup-coupons.php
  • 2× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/ketchup-coupons/includes/coupon-functions.php:11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function apply_filters() in wp-content/plugins/ketchup-coupons/includes/metaboxes/init.php:41

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 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
2 plugin tags: shortcodes, custom shortcodes

ketchup-coupons/ketchup-coupons.php Passed 13 tests

The main PHP file in "Ketchup Coupons" ver. 0.1 adds more information about the plugin and also serves as the entry point for this plugin
51 characters long description:
This plugin enables a very simple coupon post type.

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
Good job! No executable or dangerous file extensions detected4,744 lines of code in 16 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript43063742,169
PHP85221,0021,785
CSS26121540
Markdown2740250

PHP code Passed 2 tests

This is a short overview 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.53
Average class complexity66.50
▷ Minimum class complexity20.00
▷ Maximum class complexity136.00
Average method complexity3.95
▷ Minimum method complexity1.00
▷ Maximum method complexity35.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes6
▷ Abstract classes00.00%
▷ Concrete classes6100.00%
▷ Final classes00.00%
Methods133
▷ Static methods3425.56%
▷ Public methods13198.50%
▷ Protected methods21.50%
▷ Private methods00.00%
Functions12
▷ Named functions12100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants150.00%
▷ Class constants150.00%
▷ Public constants1100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
14 compressed PNG files occupy 0.02MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
includes/metaboxes/images/ui-bg_glass_65_ffffff_1x400.png0.10KB0.10KB▼ 5.71%
includes/metaboxes/images/ui-bg_flat_75_ffffff_40x100.png0.17KB0.08KB▼ 51.12%
includes/metaboxes/images/ui-bg_glass_75_e6e6e6_1x400.png0.11KB0.14KB0.00%
includes/metaboxes/images/ui-bg_highlight-soft_75_cccccc_1x100.png0.10KB0.17KB0.00%
includes/metaboxes/images/ui-icons_2e83ff_256x240.png4.27KB4.11KB▼ 3.78%