10% affiliateimporterbg

Code Review | AffiliateImporterBg

WordPress plugin AffiliateImporterBg scored 10% from 54 tests.

About plugin

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

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 1,864 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Please fix the following installer errors
  • Install procedure had errors
    • > Warning in wp-content/plugins/affiliateimporterbg/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: ▼180.58ms] Passed 4 tests

Server-side resources used by AffiliateImporterBg
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.22 ▲0.3940.93 ▲2.66
Dashboard /wp-admin2.48 ▼0.5812.30 ▼29.38
Posts /wp-admin/edit.php2.48 ▼0.6313.01 ▼34.80
Add New Post /wp-admin/post-new.php2.48 ▼2.9616.75 ▼635.47
Media Library /wp-admin/upload.php2.48 ▼0.5312.03 ▼22.67
Backup / Restore /wp-admin/admin.php?page=bgdn-backup2.4814.26
Statistics /wp-admin/admin.php?page=bgdn-stats2.4810.97
Add product /wp-admin/admin.php?page=bgdn-add2.4816.83
Support /wp-admin/admin.php?page=bgdn-support2.4814.82
Shedule /wp-admin/admin.php?page=bgdn-schedule2.4813.90
Status /wp-admin/admin.php?page=bgdn-status2.4812.28
AffImporterBg /wp-admin/admin.php?page=bgdn2.4812.83
Settings /wp-admin/admin.php?page=bgdn-settings2.4823.16

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

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 865 new files
Database: 6 new tables, 1 new option
New tables
wp_bgdn_goods_archive
wp_bgdn_price_formula
wp_bgdn_stats
wp_bgdn_goods
wp_bgdn_blacklist
wp_bgdn_account
New WordPress options
recovery_mode_email_last_sent

Browser metrics Passed 4 tests

