GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

Issues (217)

Security Analysis    no vulnerabilities found

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.

classes/backup/class-backup-engine-file.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
2
3
namespace HM\BackUpWordPress;
4
5
use Symfony\Component\Finder\Finder as Finder;
6
7
/**
8
 * The File Backup Engine type
9
 *
10
 * All File Backup Engine implementations should extend this class
11
 */
12
abstract class File_Backup_Engine extends Backup_Engine {
13
14
	/**
15
	 * The array of excludes rules
16
	 *
17
	 * @var array
18
	 */
19
	protected $excludes;
20
21
	/**
22
	 * Set the default backup filename.
23
	 */
24
	public function __construct() {
25
26
		parent::__construct();
27
28
		$this->set_backup_filename( implode( '-', array(
29
			str_ireplace( array( 'http://', 'https://', 'www' ), '', home_url() ),
30
			'backup',
31
			current_time( 'Y-m-d-H-i-s' ),
32
		) ) . '.zip' );
33
34
		$this->excludes = new Excludes;
0 ignored issues
show
Documentation Bug introduced by
It seems like new \HM\BackUpWordPress\Excludes() of type object<HM\BackUpWordPress\Excludes> is incompatible with the declared type array of property $excludes.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
35
36
	}
37
38
	/**
39
	 * Set the excludes rules for the backup.
40
	 *
41
	 * @param array $excludes The exclude rules.
0 ignored issues
show
Should the type for parameter $excludes not be Excludes?

This check looks for @param annotations where the type inferred by our type inference engine differs from the declared type.

It makes a suggestion as to what type it considers more descriptive.

Most often this is a case of a parameter that can be null in addition to its declared types.

Loading history...
42
	 */
43
	public function set_excludes( Excludes $excludes ) {
44
		$this->excludes = $excludes;
0 ignored issues
show
Documentation Bug introduced by
It seems like $excludes of type object<HM\BackUpWordPress\Excludes> is incompatible with the declared type array of property $excludes.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
45
	}
46
47
	/**
48
	 * Returns a Finder instance for the files that will be included in the
49
	 * backup.
50
	 *
51
	 * By default we ignore unreadable files and directories as well as, common
52
	 * version control folders / files, "Dot" files and anything matching the
53
	 * exclude rules.
54
	 *
55
	 * @uses Finder
56
	 * @return Finder The Finder iterator of all files to be included
57
	 */
58
	public function get_files() {
59
60
		$finder = new Finder();
61
62
		$finder->followLinks( true );
0 ignored issues
show
The call to Finder::followLinks() has too many arguments starting with true.

This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.

If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress.

In this case you can add the @ignore PhpDoc annotation to the duplicate definition and it will be ignored.

Loading history...
63
		$finder->ignoreDotFiles( false );
64
		$finder->ignoreVCS( true );
65
		$finder->ignoreUnreadableDirs( true );
66
67
		// Skip unreadable files too
68
		$finder->filter(
69
			function ( \SplFileInfo $file ) {
70
				if ( ! $file->isReadable() ) {
71
					return false;
72
				}
73
			}
74
		);
75
76
		// Finder expects exclude rules to be in a regex format
77
		$exclude_rules = $this->excludes->get_excludes_for_regex();
0 ignored issues
show
The method get_excludes_for_regex cannot be called on $this->excludes (of type array).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
78
79
		// Skips folders/files that match default exclude patterns
80
		foreach ( $exclude_rules as $exclude ) {
81
			$finder->notPath( $exclude );
82
		}
83
84
		return $finder->in( Path::get_root() );
0 ignored issues
show
Bug Compatibility introduced by
The expression $finder->in(\HM\BackUpWo...ress\Path::get_root()); of type Symfony\Component\Finder...nt\Finder\SplFileInfo[] adds the type Symfony\Component\Finder\SplFileInfo[] to the return on line 84 which is incompatible with the return type documented by HM\BackUpWordPress\File_Backup_Engine::get_files of type Symfony\Component\Finder\Finder.
Loading history...
85
86
	}
87
88
	/**
89
	 * Verify that the file backup completed successfully.
90
	 *
91
	 * This should be called from backup method of any final file backup engine
92
	 * implementations.
93
	 *
94
	 * @return bool Whether the backup completed successfully.
95
	 */
96
	public function verify_backup() {
97
98
		// If there are errors delete the backup file.
99
		if ( $this->get_errors( get_called_class() ) && file_exists( $this->get_backup_filepath() ) ) {
100
			unlink( $this->get_backup_filepath() );
101
		}
102
103
		// If the backup doesn't exist then we must have failed.
104
		if ( ! file_exists( $this->get_backup_filepath() ) ) {
105
			return false;
106
		}
107
108
		return true;
109
110
	}
111
}
112