83% product-of-the-day-for-woocommerce

Code Review | Product of the Day for WooCommerce

WordPress plugin Product of the Day for WooCommerce scored83%from 54 tests.

About plugin

  • Plugin page: product-of-the-da...
  • Plugin version: 3.5.7.8
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.3.1
  • WordPress version: 6.3.1
  • First release: Aug 15, 2016
  • Latest release: Sep 21, 2023
  • Number of updates: 65
  • Update frequency: every 40.0 days
  • Top authors: RazyRx (55.38%)dholovnia (46.15%)

Code review

54 tests

User reviews

2 reviews

Install metrics

100+ active /10,879 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲1.46MB] [CPU: ▲10.99ms] Passed 4 tests

Server-side resources used by Product of the Day for WooCommerce
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /4.91 ▲1.4547.36 ▲0.20
Dashboard /wp-admin4.81 ▲1.5067.39 ▲5.03
Posts /wp-admin/edit.php4.86 ▲1.5072.67 ▲23.41
Add New Post /wp-admin/post-new.php7.32 ▲1.44113.37 ▲18.25
Media Library /wp-admin/upload.php4.67 ▲1.4458.67 ▲20.49

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

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 90 new files
Database: no new tables, 8 new options
New WordPress options
br-products_of_day-options
db_upgraded
theysaidso_admin_options
widget_recent-comments
berocket_admin_notices_rate_stars
can_compress_scripts
widget_theysaidso_widget
widget_recent-posts

Browser metrics Passed 4 tests

Product of the Day for WooCommerce: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,836 ▲9013.19 ▼1.211.93 ▲0.1240.64 ▼11.14
Dashboard /wp-admin2,242 ▲515.89 ▼0.16103.23 ▲0.7697.27 ▲54.79
Posts /wp-admin/edit.php2,130 ▲412.08 ▲0.0338.59 ▼0.2336.63 ▲0.30
Add New Post /wp-admin/post-new.php1,568 ▲2618.18 ▼0.12642.88 ▼24.2857.97 ▼1.23
Media Library /wp-admin/upload.php1,421 ▲304.19 ▲0.05101.40 ▲2.4776.72 ▲31.62

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • Zombie WordPress options were found after uninstall: 8 options
    • berocket_admin_notices_rate_stars
    • widget_recent-posts
    • db_upgraded
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • berocket_key_activated_plugins
    • can_compress_scripts
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 50% 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
  • 26× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/product-of-the-day-for-woocommerce/berocket/includes/error_notices.php:5
    • > PHP Notice
      Undefined variable: name in wp-content/plugins/product-of-the-day-for-woocommerce/berocket/templates/conditions.php on line 2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/product-of-the-day-for-woocommerce/berocket/includes/admin_notices.php:797
    • > PHP Fatal error
      Uncaught Error: Call to undefined function apply_filters() in wp-content/plugins/product-of-the-day-for-woocommerce/templates/widget.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/product-of-the-day-for-woocommerce/berocket/libraries/popup.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/product-of-the-day-for-woocommerce/main.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/product-of-the-day-for-woocommerce/berocket/includes/widget.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/product-of-the-day-for-woocommerce/berocket/framework.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/product-of-the-day-for-woocommerce/main.php:3
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/product-of-the-day-for-woocommerce/berocket/templates/settings_footer.php:3

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 87% from 29 tests

readme.txt 88% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
Attributes that need to be fixed:
  • Screenshots: Please add an image for screenshot #1 (General settings)
  • Tags: Please delete some tags, you are using 37 tag instead of maximum 10
The official readme.txt is a good inspiration

product-of-the-day-for-woocommerce/woocommerce-products-of-day.php 85% from 13 tests

The main PHP script in "Product of the Day for WooCommerce" version 3.5.7.8 is automatically included on every request by WordPress
It is important to fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("product-of-the-day-for-woocommerce.php" instead of "woocommerce-products-of-day.php")
  • Text Domain: The text domain should only use lowercase characters and dashes

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Good job! No executable or dangerous file extensions detected21,093 lines of code in 64 files:
LanguageFilesBlank linesComment linesLines of code
PHP384449469,487
CSS152,513769,443
JavaScript743581,694
PO File2194216430
XML20039

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.55
Average class complexity49.04
▷ Minimum class complexity1.00
▷ Maximum class complexity240.00
Average method complexity4.62
▷ Minimum method complexity1.00
▷ Maximum method complexity98.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes28
▷ Abstract classes00.00%
▷ Concrete classes28100.00%
▷ Final classes00.00%
Methods372
▷ Static methods15140.59%
▷ Public methods372100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions32
▷ Named functions32100.00%
▷ Anonymous functions00.00%
Constants8
▷ Global constants8100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
6 PNG files occupy 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
berocket/assets/css/mail.png2.59KB1.92KB▼ 26.02%
berocket/assets/images/submenu-icon.png0.62KB0.50KB▼ 20.13%
berocket/assets/images/submenu-icon-a.png0.54KB0.48KB▼ 10.20%
berocket/libraries/templates/default.png3.87KB2.63KB▼ 31.94%
berocket/libraries/addons/default.png3.87KB2.63KB▼ 31.94%