| @@ -31,67 +31,67 @@ | ||
| 31 | 31 | */ | 
| 32 | 32 | class ReCaptcha | 
| 33 | 33 |  { | 
| 34 | - /** | |
| 35 | - * Version of this client library. | |
| 36 | - * @const string | |
| 37 | - */ | |
| 38 | - const VERSION = 'php_1.1.1'; | |
| 34 | + /** | |
| 35 | + * Version of this client library. | |
| 36 | + * @const string | |
| 37 | + */ | |
| 38 | + const VERSION = 'php_1.1.1'; | |
| 39 | 39 | |
| 40 | - /** | |
| 41 | - * Shared secret for the site. | |
| 42 | - * @var type string | |
| 43 | - */ | |
| 44 | - private $secret; | |
| 40 | + /** | |
| 41 | + * Shared secret for the site. | |
| 42 | + * @var type string | |
| 43 | + */ | |
| 44 | + private $secret; | |
| 45 | 45 | |
| 46 | - /** | |
| 47 | - * Method used to communicate with service. Defaults to POST request. | |
| 48 | - * @var RequestMethod | |
| 49 | - */ | |
| 50 | - private $requestMethod; | |
| 46 | + /** | |
| 47 | + * Method used to communicate with service. Defaults to POST request. | |
| 48 | + * @var RequestMethod | |
| 49 | + */ | |
| 50 | + private $requestMethod; | |
| 51 | 51 | |
| 52 | - /** | |
| 53 | - * Create a configured instance to use the reCAPTCHA service. | |
| 54 | - * | |
| 55 | - * @param string $secret shared secret between site and reCAPTCHA server. | |
| 56 | - * @param RequestMethod $requestMethod method used to send the request. Defaults to POST. | |
| 57 | - */ | |
| 58 | - public function __construct($secret, RequestMethod $requestMethod = null) | |
| 59 | -    { | |
| 60 | -        if (empty($secret)) { | |
| 61 | -            throw new \RuntimeException('No secret provided'); | |
| 62 | - } | |
| 52 | + /** | |
| 53 | + * Create a configured instance to use the reCAPTCHA service. | |
| 54 | + * | |
| 55 | + * @param string $secret shared secret between site and reCAPTCHA server. | |
| 56 | + * @param RequestMethod $requestMethod method used to send the request. Defaults to POST. | |
| 57 | + */ | |
| 58 | + public function __construct($secret, RequestMethod $requestMethod = null) | |
| 59 | +	{ | |
| 60 | +		if (empty($secret)) { | |
| 61 | +			throw new \RuntimeException('No secret provided'); | |
| 62 | + } | |
| 63 | 63 | |
| 64 | -        if (!is_string($secret)) { | |
| 65 | -            throw new \RuntimeException('The provided secret must be a string'); | |
| 66 | - } | |
| 64 | +		if (!is_string($secret)) { | |
| 65 | +			throw new \RuntimeException('The provided secret must be a string'); | |
| 66 | + } | |
| 67 | 67 | |
| 68 | - $this->secret = $secret; | |
| 68 | + $this->secret = $secret; | |
| 69 | 69 | |
| 70 | -        if (!is_null($requestMethod)) { | |
| 71 | - $this->requestMethod = $requestMethod; | |
| 72 | -        } else { | |
| 73 | - $this->requestMethod = new RequestMethod\Post(); | |
| 74 | - } | |
| 75 | - } | |
| 70 | +		if (!is_null($requestMethod)) { | |
| 71 | + $this->requestMethod = $requestMethod; | |
| 72 | +		} else { | |
| 73 | + $this->requestMethod = new RequestMethod\Post(); | |
| 74 | + } | |
| 75 | + } | |
| 76 | 76 | |
| 77 | - /** | |
| 78 | - * Calls the reCAPTCHA siteverify API to verify whether the user passes | |
| 79 | - * CAPTCHA test. | |
| 80 | - * | |
| 81 | - * @param string $response The value of 'g-recaptcha-response' in the submitted form. | |
| 82 | - * @param string $remoteIp The end user's IP address. | |
| 83 | - * @return Response Response from the service. | |
| 84 | - */ | |
| 85 | - public function verify($response, $remoteIp = null) | |
| 86 | -    { | |
| 87 | - // Discard empty solution submissions | |
| 88 | -        if (empty($response)) { | |
| 89 | -            $recaptchaResponse = new Response(false, array('missing-input-response')); | |
| 90 | - return $recaptchaResponse; | |
| 91 | - } | |
| 77 | + /** | |
| 78 | + * Calls the reCAPTCHA siteverify API to verify whether the user passes | |
| 79 | + * CAPTCHA test. | |
| 80 | + * | |
| 81 | + * @param string $response The value of 'g-recaptcha-response' in the submitted form. | |
| 82 | + * @param string $remoteIp The end user's IP address. | |
| 83 | + * @return Response Response from the service. | |
| 84 | + */ | |
| 85 | + public function verify($response, $remoteIp = null) | |
| 86 | +	{ | |
| 87 | + // Discard empty solution submissions | |
| 88 | +		if (empty($response)) { | |
| 89 | +			$recaptchaResponse = new Response(false, array('missing-input-response')); | |
| 90 | + return $recaptchaResponse; | |
| 91 | + } | |
| 92 | 92 | |
| 93 | - $params = new RequestParameters($this->secret, $response, $remoteIp, self::VERSION); | |
| 94 | - $rawResponse = $this->requestMethod->submit($params); | |
| 95 | - return Response::fromJson($rawResponse); | |
| 96 | - } | |
| 93 | + $params = new RequestParameters($this->secret, $response, $remoteIp, self::VERSION); | |
| 94 | + $rawResponse = $this->requestMethod->submit($params); | |
| 95 | + return Response::fromJson($rawResponse); | |
| 96 | + } | |
| 97 | 97 | } | 
| @@ -61,13 +61,13 @@ | ||
| 61 | 61 |              throw new \RuntimeException('No secret provided'); | 
| 62 | 62 | } | 
| 63 | 63 | |
| 64 | -        if (!is_string($secret)) { | |
| 64 | +        if ( ! is_string($secret)) { | |
| 65 | 65 |              throw new \RuntimeException('The provided secret must be a string'); | 
| 66 | 66 | } | 
| 67 | 67 | |
| 68 | 68 | $this->secret = $secret; | 
| 69 | 69 | |
| 70 | -        if (!is_null($requestMethod)) { | |
| 70 | +        if ( ! is_null($requestMethod)) { | |
| 71 | 71 | $this->requestMethod = $requestMethod; | 
| 72 | 72 |          } else { | 
| 73 | 73 | $this->requestMethod = new RequestMethod\Post(); | 
| @@ -10,38 +10,38 @@ | ||
| 10 | 10 | */ | 
| 11 | 11 | class Curl implements RequestMethod | 
| 12 | 12 |  { | 
| 13 | - /** | |
| 14 | - * URL to which requests are sent via cURL. | |
| 15 | - * @const string | |
| 16 | - */ | |
| 17 | - const SITE_VERIFY_URL = 'https://www.google.com/recaptcha/api/siteverify'; | |
| 13 | + /** | |
| 14 | + * URL to which requests are sent via cURL. | |
| 15 | + * @const string | |
| 16 | + */ | |
| 17 | + const SITE_VERIFY_URL = 'https://www.google.com/recaptcha/api/siteverify'; | |
| 18 | 18 | |
| 19 | - /** | |
| 20 | - * Submit the cURL request with the specified parameters. | |
| 21 | - * | |
| 22 | - * @param RequestParameters $params Request parameters | |
| 23 | - * @return string Body of the reCAPTCHA response | |
| 24 | - */ | |
| 25 | - public function submit(RequestParameters $params) | |
| 26 | -    { | |
| 27 | - $handle = curl_init(self::SITE_VERIFY_URL); | |
| 19 | + /** | |
| 20 | + * Submit the cURL request with the specified parameters. | |
| 21 | + * | |
| 22 | + * @param RequestParameters $params Request parameters | |
| 23 | + * @return string Body of the reCAPTCHA response | |
| 24 | + */ | |
| 25 | + public function submit(RequestParameters $params) | |
| 26 | +	{ | |
| 27 | + $handle = curl_init(self::SITE_VERIFY_URL); | |
| 28 | 28 | |
| 29 | - $options = array( | |
| 30 | - CURLOPT_POST => true, | |
| 31 | - CURLOPT_POSTFIELDS => $params->toQueryString(), | |
| 32 | - CURLOPT_HTTPHEADER => array( | |
| 33 | - 'Content-Type: application/x-www-form-urlencoded' | |
| 34 | - ), | |
| 35 | - CURLINFO_HEADER_OUT => false, | |
| 36 | - CURLOPT_HEADER => false, | |
| 37 | - CURLOPT_RETURNTRANSFER => true, | |
| 38 | - CURLOPT_SSL_VERIFYPEER => true | |
| 39 | - ); | |
| 40 | - curl_setopt_array($handle, $options); | |
| 29 | + $options = array( | |
| 30 | + CURLOPT_POST => true, | |
| 31 | + CURLOPT_POSTFIELDS => $params->toQueryString(), | |
| 32 | + CURLOPT_HTTPHEADER => array( | |
| 33 | + 'Content-Type: application/x-www-form-urlencoded' | |
| 34 | + ), | |
| 35 | + CURLINFO_HEADER_OUT => false, | |
| 36 | + CURLOPT_HEADER => false, | |
| 37 | + CURLOPT_RETURNTRANSFER => true, | |
| 38 | + CURLOPT_SSL_VERIFYPEER => true | |
| 39 | + ); | |
| 40 | + curl_setopt_array($handle, $options); | |
| 41 | 41 | |
| 42 | - $response = curl_exec($handle); | |
| 43 | - curl_close($handle); | |
| 42 | + $response = curl_exec($handle); | |
| 43 | + curl_close($handle); | |
| 44 | 44 | |
| 45 | - return $response; | |
| 46 | - } | |
| 45 | + return $response; | |
| 46 | + } | |
| 47 | 47 | } | 
| @@ -80,11 +80,11 @@ | ||
| 80 | 80 |      { | 
| 81 | 81 |          $params = array('secret' => $this->secret, 'response' => $this->response); | 
| 82 | 82 | |
| 83 | -        if (!is_null($this->remoteIp)) { | |
| 83 | +        if ( ! is_null($this->remoteIp)) { | |
| 84 | 84 | $params['remoteip'] = $this->remoteIp; | 
| 85 | 85 | } | 
| 86 | 86 | |
| 87 | -        if (!is_null($this->version)) { | |
| 87 | +        if ( ! is_null($this->version)) { | |
| 88 | 88 | $params['version'] = $this->version; | 
| 89 | 89 | } | 
| 90 | 90 | |
| @@ -31,73 +31,73 @@ | ||
| 31 | 31 | */ | 
| 32 | 32 | class RequestParameters | 
| 33 | 33 |  { | 
| 34 | - /** | |
| 35 | - * Site secret. | |
| 36 | - * @var string | |
| 37 | - */ | |
| 38 | - private $secret; | |
| 34 | + /** | |
| 35 | + * Site secret. | |
| 36 | + * @var string | |
| 37 | + */ | |
| 38 | + private $secret; | |
| 39 | 39 | |
| 40 | - /** | |
| 41 | - * Form response. | |
| 42 | - * @var string | |
| 43 | - */ | |
| 44 | - private $response; | |
| 40 | + /** | |
| 41 | + * Form response. | |
| 42 | + * @var string | |
| 43 | + */ | |
| 44 | + private $response; | |
| 45 | 45 | |
| 46 | - /** | |
| 47 | - * Remote user's IP address. | |
| 48 | - * @var string | |
| 49 | - */ | |
| 50 | - private $remoteIp; | |
| 46 | + /** | |
| 47 | + * Remote user's IP address. | |
| 48 | + * @var string | |
| 49 | + */ | |
| 50 | + private $remoteIp; | |
| 51 | 51 | |
| 52 | - /** | |
| 53 | - * Client version. | |
| 54 | - * @var string | |
| 55 | - */ | |
| 56 | - private $version; | |
| 52 | + /** | |
| 53 | + * Client version. | |
| 54 | + * @var string | |
| 55 | + */ | |
| 56 | + private $version; | |
| 57 | 57 | |
| 58 | - /** | |
| 59 | - * Initialise parameters. | |
| 60 | - * | |
| 61 | - * @param string $secret Site secret. | |
| 62 | - * @param string $response Value from g-captcha-response form field. | |
| 63 | - * @param string $remoteIp User's IP address. | |
| 64 | - * @param string $version Version of this client library. | |
| 65 | - */ | |
| 66 | - public function __construct($secret, $response, $remoteIp = null, $version = null) | |
| 67 | -    { | |
| 68 | - $this->secret = $secret; | |
| 69 | - $this->response = $response; | |
| 70 | - $this->remoteIp = $remoteIp; | |
| 71 | - $this->version = $version; | |
| 72 | - } | |
| 58 | + /** | |
| 59 | + * Initialise parameters. | |
| 60 | + * | |
| 61 | + * @param string $secret Site secret. | |
| 62 | + * @param string $response Value from g-captcha-response form field. | |
| 63 | + * @param string $remoteIp User's IP address. | |
| 64 | + * @param string $version Version of this client library. | |
| 65 | + */ | |
| 66 | + public function __construct($secret, $response, $remoteIp = null, $version = null) | |
| 67 | +	{ | |
| 68 | + $this->secret = $secret; | |
| 69 | + $this->response = $response; | |
| 70 | + $this->remoteIp = $remoteIp; | |
| 71 | + $this->version = $version; | |
| 72 | + } | |
| 73 | 73 | |
| 74 | - /** | |
| 75 | - * Array representation. | |
| 76 | - * | |
| 77 | - * @return array Array formatted parameters. | |
| 78 | - */ | |
| 79 | - public function toArray() | |
| 80 | -    { | |
| 81 | -        $params = array('secret' => $this->secret, 'response' => $this->response); | |
| 74 | + /** | |
| 75 | + * Array representation. | |
| 76 | + * | |
| 77 | + * @return array Array formatted parameters. | |
| 78 | + */ | |
| 79 | + public function toArray() | |
| 80 | +	{ | |
| 81 | +		$params = array('secret' => $this->secret, 'response' => $this->response); | |
| 82 | 82 | |
| 83 | -        if (!is_null($this->remoteIp)) { | |
| 84 | - $params['remoteip'] = $this->remoteIp; | |
| 85 | - } | |
| 83 | +		if (!is_null($this->remoteIp)) { | |
| 84 | + $params['remoteip'] = $this->remoteIp; | |
| 85 | + } | |
| 86 | 86 | |
| 87 | -        if (!is_null($this->version)) { | |
| 88 | - $params['version'] = $this->version; | |
| 89 | - } | |
| 87 | +		if (!is_null($this->version)) { | |
| 88 | + $params['version'] = $this->version; | |
| 89 | + } | |
| 90 | 90 | |
| 91 | - return $params; | |
| 92 | - } | |
| 91 | + return $params; | |
| 92 | + } | |
| 93 | 93 | |
| 94 | - /** | |
| 95 | - * Query string representation for HTTP request. | |
| 96 | - * | |
| 97 | - * @return string Query string formatted parameters. | |
| 98 | - */ | |
| 99 | - public function toQueryString() | |
| 100 | -    { | |
| 101 | - return http_build_query($this->toArray(), '', '&'); | |
| 102 | - } | |
| 94 | + /** | |
| 95 | + * Query string representation for HTTP request. | |
| 96 | + * | |
| 97 | + * @return string Query string formatted parameters. | |
| 98 | + */ | |
| 99 | + public function toQueryString() | |
| 100 | +	{ | |
| 101 | + return http_build_query($this->toArray(), '', '&'); | |
| 102 | + } | |
| 103 | 103 | } | 
| @@ -16,11 +16,11 @@ | ||
| 16 | 16 | |
| 17 | 17 | <section id="primary" class="content-area"> | 
| 18 | 18 | <div id="content" class="site-content" role="main"> | 
| 19 | - <?php espresso_get_template_part( 'loop', 'espresso_events' ); ?> | |
| 19 | +			<?php espresso_get_template_part('loop', 'espresso_events'); ?>			 | |
| 20 | 20 | </div><!-- #content --> | 
| 21 | 21 | </section><!-- #primary --> | 
| 22 | 22 | |
| 23 | 23 | <?php | 
| 24 | -get_sidebar( 'content' ); | |
| 24 | +get_sidebar('content'); | |
| 25 | 25 | get_sidebar(); | 
| 26 | 26 | get_footer(); | 
| @@ -18,11 +18,11 @@ | ||
| 18 | 18 | |
| 19 | 19 | <section id="primary" class="content-area"> | 
| 20 | 20 | <div id="content" class="site-content" role="main"> | 
| 21 | - <?php espresso_get_template_part( 'loop', 'espresso_venues' ); ?> | |
| 21 | +			<?php espresso_get_template_part('loop', 'espresso_venues'); ?>			 | |
| 22 | 22 | </div><!-- #content --> | 
| 23 | 23 | </section><!-- #primary --> | 
| 24 | 24 | |
| 25 | 25 | <?php | 
| 26 | -get_sidebar( 'content' ); | |
| 26 | +get_sidebar('content'); | |
| 27 | 27 | get_sidebar(); | 
| 28 | 28 | get_footer(); | 
| 29 | 29 | \ No newline at end of file | 
| @@ -11,14 +11,14 @@ | ||
| 11 | 11 | * @type EE_Attendee $contact | 
| 12 | 12 | * @type bool $show_gravatar whether to show gravatar or not. | 
| 13 | 13 | */ | 
| 14 | -if ( $show_gravatar ) { | |
| 15 | - $gravatar = get_avatar( $contact->email(), | |
| 16 | - (int) apply_filters( 'FHEE__loop-espresso_attendees-shortcode__template__avatar_size', 32 ) | |
| 14 | +if ($show_gravatar) { | |
| 15 | + $gravatar = get_avatar($contact->email(), | |
| 16 | +		(int) apply_filters('FHEE__loop-espresso_attendees-shortcode__template__avatar_size', 32) | |
| 17 | 17 | ); | 
| 18 | 18 |  } else { | 
| 19 | 19 | $gravatar = ''; | 
| 20 | 20 | } | 
| 21 | 21 | ?> | 
| 22 | -<?php do_action( 'AHEE__content-espresso_event_attendees__before', $contact, $show_gravatar ); ?> | |
| 23 | -<li><?php echo $gravatar . ' ' . $contact->full_name(); ?></li> | |
| 24 | -<?php do_action( 'AHEE__content-espresso_event_attendees__after', $contact, $show_gravatar ); ?> | |
| 25 | 22 | \ No newline at end of file | 
| 23 | +<?php do_action('AHEE__content-espresso_event_attendees__before', $contact, $show_gravatar); ?> | |
| 24 | +<li><?php echo $gravatar.' '.$contact->full_name(); ?></li> | |
| 25 | +<?php do_action('AHEE__content-espresso_event_attendees__after', $contact, $show_gravatar); ?> | |
| 26 | 26 | \ No newline at end of file | 
| @@ -1,12 +1,12 @@ | ||
| 1 | 1 | <?php | 
| 2 | 2 | //echo '<br/><h6 style="color:#2EA2CC;">'. __FILE__ . '   <span style="font-weight:normal;color:#E76700"> Line #: ' . __LINE__ . '</span></h6>'; | 
| 3 | 3 | global $post; | 
| 4 | -if ( espresso_display_ticket_selector( $post->ID ) && ( is_single() || ( is_archive() && espresso_display_ticket_selector_in_event_list() ))) : | |
| 4 | +if (espresso_display_ticket_selector($post->ID) && (is_single() || (is_archive() && espresso_display_ticket_selector_in_event_list()))) : | |
| 5 | 5 | ?> | 
| 6 | 6 | <div class="event-tickets" style="clear: both;"> | 
| 7 | - <?php espresso_ticket_selector( $post ); ?> | |
| 7 | + <?php espresso_ticket_selector($post); ?> | |
| 8 | 8 | </div> | 
| 9 | 9 | <!-- .event-tickets --> | 
| 10 | -<?php elseif ( ! is_single() ) : ?> | |
| 11 | -<?php espresso_view_details_btn( $post ); ?> | |
| 10 | +<?php elseif ( ! is_single()) : ?> | |
| 11 | +<?php espresso_view_details_btn($post); ?> | |
| 12 | 12 | <?php endif; ?> | 
| 13 | 13 | \ No newline at end of file | 
| @@ -1,11 +1,11 @@ | ||
| 1 | 1 | <?php //echo '<h1>' . __FILE__ . '</h1>'; ?> | 
| 2 | 2 | <?php global $post; | 
| 3 | -$wrap_class = has_excerpt( $post->ID ) ? ' has-excerpt' : ''; | |
| 3 | +$wrap_class = has_excerpt($post->ID) ? ' has-excerpt' : ''; | |
| 4 | 4 | ?> | 
| 5 | -<header class="venue-header<?php echo $wrap_class;?>"> | |
| 5 | +<header class="venue-header<?php echo $wrap_class; ?>"> | |
| 6 | 6 | <h1 id="venue-details-h1" class="entry-title"> | 
| 7 | 7 | <a class="" href="<?php the_permalink(); ?>"><?php the_title(); ?></a> | 
| 8 | 8 | </h1> | 
| 9 | -	<?php if ( has_excerpt( $post->ID )) { the_excerpt(); } ?> | |
| 9 | +	<?php if (has_excerpt($post->ID)) { the_excerpt(); } ?> | |
| 10 | 10 | </header> | 
| 11 | 11 | <!-- .venue-content --> | 
| @@ -1,16 +1,16 @@ | ||
| 1 | 1 | <?php //echo '<h1>' . __FILE__ . '</h1>'; | 
| 2 | 2 | global $post; | 
| 3 | -if ( espresso_venue_has_address( $post->ID )) : | |
| 3 | +if (espresso_venue_has_address($post->ID)) : | |
| 4 | 4 | ?> | 
| 5 | 5 | <div class="venue-location"> | 
| 6 | 6 | |
| 7 | 7 | <h3 class="venue-address-h3 ee-venue-h3"> | 
| 8 | - <span class="dashicons dashicons-location-alt"></span><?php _e( 'Location', 'event_espresso' ); ?> | |
| 8 | +		<span class="dashicons dashicons-location-alt"></span><?php _e('Location', 'event_espresso'); ?> | |
| 9 | 9 | </h3> | 
| 10 | - <span class="small-text"><strong><?php _e( 'Address:', 'event_espresso' ); ?></strong></span><?php espresso_venue_address( 'inline', $post->ID ); ?> | |
| 10 | +	<span class="small-text"><strong><?php _e('Address:', 'event_espresso'); ?></strong></span><?php espresso_venue_address('inline', $post->ID); ?> | |
| 11 | 11 | <div class="clear"></div> | 
| 12 | 12 | |
| 13 | - <div class="venue-gmap"><?php espresso_venue_gmap( $post->ID ); ?></div> | |
| 13 | + <div class="venue-gmap"><?php espresso_venue_gmap($post->ID); ?></div> | |
| 14 | 14 | <div class="clear"></div> | 
| 15 | 15 | |
| 16 | 16 | </div> |