83% woo-swish-e-commerce

Code Review | Woo Swish e-commerce

WordPress plugin Woo Swish e-commerce scored83%from 54 tests.

About plugin

  • Plugin page: woo-swish-e-commerce
  • Plugin version: 3.6.2
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-6.4
  • WordPress version: 6.3.1
  • First release: Oct 15, 2018
  • Latest release: Nov 23, 2023
  • Number of updates: 113
  • Update frequency: every 16.5 days
  • Top authors: bjorntech (88.5%)carlericsson (12.39%)

Code review

54 tests

User reviews

18 reviews

Install metrics

2,000+ active /68,247 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
This plugin's installer ran successfully

Server metrics [RAM: ▲0.03MB] [CPU: ▼3.36ms] Passed 4 tests

This is a short check of server-side resources used by Woo Swish e-commerce
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0435.71 ▲2.30
Dashboard /wp-admin3.34 ▲0.0346.05 ▼11.54
Posts /wp-admin/edit.php3.39 ▲0.0349.36 ▼0.40
Add New Post /wp-admin/post-new.php5.92 ▲0.0391.07 ▲6.36
Media Library /wp-admin/upload.php3.26 ▲0.0331.59 ▼3.80

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

How much does this plugin use your filesystem and database?
This plugin installed successfully
Filesystem: 42 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
can_compress_scripts
theysaidso_admin_options
db_upgraded
widget_recent-posts
widget_theysaidso_widget

Browser metrics Passed 4 tests

A check of browser resources used by Woo Swish e-commerce
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,790 ▲2814.27 ▲0.141.80 ▲0.0338.43 ▲0.37
Dashboard /wp-admin2,198 ▲185.59 ▼0.0594.45 ▲0.1543.60 ▼3.79
Posts /wp-admin/edit.php2,103 ▼01.98 ▼0.0538.19 ▼3.0437.53 ▲1.74
Add New Post /wp-admin/post-new.php1,526 ▼023.13 ▼0.44601.00 ▼112.4161.11 ▲6.45
Media Library /wp-admin/upload.php1,400 ▼04.20 ▲0.0197.92 ▼9.8042.34 ▼4.70

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_recent-comments
    • db_upgraded
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Good news, no errors were detected

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 fix the following
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function language_attributes() in wp-content/plugins/woo-swish-e-commerce/classes/templates/swish-wait-page.php:9

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
5 plugin tags: swish, swish-handel, woocommerce, ecommerce, payment

woo-swish-e-commerce/woo-swish-e-commerce.php 85% from 13 tests

This is the main PHP file of "Woo Swish e-commerce" version 3.6.2, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
You should first fix the following items:
  • Description: Please don't use more than 140 characters for the plugin description (currently 155 characters long)
  • Requires at least: Required version does not match the one declared in readme.txt ("4.9" instead of "4.0")

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
No dangerous file extensions were detected3,293 lines of code in 34 files:
LanguageFilesBlank linesComment linesLines of code
PHP267941,0332,809
JavaScript3574187
CSS23022168
SVG20288
JSON10041

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.31
Average class complexity16.95
▷ Minimum class complexity1.00
▷ Maximum class complexity196.00
Average method complexity2.88
▷ Minimum method complexity1.00
▷ Maximum method complexity19.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes19
▷ Abstract classes00.00%
▷ Concrete classes19100.00%
▷ Final classes15.26%
Methods163
▷ Static methods5533.74%
▷ Public methods13884.66%
▷ Protected methods10.61%
▷ Private methods2414.72%
Functions4
▷ Named functions125.00%
▷ Anonymous functions375.00%
Constants17
▷ Global constants423.53%
▷ Class constants1376.47%
▷ Public constants13100.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
5 PNG files occupy 0.63MB with 0.32MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/Swish_Logo_Secondary_RGB.png143.60KB69.98KB▼ 51.26%
assets/images/Swish_Logo_Circle.png150.20KB55.35KB▼ 63.15%
assets/images/Swish_Logo_Primary_RGB.png252.08KB156.04KB▼ 38.10%
assets/images/BjornTech_logo_small.png84.40KB39.40KB▼ 53.32%
assets/images/Swish_Logo_Text.png17.32KB8.94KB▼ 48.37%