83% swipezoom-global-payment-and-shipping

Code Review | Plugin Name: SwipeZoom Global Payments and Shipping

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

About plugin

  • Plugin page: swipezoom-global-...
  • Plugin version: 1.0.1
  • PHP version: 7.4.16
  • WordPress version: 6.3.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 /805 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▼0.01MB] [CPU: ▼6.59ms] Passed 4 tests

A check of server-side resources used by Plugin Name: SwipeZoom Global Payments and Shipping
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0038.17 ▲0.87
Dashboard /wp-admin3.31 ▼0.0443.92 ▼15.39
Posts /wp-admin/edit.php3.36 ▲0.0047.51 ▲1.07
Add New Post /wp-admin/post-new.php5.89 ▲0.0079.43 ▼10.85
Media Library /wp-admin/upload.php3.23 ▲0.0033.38 ▼1.00

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

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 63 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
theysaidso_admin_options
can_compress_scripts
db_upgraded
widget_theysaidso_widget
widget_recent-posts

Browser metrics Passed 4 tests

Plugin Name: SwipeZoom Global Payments and Shipping: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.29 ▼0.341.95 ▲0.2544.62 ▲4.21
Dashboard /wp-admin2,198 ▲185.60 ▼0.0385.08 ▼1.8639.09 ▼2.92
Posts /wp-admin/edit.php2,100 ▼31.94 ▼0.2235.04 ▼7.8332.25 ▼4.21
Add New Post /wp-admin/post-new.php1,526 ▼1123.66 ▲5.46664.24 ▲47.4152.97 ▼12.11
Media Library /wp-admin/upload.php1,400 ▼34.20 ▼0.0495.30 ▼2.7340.97 ▼2.52

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
Please fix the following items
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • db_upgraded
    • can_compress_scripts
    • widget_recent-comments
    • widget_recent-posts
    • widget_theysaidso_widget
    • theysaidso_admin_options

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 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Almost there! Just fix the following items
  • 9× GET requests to PHP files have triggered server-side errors or warnings:
    • > 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 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-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 apply_filters() in wp-content/plugins/swipezoom-global-payment-and-shipping/woocommerce-swipezoom-internationalshipping.php:23
    • > 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 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 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 apply_filters() in wp-content/plugins/swipezoom-global-payment-and-shipping/woocommerce-swipezoom-payment.php:6

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 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 need to be fixed:
  • Requires at least: Version not formatted correctly
  • Plugin Name: Write the name of your plugin instead of "Plugin Name" on the first line ( === Plugin Name: SwipeZoom Global Payments and Shipping=== )
  • Tags: There are too many tags (11 tag instead of maximum 10)
The official readme.txt might help

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

The main PHP file in "Plugin Name: SwipeZoom Global Payments and Shipping" ver. 1.0.1 adds more information about the plugin and also serves as the entry point for this plugin
You should first fix the following items:
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug
  • Main file name: Name the main plugin file the same as the plugin slug ("swipezoom-global-payment-and-shipping.php" instead of "woocommerce-swipezoom-internationalshipping.php")
  • Domain Path: The domain path folder does not exist ("/languages")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
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

This is a short overview of cyclomatic complexity and code structure for this plugin
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
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/elv50.png4.62KB2.65KB▼ 42.72%
assets/images/payment_logos/maestro50.png4.25KB2.39KB▼ 43.80%
assets/images/payment_logos/mastercardseecurecode50.png3.09KB2.03KB▼ 34.45%
assets/images/payment_logos/diners50.png1.46KB1.66KB0.00%
assets/images/sz.png4.11KB2.35KB▼ 42.86%