77% swifno-merchant-api

Code Review | Swifno Shipping Plugin

WordPress plugin Swifno Shipping Plugin scored77%from 54 tests.

About plugin

  • Plugin page: swifno-merchant-api
  • Plugin version: 5.0.3
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-5.4.2
  • WordPress version: 6.3.1
  • First release: Nov 9, 2018
  • Latest release: Aug 24, 2020
  • Number of updates: 20
  • Update frequency: every 39.8 days
  • Top authors: swifno (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /570 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.13MB] [CPU: ▲1.09ms] Passed 4 tests

This is a short check of server-side resources used by Swifno Shipping Plugin
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.59 ▲0.1444.52 ▲9.24
Dashboard /wp-admin3.43 ▲0.1348.74 ▼1.42
Posts /wp-admin/edit.php3.54 ▲0.1948.90 ▲1.35
Add New Post /wp-admin/post-new.php6.01 ▲0.1394.65 ▲3.99
Media Library /wp-admin/upload.php3.35 ▲0.1333.96 ▲0.42
Settings /wp-admin/admin.php?page=swifno-settings3.1728.54

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

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 31 new files
Database: 1 new table, 7 new options
New tables
wp_swifno_shipping
New WordPress options
widget_recent-comments
theysaidso_admin_options
db_upgraded
widget_theysaidso_widget
can_compress_scripts
widget_recent-posts
swifno_opts

Browser metrics Passed 4 tests

Swifno Shipping Plugin: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,812 ▲7713.23 ▼1.521.74 ▼0.0544.40 ▼4.35
Dashboard /wp-admin2,218 ▲305.84 ▲0.0197.64 ▼1.5539.42 ▼5.30
Posts /wp-admin/edit.php2,101 ▲121.99 ▼0.0241.46 ▼0.9040.07 ▲2.44
Add New Post /wp-admin/post-new.php1,538 ▲523.16 ▼0.32644.38 ▲58.6163.22 ▲5.22
Media Library /wp-admin/upload.php1,400 ▲124.19 ▼0.0297.28 ▲0.4444.60 ▲2.53
Settings /wp-admin/admin.php?page=swifno-settings9141.7128.4727.68

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
You still need to fix the following
  • Zombie WordPress options were found after uninstall: 7 options
    • db_upgraded
    • widget_recent-comments
    • can_compress_scripts
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • swifno_opts

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
These errors were triggered by the plugin
    • > GET request to /wp-admin/admin.php?page=swifno-settings
    • > User notice in wp-includes/functions.php+5905
    Function WP_Scripts::localize was called incorrectly. The $l10n parameter must be an array. To pass arbitrary data to scripts, use the wp_add_inline_script() function instead. Please see Debugging in WordPress for more information. (This message was added in version 5.7.0.)
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=swifno-settings
    • > Notice in wp-content/plugins/swifno-merchant-api/includes/admin/settings.php+12
    Undefined index: status
    • > GET request to /wp-admin/admin.php?page=swifno-settings
    • > Notice in wp-content/plugins/swifno-merchant-api/includes/admin/settings/delivery_settings.php+5
    Undefined index: swifno_pickup_from_time
    • > GET request to /wp-admin/admin.php?page=swifno-settings
    • > Notice in wp-content/plugins/swifno-merchant-api/includes/admin/settings/delivery_settings.php+5
    Undefined index: swifno_pickup_to_time

SRP 50% 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 take a closer look at the following
  • 1× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/swifno-merchant-api/index.php

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser errors were detected

Optimizations

Plugin configuration 86% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
Please fix the following attributes:
  • Screenshots: These screenshots have no corresponding images in /assets: #1 (/assets/images/icon.png), #2 (/assets/images/swifno-1.jpg), #3 (/assets/images/swifno-2.jpg), #4 (/assets/images/swifno-3.jpg), #5 (/assets/images/swifno-4.jpg)
Please take inspiration from this readme.txt

swifno-merchant-api/index.php 77% from 13 tests

"Swifno Shipping Plugin" version 5.0.3's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
You should first fix the following items:
  • Description: The description should be shorter than 140 characters (currently 342 characters long)
  • Main file name: The principal plugin file should be the same as the plugin slug ("swifno-merchant-api.php" instead of "index.php")
  • Text Domain: The text domain should only use lowercase characters and dashes

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Everything looks great! No dangerous files found in this plugin965 lines of code in 20 files:
LanguageFilesBlank linesComment linesLines of code
PHP1719147818
CSS2236132
JavaScript15015

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.49
Average class complexity63.00
▷ Minimum class complexity63.00
▷ Maximum class complexity63.00
Average method complexity21.67
▷ Minimum method complexity1.00
▷ Maximum method complexity63.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods3
▷ Static methods00.00%
▷ Public methods3100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions22
▷ Named functions22100.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.00MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
assets/images/swifno.png3.94KB2.77KB▼ 29.59%