Any clever #PHP developers know the cause of this #JetPack warning with #WordPress?
I can't find anything in my code or other plugins which would cause that const to be redefined.
Any clever #PHP developers know the cause of this #JetPack warning with #WordPress?
I can't find anything in my code or other plugins which would cause that const to be redefined.
@Edent LOL, according to Google, you're not the only one with this issue: https://www.google.com/search?q=Constant+automattic%5Cjetpack%5Cextensions%5Csocial_previews%5CFEATURE_NAME+already+defined&rlz=1C5CHFA_enDE1097DE1098&oq=Constant+automattic%5Cjetpack%5Cextensions%5Csocial_previews%5CFEATURE_NAME+already+defined&gs_lcrp=EgZjaHJvbWUyBggAEEUYOdIBBzE1MWowajeoAgCwAgA&sourceid=chrome&ie=UTF-8
From a first glance, it looks like the constant is redeclared somewhere. Can you "grep" the whole installation if something like "const FEATURE_NAME = 'social-previews';" appears multiple times?
@janole yup! And they all seem to get closed with no response!
Hmmm. Might be being redeclared. Will have a dig. Ta!
@Edent I think the important bit would be the namespace in the corresponding file!
So in the jetpack file, the namespace is:
namespace Automattic\Jetpack\Extensions\Social_Previews;
If you find multiple files with that namespace and "const FEATURE_NAME = ..." , I think that would be the problem.
@janole looks like there's only one.
` grep -r "Social_Previews" .`
Just returns the single file. Annoying, but nothing dreadful.
@Edent this sort of thing is usually due to the autoloader system. Basically, things are getting included that already should have been included because the autoloader is not up to snuff.
Autoloaders are surprisingly hard, basically. I would take a deep look at how it works and figure out what is breaking there.
On a side note, this is why WordPress itself does not use any form of autoloader. Some say this makes it slower, I happen to disagree.