78% wc-paywithspecta-payment-gateway

Code Review | Payment Gateway for PayWithSpecta

WordPress plugin Payment Gateway for PayWithSpecta scored78%from 54 tests.

About plugin

  • Plugin page: wc-paywithspecta-...
  • Plugin version: 1.0.1
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-5.8
  • WordPress version: 6.3.1
  • First release: Sep 2, 2021
  • Latest release: Sep 8, 2021
  • Number of updates: 8
  • Update frequency: every 1.5 days
  • Top authors: acesys (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /435 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.07MB] [CPU: ▼3.58ms] Passed 4 tests

Analyzing server-side resources used by Payment Gateway for PayWithSpecta
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.0735.78 ▼3.81
Dashboard /wp-admin3.37 ▲0.0645.78 ▼4.52
Posts /wp-admin/edit.php3.48 ▲0.1245.37 ▲0.83
Add New Post /wp-admin/post-new.php5.97 ▲0.0893.63 ▼4.26
Media Library /wp-admin/upload.php3.29 ▲0.0634.78 ▼1.72

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

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 26 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
can_compress_scripts
db_upgraded
widget_recent-posts
widget_theysaidso_widget
theysaidso_admin_options

Browser metrics Passed 4 tests

Payment Gateway for PayWithSpecta: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,920 ▲17413.54 ▼0.847.54 ▲5.6742.05 ▼4.64
Dashboard /wp-admin2,212 ▲245.83 ▲0.01102.33 ▼1.0636.82 ▼7.54
Posts /wp-admin/edit.php2,100 ▲112.01 ▼0.0535.95 ▼0.3533.00 ▲3.18
Add New Post /wp-admin/post-new.php1,535 ▲218.22 ▼5.01637.94 ▼50.4052.58 ▼2.35
Media Library /wp-admin/upload.php1,397 ▲124.22 ▲0.0098.93 ▼7.7244.80 ▼0.46

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
You still need to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • db_upgraded
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-posts
    • widget_recent-comments

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please take a closer look at the following
  • 2× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/wc-paywithspecta-payment-gateway/public/partials/wc-paywithspecta-payment-gateway-public-display.php
    • > /wp-content/plugins/wc-paywithspecta-payment-gateway/admin/partials/wc-paywithspecta-payment-gateway-admin-display.php
  • 2× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/wc-paywithspecta-payment-gateway/includes/class-wc-paywithspecta-payment-gateway.php:30
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wc-paywithspecta-payment-gateway/includes/functions-paywithspecta-woocommerce.php:127

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% 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 do not have images: #1 (PayWithSpecta Payment Gateway Setting Page), #2 (PayWithSpecta Payment Gateway on the checkout page)
  • Donate link: Please fix this invalid URI: ""
You can look at the official readme.txt

wc-paywithspecta-payment-gateway/wc-paywithspecta-payment-gateway.php 92% from 13 tests

The main file in "Payment Gateway for PayWithSpecta" v. 1.0.1 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:
  • Description: Keep the plugin description shorter than 140 characters (currently 147 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Everything looks great! No dangerous files found in this plugin411 lines of code in 18 files:
LanguageFilesBlank linesComment linesLines of code
PHP14166617405
JavaScript24546
CSS2080

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.21
Average class complexity2.88
▷ Minimum class complexity1.00
▷ Maximum class complexity13.00
Average method complexity1.54
▷ Minimum method complexity1.00
▷ Maximum method complexity9.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes8
▷ Abstract classes00.00%
▷ Concrete classes8100.00%
▷ Final classes00.00%
Methods28
▷ Static methods27.14%
▷ Public methods2382.14%
▷ Protected methods00.00%
▷ Private methods517.86%
Functions9
▷ Named functions9100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
2 PNG files occupy 0.04MB with 0.03MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/main_logo.png24.66KB10.04KB▼ 59.30%
assets/images/main_logo_medium.png18.77KB5.61KB▼ 70.11%