53% idataffiliates

Code Review | iDatAffiliates Affiliate Link Manager

WordPress plugin iDatAffiliates Affiliate Link Manager scored 53% from 54 tests.

About plugin

  • Plugin page: idataffiliates
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.4-1.0
  • WordPress version: 6.3.1
  • First release: Nov 15, 2017
  • Latest release: Nov 15, 2017
  • Number of updates: 2
  • Update frequency: every 5.5 days
  • Top authors: jass1990 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active / 13,965 total downloads

Benchmarks

Plugin footprint 48% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
This plugin's installer ran successfully

Server metrics [RAM: ▼1.94MB] [CPU: ▼54.63ms] Passed 4 tests

An overview of server-side resources used by iDatAffiliates Affiliate Link Manager
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /2.05 ▼1.415.29 ▼36.18
Dashboard /wp-admin2.07 ▼1.236.79 ▼41.86
Posts /wp-admin/edit.php2.07 ▼1.286.28 ▼40.71
Add New Post /wp-admin/post-new.php2.07 ▼3.826.93 ▼99.75
Media Library /wp-admin/upload.php2.07 ▼1.165.70 ▼27.47
Affiliate Links /wp-admin/edit.php?post_type=idatlink2.075.70
Settings /wp-admin/edit.php?post_type=idatlink&page=idat-settings2.077.51
Link Categories /wp-admin/edit-tags.php?taxonomy=idatlink-category&post_type=idatlink2.076.12
New Affiliate Link /wp-admin/post-new.php?post_type=idatlink2.076.59

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

How much does this plugin use your filesystem and database?
The plugin installed successfully
Filesystem: 107 new files
Database: 2 new tables, 17 new options
New tables
wp_idata_link_clicks_meta
wp_idata_link_clicks
New WordPress options
ta_clean_up_plugin_options
ta_link_prefix_custom
widget_recent-comments
widget_recent-posts
ta_activation_code_triggered
ta_guided_tour_status
ta_database_tables_created
ta_migration_complete_flag
db_upgraded
ta_settings_initialized
...

Browser metrics Passed 4 tests

A check of browser resources used by iDatAffiliates Affiliate Link Manager
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,846 ▲8913.22 ▼0.945.07 ▲3.0142.80 ▼4.85
Dashboard /wp-admin2,247 ▲594.88 ▼1.0497.01 ▼7.6940.23 ▼2.55
Posts /wp-admin/edit.php2,127 ▲382.04 ▲0.0535.63 ▲1.5330.26 ▼6.07
Add New Post /wp-admin/post-new.php1,564 ▲2823.32 ▲0.02597.85 ▲3.7863.41 ▲16.91
Media Library /wp-admin/upload.php1,423 ▲354.20 ▼0.04103.20 ▲3.8041.82 ▼0.44
Affiliate Links /wp-admin/edit.php?post_type=idatlink1,2122.4843.7231.74
Settings /wp-admin/edit.php?post_type=idatlink&page=idat-settings1,0582.6339.7429.05
Link Categories /wp-admin/edit-tags.php?taxonomy=idatlink-category&post_type=idatlink1,3032.1529.8328.56
New Affiliate Link /wp-admin/post-new.php?post_type=idatlink1,8014.6074.4363.22

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • Uninstall procedure had uncaught errors
    • > Notice in wp-content/plugins/idataffiliates/Models/Guided_Tour.php+222
    Undefined index: import-export-settings
  • Zombie tables were found after uninstall: 2 tables
    • wp_idata_link_clicks_meta
    • wp_idata_link_clicks
  • Zombie WordPress options were found after uninstall: 16 options
    • ta_link_prefix
    • ta_clean_up_plugin_options
    • idatOptions
    • ta_settings_initialized
    • ta_installed_version
    • ta_link_prefix_custom
    • ta_migration_complete_flag
    • widget_recent-comments
    • widget_theysaidso_widget
    • ta_used_link_prefixes
    • ...

