Issues (421)

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.

wpdfi.php (34 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
 * Plugin Name: WP Default Feature Image.
4
 * Description: Help you to choose default feature images for any post types, categories, tags,...
5
 * Version: 1.0.0
6
 * Author: Duc Bui Quang <[email protected]>
7
 * Author URI: https://www.ducbuiquang.com
8
 * License: GPLv2+
9
 * Text Domain: wpdfi
10
 *
11
12
WP Default Feature Image is free software: you can redistribute it and/or modify
13
it under the terms of the GNU General Public License as published by
14
the Free Software Foundation, either version 2 of the License, or
15
any later version.
16
 
17
WP Default Feature Image is distributed in the hope that it will be useful,
18
but WITHOUT ANY WARRANTY; without even the implied warranty of
19
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20
GNU General Public License for more details.
21
 
22
You should have received a copy of the GNU General Public License
23
along with WP Default Feature Image. If not, see https://www.gnu.org/licenses/gpl-2.0.html.
24
25
*/
26
27
28
define('WPDFI_PLUGIN', __FILE__ );
0 ignored issues
show
Expected 1 spaces after opening bracket; 0 found
Loading history...
29
define('WPDFI_PLUGIN_BASENAME', plugin_basename( WPDFI_PLUGIN ) );
0 ignored issues
show
Expected 1 spaces after opening bracket; 0 found
Loading history...
30
define('WPDFI_URL_BASE', plugin_dir_url( WPDFI_PLUGIN) );
0 ignored issues
show
Expected 1 spaces after opening bracket; 0 found
Loading history...
Expected 1 spaces before closing bracket; 0 found
Loading history...
31
define('WPDFI_DIR_BASE', plugin_dir_path( WPDFI_PLUGIN ) );
0 ignored issues
show
Expected 1 spaces after opening bracket; 0 found
Loading history...
32
define('WPDFI_ASSETS', WPDFI_URL_BASE . '/assets/' );
0 ignored issues
show
Expected 1 spaces after opening bracket; 0 found
Loading history...
33
define('WPDFI_TEMPLATES_PATH', WPDFI_DIR_BASE.  '/templates/');
0 ignored issues
show
Expected 1 spaces after opening bracket; 0 found
Loading history...
Expected 1 spaces before closing bracket; 0 found
Loading history...
34
35
require_once WPDFI_DIR_BASE . '/vendor/autoload.php';
36
37
use WPDFI\Traits\HasModule;
38
use WPDFI\Traits\Singleton;
39
use WPDFI\PostType;
40
use WPDFI\Taxonomy;
41
use WPDFI\Term;
42
use WPDFI\Ajax;
43
use WPDFI\Admin;
44
use WPDFI\Image;
45
use WPDFI\Layout;
46
use WPDFI\Admin\Notice;
47
48
final class WPDFI
49
{
50
	use HasModule;
51
	use Singleton;
52
	
53
	/**
54
	 * @traitDoc
55
	 */
56
	public function initializes() 
57
	{
58
		$this->loadModules();
59
60
		Ajax::instance();
61
	}
62
63
	/**
64
	 * All WordPress hooks come here
65
	 * 
66
	 * @since 1.0.0
67
	 * @return void
68
	 */
69
	public function hooks() 
70
	{
71
72
		add_action( 'init', [$this, 'init']);
0 ignored issues
show
Expected 1 spaces before closing bracket; 0 found
Loading history...
73
74
		/* Load all module hooks */
75
		$this->moduleHooks();
76
77
	}
78
79
	/**
80
	 * All Install and default settings stuff for this plugin come here.
81
	 *
82
	 * @since 1.0.0
83
	 * @return void
84
	 */
85
	public function install() {
86
87
		$options = get_option('wpdfi-settings');
0 ignored issues
show
Expected 1 spaces after opening bracket; 0 found
Loading history...
Expected 1 spaces before closing bracket; 0 found
Loading history...
88
		if(!$options['options']['status_for_update']) {
0 ignored issues
show
Space after opening control structure is required
Loading history...
No space before opening parenthesis is prohibited
Loading history...
No space after opening parenthesis is prohibited
Loading history...
Expected 1 space before "!"; 0 found
Loading history...
Expected 1 space after "!"; 0 found
Loading history...
No space before closing parenthesis is prohibited
Loading history...
89
			$options['options']['status_for_update'] = 'publish';
90
			update_option('wpdfi-settings', $options);
0 ignored issues
show
Expected 1 spaces after opening bracket; 0 found
Loading history...
Expected 1 spaces before closing bracket; 0 found
Loading history...
91
		}
92
93
	}
94
	
95
	/**
96
	 * init actions
97
	 * 
98
	 * @since 1.0.0
99
	 * @return void
100
	 */
101
	public function init() 
102
	{
103
		load_plugin_textdomain('wpdfi', false, WPDFI_DIR_BASE . '/lang/');
0 ignored issues
show
Expected 1 spaces after opening bracket; 0 found
Loading history...
Expected 1 spaces before closing bracket; 0 found
Loading history...
104
	}
105
	
106
	/**
107
	 * @traitDoc
108
	 */
109
	public function loadModules() {
0 ignored issues
show
The function name loadModules is in camel caps, but expected load_modules instead as per the coding standard.
Loading history...
110
		$modules = [
111
			'templater'	=> new VA\Templater(WPDFI_TEMPLATES_PATH, 'blade'),
0 ignored issues
show
Expected 1 spaces after opening bracket; 0 found
Loading history...
Expected 1 spaces before closing bracket; 0 found
Loading history...
112
			'post_type' => PostType::instance(),
113
			'taxonomy'	=> Taxonomy::instance(),
114
			'term'		=> Term::instance(),
115
			'image'		=> Image::instance(),
116
			'layout'	=> Layout::instance(),
117
			'admin_notice' => Notice::instance(),
118
			'admin'		=> Admin::instance()
119
		];
120
			
121
		foreach($modules as $moduleName => $moduleHandle) {
0 ignored issues
show
Space after opening control structure is required
Loading history...
No space before opening parenthesis is prohibited
Loading history...
No space after opening parenthesis is prohibited
Loading history...
No space before closing parenthesis is prohibited
Loading history...
122
			$this->module($moduleName, $moduleHandle);
0 ignored issues
show
Expected 1 spaces after opening bracket; 0 found
Loading history...
Expected 1 spaces before closing bracket; 0 found
Loading history...
123
		}
124
		
125
		return $this;
126
	}
127
	
128
}
129
/**
130
 * Return singleton of WPDFI
131
 *
132
 * @since  1.0.0
133
 * @return WPDFI  Singleton instance of plugin class.
134
 */
135
function wpdfi() {
136
    return WPDFI::instance();
137
}
138
139
add_action('plugins_loaded', [wpdfi(), 'hooks']);
0 ignored issues
show
Expected 1 spaces after opening bracket; 0 found
Loading history...
Expected 1 spaces before closing bracket; 0 found
Loading history...
140
141
register_activation_hook(WPDFI_PLUGIN, [wpdfi(), 'install']);
0 ignored issues
show
Expected 1 spaces after opening bracket; 0 found
Loading history...
Expected 1 spaces before closing bracket; 0 found
Loading history...