10% x-cart-integration

Code Review | X-Cart Integration

WordPress plugin X-Cart Integration scored10%from 54 tests.

About plugin

  • Plugin page: x-cart-integration
  • Plugin version: 0.3
  • PHP version: 7.4.16
  • WordPress compatibility: 2.8-4.7
  • WordPress version: 6.3.1
  • First release: Sep 8, 2015
  • Latest release: Mar 16, 2017
  • Number of updates: 22
  • Update frequency: every 25.7 days
  • Top authors: xcart_developers (100%)

Code review

54 tests

User reviews

5 reviews

Install metrics

10+ active /3,373 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
It is recommended to fix the following installer errors
  • The plugin cannot be installed
    • > Deprecated in wp-content/plugins/x-cart-integration/xcart-integration.php+215
    Methods with the same name as their class will not be constructors in a future version of PHP; XcartMinicartWidget has a deprecated constructor

Server metrics [RAM: ▼1.84MB] [CPU: ▼56.87ms] Passed 4 tests

Server-side resources used by X-Cart Integration
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /2.16 ▼1.305.26 ▼36.30
Dashboard /wp-admin2.18 ▼1.176.38 ▼52.20
Posts /wp-admin/edit.php2.18 ▼1.186.35 ▼45.76
Add New Post /wp-admin/post-new.php2.18 ▼3.717.42 ▼93.22
Media Library /wp-admin/upload.php2.18 ▼1.056.10 ▼25.90

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 106 new files
Database: no new tables, 10 new options
New WordPress options
widget_xcartminicart
db_upgraded
widget_recent-posts
widget_recent-comments
widget_xcartcategories
can_compress_scripts
widget_theysaidso_widget
xcart_store_page_id
theysaidso_admin_options
widget_xcartsearch

Browser metrics Passed 4 tests

An overview of browser requirements for X-Cart Integration
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,934 ▲16314.13 ▼0.4535.09 ▲33.2044.99 ▲2.54
Dashboard /wp-admin2,223 ▲355.82 ▲0.9495.98 ▼11.6239.97 ▼0.29
Posts /wp-admin/edit.php2,109 ▲202.05 ▲0.0334.43 ▼2.5538.38 ▲4.26
Add New Post /wp-admin/post-new.php1,531 ▼323.75 ▲0.57621.70 ▼53.5753.05 ▲1.73
Media Library /wp-admin/upload.php1,408 ▲204.22 ▼0.0394.22 ▼6.6043.60 ▲1.72

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • Uninstall procedure had uncaught errors
    • > Deprecated in wp-content/plugins/x-cart-integration/xcart-integration.php+215
    Methods with the same name as their class will not be constructors in a future version of PHP; XcartMinicartWidget has a deprecated constructor
  • This plugin does not fully uninstall, leaving 10 options in the database
    • db_upgraded
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-comments
    • widget_theysaidso_widget
    • xcart_store_page_id
    • widget_recent-posts
    • widget_xcartcategories
    • widget_xcartminicart
    • widget_xcartsearch

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
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Almost there! Just fix the following items
  • 39× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Notice
      Undefined variable: translate in wp-content/plugins/x-cart-integration/templates/default.php on line 9
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/x-cart-integration/templates/elements/product-browser.php on line 3
    • > PHP Notice
      Undefined variable: attributes in wp-content/plugins/x-cart-integration/templates/elements/product-browser.php on line 3
    • > PHP Notice
      Undefined variable: translate in wp-content/plugins/x-cart-integration/js/init.php on line 51
    • > PHP Notice
      Undefined variable: jsSrc in wp-content/plugins/x-cart-integration/js/init.php on line 34
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/x-cart-integration/templates/elements/product-grid.php on line 3
    • > PHP Notice
      Undefined variable: attributes in wp-content/plugins/x-cart-integration/templates/elements/product-browser.php on line 3
    • > PHP Notice
      Undefined variable: template in wp-content/plugins/x-cart-integration/js/init.php on line 48
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/x-cart-integration/templates/default/elements/product-browser.php on line 1
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/x-cart-integration/templates/elements/product-grid.php on line 3

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
There were no browser issues found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
These attributes need your attention:
  • Tags: Please reduce the number of tags, currently 15 tag instead of maximum 10
  • Screenshots: These screenshots do not have images: #1 (Page in a Wordpress blog with Product grid, X-Cart Search, and X-Cart Categories menu widgets), #2 (Single product widget), #3 (Code in admin backend of X-Cart store to insert in a text in a website), #4 (Code in a blog text from admin backend of X-Cart store), #5 (Cart with products), #6 (Checkout)
You can take inspiration from this readme.txt

x-cart-integration/xcart-integration.php 92% from 13 tests

The main PHP script in "X-Cart Integration" version 0.3 is automatically included on every request by WordPress
Please make the necessary changes and fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("x-cart-integration.php" instead of "xcart-integration.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Success! There were no dangerous files found in this plugin6,278 lines of code in 72 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript386852754,414
CSS7881311,031
PHP2511364677
PO File1510112
SVG10144

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.17
Average class complexity4.00
▷ Minimum class complexity4.00
▷ Maximum class complexity4.00
Average method complexity1.75
▷ Minimum method complexity1.00
▷ Maximum method complexity4.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods12
▷ Static methods00.00%
▷ Public methods12100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions20
▷ Named functions20100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
16 PNG files occupy 1.68MB with 0.65MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/btn-close.png0.43KB0.59KB0.00%
screenshot-6.png278.07KB103.74KB▼ 62.69%
screenshot-5.png94.94KB37.45KB▼ 60.55%
templates/default/images/no_image.png6.63KB2.08KB▼ 68.63%
templates/default/images/basket-icon.png0.53KB0.84KB0.00%