An overview of browser requirements for AffiliateImporterBg
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,806 ▲21116.84 ▲0.8710.94 ▲1.9647.52 ▼1.67
Dashboard /wp-admin3,072 ▲1447.15 ▲1.16151.74 ▼1.65135.68 ▲26.99
Posts /wp-admin/edit.php2,842 ▲1032.84 ▲0.1477.80 ▲17.24124.83 ▲40.56
Add New Post /wp-admin/post-new.php1,972 ▲35715.71 ▼5.82423.78 ▲127.02108.16 ▲0.08
Media Library /wp-admin/upload.php1,860 ▲535.53 ▲0.47143.81 ▼3.52138.78 ▲16.31
Backup / Restore /wp-admin/admin.php?page=bgdn-backup1,5272.8657.70109.47
Statistics /wp-admin/admin.php?page=bgdn-stats1,5642.8664.9895.99
Add product /wp-admin/admin.php?page=bgdn-add1,1022.2536.4856.14
Support /wp-admin/admin.php?page=bgdn-support1,2862.6755.7385.42
Shedule /wp-admin/admin.php?page=bgdn-schedule1,5462.8664.74103.09
Status /wp-admin/admin.php?page=bgdn-status1,2982.3146.5891.46
AffImporterBg /wp-admin/admin.php?page=bgdn1,5082.6964.02122.70
Settings /wp-admin/admin.php?page=bgdn-settings2,4592.9076.06125.83

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
Please fix the following items
  • This plugin cannot be uninstalled
    • > Warning in wp-content/plugins/affiliateimporterbg/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 1 option in the database
    • recovery_mode_email_last_sent

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
Please fix the following server-side errors
  • 9 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=bgdn-settings
    • > Warning in wp-content/plugins/affiliateimporterbg/src/Dnolbon/AffiliateImporter/AffiliateImporterAbstract.php+548
    file_get_contents(): php_network_getaddresses: getaddrinfo failed: Name or service not known
  • 9 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=bgdn-settings
    • > Warning in wp-content/plugins/affiliateimporterbg/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=bgdn-settings
    • > Deprecated in wp-content/plugins/affiliateimporterbg/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)`
    • > GET request to /wp-admin/admin.php?page=bgdn-status
    • > Error in wp-content/plugins/affiliateimporterbg/layout/status.php+58
    Uncaught Error: Call to undefined function woocommerce_let_to_num() in wp-content/plugins/affiliateimporterbg/layout/status.php:58
    Stack trace:
    #0 wp-content/plugins/affiliateimporterbg/src/Dnolbon/AffiliateImporter/Pages/Status.php(16): include()
    #1 wp-includes/class-wp-hook.php(303): Dnolbon\AffiliateImporter\Pages\Status->render()
    #2 wp-includes/class-wp-hook.php(327): WP_Hook->apply_filters()
    #3 wp-includes/plugin.php(470): 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=bgdn-settings
    • > Notice in wp-content/plugins/affiliateimporterbg/src/Dnolbon/WooCommerce/Categories/Categories.php+18
    Undefined index: parent

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 items
  • 293× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Twig_Node_Expression_Binary' not found in wp-content/plugins/affiliateimporterbg/vendor/twig/twig/lib/Twig/Node/Expression/Binary/And.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'Twig_Node_Expression_Binary' not found in wp-content/plugins/affiliateimporterbg/vendor/twig/twig/lib/Twig/Node/Expression/Binary/Power.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'Twig_Error' not found in wp-content/plugins/affiliateimporterbg/vendor/twig/twig/lib/Twig/Error/Loader.php:25
    • > PHP Fatal error
      Uncaught Error: Class 'Twig_Node_Expression_Call' not found in wp-content/plugins/affiliateimporterbg/vendor/twig/twig/lib/Twig/Node/Expression/Filter.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'Twig_Node_Expression_Test' not found in wp-content/plugins/affiliateimporterbg/vendor/twig/twig/lib/Twig/Node/Expression/Test/Sameas.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'Twig_Test_NodeTestCase' not found in wp-content/plugins/affiliateimporterbg/vendor/twig/twig/test/Twig/Tests/Node/ImportTest.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'Twig_Extension' not found in wp-content/plugins/affiliateimporterbg/vendor/twig/twig/lib/Twig/Extension/Staging.php:21
    • > PHP Fatal error
      Uncaught Error: Class 'Dnolbon\\AffiliateImporter\\Configurator\\ConfiguratorAbstract' not found in wp-content/plugins/affiliateimporterbg/src/Dnolbon/AffiliateImporterEbay/AffiliateImporterEbayConfigurator.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/affiliateimporterbg/vendor/twig/twig/test/Twig/Tests/CustomExtensionTest.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'Twig_TokenParser' not found in wp-content/plugins/affiliateimporterbg/vendor/twig/twig/lib/Twig/TokenParser/Block.php:25

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Please take a look at the following user-side issues
    • > GET request to /wp-admin/admin.php?page=bgdn-support
    • > Console-api (warning) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=5.8.1 1:31592 "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=bgdn-support:248:87)\n at HTMLDocument.\u003Canonymous> (/wp-admin/admin.php?page=bgdn-support:238:9)\n at e (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=5.8.1:2:30038)\n at t (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=5.8.1:2:30340)" undefined
    • > GET request to /wp-admin/admin.php?page=bgdn-support
    • > Javascript (severe) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=5.8.1 1:31702 Uncaught TypeError: Cannot read properties of undefined (reading 'replace')

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% 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:
  • Screenshots: These screenshots do not have images: #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: You are using too many tags: 11 tag instead of maximum 10
Please take inspiration from this readme.txt

affiliateimporterbg/AffiliateImporterBg.php 92% from 13 tests

The entry point to "AffiliateImporterBg" version 1.0 is a PHP file that has certain tags in its header comment area
The following require your attention:
  • Main file name: Name the main plugin file the same as the plugin slug ("affiliateimporterbg.php" instead of "AffiliateImporterBg.php")

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 detected42,065 lines of code in 536 files:
LanguageFilesBlank linesComment linesLines of code
PHP3825,1348,07123,906
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

This is a short overview of cyclomatic complexity and code structure for this plugin
This plugin has no cyclomatic complexity issues
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

Often times overlooked, PNG files can occupy unnecessary space in your plugin
27 PNG files occupy 0.84MB with 0.50MB 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/screenshots/AddProduct.png260.55KB71.71KB▼ 72.48%
assets/screenshots/Dashboard.png239.08KB66.30KB▼ 72.27%
assets/img/toolbar/dashboard.png1.69KB1.17KB▼ 30.92%
assets/img/toolbar/status_active.png2.31KB1.73KB▼ 25.18%