84% login-by-zalo

Code Review | Login by Zalo

WordPress plugin Login by Zalo scored84%from 54 tests.

About plugin

  • Plugin page: login-by-zalo
  • Plugin version: 1.0.3
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.6-5.7.2
  • WordPress version: 6.3.1
  • First release: Feb 5, 2021
  • Latest release: Aug 31, 2021
  • Number of updates: 8
  • Update frequency: every 26.0 days
  • Top authors: bluecoral (100%)

Code review

54 tests

User reviews

1 review

Install metrics

70+ active /1,872 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
Install script ran successfully

Server metrics [RAM: ▼0.26MB] [CPU: ▼14.31ms] Passed 4 tests

Server-side resources used by Login by Zalo
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.52 ▲0.0642.31 ▲1.15
Dashboard /wp-admin3.31 ▲0.0144.00 ▼6.68
Posts /wp-admin/edit.php3.45 ▲0.1055.07 ▲15.03
Add New Post /wp-admin/post-new.php4.72 ▼1.1748.76 ▼59.66
Media Library /wp-admin/upload.php3.28 ▲0.0539.17 ▲7.94

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

A short overview of filesystem and database impact
This plugin was installed successfully
Filesystem: 73 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-comments
theysaidso_admin_options
widget_theysaidso_widget
can_compress_scripts
widget_recent-posts
widget_login_zalo
db_upgraded

Browser metrics Passed 4 tests

Login by Zalo: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,816 ▲7013.73 ▼0.561.47 ▼0.4343.35 ▼1.65
Dashboard /wp-admin2,222 ▲344.84 ▼0.05111.77 ▲11.1842.17 ▲2.94
Posts /wp-admin/edit.php2,105 ▲162.00 ▼0.0040.05 ▲0.1033.94 ▼0.99
Add New Post /wp-admin/post-new.php1,555 ▲1318.22 ▲0.09590.02 ▼23.0650.15 ▼4.76
Media Library /wp-admin/upload.php1,401 ▲104.17 ▼0.0997.98 ▼5.8243.86 ▼1.53

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
You still need to fix the following
  • The uninstall procedure has failed, leaving 7 options in the database
    • can_compress_scripts
    • widget_recent-comments
    • db_upgraded
    • widget_login_zalo
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please take a closer look at the following
  • 15× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Interface 'Zalo\\HttpClients\\ZaloHttpClientInterface' not found in wp-content/plugins/login-by-zalo/libraries/vendor/zaloplatform/zalo-php-sdk/src/HttpClients/ZStreamHttpClient.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'Zalo\\Exceptions\\ZaloSDKException' not found in wp-content/plugins/login-by-zalo/libraries/vendor/zaloplatform/zalo-php-sdk/src/Exceptions/ZaloOtherException.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/login-by-zalo/libraries/vendor/zaloplatform/zalo-php-sdk/tests/YourClassTest.php:11
    • > PHP Fatal error
      Uncaught Error: Interface 'Zalo\\Http\\RequestBodyInterface' not found in wp-content/plugins/login-by-zalo/libraries/vendor/zaloplatform/zalo-php-sdk/src/Http/RequestBodyUrlEncoded.php:16
    • > PHP Fatal error
      Uncaught Error: Interface 'Zalo\\Url\\UrlDetectionInterface' not found in wp-content/plugins/login-by-zalo/libraries/vendor/zaloplatform/zalo-php-sdk/src/Url/ZaloUrlDetectionHandler.php:16
    • > PHP Fatal error
      Uncaught Error: Interface 'Zalo\\Http\\RequestBodyInterface' not found in wp-content/plugins/login-by-zalo/libraries/vendor/zaloplatform/zalo-php-sdk/src/Http/RequestBodyRaw.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'Zalo\\Exceptions\\ZaloSDKException' not found in wp-content/plugins/login-by-zalo/libraries/vendor/zaloplatform/zalo-php-sdk/src/Exceptions/ZaloClientException.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'Zalo\\Exceptions\\ZaloSDKException' not found in wp-content/plugins/login-by-zalo/libraries/vendor/zaloplatform/zalo-php-sdk/src/Exceptions/ZaloOAException.php:16
    • > PHP Fatal error
      Uncaught Error: Interface 'Zalo\\Http\\RequestBodyInterface' not found in wp-content/plugins/login-by-zalo/libraries/vendor/zaloplatform/zalo-php-sdk/src/Http/RequestBodyMultipart.php:19
    • > PHP Fatal error
      Uncaught Error: Interface 'Zalo\\HttpClients\\ZaloHttpClientInterface' not found in wp-content/plugins/login-by-zalo/libraries/vendor/zaloplatform/zalo-php-sdk/src/HttpClients/ZaloCurlHttpClient.php:19

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
These attributes need to be fixed:
  • Tags: There are too many tags (13 tag instead of maximum 10)
The official readme.txt is a good inspiration

login-by-zalo/login-by-zalo.php Passed 13 tests

The entry point to "Login by Zalo" version 1.0.3 is a PHP file that has certain tags in its header comment area
71 characters long description:
Integrate Zalo Login at your website easiest and simplest possible way.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Good job! No executable or dangerous file extensions detected5,270 lines of code in 66 files:
LanguageFilesBlank linesComment linesLines of code
PHP539542,4134,616
Markdown1650287
CSS336227
JSON30087
JavaScript42628
YAML15113
XML10012

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.26
Average class complexity8.84
▷ Minimum class complexity1.00
▷ Maximum class complexity53.00
Average method complexity2.00
▷ Minimum method complexity1.00
▷ Maximum method complexity52.00
Code structure
Namespaces10
Interfaces3
Traits0
Classes41
▷ Abstract classes00.00%
▷ Concrete classes41100.00%
▷ Final classes00.00%
Methods350
▷ Static methods288.00%
▷ Public methods31890.86%
▷ Protected methods164.57%
▷ Private methods164.57%
Functions2
▷ Named functions150.00%
▷ Anonymous functions150.00%
Constants42
▷ Global constants00.00%
▷ Class constants42100.00%
▷ Public constants42100.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.01MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/zalo-logo.png3.36KB1.66KB▼ 50.65%
assets/images/logo.png11.58KB6.72KB▼ 41.98%