Issues (103)

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.

public/assets/js/betterOptin.js (1 issue)

Severity

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
/*global jQuery:false */
2
var DEBUG = false;
3
4
(function ($) {
5
	'use strict';
6
7
	// Reading WordPress Options
8
	var wpboStr, wpboObj;
9
	if (typeof wpbo !== 'undefined') {
10
		wpboStr = wpbo.replace(/"/g, '"');
11
		wpboObj = $.parseJSON(wpboStr);
12
		if (DEBUG) {
13
			console.log(wpboObj);
14
		}
15
	} else {
16
		wpboObj = {
17
			close_overlay: true,
18
			close_esc: true,
19
			cookie_lifetime: '30',
20
			animation: 'bounceIn',
21
			popup_id: 'betterOpt',
22
			overlayOpacity: 0.5,
23
			overlayColor: '#000',
24
			credit: true
25
		};
26
	}
27
28
	/////////////////////
29
	// Document Ready //
30
	/////////////////////
31
	$(function () {
32
33
		// Define vars
34
		var wpboCookie = 'wpbo_' + wpboObj.popup_id,
35
			wpboModal = $('.wpbo-modal').hide(),
36
			wpboForm = wpboModal.parent('.optform');
37
38
		// Preload images
39
		function preload(arrayOfImages) {
40
			$(arrayOfImages).each(function () {
41
				$('<img />').attr('src', this).appendTo('body').hide();
42
			});
43
		}
44
		if ($('.wpbo-featured-img').length) {
45
			var wpboImages = $('.wpbo-featured-img').attr('src');
46
			if (DEBUG) {
47
				console.log(wpboImages);
48
			}
49
			preload([wpboImages]);
50
		}
51
52
		wpboModal.easyModal({
53
			top: 200,
54
			overlayOpacity: wpboObj.overlay_opacity,
55
			overlayColor: wpboObj.overlay_color,
56
			overlayClose: wpboObj.close_overlay,
57
			transitionIn: 'animated ' + wpboObj.animation,
58
			updateZIndexOnOpen: false,
59
			closeOnEscape: wpboObj.close_esc,
60
			closeButtonClass: '.wpbo-close',
61
			onClose: function () {
62
63
				// Set Cookie
64
				// @NOTE: Does not work locally, see http://stackoverflow.com/questions/335244/why-does-chrome-ignore-local-jquery-cookies
65
				var d = new Date();
66
				d = d.toDateString();
67
				d = d.split(' ').join('_');
68
				$.cookie(wpboCookie, 'closed_on_' + d, {
69
					expires: wpboObj.cookie_lifetime,
70
					path: '/'
71
				});
72
			},
73
			onOpen: function () {
74
75
				// Save impressions
76
				var data = {
77
					'action': 'wpbo_new_impression',
78
					'popup_id': wpboObj.popup_id
79
				};
80
				$.post(wpboObj.ajaxurl, data);
81
82
				// Trigger matchHeight
83
				if (jQuery().matchHeight) {
84
					$('.wpbo-col').matchHeight('.wpbo-grid-no-gutter');
85
				}
86
87
				// Focus on the first form input
88
				wpboForm.find('input:first').focus();
89
90
				// Disable the submit button onSubmit
91
				wpboForm.submit(function () {
92
					wpboForm.find('[type=submit]').prop('disabled', true).text('Please wait...');
93
				});
94
95
				// Add Credit
96
				if (wpboObj.credit === true) {
97
					wpboModal.append('<a class="wpbo-credit" href="http://betteropt.in/?utm_source=plugin&utm_medium=credit&utm_term=organic&utm_campaign=betteroptin" target="_blank">Popup created with <strong>BetterOptin</strong></a>');
98
				}
99
			}
100
		});
101
102
		// If cookie is not set, show the modal
103
		if ($.cookie(wpboCookie) == null) {
0 ignored issues
show
It is recommended to use === to compare with null.

Generally, it is recommended to use strict comparison whenever possible and not to rely on the weaker type-juggling comparison operator.

Read more about comparison operations.

Loading history...
104
105
			$(document).one('mouseleave', function (e) {
106
				e.preventDefault();
107
108
				// Open the modal
109
				wpboModal.trigger('openModal').addClass('wpbo-modal-active');
110
111
				// Click outside animates the modal
112
				if (wpboObj.wiggle === true) {
113
					$(document).on('click', '.lean-overlay:not(".wpbo-modal")', function () {
114
						wpboModal.addClass('wpbo-tada');
115
						wpboModal.on('oanimationend animationend webkitAnimationEnd', function () {
116
							$(this).removeClass('wpbo-tada');
117
						});
118
					});
119
				}
120
			});
121
		}
122
123
		// Trigger the modal manually
124
		$('.wpbo-trigger').on('click', function (e) {
125
			e.preventDefault();
126
			wpboModal.trigger('openModal').addClass('wpbo-modal-active');
127
		});
128
129
		// Hide close icon if option is enabled
130
		if (wpboObj.hide_close_button) {
131
			$('.wpbo-close').hide();
132
		}
133
134
	});
135
136
}(jQuery));