WordPress.org

Plugin Directory

#1681 closed defect (fixed)

Use of PHP short tags

Reported by: JoshuaGoodwin Owned by:
Priority: high Severity: trivial
Plugin: not-listed Keywords: has-patch
Cc: onetarek, Asif2BD

Description

twitter-cards-meta uses (just once) <? instead of <?php. On servers where the short format hasn't been enabled (which is many), this causes something like this to be outputted (incorrectly) to wp-head(), for example:

<!-- Twitter Cards Meta By WPDeveloper.net -->
<meta name="twitter:card" value="summary"/>
<meta name="twitter:site" value="@MartinBelam" />
<meta name="twitter:creator" value="@MartinBelam" />
<meta name="twitter:url" value="http://martinbelam.com/2013/in-soviet-russia-webkit-forks-you/"/>
<meta name="twitter:title" value="In Soviet Russia, WebKit forks you"/>
<meta name="twitter:description" value="Try as I might, I just can’t get myself vexed about Google’s latest move in the new incarnation of the browser wars. Last night, just as I was going to bed, the web was in a frenzy about Google’s [...]"/>
<meta name="twitter:image" value="http://martinbelam.com/wp-content/uploads/2013/02/martin_belam_144x144.png" />
<!-- Twitter Cards Meta By WPDeveloper.net -->

		<?
      
    }
	elseif(is_home()) # elseif of if(is_single() || is_page())
	{
	
	?>

<!-- Twitter Cards Meta By WPDeveloper.net -->
<meta name="twitter:card" value="summary"/>
<meta name="twitter:site" value="@MartinBelam" />
<meta name="twitter:creator" value="@MartinBelam" />
<meta name="twitter:url" value="http://martinbelam.com"/>
<meta name="twitter:title" value="Martin Belam"/>
<meta name="twitter:description" value="Martin Belam’s blog about digital design, media and journalism."/>
<meta name="twitter:image" value="http://martinbelam.com/wp-content/uploads/2013/02/martin_belam_144x144.png" />
<!-- Twitter Cards Meta By WPDeveloper.net -->

Simply changing one line solves the problem.

Attachments (1)

twitter-cards-meta.php.patch (427 bytes) - added by JoshuaGoodwin 13 months ago.
Patch

Download all attachments as: .zip

Change History (2)

comment:1 onetarek13 months ago

  • Resolution set to fixed
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.