10% affiliateimporteren

Code Review | AffiliateImporterEn

WordPress plugin AffiliateImporterEn scored10%from 54 tests.

About plugin

  • Plugin page: affiliateimporteren
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-4.7
  • WordPress version: 6.3.1
  • First release: Feb 18, 2017
  • Latest release: Feb 18, 2017
  • Number of updates: 12
  • Update frequency: every 0.3 days
  • Top authors: cr1000 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /832 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
These installer errors require your attention
  • This plugin did not install gracefully
    • > Warning in wp-content/plugins/affiliateimporteren/src/Dnolbon/AffiliateImporter/AffiliateImporterAbstract.php+548
    file_get_contents(): php_network_getaddresses: getaddrinfo failed: Name or service not known

Server metrics [RAM: ▼1.17MB] [CPU: ▲55.72ms] Passed 4 tests

Analyzing server-side resources used by AffiliateImporterEn
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.88 ▲0.4251.41 ▲10.50
Dashboard /wp-admin2.77 ▼0.53137.40 ▲84.23
Posts /wp-admin/edit.php2.77 ▼0.58129.63 ▲82.48
Add New Post /wp-admin/post-new.php2.77 ▼3.12161.74 ▲62.74
Media Library /wp-admin/upload.php2.77 ▼0.46104.61 ▲67.15
Add product /wp-admin/admin.php?page=endn-add2.77181.76
Shedule /wp-admin/admin.php?page=endn-schedule2.77127.85
Statistics /wp-admin/admin.php?page=endn-stats2.77136.26
AffImporterEn /wp-admin/admin.php?page=endn2.77109.22
Settings /wp-admin/admin.php?page=endn-settings2.77130.83
Support /wp-admin/admin.php?page=endn-support2.77119.34
Backup / Restore /wp-admin/admin.php?page=endn-backup2.77121.11
Status /wp-admin/admin.php?page=endn-status2.77145.99

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

How much does this plugin use your filesystem and database?
This plugin installed successfully
Filesystem: 864 new files
Database: 6 new tables, 7 new options
New tables
wp_endn_stats
wp_endn_blacklist
wp_endn_account
wp_endn_goods_archive
wp_endn_price_formula
wp_endn_goods
New WordPress options
theysaidso_admin_options
widget_theysaidso_widget
can_compress_scripts
widget_recent-comments
db_upgraded
recovery_mode_email_last_sent
widget_recent-posts

Browser metrics Passed 4 tests

