83% payment-gateway-via-paylike-for-woocommerce

Code Review | WooCommerce Paylike Payment Gateway

WordPress plugin WooCommerce Paylike Payment Gateway scored83%from 54 tests.

About plugin

  • Plugin page: payment-gateway-v...
  • Plugin version: 4.0.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-6.3
  • WordPress version: 6.3.1
  • First release: Oct 10, 2016
  • Latest release: Nov 28, 2023
  • Number of updates: 184
  • Update frequency: every 14.2 days
  • Top authors: ionut.calara (100%)

Code review

54 tests

User reviews

7 reviews

Install metrics

3,000+ active /66,732 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.14MB] [CPU: ▼0.65ms] Passed 4 tests

Server-side resources used by WooCommerce Paylike Payment Gateway
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.56 ▲0.1039.48 ▼0.39
Dashboard /wp-admin3.46 ▲0.1549.99 ▼3.64
Posts /wp-admin/edit.php3.57 ▲0.2149.89 ▼3.25
Add New Post /wp-admin/post-new.php6.04 ▲0.1596.39 ▲4.69
Media Library /wp-admin/upload.php3.38 ▲0.1537.07 ▲4.99

Server storage [IO: ▲0.38MB] [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: 80 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
widget_recent-comments
widget_recent-posts
widget_theysaidso_widget
theysaidso_admin_options
can_compress_scripts

Browser metrics Passed 4 tests

A check of browser resources used by WooCommerce Paylike Payment Gateway
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,799 ▲3714.69 ▼0.031.58 ▼0.4742.82 ▼1.01
Dashboard /wp-admin2,204 ▲275.63 ▲0.0191.54 ▼7.8343.06 ▼3.59
Posts /wp-admin/edit.php2,109 ▲91.99 ▼0.0439.44 ▼2.1136.99 ▼0.17
Add New Post /wp-admin/post-new.php1,535 ▲923.22 ▼0.02640.86 ▲20.3863.07 ▲14.11
Media Library /wp-admin/upload.php1,412 ▲184.17 ▼0.0194.66 ▲0.7641.49 ▼1.11

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
These items require your attention
  • Zombie WordPress options detected upon uninstall: 6 options
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_recent-comments
    • widget_theysaidso_widget
    • can_compress_scripts
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting 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: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Almost there! Just fix the following items
  • 22× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Paylike\\Exception\\ApiException' not found in wp-content/plugins/payment-gateway-via-paylike-for-woocommerce/vendor/paylike/php-api/src/Exception/ApiConnection.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'Paylike\\Tests\\BaseTest' not found in wp-content/plugins/payment-gateway-via-paylike-for-woocommerce/vendor/paylike/php-api/tests/CurrenciesTest.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'Paylike\\Exception\\ApiException' not found in wp-content/plugins/payment-gateway-via-paylike-for-woocommerce/vendor/paylike/php-api/src/Exception/NotFound.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'Paylike\\Tests\\BaseTest' not found in wp-content/plugins/payment-gateway-via-paylike-for-woocommerce/vendor/paylike/php-api/tests/MerchantsLinesTest.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'Paylike\\Tests\\BaseTest' not found in wp-content/plugins/payment-gateway-via-paylike-for-woocommerce/vendor/paylike/php-api/tests/AppsTest.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'Paylike\\Endpoint\\Endpoint' not found in wp-content/plugins/payment-gateway-via-paylike-for-woocommerce/vendor/paylike/php-api/src/Endpoint/Apps.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'Paylike\\Endpoint\\Endpoint' not found in wp-content/plugins/payment-gateway-via-paylike-for-woocommerce/vendor/paylike/php-api/src/Endpoint/Merchants.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'Paylike\\Exception\\ApiException' not found in wp-content/plugins/payment-gateway-via-paylike-for-woocommerce/vendor/paylike/php-api/src/Exception/Unauthorized.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'Paylike\\Tests\\BaseTest' not found in wp-content/plugins/payment-gateway-via-paylike-for-woocommerce/vendor/paylike/php-api/tests/TransactionsTest.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'Paylike\\Tests\\BaseTest' not found in wp-content/plugins/payment-gateway-via-paylike-for-woocommerce/vendor/paylike/php-api/tests/MerchantsTest.php:7

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
There were no browser issues found

Optimizations

Plugin configuration 86% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
These attributes need to be fixed: The official readme.txt is a good inspiration

payment-gateway-via-paylike-for-woocommerce/woocommerce-gateway-paylike.php 77% from 13 tests

The primary PHP file in "WooCommerce Paylike Payment Gateway" version 4.0.2 is used by WordPress to initiate all plugin functionality
The following require your attention:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("payment-gateway-via-paylike-for-woocommerce.php" instead of "woocommerce-gateway-paylike.php")
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug
  • Requires at least: Required version does not match the one declared in readme.txt ("4.4" instead of "3.0")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
There were no executable files found in this plugin7,818 lines of code in 67 files:
LanguageFilesBlank linesComment linesLines of code
PHP528931,9876,291
PO File3298401957
JavaScript14629301
Markdown2400136
JSON30099
XML22030
SVG4004

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.35
Average class complexity13.72
▷ Minimum class complexity1.00
▷ Maximum class complexity181.00
Average method complexity2.75
▷ Minimum method complexity1.00
▷ Maximum method complexity20.00
Code structure
Namespaces11
Interfaces1
Traits0
Classes39
▷ Abstract classes25.13%
▷ Concrete classes3794.87%
▷ Final classes00.00%
Methods289
▷ Static methods3010.38%
▷ Public methods23280.28%
▷ Protected methods206.92%
▷ Private methods3712.80%
Functions14
▷ Named functions1071.43%
▷ Anonymous functions428.57%
Constants15
▷ Global constants1386.67%
▷ Class constants213.33%
▷ Public constants2100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
1 PNG file occupies 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
assets/images/paylike.png6.17KB3.30KB▼ 46.51%