83% thanh-toan-the-cao-dien-thoai

Code Review | Thanh Toan The Cao Dien Thoai

WordPress plugin Thanh Toan The Cao Dien Thoai scored83%from 54 tests.

About plugin

  • Plugin page: thanh-toan-the-ca...
  • Plugin version: 1.4.2
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: Jul 13, 2017
  • Latest release: Apr 10, 2018
  • Number of updates: 9
  • Update frequency: every 30.2 days
  • Top authors: dangngocbinh (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

10+ active /1,950 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
This plugin's installer ran successfully

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

A check of server-side resources used by Thanh Toan The Cao Dien Thoai
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0137.70 ▼3.58
Dashboard /wp-admin3.31 ▼0.0347.99 ▼18.21
Posts /wp-admin/edit.php3.36 ▲0.0145.92 ▲0.37
Add New Post /wp-admin/post-new.php5.89 ▲0.0191.69 ▼4.54
Media Library /wp-admin/upload.php3.23 ▲0.0133.66 ▼0.74

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

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

Browser metrics Passed 4 tests

Thanh Toan The Cao Dien Thoai: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲5814.47 ▲0.091.74 ▼0.0341.78 ▼1.99
Dashboard /wp-admin2,210 ▲225.89 ▲1.01110.63 ▼11.8944.77 ▼2.88
Posts /wp-admin/edit.php2,095 ▲62.00 ▼0.0440.08 ▼0.2940.57 ▲3.80
Add New Post /wp-admin/post-new.php1,518 ▼117.50 ▼5.71593.72 ▼34.2352.70 ▼1.75
Media Library /wp-admin/upload.php1,392 ▲74.28 ▲0.0497.40 ▼5.4743.17 ▲0.65

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
The following items require your attention
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_theysaidso_widget
    • widget_recent-comments
    • widget_recent-posts
    • db_upgraded
    • can_compress_scripts
    • theysaidso_admin_options

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
Everything seems fine, however this is by no means an exhaustive test

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
  • 14× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'nusoap_base' not found in wp-content/plugins/thanh-toan-the-cao-dien-thoai/modules/nganluonglib/class.soap_server.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'nusoap_base' not found in wp-content/plugins/thanh-toan-the-cao-dien-thoai/modules/nganluonglib/class.soap_transport_http.php:15
    • > PHP Warning
      require_once(Mail/mimeDecode.php): failed to open stream: No such file or directory in wp-content/plugins/thanh-toan-the-cao-dien-thoai/modules/nganluonglib/nusoapmime.php on line 42
    • > PHP Fatal error
      Uncaught Error: Call to undefined function apply_filters() in wp-content/plugins/thanh-toan-the-cao-dien-thoai/mobile-card-credit.php:11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/thanh-toan-the-cao-dien-thoai/card-getway.php:2
    • > PHP Fatal error
      require_once(): Failed opening required 'Mail/mimeDecode.php' (include_path='.:/usr/share/php') in wp-content/plugins/thanh-toan-the-cao-dien-thoai/modules/nganluonglib/nusoapmime.php on line 42
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/thanh-toan-the-cao-dien-thoai/credit.php:452
    • > PHP Fatal error
      Uncaught Error: Class 'nusoap_base' not found in wp-content/plugins/thanh-toan-the-cao-dien-thoai/modules/nganluonglib/class.soap_val.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'nusoap_base' not found in wp-content/plugins/thanh-toan-the-cao-dien-thoai/modules/nganluonglib/class.soap_fault.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'nusoap_base' not found in wp-content/plugins/thanh-toan-the-cao-dien-thoai/modules/nganluonglib/class.wsdl.php:15

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
There were no browser issues found

Optimizations

Plugin configuration 79% from 29 tests

readme.txt 81% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
Attributes that need to be fixed:
  • Screenshots: These screenshots lack descriptions #1, #2 in thanh-toan-the-cao-dien-thoai/assets to your readme.txt
  • Plugin Name: Please replace "Plugin Name" with the name of your plugin on the first line ( === thanh-toan-the-cao-dien-thoai === )
  • Requires at least: Invalid version format
The official readme.txt might help

thanh-toan-the-cao-dien-thoai/mobile-card-credit.php 77% from 13 tests

The main PHP script in "Thanh Toan The Cao Dien Thoai" version 1.4.2 is automatically included on every request by WordPress
You should first fix the following items:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("thanh-toan-the-cao-dien-thoai.php" instead of "mobile-card-credit.php")
  • Description: Please keep the plugin description shorter than 140 characters (currently 219 characters long)
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Success! There were no dangerous files found in this plugin12,253 lines of code in 23 files:
LanguageFilesBlank linesComment linesLines of code
PHP201,0355,16011,956
CSS1325146
PO File1272878
JavaScript1191573

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.46
Average class complexity66.73
▷ Minimum class complexity1.00
▷ Maximum class complexity388.00
Average method complexity8.66
▷ Minimum method complexity1.00
▷ Maximum method complexity82.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes41
▷ Abstract classes00.00%
▷ Concrete classes41100.00%
▷ Final classes00.00%
Methods352
▷ Static methods10.28%
▷ Public methods34999.15%
▷ Protected methods00.00%
▷ Private methods30.85%
Functions20
▷ Named functions20100.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants4100.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
2 PNG files occupy 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
image/check-mark.png4.90KB3.12KB▼ 36.35%
includes/images/napthe.png3.23KB2.00KB▼ 38.11%