YOOtheme Pro is here! The best WordPress and Joomla theme. Learn more

Avatar giacomo.bruzzo asked

Widgetkit 2.9.11 caches duplicates of uikit.js and other components - major issue

Dear All

Setup : Wordpress 4.8.1 / Bento_WP 1.0.7 / Warp 7.3.34

Premise : we have recently been working on trying to resolve an issue with offcanvas (see https://yootheme.com/support/question/114604).
solution required modification of uikit.js.

We are aware that it is not possible to stop Widgetkit from loading its own uikit (as part of a larger cached file located in

wp-content/plugins/widgetkit/cache

We therefore stopped the main theme from loading uikit.js and proceeded to upload the modified uikit.min.js to the following plugin directories

wp-content/plugins/widgetkit/vendor/assets/uikit/js
wp-content/plugins/widgetkit/vendor/assets/wkuikit/js
wp-content/plugins/widgetkit/vendor/yootheme/framework/assets/uikit/js

(we are not quite sure which folder Widgetkit uses to create the cache, so we uploaded to all three. We believe it is the first)

We noticed though, that the cached file built by Widgetkit is actually contains a lot of redundant copies of the components.

See this snapshot of multiple copies being loaded

Questions:

  • how can we remove the redundancies? the main issue is having 2 x copies of the main uikit.js included - this causes our modification to fail

  • where can we find the code responsible for the cache creation?

  • We have tried several options:
    a. changing RegisterAssets as suggested in the following thread https://yootheme.com/support/question/87820 - No success
    b. removing the line $app['scripts']->register('uikit', $path.'/uikit.min.js'); from /wp-content/plugins/widgetkit/vendor/yootheme/framework/plugins/uikit/plugin.php - this results in the redundant copy of uikit.js not being included in the cached uikit2 file - partial success.

Please help us understand the cache creation process and what switches can be manipulated to better control it.

Thank you in advance

Giacomo Bruzzo

  • WordPress
  • Widgetkit
  • UIkit

Edited

1 Answer

0

Avatar giacomo.bruzzo answered

Ok, no need to answer, I found what I was looking for

The two copies of uikit.min.js are loaded by, respectively:

  • wp-content/plugins/widgetkit/src/Application.php
    and
  • wp-content/plugins/widgetkit/vendor/yootheme/framework/plugins/uikit/plugin.php

  • all the component js are loaded by their respective plugin.php file

the cache files are assembled in

  • wp-content/plugins/widgetkit/src/Application.php

We can thus control what js gets loaded by Widgetkit, but it is not very nice at all. A lot of redundancy. a lot of weight. Not very pleasant.

I hope devs might want to provide a set of on/off switches for the admin settings panel of Uikit2 so as to allow users to selectively decide what widgets and js to load (or not).

Giacomo Bruzzo

Edited

Know someone who can answer? Share a link to this question via email or twitter.