Skip to content
This repository was archived by the owner on Dec 2, 2022. It is now read-only.

Theme Options CSS and JS file URL issue when embedded in a theme #151

Open
bryanpaulmiller opened this issue Aug 28, 2020 · 7 comments
Open

Comments

@bryanpaulmiller
Copy link

bryanpaulmiller commented Aug 28, 2020

I embed Redux Framework 4.1.17 in a theme. When I visit the Theme Options page the file URLs to CSS and JS assets are incorrect. They include extra path information instead of only the URL of my website theme.

Is there something I'm doing wrong that could cause this issue? Or, is the free version not able to be embedded in a theme?

Support Hash

Unable to follow link to the support hash page. Link has expired.

Steps to reproduce

Embed Redux Framework 4.1.17 in a theme.
Do not install Redux Framework as a plugin.
Then visit the Theme Options page.

Expected Behavior

I expect the file URLs to CSS and JS to point to my theme folder.

For example: https://domain.com/wp-content/themes/sample-theme/redux-framework/redux-core/inc/fields/slides/redux-slides.css?ver=4.1.16.1598631244

Actual Behavior

The file URLs to CSS and JS assets are incorrect. They include extra path information instead of only the URL of my website theme.

For example: https://domain.com/wp-content/plugins/var/www/vhosts/domain.com/httpdocs/wp-content/themes/sample-theme/redux-framework/redux-core/inc/fields/slides/redux-slides.css?ver=4.1.16.1598631244

Any Error Details (PHP/JavaScript)

Refused to apply style from 'https://domain.com/wp-content/plugins/var/www/vhosts/domain.com/httpdocs/wp-content/themes/sample-theme/redux-framework/redux-core/assets/css/colors/fresh/colors.css?ver=4.1.17.1598636630' because its MIME type ('text/html') is not a supported stylesheet MIME type, and strict MIME checking is enabled.

@kmob2
Copy link

kmob2 commented Oct 7, 2020

I second this. Redux Framework 4 in its current state cannot be integrated into a theme.
I had redux 3.x directly integrated into my theme for years. Now I upgraded to redux framework 4 and I get the same issues. All css and js files use the wrong path. They use the absolute server path to the files instead of the the theme directory.

Chrome console shows 38 error messages for not being able to include the .js and .css files

It tries to load
https://example.com/wp-content/plugins/srv/users/example-site/public_html/wp-content/themes/mytheme/redux-framework-4/redux-core/inc/fields/switch/redux-switch.min.js?ver=4.1.21

Instead of
https://example.com/wp-content/plugins/themes/mytheme/redux-framework-4/redux-core/inc/fields/switch/redux-switch.min.js?ver=4.1.21

@lacoste-sochi
Copy link

image

Request URL: https://grace-calipso.ru/wp-content/plugins/var/www/grace-calipso.ru/wp-content/themes/Grace%20Group/redux-framework-4/redux-core/assets/js/vendor/qtip/qtip.min.js?ver=2.2.0

The situation is the same ...

I understand it needs to be finalized - Redux_Core::$url

Everything worked fine on OPENSERVER , but doesn't work on linux ubuntu server =(

Help

@clstech
Copy link

clstech commented Dec 21, 2020

I also encountered this problem, and it was very troublesome. I used xampp to build it locally, but it was the same when using bt.cn to deploy on CentOS8.0. The resource file path was wrong.

@dovy
Copy link
Contributor

dovy commented Dec 21, 2020

I'm working on it. Trying to root out the cause. For now use TGM to install the plugin. :)

@STV11C
Copy link

STV11C commented Jan 14, 2021

Hey all, I also just tried now to embed the latest plugin version redux-core folder into my theme. I am getting a similar error but slightly diff. See attached image.

Capture

@udarts
Copy link

udarts commented Feb 13, 2021

I did some digging and found the following line:

self::$url       = trailingslashit( dirname( $theme_info['url'] ) );

That is in the class-redux-core.php file.

I tested with:

print_r($theme_info['url']);    /// {my-theme/inc/admin/redux-core/}
self::$url       = trailingslashit( dirname( $theme_info['url'] ) );
print_r(self::$url);     //// {my-theme/inc/admin/}

And it seems the dirname is somehow removing the last part of the url (at least for me), as I added the redux-core folder in the {my-theme/inc/admin/}, so it becomes {my-theme/inc/admin/redux-core/}.

@shamloo
Copy link

shamloo commented Sep 22, 2021

to fix just add another dir to your core folder
e.g if your current Redux dir be:
/lib/
make it:
/lib/sub/

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants