10% codeswholesale-for-woocommerce

Code Review | CodesWholesale.com for WooCommerce

WordPress plugin CodesWholesale.com for WooCommerce scored10%from 54 tests.

About plugin

  • Plugin page: codeswholesale-fo...
  • Plugin version: 2.6.6
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4.0-5.0.1
  • WordPress version: 6.3.1
  • First release: Apr 18, 2016
  • Latest release: Jul 8, 2019
  • Number of updates: 88
  • Update frequency: every 13.4 days
  • Top authors: devteamcodeswholesale (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

50+ active /10,985 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
These installer errors require your attention
  • The plugin cannot be installed
    • > Warning in wp-content/plugins/codeswholesale-for-woocommerce/codeswholesale.php+127
    Use of undefined constant FILE - assumed 'FILE' (this will throw an Error in a future version of PHP)

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

Server-side resources used by CodesWholesale.com for WooCommerce
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0040.84 ▲3.00
Dashboard /wp-admin3.31 ▼0.0447.67 ▼13.70
Posts /wp-admin/edit.php3.36 ▲0.0044.30 ▼1.04
Add New Post /wp-admin/post-new.php5.89 ▲0.0080.28 ▼26.04
Media Library /wp-admin/upload.php3.23 ▲0.0035.38 ▲1.58

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

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 614 new files
Database: 7 new tables, 6 new options
New tables
wp_codeswholesale_refresh_tokens
wp_codeswholesale_import_properties
wp_codeswholesale_currency_control
wp_codeswholesale_access_tokens
wp_codeswholesale_postback_import_details
wp_codeswholesale_postback_import_properties
wp_codeswholesale_products
New WordPress options
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-posts
can_compress_scripts
db_upgraded
widget_recent-comments

Browser metrics Passed 4 tests

This is an overview of browser requirements for CodesWholesale.com for WooCommerce
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.14 ▼0.461.84 ▲0.0543.21 ▲0.86
Dashboard /wp-admin2,198 ▲205.61 ▼0.1394.32 ▼5.8542.18 ▲0.21
Posts /wp-admin/edit.php2,100 ▼01.99 ▼0.0135.60 ▼1.0933.32 ▼2.48
Add New Post /wp-admin/post-new.php1,531 ▲523.27 ▼0.46667.17 ▲0.5663.63 ▲6.90
Media Library /wp-admin/upload.php1,400 ▼34.21 ▲0.04100.65 ▲5.4542.51 ▼1.00

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
You still need to fix the following
  • Zombie tables detected upon uninstall: 7 tables
    • wp_codeswholesale_products
    • wp_codeswholesale_postback_import_properties
    • wp_codeswholesale_import_properties
    • wp_codeswholesale_postback_import_details
    • wp_codeswholesale_currency_control
    • wp_codeswholesale_access_tokens
    • wp_codeswholesale_refresh_tokens
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_recent-comments
    • widget_recent-posts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • can_compress_scripts
    • db_upgraded

Smoke tests 50% 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 0% 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
  • 3× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/codeswholesale-for-woocommerce/vendor/codeswholesale/sdk/examples/list-order-history.php
    • > /wp-content/plugins/codeswholesale-for-woocommerce/vendor/codeswholesale/sdk/examples/single-product.php
    • > /wp-content/plugins/codeswholesale-for-woocommerce/vendor/codeswholesale/sdk/tests/Bootstrap.php
  • 284× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      require_once(): Failed opening required '../vendor/autoload.php' (include_path='.:/usr/share/php') in wp-content/plugins/codeswholesale-for-woocommerce/vendor/codeswholesale/sdk/examples/list-order-history.php on line 8
    • > PHP Fatal error
      Uncaught Error: Class 'GuzzleHttp\\Cookie\\CookieJar' not found in wp-content/plugins/codeswholesale-for-woocommerce/vendor/guzzlehttp/guzzle/src/Cookie/SessionCookieJar.php:7
    • > PHP Fatal error
      Uncaught Error: Interface 'CodesWholesaleFramework\\Action' not found in wp-content/plugins/codeswholesale-for-woocommerce/vendor/codeswholesale/cw-extension-framework/src/Orders/Codes/SendCodesAction.php:32
    • > PHP Fatal error
      Uncaught Error: Class 'GuzzleHttp\\Tests\\Psr7\\BaseTest' not found in wp-content/plugins/codeswholesale-for-woocommerce/vendor/guzzlehttp/psr7/tests/UriTest.php:9
    • > PHP Fatal error
      require_once(): Failed opening required '../vendor/autoload.php' (include_path='.:/usr/share/php') in wp-content/plugins/codeswholesale-for-woocommerce/vendor/codeswholesale/sdk/examples/fetch-product-import.php on line 13
    • > PHP Fatal error
      Uncaught Error: Class 'CodesWholesale\\Resource\\Resource' not found in wp-content/plugins/codeswholesale-for-woocommerce/vendor/codeswholesale/sdk/src/CodesWholesale/Resource/Error.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'GuzzleHttp\\Promise\\RejectionException' not found in wp-content/plugins/codeswholesale-for-woocommerce/vendor/guzzlehttp/promises/src/CancellationException.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/codeswholesale-for-woocommerce/includes/admin/views/view-blocked.php:2
    • > PHP Fatal error
      Uncaught Error: Interface 'CodesWholesaleFramework\\Retriever\\LinkRetriever' not found in wp-content/plugins/codeswholesale-for-woocommerce/includes/retrievers/wp-links-retriever.php:5
    • > PHP Warning
      Use of undefined constant STDERR - assumed 'STDERR' (this will throw an Error in a future version of PHP) in wp-content/plugins/codeswholesale-for-woocommerce/vendor/guzzlehttp/guzzle/build/Burgomaster.php on line 115

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine on the user side

Optimizations

Plugin configuration 87% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
Please fix the following attributes:
  • Screenshots: No descriptions were found for these screenshots #1, #2, #3, #4, #5, #6, #7, #8 in codeswholesale-for-woocommerce/assets to your readme.txt
  • Tags: Please reduce the number of tags, currently 12 tag instead of maximum 10
You can take inspiration from this readme.txt

codeswholesale-for-woocommerce/codeswholesale.php 85% from 13 tests

"CodesWholesale.com for WooCommerce" version 2.6.6's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
Please make the necessary changes and fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("codeswholesale-for-woocommerce.php" instead of "codeswholesale.php")
  • Git Repository: An alternative Git repository was detected

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Everything looks great! No dangerous files found in this plugin38,951 lines of code in 471 files:
LanguageFilesBlank linesComment linesLines of code
PHP4116,55410,48431,972
Markdown171,13803,739
reStructuredText88451,0531,114
JSON1100828
CSS2980518
make4475202
JavaScript11860172
YAML7351150
XML6121105
SVG10197
Python1182228
SQL13216
Dockerfile18010

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.19
Average class complexity6.14
▷ Minimum class complexity1.00
▷ Maximum class complexity88.00
Average method complexity1.75
▷ Minimum method complexity1.00
▷ Maximum method complexity27.00
Code structure
Namespaces53
Interfaces41
Traits2
Classes331
▷ Abstract classes123.63%
▷ Concrete classes31996.37%
▷ Final classes165.02%
Methods2,644
▷ Static methods1816.85%
▷ Public methods2,34888.80%
▷ Protected methods772.91%
▷ Private methods2198.28%
Functions510
▷ Named functions7314.31%
▷ Anonymous functions43785.69%
Constants361
▷ Global constants20.55%
▷ Class constants35999.45%
▷ Public constants359100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
4 PNG files occupy 0.24MB with 0.06MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
vendor/codeswholesale/cw-extension-framework/src/Assets/img/codeswholesale.png2.78KB2.09KB▼ 24.83%
vendor/guzzlehttp/guzzle/docs/_static/guzzle-icon.png0.78KB0.94KB0.00%
vendor/guzzlehttp/guzzle/docs/_static/logo.png241.87KB69.68KB▼ 71.19%
vendor/codeswholesale/cw-extension-framework/src/Assets/img/codeswholesale-icon.png0.14KB0.14KB▼ 0.68%