Issues (1378)

Security Analysis    not enabled

This project does not seem to handle request data directly as such no vulnerable execution paths were found.

  Cross-Site Scripting
Cross-Site Scripting enables an attacker to inject code into the response of a web-request that is viewed by other users. It can for example be used to bypass access controls, or even to take over other users' accounts.
  File Exposure
File Exposure allows an attacker to gain access to local files that he should not be able to access. These files can for example include database credentials, or other configuration files.
  File Manipulation
File Manipulation enables an attacker to write custom data to files. This potentially leads to injection of arbitrary code on the server.
  Object Injection
Object Injection enables an attacker to inject an object into PHP code, and can lead to arbitrary code execution, file exposure, or file manipulation attacks.
  Code Injection
Code Injection enables an attacker to execute arbitrary code on the server.
  Response Splitting
Response Splitting can be used to send arbitrary responses.
  File Inclusion
File Inclusion enables an attacker to inject custom files into PHP's file loading mechanism, either explicitly passed to include, or for example via PHP's auto-loading mechanism.
  Command Injection
Command Injection enables an attacker to inject a shell command that is execute with the privileges of the web-server. This can be used to expose sensitive data, or gain access of your server.
  SQL Injection
SQL Injection enables an attacker to execute arbitrary SQL code on your database server gaining access to user data, or manipulating user data.
  XPath Injection
XPath Injection enables an attacker to modify the parts of XML document that are read. If that XML document is for example used for authentication, this can lead to further vulnerabilities similar to SQL Injection.
  LDAP Injection
LDAP Injection enables an attacker to inject LDAP statements potentially granting permission to run unauthorized queries, or modify content inside the LDAP tree.
  Header Injection
  Other Vulnerability
This category comprises other attack vectors such as manipulating the PHP runtime, loading custom extensions, freezing the runtime, or similar.
  Regex Injection
Regex Injection enables an attacker to execute arbitrary code in your PHP process.
  XML Injection
XML Injection enables an attacker to read files on your local filesystem including configuration files, or can be abused to freeze your web-server process.
  Variable Injection
Variable Injection enables an attacker to overwrite program variables with custom data, and can lead to further vulnerabilities.
Unfortunately, the security analysis is currently not available for your project. If you are a non-commercial open-source project, please contact support to gain access.

includes/shortcodes.php (21 issues)

Upgrade to new PHP Analysis Engine

These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more

1
<?php 
2
3
4
/**
5
 * Shortcode: Announcement Slider
6
 */
7
// function announcement_slider($atts, $content = null){
8
9
// 	ob_start();
10
11
// 	echo '<div class="messages"> <div id="announcement_slider" class="owl-carousel">';
12
13
// 	if( have_rows('announcement', 'option') ):
14
// 		while ( have_rows('announcement', 'option') ) : the_row();
15
// 	$message = get_sub_field('messages');
16
// 	$message_link = get_sub_field('link');
17
18
// 	echo '<div class="col-xs-12">';
19
// 	echo '<a href=" ' . $message_link .' " " title="Click to read full messages"> ' . $message .' </a>';
20
// 	echo '</div>';
21
// 	endwhile;
22
// 	else :
23
// 		echo '<div class="col-xs-12">No Messages to Show!</div>';
24
// 	endif;
25
// 	echo '</div></div>';
26
27
// 	$output = ob_get_clean();
28
// 	return $output;
29
// }
30
31
// add_shortcode('announcement','announcement_slider');
32
33
function announcement_slider($atts, $content = null){
0 ignored issues
show
The parameter $atts is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
The parameter $content is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
34
35
	ob_start();
36
37
	echo '<div class="marquee-container"> 
38
	<div class="marquee">';
39
		if( have_rows('announcement', 'option') ):
0 ignored issues
show
'option' is of type string, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
40
			while ( have_rows('announcement', 'option') ) : the_row();
0 ignored issues
show
'option' is of type string, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
41
		$message = get_sub_field('messages');
42
		$message_link = get_sub_field('link');
43
44
		echo '<a href=" ' . $message_link .' " " title="Click to read full message"> ' . $message .' </a> <span>-</span>';
45
		endwhile;
46
		else :
47
			echo '<div class="col-xs-12">No Messages to Show!</div>';
48
		endif;
49
		echo '</div></div>';
50
51
		$output = ob_get_clean();
52
		return $output;
53
	}
54
55
	add_shortcode('announcement','announcement_slider');
