10% dragon-ecommerce

Code Review | Dragon Ecommerce Plugin for WordPress

WordPress plugin Dragon Ecommerce Plugin for WordPress scored10%from 54 tests.

About plugin

  • Plugin page: dragon-ecommerce
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 5.4-6.1.1
  • WordPress version: 6.3.1
  • First release: Dec 2, 2021
  • Latest release: Oct 16, 2023
  • Number of updates: 34
  • Update frequency: every 21.0 days
  • Top authors: v20202020 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,030 total downloads

Benchmarks

Plugin footprint 21% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
It is recommended to fix the following installer errors
  • Install procedure validation failed for this plugin
    • > Notice in wp-content/plugins/dragon-ecommerce/dragonecommercezyx987_importer.php+557
    Undefined variable: U

Server metrics [RAM: ▲7.54MB] [CPU: ▼11.24ms] 75% from 4 tests

Analyzing server-side resources used by Dragon Ecommerce Plugin for WordPress
The following require your attention
  • Extra RAM: Extra memory usage must be kept under 5MB (currently 7.54MB on /wp-admin/options-general.php?page=Dragon Ecommerce)
PageMemory (MB)CPU Time (ms)
Home /11.54 ▲8.0767.00 ▲27.86
Dashboard /wp-admin11.56 ▲8.2147.28 ▼11.69
Posts /wp-admin/edit.php11.56 ▲8.2052.63 ▲2.37
Add New Post /wp-admin/post-new.php11.56 ▲5.6753.78 ▼47.17
Media Library /wp-admin/upload.php11.56 ▲8.3346.84 ▲11.53

Server storage [IO: ▲18.53MB] [DB: ▲0.20MB] Passed 3 tests

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 282 new files
Database: 36 new tables, 6 new options
New tables
wp_dragonecommercezyx987_currency
wp_dragonecommercezyx987_department
wp_dragonecommercezyx987_user_token
wp_dragonecommercezyx987_city
wp_dragonecommercezyx987_group
wp_dragonecommercezyx987_product_order
wp_dragonecommercezyx987_propertyvalue
wp_dragonecommercezyx987_province
wp_dragonecommercezyx987_product_propertyvalue
wp_dragonecommercezyx987_currencyexchangerate
...
New WordPress options
widget_recent-comments
widget_theysaidso_widget
widget_recent-posts
theysaidso_admin_options
db_upgraded
can_compress_scripts

Browser metrics 50% from 4 tests

A check of browser resources used by Dragon Ecommerce Plugin for WordPress
A great user experience is important, so you should focus on the following
  • Nodes: You must limit the number of DOM nodes under 25,000 (currently 226,740 on /wp-admin/options-general.php?page=Dragon Ecommerce)
  • Script duration: Total JavaScript execution time should be lower than 1,500.00ms (currently 1,578.24ms on /wp-admin/options-general.php?page=Dragon Ecommerce)
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,793 ▲4714.28 ▲0.011.78 ▲0.1443.99 ▲2.35
Dashboard /wp-admin2,202 ▲225.58 ▲0.0590.58 ▲4.7138.74 ▼3.65
Posts /wp-admin/edit.php2,104 ▲42.01 ▲0.0038.88 ▲5.0737.16 ▼2.89
Add New Post /wp-admin/post-new.php1,529 ▼023.38 ▼0.29655.76 ▲15.1760.01 ▲10.35
Media Library /wp-admin/upload.php1,404 ▲104.20 ▼0.0293.52 ▼4.1940.31 ▼0.99
Dragon Ecommerce /wp-admin/options-general.php?page=Dragon Ecommerce226,74012.551,578.24173.16

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
Please fix the following items
  • Uninstall procedure had uncaught errors
    • > User deprecated in wp-includes/functions.php+5737
    Function has_cap was called with an argument that is deprecated since version 2.0.0! Usage of user levels is deprecated. Use capabilities instead.
  • Zombie tables were found after uninstall: 36 tables
    • wp_dragonecommercezyx987_province
    • wp_dragonecommercezyx987_product_propertyvalue
    • wp_dragonecommercezyx987_user_status
    • wp_dragonecommercezyx987_address
    • wp_dragonecommercezyx987_weight
    • wp_dragonecommercezyx987_product_quantity_alert
    • wp_dragonecommercezyx987_order_group
    • wp_dragonecommercezyx987_paymentmethod
    • wp_dragonecommercezyx987_group_property
    • wp_dragonecommercezyx987_department
    • ...
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-comments
    • can_compress_scripts
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please fix the following items
  • 114× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Braintree\\Exception' not found in wp-content/plugins/dragon-ecommerce/vendor/braintree/braintree_php/lib/Braintree/Exception/Authorization.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'Braintree\\Base' not found in wp-content/plugins/dragon-ecommerce/vendor/braintree/braintree_php/lib/Braintree/DocumentUpload.php:26
    • > PHP Fatal error
      Uncaught Error: Class 'Braintree\\Base' not found in wp-content/plugins/dragon-ecommerce/vendor/braintree/braintree_php/lib/Braintree/Disbursement.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Braintree\\Modification' not found in wp-content/plugins/dragon-ecommerce/vendor/braintree/braintree_php/lib/Braintree/AddOn.php:19
    • > PHP Fatal error
      Uncaught Error: Class 'Braintree\\Base' not found in wp-content/plugins/dragon-ecommerce/vendor/braintree/braintree_php/lib/Braintree/ApplePayCard.php:42
    • > PHP Fatal error
      Uncaught Error: Class 'Braintree\\Instance' not found in wp-content/plugins/dragon-ecommerce/vendor/braintree/braintree_php/lib/Braintree/Transaction/StatusDetails.php:19
    • > PHP Fatal error
      Uncaught Error: Class 'Braintree\\Base' not found in wp-content/plugins/dragon-ecommerce/vendor/braintree/braintree_php/lib/Braintree/Merchant.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Braintree\\Instance' not found in wp-content/plugins/dragon-ecommerce/vendor/braintree/braintree_php/lib/Braintree/Transaction/CustomerDetails.php:23
    • > PHP Fatal error
      Uncaught Error: Class 'Braintree\\Base' not found in wp-content/plugins/dragon-ecommerce/vendor/braintree/braintree_php/lib/Braintree/Modification.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Braintree\\Base' not found in wp-content/plugins/dragon-ecommerce/vendor/braintree/braintree_php/lib/Braintree/UsBankAccount.php:34

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 87% from 29 tests

readme.txt 88% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
Attributes that require attention:
  • Requires php: Invalid plugin version format
  • Screenshots: These screenshots need descriptions #1, #10, #11, #12, #13, #14, #15, #16, #17, #18, #4, #5, #6, #7, #8, #9 in dragon-ecommerce/assets to your readme.txt
You can look at the official readme.txt

dragon-ecommerce/dragonecommercezyx987_importer.php 85% from 13 tests

Analyzing the main PHP file in "Dragon Ecommerce Plugin for WordPress" version 1.0
The following require your attention:
  • Description: Keep the plugin description shorter than 140 characters (currently 244 characters long)
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("dragon-ecommerce.php" instead of "dragonecommercezyx987_importer.php")

Code Analysis 5% from 3 tests

File types 0% from 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Please fix the following items
  • Do not distribute dangerous files with your plugin
    • .crt - Security Certificate in Firefox, IE, Chrome, Safari
      • wp-content/plugins/dragon-ecommerce/vendor/braintree/braintree_php/lib/ssl/api_braintreegateway_com.ca.crt
111,670 lines of code in 234 files:
LanguageFilesBlank linesComment linesLines of code
PHP1966,3205,85450,772
CSS208,43542138,916
JavaScript113,5051,63911,784
SQL11,4997349,362
Markdown22200716
JSON30097
XML171023

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.31
Average class complexity4.88
▷ Minimum class complexity1.00
▷ Maximum class complexity63.00
Average method complexity1.70
▷ Minimum method complexity1.00
▷ Maximum method complexity36.00
Code structure
Namespaces13
Interfaces1
Traits0
Classes183
▷ Abstract classes21.09%
▷ Concrete classes18198.91%
▷ Final classes00.00%
Methods1,022
▷ Static methods44643.64%
▷ Public methods85083.17%
▷ Protected methods514.99%
▷ Private methods12111.84%
Functions220
▷ Named functions20593.18%
▷ Anonymous functions156.82%
Constants861
▷ Global constants10.12%
▷ Class constants86099.88%
▷ Public constants860100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
8 PNG files occupy 0.04MB with 0.02MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
css/images/ui-icons_555555_256x240.png6.84KB4.18KB▼ 38.84%
images/no_img2.png7.66KB3.09KB▼ 59.67%
(invalid) css/scroll_back.png0.10KB0.00KB▼ 100.00%
css/images/ui-icons_777777_256x240.png6.84KB4.18KB▼ 38.84%
images/no_img.png2.45KB1.17KB▼ 52.05%