77% swipecart

Code Review | Swipecart

WordPress plugin Swipecart scored77%from 54 tests.

About plugin

  • Plugin page: swipecart
  • Plugin version: 2.8.6
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.9-6.2
  • WordPress version: 6.3.1
  • First release: Feb 10, 2022
  • Latest release: Jul 7, 2023
  • Number of updates: 98
  • Update frequency: every 5.2 days
  • Top authors: swipecartrtd (100%)

Code review

54 tests

User reviews

1 review

Install metrics

30+ active /4,084 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.86MB] [CPU: ▲4.96ms] Passed 4 tests

An overview of server-side resources used by Swipecart
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /4.32 ▲0.8744.87 ▲3.31
Dashboard /wp-admin4.16 ▲0.8654.46 ▲7.22
Posts /wp-admin/edit.php4.27 ▲0.9254.27 ▲5.62
Add New Post /wp-admin/post-new.php6.76 ▲0.88106.67 ▲3.68
Media Library /wp-admin/upload.php4.08 ▲0.8643.14 ▲10.06
Install Plugins /wp-admin/plugins.php?page=tgmpa-install-plugins4.0937.84

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

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 49 new files
Database: no new tables, 7 new options
New WordPress options
theysaidso_admin_options
swipecart_auth
db_upgraded
widget_recent-comments
can_compress_scripts
widget_theysaidso_widget
widget_recent-posts

Browser metrics Passed 4 tests

An overview of browser requirements for Swipecart
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,870 ▲13513.23 ▼0.934.88 ▲2.4235.50 ▼10.79
Dashboard /wp-admin2,242 ▲545.89 ▲0.97108.84 ▲2.4345.06 ▲1.84
Posts /wp-admin/edit.php2,133 ▲442.10 ▲0.0740.42 ▼2.0743.01 ▲7.44
Add New Post /wp-admin/post-new.php1,564 ▲3023.28 ▲0.16590.06 ▼87.2651.24 ▼4.64
Media Library /wp-admin/upload.php1,432 ▲414.28 ▲0.0698.04 ▼0.3845.25 ▲4.12
Install Plugins /wp-admin/plugins.php?page=tgmpa-install-plugins9672.0925.5930.04

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Please fix the following items
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_theysaidso_widget
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_recent-comments
    • can_compress_scripts
    • db_upgraded

Smoke tests 50% 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 everything seems fine, this is not an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please fix the following items
  • 34× PHP files perform the task of outputting text when accessed with GET requests (only 10 are shown):
    • > /wp-content/plugins/swipecart/inc/wp-init/admin-pages/swipecart/init.php
    • > /wp-content/plugins/swipecart/inc/Utility.php
    • > /wp-content/plugins/swipecart/swipecart.php
    • > /wp-content/plugins/swipecart/inc/wp-init/integrations/popup/init.php
    • > /wp-content/plugins/swipecart/inc/wp-init/integrations/security/init.php
    • > /wp-content/plugins/swipecart/inc/wp-init/admin-pages/swipecart/class/views/html-sc-integration-admin-options.php
    • > /wp-content/plugins/swipecart/inc/wp-init/integrations/back-in-stock/init.php
    • > /wp-content/plugins/swipecart/inc/class/class-events.php
    • > /wp-content/plugins/swipecart/inc/wp-init/integrations/popup/views/popup-html.php
    • > /wp-content/plugins/swipecart/inc/wp-init/integrations/checkout/class-checkout.php
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function did_action() in wp-content/plugins/swipecart/inc/wp-init/plugins/tgmpa.php:2146

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
There were no browser issues found

Optimizations

Plugin configuration 86% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
These attributes need your attention:
  • Donate link: Please fix this invalid URI: ""
The official readme.txt might help

swipecart/swipecart.php 77% from 13 tests

This is the main PHP file of "Swipecart" version 2.8.6, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
Please make the necessary changes and fix the following:
  • Description: Keep the plugin description shorter than 140 characters (currently 147 characters long)
  • Requires PHP: Required version must be the same as the one declared in readme.txt ("7.3" instead of "7.4")
  • Requires at least: Required version must be the same as the one declared in readme.txt ("5.0" instead of "4.9")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
No dangerous file extensions were detected6,811 lines of code in 44 files:
LanguageFilesBlank linesComment linesLines of code
PHP361,5163,9376,284
Markdown1660295
JavaScript4036222
CSS2007
SVG1003

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.39
Average class complexity23.25
▷ Minimum class complexity1.00
▷ Maximum class complexity206.00
Average method complexity3.34
▷ Minimum method complexity1.00
▷ Maximum method complexity45.00
Code structure
Namespaces3
Interfaces0
Traits0
Classes40
▷ Abstract classes00.00%
▷ Concrete classes40100.00%
▷ Final classes00.00%
Methods373
▷ Static methods4812.87%
▷ Public methods32386.60%
▷ Protected methods236.17%
▷ Private methods277.24%
Functions28
▷ Named functions310.71%
▷ Anonymous functions2589.29%
Constants6
▷ Global constants00.00%
▷ Class constants6100.00%
▷ Public constants6100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
PNG images were not found in this plugin