78% paay

Code Review | PAAY for WooCommerce

WordPress plugin PAAY for WooCommerce scored78%from 54 tests.

About plugin

  • Plugin page: paay
  • Plugin version: 2.0.25
  • PHP version: 7.4.16
  • WordPress compatibility: 4.3-4.1
  • WordPress version: 6.3.1
  • First release: Mar 11, 2014
  • Latest release: Feb 13, 2017
  • Number of updates: 103
  • Update frequency: every 10.4 days
  • Top authors: paay (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,337 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.03MB] [CPU: ▼8.56ms] Passed 4 tests

This is a short check of server-side resources used by PAAY for WooCommerce
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0333.73 ▼3.72
Dashboard /wp-admin3.34 ▲0.0341.75 ▼5.43
Posts /wp-admin/edit.php3.39 ▲0.0347.07 ▼0.07
Add New Post /wp-admin/post-new.php5.92 ▲0.0377.82 ▼22.30
Media Library /wp-admin/upload.php3.26 ▲0.0330.97 ▼2.77

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

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

Browser metrics Passed 4 tests

PAAY for WooCommerce: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5413.22 ▼1.401.57 ▼0.1237.20 ▼7.59
Dashboard /wp-admin2,206 ▲185.84 ▼0.02109.66 ▲6.5041.47 ▲0.05
Posts /wp-admin/edit.php2,089 ▼32.00 ▼0.0034.98 ▼8.9133.61 ▼2.24
Add New Post /wp-admin/post-new.php1,533 ▼923.17 ▲4.93660.35 ▲34.6662.56 ▲9.15
Media Library /wp-admin/upload.php1,382 ▼94.25 ▲0.0996.02 ▼3.7441.49 ▼1.38

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

Smoke tests 50% 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)
Everything seems fine, however this is by no means an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Almost there! Just fix the following items
  • 4× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/paay/templates/3dsautosubmit.php
    • > /wp-content/plugins/paay/templates/paay_button.php
    • > /wp-content/plugins/paay/templates/paay_box.php
    • > /wp-content/plugins/paay/handler.php
  • 30× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Warning
      include_once(): Failed opening 'ABSPATHwp-admin/includes/plugin.php' for inclusion (include_path='.:/usr/share/php') in wp-content/plugins/paay/paay-woocommerce.php on line 16
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/paay/templates/paay_box.php on line 3
    • > PHP Notice
      Undefined variable: var in wp-content/plugins/paay/templates/paay_box.php on line 3
    • > PHP Fatal error
      Uncaught Error: Class 'Paay_Validator_AbstractValidator' not found in wp-content/plugins/paay/lib/Paay/Validator/PAN.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/paay/templates/standalone_css.php:32
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/paay/templates/standalone_css.php:32
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/paay/templates/standalone_css.php:32
    • > PHP Fatal error
      Uncaught Error: Class 'Paay_Validator_AbstractValidator' not found in wp-content/plugins/paay/lib/Paay/Validator/ExpiryYear.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'Paay_Validator_AbstractValidator' not found in wp-content/plugins/paay/lib/Paay/Validator/Expiry.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function paay_checkout() in wp-content/plugins/paay/templates/3dsframe.php:1

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
There were no browser issues found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 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
These attributes need your attention:
  • Plugin Name: Write the name of your plugin instead of "Plugin Name" on the first line ( === paay === )
The official readme.txt is a good inspiration

paay/paay-woocommerce.php 85% from 13 tests

Analyzing the main PHP file in "PAAY for WooCommerce" version 2.0.25
You should first fix the following items:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("paay.php" instead of "paay-woocommerce.php")
  • Requires at least: Required version does not match the one declared in readme.txt ("3.8" instead of "4.3")

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
Good job! No executable or dangerous file extensions detected3,037 lines of code in 30 files:
LanguageFilesBlank linesComment linesLines of code
PHP295364043,003
CSS11034

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.40
Average class complexity22.48
▷ Minimum class complexity1.00
▷ Maximum class complexity197.00
Average method complexity3.75
▷ Minimum method complexity1.00
▷ Maximum method complexity57.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes21
▷ Abstract classes14.76%
▷ Concrete classes2095.24%
▷ Final classes00.00%
Methods165
▷ Static methods10.61%
▷ Public methods13581.82%
▷ Protected methods2313.94%
▷ Private methods74.24%
Functions28
▷ Named functions2278.57%
▷ Anonymous functions621.43%
Constants21
▷ Global constants21100.00%
▷ Class constants00.00%
▷ Public constants00.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
2 PNG files occupy 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
templates/paay.png7.56KB5.37KB▼ 28.97%
images/paay/paay-secure.png2.01KB1.82KB▼ 9.32%