62% webinane-commerce

Code Review | WP Commerce

WordPress plugin WP Commerce scored 62% from 54 tests.

About plugin

  • Plugin page: webinane-commerce
  • Plugin version: 2.2.3
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-5.5
  • WordPress version: 5.8.1
  • First release: Jun 26, 2019
  • Latest release: Dec 1, 2020
  • Number of updates: 149
  • Update frequency: every 3.5 days
  • Top authors: webinnane (100%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active / 5,976 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
This plugin's installer ran successfully

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

Server-side resources used by WP Commerce
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.08 ▲0.3639.97 ▲16.19
Dashboard /wp-admin4.25 ▲1.2065.36 ▲16.97
Posts /wp-admin/edit.php4.32 ▲1.2157.47 ▲13.01
Add New Post /wp-admin/post-new.php6.14 ▲0.7195.78 ▼555.42
Media Library /wp-admin/upload.php4.26 ▲1.2638.12 ▲4.08
WP Commerce /wp-admin/admin.php?page=wp-commerce-settings4.2459.46
Extensions /wp-admin/admin.php?page=wp-commerce-extensions4.2442.45
Dashboard /wp-admin/admin.php?page=wp-commerce-dashboard4.2438.74
Orders /wp-admin/edit.php?post_type=orders4.3048.62

Server storage [IO: ▲7.07MB] [DB: ▲0.13MB] Passed 3 tests

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 1,307 new files
Database: 7 new tables, 2 new options
New tables
wp_wpcommerce_order_items
wp_wpcommerce_log
wp_wpcommerce_customers
wp_wpcommerce_payment_tokens
wp_wpcommerce_customer_meta
wp_wpcommerce_sessions
wp_wpcommerce_payment_tokenmeta
New WordPress options
_wpcommerce_settings
wpcm_user_data

Browser metrics Passed 4 tests

Checking browser requirements for WP Commerce
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /4,310 ▲71422.37 ▲6.569.35 ▲0.2250.91 ▲2.52
Dashboard /wp-admin3,551 ▲61711.58 ▲5.66233.16 ▲92.61151.92 ▲29.99
Posts /wp-admin/edit.php3,237 ▲4988.30 ▲5.62135.94 ▲66.25116.31 ▲24.81
Add New Post /wp-admin/post-new.php3,921 ▲2,34023.42 ▲5.32458.50 ▲54.53116.73 ▼2.24
Media Library /wp-admin/upload.php2,063 ▲2568.90 ▲3.89175.69 ▲20.04147.38 ▲19.17
WP Commerce /wp-admin/admin.php?page=wp-commerce-settings5,33919.69191.72148.81
Extensions /wp-admin/admin.php?page=wp-commerce-extensions1,92110.43176.91107.19
Dashboard /wp-admin/admin.php?page=wp-commerce-dashboard2,04111.56189.66134.56
Orders /wp-admin/edit.php?post_type=orders1,9738.29136.0293.93

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 7 tables in the database
    • wp_wpcommerce_sessions
    • wp_wpcommerce_payment_tokenmeta
    • wp_wpcommerce_log
    • wp_wpcommerce_customer_meta
    • wp_wpcommerce_customers
    • wp_wpcommerce_order_items
    • wp_wpcommerce_payment_tokens
  • This plugin did not uninstall successfully, leaving 2 options in the database
    • wpcm_user_data
    • _wpcommerce_settings

Smoke tests 25% 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
Almost there! Just fix the following items
  • 9× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/webinane-commerce/templates/checkout/gateways.php
    • > /wp-content/plugins/webinane-commerce/templates/admin/settings.php
    • > /wp-content/plugins/webinane-commerce/vendor/illuminate/pagination/resources/views/simple-default.blade.php
    • > /wp-content/plugins/webinane-commerce/vendor/illuminate/pagination/resources/views/semantic-ui.blade.php
    • > /wp-content/plugins/webinane-commerce/vendor/illuminate/pagination/resources/views/simple-bootstrap-4.blade.php
    • > /wp-content/plugins/webinane-commerce/templates/emails/layouts/template3.php
    • > /wp-content/plugins/webinane-commerce/vendor/illuminate/pagination/resources/views/bootstrap-4.blade.php
    • > /wp-content/plugins/webinane-commerce/templates/emails/layouts/template2.php
    • > /wp-content/plugins/webinane-commerce/vendor/illuminate/pagination/resources/views/default.blade.php
  • 695× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/webinane-commerce/templates/orders/success-page.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'PayPal\\Core\\PPXmlMessage' not found in wp-content/plugins/webinane-commerce/vendor/paypal/merchant-sdk-php/lib/PayPal/EBLBaseComponents/EnhancedDataType.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wpcm_get_cart_content() in wp-content/plugins/webinane-commerce/templates/checkout/checkout.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'PayPal\\Handler\\PPGenericServiceHandler' not found in wp-content/plugins/webinane-commerce/vendor/paypal/sdk-core-php/lib/PayPal/Handler/PPPlatformServiceHandler.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'PayPal\\Core\\PPXmlMessage' not found in wp-content/plugins/webinane-commerce/vendor/paypal/merchant-sdk-php/lib/PayPal/EBLBaseComponents/ExecuteCheckoutOperationsRequestDetailsType.php:16
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/webinane-commerce/templates/global/add-to-cart-button.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'PayPal\\Core\\PPXmlMessage' not found in wp-content/plugins/webinane-commerce/vendor/paypal/merchant-sdk-php/lib/PayPal/EBLBaseComponents/IncentiveDetailsType.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'PayPal\\EBLBaseComponents\\AbstractRequestType' not found in wp-content/plugins/webinane-commerce/vendor/paypal/merchant-sdk-php/lib/PayPal/PayPalAPI/DoNonReferencedCreditRequestType.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'PayPal\\Core\\PPXmlMessage' not found in wp-content/plugins/webinane-commerce/vendor/paypal/merchant-sdk-php/lib/PayPal/PayPalAPI/BMButtonSearchReq.php:9
    • > PHP Fatal error
      Uncaught Error: Interface 'Illuminate\\Contracts\\Auth\\Guard' not found in wp-content/plugins/webinane-commerce/vendor/illuminate/contracts/Auth/StatefulGuard.php:5

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Please fix the following browser errors
    • > GET request to /wp-admin/admin.php?page=wp-commerce-settings
    • > Network (severe)
    index.php/wp-json/webinane-commerce/v1/countries//states - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
3 plugin tags: paypal, ecommerce, payment gateways

webinane-commerce/webinane-commerce.php Passed 13 tests

The main PHP file in "WP Commerce" ver. 2.2.3 adds more information about the plugin and also serves as the entry point for this plugin
26 characters long description:
eCommerce WordPress plugin

Code Analysis 97% from 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
There were no executable files found in this plugin100,099 lines of code in 1,225 files:
LanguageFilesBlank linesComment linesLines of code
PHP1,00016,18757,33666,756
CSS131,1365010,741
JavaScript241,2001,56710,172
JSON161508,302
XSD392482,803
Markdown92100497
HTML2280411
SVG404180
Blade51119136
reStructuredText1473048
XML10045
YAML2018

PHP code 50% from 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
Please tend to the following items
  • Cyclomatic complexity of methods should be reduced to less than 100 (currently 139)
Cyclomatic complexity
Average complexity per logical line of code0.32
Average class complexity7.46
▷ Minimum class complexity1.00
▷ Maximum class complexity337.00
Average method complexity2.19
▷ Minimum method complexity1.00
▷ Maximum method complexity139.00
Code structure
Namespaces111
Interfaces117
Traits52
Classes767
▷ Abstract classes283.65%
▷ Concrete classes73996.35%
▷ Final classes30.41%
Methods5,759
▷ Static methods88415.35%
▷ Public methods4,64280.60%
▷ Protected methods97816.98%
▷ Private methods1392.41%
Functions484
▷ Named functions15632.23%
▷ Anonymous functions32867.77%
Constants143
▷ Global constants1611.19%
▷ Class constants12788.81%
▷ Public constants12598.43%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
27 PNG files occupy 0.07MB with 0.03MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/ui-icons_fcd113_256x240.png4.44KB4.17KB▼ 6.02%
assets/images/ui-bg_gloss-wave_75_2191c0_500x100.png5.84KB2.74KB▼ 53.09%
assets/images/ui-icons_f7a50d_256x240.png4.44KB4.17KB▼ 6.02%
assets/images/icons/fltr-icon2.png1.21KB0.59KB▼ 50.97%
assets/images/icons/wdgt-icon1.png1.07KB0.21KB▼ 79.89%