78% coupon-creator

Code Review | Coupon Creator

WordPress plugin Coupon Creator scored78%from 54 tests.

About plugin

  • Plugin page: coupon-creator
  • Plugin version: 3.3.0
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.9-6.1.1
  • WordPress version: 6.3.1
  • First release: Jul 8, 2012
  • Latest release: Mar 9, 2023
  • Number of updates: 224
  • Update frequency: every 17.4 days
  • Top authors: brianjessee (100%)

Code review

54 tests

User reviews

36 reviews

Install metrics

8,000+ active /182,875 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲1.70MB] [CPU: ▲11.84ms] Passed 4 tests

This is a short check of server-side resources used by Coupon Creator
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /4.66 ▲1.2053.44 ▲11.61
Dashboard /wp-admin5.20 ▲1.9063.88 ▲13.20
Posts /wp-admin/edit.php5.26 ▲1.9069.26 ▲10.37
Add New Post /wp-admin/post-new.php7.86 ▲1.98113.44 ▲12.17
Media Library /wp-admin/upload.php5.05 ▲1.8254.63 ▲20.86
Add New /wp-admin/post-new.php?post_type=cctor_coupon5.48245.05
Coupon Categories /wp-admin/edit-tags.php?taxonomy=cctor_coupon_category&post_type=cctor_coupon5.0452.11
Options /wp-admin/edit.php?post_type=cctor_coupon&page=coupon-options5.65292.46
All Coupons /wp-admin/edit.php?post_type=cctor_coupon5.1053.97

Server storage [IO: ▲3.08MB] [DB: ▲0.01MB] Passed 3 tests

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 266 new files
Database: no new tables, 16 new options
New WordPress options
db_upgraded
pngx_permalink_flush
coupon_update_image_border_meta
pngx_permalink_change
cctor_coupon_version
widget_recent-posts
theysaidso_admin_options
wisdom_notification_times
widget_recent-comments
coupon_update_templates
...

Browser metrics Passed 4 tests

