94% add-tag-to-woocommerce-products

Code Review | Add Custom Tags To WooCommerce Products

WordPress plugin Add Custom Tags To WooCommerce Products scored 94% from 54 tests.

About plugin

  • Plugin page: add-tag-to-woocom...
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4-4.5.2
  • WordPress version: 5.9.2
  • First release: Mar 25, 2017
  • Latest release: Mar 25, 2017
  • Number of updates: 14
  • Update frequency: every 0.8 days
  • Top authors: themelocation (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 646 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Installer ran successfully

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

An overview of server-side resources used by Add Custom Tags To WooCommerce Products
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.52 ▲0.0152.90 ▲2.42
Dashboard /wp-admin3.41 ▲0.0032.92 ▼1.42
Posts /wp-admin/edit.php3.64 ▲0.0038.21 ▲0.01
Add New Post /wp-admin/post-new.php6.89 ▼0.0898.30 ▼1,152.52
Media Library /wp-admin/upload.php3.29 ▼0.0122.49 ▼5.67

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

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 12 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

An overview of browser requirements for Add Custom Tags To WooCommerce Products
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,763 ▲916.22 ▲0.457.97 ▲1.902.24 ▼0.59
Dashboard /wp-admin2,888 ▲276.14 ▼0.05115.20 ▼17.11153.93 ▼9.68
Posts /wp-admin/edit.php2,694 ▲63.22 ▼0.0161.96 ▼0.50135.53 ▼5.48
Add New Post /wp-admin/post-new.php1,668 ▲718.21 ▲1.36399.78 ▲9.58154.01 ▼2.08
Media Library /wp-admin/upload.php1,698 ▼05.48 ▼0.01152.89 ▲7.76193.30 ▲7.17

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Uninstall script ran successfully

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
The smoke test was a success, however most plugin functionality was not tested

SRP 50% 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
Please take a closer look at the following
  • 3× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function apply_filters() in wp-content/plugins/add-tag-to-woocommerce-products/wc_tag_on_products.php:12
    • > PHP Fatal error
      Uncaught Error: Call to a member function get_row() on null in wp-content/plugins/add-tag-to-woocommerce-products/admin/display_setting_page.php:6
    • > PHP Notice
      Trying to get property 'prefix' of non-object in wp-content/plugins/add-tag-to-woocommerce-products/admin/display_setting_page.php on line 5

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser issues were found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
Attributes that need to be fixed:
  • Screenshots: These screenshots do not have images: #1 (Dashboard page for settings), #2 (Dashboard page for editing a tag text and number of days), #3 (Thats how tag look on frontend end on products)
The official readme.txt is a good inspiration

add-tag-to-woocommerce-products/wc_tag_on_products.php 92% from 13 tests

The main file in "Add Custom Tags To WooCommerce Products" v. 1.0 serves as a complement to information provided in readme.txt and as the entry point to the plugin
Please take the time to fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("add-tag-to-woocommerce-products.php" instead of "wc_tag_on_products.php")

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
There were no executable files found in this plugin257 lines of code in 8 files:
LanguageFilesBlank linesComment linesLines of code
PHP7589308241
CSS10016

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.13
Average class complexity2.60
▷ Minimum class complexity1.00
▷ Maximum class complexity4.00
Average method complexity1.35
▷ Minimum method complexity1.00
▷ Maximum method complexity4.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes5
▷ Abstract classes00.00%
▷ Concrete classes5100.00%
▷ Final classes00.00%
Methods23
▷ Static methods14.35%
▷ Public methods1982.61%
▷ Protected methods00.00%
▷ Private methods417.39%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
3 PNG files occupy 0.15MB with 0.09MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-2.png23.17KB9.50KB▼ 59.00%
screenshot-1.png47.65KB19.35KB▼ 59.39%
screenshot-3.png80.90KB27.74KB▼ 65.71%