Issues (557)

Security Analysis    no request data  

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.

modules/class-realestate-tools.php (9 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
if ( ! class_exists( 'RealEstateTools' ) ) {
4
5
	/**
6
	 * RealEstateTools class.
7
	 */
8
	class RealEstateTools {
0 ignored issues
show
Coding Style Compatibility introduced by
PSR1 recommends that each class must be in a namespace of at least one level to avoid collisions.

You can fix this by adding a namespace to your class:

namespace YourVendor;

class YourClass { }

When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.

Loading history...
9
10
		/**
11
		 * __construct function.
12
		 *
13
		 * @access public
14
		 * @return void
0 ignored issues
show
Comprehensibility Best Practice introduced by
Adding a @return annotation to constructors is generally not recommended as a constructor does not have a meaningful return value.

Adding a @return annotation to a constructor is not recommended, since a constructor does not have a meaningful return value.

Please refer to the PHP core documentation on constructors.

Loading history...
15
		 */
16
		public function __construct() {
17
18
		}
19
20
		/**
21
		 * extract_zipcode function.
22
		 *
23
		 * @access public
24
		 * @param mixed $address
25
		 * @return void
26
		 */
27
		public function extract_zipcode( $address ) {
28
			$zipcode = preg_match("/\b[A-Z]{2}\s+\d{5}(-\d{4})?\b/", $address, $matches);
0 ignored issues
show
$zipcode 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...
29
			return $matches[0];
30
		}
31
32
		/**
33
		 * extract_bed_count function.
34
		 *
35
		 * @access public
36
		 * @param mixed $text
37
		 * @return void
38
		 */
39
		public function extract_bed_count( $text ) {
40
    		$beds = preg_match("/\d (beds|Beds|Bedrooms)/", $text, $matches);
0 ignored issues
show
$beds 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...
41
			$beds_text = $matches[0];
42
			return $int = filter_var($beds_text, FILTER_SANITIZE_NUMBER_INT);
0 ignored issues
show
$int 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...
43
		}
44
45
		/**
46
		 * extract_bath_count function.
47
		 *
48
		 * @access public
49
		 * @param mixed $text
50
		 * @return void
51
		 */
52
		public function extract_bath_count( $text ) {
53
    		$baths = preg_match("/\d (bath|Baths|Bathrooms)/", $text, $matches);
0 ignored issues
show
$baths 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...
54
			$baths_text = $matches[0];
0 ignored issues
show
$baths_text 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...
55
			return $int = filter_var($beds_text, FILTER_SANITIZE_NUMBER_INT);
0 ignored issues
show
The variable $beds_text does not exist. Did you forget to declare it?

This check marks access to variables or properties that have not been declared yet. While PHP has no explicit notion of declaring a variable, accessing it before a value is assigned to it is most likely a bug.

Loading history...
$int 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...
56
		}
57
58
		/**
59
		 * validate_usa_zipcode function.
60
		 *
61
		 * @access public
62
		 * @param mixed $zip_code
63
		 * @return void
64
		 */
65
		public function validate_usa_zipcode( $zip_code ) {
66
			if ( preg_match("/^([0-9]{5})(-[0-9]{4})?$/i", $zip_code) )
67
				return true;
68
			else
69
				return false;
70
		}
71
72
73
		/**
74
		 * is_valid_latitude function.
75
		 *
76
		 * @access public
77
		 * @param mixed $latitude
78
		 * @return void
79
		 */
80
		public function is_valid_latitude($latitude) {
81
			if ( preg_match("/^-?([1-8]?[1-9]|[1-9]0)\.{1}\d{1,6}$/", $latitude) ) {
82
				return true;
83
			} else {
84
				return false;
85
			}
86
		}
87
88
89
		/**
90
		 * is_valid_longitude function.
91
		 *
92
		 * @access public
93
		 * @param mixed $longitude
94
		 * @return void
95
		 */
96
		public function is_valid_longitude($longitude) {
97
			if (preg_match("/^-?([1]?[1-7][1-9]|[1]?[1-8][0]|[1-9]?[0-9])\.{1}\d{1,6}$/",
98
					$longitude)) {
99
				return true;
100
			} else {
101
				return false;
102
			}
103
		}
104
105
106
	}
107
}
108