An overview of browser requirements for Coupon Creator
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,882 ▲13613.21 ▼1.441.88 ▼0.0142.79 ▲0.57
Dashboard /wp-admin2,282 ▲945.88 ▼0.03101.55 ▼7.3039.69 ▼5.10
Posts /wp-admin/edit.php2,171 ▲822.06 ▲0.0540.94 ▲1.3838.82 ▲0.88
Add New Post /wp-admin/post-new.php6,422 ▲4,90829.51 ▲11.97895.89 ▲233.8636.32 ▼17.22
Media Library /wp-admin/upload.php1,464 ▲764.34 ▲0.11119.95 ▲9.8447.99 ▲3.46
Add New /wp-admin/post-new.php?post_type=cctor_coupon3,8415.28158.65182.20
Coupon Categories /wp-admin/edit-tags.php?taxonomy=cctor_coupon_category&post_type=cctor_coupon1,3412.3034.0130.61
Options /wp-admin/edit.php?post_type=cctor_coupon&page=coupon-options3,1595.16105.63139.78
All Coupons /wp-admin/edit.php?post_type=cctor_coupon1,1722.1137.3031.71

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The following items require your attention
  • Zombie WordPress options detected upon uninstall: 16 options
    • db_upgraded
    • theysaidso_admin_options
    • coupon_update_expiration_type
    • cctor_coupon_version
    • coupon_update_image_border_meta
    • widget_recent-comments
    • can_compress_scripts
    • coupon_update_version
    • coupon_creator_options
    • pngx_permalink_flush
    • ...

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 0% 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
The following issues need your attention
  • 90× PHP files perform the task of outputting text when accessed with GET requests (only 10 are shown):
    • > /wp-content/plugins/coupon-creator/src/Cctor/Expiration.php
    • > /wp-content/plugins/coupon-creator/plugin-engine/src/Pngx/Fields.php
    • > /wp-content/plugins/coupon-creator/plugin-engine/src/Pngx/Sanitize.php
    • > /wp-content/plugins/coupon-creator/src/functions/template-functions/cctor-function-expiration.php
    • > /wp-content/plugins/coupon-creator/plugin-engine/src/Pngx/Admin/Field/Hidden.php
    • > /wp-content/plugins/coupon-creator/src/functions/template-build/cctor-shortcode-build.php
    • > /wp-content/plugins/coupon-creator/src/deprecated/deprecated.php
    • > /wp-content/plugins/coupon-creator/src/Cctor/Admin/Field/Help.php
    • > /wp-content/plugins/coupon-creator/plugin-engine/src/Pngx/Admin/EDD_License.php
    • > /wp-content/plugins/coupon-creator/src/Cctor/Main.php
  • 11× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Interface 'Pngx__Blocks__Interface' not found in wp-content/plugins/coupon-creator/plugin-engine/src/Pngx/Blocks/Abstract.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'tad_DI52_ServiceProvider' not found in wp-content/plugins/coupon-creator/plugin-engine/src/Pngx/Duplicate/Post_Types.php:11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_the_ID() in wp-content/plugins/coupon-creator/src/functions/templates/print-coupon.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function trailingslashit() in wp-content/plugins/coupon-creator/plugin-engine/src/Pngx/Main.php:67
    • > PHP Fatal error
      Uncaught Error: Class 'Pngx__Abstract_Plugin_Register' not found in wp-content/plugins/coupon-creator/src/Cctor/Plugin_Register.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'tad_DI52_Container' not found in wp-content/plugins/coupon-creator/plugin-engine/src/Pngx/Container.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'tad_DI52_ServiceProvider' not found in wp-content/plugins/coupon-creator/plugin-engine/src/Pngx/Service_Providers/Processes.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'Pngx__Blocks__Abstract' not found in wp-content/plugins/coupon-creator/src/Cctor/Blocks/Coupon.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Autoload\\AutoloadGenerator' not found in wp-content/plugins/coupon-creator/plugin-engine/vendor/xrstf/composer-php52/lib/xrstf/Composer52/AutoloadGenerator.php:30
    • > PHP Fatal error
      Uncaught Error: Interface 'tad_DI52_ServiceProviderInterface' not found in wp-content/plugins/coupon-creator/plugin-engine/vendor/lucatume/di52/src/tad/DI52/ServiceProvider.php:7

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
There were no browser issues found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
3 plugin tags: custom post type, coupon, shortcode

coupon-creator/coupon_creator.php 92% from 13 tests

The main file in "Coupon Creator" v. 3.3.0 serves as a complement to information provided in readme.txt and as the entry point to the plugin
Please make the necessary changes and fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("coupon-creator.php" instead of "coupon_creator.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Success! There were no dangerous files found in this plugin28,940 lines of code in 225 files:
LanguageFilesBlank linesComment linesLines of code
PHP1614,5329,49414,842
JavaScript371,5661,0006,183
CSS144792404,092
PO File61,0141,1892,524
SVG500991
JSON200308

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.45
Average class complexity16.87
▷ Minimum class complexity1.00
▷ Maximum class complexity119.00
Average method complexity3.61
▷ Minimum method complexity1.00
▷ Maximum method complexity42.00
Code structure
Namespaces9
Interfaces3
Traits2
Classes127
▷ Abstract classes43.15%
▷ Concrete classes12396.85%
▷ Final classes00.00%
Methods832
▷ Static methods13115.75%
▷ Public methods72987.62%
▷ Protected methods637.57%
▷ Private methods404.81%
Functions91
▷ Named functions8492.31%
▷ Anonymous functions77.69%
Constants21
▷ Global constants314.29%
▷ Class constants1885.71%
▷ Public constants18100.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
7 PNG files occupy 0.03MB with 0.00MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
plugin-engine/src/resources/images/ui-icons_2e83ff_256x240.png4.27KB4.11KB▼ 3.78%
plugin-engine/vendor/colorbox/images/border2.png0.11KB0.16KB0.00%
vendor/colorbox/images/border2.png0.11KB0.16KB0.00%
plugin-engine/vendor/colorbox/images/border1.png0.61KB0.82KB0.00%
plugin-engine/src/resources/images/ui-bg_flat_65_2a5a8a_40x100.png0.96KB0.08KB▼ 91.16%