83% amazon-payment-services

Code Review | Amazon payment services

WordPress plugin Amazon payment services scored83%from 54 tests.

About plugin

  • Plugin page: amazon-payment-se...
  • Plugin version: 2.3.6
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.3-6.3.1
  • WordPress version: 6.3.1
  • First release: Aug 10, 2021
  • Latest release: Oct 26, 2023
  • Number of updates: 37
  • Update frequency: every 21.8 days
  • Top authors: amazonpaymentservices (100%)

Code review

54 tests

User reviews

1 review

Install metrics

400+ active /4,949 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
Installer ran successfully

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

An overview of server-side resources used by Amazon payment services
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0039.18 ▲1.17
Dashboard /wp-admin3.31 ▼0.0443.90 ▼17.45
Posts /wp-admin/edit.php3.36 ▲0.0041.81 ▼8.02
Add New Post /wp-admin/post-new.php5.89 ▲0.0078.43 ▼24.19
Media Library /wp-admin/upload.php3.23 ▲0.0033.82 ▲3.94

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

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 91 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
can_compress_scripts
db_upgraded
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-comments

Browser metrics Passed 4 tests

Amazon payment services: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲1814.45 ▲0.092.26 ▲0.5654.41 ▲14.60
Dashboard /wp-admin2,195 ▲185.52 ▼0.1485.60 ▼6.0036.64 ▼1.76
Posts /wp-admin/edit.php2,097 ▼32.03 ▲0.0633.27 ▼7.1234.63 ▼1.97
Add New Post /wp-admin/post-new.php1,538 ▲1018.24 ▼4.90615.39 ▼18.8965.55 ▲10.19
Media Library /wp-admin/upload.php1,394 ▼04.19 ▲0.0497.02 ▼1.9642.52 ▲1.31

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
The following items require your attention
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_recent-comments
    • db_upgraded
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please fix the following items
  • 2× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/amazon-payment-services/public/partials/aps-public-display.php
    • > /wp-content/plugins/amazon-payment-services/admin/partials/aps-admin-display.php

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
Attributes that require attention:
  • Contributors: Plugin contributors field is missing
The official readme.txt might help

amazon-payment-services/woocommerce-aps.php 85% from 13 tests

The main file in "Amazon payment services" v. 2.3.6 serves as a complement to information provided in readme.txt and as the entry point to the plugin
You should first fix the following items:
  • Description: Please keep the plugin description shorter than 140 characters (currently 185 characters long)
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("amazon-payment-services.php" instead of "woocommerce-aps.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Everything looks great! No dangerous files found in this plugin15,503 lines of code in 74 files:
LanguageFilesBlank linesComment linesLines of code
PHP547062,3657,421
JavaScript8983884,733
CSS6198382,681
PO File1207292425
HTML200136
Markdown2380106
SVG1001

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.33
Average class complexity28.62
▷ Minimum class complexity1.00
▷ Maximum class complexity180.00
Average method complexity3.31
▷ Minimum method complexity1.00
▷ Maximum method complexity56.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes29
▷ Abstract classes00.00%
▷ Concrete classes29100.00%
▷ Final classes00.00%
Methods335
▷ Static methods154.48%
▷ Public methods32396.42%
▷ Protected methods10.30%
▷ Private methods113.28%
Functions14
▷ Named functions750.00%
▷ Anonymous functions750.00%
Constants88
▷ Global constants22.27%
▷ Class constants8697.73%
▷ Public constants86100.00%

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
7 PNG files occupy 0.06MB with 0.02MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
public/images/visa-logo.png1.67KB1.55KB▼ 6.69%
public/images/amex-logo.png3.34KB1.54KB▼ 54.05%
public/images/stcpay-logo.png5.00KB2.58KB▼ 48.47%
public/images/mastercard-logo.png3.08KB1.53KB▼ 50.17%
public/images/tabby-logo.png1.53KB1.53KB0.00%