77% pacific-payment-gateway

Code Review | Pacific Payment Gateway

WordPress plugin Pacific Payment Gateway scored77%from 54 tests.

About plugin

  • Plugin page: pacific-payment-g...
  • Plugin version: 1.0.23
  • PHP compatiblity: 7.1+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.3-6.0.1
  • WordPress version: 6.3.1
  • First release: Aug 30, 2022
  • Latest release: Sep 30, 2022
  • Number of updates: 35
  • Update frequency: every 1.7 days
  • Top authors: pacificorg (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /445 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
This plugin's installer ran successfully

Server metrics [RAM: ▼0.00MB] [CPU: ▼13.46ms] Passed 4 tests

A check of server-side resources used by Pacific Payment Gateway
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0134.68 ▼7.37
Dashboard /wp-admin3.31 ▼0.0346.04 ▼20.14
Posts /wp-admin/edit.php3.36 ▲0.0145.35 ▼4.54
Add New Post /wp-admin/post-new.php5.89 ▲0.0181.34 ▼21.78
Media Library /wp-admin/upload.php3.23 ▲0.0033.60 ▼0.59

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

Filesystem and database footprint
The plugin installed successfully
Filesystem: 2,020 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
can_compress_scripts
widget_theysaidso_widget
widget_recent-comments
theysaidso_admin_options
db_upgraded

Browser metrics Passed 4 tests

A check of browser resources used by Pacific Payment Gateway
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5413.28 ▼0.974.29 ▲2.4941.41 ▼2.90
Dashboard /wp-admin2,200 ▲155.83 ▼0.10102.02 ▲0.6741.63 ▲0.20
Posts /wp-admin/edit.php2,089 ▼02.01 ▲0.0234.50 ▼4.6333.85 ▼1.35
Add New Post /wp-admin/post-new.php1,531 ▲218.12 ▼5.09657.26 ▼35.5152.64 ▼13.34
Media Library /wp-admin/upload.php1,388 ▼04.21 ▲0.0495.97 ▼6.6142.41 ▼2.01

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

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 0% 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
  • 3× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/pacific-payment-gateway/vendor/pacific/core/tests/test.php
    • > /wp-content/plugins/pacific-payment-gateway/vendor/symfony/mime/Resources/bin/update_mime_types.php
    • > /wp-content/plugins/pacific-payment-gateway/vendor/symfony/intl/Resources/bin/update-data.php
  • 369× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'phpDocumentor\\Reflection\\DocBlock\\Tags\\TagWithType' not found in wp-content/plugins/pacific-payment-gateway/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Var_.php:25
    • > PHP Fatal error
      Uncaught Error: Interface 'Symfony\\Component\\Serializer\ormalizer\ormalizerInterface' not found in wp-content/plugins/pacific-payment-gateway/vendor/symfony/serializer/Normalizer/ProblemNormalizer.php:25
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Container\\ContainerExceptionInterface' not found in wp-content/plugins/pacific-payment-gateway/vendor/psr/container/src/NotFoundExceptionInterface.php:11
    • > PHP Fatal error
      Uncaught Error: Interface 'Pacific\\Core\\Utils\\ContextInterface' not found in wp-content/plugins/pacific-payment-gateway/vendor/pacific/core/src/Api/Context.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'Symfony\\Component\\HttpClient\\Chunk\\DataChunk' not found in wp-content/plugins/pacific-payment-gateway/vendor/symfony/http-client/Chunk/InformationalChunk.php:19
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/pacific-payment-gateway/templates/admin/select_input.php:16
    • > PHP Fatal error
      Uncaught Error: Interface 'Symfony\\Component\\Serializer\\Exception\\ExceptionInterface' not found in wp-content/plugins/pacific-payment-gateway/vendor/symfony/serializer/Exception/LogicException.php:19
    • > PHP Fatal error
      Uncaught Error: Class 'WC_Shipping_Method' not found in wp-content/plugins/pacific-payment-gateway/src/app/Component/PacificInpostShipmentMethod.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'Symfony\\Component\\Intl\\DateFormatter\\DateFormat\\Transformer' not found in wp-content/plugins/pacific-payment-gateway/vendor/symfony/intl/DateFormatter/DateFormat/SecondTransformer.php:21
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/pacific-payment-gateway/templates/admin/text_input.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine on the user side

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
These attributes need your attention:
  • Donate link: Please fix this invalid url: ""
You can look at the official readme.txt

pacific-payment-gateway/pacific-gateway.php 85% from 13 tests

This is the main PHP file of "Pacific Payment Gateway" version 1.0.23, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
Please take the time to fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("pacific-payment-gateway.php" instead of "pacific-gateway.php")
  • Text Domain: The text domain name must use dashes instead of underscores, and it must be lowercase

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
No dangerous file extensions were detected401,336 lines of code in 1,857 files:
LanguageFilesBlank linesComment linesLines of code
JSON1,17410341,904
PHP6228,90720,29057,554
Markdown3136801,110
YAML8570459
XML891110
PO File1252972
XSD111072
make17028
Bourne Again Shell12011
SVG50011
HTML3003
CSS1001
JavaScript1001

PHP code 50% from 2 tests

This plugin's cyclomatic complexity and code structure detailed below
Please fix the following
  • Method cyclomatic complexity should be reduced to less than 100 (currently 179)
Cyclomatic complexity
Average complexity per logical line of code0.47
Average class complexity9.39
▷ Minimum class complexity1.00
▷ Maximum class complexity224.00
Average method complexity2.94
▷ Minimum method complexity1.00
▷ Maximum method complexity179.00
Code structure
Namespaces99
Interfaces94
Traits13
Classes466
▷ Abstract classes347.30%
▷ Concrete classes43292.70%
▷ Final classes12428.70%
Methods2,698
▷ Static methods68125.24%
▷ Public methods2,24283.10%
▷ Protected methods1425.26%
▷ Private methods31411.64%
Functions245
▷ Named functions14458.78%
▷ Anonymous functions10141.22%
Constants600
▷ Global constants8514.17%
▷ Class constants51585.83%
▷ Public constants45087.38%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
1 compressed PNG file occupies 0.00MB
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
public/dist/images/content/no-image.png4.42KB4.30KB▼ 2.63%