84% pay-now-button-giyapay

Code Review | Pay Now Button with GiyaPay

WordPress plugin Pay Now Button with GiyaPay scored84%from 54 tests.

About plugin

  • Plugin page: pay-now-button-gi...
  • Plugin version: 1.0.1
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.3.2-6.0.2
  • WordPress version: 6.3.1
  • First release: Oct 5, 2022
  • Latest release: Nov 4, 2022
  • Number of updates: 4
  • Update frequency: every 8.5 days
  • Top authors: cyndertech (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /177 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
This plugin's installer ran successfully

Server metrics [RAM: ▲0.02MB] [CPU: ▼5.88ms] Passed 4 tests

An overview of server-side resources used by Pay Now Button with GiyaPay
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0338.67 ▲0.17
Dashboard /wp-admin3.33 ▼0.0151.90 ▼8.52
Posts /wp-admin/edit.php3.39 ▲0.0345.01 ▼3.97
Add New Post /wp-admin/post-new.php5.92 ▲0.0387.29 ▼10.31
Media Library /wp-admin/upload.php3.26 ▲0.0334.41 ▼0.70
GiyaPay Button /wp-admin/options-general.php?page=wp-giyapay-settings3.2430.38

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 6 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-posts
can_compress_scripts
theysaidso_admin_options
widget_recent-comments
giyapay_now_settings_options
db_upgraded
widget_theysaidso_widget

Browser metrics Passed 4 tests

Pay Now Button with GiyaPay: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,797 ▲5114.34 ▼0.011.77 ▲0.1744.19 ▲6.68
Dashboard /wp-admin2,201 ▲245.60 ▼0.0685.33 ▼9.1736.42 ▼0.14
Posts /wp-admin/edit.php2,085 ▼151.98 ▲0.0034.35 ▼2.6235.21 ▼4.87
Add New Post /wp-admin/post-new.php1,531 ▲323.31 ▲0.04592.30 ▼0.3749.02 ▼7.75
Media Library /wp-admin/upload.php1,403 ▲64.17 ▼0.03104.49 ▲7.5442.16 ▼1.95
GiyaPay Button /wp-admin/options-general.php?page=wp-giyapay-settings9552.0224.1730.24

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • db_upgraded
    • widget_theysaidso_widget
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP 50% 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
Please fix the following items
  • 2× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/pay-now-button-giyapay/giyapay-settings-form.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/pay-now-button-giyapay/giyapay-button.php:1

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
No browser errors were detected

Optimizations

Plugin configuration 93% 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 might help

pay-now-button-giyapay/register.php 92% from 13 tests

The entry point to "Pay Now Button with GiyaPay" version 1.0.1 is a PHP file that has certain tags in its header comment area
You should first fix the following items:
  • Main file name: The principal plugin file should be the same as the plugin slug ("pay-now-button-giyapay.php" instead of "register.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
There were no executable files found in this plugin268 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
PHP33619205
CSS213063

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.16
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions11
▷ Named functions11100.00%
▷ Anonymous functions00.00%
Constants6
▷ Global constants116.67%
▷ Class constants583.33%
▷ Public constants5100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
PNG images were not found in this plugin