58% wp-service-payment-form-with-authorizenet

Code Review | WP Service Payment Form With Authorize.net

WordPress plugin WP Service Payment Form With Authorize.net scored58%from 54 tests.

About plugin

  • Plugin page: wp-service-paymen...
  • Plugin version: 2.6.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-6.3
  • WordPress version: 6.3.1
  • First release: Mar 10, 2017
  • Latest release: Oct 21, 2023
  • Number of updates: 39
  • Update frequency: every 61.7 days
  • Top authors: shivtiwari (100%)

Code review

54 tests

User reviews

21 reviews

Install metrics

500+ active /11,858 total downloads

Benchmarks

Plugin footprint 48% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.00MB] [CPU: ▼4.47ms] Passed 4 tests

A check of server-side resources used by WP Service Payment Form With Authorize.net
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0037.69 ▼3.18
Dashboard /wp-admin3.31 ▲0.0046.65 ▼0.84
Posts /wp-admin/edit.php3.36 ▲0.0042.62 ▼1.33
Add New Post /wp-admin/post-new.php5.89 ▲0.0087.56 ▼9.29
Media Library /wp-admin/upload.php3.23 ▲0.0032.18 ▼4.07

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 17 new files
Database: 3 new tables, 6 new options
New tables
wp_wpspf_payment_entry
wp_wpspf_form_fields
wp_wpspf_payment_entry_meta
New WordPress options
widget_recent-posts
can_compress_scripts
widget_recent-comments
db_upgraded
theysaidso_admin_options
widget_theysaidso_widget

Browser metrics Passed 4 tests

Checking browser requirements for WP Service Payment Form With Authorize.net
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.17 ▼0.421.99 ▲0.4343.85 ▲6.60
Dashboard /wp-admin2,198 ▲185.59 ▼0.0685.27 ▼0.1342.72 ▼1.14
Posts /wp-admin/edit.php2,100 ▼01.96 ▼0.0636.09 ▲0.6733.88 ▼0.00
Add New Post /wp-admin/post-new.php1,535 ▼218.28 ▼0.04653.40 ▼0.1065.49 ▼4.22
Media Library /wp-admin/upload.php1,400 ▼34.17 ▼0.0194.34 ▼2.7640.03 ▼4.99

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
You still need to fix the following
  • The plugin did not uninstall gracefully
    • > Warning in wp-content/plugins/wp-service-payment-form-with-authorizenet/wp-service-payment-form-with-authorizenet.php+126
    Use of undefined constant WP_UNINSTALL_PLUGIN - assumed 'WP_UNINSTALL_PLUGIN' (this will throw an Error in a future version of PHP)
  • The plugin did not uninstall successfully, leaving 2 tables in the database
    • wp_wpspf_payment_entry_meta
    • wp_wpspf_payment_entry
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_recent-posts
    • db_upgraded
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-comments
    • can_compress_scripts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
The smoke test was a success, however most plugin functionality was not tested

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
The following issues need your attention
  • 2× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/wp-service-payment-form-with-authorizenet/wp-service-payment-form-with-authorizenet.php
    • > /wp-content/plugins/wp-service-payment-form-with-authorizenet/admin/settings-document.php
  • 10× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp-service-payment-form-with-authorizenet/functions.php:7
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/wp-service-payment-form-with-authorizenet/src/wpspf-payments-list.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/wp-service-payment-form-with-authorizenet/admin/settings.php:218
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/wp-service-payment-form-with-authorizenet/src/shortcodes.php:27
    • > PHP Notice
      Trying to get property 'prefix' of non-object in wp-content/plugins/wp-service-payment-form-with-authorizenet/src/wpspf-payment-details.php on line 4
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/class-wp-list-table.php): failed to open stream: No such file or directory in wp-content/plugins/wp-service-payment-form-with-authorizenet/src/wpspf-payments-list.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/wp-service-payment-form-with-authorizenet/src/form-settings.php:2
    • > PHP Fatal error
      Uncaught Error: Call to a member function get_results() on null in wp-content/plugins/wp-service-payment-form-with-authorizenet/src/wpspf-payment-details.php:5
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/class-wp-list-table.php' (include_path='.:/usr/share/php') in wp-content/plugins/wp-service-payment-form-with-authorizenet/src/wpspf-payments-list.php on line 3
    • > PHP Notice
      Undefined index: wpspf_entry in wp-content/plugins/wp-service-payment-form-with-authorizenet/src/wpspf-payment-details.php on line 2

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser issues were 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
Attributes that require attention:
  • Donate link: Invalid URI ("")
You can take inspiration from this readme.txt

wp-service-payment-form-with-authorizenet/wp-service-payment-form-with-authorizenet.php 85% from 13 tests

The main PHP file in "WP Service Payment Form With Authorize.net" ver. 2.6.1 adds more information about the plugin and also serves as the entry point for this plugin
The following require your attention:
  • Text Domain: Please use dashes and lowercase characters for text domains
  • Description: Please keep the plugin description shorter than 140 characters (currently 145 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
No dangerous file extensions were detected2,224 lines of code in 12 files:
LanguageFilesBlank linesComment linesLines of code
PHP92542732,038
JavaScript21812156
CSS13230

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.34
Average class complexity17.00
▷ Minimum class complexity17.00
▷ Maximum class complexity17.00
Average method complexity3.00
▷ Minimum method complexity1.00
▷ Maximum method complexity8.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods9
▷ Static methods00.00%
▷ Public methods9100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions28
▷ Named functions28100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
1 PNG file occupies 0.01MB with 0.01MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
img/credit-card-logo.png15.14KB4.15KB▼ 72.59%