56
57
58
/**
59
 * Shortcode: Recent Post Slider
60
 */
61
function recent_post_slider($atts, $content = null){
0 ignored issues
show
The parameter $atts is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
The parameter $content is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
62
63
	ob_start();
64
65
	echo '<div class="post-slider row"><div id="recent-posts" class="owl-carousel">';
66
67
	global $post;
68
	$post_query = new WP_Query( array(
69
		'post_type' => 'post',
70
		'posts_per_page' => 12,
71
		'order'=>'DESC',
72
		'orderby' => 'date',
73
		)
74
	);
75
76
	if( $post_query->have_posts() ) : while( $post_query->have_posts() ) : $post_query->the_post();
77
	$thumb_post = wp_get_attachment_image_src( get_post_thumbnail_id(), 'lighthouse_related_post');
78
	$url_post = $thumb_post[0];
79
	$content = get_the_content();
80
81
	echo '<div class="col-xs-12"><div class="thumbnail thumbnail-hover">';
82
	echo '<img class="img-responsive" src=" ' . $url_post . '">';
83
	echo '<a href=" ' . get_permalink() .' " " title=" ' .  get_the_title() .' " class="overlay"></a>';
84
	echo '</div>';
85
	echo '<div class="entry">';
86
	echo '<h3><a href=" ' . get_permalink() . ' "> ' . get_the_title() . '</a></h3>';
87
	echo '<span class="date"> <i class="fa fa-clock-o"></i> ' . get_the_time(get_option('date_format')) .'</span>';
88
	echo '<div class="entry-content">' . wp_trim_words( $content , '27' ) . '</div>';
89
	echo '<div class="read-more">';
90
	echo '<a href="' . get_permalink() . ' " class="btn read-more-btn">View Article</a>';
91
	echo '</div>';
92
	echo '</div></div>';
93
94
	endwhile;
95
	wp_reset_postdata();
96
	endif;
97
98
	echo '</div></div>';
99
100
	$output = ob_get_clean();
101
	return $output;
102
}
103
104
add_shortcode('recent_posts','recent_post_slider');
105
106
107
/**
108
 * Shortcode: Member logo slider
109
 */
110
function member_logo_slider($atts, $content = null){
0 ignored issues
show
The parameter $atts is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
The parameter $content is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
111
112
	ob_start();
113
114
	echo '<div class="members-logo row"> <div id="logo-slider" class="owl-carousel">';
115
116
	if( have_rows('members_logo', 'option') ):
0 ignored issues
show
'option' is of type string, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
117
		while ( have_rows('members_logo', 'option') ) : the_row();
0 ignored issues
show
'option' is of type string, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
118
	$logo_url = get_sub_field('logo');
119
	$company_link = get_sub_field('link');
120
121
	echo '<div class="thumbnail thumbnail-hover">';
122
	echo '<img class="img-responsive" src=" ' . $logo_url . '">';
123
	echo '<a href=" ' . $company_link .' " " title=" ' .  $company_link .' " class="link-full"></a>';
124
	echo '</div>';
125
126
	endwhile;
127
	else :
128
		echo '<div class="col-xs-12">Members Logo Slider not found! <be> please add some logo in theme setting page</div>';
129
	endif;
130
	echo '</div></div>';
131
132
	$output = ob_get_clean();
133
	return $output;
134
}
135
136
add_shortcode('members_logo','member_logo_slider');
137
138
139
/**
140
 * Shortcode: Share Price
141
 */
