74% craftgate-payment-gateway

Code Review | Craftgate Payment Gateway

WordPress plugin Craftgate Payment Gateway scored74%from 54 tests.

About plugin

  • Plugin page: craftgate-payment...
  • Plugin version: 1.0.9
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4-6.0
  • WordPress version: 6.3.1
  • First release: Apr 5, 2021
  • Latest release: Jan 2, 2023
  • Number of updates: 25
  • Update frequency: every 25.5 days
  • Top authors: craftgateio (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /809 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed successfully, without throwing any errors or notices

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

Analyzing server-side resources used by Craftgate Payment Gateway
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0138.63 ▼0.92
Dashboard /wp-admin3.31 ▲0.0146.81 ▼0.35
Posts /wp-admin/edit.php3.42 ▲0.0744.47 ▼2.46
Add New Post /wp-admin/post-new.php5.89 ▲0.0188.53 ▼6.41
Media Library /wp-admin/upload.php3.23 ▲0.0136.14 ▼1.45

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

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

Browser metrics Passed 4 tests

This is an overview of browser requirements for Craftgate Payment Gateway
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,802 ▲5613.19 ▼1.421.79 ▼0.0242.49 ▼1.29
Dashboard /wp-admin2,209 ▲215.88 ▲0.02108.87 ▲4.2842.41 ▲2.83
Posts /wp-admin/edit.php2,089 ▼02.05 ▲0.0539.24 ▲1.6634.91 ▲1.15
Add New Post /wp-admin/post-new.php1,535 ▲1523.09 ▲1.99651.49 ▼5.9947.48 ▼5.58
Media Library /wp-admin/upload.php1,388 ▲64.20 ▼0.0895.47 ▼8.0140.16 ▼4.23

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
You still need to fix the following
  • The plugin did not uninstall successfully, leaving 1 table in the database
    • wp_craftgate_card
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-posts
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-comments

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 take a closer look at the following
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'Craftgate\\Adapter\\BaseAdapter' not found in wp-content/plugins/craftgate-payment-gateway/includes/lib/craftgate/src/Adapter/PaymentAdapter.php:5

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
9 plugin tags: sanal pos, czdan, kredi kart, deme formu, pazaryeri...

craftgate-payment-gateway/craftgate-payment-gateway.php Passed 13 tests

The main file in "Craftgate Payment Gateway" v. 1.0.9 serves as a complement to information provided in readme.txt and as the entry point to the plugin
93 characters long description:
Accept debit/credit card payments easily and directly on your WordPress site using Craftgate.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
There were no executable files found in this plugin1,000 lines of code in 16 files:
LanguageFilesBlank linesComment linesLines of code
PHP14156223873
PO File13742106
CSS13721

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.24
Average class complexity5.92
▷ Minimum class complexity1.00
▷ Maximum class complexity47.00
Average method complexity1.95
▷ Minimum method complexity1.00
▷ Maximum method complexity6.00
Code structure
Namespaces4
Interfaces0
Traits0
Classes12
▷ Abstract classes00.00%
▷ Concrete classes12100.00%
▷ Final classes00.00%
Methods62
▷ Static methods812.90%
▷ Public methods3454.84%
▷ Protected methods46.45%
▷ Private methods2438.71%
Functions8
▷ Named functions787.50%
▷ Anonymous functions112.50%
Constants10
▷ Global constants00.00%
▷ Class constants10100.00%
▷ Public constants10100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
1 PNG file occupies 0.02MB with 0.02MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
assets/images/card-brands.png25.37KB7.98KB▼ 68.56%