84% woo-diamondpay

Code Review | DiamondPay payment gateway for WooCommerce

WordPress plugin DiamondPay payment gateway for WooCommerce scored84%from 54 tests.

About plugin

  • Plugin page: woo-diamondpay
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: Jan 23, 2018
  • Latest release: Jan 23, 2018
  • Number of updates: 6
  • Update frequency: every 1.3 days
  • Top authors: tasveeq (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /595 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed gracefully, with no errors

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

Analyzing server-side resources used by DiamondPay payment gateway for WooCommerce
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0138.87 ▼7.08
Dashboard /wp-admin3.32 ▲0.0252.98 ▲3.40
Posts /wp-admin/edit.php3.37 ▲0.0152.53 ▲2.77
Add New Post /wp-admin/post-new.php5.90 ▲0.0186.42 ▼13.41
Media Library /wp-admin/upload.php3.24 ▲0.0137.72 ▲0.71

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

Input-output and database impact of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 3 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
widget_recent-comments
db_upgraded
theysaidso_admin_options
can_compress_scripts
widget_recent-posts

Browser metrics Passed 4 tests

Checking browser requirements for DiamondPay payment gateway for WooCommerce
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5413.17 ▼1.561.77 ▼0.2145.39 ▲2.73
Dashboard /wp-admin2,203 ▲155.77 ▼0.11102.05 ▼1.8439.96 ▼2.08
Posts /wp-admin/edit.php2,089 ▼31.99 ▼0.0436.31 ▼5.5134.61 ▼1.80
Add New Post /wp-admin/post-new.php1,514 ▼517.68 ▼5.61679.05 ▲70.7557.75 ▲6.76
Media Library /wp-admin/upload.php1,391 ▲64.26 ▲0.0695.55 ▼7.5842.86 ▼3.07

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
The following items require your attention
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-posts
    • widget_recent-comments
    • db_upgraded
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_theysaidso_widget

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
Even though no errors were found, this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please take a closer look at the following
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/woo-diamondpay/woo-diamondpay.php:96

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 97% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Attributes that need to be fixed: You can take inspiration from this readme.txt

woo-diamondpay/woo-diamondpay.php Passed 13 tests

The main file in "DiamondPay payment gateway for WooCommerce" v. 1.0.0 serves as a complement to information provided in readme.txt and as the entry point to the plugin
45 characters long description:
Add Diamond Payment Gateways for WooCommerce.

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
Good job! No executable or dangerous file extensions detected79 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP19879

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.04
Average class complexity1.00
▷ Minimum class complexity1.00
▷ Maximum class complexity1.00
Average method complexity1.00
▷ Minimum method complexity1.00
▷ Maximum method complexity1.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods5
▷ Static methods00.00%
▷ Public methods5100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
1 PNG file occupies 0.02MB with 0.02MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
(invalid) images/diamondlogo.png23.50KB0.00KB▼ 100.00%