68% ratapay

Code Review | Ratapay

WordPress plugin Ratapay scored 68% from 54 tests.

About plugin

  • Plugin page: ratapay
  • Plugin version: 0.1.3
  • PHP compatiblity: 7.0.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.9-5.7
  • WordPress version: 5.8.1
  • First release: Mar 19, 2020
  • Latest release: May 20, 2021
  • Number of updates: 15
  • Update frequency: every 29.1 days
  • Top authors: ratapaytech (100%)

Code review

54 tests

User reviews

1 review

Install metrics

70+ active / 658 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
This plugin's installer ran successfully

Server metrics [RAM: ▲0.20MB] [CPU: ▼145.14ms] Passed 4 tests

Server-side resources used by Ratapay
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.03 ▲0.1943.03 ▲4.92
Dashboard /wp-admin3.26 ▲0.2063.14 ▼4.41
Posts /wp-admin/edit.php3.37 ▲0.2653.49 ▼9.96
Add New Post /wp-admin/post-new.php5.62 ▲0.18111.27 ▼571.09
Media Library /wp-admin/upload.php3.20 ▲0.2047.45 ▲7.74
Setting /wp-admin/admin.php?page=ratapay_setting3.1743.44
Splitter /wp-admin/admin.php?page=ratapay_splitter3.2034.09
PayLink /wp-admin/admin.php?page=ratapay_paylink3.1938.34
Ratapay /wp-admin/admin.php?page=ratapay_menu3.1537.95

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

Input-output and database impact of this plugin
This plugin was installed successfully
Filesystem: 9 new files
Database: 1 new table, 1 new option
New tables
wp_ratapay_splitter
New WordPress options
ratapay_db_version

Browser metrics Passed 4 tests

Checking browser requirements for Ratapay
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,741 ▲14516.31 ▲0.6910.77 ▲1.7750.36 ▲1.87
Dashboard /wp-admin3,032 ▲985.93 ▼0.02156.13 ▼27.12134.29 ▲0.20
Posts /wp-admin/edit.php2,803 ▲642.73 ▲0.0178.86 ▼9.95111.60 ▼3.91
Add New Post /wp-admin/post-new.php1,644 ▲6318.82 ▼2.60438.94 ▲23.92117.68 ▼1.42
Media Library /wp-admin/upload.php1,869 ▲625.05 ▲0.01194.99 ▲33.54139.58 ▲8.43
Setting /wp-admin/admin.php?page=ratapay_setting1,3602.2364.63121.53
Splitter /wp-admin/admin.php?page=ratapay_splitter1,4432.9383.6485.82
PayLink /wp-admin/admin.php?page=ratapay_paylink1,5953.2186.7380.22
Ratapay /wp-admin/admin.php?page=ratapay_menu1,1732.0971.58102.09

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 1 table in the database
    • wp_ratapay_splitter
  • The uninstall procedure has failed, leaving 1 option in the database
    • ratapay_db_version

Smoke tests 50% 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
  • 9 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=ratapay_menu
    • > Notice in wp-content/plugins/ratapay/ratapay.php+743
    Trying to access array offset on value of type null

SRP 50% 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
Almost there! Just fix the following items
  • 9× PHP files trigger errors when accessed directly with GET requests:
    • > 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/ratapay/includes/ratapay_splitter_data_source.php on line 3
    • > 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/ratapay/includes/ratapay_splitter_data_source.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/ratapay/includes/ratapay_splitter_meta.php:3
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/ratapay/includes/ratapay_splitter_data_source.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/ratapay/includes/woocommerce_ratapay_gateway.php:355
    • > 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/ratapay/includes/ratapay_paylink_data_source.php on line 3
    • > 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/ratapay/includes/ratapay_paylink_data_source.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/ratapay/includes/woocommerce_ratapay_gateway.php:355
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/ratapay/includes/ratapay_paylink_data_source.php on line 3

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
These attributes need to be fixed:
  • Screenshots: A description for screenshot #5 is required in ratapay/assets to your readme.txt
You can look at the official readme.txt

ratapay/ratapay.php Passed 13 tests

The primary PHP file in "Ratapay" version 0.1.3 is used by WordPress to initiate all plugin functionality
44 characters long description:
This plugin provide integration with Ratapay

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
Good job! No executable or dangerous file extensions detected1,521 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
PHP61681071,521

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.36
Average class complexity20.67
▷ Minimum class complexity8.00
▷ Maximum class complexity46.00
Average method complexity4.28
▷ Minimum method complexity1.00
▷ Maximum method complexity28.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods18
▷ Static methods15.56%
▷ Public methods18100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions26
▷ Named functions26100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
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
ratapay-logo.png8.07KB2.20KB▼ 72.74%