84% simple-payu-romania

Code Review | Simple PayU Romania

WordPress plugin Simple PayU Romania scored84%from 54 tests.

About plugin

  • Plugin page: simple-payu-romania
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0.0-4.3.1
  • WordPress version: 6.3.1
  • First release: Jun 16, 2015
  • Latest release: Oct 7, 2015
  • Number of updates: 5
  • Update frequency: every 23.2 days
  • Top authors: softpill.eu (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,215 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.01MB] [CPU: ▼6.44ms] Passed 4 tests

An overview of server-side resources used by Simple PayU Romania
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0038.16 ▼4.05
Dashboard /wp-admin3.32 ▲0.0250.38 ▼1.63
Posts /wp-admin/edit.php3.38 ▲0.0247.83 ▼4.77
Add New Post /wp-admin/post-new.php5.90 ▲0.0287.62 ▼15.29
Media Library /wp-admin/upload.php3.25 ▲0.0237.60 ▲6.15
Records /wp-admin/admin.php?page=sp_spr_records3.2235.96
About /wp-admin/admin.php?page=sp_spr_about3.2134.46
Settings /wp-admin/admin.php?page=sp_spr_settings3.2128.99
Payment Forms /wp-admin/admin.php?page=sp_spr_payment_forms3.2029.60

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

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 17 new files
Database: 1 new table, 6 new options
New tables
wp_simplepayuromania_trans
New WordPress options
db_upgraded
widget_theysaidso_widget
widget_recent-posts
can_compress_scripts
theysaidso_admin_options
widget_recent-comments

Browser metrics Passed 4 tests

An overview of browser requirements for Simple PayU Romania
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,848 ▲8714.72 ▲0.371.93 ▲0.2643.21 ▼0.35
Dashboard /wp-admin2,226 ▲465.58 ▼0.1492.34 ▲1.0439.75 ▼1.60
Posts /wp-admin/edit.php2,134 ▲311.99 ▲0.0239.41 ▲3.0637.07 ▼2.24
Add New Post /wp-admin/post-new.php1,554 ▲2623.32 ▲0.20693.41 ▲57.9656.51 ▲6.12
Media Library /wp-admin/upload.php1,431 ▲314.18 ▼0.02103.12 ▼4.0443.54 ▼4.63
Records /wp-admin/admin.php?page=sp_spr_records9362.0324.9928.82
About /wp-admin/admin.php?page=sp_spr_about8872.2722.6226.62
Settings /wp-admin/admin.php?page=sp_spr_settings8312.0023.9326.27
Payment Forms /wp-admin/admin.php?page=sp_spr_payment_forms8902.0025.7829.46

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_theysaidso_widget
    • db_upgraded
    • can_compress_scripts
    • widget_recent-comments
    • widget_recent-posts
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Everything seems fine, however this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please fix the following items
  • 7× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > 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/simple-payu-romania/includes/simplepayuromania.records.php on line 19
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/simple-payu-romania/includes/simplepayuromania_frontend.php:84
    • > PHP Warning
      Use of undefined constant WP_PLUGIN_DIR - assumed 'WP_PLUGIN_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/simple-payu-romania/simplepayuromania.php on line 25
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/simple-payu-romania/includes/simplepayuromania.records.php on line 19
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/simple-payu-romania/simplepayuromania.php:26
    • > 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/simple-payu-romania/includes/simplepayuromania.records.php on line 19
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/simple-payu-romania/includes/simplepayuromania_admin.php:27

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 issues were found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
6 plugin tags: payu romania, invoices, process invoices, pay online, payu...

simple-payu-romania/simplepayuromania.php 92% from 13 tests

The entry point to "Simple PayU Romania" version 1.0 is a PHP file that has certain tags in its header comment area
The following require your attention:
  • Main file name: Name the main plugin file the same as the plugin slug ("simple-payu-romania.php" instead of "simplepayuromania.php")

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
Everything looks great! No dangerous files found in this plugin3,334 lines of code in 14 files:
LanguageFilesBlank linesComment linesLines of code
PHP92435512,779
JavaScript2105133308
CSS29050244
HTML1003

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.43
Average class complexity69.33
▷ Minimum class complexity2.00
▷ Maximum class complexity196.00
Average method complexity6.26
▷ Minimum method complexity1.00
▷ Maximum method complexity56.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods39
▷ Static methods00.00%
▷ Public methods39100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions16
▷ Named functions16100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
No PNG files were detected