10% affiliateimportereb

Code Review | AffiliateImporterEb

WordPress plugin AffiliateImporterEb scored 10% from 54 tests.

About plugin

  • Plugin page: affiliateimportereb
  • Plugin version: 1.0.6
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-4.7
  • WordPress version: 6.3.1
  • First release: Dec 29, 2016
  • Latest release: Mar 19, 2017
  • Number of updates: 46
  • Update frequency: every 1.6 days
  • Top authors: cr1000 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 1,816 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
  • The plugin did not install without errors
    • > Warning in wp-content/plugins/affiliateimportereb/src/EBDN/Utils/Ajax.php+41
    file_get_contents(): php_network_getaddresses: getaddrinfo failed: Name or service not known

Server metrics [RAM: ▼1.18MB] [CPU: ▲61.97ms] Passed 4 tests

Server-side resources used by AffiliateImporterEb
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /4.52 ▲1.0662.10 ▲22.30
Dashboard /wp-admin2.76 ▼0.54133.26 ▲86.34
Posts /wp-admin/edit.php2.76 ▼0.59150.05 ▲82.41
Add New Post /wp-admin/post-new.php2.76 ▼3.13156.68 ▲70.05
Media Library /wp-admin/upload.php2.76 ▼0.46109.51 ▲73.10
Shedule /wp-admin/admin.php?page=ebdn-schedule2.76125.79
Statistics /wp-admin/admin.php?page=ebdn-stats2.76147.25
Status /wp-admin/admin.php?page=ebdn-status2.76254.13
Support /wp-admin/admin.php?page=ebdn-support2.76136.00
Ebay /wp-admin/admin.php?page=ebdn-add2.76139.05
Affiliate Eb /wp-admin/admin.php?page=ebdn2.76137.33
Settings /wp-admin/admin.php?page=ebdn-settings2.76133.19
Backup / Restore /wp-admin/admin.php?page=ebdn-backup2.76140.79

Server storage [IO: ▲7.19MB] [DB: ▲0.01MB] Passed 3 tests

Input-output and database impact of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 112 new files
Database: 8 new tables, 8 new options
New tables
wp_ebdn_stats
wp_ebdn_goods_archive
wp_ebdn_log
wp_ebdn_ebay_sites
wp_ebdn_blacklist
wp_ebdn_price_formula
wp_ebdn_account
wp_ebdn_goods
New WordPress options
can_compress_scripts
db_upgraded
widget_recent-comments
theysaidso_admin_options
widget_recent-posts
ebdn_db_version
widget_theysaidso_widget
recovery_mode_email_last_sent

Browser metrics Passed 4 tests

An overview of browser requirements for AffiliateImporterEb
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,915 ▲15813.86 ▼0.521.72 ▼0.2048.82 ▲6.05
Dashboard /wp-admin2,306 ▲1185.74 ▲0.87109.48 ▼0.3299.47 ▲54.68
Posts /wp-admin/edit.php2,189 ▲1002.49 ▲0.4545.26 ▼15.5062.17 ▲14.09
Add New Post /wp-admin/post-new.php1,606 ▲9223.84 ▲6.28652.69 ▼29.7936.70 ▼11.87
Media Library /wp-admin/upload.php1,500 ▲1154.97 ▲0.77102.95 ▼0.1192.46 ▲47.16
Shedule /wp-admin/admin.php?page=ebdn-schedule1,1682.3838.1859.21
Statistics /wp-admin/admin.php?page=ebdn-stats1,1352.3634.6835.78
Status /wp-admin/admin.php?page=ebdn-status1,0111.7419.6330.66
Support /wp-admin/admin.php?page=ebdn-support9492.6132.4033.36
Ebay /wp-admin/admin.php?page=ebdn-add8822.3329.4126.29
Affiliate Eb /wp-admin/admin.php?page=ebdn1,1592.4234.7365.31
Settings /wp-admin/admin.php?page=ebdn-settings2,1802.3338.9264.00
Backup / Restore /wp-admin/admin.php?page=ebdn-backup1,1572.3634.1354.96

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • This plugin cannot be uninstalled
    • > Warning in wp-content/plugins/affiliateimportereb/src/EBDN/Utils/Ajax.php+41
    file_get_contents(): php_network_getaddresses: getaddrinfo failed: Name or service not known
  • The uninstall procedure has failed, leaving 8 options in the database
    • widget_theysaidso_widget
    • recovery_mode_email_last_sent
    • widget_recent-posts
    • ebdn_db_version
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-comments
    • can_compress_scripts

