Bidd

Nevermind, I was conflating namespaces and autoloading

Bidd

I’m hoping it’s something I’m not getting as opposed to SS being “helpful”

Bidd

Anyone use namespaced functions? I’m specifically talking about namespacing functions, not classes. I can’t get it to work, I keep getting “undefined function”. I have a file Schema.php with the namespace App\Schema and a bunch of functions inside. App resolves to app/src and Schema.php lives in there. Normally the trailing part of a namespace is the class but in this case I don’t have one, so I assume it’s just the filename. Any idea?

Bidd

I’ve never seen that documented anywhere?! Doesn’t even come up in the search on the SS online doco. Does the job though, thanks @andante

(1)
Bidd

What’s the deal with outputting JSON into a template? At the mo I’ve got a function returning a regular json_encode of an associative array, and displaying it with the .JS escape method in the template, but it’s escaping the quotes for instance {\"Tim\":\"Sucks\"}

Bidd

Anyone have issues with the embed feature of the WYSIWYG returning “invalid URL … (status code 429)” for YouTube videos?

jkersu

I think I ran into a similar issue earlier. Do you have a lot of Youtube videos embedded on that page?

jkersu

I found if you have too many, that error will occur. I think its because it uses oembed and its sending too many requests to Youtube on the same page. Youtube has a request limit

As a workaround I used the script editor in the HTMLEdtorField instead and just added the Youtube videos as iframes, instead of directly using the embed button

Bidd

Yes, we do have a heap of YouTube videos

Bidd

.. so any idea why iframe works? they’re both making requests from the same IP and/or domain I would have thought…

jkersu

Its probably th oembed feature making the request.. I dont think iFrame would make request

klemen

Yeah I just had this happen on a large site that got a lot of requests at once. 2 embeds on a blog and it broke everywhere.

Bidd

So it must be oembed making the call, right? Changing them to iframe fixed my issue


Show less replies
Bidd

Or is Chrome’s Lighthouse audit the be-all-to-end-all

Bidd

Any suggestions on good tools for testing website perf and metrics?