Smoke tests 25% 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
  • 5 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=idatlink
    • > Notice in wp-content/plugins/idataffiliates/Models/Guided_Tour.php+222
    Undefined index: import-export-settings
  • 5 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=idatlink
    • > Notice in wp-content/plugins/idataffiliates/Models/Guided_Tour.php+232
    Undefined index: help-settings

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
The following issues need your attention
  • 12× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Interface 'IDatAffiliates\\Interfaces\\Model_Interface' not found in wp-content/plugins/idataffiliates/Models/Affiliate_Links_CPT.php:21
    • > PHP Fatal error
      Uncaught Error: Call to undefined function do_action() in wp-content/plugins/idataffiliates/views/linkpicker/quick-add-affiliate-link.php:5
    • > PHP Fatal error
      Uncaught Error: Interface 'IDatAffiliates\\Interfaces\\Model_Interface' not found in wp-content/plugins/idataffiliates/Models/Guided_Tour.php:19
    • > PHP Fatal error
      Uncaught Error: Interface 'IDatAffiliates\\Interfaces\\Model_Interface' not found in wp-content/plugins/idataffiliates/Models/Rewrites_Redirection.php:17
    • > PHP Fatal error
      Uncaught Error: Interface 'IDatAffiliates\\Interfaces\\Model_Interface' not found in wp-content/plugins/idataffiliates/Models/Shortcodes.php:17
    • > PHP Fatal error
      Uncaught Error: Interface 'IDatAffiliates\\Interfaces\\Model_Interface' not found in wp-content/plugins/idataffiliates/Models/Link_Picker.php:19
    • > PHP Fatal error
      Uncaught Error: Interface 'IDatAffiliates\\Interfaces\\Model_Interface' not found in wp-content/plugins/idataffiliates/Models/Marketing.php:19
    • > PHP Fatal error
      Uncaught Error: Interface 'IDatAffiliates\\Interfaces\\Model_Interface' not found in wp-content/plugins/idataffiliates/Models/Stats_Reporting.php:20
    • > PHP Fatal error
      Uncaught Error: Interface 'IDatAffiliates\\Interfaces\\Model_Interface' not found in wp-content/plugins/idataffiliates/Models/Affiliate_Link_Attachment.php:18
    • > PHP Fatal error
      Uncaught Error: Interface 'IDatAffiliates\\Interfaces\\Model_Interface' not found in wp-content/plugins/idataffiliates/Models/Migration.php:19

User-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Please fix the following user-side errors
    • > GET request to /wp-admin/post-new.php?post_type=idatlink
    • > Network (severe)
    wp-content/plugins/idataffiliates/Models/css/bootstrap/js/bootstrap.min.js?ver=3.3.7 - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/post-new.php?post_type=idatlink
    • > Deprecation (warning) in unknown
    /wp-content/plugins/idataffiliates/js/app/affiliate_link_page/dist/affiliate-link-page.js?ver=1.0.0 23 Listener added for a synchronous 'DOMNodeInserted' DOM Mutation Event. This event type is deprecated (https://w3c.github.io/uievents/#legacy-event-types) and work is underway to remove it from this browser. Usage of this event listener will cause performance issues today, and represents a risk of future incompatibility. Consider using MutationObserver instead.

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
5 plugin tags: link, idat, affiliate, idataffiliates, affiliate link management

idataffiliates/idataffiliates.php Passed 13 tests

"iDatAffiliates Affiliate Link Manager" version 1.0.0's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
42 characters long description:
To link easily using simple affiliate link

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Success! There were no dangerous files found in this plugin27,512 lines of code in 76 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript253,3402,26913,199
CSS201,2326710,321
PHP312,0783,2283,992

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.37
Average class complexity27.90
▷ Minimum class complexity1.00
▷ Maximum class complexity113.00
Average method complexity3.29
▷ Minimum method complexity1.00
▷ Maximum method complexity26.00
Code structure
Namespaces4
Interfaces3
Traits0
Classes18
▷ Abstract classes15.56%
▷ Concrete classes1794.44%
▷ Final classes00.00%
Methods245
▷ Static methods166.53%
▷ Public methods22190.20%
▷ Protected methods00.00%
▷ Private methods249.80%
Functions6
▷ Named functions233.33%
▷ Anonymous functions466.67%
Constants19
▷ Global constants00.00%
▷ Class constants19100.00%
▷ Public constants19100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
2 compressed PNG files occupy 0.00MB
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
js/lib/chosen/chosen-sprite.png0.53KB0.88KB0.00%
js/lib/chosen/chosen-sprite@2x.png0.72KB0.83KB0.00%