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/class-setup.php (2 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
 * Class BackUpWordPress_Setup
4
 */
5
class HMBKP_Setup {
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...
6
7
	/**
8
	 * Defines the minimum version of WordPress required by BWP.
9
	 */
10
	const MIN_WP_VERSION = '3.9';
11
12
	/**
13
	 * Defines the minimum version of PHP required by BWP.
14
	 */
15
	const MIN_PHP_VERSION = '5.3.2';
16
17
	/**
18
	 * Setup the plugin defaults on activation
19
	 */
20
	public static function activate() {
21
22
		if ( ! current_user_can( 'activate_plugins' ) ) {
23
			return;
24
		}
25
26
		// loads the translation files for the Error message in the wp_die call.
27
		load_plugin_textdomain( 'backupwordpress', false, dirname( plugin_basename( __FILE__ ) ) . '/languages' );
28
29
		if ( ! self::meets_requirements() ) {
30
31
			wp_die( self::get_notice_message(), __( 'BackUpWordPress', 'backupwordpress' ), array( 'back_link' => true ) );
32
33
		}
34
35
		// Run deactivate on activation in-case it was deactivated manually
36
		self::deactivate();
37
38
	}
39
40
	/**
41
	 * Cleanup on plugin deactivation
42
	 *
43
	 * Removes options and clears all cron schedules
44
	 */
45
	public static function deactivate() {
46
47
		if ( ! current_user_can( 'activate_plugins' ) ) {
48
			return;
49
		}
50
51
		self::delete_schedules();
52
53
		self::delete_transients();
54
55
	}
56
57
	/**
58
	 * Deletes the backup schedule database entries and WP Cron entries.
59
	 */
60
	public static function delete_schedules() {
61
62
		// Delete Cron schedules.
63
		global $wpdb;
0 ignored issues
show
Compatibility Best Practice introduced by
Use of global functionality is not recommended; it makes your code harder to test, and less reusable.

Instead of relying on global state, we recommend one of these alternatives:

1. Pass all data via parameters

function myFunction($a, $b) {
    // Do something
}

2. Create a class that maintains your state

class MyClass {
    private $a;
    private $b;

    public function __construct($a, $b) {
        $this->a = $a;
        $this->b = $b;
    }

    public function myFunction() {
        // Do something
    }
}
Loading history...
64
65
		$schedules = $wpdb->get_col( $wpdb->prepare( "SELECT option_name FROM $wpdb->options WHERE option_name LIKE %s", 'hmbkp_schedule_%' ) );
66
67
		foreach ( array_map( array( 'self', 'trim_prefix' ), $schedules ) as $item ) {
68
			wp_clear_scheduled_hook( 'hmbkp_schedule_hook', array( 'id' => $item ) );
69
		}
70
	}
71
72
	public static function trim_prefix( $item ) {
73
		return ltrim( $item, 'hmbkp_schedule_' );
74
	}
75
76
	/**
77
	 * Deletes the plugin's transients from the database.
78
	 */
79
	public static function delete_transients() {
80
81
		// Delete all transients
82
		$transients = array(
83
			'hmbkp_plugin_data',
84
			'hmbkp_directory_filesizes',
85
			'hmbkp_directory_filesizes_running',
86
			'hmbkp_wp_cron_test_beacon',
87
			'hm_backdrop',
88
		);
89
90
		array_map( 'delete_transient', $transients );
91
	}
92
93
	/**
94
	 * Deactivate BackUpWordPress.
95
	 */
96
	public static function self_deactivate() {
97
98
		if ( ! current_user_can( 'activate_plugins' ) ) {
99
			return;
100
		}
101
102
		if ( ! function_exists( 'deactivate_plugins' ) ) {
103
			require_once( ABSPATH . 'wp-admin/includes/plugin.php' );
104
		}
105
106
		deactivate_plugins( dirname( dirname( __FILE__ ) ) . '/backupwordpress.php' );
107
108
		if ( isset( $_GET['activate'] ) ) {
109
			unset( $_GET['activate'] );
110
		}
111
112
	}
113
114
	/**
115
	 * Determine if this WordPress install meets the minimum requirements for BWP to run.
116
	 *
117
	 * @return bool
118
	 */
119
	public static function meets_requirements() {
120
121
		if ( false === self::is_supported_php_version() ) {
122
			return false;
123
		}
124
125
		if ( false === self::is_supported_wp_version() ) {
126
			return false;
127
		}
128
129
		return true;
130
	}
131
132
	/**
133
	 * Checks the current PHP version against the required version.
134
	 *
135
	 * @return bool 'Operator' parameter specified, returns a boolean.
136
	 */
137
	protected static function is_supported_php_version() {
138
139
		return version_compare( phpversion(), self::MIN_PHP_VERSION, '>=' );
140
	}
141
142
	/**
143
	 * Checks the current WordPress version against the required version.
144
	 *
145
	 * @return bool 'Operator' parameter specified, returns a boolean.
146
	 */
147
	protected static function is_supported_wp_version() {
148
149
		return version_compare( get_bloginfo( 'version' ), self::MIN_WP_VERSION, '>=' );
150
	}
151
152
	/**
153
	 * Displays a user friendly message in the WordPress admin.
154
	 */
155
	public static function display_admin_notices() {
156
157
		echo '<div class="error"><p>' . self::get_notice_message() . '</p></div>';
158
159
	}
160
161
	/**
162
	 * Returns a localized user friendly error message.
163
	 *
164
	 * @return string
165
	 */
166
	public static function get_notice_message() {
167
168
		return sprintf(
169
			__( 'BackUpWordPress requires PHP version %1$s or later and WordPress version %2$s or later to run. It has not been activated. %3$s%4$s%5$sLearn more%6$s', 'backupwordpress' ),
170
			self::MIN_PHP_VERSION,
171
			self::MIN_WP_VERSION,
172
			'<a href="',
173
			'https://bwp.hmn.md/unsupported-php-version-error/',
174
			'">',
175
			'</a>'
176
		);
177
	}
178
}
179