10% clearent-payments

Code Review | Clearent Payments

WordPress plugin Clearent Payments scored 10% from 54 tests.

About plugin

  • Plugin page: clearent-payments
  • Plugin version: 1.9
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-4.7.4
  • WordPress version: 5.8.1
  • First release: Nov 11, 2015
  • Latest release: Jun 19, 2018
  • Number of updates: 39
  • Update frequency: every 24.4 days
  • Top authors: clearent1 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

200+ active / 1,646 total downloads

Benchmarks

Plugin footprint 58% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Please fix the following installer errors
  • Install procedure had errors
    • > Notice in wp-content/plugins/clearent-payments/main.php+11
    Constant WP_DEBUG already defined

Server metrics [RAM: ▼1.86MB] [CPU: ▼179.77ms] Passed 4 tests

Analyzing server-side resources used by Clearent Payments
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /1.77 ▼1.064.29 ▼23.70
Dashboard /wp-admin1.79 ▼1.273.88 ▼31.91
Posts /wp-admin/edit.php1.79 ▼1.313.71 ▼27.83
Add New Post /wp-admin/post-new.php1.79 ▼3.643.51 ▼635.64
Media Library /wp-admin/upload.php1.79 ▼1.213.65 ▼19.09
Clearent Payments /wp-admin/options-general.php?page=clearent_option_group1.793.52

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 42 new files
Database: 1 new table, 1 new option
New tables
wp_clearent_transaction
New WordPress options
clearent_opts

Browser metrics Passed 4 tests

A check of browser resources used by Clearent Payments
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,671 ▲7015.98 ▲0.285.03 ▼1.0074.18 ▼10.91
Dashboard /wp-admin2,935 ▲406.13 ▼0.03124.10 ▼7.68179.15 ▲10.94
Posts /wp-admin/edit.php2,745 ▲53.36 ▼0.0161.16 ▼1.91129.95 ▼12.25
Add New Post /wp-admin/post-new.php3,818 ▲7719.18 ▲0.19422.82 ▼35.16179.13 ▲10.49
Media Library /wp-admin/upload.php1,757 ▲55.50 ▼0.02144.77 ▼2.84186.65 ▲0.82
Clearent Payments /wp-admin/options-general.php?page=clearent_option_group1,3443.1156.19151.00

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • Uninstall procedure validation failed for this plugin
    • > Notice in wp-content/plugins/clearent-payments/main.php+11
    Constant WP_DEBUG already defined

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Smoke test failed, please fix the following
    • > GET request to /wp-admin/options-general.php?page=clearent_option_group
    • > Notice in wp-content/plugins/clearent-payments/main.php+11
    Constant WP_DEBUG already defined

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
  • 8× PHP files trigger server errors when accessed directly:
    • > script 'wp-content/plugins/clearent-payments/admin/options-general.php' not found or unable to stat
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/clearent-payments/main.php:34
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/clearent-payments/admin/transaction_history.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Query' not found in wp-content/plugins/clearent-payments/admin/pages_using_plugin.php:9
    • > PHP Notice
      Undefined index: confirm in wp-content/plugins/clearent-payments/admin/clearent_clear_log.php on line 5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function settings_fields() in wp-content/plugins/clearent-payments/admin/plugin_settings.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_url() in wp-content/plugins/clearent-payments/admin/debug_log.php:3
    • > PHP Notice
      Undefined index: redirect_url in wp-content/plugins/clearent-payments/admin/clearent_clear_log.php on line 13

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser issues were found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
9 plugin tags: pay buttons, hosted pay buttons, clearent, payments, e-commerce...

clearent-payments/main.php 85% from 13 tests

Analyzing the main PHP file in "Clearent Payments" version 1.9
The following require your attention:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("clearent-payments.php" instead of "main.php")
  • Description: Keep the plugin description shorter than 140 characters (currently 147 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,529 lines of code in 19 files:
LanguageFilesBlank linesComment linesLines of code
PHP12203901,563
JavaScript39582738
CSS44731228

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.38
Average class complexity31.67
▷ Minimum class complexity2.00
▷ Maximum class complexity130.00
Average method complexity7.28
▷ Minimum method complexity1.00
▷ Maximum method complexity59.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes6
▷ Abstract classes00.00%
▷ Concrete classes6100.00%
▷ Final classes00.00%
Methods30
▷ Static methods00.00%
▷ Public methods2996.67%
▷ Protected methods00.00%
▷ Private methods13.33%
Functions1
▷ Named functions00.00%
▷ Anonymous functions1100.00%
Constants5
▷ Global constants120.00%
▷ Class constants480.00%
▷ Public constants4100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
18 PNG files occupy 0.05MB with 0.01MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
css/images/ui-bg_glass_75_dadada_1x400.png0.26KB0.16KB▼ 38.93%
image/clearent-cards.png14.96KB5.56KB▼ 62.82%
image/clearent.png1.71KB1.75KB0.00%
image/clearent-warning.png0.68KB0.72KB0.00%
image/clearent-lock.png0.26KB0.28KB0.00%