By Diederik van der Eems on Friday, 29 June 2018
Posted in General Issues
Replies 5
Likes 0
Views 1K
Votes 0
Hi There,

I see Google search console recently started complaining about Javascript on AMP pages. After looking at the output I found that the Javascript is added by the Email Cloaking plugin on Joomla. To fix the issue I disabled the plugin on the affected pages by adding the text {emailcloak=off} at the start of the article, but this means the Joomla will stop cloaking the email addresses on all versions of the article.
Is it perhaps possible to modify a file somewhere in order to get EasyBlog to add the keyword {emailcloak=off} only to AMP versions article?

Thanks for assisting
Hey Diederik,

Hm, where did you enter the codes? Is this added into the article of Joomla?
·
Friday, 29 June 2018 20:55
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi Mark,

I added it at the start of the blog article. If you want an example article you can search for "home visits" in the posts in the back-end, and then you will see I added the keyword "{emailcloak=off}" at the start of the article. If you open the post on the front-end you won't see the keyword, seeing that it is removed by the Joomla plugin.
·
Friday, 29 June 2018 21:40
·
0 Likes
·
0 Votes
·
0 Comments
·
Hey Diederik,

Hm, I think you could try a simple hack in the email cloaking plugin as that would be ideal because I could see the same problem arising if you are generating rss feeds (perhaps rss feeds aren't as strict as AMP) but what you could do is to edit the file /plugins/content/emailcloak/emailcloak.php and at line 97 locate the codes below:

[gist]
protected function _cloak(&$text, &$params)
{
[/gist]

Replace it with,

[gist]
protected function _cloak(&$text, &$params)
{
$doc = JFactory::getDocument();

if ($doc->getType() != 'html') {
return;
}
[/gist]

Alternatively, if you do not want to apply the hacks on the emailcloak plugin, edit the file /administrator/components/com_easyblog/includes/post/post.php and at line 4919, locate the codes below,

[gist]
// Trigger plugins to prepare the content.
$this->prepareContent('list', 'content');
[/gist]

Replace it with,

[gist]
$this->text = '{emailcloak=off}' . $this->text;

// Trigger plugins to prepare the content.
$this->prepareContent('list', 'content');
[/gist]
·
Friday, 29 June 2018 22:51
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi Mark,

Thanks. Will try your suggestions.
·
Monday, 02 July 2018 23:51
·
0 Likes
·
0 Votes
·
0 Comments
·
No problem Diederik
·
Monday, 02 July 2018 23:57
·
0 Likes
·
0 Votes
·
0 Comments
·
View Full Post