79% wp-olivecart

Code Review | WP-OliveCart

WordPress plugin WP-OliveCart scored 79% from 54 tests.

About plugin

  • Plugin page: wp-olivecart
  • Plugin version: 1.1.3
  • PHP version: 7.4.16
  • WordPress compatibility: 5.3-5.3.2
  • WordPress version: 5.8.1
  • First release: Nov 27, 2017
  • Latest release: Feb 6, 2020
  • Number of updates: 32
  • Update frequency: every 25.1 days
  • Top authors: olivecart (100%)

Code review

54 tests

User reviews

1 review

Install metrics

800+ active / 7,571 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Install script ran successfully

Server metrics [RAM: ▲0.16MB] [CPU: ▼161.08ms] Passed 4 tests

An overview of server-side resources used by WP-OliveCart
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /2.96 ▲0.2447.13 ▲30.19
Dashboard /wp-admin3.21 ▲0.1549.12 ▲3.13
Posts /wp-admin/edit.php3.31 ▲0.2152.01 ▲11.81
Add New Post /wp-admin/post-new.php5.56 ▲0.13104.84 ▼670.18
Media Library /wp-admin/upload.php3.14 ▲0.1444.25 ▲10.92
Items Page List /wp-admin/edit.php?post_type=wp_olivecart3.2244.38
Othre Items /wp-admin/admin.php?page=olivecart_charges3.1640.15
Cart Options /wp-admin/admin.php?page=olivecart_options3.1233.73
Settlement /wp-admin/admin.php?page=olivecart_settlement3.1637.66
Postage /wp-admin/admin.php?page=olivecart_postage3.1535.92
Items Page List /wp-admin/edit.php?post_type=cart3.1837.94
Cart End Message /wp-admin/admin.php?page=olivecart_end_message3.1032.85
Item Category /wp-admin/edit-tags.php?taxonomy=product_category&post_type=cart3.1539.34
Cart Auto Reply Email /wp-admin/admin.php?page=olivecart_auto_email3.1033.63
Add new /wp-admin/post-new.php?post_type=wp_olivecart3.2551.11

Server storage [IO: ▲0.23MB] [DB: ▲0.02MB] Passed 3 tests

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 74 new files
Database: 4 new tables, 7 new options
New tables
CART_postage
CART_commission
CART_cartedit
wp_cart_meta
New WordPress options
widget_olivecart_category_widget
cart_button_other_option1
widget_olivecart_preview_widget
s_mail_m
sendmail_address1
cart_page_id
s_subject

Browser metrics Passed 4 tests

Checking browser requirements for WP-OliveCart
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,924 ▲31815.91 ▲0.319.34 ▼0.2449.02 ▲0.60
Dashboard /wp-admin3,144 ▲2135.91 ▼0.10131.99 ▼22.72133.41 ▲17.77
Posts /wp-admin/edit.php2,897 ▲1612.73 ▲0.0066.79 ▲4.0285.99 ▼6.06
Add New Post /wp-admin/post-new.php1,742 ▲24216.33 ▼2.21442.34 ▲73.86118.16 ▲9.37
Media Library /wp-admin/upload.php1,918 ▲1115.02 ▼0.00125.79 ▼14.99143.76 ▲30.48
Items Page List /wp-admin/edit.php?post_type=wp_olivecart2,2692.6364.1793.65
Othre Items /wp-admin/admin.php?page=olivecart_charges1,9252.4476.9598.66
Cart Options /wp-admin/admin.php?page=olivecart_options1,5802.7062.7083.19
Settlement /wp-admin/admin.php?page=olivecart_settlement1,7572.5469.5994.83
Postage /wp-admin/admin.php?page=olivecart_postage1,5152.6858.8578.18
Items Page List /wp-admin/edit.php?post_type=cart1,6052.6457.4970.61
Cart End Message /wp-admin/admin.php?page=olivecart_end_message1,4822.6266.6472.07
Item Category /wp-admin/edit-tags.php?taxonomy=product_category&post_type=cart1,9082.4055.0779.09
Cart Auto Reply Email /wp-admin/admin.php?page=olivecart_auto_email1,5792.7566.6673.86
Add new /wp-admin/post-new.php?post_type=wp_olivecart3,0108.83210.80166.92

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
The following items require your attention
  • The uninstall procedure has failed, leaving 2 options in the database
    • widget_olivecart_category_widget
    • widget_olivecart_preview_widget

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
These server-side errors were triggered
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=olivecart_auto_email
    • > Notice in wp-content/plugins/wp-olivecart/include/class-cart-auto-email.php+96
    Undefined index: id
    • > GET request to /wp-admin/admin.php?page=olivecart_auto_email
    • > Notice in wp-content/plugins/wp-olivecart/include/class-cart-auto-email.php+140
    Trying to get property 'set05' of non-object
    • > GET request to /wp-admin/admin.php?page=olivecart_auto_email
    • > Notice in wp-content/plugins/wp-olivecart/include/class-cart-auto-email.php+147
    Trying to get property 'set06' of non-object

SRP Passed 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Congratulations! This plugin passed the SRP test

User-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
These are user-side errors you should fix
    • > GET request to /wp-admin/edit.php?post_type=cart
    • > Javascript (severe) in unknown
    /wp-admin/edit.php?post_type=cart 63:20 Uncaught TypeError: jQuery(...).live is not a function

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
8 plugin tags: shopping, olivecart, eshop, e-commerce, store...

wp-olivecart/wp-olivecart.php Passed 13 tests

"WP-OliveCart" version 1.1.3's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
37 characters long description:
Simple & Easy Free e-commerce plugin.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Success! There were no dangerous files found in this plugin5,733 lines of code in 64 files:
LanguageFilesBlank linesComment linesLines of code
PHP501961703,238
CSS11671732,063
PO File1418785344
JavaScript27588

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.32
Average class complexity10.29
▷ Minimum class complexity1.00
▷ Maximum class complexity31.00
Average method complexity3.56
▷ Minimum method complexity1.00
▷ Maximum method complexity29.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes35
▷ Abstract classes00.00%
▷ Concrete classes35100.00%
▷ Final classes00.00%
Methods127
▷ Static methods00.00%
▷ Public methods127100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions8
▷ Named functions675.00%
▷ Anonymous functions225.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
4 PNG files occupy 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/icon_order.png0.87KB0.66KB▼ 23.99%
images/icon_cart.png0.36KB0.19KB▼ 48.52%
images/icon_commodity.png0.38KB0.18KB▼ 51.56%
images/icon_customer.png0.79KB0.44KB▼ 43.78%