84% artemis-payment-gateway

Code Review | Artemis Payment Gateway for WooCommerce

WordPress plugin Artemis Payment Gateway for WooCommerce scored84%from 54 tests.

About plugin

  • Plugin page: artemis-payment-g...
  • Plugin version: 1.2.2
  • PHP compatiblity: 8.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.8-6.1.1
  • WordPress version: 6.3.1
  • First release: Nov 12, 2022
  • Latest release: Nov 17, 2022
  • Number of updates: 10
  • Update frequency: every 0.8 days
  • Top authors: artemisgateway (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,299 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Install script ran successfully

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

An overview of server-side resources used by Artemis Payment Gateway for WooCommerce
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0035.41 ▼7.01
Dashboard /wp-admin3.31 ▼0.0445.39 ▼14.05
Posts /wp-admin/edit.php3.36 ▲0.0047.27 ▲2.30
Add New Post /wp-admin/post-new.php5.89 ▲0.0091.06 ▼7.86
Media Library /wp-admin/upload.php3.23 ▲0.0044.80 ▲8.19

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

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

Browser metrics Passed 4 tests

A check of browser resources used by Artemis Payment Gateway for WooCommerce
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲2914.74 ▲0.141.64 ▼0.2342.99 ▲0.38
Dashboard /wp-admin2,206 ▲185.91 ▼0.13107.59 ▼5.3140.51 ▼3.90
Posts /wp-admin/edit.php2,089 ▼02.04 ▲0.0141.40 ▲6.7536.96 ▲1.70
Add New Post /wp-admin/post-new.php1,533 ▼023.27 ▼0.07661.10 ▼42.6153.29 ▼5.95
Media Library /wp-admin/upload.php1,388 ▼04.19 ▼0.2094.40 ▼16.1942.04 ▼5.13

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
It is recommended to fix the following
  • The uninstall procedure has failed, leaving 6 options in the database
    • can_compress_scripts
    • db_upgraded
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

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

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please fix the following items
  • 763× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/artemis-payment-gateway/vendor/soneso/stellar-php-sdk/Soneso/StellarSDKTests/AmmTest.php:33
    • > PHP Fatal error
      Uncaught Error: Class 'ParagonIE_Sodium_Core_SipHash' not found in wp-content/plugins/artemis-payment-gateway/vendor/paragonie/sodium_compat/namespaced/Core/SipHash.php:4
    • > PHP Notice
      Constant SODIUM_CRYPTO_PWHASH_SCRYPTSALSA208SHA256_OPSLIMIT_INTERACTIVE already defined in wp-content/plugins/artemis-payment-gateway/vendor/paragonie/sodium_compat/lib/php72compat_const.php on line 65
    • > PHP Parse error
      syntax error, unexpected '->' (T_OBJECT_OPERATOR) in wp-content/plugins/artemis-payment-gateway/vendor/soneso/stellar-php-sdk/Soneso/StellarSDK/Transaction.php on line 144
    • > PHP Fatal error
      Uncaught Error: Class 'phpseclib3\\Crypt\\Common\\Formats\\Signature\\Raw' not found in wp-content/plugins/artemis-payment-gateway/vendor/phpseclib/phpseclib/phpseclib/Crypt/EC/Formats/Signature/Raw.php:23
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/artemis-payment-gateway/vendor/bacon/bacon-qr-code/test/Common/ReedSolomonCodecTest.php:10
    • > PHP Notice
      Constant SODIUM_CRYPTO_BOX_SEEDBYTES already defined in wp-content/plugins/artemis-payment-gateway/vendor/paragonie/sodium_compat/lib/php72compat_const.php on line 35
    • > PHP Warning
      require_once(wp-content/plugins/artemis-payment-gateway/vendor/chillerlan/php-qrcode/examples/../vendor/autoload.php): failed to open stream: No such file or directory in wp-content/plugins/artemis-payment-gateway/vendor/chillerlan/php-qrcode/examples/image.php on line 15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/artemis-payment-gateway/src/woocommerce/wc_agp_payment.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'phpseclib3\\Crypt\\Common\\AsymmetricKey' not found in wp-content/plugins/artemis-payment-gateway/vendor/phpseclib/phpseclib/phpseclib/Crypt/DSA.php:44

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
There were no browser issues found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
7 plugin tags: cryptocurrency, woocommerce, crypto-currency, bitcoin, ecommerce...

artemis-payment-gateway/artemispaymentgateway.php 92% from 13 tests

The main file in "Artemis Payment Gateway for WooCommerce" v. 1.2.2 serves as a complement to information provided in readme.txt and as the entry point to the plugin
Please take the time to fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("artemis-payment-gateway.php" instead of "artemispaymentgateway.php")

Code Analysis 97% from 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 plugin122,861 lines of code in 1,425 files:
LanguageFilesBlank linesComment linesLines of code
PHP1,33022,88552,556112,705
Markdown572,42107,096
JSON23002,594
XML750151
CSS220139
HTML1260137
JavaScript27034
Bourne Shell1203
SVG1001
TOML1001

PHP code 50% from 2 tests

A short review of cyclomatic complexity and code structure
The following items need your attention
  • Method cyclomatic complexity should be reduced to less than 100 (currently 104)
Cyclomatic complexity
Average complexity per logical line of code0.28
Average class complexity10.79
▷ Minimum class complexity1.00
▷ Maximum class complexity670.00
Average method complexity2.63
▷ Minimum method complexity1.00
▷ Maximum method complexity104.00
Code structure
Namespaces147
Interfaces61
Traits11
Classes1,224
▷ Abstract classes24319.85%
▷ Concrete classes98180.15%
▷ Final classes17017.33%
Methods7,403
▷ Static methods1,78624.13%
▷ Public methods6,28484.88%
▷ Protected methods5106.89%
▷ Private methods6098.23%
Functions382
▷ Named functions21556.28%
▷ Anonymous functions16743.72%
Constants1,354
▷ Global constants151.11%
▷ Class constants1,33998.89%
▷ Public constants1,16486.93%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
7 PNG files occupy 0.06MB with 0.03MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
vendor/endroid/qr-code/assets/blackfire.png28.08KB10.02KB▼ 64.30%
vendor/chillerlan/php-qrcode/examples/example_svg.png15.55KB6.70KB▼ 56.90%
vendor/chillerlan/php-qrcode/examples/example_image.png2.23KB1.09KB▼ 50.94%
vendor/chillerlan/php-qrcode/examples/octocat.png2.41KB2.46KB0.00%
vendor/bacon/bacon-qr-code/test/Integration/__snapshots__/files/ImagickRenderingTest__testGenericQrCode__1.png3.04KB1.72KB▼ 43.30%