67% stock-sync-for-woocommerce

Code Review | Stock Sync for WooCommerce

WordPress plugin Stock Sync for WooCommerce scored67%from 54 tests.

About plugin

  • Plugin page: stock-sync-for-wo...
  • Plugin version: 2.6.1
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 6.0.0-6.4
  • WordPress version: 6.3.1
  • First release: Jan 26, 2019
  • Latest release: Nov 24, 2023
  • Number of updates: 57
  • Update frequency: every 31.0 days
  • Top authors: wooelements (100%)

Code review

54 tests

User reviews

5 reviews

Install metrics

1,000+ active /21,430 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲0.06MB] [CPU: ▼5.24ms] Passed 4 tests

This is a short check of server-side resources used by Stock Sync for WooCommerce
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.54 ▲0.0736.70 ▼6.30
Dashboard /wp-admin3.38 ▲0.0349.12 ▼14.30
Posts /wp-admin/edit.php3.49 ▲0.1352.03 ▲4.49
Add New Post /wp-admin/post-new.php5.96 ▲0.0794.37 ▼2.54
Media Library /wp-admin/upload.php3.30 ▲0.0636.47 ▲2.19

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

Input-output and database impact of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 74 new files
Database: 1 new table, 7 new options
New tables
wp_wss_log
New WordPress options
widget_theysaidso_widget
widget_recent-posts
can_compress_scripts
theysaidso_admin_options
db_upgraded
wss_db_version
widget_recent-comments

Browser metrics Passed 4 tests

A check of browser resources used by Stock Sync for WooCommerce
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,815 ▲5314.34 ▲0.081.83 ▲0.0737.91 ▼5.69
Dashboard /wp-admin2,195 ▲235.64 ▼0.0491.55 ▼9.1337.57 ▼9.68
Posts /wp-admin/edit.php2,100 ▼01.99 ▲0.0338.24 ▼0.8635.38 ▲3.07
Add New Post /wp-admin/post-new.php1,526 ▼023.37 ▲0.20586.38 ▼0.1858.56 ▲6.00
Media Library /wp-admin/upload.php1,394 ▼34.17 ▼0.0096.98 ▼0.7243.64 ▲2.31

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
  • Zombie tables were found after uninstall: 1 table
    • wp_wss_log
  • The uninstall procedure has failed, leaving 7 options in the database
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-comments
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-posts
    • wss_db_version

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Good news, no errors were detected

SRP 0% 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 items
  • 1× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/stock-sync-for-woocommerce/vendor/automattic/woocommerce/tests/bootstrap.php
  • 19× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/stock-sync-for-woocommerce/includes/admin/views/update.html.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/stock-sync-for-woocommerce/includes/admin/views/api-check-modal.html.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/stock-sync-for-woocommerce/vendor/automattic/woocommerce/tests/WooCommerce/Tests/HttpClient/ResponseTest.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html() in wp-content/plugins/stock-sync-for-woocommerce/includes/admin/views/log.html.php:4
    • > PHP Notice
      Undefined variable: value in wp-content/plugins/stock-sync-for-woocommerce/includes/admin/views/credentials-table.html.php on line 3
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/stock-sync-for-woocommerce/vendor/automattic/woocommerce/tests/WooCommerce/Tests/HttpClient/OAuthTest.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/stock-sync-for-woocommerce/includes/wp-flash-messages.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/stock-sync-for-woocommerce/vendor/automattic/woocommerce/tests/WooCommerce/Tests/HttpClient/BasicAuthTest.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/stock-sync-for-woocommerce/vendor/automattic/woocommerce/tests/WooCommerce/Tests/HttpClient/OptionsTest.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/stock-sync-for-woocommerce/includes/admin/views/push-all.html.php:13

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
No browser issues were found

Optimizations

Plugin configuration 86% from 29 tests

readme.txt 94% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
These attributes need your attention: The official readme.txt might help

stock-sync-for-woocommerce/woo-stock-sync.php 77% from 13 tests

The entry point to "Stock Sync for WooCommerce" version 2.6.1 is a PHP file that has certain tags in its header comment area
You should first fix the following items:
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("stock-sync-for-woocommerce.php" instead of "woo-stock-sync.php")
  • Requires at least: Required version must be the same as the one declared in readme.txt ("4.5" instead of "6.0.0")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
There were no executable files found in this plugin14,821 lines of code in 61 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript21,1721,4919,528
PHP489951,5254,339
Sass1750380
CSS27837327
Markdown1380112
JSON30090
XML21026
YAML26019

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.35
Average class complexity13.00
▷ Minimum class complexity1.00
▷ Maximum class complexity44.00
Average method complexity2.78
▷ Minimum method complexity1.00
▷ Maximum method complexity31.00
Code structure
Namespaces4
Interfaces0
Traits0
Classes32
▷ Abstract classes00.00%
▷ Concrete classes32100.00%
▷ Final classes00.00%
Methods216
▷ Static methods188.33%
▷ Public methods17581.02%
▷ Protected methods2812.96%
▷ Private methods136.02%
Functions47
▷ Named functions3880.85%
▷ Anonymous functions919.15%
Constants15
▷ Global constants533.33%
▷ Class constants1066.67%
▷ Public constants10100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
3 compressed PNG files occupy 0.00MB
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
public/admin/img/warning.png0.46KB0.43KB▼ 6.34%
public/admin/img/no.png0.74KB0.74KB0.00%
public/admin/img/yes.png0.53KB0.58KB0.00%