10% wp-shop-original

Code Review | WP Shop

WordPress plugin WP Shop scored 10% from 54 tests.

About plugin

  • Plugin page: wp-shop-original
  • Plugin version: 3.9.6
  • PHP compatiblity: 5.3+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.7-5.2.2
  • WordPress version: 5.9.2
  • First release: Sep 4, 2014
  • Latest release: Jul 29, 2020
  • Number of updates: 177
  • Update frequency: every 12.2 days
  • Top authors: wpshop (100%)

Code review

54 tests

User reviews

16 reviews

Install metrics

1,000+ active / 155,719 total downloads

Benchmarks

Plugin footprint 23% 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/wp-shop-original/classes/class.Wpshop.Boot.php+84
    Function get_magic_quotes_gpc() is deprecated

Server metrics [RAM: ▼2.37MB] [CPU: ▼344.71ms] Passed 4 tests

Analyzing server-side resources used by WP Shop
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /2.00 ▼1.524.76 ▼44.72
Dashboard /wp-admin2.02 ▼1.393.89 ▼29.52
Posts /wp-admin/edit.php2.02 ▼1.624.15 ▼33.59
Add New Post /wp-admin/post-new.php2.02 ▼4.954.53 ▼1,270.99
Media Library /wp-admin/upload.php2.02 ▼1.28227.86 ▲201.88
WP Shop Export/Import /wp-admin/admin.php?page=wpshop_export-import2.024.55
WP Shop Deliveries /wp-admin/admin.php?page=wpshop_delivery2.025.19
WP Shop Pre Orders /wp-admin/admin.php?page=wpshop_pre_order2.024.11
WP Shop User Deliveries /wp-admin/edit.php?post_type=wpshop_user_delivery2.024.61
WP Shop Promo /wp-admin/edit.php?post_type=wpshop_promo2.023.46
WP Shop Carts /wp-admin/edit.php?post_type=wpshopcarts2.024.88
WP Shop Payments /wp-admin/admin.php?page=wpshop_payments2.024.44
WP Shop Mail Constructor /wp-admin/edit.php?post_type=wpshop_client_mail2.025.14
WP Shop Orders /wp-admin/admin.php?page=wpshop_orders2.026.26
WP Shop Settings /wp-admin/admin.php?page=wpshop_settings2.025.21

Server storage [IO: ▲3.53MB] [DB: ▲0.06MB] Passed 3 tests

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 196 new files
Database: 3 new tables, 59 new options
New tables
wp_wpshop_selected_items
wp_wpshop_orders
wp_wpshop_ordered
New WordPress options
wpshop.payments.icredit
wpshop.uds_api_key
wpshop.payments.robokassa
wpshop.delivery
wpshop.payments.tinkoff
wp-shop_position
wpshop.mail_activate
wpshop.payments.post
wpshop.uds_percents
wp-shop_relink
...

Browser metrics Passed 4 tests

An overview of browser requirements for WP Shop
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,830 ▲7617.21 ▲1.5813.76 ▲8.082.61 ▼0.23
Dashboard /wp-admin2,821 ▼407.21 ▲1.09117.31 ▼16.70155.73 ▼6.03
Posts /wp-admin/edit.php2,973 ▲2853.73 ▲0.5099.06 ▲38.32139.54 ▲9.45
Add New Post /wp-admin/post-new.php2,740 ▲1,05022.67 ▲1.81424.14 ▼25.38190.59 ▲33.27
Media Library /wp-admin/upload.php1,838 ▲1406.07 ▲0.55128.69 ▼10.21194.07 ▲4.45
WP Shop Export/Import /wp-admin/admin.php?page=wpshop_export-import1,3283.2465.34121.25
WP Shop Deliveries /wp-admin/admin.php?page=wpshop_delivery1,4943.2159.07113.69
WP Shop Pre Orders /wp-admin/admin.php?page=wpshop_pre_order1,1503.2062.37101.87
WP Shop User Deliveries /wp-admin/edit.php?post_type=wpshop_user_delivery1,5313.5596.07112.53
WP Shop Promo /wp-admin/edit.php?post_type=wpshop_promo1,4813.5787.42111.99
WP Shop Carts /wp-admin/edit.php?post_type=wpshopcarts5,0673.6794.27150.63
WP Shop Payments /wp-admin/admin.php?page=wpshop_payments5,1733.4867.12195.68
WP Shop Mail Constructor /wp-admin/edit.php?post_type=wpshop_client_mail1,5303.6976.76109.75
WP Shop Orders /wp-admin/admin.php?page=wpshop_orders1,5483.3359.74109.37
WP Shop Settings /wp-admin/admin.php?page=wpshop_settings2,6133.1761.80268.30

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • This plugin did not uninstall without warnings or errors
    • > Deprecated in wp-content/plugins/wp-shop-original/classes/class.Wpshop.Boot.php+84
    Function get_magic_quotes_gpc() is deprecated
  • Zombie tables were found after uninstall: 3 tables
    • wp_wpshop_orders
    • wp_wpshop_ordered
    • wp_wpshop_selected_items
  • The uninstall procedure has failed, leaving 59 options in the database
    • payment_del_children
    • wpshop.cart.minzakaz_info
    • wp-shop_cform
    • wpshop.uds_user_id
    • wpshop.payments.vizit
    • wpshop.email
    • wpshop.udsactive
    • wp-shop-link_ie6
    • wpshop.cart.discount
    • mail_type_children
    • ...

