ThemeFuse / Unyson

A WordPress framework that facilitates the development of WP themes
http://unyson.io
923 stars 219 forks source link

WP Customizer options disappeared #4288

Closed PioPas closed 1 year ago

PioPas commented 1 year ago

I have just noticed there are not visible WP Customizer options. I have found also an error in console log.

image

PioPas commented 1 year ago

I have found this topic (https://github.com/ThemeFuse/Unyson/issues/4261#issuecomment-1228820888). I did what is described. When I deleted the value in DB I have got this error. I refreshed page a few times and the option in DB is not updated.

image image

PioPas commented 1 year ago

Ok, so there is an error in api used in general.php - it doesn't get the API result. So temporally I replace the $body with the string from bkp. So it is "refreshing" database value but the value is hardcoded not get from the API. It works for me but it is not a solution. Hope API will be fixed soon.

IamOri commented 1 year ago

You can try load them directly from google api. https://developers.google.com/fonts/docs/developer_api Unyson api is just cache without token authenitication.

PioPas commented 1 year ago

You can try load them directly from google api. https://developers.google.com/fonts/docs/developer_api Unyson api is just cache without token authenitication.

Thanks. It worked for me as a hardcoded string in php now but I have a felling I am not the only user who faced this issue with Unyson API. There is still "Error : Failed to get Google Fonts".

The question is if there is Unyson API error in general or something wrong with my WP?

I am asking about it: $response = wp_remote_get( apply_filters( 'fw_googleapis_webfonts_url', 'https://google-webfonts-cache.unyson.io/v1/webfonts' ) );

IamOri commented 1 year ago

When i open that link i can see correct json, so thats probably ok. I also tried to reload it by removing font data from db on my site, and that works fine too. You can try to call api in separate script with curl (your.site/api-test.php), to see if your server get response from api. If you get valid response, then problem is probably somewhere in your wp. Maybe you could try load it with that wp_remote_get function in some of the functions.php file and see what it returns.

PioPas commented 1 year ago

When i open that link i can see correct json, so thats probably ok. I also tried to reload it by removing font data from db on my site, and that works fine too. You can try to call api in separate script with curl (your.site/api-test.php), to see if your server get response from api. If you get valid response, then problem is probably somewhere in your wp. Maybe you could try load it with that wp_remote_get function in some of the functions.php file and see what it returns.

Thanks a lot!

I have checked and it worked like that

$response = wp_remote_get( 'https://google-webfonts-cache.unyson.io/v1/webfonts' );
$body     = wp_remote_retrieve_body( $response );

but by design is like that and I haven't change it. No idea why but I will keep digging...

$response = wp_remote_get( apply_filters( 'fw_googleapis_webfonts_url',
            'https://google-webfonts-cache.unyson.io/v1/webfonts' ) );
PioPas commented 1 year ago

Ok, I have found a reason. It is in my template extra filter which redirect to the different url.