An overview of browser requirements for AffiliateImporterEn
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,906 ▲14513.36 ▼0.991.88 ▲0.1941.72 ▼2.03
Dashboard /wp-admin2,272 ▲1025.13 ▼0.5885.45 ▼13.3199.03 ▲58.26
Posts /wp-admin/edit.php2,175 ▲722.46 ▲0.4838.42 ▼9.4751.90 ▲13.58
Add New Post /wp-admin/post-new.php1,608 ▲8023.72 ▲0.55642.45 ▼24.4335.49 ▼15.14
Media Library /wp-admin/upload.php1,486 ▲864.71 ▲0.49103.25 ▼10.9076.91 ▲32.67
Add product /wp-admin/admin.php?page=endn-add14,5632.5844.4940.88
Shedule /wp-admin/admin.php?page=endn-schedule1,1532.4233.6028.06
Statistics /wp-admin/admin.php?page=endn-stats1,1712.4634.9627.53
AffImporterEn /wp-admin/admin.php?page=endn1,1442.2433.8231.43
Settings /wp-admin/admin.php?page=endn-settings1,8882.4332.8937.79
Support /wp-admin/admin.php?page=endn-support9792.1829.2028.90
Backup / Restore /wp-admin/admin.php?page=endn-backup1,1432.3929.0433.77
Status /wp-admin/admin.php?page=endn-status9741.7513.9331.06

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
Please fix the following items
  • Uninstall procedure had uncaught errors
    • > Warning in wp-content/plugins/affiliateimporteren/src/Dnolbon/AffiliateImporter/AffiliateImporterAbstract.php+548
    file_get_contents(): php_network_getaddresses: getaddrinfo failed: Name or service not known
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • widget_theysaidso_widget
    • widget_recent-comments
    • db_upgraded
    • theysaidso_admin_options
    • recovery_mode_email_last_sent
    • can_compress_scripts
    • widget_recent-posts

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check 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=endn-status
    • > Warning in wp-content/plugins/affiliateimporteren/src/Dnolbon/AffiliateImporter/AffiliateImporterAbstract.php+548
    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=endn-status
    • > Warning in wp-content/plugins/affiliateimporteren/src/Dnolbon/AffiliateImporter/AffiliateImporterAbstract.php+548
    file_get_contents(http://...@potrivit.com): failed to open stream: php_network_getaddresses: getaddrinfo failed: Name or service not known
  • 16 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=endn-status
    • > Deprecated in wp-content/plugins/affiliateimporteren/vendor/twig/twig/lib/Twig/Node.php+198
    Unparenthesized `a ? b : c ? d : e` is deprecated. Use either `(a ? b : c) ? d : e` or `a ? b : (c ? d : e)`
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=endn-settings
    • > Notice in wp-content/plugins/affiliateimporteren/src/Dnolbon/WooCommerce/Categories/Categories.php+18
    Undefined index: parent
    • > GET request to /wp-admin/admin.php?page=endn-status
    • > Error in wp-content/plugins/affiliateimporteren/layout/status.php+58
    Uncaught Error: Call to undefined function woocommerce_let_to_num() in wp-content/plugins/affiliateimporteren/layout/status.php:58
    Stack trace:
    #0 wp-content/plugins/affiliateimporteren/src/Dnolbon/AffiliateImporter/Pages/Status.php(16): include()
    #1 wp-includes/class-wp-hook.php(310): Dnolbon\AffiliateImporter\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

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
Please fix the following
  • 293× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Twig_BaseNodeVisitor' not found in wp-content/plugins/affiliateimporteren/vendor/twig/twig/lib/Twig/NodeVisitor/Sandbox.php:19
    • > PHP Fatal error
      Uncaught Error: Class 'Twig_Filter' not found in wp-content/plugins/affiliateimporteren/vendor/twig/twig/lib/Twig/Filter/Method.php:23
    • > PHP Fatal error
      Uncaught Error: Class 'Dnolbon\\AffiliateImporter\\AffiliateImporterAbstract' not found in wp-content/plugins/affiliateimporteren/src/Dnolbon/AffiliateImporterEnvato/AffiliateImporterEnvato.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'Twig_Node_Expression_Binary' not found in wp-content/plugins/affiliateimporteren/vendor/twig/twig/lib/Twig/Node/Expression/Binary/Or.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'Twig_TokenParser' not found in wp-content/plugins/affiliateimporteren/vendor/twig/twig/lib/Twig/TokenParser/Import.php:21
    • > PHP Fatal error
      Uncaught Error: Class 'Dnolbon\\Wordpress\\Ajax\\AjaxAbstract' not found in wp-content/plugins/affiliateimporteren/src/Dnolbon/AffiliateImporter/Ajax/ProductLoadDetails.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'Twig_Test_NodeTestCase' not found in wp-content/plugins/affiliateimporteren/vendor/twig/twig/test/Twig/Tests/Node/Expression/Binary/MulTest.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'Twig_Node' not found in wp-content/plugins/affiliateimporteren/vendor/twig/twig/lib/Twig/Profiler/Node/EnterProfile.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'Twig_Node' not found in wp-content/plugins/affiliateimporteren/vendor/twig/twig/lib/Twig/Node/Set.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/affiliateimporteren/vendor/twig/twig/test/Twig/Tests/TokenStreamTest.php:12

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Please fix the following user-side errors
    • > GET request to /wp-admin/admin.php?page=endn-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=endn-support:248:87)\n at HTMLDocument.\u003Canonymous> (/wp-admin/admin.php?page=endn-support:238: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=endn-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 90% from 29 tests

readme.txt 88% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
These attributes need to be fixed:
  • Screenshots: 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)
  • Tags: Please reduce the number of tags, currently 11 tag instead of maximum 10
The official readme.txt is a good inspiration

affiliateimporteren/AffiliateImporterEn.php 92% from 13 tests

Analyzing the main PHP file in "AffiliateImporterEn" version 1.0
Please make the necessary changes and fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("affiliateimporteren.php" instead of "AffiliateImporterEn.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
No dangerous file extensions were detected42,069 lines of code in 536 files:
LanguageFilesBlank linesComment linesLines of code
PHP3825,1348,07123,910
CSS7858214,841
JSON12003,925
reStructuredText892,3872,1113,349
JavaScript6320562,400
HTML2311801,378
SVG2001,301
C1172184859
YAML18135
XML24031
C/C++ Header171315
Twig86014
Markdown1306
m41215

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.31
Average class complexity6.71
▷ Minimum class complexity1.00
▷ Maximum class complexity147.00
Average method complexity2.27
▷ Minimum method complexity1.00
▷ Maximum method complexity91.00
Code structure
Namespaces29
Interfaces31
Traits0
Classes378
▷ Abstract classes287.41%
▷ Concrete classes35092.59%
▷ Final classes41.14%
Methods1,949
▷ Static methods552.82%
▷ Public methods1,70887.63%
▷ Protected methods20410.47%
▷ Private methods371.90%
Functions66
▷ Named functions5989.39%
▷ Anonymous functions710.61%
Constants50
▷ Global constants24.00%
▷ Class constants4896.00%
▷ Public constants48100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
27 PNG files occupy 0.84MB with 0.40MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/img/logo.png15.83KB0.73KB▼ 95.42%
assets/img/toolbar/settings.png2.51KB2.00KB▼ 20.14%
assets/img/toolbar/stat_active.png1.93KB1.37KB▼ 28.65%
assets/img/toolbar/backup.png2.75KB2.19KB▼ 20.50%
assets/screenshots/Dashboard.png239.08KB66.30KB▼ 72.27%