Smoke tests 0% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Almost there, just fix the following server-side errors
  • 14 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=wpshop_settings
    • > Deprecated in wp-content/plugins/wp-shop-original/classes/class.Wpshop.Boot.php+84
    Function get_magic_quotes_gpc() is deprecated
  • 308 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=wpshop_settings
    • > Notice in wp-content/plugins/wp-shop-original/classes/class.Wpshop.Forms.php+72
    Undefined index: form
  • 28 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=wpshop_settings
    • > Notice in wp-content/plugins/wp-shop-original/classes/class.Wpshop.Forms.php+174
    Trying to access array offset on value of type null
  • 12 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=wpshop_settings
    • > Notice in wp-content/plugins/wp-shop-original/classes/class.Wpshop.Delivery.php+55
    Undefined index: free_delivery
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=wpshop_settings
    • > Notice in wp-content/plugins/wp-shop-original/views/admin/settings.php+217
    Undefined variable: p1
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=wpshop_settings
    • > Notice in wp-content/plugins/wp-shop-original/views/admin/settings.php+218
    Undefined variable: p2
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=wpshop_settings
    • > Notice in wp-content/plugins/wp-shop-original/views/admin/settings.php+219
    Undefined variable: p3
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=wpshop_settings
    • > Notice in wp-content/plugins/wp-shop-original/views/admin/settings.php+220
    Undefined variable: p4
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=wpshop_settings
    • > Notice in wp-content/plugins/wp-shop-original/views/admin/settings.php+221
    Undefined variable: p5
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=wpshop_payments
    • > Notice in wp-content/plugins/wp-shop-original/views/admin/payments.php+1688
    Undefined variable: p6
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=wpshop_payments
    • > Notice in wp-content/plugins/wp-shop-original/views/admin/payments.php+1689
    Undefined variable: p7
    • > GET request to /wp-admin/admin.php?page=wpshop_payments
    • > Notice in wp-content/plugins/wp-shop-original/views/admin/payments.php+984
    Undefined variable: f2
    • > GET request to /wp-admin/admin.php?page=wpshop_payments
    • > Notice in wp-content/plugins/wp-shop-original/views/admin/payments.php+1690
    Undefined variable: p8
    • > GET request to /wp-admin/admin.php?page=wpshop_payments
    • > Notice in wp-content/plugins/wp-shop-original/views/admin/payments.php+1691
    Undefined variable: p9
    • > GET request to /wp-admin/admin.php?page=wpshop_payments
    • > Notice in wp-content/plugins/wp-shop-original/views/admin/payments.php+1692
    Undefined variable: p10
    • > GET request to /wp-admin/admin.php?page=wpshop_payments
    • > Notice in wp-content/plugins/wp-shop-original/views/admin/payments.php+1710
    Undefined variable: pl1
    • > GET request to /wp-admin/admin.php?page=wpshop_payments
    • > Notice in wp-content/plugins/wp-shop-original/views/admin/payments.php+1711
    Undefined variable: pl2
    • > GET request to /wp-admin/admin.php?page=wpshop_payments
    • > Notice in wp-content/plugins/wp-shop-original/views/admin/payments.php+1712
    Undefined variable: pl3
    • > GET request to /wp-admin/admin.php?page=wpshop_payments
    • > Notice in wp-content/plugins/wp-shop-original/views/admin/payments.php+1713
    Undefined variable: pl4
    • > GET request to /wp-admin/admin.php?page=wpshop_payments
    • > Notice in wp-content/plugins/wp-shop-original/views/admin/payments.php+1714
    Undefined variable: pl5
    • > GET request to /wp-admin/admin.php?page=wpshop_payments
    • > Notice in wp-content/plugins/wp-shop-original/views/admin/payments.php+1715
    Undefined variable: pl6
    • > GET request to /wp-admin/admin.php?page=wpshop_orders
    • > Notice in wp-content/plugins/wp-shop-original/classes/class.Wpshop.Admin.php+301
    Undefined variable: condition

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Almost there! Just fix the following items
  • 3× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/wp-shop-original/views/js.inc.clearCart.php
    • > /wp-content/plugins/wp-shop-original/views/admin/user.profile.customer.php
    • > /wp-content/plugins/wp-shop-original/views/response_xml.php
  • 79× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Warning
      Use of undefined constant WPSHOP_CLASSES_DIR - assumed 'WPSHOP_CLASSES_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/wp-shop-original/classes/class.Wpshop.Payment.php on line 1
    • > PHP Warning
      require_once(WPSHOP_DIR/classes/cripto/exceptions.php): failed to open stream: No such file or directory in wp-content/plugins/wp-shop-original/classes/cripto/BaseAPI.php on line 6
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/wp-shop-original/views/yandex_metrika_res.php:2
    • > PHP Warning
      Use of undefined constant WPSHOP_CLASSES_DIR - assumed 'WPSHOP_CLASSES_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/wp-shop-original/classes/sofort_lib/refund/sofortLibRefund.inc.php on line 2
    • > PHP Fatal error
      require_once(): Failed opening required 'WPSHOP_CLASSES_DIR/sofort_lib/core/sofortLibPaycodeAbstract.inc.php' (include_path='.:/usr/share/php') in wp-content/plugins/wp-shop-original/classes/sofort_lib/billcode/sofortLibBillcode.inc.php on line 2
    • > PHP Fatal error
      require_once(): Failed opening required 'WPSHOP_CLASSES_DIR/sofort_lib/core/sofortLibMultipay.inc.php' (include_path='.:/usr/share/php') in wp-content/plugins/wp-shop-original/classes/sofort_lib/ideal/sofortLibIdeal.inc.php on line 2
    • > PHP Notice
      Undefined index: shopId in wp-content/plugins/wp-shop-original/views/response_xml.php on line 5
    • > PHP Fatal error
      require_once(): Failed opening required 'WPSHOP_CLASSES_DIR/sofort_lib/core/sofortLibMultipay.inc.php' (include_path='.:/usr/share/php') in wp-content/plugins/wp-shop-original/classes/sofort_lib/core/sofortLibPaycodeAbstract.inc.php on line 2
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/wp-shop-original/views/vitrina.php:3
    • > PHP Notice
      Undefined variable: code in wp-content/plugins/wp-shop-original/views/response_xml.php on line 5

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
These are user-side errors you should fix
    • > GET request to /wp-admin/admin.php?page=wpshop_payments
    • > Javascript (severe) in unknown
    /wp-admin/admin.php?page=wpshop_payments 186:22 Uncaught SyntaxError: Unexpected token ';'

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
Please fix the following attributes:
  • Tags: Too many tags (40 tag instead of maximum 10); only the first 5 tags are used in your directory listing
