83% astropay-for-woocommerce

Code Review | AstroPay for WooCommerce

WordPress plugin AstroPay for WooCommerce scored 83% from 54 tests.

About plugin

  • Plugin page: astropay-for-wooc...
  • Plugin version: 2.0.3
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4-5.7
  • WordPress version: 6.3.1
  • First release: Mar 19, 2021
  • Latest release: Jul 13, 2023
  • Number of updates: 6
  • Update frequency: every 141.2 days
  • Top authors: astropayintegrations (100%)

Code review

54 tests

User reviews

1 review

Install metrics

60+ active / 1,125 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.00MB] [CPU: ▼7.82ms] Passed 4 tests

Analyzing server-side resources used by AstroPay for WooCommerce
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0036.50 ▼6.03
Dashboard /wp-admin3.31 ▲0.0043.08 ▼8.96
Posts /wp-admin/edit.php3.36 ▲0.0048.45 ▼3.60
Add New Post /wp-admin/post-new.php5.89 ▲0.0085.83 ▼12.70
Media Library /wp-admin/upload.php3.23 ▲0.0032.13 ▼2.51

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

Input-output and database impact of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 37 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
can_compress_scripts
widget_recent-posts
db_upgraded
theysaidso_admin_options
widget_theysaidso_widget

Browser metrics Passed 4 tests

An overview of browser requirements for AstroPay for WooCommerce
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲4313.22 ▼1.171.70 ▼0.6445.77 ▼4.95
Dashboard /wp-admin2,209 ▲185.91 ▼0.02107.99 ▲5.4839.31 ▼8.98
Posts /wp-admin/edit.php2,089 ▼32.04 ▲0.0239.02 ▼0.4536.02 ▼1.11
Add New Post /wp-admin/post-new.php1,536 ▲1623.11 ▼0.23606.43 ▼47.1651.11 ▼12.41
Media Library /wp-admin/upload.php1,388 ▲64.28 ▲0.0992.35 ▼4.7843.17 ▼0.65

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
It is recommended to fix the following
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-comments
    • can_compress_scripts
    • widget_recent-posts
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please fix the following
  • 3× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function Ecomerciar\\AstroPay\\Gateway\\apply_filters() in wp-content/plugins/astropay-for-woocommerce/src/gateway/settings.php:12
    • > PHP Fatal error
      Trait 'Ecomerciar\\AstroPay\\Helper\\TemplatesTrait' not found in wp-content/plugins/astropay-for-woocommerce/src/helper/class-helper.php on line 13
    • > PHP Fatal error
      Uncaught Error: Class 'Ecomerciar\\AstroPay\\Helper\\Helper' not found in wp-content/plugins/astropay-for-woocommerce/templates/page-onboarding.php:4

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser errors were detected

Optimizations

Plugin configuration 83% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
Please fix the following attributes:
  • Screenshots: These screenshots lack descriptions #1, #2, #3, #4, #5, #6 in astropay-for-woocommerce/assets to your readme.txt
  • Tags: There are too many tags (14 tag instead of maximum 10)
Please take inspiration from this readme.txt

astropay-for-woocommerce/astropay-woocommerce.php 77% from 13 tests

The main file in "AstroPay for WooCommerce" v. 2.0.3 serves as a complement to information provided in readme.txt and as the entry point to the plugin
Please make the necessary changes and fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("astropay-for-woocommerce.php" instead of "astropay-woocommerce.php")
  • Requires at least: Required version number formatted incorrectly (ex. "7.0" instead of "4")
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug

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
Good job! No executable or dangerous file extensions detected2,623 lines of code in 29 files:
LanguageFilesBlank linesComment linesLines of code
PHP233006692,193
CSS14561266
SVG40283
JavaScript112381

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.40
Average class complexity10.75
▷ Minimum class complexity1.00
▷ Maximum class complexity45.00
Average method complexity3.38
▷ Minimum method complexity1.00
▷ Maximum method complexity19.00
Code structure
Namespaces7
Interfaces1
Traits9
Classes10
▷ Abstract classes220.00%
▷ Concrete classes880.00%
▷ Final classes00.00%
Methods84
▷ Static methods5160.71%
▷ Public methods7690.48%
▷ Protected methods22.38%
▷ Private methods67.14%
Functions3
▷ Named functions00.00%
▷ Anonymous functions3100.00%
Constants15
▷ Global constants00.00%
▷ Class constants15100.00%
▷ Public constants15100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
2 PNG files occupy 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/img/astropay-woocommerce-logo.png9.20KB5.08KB▼ 44.76%
assets/img/loading-spinner.png1.18KB1.35KB0.00%