10% sell-with-razorpay

Code Review | Sale with Razorpay

WordPress plugin Sale with Razorpay scored 10% from 54 tests.

About plugin

  • Plugin page: sell-with-razorpay
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-6.0
  • WordPress version: 6.3.1
  • First release: Jul 13, 2016
  • Latest release: Jun 14, 2022
  • Number of updates: 16
  • Update frequency: every 135.4 days
  • Top authors: brainvireinfo (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 1,211 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
These installer errors require your attention
  • Install procedure had errors
    • > User deprecated in wp-includes/functions.php+5453
    Function get_page_by_title is deprecated since version 6.2.0! Use WP_Query instead.

Server metrics [RAM: ▲0.18MB] [CPU: ▼4.17ms] Passed 4 tests

A check of server-side resources used by Sale with Razorpay
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.56 ▲0.1039.28 ▼1.28
Dashboard /wp-admin3.52 ▲0.2245.85 ▼3.61
Posts /wp-admin/edit.php3.60 ▲0.2546.05 ▼2.48
Add New Post /wp-admin/post-new.php6.14 ▲0.2586.22 ▼9.30
Media Library /wp-admin/upload.php3.39 ▲0.1633.83 ▲0.34
SWR Setting /wp-admin/options-general.php?page=swr-setting-page3.3939.12
SWR Razorpay Order List /wp-admin/admin.php?page=download_swr_order_list3.3032.87
SWR Product /wp-admin/edit.php?post_type=swr_product3.4732.47
Add New /wp-admin/post-new.php?post_type=swr_product3.5548.29
Product Categories /wp-admin/edit-tags.php?taxonomy=swr_productcat&post_type=swr_product3.4236.22

Server storage [IO: ▲2.06MB] [DB: ▲0.01MB] Passed 3 tests

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 270 new files
Database: 2 new tables, 7 new options
New tables
wp_swr_shipping_address
wp_swr_transaction
New WordPress options
widget_recent-posts
db_upgraded
recovery_mode_email_last_sent
theysaidso_admin_options
can_compress_scripts
widget_recent-comments
widget_theysaidso_widget

Browser metrics Passed 4 tests

An overview of browser requirements for Sale with Razorpay
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,016 ▲28114.95 ▲0.644.10 ▲2.3652.04 ▲2.65
Dashboard /wp-admin2,412 ▲2246.53 ▲0.63134.27 ▲22.7139.51 ▼3.65
Posts /wp-admin/edit.php2,327 ▲2353.43 ▲1.3956.22 ▲15.2636.08 ▼0.70
Add New Post /wp-admin/post-new.php1,570 ▲4223.24 ▲4.86631.60 ▲25.4335.94 ▼15.01
Media Library /wp-admin/upload.php1,464 ▲734.22 ▲0.0286.64 ▼14.6145.22 ▼1.44
SWR Setting /wp-admin/options-general.php?page=swr-setting-page1,1303.3540.1027.27
SWR Razorpay Order List /wp-admin/admin.php?page=download_swr_order_list280.440.069.37
SWR Product /wp-admin/edit.php?post_type=swr_product1,3023.4744.1525.37
Add New /wp-admin/post-new.php?post_type=swr_product2,3497.72169.8164.88
Product Categories /wp-admin/edit-tags.php?taxonomy=swr_productcat&post_type=swr_product1,5183.4344.0027.00

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
It is recommended to fix the following
  • Zombie tables were found after uninstall: 2 tables
    • wp_swr_shipping_address
    • wp_swr_transaction
  • Zombie WordPress options detected upon uninstall: 7 options
    • widget_theysaidso_widget
    • can_compress_scripts
    • recovery_mode_email_last_sent
    • theysaidso_admin_options
    • widget_recent-posts
    • db_upgraded
    • widget_recent-comments

Smoke tests 0% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Please fix the following server-side errors
    • > GET request to /wp-admin/admin.php?page=download_swr_order_list
    • > Error in wp-content/plugins/sell-with-razorpay/admin/swr-order-detail-download.php+13
    Uncaught Error: Call to undefined function mysql_error() in wp-content/plugins/sell-with-razorpay/admin/swr-order-detail-download.php:13
    Stack trace:
    #0 wp-includes/class-wp-hook.php(310): download_swr_order_list()
    #1 wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters()
    #2 wp-includes/plugin.php(517): WP_Hook->do_action()
    #3 wp-admin/admin.php(259): do_action()
    #4 {main}
    thrown

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 fix the following
  • 13× PHP files perform the task of outputting text when accessed with GET requests (only 10 are shown):
    • > /wp-content/plugins/sell-with-razorpay/lib/razorpay-php/vendor/rmccue/requests/examples/session.php
    • > /wp-content/plugins/sell-with-razorpay/lib/razorpay-php/libs/Requests-1.6.1/examples/session.php
    • > /wp-content/plugins/sell-with-razorpay/lib/razorpay-php/libs/Requests-1.6.1/examples/basic-auth.php
    • > /wp-content/plugins/sell-with-razorpay/lib/razorpay-php/vendor/rmccue/requests/examples/get.php
    • > /wp-content/plugins/sell-with-razorpay/lib/razorpay-php/vendor/rmccue/requests/examples/post.php
    • > /wp-content/plugins/sell-with-razorpay/lib/razorpay-php/libs/Requests-1.6.1/bin/create_pear_package.php
    • > /wp-content/plugins/sell-with-razorpay/lib/razorpay-php/vendor/rmccue/requests/examples/basic-auth.php
    • > /wp-content/plugins/sell-with-razorpay/lib/razorpay-php/libs/Requests-1.6.1/examples/get.php
    • > /wp-content/plugins/sell-with-razorpay/lib/razorpay-php/libs/Requests-1.6.1/examples/multiple.php
    • > /wp-content/plugins/sell-with-razorpay/lib/razorpay-php/vendor/rmccue/requests/bin/create_pear_package.php
  • 135× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/sell-with-razorpay/lib/razorpay-php/libs/Requests-1.6.1/tests/Cookies.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'Requests_Exception_HTTP' not found in wp-content/plugins/sell-with-razorpay/lib/razorpay-php/vendor/rmccue/requests/library/Requests/Exception/HTTP/409.php:13
    • > PHP Fatal error
      Uncaught Error: Interface 'Requests_Auth' not found in wp-content/plugins/sell-with-razorpay/lib/razorpay-php/libs/Requests-1.6.1/library/Requests/Auth/Basic.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'Razorpay\\Api\\Entity' not found in wp-content/plugins/sell-with-razorpay/lib/razorpay-php/src/Collection.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'Requests_Utility_CaseInsensitiveDictionary' not found in wp-content/plugins/sell-with-razorpay/lib/razorpay-php/vendor/rmccue/requests/library/Requests/Response/Headers.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'Razorpay\\Api\\Resource' not found in wp-content/plugins/sell-with-razorpay/lib/razorpay-php/src/Entity.php:7
    • > PHP Fatal error
      Uncaught Error: Interface 'Requests_Transport' not found in wp-content/plugins/sell-with-razorpay/lib/razorpay-php/vendor/rmccue/requests/library/Requests/Transport/cURL.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'kintParser' not found in wp-content/plugins/sell-with-razorpay/lib/razorpay-php/vendor/raveren/kint/parsers/custom/json.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'Requests_Exception_HTTP' not found in wp-content/plugins/sell-with-razorpay/lib/razorpay-php/vendor/rmccue/requests/library/Requests/Exception/HTTP/Unknown.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'RequestsTest_Transport_Base' not found in wp-content/plugins/sell-with-razorpay/lib/razorpay-php/vendor/rmccue/requests/tests/Transport/fsockopen.php:3

User-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Please fix the following browser errors
    • > GET request to /wp-admin/post-new.php?post_type=swr_product
    • > Javascript (severe) in unknown
    /wp-admin/post-new.php?post_type=swr_product 427:41 Uncaught TypeError: jQuery(...).live is not a function

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
10 plugin tags: sale product, shipping address, razorpay api, sale, product...

sell-with-razorpay/sell-with-razorpay.php Passed 13 tests

This is the main PHP file of "Sale with Razorpay" version 1.0, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
57 characters long description:
Product manage & razorpay gateway use for payment process

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
There were no executable files found in this plugin18,049 lines of code in 176 files:
LanguageFilesBlank linesComment linesLines of code
PHP1242,1443,9629,860
CSS761633,632
JavaScript52681621,797
Markdown2556801,421
SVG100520
LESS513439505
JSON500225
XML24066
YAML20023

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.35
Average class complexity10.99
▷ Minimum class complexity1.00
▷ Maximum class complexity193.00
Average method complexity3.30
▷ Minimum method complexity1.00
▷ Maximum method complexity42.00
Code structure
Namespaces3
Interfaces9
Traits0
Classes165
▷ Abstract classes42.42%
▷ Concrete classes16197.58%
▷ Final classes00.00%
Methods774
▷ Static methods19425.06%
▷ Public methods63081.40%
▷ Protected methods10813.95%
▷ Private methods364.65%
Functions68
▷ Named functions6798.53%
▷ Anonymous functions11.47%
Constants50
▷ Global constants816.00%
▷ Class constants4284.00%
▷ Public constants42100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
2 PNG files occupy 0.10MB with 0.07MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/noimage.png99.01KB13.95KB▼ 85.91%
assets/images/logo-pmc.png4.11KB2.07KB▼ 49.61%