142
function share_price_feed($atts, $content = null){
0 ignored issues
show
The parameter $atts is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
The parameter $content is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
143
144
	ob_start();
145
146
	$xmldat = file_get_contents('http://qfx.quartalflife.com/clients/uk/lighthouse_group/xml/xml.aspx');
147
	file_put_contents('./wp-content/themes/lighthouse/xml-feeds/share-price.xml', $xmldat);
148
149
	$url 	= './wp-content/themes/lighthouse/xml-feeds/share-price.xml';
150
	$xml 	= simplexml_load_file($url);
151
	$price 	= $xml->CurrentPrice;
0 ignored issues
show
The property CurrentPrice does not seem to exist in SimpleXMLElement.

An attempt at access to an undefined property has been detected. This may either be a typographical error or the property has been renamed but there are still references to its old name.

If you really want to allow access to undefined properties, you can define magic methods to allow access. See the php core documentation on Overloading.

Loading history...
152
	$change = $xml->Change;
0 ignored issues
show
The property Change does not seem to exist in SimpleXMLElement.

An attempt at access to an undefined property has been detected. This may either be a typographical error or the property has been renamed but there are still references to its old name.

If you really want to allow access to undefined properties, you can define magic methods to allow access. See the php core documentation on Overloading.

Loading history...
153
	$change_pcent 	= $xml->PercentageChange;
0 ignored issues
show
The property PercentageChange does not seem to exist in SimpleXMLElement.

An attempt at access to an undefined property has been detected. This may either be a typographical error or the property has been renamed but there are still references to its old name.

If you really want to allow access to undefined properties, you can define magic methods to allow access. See the php core documentation on Overloading.

Loading history...
$change_pcent is not used, you could remove the assignment.

This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.

$myVar = 'Value';
$higher = false;

if (rand(1, 6) > 3) {
    $higher = true;
} else {
    $higher = false;
}

Both the $myVar assignment in line 1 and the $higher assignment in line 2 are dead. The first because $myVar is never used and the second because $higher is always overwritten for every possible time line.

Loading history...
154
	$volume = $xml->Volume;
0 ignored issues
show
The property Volume does not seem to exist in SimpleXMLElement.

An attempt at access to an undefined property has been detected. This may either be a typographical error or the property has been renamed but there are still references to its old name.

If you really want to allow access to undefined properties, you can define magic methods to allow access. See the php core documentation on Overloading.

Loading history...
155
	$Date 	= $xml->Date; 
0 ignored issues
show
The property Date does not seem to exist in SimpleXMLElement.

An attempt at access to an undefined property has been detected. This may either be a typographical error or the property has been renamed but there are still references to its old name.

If you really want to allow access to undefined properties, you can define magic methods to allow access. See the php core documentation on Overloading.

Loading history...
156
	$time 	= $xml->time; 
0 ignored issues
show
The property time does not seem to exist in SimpleXMLElement.

An attempt at access to an undefined property has been detected. This may either be a typographical error or the property has been renamed but there are still references to its old name.

If you really want to allow access to undefined properties, you can define magic methods to allow access. See the php core documentation on Overloading.

Loading history...
157
158
	echo '<div class="share_price_feed">';
159
160
	echo '<div class="feed_options"><div class="share_data_title">Share Price:</div><div class="share_data">' . $price . '</div></div>';
161
	echo '<div class="feed_options"><div class="share_data_title">Change:</div><div class="share_data">' . $change . 'p</div></div>';
162
	echo '<div class="feed_options"><div class="share_data_title">Volume:</div><div class="share_data">' . $volume . '</div></div>';
163
	echo '<div class="feed_options"><div class="share_data_title">Date:</div><div class="share_data">' . $Date . '</div></div>';
164
	echo '<div class="feed_options"><div class="share_data_title">Time:</div><div class="share_data">' . $time . '</div></div>';
165
166
	echo '</div>';
167
168
	$output = ob_get_clean();
169
	return $output;
170
}
171
172
add_shortcode('share_price','share_price_feed');
173
174
175
176
/**
177
 * Shortcode: RNS Feeds
178
 */
179
function rns_feed_fn($atts, $content = null){
0 ignored issues
show
The parameter $atts is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
The parameter $content is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
180
181
	ob_start();
182
183
	$xmldata = file_get_contents('http://otp.investis.com/clients/uk/lighthouse_group_plc/rns/xml-feed.aspx?culture=en-GB');
184
	file_put_contents('./wp-content/themes/lighthouse/xml-feeds/rns-feed.xml', $xmldata);
185
186
	$url 	= './wp-content/themes/lighthouse/xml-feeds/rns-feed.xml';
187
	$xml 	= simplexml_load_file($url);
188
189
	foreach ($xml->RNSSummaries->RNSSummary as $RNSSummary) {
190
		$RNSDateTime = $RNSSummary->pubDate;
191
		$RNSDate = substr($RNSDateTime, 5, 11);
192
		$RNSLink = $RNSSummary->ShareURL;
193
		$RNSTitle = $RNSSummary->Title;
194
195
		echo $RNSDate, ' – <a title="Read article" href=" ', $RNSLink, ' " target="_blank"> ', $RNSTitle, ' </a><br> ', PHP_EOL;
196
	}
197
198
	$output = ob_get_clean();
199
	return $output;
200
}
201
202
add_shortcode('rns_feed','rns_feed_fn');