10% deal-of-the-day

Code Review | Deals of the Day WooCommerce

WordPress plugin Deals of the Day WooCommerce scored 10% from 54 tests.

About plugin

  • Plugin page: deal-of-the-day
  • Plugin version: 1.3
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-5.8
  • WordPress version: 5.9.2
  • First release: Nov 21, 2017
  • Latest release: Sep 8, 2021
  • Number of updates: 65
  • Update frequency: every 21.4 days
  • Top authors: themelocation (100%)

Code review

54 tests

User reviews

1 review

Install metrics

70+ active / 1,648 total downloads

Benchmarks

Plugin footprint 58% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Please fix the following installer errors
  • The plugin cannot be installed
    • > Error in wp-content/plugins/deal-of-the-day/includes/admin/install.class.php+38
    Uncaught Error: Call to undefined function wc_get_page_id() in wp-content/plugins/deal-of-the-day/includes/admin/install.class.php:38
    Stack trace:
    #0 wp-includes/class-wp-hook.php(307): DD_Install->install()
    #1 wp-includes/class-wp-hook.php(331): WP_Hook->apply_filters()
    #2 wp-includes/plugin.php(474): WP_Hook->do_action()
    #3 wp-admin/includes/plugin.php(689): do_action()

Server metrics [RAM: ▼0.02MB] [CPU: ▼295.11ms] Passed 4 tests

An overview of server-side resources used by Deals of the Day WooCommerce
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.0155.00 ▼1.40
Dashboard /wp-admin3.42 ▲0.0134.13 ▼2.78
Posts /wp-admin/edit.php3.65 ▲0.0137.09 ▼1.72
Add New Post /wp-admin/post-new.php6.89 ▼0.0997.41 ▼1,174.52
Media Library /wp-admin/upload.php3.30 ▲0.0026.75 ▲2.75

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

Analyzing filesystem and database footprints of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 213 new files
Database: no new tables, 4 new options
New WordPress options
fs_accounts
fs_active_plugins
fs_debug_mode
fs_gdpr

Browser metrics Passed 4 tests

A check of browser resources used by Deals of the Day WooCommerce
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,763 ▲915.76 ▼0.325.46 ▼0.452.39 ▼0.37
Dashboard /wp-admin2,888 ▲276.12 ▼0.03125.89 ▼36.37175.68 ▲15.25
Posts /wp-admin/edit.php2,694 ▲93.23 ▲0.0162.72 ▼4.59140.62 ▼64.91
Add New Post /wp-admin/post-new.php1,661 ▼9521.62 ▲4.64409.60 ▼10.20191.33 ▲12.14
Media Library /wp-admin/upload.php1,698 ▼05.56 ▲0.02164.71 ▲7.76238.02 ▲51.99

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Please fix the following items
  • The uninstall procedure has failed, leaving 4 options in the database
    • fs_accounts
    • fs_active_plugins
    • fs_debug_mode
    • fs_gdpr

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Everything seems fine, however this is by no means an exhaustive test

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
The following issues need your attention
  • 1× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/deal-of-the-day/freemius/templates/ajax-loader.php
  • 18× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Notice
      Undefined variable: VARS in wp-content/plugins/deal-of-the-day/freemius/templates/account/partials/addon.php on line 8
    • > PHP Notice
      Undefined variable: msg in wp-content/plugins/deal-of-the-day/includes/admin/views/_geneal_settings.php on line 2
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/deal-of-the-day/freemius/templates/account/partials/addon.php on line 6
    • > PHP Fatal error
      Uncaught Error: Class 'DD_Admin_Views' not found in wp-content/plugins/deal-of-the-day/includes/admin/views/_header.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_post_meta() in wp-content/plugins/deal-of-the-day/includes/shortcodes/views/deal_of_day_view.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function freemius() in wp-content/plugins/deal-of-the-day/freemius/templates/partials/network-activation.php:6
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/deal-of-the-day/freemius/templates/account/partials/addon.php on line 8
    • > PHP Fatal error
      Uncaught Error: Class 'DD_Admin_Views' not found in wp-content/plugins/deal-of-the-day/includes/admin/views/_header.php:13
    • > PHP Notice
      Undefined variable: VARS in wp-content/plugins/deal-of-the-day/freemius/templates/account/partials/addon.php on line 7
    • > PHP Fatal error
      Uncaught Error: Call to a member function get_slug() on null in wp-content/plugins/deal-of-the-day/freemius/templates/account/partials/addon.php:9

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser errors were detected

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
6 plugin tags: deals woocommerce, livingsocial, woocommerce, groupon, wordpress deals...

deal-of-the-day/deal-of-the-day.php Passed 13 tests

This is the main PHP file of "Deals of the Day WooCommerce" version 1.3, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
53 characters long description:
Plugin to add facility in woocommerce to create deals

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
There were no executable files found in this plugin32,715 lines of code in 150 files:
LanguageFilesBlank linesComment linesLines of code
PHP1237,47216,36131,511
CSS165063523
JavaScript87068439
Markdown1680214
JSON10027
SVG1001

PHP code 50% from 2 tests

A short review of cyclomatic complexity and code structure
Please fix the following
  • Cyclomatic complexity of classes should be reduced to less than 1000 (currently 2,895)
Cyclomatic complexity
Average complexity per logical line of code0.62
Average class complexity75.38
▷ Minimum class complexity1.00
▷ Maximum class complexity2,895.00
Average method complexity4.56
▷ Minimum method complexity1.00
▷ Maximum method complexity86.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes55
▷ Abstract classes23.64%
▷ Concrete classes5396.36%
▷ Final classes11.89%
Methods1,181
▷ Static methods20317.19%
▷ Public methods83770.87%
▷ Protected methods151.27%
▷ Private methods32927.86%
Functions99
▷ Named functions99100.00%
▷ Anonymous functions00.00%
Constants124
▷ Global constants9979.84%
▷ Class constants2520.16%
▷ Public constants25100.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 PNG files occupy 0.37MB with 0.19MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/howto2.png19.95KB6.58KB▼ 66.99%
screenshot-4.png14.82KB8.44KB▼ 43.07%
screenshot-6.png42.72KB19.14KB▼ 55.20%
freemius/assets/img/theme-icon.png10.97KB5.78KB▼ 47.37%
screenshot-2.png31.77KB16.26KB▼ 48.81%