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.

re-pro.php (6 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
0 ignored issues
show
Coding Style Compatibility introduced by
For compatibility and reusability of your code, PSR1 recommends that a file should introduce either new symbols (like classes, functions, etc.) or have side-effects (like outputting something, or including other files), but not both at the same time. The first symbol is defined on line 34 and the first side effect is on line 24.

The PSR-1: Basic Coding Standard recommends that a file should either introduce new symbols, that is classes, functions, constants or similar, or have side effects. Side effects are anything that executes logic, like for example printing output, changing ini settings or writing to a file.

The idea behind this recommendation is that merely auto-loading a class should not change the state of an application. It also promotes a cleaner style of programming and makes your code less prone to errors, because the logic is not spread out all over the place.

To learn more about the PSR-1, please see the PHP-FIG site on the PSR-1.

Loading history...
2
/**
3
 * Real Estate Pro
4
 *
5
 * @package re-pro
6
 */
7
8
/*
9
-------------------------------------------------------------------------------
10
	Plugin Name: Real Estate Pro
11
	Plugin URI: https://www.imforza.com
12
	Description: A WordPress plugin for Real Estate websites, offering tools such as widgets and badges. Built by <a href="https://www.imforza.com">imFORZA</a>.
13
	Version: 1.0.9
14
	Author: imFORZA
15
	Contributors: imforza, bhubbard, sfgarza, matoledo
16
	Text Domain: re-pro
17
	Author URI: https://www.imforza.com
18
	License: GPLv3 or later
19
	License URI: https://www.gnu.org/licenses/gpl-3.0.en.html
20
------------------------------------------------------------------------------
21
*/
22
23
/* Exit if accessed directly. */
24
if ( ! defined( 'ABSPATH' ) ) { exit; }
25
26
/** Instantiate the plugin. */
27
new RePro();
28
require_once( 'settings.php' );
29
30
31
/**
32
 * RePro class.
33
 */
34
class RePro {
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...
35
36
	/**
37
	 * Constructor.
38
	 *
39
	 * @access public
40
	 * @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...
41
	 */
42
	public function __construct() {
43
		/* Define Constants */
44
		define( 'REPRO_BASE_NAME', plugin_basename( __FILE__ ) );
45
		define( 'REPRO_BASE_DIR', plugin_dir_path( __FILE__ ) );
46
		define( 'REPRO_PLUGIN_FILE', REPRO_BASE_DIR . 're-pro.php' );
47
48
		/* Include dependencies */
49
		require_once( 'includes.php' );
50
51
		$this->init();
52
	}
53
54
55
	/**
56
	 * Init.
57
	 *
58
	 * @access private
59
	 * @return void
60
	 */
61
	private function init() {
62
		$this->general_settings = get_option( 're_pro_settings' );
63
64
		/* Language Support. */
65
		load_plugin_textdomain( 're-pro', false, dirname( REPRO_BASE_NAME ) . '/languages' );
66
67
		/* Plugin Activation/De-Activation. */
68
		register_activation_hook( REPRO_PLUGIN_FILE, array( $this, 'activate' ) );
69
		register_deactivation_hook( REPRO_PLUGIN_FILE, array( $this, 'deactivate' ) );
70
71
		/* Set menu page. */
72
		add_action( 'admin_menu', array( $this, 'admin_menu' ) );
73
74
		/** Enqueue css and js files. */
75
		add_action( 'admin_enqueue_scripts', array( $this, 'admin_scripts' ) );
76
		add_action( 'wp_enqueue_scripts', 	 array( $this, 'widget_styles' ) );
77
78
		/* Add link to settings in plugins admin page. */
79
		add_filter( 'plugin_action_links_' . REPRO_BASE_NAME , array( $this, 'plugin_links' ) );
80
81
		add_filter( 'wpapi_google_map_data', array( $this, 'gmap_style' ), 1 );
82
83
		$this->init_modules();
84
	}
85
86
	private function init_modules() {
87
		$gmaps_key = isset( $this->general_settings['gmaps_key'] ) ? $this->general_settings['gmaps_key'] : null;
88
89
		if ( isset( $this->general_settings['gmaps_active'] ) && isset( $gmaps_key ) ) {
90
			new WPAPI_GOOGLE_MAPS( $gmaps_key );
91
		}
92
	}
93
94
	public function gmap_style( $map_data ) {
95
		// Grab style option.
96
		$map_json = ( isset( $this->general_settings['gmaps_style'] ) ) ? $this->general_settings['gmaps_style'] : '[]';
97
98
		// Validate JSON.
99
		json_decode( $map_json );
100
		$json_valid = json_last_error();
101
102
		// Set style to map_data.
103
		$map_data['style'] = ( $json_valid === JSON_ERROR_NONE ) ? $map_json : '[]';
104
105
		return $map_data;
106
	}
107
108
	/**
109
	 * Method that runs on admin_menu hook.
110
	 */
111
	public function admin_menu() {
112
113
	}
114
115
	/**
116
	 * Enqueue CSS.
117
	 */
118
	public function admin_scripts() {
119
		if ( ! is_admin() ) {
120
			wp_register_style( 're-pro', plugins_url( 'assets/css/re-pro-min.css', REPRO_PLUGIN_FILE ) );
121
			// wp_enqueue_style( 're-pro' );
0 ignored issues
show
Unused Code Comprehensibility introduced by
50% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
122
		}
123
	}
124
125
	/**
126
	 * Register Widget CSS.
127
	 */
128
	public function widget_styles() {
129
		wp_register_style( 're-pro-widgets', plugins_url( 'assets/css/re-pro-widgets.min.css', REPRO_PLUGIN_FILE ) );
130
		wp_enqueue_style( 're-pro-widgets' );
131
	}
132
133
	/**
134
	 * Method that executes on plugin activation.
135
	 */
136
	public function activate() {
137
		flush_rewrite_rules();
138
	}
139
140
	/**
141
	 * Method that executes on plugin de-activation.
142
	 */
143
	public function deactivate() {
144
		flush_rewrite_rules();
145
	}
146
147
	/**
148
	 * Add Tools link on plugin page.
149
	 *
150
	 * @param  [Array] $links : Array of links on plugin page.
0 ignored issues
show
The doc-type [Array] could not be parsed: Unknown type name "" at position 0. [(view supported doc-types)

This check marks PHPDoc comments that could not be parsed by our parser. To see which comment annotations we can parse, please refer to our documentation on supported doc-types.

Loading history...
151
	 * @return [Array]        : Array of links on plugin page.
0 ignored issues
show
The doc-type [Array] could not be parsed: Unknown type name "" at position 0. [(view supported doc-types)

This check marks PHPDoc comments that could not be parsed by our parser. To see which comment annotations we can parse, please refer to our documentation on supported doc-types.

Loading history...
152
	 */
153
	public function plugin_links( $links ) {
154
		$settings_link = '<a href="options-general.php?page=re-pro-settings">Settings</a>';
155
		array_unshift( $links, $settings_link );
156
		return $links;
157
	}
158
}
159