84% dc-nagad

Code Review | DC Nagad Payment

WordPress plugin DC Nagad Payment scored84%from 54 tests.

About plugin

  • Plugin page: dc-nagad
  • Plugin version: 1.1.1
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-5.4
  • WordPress version: 6.3.1
  • First release: May 14, 2020
  • Latest release: Jul 27, 2020
  • Number of updates: 9
  • Update frequency: every 8.2 days
  • Top authors: kapilpaul (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

70+ active /4,188 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 successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.09MB] [CPU: ▼3.03ms] Passed 4 tests

Server-side resources used by DC Nagad Payment
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.55 ▲0.0944.52 ▲0.60
Dashboard /wp-admin3.39 ▲0.0949.16 ▼4.34
Posts /wp-admin/edit.php3.51 ▲0.1549.63 ▼6.91
Add New Post /wp-admin/post-new.php5.98 ▲0.09108.21 ▲12.73
Media Library /wp-admin/upload.php3.32 ▲0.0938.13 ▼1.48

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

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 33 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-posts
can_compress_scripts
widget_recent-comments
db_upgraded

Browser metrics Passed 4 tests

A check of browser resources used by DC Nagad Payment
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.77 ▲0.421.70 ▼0.1945.55 ▼1.12
Dashboard /wp-admin2,192 ▲155.61 ▲0.0289.13 ▼13.6441.80 ▲2.49
Posts /wp-admin/edit.php2,100 ▼01.96 ▼0.0636.61 ▼4.3736.10 ▼5.41
Add New Post /wp-admin/post-new.php1,526 ▼023.17 ▲0.32667.74 ▲3.1459.11 ▲4.27
Media Library /wp-admin/upload.php1,397 ▼34.18 ▲0.0096.73 ▼20.6642.28 ▼6.96

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
It is recommended to fix the following
  • The uninstall procedure has failed, leaving 6 options in the database
    • db_upgraded
    • can_compress_scripts
    • widget_recent-posts
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though everything seems fine, this is not 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
Almost there! Just fix the following items
  • 6× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/dc-nagad/includes/Admin/views/payment-list.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'DCoders\agad\\Woocommerce\agad_Gateway' not found in wp-content/plugins/dc-nagad/includes/Woocommerce/PaymentProcessor.php:12
    • > 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/dc-nagad/includes/Admin/Payment_List.php on line 7
    • > 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/dc-nagad/includes/Admin/Payment_List.php on line 7
    • > PHP Fatal error
      Uncaught Error: Class 'WC_Payment_Gateway' not found in wp-content/plugins/dc-nagad/includes/Woocommerce/Nagad_Gateway.php:8
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/dc-nagad/includes/Admin/Payment_List.php on line 7

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

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
4 plugin tags: nagad, bd payment gateway, bangladesh, bdt

dc-nagad/dcoders-nagad.php 92% from 13 tests

Analyzing the main PHP file in "DC Nagad Payment" version 1.1.1
Please make the necessary changes and fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("dc-nagad.php" instead of "dcoders-nagad.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
No dangerous file extensions were detected1,442 lines of code in 28 files:
LanguageFilesBlank linesComment linesLines of code
PHP233628061,311
JavaScript110066
Markdown133036
JSON20023
CSS1006

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.32
Average class complexity10.20
▷ Minimum class complexity1.00
▷ Maximum class complexity44.00
Average method complexity2.28
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces5
Interfaces0
Traits0
Classes15
▷ Abstract classes00.00%
▷ Concrete classes15100.00%
▷ Final classes16.67%
Methods108
▷ Static methods2422.22%
▷ Public methods10092.59%
▷ Protected methods43.70%
▷ Private methods43.70%
Functions12
▷ Named functions1083.33%
▷ Anonymous functions216.67%
Constants7
▷ Global constants685.71%
▷ Class constants114.29%
▷ Public constants1100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
1 PNG file occupies 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
assets/images/nagad.png2.14KB1.23KB▼ 42.73%