84% charge-anywhere-payment-gateway-for-woocommerce

Code Review | Charge Anywhere Payment Gateway For WooCommerce

WordPress plugin Charge Anywhere Payment Gateway For WooCommercescored84%from 54 tests.

About plugin

  • Plugin page: charge-anywhere-p...
  • Plugin version: 1.13
  • PHP compatiblity: 7.0.1+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-6.3.1
  • WordPress version: 6.3.1
  • First release: Oct 14, 2022
  • Latest release: Sep 1, 2023
  • Number of updates: 21
  • Update frequency: every 15.7 days
  • Top authors: tsmires (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /646 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
The plugin installed successfully, without throwing any errors or notices

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

An overview of server-side resources used by Charge Anywhere Payment Gateway For WooCommerce
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0139.79 ▼3.76
Dashboard /wp-admin3.31 ▲0.0144.81 ▼2.11
Posts /wp-admin/edit.php3.42 ▲0.0745.78 ▲0.27
Add New Post /wp-admin/post-new.php5.89 ▲0.0183.65 ▼5.36
Media Library /wp-admin/upload.php3.23 ▲0.0132.50 ▼1.29

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

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

Browser metrics Passed 4 tests

Charge Anywhere Payment Gateway For WooCommerce: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲6513.21 ▼1.251.66 ▼0.4643.17 ▼3.70
Dashboard /wp-admin2,203 ▲125.90 ▲0.9793.21 ▼10.6238.90 ▼5.26
Posts /wp-admin/edit.php2,089 ▲212.02 ▼0.0338.61 ▲3.7332.54 ▼3.01
Add New Post /wp-admin/post-new.php1,533 ▼023.28 ▲0.10668.61 ▼7.1763.77 ▲4.48
Media Library /wp-admin/upload.php1,388 ▼04.24 ▲0.0394.76 ▼18.5440.79 ▼7.75

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
These items require your attention
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • theysaidso_admin_options
    • db_upgraded
    • can_compress_scripts
    • widget_recent-comments
    • widget_recent-posts
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for 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
  • 2× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/charge-anywhere-payment-gateway-for-woocommerce/credit_card.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/charge-anywhere-payment-gateway-for-woocommerce/index.php:14

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
These attributes need to be fixed:
  • Plugin Name: Write the name of your plugin instead of "Plugin Name" on the first line ( === Charge Anywhere Payment Gateway For WooCommerce=== )
The official readme.txt is a good inspiration

charge-anywhere-payment-gateway-for-woocommerce/index.php 92% from 13 tests

The primary PHP file in "Charge Anywhere Payment Gateway For WooCommerce" version 1.13 is used by WordPress to initiate all plugin functionality
Please make the necessary changes and fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("charge-anywhere-payment-gateway-for-woocommerce.php" instead of "index.php")

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
Success! There were no dangerous files found in this plugin1,510 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
PHP31601631,229
JavaScript2625280
SVG1001

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.38
Average class complexity130.00
▷ Minimum class complexity130.00
▷ Maximum class complexity130.00
Average method complexity6.38
▷ Minimum method complexity1.00
▷ Maximum method complexity51.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods24
▷ Static methods00.00%
▷ Public methods24100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions9
▷ Named functions666.67%
▷ Anonymous functions333.33%
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
No PNG images were found in this plugin