Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CRM-21639 NOINDEX on print preview pages #11498

Merged

Conversation

magnolia61
Copy link
Contributor

@magnolia61 magnolia61 commented Jan 9, 2018

Overview

CiviCRM Print Preview pages should not be indexed by search engines

Before

Print preview pages (snippets) are indexed by google and cause confusion and possible worse than possible rankings.

After

Print Preview pages do not get indexed by compliant search engines

Technical Details

The PR adds META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW" to the head of the Print Preview

Comments

This patch will not remove old print preview pages from google, but a legitimate site owner can remove them using the Google Search Console. With the NOINDEX tag in place they will not be re-indexed.


@seamuslee001
Copy link
Contributor

Jenkins re test this please

@mlutfy
Copy link
Member

mlutfy commented Jan 10, 2018

jenkins, test this please

@JoeMurray
Copy link
Contributor

JoeMurray commented Jan 10, 2018

This looks fairly safe at one level, but print.tpl and PRINT_PAGE are deep in our core files:

./CRM/Core/Selector/Controller.php: $content = self::$_template->fetch('CRM/common/print.tpl');

./CRM/Core/Controller.php: return 'CRM/common/print.tpl';

./CRM/Core/Smarty.php: // use print.tpl and bypass the CMS. Civi prints a valid html file

./CRM/Core/Page.php: $content = self::$_template->fetch('CRM/common/print.tpl');

./templates/CRM/Admin/Page/APIExplorer.tpl: <% if(join.children) print(tpl({joins: join.children, tpl: tpl})); %>

./templates/CRM/common/snippet.tpl: {include file="CRM/common/print.tpl"}

./CRM/Contact/Page/View/Print.php: $this->_print = CRM_Core_Smarty::PRINT_PAGE;

./CRM/Core/Controller.php: if ($this->_print == CRM_Core_Smarty::PRINT_PAGE) {

./CRM/Core/Smarty.php: PRINT_PAGE = 1,

So I'd just want to make sure that the testing on this is well thought through to ensure no quiet but troublesome use cases are missed.

@colemanw
Copy link
Member

To my eye this looks safe & straightforward. I'm not sure what potential issues could arise from this that we should test for @JoeMurray - did you have anything in mind?

@magnolia61
Copy link
Contributor Author

@colemanw is there anything we need to check or do to get this merged?
When I look at the list of @JoeMurray I cannot relate that to specific pages to check
It is only inserted in the print preview modus where also the print.css is loaded.

@colemanw colemanw merged commit 30bf2b2 into civicrm:master Feb 14, 2018
@colemanw
Copy link
Member

I can't think of any reason this wouldn't be safe.

@mlutfy mlutfy changed the title CRM-21639_NOINDEX_Print_preview_pages CRM-21639 NOINDEX on print preview pages Mar 6, 2018
@mlutfy mlutfy added this to the 4.7.32 milestone Mar 6, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants