84% add-tag-to-woocommerce-products

Code Review | Add Custom Tags To WooCommerce Products

WordPress plugin Add Custom Tags To WooCommerce Products scored84%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: 6.3.1
  • 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 /845 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
This plugin's installer ran successfully

Server metrics [RAM: ▼0.01MB] [CPU: ▼1.20ms] Passed 4 tests

A check of server-side resources used by Add Custom Tags To WooCommerce Products
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0043.50 ▲1.37
Dashboard /wp-admin3.31 ▼0.0449.79 ▼10.18
Posts /wp-admin/edit.php3.36 ▲0.0052.81 ▲4.69
Add New Post /wp-admin/post-new.php5.89 ▲0.00102.23 ▲11.01
Media Library /wp-admin/upload.php3.23 ▲0.0035.25 ▼0.68

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

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 12 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
db_upgraded
can_compress_scripts
theysaidso_admin_options
widget_recent-posts
widget_theysaidso_widget

Browser metrics Passed 4 tests

A check of browser resources used by Add Custom Tags To WooCommerce Products
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,815 ▲5413.27 ▼1.481.80 ▲0.0447.59 ▲4.15
Dashboard /wp-admin2,218 ▲154.85 ▼0.01105.41 ▼32.4139.16 ▼18.16
Posts /wp-admin/edit.php2,103 ▲32.03 ▲0.0238.72 ▼3.6435.73 ▼1.09
Add New Post /wp-admin/post-new.php1,545 ▲1423.20 ▲0.23649.18 ▼33.0661.57 ▲8.49
Media Library /wp-admin/upload.php1,400 ▼04.23 ▼0.0597.81 ▼10.3645.15 ▼4.16

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
These items require your attention
  • The uninstall procedure has failed, leaving 6 options in the database
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-comments
    • widget_recent-posts
    • db_upgraded
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Good news, no errors were detected

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please fix the following
  • 3× PHP files trigger server errors when accessed directly:
    • > 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
    • > 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

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
Attributes that need to be fixed:
  • Screenshots: These screenshots require 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 primary PHP file in "Add Custom Tags To WooCommerce Products" version 1.0 is used by WordPress to initiate all plugin functionality
You should first fix the following items:
  • 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 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Everything looks great! No dangerous files found in this plugin257 lines of code in 8 files:
LanguageFilesBlank linesComment linesLines of code
PHP7589308241
CSS10016

PHP code Passed 2 tests

Analyzing 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.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-3.png80.90KB27.74KB▼ 65.71%
screenshot-2.png23.17KB9.50KB▼ 59.00%
screenshot-1.png47.65KB19.35KB▼ 59.39%