10% gnucommerce

Code Review | GNUCommerce

WordPress plugin GNUCommerce scored10%from 54 tests.

About plugin

  • Plugin page: gnucommerce
  • Plugin version: 1.5.4
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-4.9.2
  • WordPress version: 6.3.1
  • First release: Nov 18, 2015
  • Latest release: Jun 25, 2018
  • Number of updates: 166
  • Update frequency: every 5.7 days
  • Top authors: kagla (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

200+ active /16,915 total downloads

Benchmarks

Plugin footprint 40% 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
You still need to fix the following installer errors
  • Install procedure had errors
    • > Notice in wp-content/plugins/gnucommerce/lib/gc_board_var.class.php+80
    Trying to access array offset on value of type null

Server metrics [RAM: ▼0.35MB] [CPU: ▼14.38ms] Passed 4 tests

A check of server-side resources used by GNUCommerce
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.80 ▲0.3540.08 ▼1.74
Dashboard /wp-admin3.66 ▲0.3649.75 ▼1.39
Posts /wp-admin/edit.php3.71 ▲0.3555.50 ▲7.31
Add New Post /wp-admin/post-new.php3.48 ▼2.4041.00 ▼58.04
Media Library /wp-admin/upload.php3.51 ▲0.2938.59 ▲3.66
분류 설정 /wp-admin/edit-tags.php?taxonomy=cart_cat&post_type=gnucommerce3.5138.86
환경 설정 /wp-admin/admin.php?page=gc_admin4.3247.86
상품 추가하기 /wp-admin/post-new.php?post_type=gnucommerce3.7654.76
쿠폰 관리 /wp-admin/admin.php?page=gnu_couponlist3.5834.31
게시판 관리 /wp-admin/admin.php?page=gc_board_list3.6438.93
기타 /wp-admin/admin.php?page=gnu_adm_etc3.5838.84
상품 관리 /wp-admin/edit.php?post_type=gnucommerce3.6338.21
게시판 추가 /wp-admin/admin.php?page=gc_board_form4.2436.76
주문 관리 /wp-admin/admin.php?page=gnu_orderlist3.8141.22
개인결제 관리 /wp-admin/admin.php?page=gnu_personalpaylist3.5839.42

Server storage [IO: ▲13.08MB] [DB: ▲0.04MB] Passed 3 tests

How much does this plugin use your filesystem and database?
The plugin installed successfully
Filesystem: 1,056 new files
Database: 27 new tables, 11 new options
New tables
wp_gc_shop_item_qa
wp_gc_shop_order_delete
wp_g5_board
wp_gc_shop_sendcost
wp_gc_shop_wish
wp_gc_shop_item
wp_gc_shop_coupon_log
wp_g5_write
wp_g5_term_taxonomy
wp_g5_write_comment
...
New WordPress options
gc_cf_stipulation
theysaidso_admin_options
db_upgraded
gc_cf_privacy
gc_options
widget_recent-posts
gc_board_options
can_compress_scripts
widget_gc_cat_widget
widget_theysaidso_widget
...

Browser metrics Passed 4 tests

A check of browser resources used by GNUCommerce
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,914 ▲15713.64 ▼0.661.94 ▼0.2241.48 ▲3.96
Dashboard /wp-admin2,285 ▲1005.01 ▲0.10101.28 ▼7.1993.30 ▲50.23
Posts /wp-admin/edit.php2,189 ▲1002.08 ▲0.0637.95 ▼5.8547.54 ▲10.26
Add New Post /wp-admin/post-new.php1,604 ▲8218.57 ▼4.78606.54 ▲19.4937.02 ▼17.60
Media Library /wp-admin/upload.php1,476 ▲914.29 ▲0.08105.16 ▼5.2790.20 ▲47.01
분류 설정 /wp-admin/edit-tags.php?taxonomy=cart_cat&post_type=gnucommerce1,3972.2227.9061.82
환경 설정 /wp-admin/admin.php?page=gc_admin6,7299.30294.91286.05
상품 추가하기 /wp-admin/post-new.php?post_type=gnucommerce4,4438.37190.45213.83
쿠폰 관리 /wp-admin/admin.php?page=gnu_couponlist1,0191.7826.9774.69
게시판 관리 /wp-admin/admin.php?page=gc_board_list1,2122.3242.6462.36
기타 /wp-admin/admin.php?page=gnu_adm_etc1,0451.7625.9263.17
상품 관리 /wp-admin/edit.php?post_type=gnucommerce1,2352.0235.0046.52
게시판 추가 /wp-admin/admin.php?page=gc_board_form3,6012.2943.37120.87
주문 관리 /wp-admin/admin.php?page=gnu_orderlist1,3101.8931.1574.87
개인결제 관리 /wp-admin/admin.php?page=gnu_personalpaylist1,0291.7724.8865.90

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
It is recommended to fix the following
  • The uninstall procedure failed, leaving 27 tables in the database
    • wp_gc_shop_coupon_log
    • wp_g5_scrap
    • wp_gc_shop_personalpay
    • wp_g5_board
    • wp_gc_shop_item
    • wp_gc_inicis_log
    • wp_g5_writemeta
    • wp_gc_shop_coupon
    • wp_gc_shop_item_stocksms
    • wp_g5_term_taxonomy
    • ...
  • This plugin does not fully uninstall, leaving 11 options in the database
    • widget_gc_cat_widget
    • db_upgraded
    • gc_cf_privacy
    • gc_options
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_theysaidso_widget
    • gc_cf_stipulation
    • widget_recent-posts
    • ...

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
These server-side errors were triggered
  • 9 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=gnucommerce
    • > Notice in wp-content/plugins/gnucommerce/adm/view/iteminfo.php+45
    Trying to access array offset on value of type int

SRP 0% 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
Please take a closer look at the following
  • 5× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/gnucommerce/shop/lg/cancel_url.php
    • > /wp-content/plugins/gnucommerce/shop/inicis/libs/CreateIdModule.php
    • > /wp-content/plugins/gnucommerce/shop/inicis/close.php
    • > /wp-content/plugins/gnucommerce/shop/lg/mispwapurl.php
    • > /wp-content/plugins/gnucommerce/shop/inicis/popup.php
  • 32× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_bloginfo() in wp-content/plugins/gnucommerce/shop/mail/ordermail.mail.php:5
    • > PHP Fatal error
      Uncaught Error: Call to a member function Rollback() on null in wp-content/plugins/gnucommerce/shop/lg/xpay_cancel.php:5
    • > PHP Warning
      require_once(class.ole_pps_root.php): failed to open stream: No such file or directory in wp-content/plugins/gnucommerce/lib/Excel/php_writeexcel/class.writeexcel_workbookbig.inc.php on line 28
    • > PHP Warning
      "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in wp-content/plugins/gnucommerce/adm/orderlistupdate.php on line 44
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_bloginfo() in wp-content/plugins/gnucommerce/shop/mail/couponmail.mail.php:6
    • > PHP Warning
      "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in wp-content/plugins/gnucommerce/adm/orderlistupdate.php on line 68
    • > PHP Warning
      "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in wp-content/plugins/gnucommerce/plug/htmlpurifier/HTMLPurifier.standalone.php on line 12007
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_bloginfo() in wp-content/plugins/gnucommerce/shop/mail/orderupdate2.mail.php:6
    • > PHP Warning
      "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in wp-content/plugins/gnucommerce/adm/orderlistupdate.php on line 45
    • > PHP Warning
      "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in wp-content/plugins/gnucommerce/adm/orderlistupdate.php on line 110

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
There were no browser issues found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
Attributes that need to be fixed:
  • Tags: There are too many tags (15 tag instead of maximum 10)
You can look at the official readme.txt

gnucommerce/gnucommerce.php 92% from 13 tests

This is the main PHP file of "GNUCommerce" version 1.5.4, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
It is important to fix the following:
  • Text Domain: The text domain follows the same naming rules as the plugin slug: lowercase characters and dashes

Code Analysis 3% from 3 tests

File types 0% from 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Please make sure to remedy the following
  • Do not include executable or dangerous files in your plugin
    • .crt - Security Certificate in Firefox, IE, Chrome, Safari
      • wp-content/plugins/gnucommerce/plug/lgxpay/lgdacom/conf/ca-bundle.crt
    • .exe - Executable in Windows
      • wp-content/plugins/gnucommerce/plug/okname/bin/okname.exe
      • wp-content/plugins/gnucommerce/plug/okname/bin/oknamex64.exe
      • wp-content/plugins/gnucommerce/shop/kcp/bin/pp_cli_exe.exe
108,195 lines of code in 539 files:
LanguageFilesBlank linesComment linesLines of code
PHP46919,06817,96684,339
CSS2995062813,457
JavaScript361,0211,3146,455
PO File11,6202,7773,646
XML200287
HTML10710
INI1111

PHP code 50% from 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
The following items need your attention
  • Cyclomatic complexity of methods has to be reduced to less than 100 (currently 232)
Cyclomatic complexity
Average complexity per logical line of code0.38
Average class complexity20.55
▷ Minimum class complexity1.00
▷ Maximum class complexity539.00
Average method complexity4.72
▷ Minimum method complexity1.00
▷ Maximum method complexity232.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes330
▷ Abstract classes123.64%
▷ Concrete classes31896.36%
▷ Final classes00.00%
Methods1,749
▷ Static methods1377.83%
▷ Public methods1,52787.31%
▷ Protected methods895.09%
▷ Private methods1337.60%
Functions480
▷ Named functions480100.00%
▷ Anonymous functions00.00%
Constants703
▷ Global constants64591.75%
▷ Class constants588.25%
▷ Public constants58100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
59 PNG files occupy 0.21MB with 0.06MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
plug/kcaptcha/fonts/chaparral.png7.42KB4.17KB▼ 43.87%
img/s_star2.png0.88KB0.87KB▼ 0.89%
css/images/ui-icons_454545_256x240.png6.83KB4.17KB▼ 38.86%
css/images/ui-icons_0073ea_256x240.png4.44KB4.17KB▼ 6.02%
plug/kcaptcha/fonts/kozuka.png7.08KB4.03KB▼ 43.13%