10% affiliate-tools-viet-nam

Code Review | Affiliate Tools Việt Nam

WordPress plugin Affiliate Tools Việt Nam scored 10% from 54 tests.

About plugin

  • Plugin page: affiliate-tools-v...
  • Plugin version: 0.3.17
  • PHP version: 7.4.16
  • WordPress compatibility: 2.6-4.7
  • WordPress version: 6.3.1
  • First release: Dec 24, 2016
  • Latest release: Sep 11, 2017
  • Number of updates: 81
  • Update frequency: every 3.2 days
  • Top authors: leduchuy89vn (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

20+ active / 2,871 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
These installer errors require your attention
  • This plugin did not install gracefully
    • > Notice in wp-content/plugins/affiliate-tools-viet-nam/functions/affiliate-tools-base.php+88
    Undefined index: old_name

Server metrics [RAM: ▼1.89MB] [CPU: ▼50.44ms] Passed 4 tests

This is a short check of server-side resources used by Affiliate Tools Việt Nam
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0442.20 ▼0.60
Dashboard /wp-admin2.05 ▼1.258.05 ▼44.40
Posts /wp-admin/edit.php2.05 ▼1.315.91 ▼39.82
Add New Post /wp-admin/post-new.php2.05 ▼3.846.32 ▼90.47
Media Library /wp-admin/upload.php2.05 ▼1.186.52 ▼27.07
Affiliate Tools /wp-admin/options-general.php?page=affiliate-tools-viet-nam/functions/affiliate-tools-admin.php2.056.57

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 20 new files
Database: 2 new tables, 7 new options
New tables
wp_masklinks
wp_links_stats
New WordPress options
widget_recent-posts
widget_theysaidso_widget
db_upgraded
AffiliateToolsBase
theysaidso_admin_options
widget_recent-comments
can_compress_scripts

Browser metrics Passed 4 tests

Checking browser requirements for Affiliate Tools Việt Nam
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,883 ▲11213.96 ▼0.722.11 ▲0.2433.55 ▼15.49
Dashboard /wp-admin2,276 ▲1055.58 ▼0.31109.53 ▲8.0641.76 ▼4.38
Posts /wp-admin/edit.php2,103 ▲142.65 ▲0.6734.77 ▼5.2434.09 ▼0.75
Add New Post /wp-admin/post-new.php6,460 ▲4,91621.02 ▲2.85903.32 ▲264.9838.18 ▼15.88
Media Library /wp-admin/upload.php1,402 ▲204.89 ▲0.5897.88 ▼2.6038.92 ▼5.82
Affiliate Tools /wp-admin/options-general.php?page=affiliate-tools-viet-nam/functions/affiliate-tools-admin.php1,1922.3239.7337.40

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 50% 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
  • Uninstall procedure had uncaught errors
    • > User notice in wp-includes/functions.php+5905
    Function wp_localize_script was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the init-chart handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_recent-posts
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-comments
    • db_upgraded
    • widget_theysaidso_widget

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Almost there, just fix the following server-side errors
    • > GET request to /wp-admin/options-general.php?page=affiliate-tools-viet-nam/functions/affiliate-tools-admin.php
    • > User notice in wp-includes/functions.php+5905
    Function wp_localize_script was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the init-chart handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
    • > GET request to /wp-admin/options-general.php?page=affiliate-tools-viet-nam/functions/affiliate-tools-admin.php
    • > User notice in wp-includes/functions.php+5905
    Function wp_enqueue_script was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the jquery handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
    • > GET request to /wp-admin/options-general.php?page=affiliate-tools-viet-nam/functions/affiliate-tools-admin.php
    • > User notice in wp-includes/functions.php+5905
    Function wp_enqueue_script was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the chart handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
    • > GET request to /wp-admin/options-general.php?page=affiliate-tools-viet-nam/functions/affiliate-tools-admin.php
    • > User notice in wp-includes/functions.php+5905
    Function wp_enqueue_script was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the init-chart handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
    • > GET request to /wp-admin/options-general.php?page=affiliate-tools-viet-nam/functions/affiliate-tools-admin.php
    • > User notice in wp-includes/functions.php+5905
    Function wp_enqueue_script was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the aff-select2 handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
    • > GET request to /wp-admin/options-general.php?page=affiliate-tools-viet-nam/functions/affiliate-tools-admin.php
    • > User notice in wp-includes/functions.php+5905
    Function wp_enqueue_style was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the aff-select2 handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
    • > GET request to /wp-admin/options-general.php?page=affiliate-tools-viet-nam/functions/affiliate-tools-admin.php
    • > User notice in wp-includes/functions.php+5905
    Function wp_enqueue_style was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the affiliate-tools handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)

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 fix the following items
  • 12× PHP files output text when accessed directly (only 10 are shown):
    • > /wp-content/plugins/affiliate-tools-viet-nam/functions/affiliate-factory/base-affiliate-factory.php
    • > /wp-content/plugins/affiliate-tools-viet-nam/functions/affiliate-factory/accesstrade-affiliate-factory.php
    • > /wp-content/plugins/affiliate-tools-viet-nam/functions/affiliate-tools-base.php
    • > /wp-content/plugins/affiliate-tools-viet-nam/functions/option-layouts.php
    • > /wp-content/plugins/affiliate-tools-viet-nam/functions/affiliate-tools-parser.php
    • > /wp-content/plugins/affiliate-tools-viet-nam/functions/affiliate-factory/affiliate-factory.php
    • > /wp-content/plugins/affiliate-tools-viet-nam/functions/options.php
    • > /wp-content/plugins/affiliate-tools-viet-nam/functions/utilities.php
    • > /wp-content/plugins/affiliate-tools-viet-nam/widget/affiliate-admin-widget.php
    • > /wp-content/plugins/affiliate-tools-viet-nam/functions/affiliate-tools-admin.php

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 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
10 plugin tags: posts, comments, post, link, links...

affiliate-tools-viet-nam/affiliate-tools-viet-nam.php Passed 13 tests

The entry point to "Affiliate Tools Việt Nam" version 0.3.17 is a PHP file that has certain tags in its header comment area
108 characters long description:
Affiliate Tools plugin for Viet Nam. Currently we supports Accesstrade, Massoffer and Lazada's comming soon.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Good job! No executable or dangerous file extensions detected2,285 lines of code in 19 files:
LanguageFilesBlank linesComment linesLines of code
PHP135008142,137
CSS31181
JavaScript315967

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.48
Average class complexity37.00
▷ Minimum class complexity6.00
▷ Maximum class complexity134.00
Average method complexity4.13
▷ Minimum method complexity1.00
▷ Maximum method complexity77.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes8
▷ Abstract classes00.00%
▷ Concrete classes8100.00%
▷ Final classes00.00%
Methods92
▷ Static methods2223.91%
▷ Public methods9097.83%
▷ Protected methods22.17%
▷ Private methods00.00%
Functions24
▷ Named functions24100.00%
▷ Anonymous functions00.00%
Constants12
▷ Global constants18.33%
▷ Class constants1191.67%
▷ Public constants11100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
No PNG files were detected