68% woo-links-to-product

Code Review | WooCommerce Links to Product

WordPress plugin WooCommerce Links to Product scored68%from 54 tests.

About plugin

  • Plugin page: woo-links-to-product
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.8
  • WordPress version: 6.3.1
  • First release: Jul 8, 2017
  • Latest release: Jul 8, 2017
  • Number of updates: 8
  • Update frequency: every 0.1 days
  • Top authors: ernestortiz (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /924 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▼0.87MB] [CPU: ▼26.25ms] Passed 4 tests

Analyzing server-side resources used by WooCommerce Links to Product
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.55 ▲0.0939.52 ▼0.18
Dashboard /wp-admin3.41 ▲0.0644.14 ▼19.00
Posts /wp-admin/edit.php3.52 ▲0.1646.35 ▲3.22
Add New Post /wp-admin/post-new.php2.16 ▼3.737.72 ▼89.03
Media Library /wp-admin/upload.php3.33 ▲0.1036.98 ▲4.12
Links to Product /wp-admin/admin.php?page=woocommerce-links-to-product2.165.55

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

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 11 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
can_compress_scripts
widget_theysaidso_widget
db_upgraded
widget_recent-posts
widget_recent-comments

Browser metrics Passed 4 tests

WooCommerce Links to Product: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,912 ▲16613.63 ▼1.047.18 ▲5.5543.16 ▲0.20
Dashboard /wp-admin2,206 ▲184.88 ▼1.02108.00 ▼10.1542.53 ▼6.09
Posts /wp-admin/edit.php2,092 ▲61.97 ▼0.0940.86 ▲5.4534.24 ▼2.36
Add New Post /wp-admin/post-new.php1,514 ▼617.65 ▼5.49621.75 ▼105.4251.76 ▼6.80
Media Library /wp-admin/upload.php1,388 ▼34.20 ▲0.0698.83 ▲1.8244.99 ▼0.75
Links to Product /wp-admin/admin.php?page=woocommerce-links-to-product9662.0524.7130.08

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
These items require your attention
  • This plugin cannot be uninstalled
    • > Notice in wp-content/plugins/woo-links-to-product/uninstall.php+7
    Trying to access array offset on value of type bool
  • This plugin does not fully uninstall, leaving 6 options in the database
    • can_compress_scripts
    • widget_recent-posts
    • widget_recent-comments
    • db_upgraded
    • widget_theysaidso_widget
    • theysaidso_admin_options

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Almost there, just fix the following server-side errors
    • > GET request to /wp-admin/admin.php?page=woocommerce-links-to-product
    • > Notice in wp-content/plugins/woo-links-to-product/links2p.php+26
    Undefined index: post
    • > GET request to /wp-admin/admin.php?page=woocommerce-links-to-product
    • > Notice in wp-content/plugins/woo-links-to-product/links2p.php+27
    Undefined index: post_type
    • > GET request to /wp-admin/admin.php?page=woocommerce-links-to-product
    • > Notice in wp-content/plugins/woo-links-to-product/optionspage.php+110
    Undefined index: l_header
    • > GET request to /wp-admin/admin.php?page=woocommerce-links-to-product
    • > Notice in wp-content/plugins/woo-links-to-product/optionspage.php+112
    Undefined index: l_footer
    • > GET request to /wp-admin/admin.php?page=woocommerce-links-to-product
    • > Notice in wp-content/plugins/woo-links-to-product/optionspage.php+168
    Undefined index: on_uninstall

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
Please take a closer look at the following
  • 4× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/woo-links-to-product/shortcodes.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/woo-links-to-product/optionspage.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/woo-links-to-product/links2p.php:18
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/woo-links-to-product/ajaxes.php:7

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser issues were found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
3 plugin tags: retailer, woocommerce, product links

woo-links-to-product/links2p.php 85% from 13 tests

The main file in "WooCommerce Links to Product" v. 1.0.0 serves as a complement to information provided in readme.txt and as the entry point to the plugin
It is important to fix the following:
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug
  • Main file name: The principal plugin file should be the same as the plugin slug ("woo-links-to-product.php" instead of "links2p.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Good job! No executable or dangerous file extensions detected775 lines of code in 9 files:
LanguageFilesBlank linesComment linesLines of code
PHP54490533
JavaScript21441213
CSS21329

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.36
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions23
▷ Named functions23100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
There were not PNG files found in your plugin