64% yocommerce

Code Review | YoCommerce

WordPress plugin YoCommerce scored 64% from 54 tests.

About plugin

  • Plugin page: yocommerce
  • Plugin version: 1.3
  • PHP version: 7.4.16
  • WordPress compatibility: 5.8.2-5.8.2
  • WordPress version: 6.3.1
  • First release: Dec 17, 2015
  • Latest release: Dec 22, 2021
  • Number of updates: 13
  • Update frequency: every 169.1 days
  • Top authors: aleksandrposs (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 731 total downloads

Benchmarks

Plugin footprint 48% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Install script ran successfully

Server metrics [RAM: ▼0.22MB] [CPU: ▼9.98ms] Passed 4 tests

An overview of server-side resources used by YoCommerce
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.54 ▲0.0844.24 ▼0.45
Dashboard /wp-admin3.42 ▲0.1153.78 ▼2.57
Posts /wp-admin/edit.php3.54 ▲0.1856.59 ▲0.41
Add New Post /wp-admin/post-new.php4.72 ▼1.1853.41 ▼37.32
Media Library /wp-admin/upload.php3.35 ▲0.1145.33 ▲8.98

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 7 new files
Database: 4 new tables, 7 new options
New tables
wp_plugin_yocommerce_goods
wp_plugin_yocommerce_orders
wp_plugin_yocommerce_settings
wp_plugin_yocommerce_settings_2
New WordPress options
widget_theysaidso_widget
widget_recent-comments
theysaidso_admin_options
can_compress_scripts
db_upgraded
widget_wpb_widget
widget_recent-posts

Browser metrics Passed 4 tests

A check of browser resources used by YoCommerce
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,821 ▲1014.45 ▼0.031.84 ▼0.2243.05 ▼0.88
Dashboard /wp-admin2,212 ▲64.89 ▼0.97110.71 ▼6.5177.08 ▲34.28
Posts /wp-admin/edit.php2,116 ▲272.01 ▲0.0038.33 ▲2.1434.57 ▲0.51
Add New Post /wp-admin/post-new.php6,594 ▲5,08026.93 ▲9.24938.28 ▲252.1860.93 ▼1.32
Media Library /wp-admin/upload.php1,405 ▲204.13 ▼0.04100.82 ▲0.5279.84 ▲35.39

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
These items require your attention
  • This plugin cannot be uninstalled
    • > Notice in wp-content/plugins/yocommerce/index.php+284
    Undefined index: yocommerce_order_id
  • The uninstall procedure failed, leaving 1 table in the database
    • wp_plugin_yocommerce_settings_2
  • This plugin does not fully uninstall, leaving 7 options in the database
    • widget_recent-comments
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-posts
    • db_upgraded
    • can_compress_scripts
    • widget_wpb_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Even though no errors were found, this is by no means an exhaustive test

SRP 50% 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
Please take a closer look at the following
  • 4× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/yocommerce/yocommerce_widget.class.php:3
    • > PHP Fatal error
      Uncaught Error: Call to a member function get_results() on null in wp-content/plugins/yocommerce/yocommerce_paypalfunctions.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/yocommerce/yocommerce_widget.class.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/yocommerce/yocommerce_admin.php:20

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser errors were detected

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
These attributes need to be fixed:
  • Plugin Name: You should set the name of your plugin on the first line ( === yocommerce === )
The official readme.txt is a good inspiration

yocommerce/index.php 92% from 13 tests

The main PHP script in "YoCommerce" version 1.3 is automatically included on every request by WordPress
The following require your attention:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("yocommerce.php" instead of "index.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Everything looks great! No dangerous files found in this plugin663 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
PHP5266302663

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.26
Average class complexity12.00
▷ Minimum class complexity12.00
▷ Maximum class complexity12.00
Average method complexity3.75
▷ Minimum method complexity1.00
▷ Maximum method complexity10.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods4
▷ Static methods00.00%
▷ Public methods4100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions24
▷ Named functions24100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
1 PNG file occupies 0.01MB with 0.01MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
buy.png11.19KB4.54KB▼ 59.40%