90% conditional-payment-gateways-for-woocommerce

Code Review | Conditional Payment Gateways for WooCommerce

WordPress plugin Conditional Payment Gateways for WooCommerce scored 90% from 54 tests.

About plugin

  • Plugin page: conditional-payme...
  • Plugin version: 2.1.3
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4-6.3
  • WordPress version: 6.3.1
  • First release: Mar 28, 2021
  • Latest release: Sep 24, 2023
  • Number of updates: 10
  • Update frequency: every 91.1 days
  • Top authors: algoritmika (70%)wpcodefactory (40%)

Code review

54 tests

User reviews

1 review

Install metrics

30+ active / 1,659 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed successfully, without throwing any errors or notices

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

This is a short check of server-side resources used by Conditional Payment Gateways for WooCommerce
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0036.35 ▼15.42
Dashboard /wp-admin3.31 ▲0.0045.21 ▼3.35
Posts /wp-admin/edit.php3.36 ▲0.0047.69 ▼1.82
Add New Post /wp-admin/post-new.php5.89 ▲0.0084.61 ▼11.60
Media Library /wp-admin/upload.php3.23 ▲0.0033.25 ▲0.37

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 17 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
widget_recent-comments
db_upgraded
widget_theysaidso_widget
widget_recent-posts
can_compress_scripts

Browser metrics Passed 4 tests

An overview of browser requirements for Conditional Payment Gateways for WooCommerce
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5413.57 ▼0.794.06 ▲2.1938.14 ▼4.73
Dashboard /wp-admin2,206 ▲154.84 ▼0.03106.45 ▼1.3738.03 ▼4.21
Posts /wp-admin/edit.php2,089 ▼02.01 ▲0.0239.47 ▲0.3033.69 ▼1.42
Add New Post /wp-admin/post-new.php1,514 ▼2817.59 ▼0.73670.93 ▲63.1666.41 ▼2.50
Media Library /wp-admin/upload.php1,382 ▼34.17 ▼0.0692.48 ▼8.0240.74 ▼3.59

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-posts
    • can_compress_scripts
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-comments
    • theysaidso_admin_options

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Even though everything seems fine, this is not an exhaustive test

SRP Passed 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
No output text or server-side errors detected on direct access of PHP files

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
3 plugin tags: woo commerce, payment gateway, woocommerce

conditional-payment-gateways-for-woocommerce/conditional-payment-gateways-for-woocommerce.php Passed 13 tests

The entry point to "Conditional Payment Gateways for WooCommerce" version 2.1.3 is a PHP file that has certain tags in its header comment area
52 characters long description:
Manage payment gateways in WooCommerce. Beautifully.

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 plugin1,087 lines of code in 14 files:
LanguageFilesBlank linesComment linesLines of code
PHP142219611,087

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.56
Average class complexity12.46
▷ Minimum class complexity2.00
▷ Maximum class complexity56.00
Average method complexity2.26
▷ Minimum method complexity1.00
▷ Maximum method complexity38.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes13
▷ Abstract classes17.69%
▷ Concrete classes1292.31%
▷ Final classes18.33%
Methods121
▷ Static methods10.83%
▷ Public methods121100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions1
▷ Named functions1100.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
No PNG images were found in this plugin