10% paytm-donation

Code Review | Paytm - Donation Plugin

WordPress plugin Paytm - Donation Plugin scored10%from 54 tests.

About plugin

  • Plugin page: paytm-donation
  • Plugin version: 2.2.7
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.9-6.2.2
  • WordPress version: 6.3.1
  • First release: Sep 12, 2018
  • Latest release: Dec 1, 2023
  • Number of updates: 25
  • Update frequency: every 76.5 days
  • Top authors: integrationdevpaytm (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

500+ active /14,005 total downloads

Benchmarks

Plugin footprint 22% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
It is recommended to fix the following installer errors
  • Install procedure validation failed for this plugin
    • > Notice in wp-content/plugins/paytm-donation/paytm-donation.php+113
    Undefined variable: paytm_pages

Server metrics [RAM: ▲0.33MB] [CPU: ▼5.85ms] 75% from 4 tests

An overview of server-side resources used by Paytm - Donation Plugin
Please fix the following
  • CPU: Try to keep total CPU usage under 500.00ms (currently 5,041.08ms on /wp-admin/admin.php?page=paytm_options_page)
PageMemory (MB)CPU Time (ms)
Home /3.70 ▲0.2345.72 ▲3.80
Dashboard /wp-admin3.67 ▲0.3249.47 ▼15.99
Posts /wp-admin/edit.php3.77 ▲0.4054.36 ▲6.25
Add New Post /wp-admin/post-new.php6.36 ▲0.4787.22 ▼17.46
Media Library /wp-admin/upload.php3.61 ▲0.3744.51 ▲10.96
Payment History /wp-admin/admin.php?page=wp_paytm_donation3.5339.64
Edit Fields /wp-admin/admin.php?page=wp_paytm_donation_user_field_page3.5139.11
Settings /wp-admin/admin.php?page=paytm_options_page3.505,041.08

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

Filesystem and database footprint
The plugin installed successfully
Filesystem: 13 new files
Database: 2 new tables, 13 new options
New tables
wp_paytm_donation_user_data
wp_paytm_donation_order_data
New WordPress options
db_upgraded
isWebsiteAddedDonation
websiteOptionDonation
paytm_content
paytm_user_field
paytm_merchant_id
widget_recent-posts
widget_recent-comments
paytm_merchant_key
can_compress_scripts
...

Browser metrics Passed 4 tests

This is an overview of browser requirements for Paytm - Donation Plugin
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,820 ▲7314.23 ▼0.481.73 ▼0.2644.68 ▼0.07
Dashboard /wp-admin2,213 ▲395.56 ▲0.0293.98 ▼10.4077.30 ▲34.76
Posts /wp-admin/edit.php2,130 ▲271.96 ▲0.0237.77 ▼1.4036.66 ▲0.43
Add New Post /wp-admin/post-new.php1,704 ▲16822.48 ▼0.69650.92 ▲20.5259.15 ▲7.43
Media Library /wp-admin/upload.php1,427 ▲334.19 ▼0.0195.11 ▼0.6281.13 ▲40.59
Payment History /wp-admin/admin.php?page=wp_paytm_donation9551.7130.5030.37
Edit Fields /wp-admin/admin.php?page=wp_paytm_donation_user_field_page1,1561.7126.6531.35
Settings /wp-admin/admin.php?page=paytm_options_page1,0201.7227.6732.00

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
The following items require your attention
  • This plugin cannot be uninstalled
    • > Notice in wp-content/plugins/paytm-donation/paytm-donation.php+159
    Undefined variable: wpdb
  • Zombie tables were found after uninstall: 2 tables
    • wp_paytm_donation_user_data
    • wp_paytm_donation_order_data
  • This plugin does not fully uninstall, leaving 10 options in the database
    • db_upgraded
    • websiteOptionDonation
    • isWebsiteAddedDonation
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • paytm_donation_details_url
    • widget_recent-posts
    • widget_recent-comments
    • paytm_user_field
    • can_compress_scripts

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Please fix the following server-side errors
    • > GET request to /wp-admin/admin.php?page=paytm_options_page
    • > Notice in wp-content/plugins/paytm-donation/paytm-donation.php+402
    Undefined variable: tableEnd

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please take a closer look at the following
  • 1× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/paytm-donation/paytm-donation-listings.php
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_activation_hook() in wp-content/plugins/paytm-donation/paytm-donation.php:12

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 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
8 plugin tags: paytm, paytm payment, payment, wordpress donation, paytm donation...

paytm-donation/paytm-donation.php 85% from 13 tests

The main PHP file in "Paytm - Donation Plugin" ver. 2.2.7 adds more information about the plugin and also serves as the entry point for this plugin
It is important to fix the following:
  • Text Domain: Please use dashes and lowercase characters for text domains
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 546 characters long)

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
No dangerous file extensions were detected2,362 lines of code in 10 files:
LanguageFilesBlank linesComment linesLines of code
PHP62831021,752
CSS23910314
JavaScript23716296

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.25
Average class complexity13.50
▷ Minimum class complexity1.00
▷ Maximum class complexity31.00
Average method complexity2.75
▷ Minimum method complexity1.00
▷ Maximum method complexity8.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods29
▷ Static methods2689.66%
▷ Public methods2172.41%
▷ Protected methods00.00%
▷ Private methods827.59%
Functions24
▷ Named functions2395.83%
▷ Anonymous functions14.17%
Constants49
▷ Global constants00.00%
▷ Class constants49100.00%
▷ Public constants49100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
1 compressed PNG file occupies 0.00MB
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
images/logo.png0.40KB0.39KB▼ 1.46%