Please take inspiration from this readme.txt

wp-shop-original/wp-shop.php 92% from 13 tests

Analyzing the main PHP file in "WP Shop" version 3.9.6
The following require your attention:
  • Main file name: The principal plugin file should be the same as the plugin slug ("wp-shop-original.php" instead of "wp-shop.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
Good job! No executable or dangerous file extensions detected26,128 lines of code in 124 files:
LanguageFilesBlank linesComment linesLines of code
PHP1032,7593,84615,902
PO File31,5102,0813,301
JavaScript106022232,882
SVG30122,880
CSS5186291,163

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.32
Average class complexity19.57
▷ Minimum class complexity1.00
▷ Maximum class complexity149.00
Average method complexity3.19
▷ Minimum method complexity1.00
▷ Maximum method complexity98.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes70
▷ Abstract classes710.00%
▷ Concrete classes6390.00%
▷ Final classes00.00%
Methods599
▷ Static methods6510.85%
▷ Public methods52988.31%
▷ Protected methods264.34%
▷ Private methods447.35%
Functions33
▷ Named functions3296.97%
▷ Anonymous functions13.03%
Constants27
▷ Global constants1451.85%
▷ Class constants1348.15%
▷ Public constants13100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
52 PNG files occupy 0.49MB with 0.24MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/payments/SberOnlineRUB.png16.09KB4.06KB▼ 74.76%
images/payments/CreditCardRUB.png5.31KB4.90KB▼ 7.73%
images/payments/RsbRUB.png24.92KB7.93KB▼ 68.18%
images/payments/credit-card.png7.77KB3.96KB▼ 48.99%
images/payments/simplepay.png5.57KB3.06KB▼ 45.08%