83% product-watermark-for-woocommerce

Code Review | Product Watermark for WooCommerce

WordPress plugin Product Watermark for WooCommerce scored 83% from 54 tests.

About plugin

  • Plugin page: product-watermark...
  • Plugin version: 1.3.5.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: 74
  • Update frequency: every 35.1 days
  • Top authors: RazyRx (60.81%)dholovnia (40.54%)

Code review

54 tests

User reviews

48 reviews

Install metrics

2,000+ active / 66,751 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
This plugin's installer ran successfully

Server metrics [RAM: ▲0.39MB] [CPU: ▲6.25ms] Passed 4 tests

An overview of server-side resources used by Product Watermark for WooCommerce
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.80 ▲0.3447.02 ▲6.13
Dashboard /wp-admin3.76 ▲0.4550.63 ▲2.19
Posts /wp-admin/edit.php3.80 ▲0.4550.98 ▲9.03
Add New Post /wp-admin/post-new.php6.27 ▲0.39105.32 ▲11.14
Media Library /wp-admin/upload.php3.60 ▲0.3743.34 ▲7.66

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

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 103 new files
Database: no new tables, 11 new options
New WordPress options
widget_recent-posts
berocket_admin_notices_rate_stars
widget_theysaidso_widget
theysaidso_admin_options
br-image_watermark-options
berocket_current_displayed_notice
BeRocket_Framework_plugins_version_check
widget_recent-comments
can_compress_scripts
db_upgraded
...

Browser metrics Passed 4 tests

Product Watermark for WooCommerce: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,020 ▲28513.63 ▼0.935.48 ▲3.4847.59 ▲0.90
Dashboard /wp-admin2,286 ▲984.97 ▼0.13102.17 ▼2.5891.84 ▲50.28
Posts /wp-admin/edit.php2,214 ▲1222.32 ▲0.3237.82 ▲0.9437.14 ▲4.57
Add New Post /wp-admin/post-new.php1,769 ▲24922.60 ▼0.65706.46 ▲4.3438.27 ▼19.42
Media Library /wp-admin/upload.php1,526 ▲1384.31 ▲0.12118.76 ▲4.2749.61 ▲2.27

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
Please fix the following items
  • This plugin does not fully uninstall, leaving 11 options in the database
    • theysaidso_admin_options
    • can_compress_scripts
    • berocket_admin_notices_rate_stars
    • berocket_current_displayed_notice
    • widget_recent-comments
    • berocket_key_activated_plugins
    • berocket_admin_notices
    • BeRocket_Framework_plugins_version_check
    • db_upgraded
    • widget_recent-posts
    • ...

Smoke tests 75% 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 50% 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
  • 26× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'BeRocket_image_watermark' not found in wp-content/plugins/product-watermark-for-woocommerce/includes/imagelib/gd.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/product-watermark-for-woocommerce/berocket/libraries/tippy.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/product-watermark-for-woocommerce/berocket/framework.php:4
    • > PHP Notice
      Undefined variable: framework_version in wp-content/plugins/product-watermark-for-woocommerce/berocket/framework_version.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/product-watermark-for-woocommerce/berocket/sale/sale.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/product-watermark-for-woocommerce/main.php:3
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/product-watermark-for-woocommerce/berocket/templates/settings_footer.php:3
    • > PHP Notice
      Undefined variable: title in wp-content/plugins/product-watermark-for-woocommerce/berocket/templates/widget.php on line 1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/product-watermark-for-woocommerce/berocket/includes/updater.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/product-watermark-for-woocommerce/addons/media_buttons/media_buttons_include.php:4

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
Please fix the following attributes:
  • Screenshots: Screenshot #1 (General settings) image required
  • Tags: You are using too many tags: 47 tag instead of maximum 10
You can take inspiration from this readme.txt

product-watermark-for-woocommerce/woocommerce-products-image-watermark.php 92% from 13 tests

The entry point to "Product Watermark for WooCommerce" version 1.3.5.8 is a PHP file that has certain tags in its header comment area
It is important to fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("product-watermark-for-woocommerce.php" instead of "woocommerce-products-image-watermark.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
No dangerous file extensions were detected20,849 lines of code in 64 files:
LanguageFilesBlank linesComment linesLines of code
CSS142,517819,584
PHP414641,6108,939
JavaScript544581,852
PO File2194216430
XML20044

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.53
Average class complexity46.06
▷ Minimum class complexity1.00
▷ Maximum class complexity240.00
Average method complexity4.67
▷ Minimum method complexity1.00
▷ Maximum method complexity98.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes31
▷ Abstract classes00.00%
▷ Concrete classes31100.00%
▷ Final classes00.00%
Methods381
▷ Static methods14237.27%
▷ Public methods381100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions34
▷ Named functions34100.00%
▷ Anonymous functions00.00%
Constants8
▷ Global constants8100.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
18 PNG files occupy 0.05MB with 0.02MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
css/images/ui-bg_glass_65_ffffff_1x400.png0.20KB0.09KB▼ 57.49%
css/images/ui-bg_glass_75_dadada_1x400.png0.26KB0.16KB▼ 38.93%
css/images/ui-bg_glass_55_fbf9ee_1x400.png0.33KB0.12KB▼ 62.09%
css/images/ui-icons_cd0a0a_256x240.png4.44KB4.17KB▼ 6.02%
css/images/ui-bg_glass_95_fef1ec_1x400.png0.32KB0.15KB▼ 54.82%