Smoke tests 0% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Smoke test failed, please fix the following
  • 8 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=ebdn-backup
    • > Warning in wp-content/plugins/affiliateimportereb/src/EBDN/Utils/Ajax.php+41
    file_get_contents(): php_network_getaddresses: getaddrinfo failed: Name or service not known
  • 8 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=ebdn-backup
    • > Warning in wp-content/plugins/affiliateimportereb/src/EBDN/Utils/Ajax.php+41
    file_get_contents(http://...@potrivit.com): failed to open stream: php_network_getaddresses: getaddrinfo failed: Name or service not known
  • 49 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=ebdn-backup
    • > Notice in wp-content/plugins/affiliateimportereb/layout/toolbar.php+55
    Undefined index: class
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=ebdn-status
    • > Notice in wp-content/plugins/affiliateimportereb/layout/status.php+32
    Trying to access array offset on value of type bool
    • > GET request to /wp-admin/admin.php?page=ebdn-status
    • > Error in wp-content/plugins/affiliateimportereb/layout/status.php+82
    Uncaught Error: Call to undefined function woocommerce_let_to_num() in wp-content/plugins/affiliateimportereb/layout/status.php:82
    Stack trace:
    #0 wp-content/plugins/affiliateimportereb/src/Dnolbon/Ebdn/Pages/Status.php(11): include()
    #1 wp-includes/class-wp-hook.php(310): Dnolbon\Ebdn\Pages\Status->render()
    #2 wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters()
    #3 wp-includes/plugin.php(517): WP_Hook->do_action()
    #4 wp-admin/admin.php(259): do_action()
    #5 {main}
    thrown
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=ebdn-settings
    • > Notice in wp-content/plugins/affiliateimportereb/src/EBDN/Utils/Utils.php+57
    Undefined index: parent

SRP 0% 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
Please take a closer look at the following
  • 1× PHP files output text when accessed directly:
    • > /wp-content/plugins/affiliateimportereb/layout/backup_restore.php
  • 28× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Notice
      Undefined variable: dashboard in wp-content/plugins/affiliateimportereb/layout/dashboard.php on line 7
    • > 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/affiliateimportereb/src/EBDN/Pages/DashboardPage.php on line 6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_basename() in wp-content/plugins/affiliateimportereb/AffiliateImporterEb.php:21
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _ex() in wp-content/plugins/affiliateimportereb/src/EBDN/Modules/ebay/view/settings.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'Dnolbon\\Ebdn\\Wordpress\\WordpressDb' not found in wp-content/plugins/affiliateimportereb/layout/status.php:8
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/affiliateimportereb/layout/stats.php:16
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/upgrade.php' (include_path='.:/usr/share/php') in wp-content/plugins/affiliateimportereb/install.php on line 5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/affiliateimportereb/src/EBDN/Utils/Ajax.php:11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/affiliateimportereb/schedule.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'EBDN_AbstractLoader' not found in wp-content/plugins/affiliateimportereb/src/EBDN/Modules/ebay/EBDN_EbayLoader.php:11

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)
There are user-side issues you should fix
    • > GET request to /wp-admin/admin.php?page=ebdn-support
    • > Console-api (warning) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1 1:28609 "jQuery.Deferred exception: Cannot read properties of undefined (reading 'replace')" "TypeError: Cannot read properties of undefined (reading 'replace')\n at setActivePage (/wp-admin/admin.php?page=ebdn-support:233:87)\n at HTMLDocument.\u003Canonymous> (/wp-admin/admin.php?page=ebdn-support:223:9)\n at e (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:26990)\n at t (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:27292)" undefined
    • > GET request to /wp-admin/admin.php?page=ebdn-support
    • > Javascript (severe) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1 1:28721 Uncaught TypeError: Cannot read properties of undefined (reading 'replace')

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 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
Please fix the following attributes:
  • Screenshots: Please add images for these screenshots: #1 (This screen shot description corresponds to screenshot-1.(png|jpg|jpeg|gif). Note that the screenshot is taken from), #2 (This is the second screen shot)
Please take inspiration from this readme.txt

affiliateimportereb/AffiliateImporterEb.php 92% from 13 tests

The main file in "AffiliateImporterEb" v. 1.0.6 serves as a complement to information provided in readme.txt and as the entry point to the plugin
Please make the necessary changes and fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("affiliateimportereb.php" instead of "AffiliateImporterEb.php")

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 plugin16,227 lines of code in 70 files:
LanguageFilesBlank linesComment linesLines of code
PHP531,4361,3757,123
CSS7860214,846
JavaScript6409682,805
SVG2001,301
JSON100150
XML1002

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.45
Average class complexity21.33
▷ Minimum class complexity1.00
▷ Maximum class complexity138.00
Average method complexity3.66
▷ Minimum method complexity1.00
▷ Maximum method complexity76.00
Code structure
Namespaces5
Interfaces0
Traits0
Classes39
▷ Abstract classes410.26%
▷ Concrete classes3589.74%
▷ Final classes00.00%
Methods310
▷ Static methods3310.65%
▷ Public methods26284.52%
▷ Protected methods3711.94%
▷ Private methods113.55%
Functions36
▷ Named functions3494.44%
▷ Anonymous functions25.56%
Constants18
▷ Global constants18100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
27 PNG files occupy 0.83MB with 0.42MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/img/toolbar/dashboard.png1.69KB1.17KB▼ 30.92%
assets/screenshots/Statistics.png267.52KB69.89KB▼ 73.87%
assets/img/toolbar/add.png2.14KB1.65KB▼ 22.85%
assets/screenshots/AddProduct.png260.55KB71.71KB▼ 72.48%
assets/img/main/views.png2.99KB1.41KB▼ 52.68%