93% swipezoom-global-payment-and-shipping

Code Review | Plugin Name: SwipeZoom Global Payments and Shipping

WordPress plugin Plugin Name: SwipeZoom Global Payments and Shippingscored 93% from 54 tests.

About plugin

  • Plugin page: swipezoom-global-...
  • Plugin version: 1.0.1
  • PHP version: 7.4.16
  • WordPress version: 5.8.1
  • First release: Apr 6, 2016
  • Latest release: May 12, 2016
  • Number of updates: 30
  • Update frequency: every 1.2 days
  • Top authors: swipezoom (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 695 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▼0.00MB] [CPU: ▼147.32ms] Passed 4 tests

This is a short check of server-side resources used by Plugin Name: SwipeZoom Global Payments and Shipping
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /2.84 ▲0.0024.45 ▲2.21
Dashboard /wp-admin3.06 ▼0.0030.95 ▼13.94
Posts /wp-admin/edit.php3.11 ▲0.0030.47 ▼0.78
Add New Post /wp-admin/post-new.php5.42 ▼0.0268.13 ▼574.57
Media Library /wp-admin/upload.php3.00 ▲0.0022.18 ▲0.03

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 63 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

Plugin Name: SwipeZoom Global Payments and Shipping: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,666 ▲3915.88 ▼0.145.10 ▼1.9875.57 ▲0.87
Dashboard /wp-admin2,930 ▲376.15 ▲0.06116.30 ▼16.83167.95 ▲0.55
Posts /wp-admin/edit.php2,743 ▲63.24 ▼0.0165.87 ▲1.55139.07 ▼2.97
Add New Post /wp-admin/post-new.php3,698 ▼10918.36 ▼0.67420.82 ▼45.31163.73 ▼14.68
Media Library /wp-admin/upload.php1,752 ▼05.47 ▼0.06149.06 ▲8.45181.66 ▲0.58

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The plugin uninstalled completely, with no zombie files or tables

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Good news, no errors were detected

SRP 50% from 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
Please fix the following items
  • 9× PHP files trigger server errors when accessed directly:
    • > PHP Notice
      Undefined index: post in wp-content/plugins/swipezoom-global-payment-and-shipping/woocommerce/admin/swipezoom-order-grid.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function apply_filters() in wp-content/plugins/swipezoom-global-payment-and-shipping/woocommerce-swipezoom-payment.php:6
    • > PHP Notice
      Undefined index: post in wp-content/plugins/swipezoom-global-payment-and-shipping/woocommerce/admin/swipezoom-shipping-handling-information.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_post_meta() in wp-content/plugins/swipezoom-global-payment-and-shipping/woocommerce/admin/swipezoom-order-grid.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_post_meta() in wp-content/plugins/swipezoom-global-payment-and-shipping/woocommerce/admin/swipezoom-item-package-details.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_post_meta() in wp-content/plugins/swipezoom-global-payment-and-shipping/woocommerce/admin/swipezoom-shipping-handling-information.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/swipezoom-global-payment-and-shipping/overridden-functions.php:8
    • > PHP Notice
      Undefined index: post in wp-content/plugins/swipezoom-global-payment-and-shipping/woocommerce/admin/swipezoom-item-package-details.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function apply_filters() in wp-content/plugins/swipezoom-global-payment-and-shipping/woocommerce-swipezoom-internationalshipping.php:23

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
There were no browser issues found

Optimizations

Plugin configuration 79% from 29 tests

readme.txt 81% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
Attributes that require attention:
  • Plugin Name: Please specify the plugin name on the first line ( === Plugin Name: SwipeZoom Global Payments and Shipping=== )
  • Tags: Please reduce the number of tags, currently 11 tag instead of maximum 10
  • Requires at least: Invalid version format
You can look at the official readme.txt

swipezoom-global-payment-and-shipping/woocommerce-swipezoom-internationalshipping.php 77% from 13 tests

"Plugin Name: SwipeZoom Global Payments and Shipping" version 1.0.1's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
Please take the time to fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("swipezoom-global-payment-and-shipping.php" instead of "woocommerce-swipezoom-internationalshipping.php")
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6
  • Domain Path: The domain path folder was not found ("/languages")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Everything looks great! No dangerous files found in this plugin6,770 lines of code in 38 files:
LanguageFilesBlank linesComment linesLines of code
PHP217877082,812
XSD5368652,013
XML9294521,156
JavaScript216184715
CSS17974

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.39
Average class complexity33.67
▷ Minimum class complexity7.00
▷ Maximum class complexity73.00
Average method complexity2.69
▷ Minimum method complexity1.00
▷ Maximum method complexity17.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods58
▷ Static methods00.00%
▷ Public methods4882.76%
▷ Protected methods1017.24%
▷ Private methods00.00%
Functions41
▷ Named functions41100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
15 PNG files occupy 0.04MB with 0.01MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/payment_logos/sepa50.png2.84KB1.91KB▼ 32.60%
assets/images/payment_logos/jcb50.png3.12KB2.09KB▼ 32.93%
assets/images/payment_logos/visa50.png1.89KB1.73KB▼ 8.17%
assets/images/payment_logos/diners50.png1.46KB1.66KB0.00%
assets/images/payment_logos/visaelectron50.png3.03KB2.10KB▼ 30.62%