Secure Custom Fields no longer works well with CP

I’ve tested the latest SCF 6.8.0 on CP 2.6.0, and it’s giving Uncaught ReferenceError: acf is not defined error causing issues in field and post creation/editing.

Tested previous versions of the plugin, and only version 6.4.2 works without issues. So, I believe it’s no longer compatible with ClassicPress.

Tested previous versions of the plugin, and only version 6.4.2 works without issues.

The next version (6.5.0) is a major update and adds quite a few “Enhancements & Features” as they call it. We can compare all changes to find the cause, but this may take some time. And than maybe CP core can be changed, so SCF will work again.

Personally I prefer the original (ACF). Besides a layout related thing, the plugin still seems to work properly.

Found out it’s caused by this function to print scripts in the footer and this piece of code, both in file secure-custom-fields\includes\assets.php. The piece of code is part of a function that was updated a lot.

I don’t have enough knowledge to explain what is happening here. And don’t know if we can add something to CP core to make it work again. Maybe someone else can take a look?

1 Like

Thanks for the details.

My hunch is that scripts (like JS files) should not go in footer but just before the </body> tag when they do not need to be placed in header.
However my brain might be fried, it’s just something I think I recall from my HTML days…

1 Like

It’s printing scripts before the admin footer, which is essentially before the end of the HTML <body> tag. It might be possible to stop them from being printed (e.g. by using an output buffer) but that will presumably prevent some other functionality from working. Even if it doesn’t, they could do the same with another script, and we’ll be endlessly chasing our tails. Probably better to get someone to fork the plugin for CP.

3 Likes

As long as the original ACF - not the stolen copy fork by Automattic - still works, I’m fine. And so far, it does (latest nightly).

cu, w0lf.

2 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.