77% autoship-cloud

Code Review | Autoship Cloud for WooCommerce Subscription Products

WordPress plugin Autoship Cloud for WooCommerce Subscription Products scored77%from 54 tests.

About plugin

  • Plugin page: autoship-cloud
  • Plugin version: 2.5.0
  • PHP compatiblity: 7.3+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.4.1-6.4.1
  • WordPress version: 6.3.1
  • First release: Jan 8, 2018
  • Latest release: Nov 27, 2023
  • Number of updates: 176
  • Update frequency: every 12.2 days
  • Top authors: patternsinthecloud (100%)

Code review

54 tests

User reviews

28 reviews

Install metrics

400+ active /25,660 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
Installer ran successfully

Server metrics [RAM: ▲0.02MB] [CPU: ▼11.17ms] Passed 4 tests

Analyzing server-side resources used by Autoship Cloud for WooCommerce Subscription Products
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0340.85 ▼4.60
Dashboard /wp-admin3.33 ▼0.0146.66 ▼15.91
Posts /wp-admin/edit.php3.39 ▲0.0348.44 ▼0.39
Add New Post /wp-admin/post-new.php5.92 ▲0.0385.05 ▼23.77
Media Library /wp-admin/upload.php3.26 ▲0.0334.05 ▼0.05

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

Analyzing filesystem and database footprints of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 177 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-posts
widget_theysaidso_widget
widget_recent-comments
can_compress_scripts
db_upgraded
autoship_flush_rewrite_rules_flag
theysaidso_admin_options

Browser metrics Passed 4 tests

Autoship Cloud for WooCommerce Subscription Products: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,794 ▲4714.67 ▲0.161.74 ▲0.1042.78 ▼0.80
Dashboard /wp-admin2,199 ▲185.63 ▼0.0594.41 ▼8.8138.59 ▲2.11
Posts /wp-admin/edit.php2,104 ▲72.13 ▲0.1538.48 ▼0.7437.23 ▲2.49
Add New Post /wp-admin/post-new.php1,530 ▼1323.21 ▲0.12574.61 ▼43.4057.11 ▼5.10
Media Library /wp-admin/upload.php1,404 ▲104.19 ▼0.0094.31 ▼5.6342.94 ▼0.11

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
These items require your attention
  • This plugin does not fully uninstall, leaving 7 options in the database
    • can_compress_scripts
    • widget_recent-comments
    • autoship_flush_rewrite_rules_flag
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-posts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please take a closer look at the following
  • 4× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/autoship-cloud/templates/scheduled-orders-cart/schedule-cart-dialogs.php
    • > /wp-content/plugins/autoship-cloud/templates/admin/no-token.php
    • > /wp-content/plugins/autoship-cloud/templates/webchat/customer-bot.php
    • > /wp-content/plugins/autoship-cloud/scheduled-orders/dist/index.php
  • 59× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/autoship-cloud/src/coupons.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function do_action() in wp-content/plugins/autoship-cloud/templates/admin/utilities.php:3
    • > PHP Notice
      Undefined variable: error in wp-content/plugins/autoship-cloud/templates/admin/product-summary-metabox-error.php on line 10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function do_action() in wp-content/plugins/autoship-cloud/templates/admin/tax-rates.php:1
    • > PHP Notice
      Undefined variable: webchat_directline_secret in wp-content/plugins/autoship-cloud/templates/webchat/customer-bot.php on line 5
    • > PHP Notice
      Undefined variable: autoship_customer_id in wp-content/plugins/autoship-cloud/templates/webchat/customer-bot.php on line 7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function do_action() in wp-content/plugins/autoship-cloud/templates/admin/coupons.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/autoship-cloud/src/upgrade.php:54
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/autoship-cloud/src/admin.php:487
    • > PHP Fatal error
      Uncaught Error: Call to undefined function do_action() in wp-content/plugins/autoship-cloud/templates/admin/logs.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser issues were found

Optimizations

Plugin configuration 86% from 29 tests

readme.txt 94% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
Attributes that require attention:
  • Screenshots: These screenshots require images: #3 (Customer portals display upcoming orders and deliveries to your subscribers. Simple, flexible and look great on with your theme.), #4 (Set default and customized frequency options for all of the products that you offer on Autoship. Offer the same frequency to all customers or set unique frequencies for specific products and variable products.), #5 (Product subscription options are easy to customize and style for the best customer experience. Fully documented and well structured templates help your custom layouts shine!), #6 (Autoship Cloud’s plugin extension framework enables developers to add unique solutions. See how products can be added to an upcoming subscription order.)
The official readme.txt is a good inspiration

autoship-cloud/autoship.php 77% from 13 tests

The main PHP script in "Autoship Cloud for WooCommerce Subscription Products" version 2.5.0 is automatically included on every request by WordPress
You should first fix the following items:
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("autoship-cloud.php" instead of "autoship.php")
  • Requires at least: Required version must be the same as the one declared in readme.txt ("4.6" instead of "3.4.1")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
No dangerous file extensions were detected26,616 lines of code in 145 files:
LanguageFilesBlank linesComment linesLines of code
PHP838,36011,00418,104
CSS7420732,986
Sass233491,995
JSON2001,510
JavaScript135542651,499
SVG3607518
Markdown1103
YAML1001

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.40
Average class complexity10.00
▷ Minimum class complexity1.00
▷ Maximum class complexity43.00
Average method complexity1.47
▷ Minimum method complexity1.00
▷ Maximum method complexity10.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes5
▷ Abstract classes00.00%
▷ Concrete classes5100.00%
▷ Final classes00.00%
Methods95
▷ Static methods00.00%
▷ Public methods8488.42%
▷ Protected methods00.00%
▷ Private methods1111.58%
Functions920
▷ Named functions91799.67%
▷ Anonymous functions30.33%
Constants6
▷ Global constants6100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
12 PNG files occupy 3.32MB with 2.06MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/banner-1544x500.png470.50KB204.45KB▼ 56.55%
assets/screenshot-1.png607.97KB195.55KB▼ 67.84%
assets/AdvancedAutomationofWooCommerceProducts.png494.61KB167.45KB▼ 66.14%
assets/icon-128x128.png1.79KB0.66KB▼ 62.91%
assets/banner-1544x500-rtl.png451.67KB195.60KB▼ 56.69%