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 (4)

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.

modules/syndicate.php (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
<?php
2
class WP_SYNDICATE {
3
4
	public function __construct() {
5
		add_action( 'init', array( $this, 'init' ) );
6
		add_action( 'save_post', array( $this, 'save_meta_box' ) );
7
	}
8
9
	public function init() {
10
		$capabilities = array(
11
		    'read_wp_syndicate',
12
			'edit_wp_syndicate',
13
			'delete_wp_syndicate',
14
			'edit_wp_syndicates',
15
			'edit_others_wp_syndicates',
16
			'publish_wp_syndicates',
17
			'read_private_wp_syndicates',
18
			'delete_wp_syndicates',
19
			'delete_private_wp_syndicates',
20
			'delete_published_wp_syndicates',
21
			'delete_others_wp_syndicates',
22
			'edit_private_wp_syndicates',
23
			'edit_published_wp_syndicates',
24
		);
25
26
		$role = get_role( 'administrator' );
27
		foreach ( $capabilities as $cap ) {
28
			$role->add_cap( $cap );
29
		}
30
		register_post_type( 'wp-syndicate',
31
			array(
32
	    								'labels' => array( 'name' => __( 'Syndication', WPSYND_DOMAIN ) ),
33
	    								'public' => true,
34
	    								'publicly_queryable' => false,
35
										'has_archive' => false,
36
	    								'hierarchical' => false,
37
	    								'supports' => array( 'title' ),
38
	    								'rewrite' => false,
39
	    								'can_export' => true,
40
	    								'menu_position' => 28,
41
	    								'capability_type' => 'wp_syndicate',
42
										'capabilities'    => $capabilities,
43
										'map_meta_cap' => true,
44
										'register_meta_box_cb' => array( $this, 'add_meta_box' ),
45
	    							));
46
	}
47
48
	public function add_meta_box() {
49
		global $hook_suffix;
50
51
		add_meta_box( 'wp_syndicate_meta_box', __( 'configuration', WPSYND_DOMAIN ), array( $this, 'meta_box_wp_syndicate' ),'wp-syndicate' );
52
		if ( 'post.php' === $hook_suffix ) {
53
			add_meta_box( 'wp_syndicate_meta_box_import_test', __( 'Import Test', WPSYND_DOMAIN ), array( $this, 'meta_box_wp_syndicate_import_test' ),'wp-syndicate' );
54
		}
55
	}
56
57
	public function meta_box_wp_syndicate() {
58
		wp_nonce_field( 'wp_syndicate_meta_box', 'wp_syndicate_meta_box_nonce' );
59
60
		$feed_url = get_post_meta( get_the_ID(), 'wp_syndicate-feed-url', true );
61
		$feed_retrieve_term = get_post_meta( get_the_ID(), 'wp_syndicate-feed-retrieve-term', true );
62
		$author_id = get_post_meta( get_the_ID(), 'wp_syndicate-author-id', true );
63
		$statuses = get_post_statuses();
64
		unset( $statuses['pending'] );
65
		$status = get_post_meta( get_the_ID(), 'wp_syndicate-default-post-status', true );
66
		$post_types = get_post_types( array( 'public' => true ) );
67
		$post_type = get_post_meta( get_the_ID(), 'wp_syndicate-default-post-type', true );
68
		$registration_method = get_post_meta( get_the_ID(), 'wp_syndicate-registration-method', true );
69
		$user_id = get_post_meta( get_the_ID(), 'wp_syndicate-basic-auth-user', true );
70
		$password = get_post_meta( get_the_ID(), 'wp_syndicate-basic-auth-pass', true );
71
72
?>
73
<table class="form-table">
74
<tr><th><?php esc_html_e( 'feed URL', WPSYND_DOMAIN ) ?></th><td><input type="text" name="wp_syndicate-feed-url" size="40" value="<?php echo esc_attr( $feed_url ); ?>" /></td></tr>
75
<tr><th><?php esc_html_e( 'feed retrieve term', WPSYND_DOMAIN ) ?></th><td><input type="number" step="1" min="1" max="999" name="wp_syndicate-feed-retrieve-term" size="20" value="<?php echo esc_attr( $feed_retrieve_term ); ?>" /> <?php esc_html_e( 'min', WPSYND_DOMAIN ) ?></td></tr>
76
<tr><th><?php esc_html_e( 'Author ID', WPSYND_DOMAIN ) ?></th><td><input type="text" name="wp_syndicate-author-id" size="7" value="<?php echo esc_attr( $author_id ); ?>" /></td></tr>
77
<tr><th><?php esc_html_e( 'Default Post Type', WPSYND_DOMAIN ) ?></th>
78
<td>
79
<select name="wp_syndicate-default-post-type">
80
<?php foreach ( $post_types as $key => $val ) : ?>
81
	<option <?php selected( $post_type, $key ); ?> value="<?php echo esc_attr( $key ); ?>"><?php echo esc_attr( $val ); ?></option>
82
<?php endforeach; ?>
83
</select>
84
</td></tr>
85
<tr><th><?php esc_html_e( 'Default Post Status', WPSYND_DOMAIN ) ?></th>
86
<td>
87
<select name="wp_syndicate-default-post-status">
88
<?php foreach ( $statuses as $key => $val ) : ?>
89
	<option <?php selected( $status, $key ); ?> value="<?php echo esc_attr( $key ); ?>"><?php echo esc_attr( $val ); ?></option>
90
<?php endforeach; ?>
91
</select>
92
</td></tr>
93
<tr><th><?php esc_html_e( 'Registration method', WPSYND_DOMAIN ) ?></th>
94
<td>
95
<select name="wp_syndicate-registration-method">
96
	<option <?php selected( $registration_method, 'insert' ); ?> value="insert">insert only</option>
97
	<option <?php selected( $registration_method, 'insert-or-update' ); ?> value="insert-or-update">insert or update</option>
98
</select>
99
</td></tr>
100
<tr><th><?php esc_html_e( 'Basic Auth User ID', WPSYND_DOMAIN ) ?></th><td><input type="text" name="wp_syndicate-basic-auth-user" size="40" value="<?php echo esc_attr( $user_id ); ?>" /></td></tr>
101
<tr><th><?php esc_html_e( 'Basic Auth Password', WPSYND_DOMAIN ) ?></th><td><input type="password" name="wp_syndicate-basic-auth-pass" size="40" value="<?php echo esc_attr( $password ); ?>" /></td></tr>
102
<?php do_action( 'wp_syndicate_add_metabox' ); ?>
103
</table>
104
<?php
105
	}
106
107
	public function meta_box_wp_syndicate_import_test($post) {
0 ignored issues
show
The parameter $post is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
108
		submit_button( 'Save and Test Excute', 'primary', 'wp_syndicate_import_test_excute' );
109
	}
110
111
	public function save_meta_box( $post_id ) {
112
		if ( wp_is_post_revision( $post_id ) || get_post_type() !== 'wp-syndicate' || ! current_user_can( 'edit_wp_syndicate', $post_id )
113
				|| ! isset( $_POST['wp_syndicate_meta_box_nonce'] ) || ! wp_verify_nonce( $_POST['wp_syndicate_meta_box_nonce'], 'wp_syndicate_meta_box' ) ) {
114
			return;
115
		}
116
117
		isset( $_POST['wp_syndicate-feed-url'] ) && update_post_meta( $post_id, 'wp_syndicate-feed-url', esc_url( $_POST['wp_syndicate-feed-url'] ) );
118
		isset( $_POST['wp_syndicate-feed-retrieve-term'] ) && update_post_meta( $post_id, 'wp_syndicate-feed-retrieve-term', absint( $_POST['wp_syndicate-feed-retrieve-term'] ) );
119
		isset( $_POST['wp_syndicate-author-id'] ) && update_post_meta( $post_id, 'wp_syndicate-author-id', absint( $_POST['wp_syndicate-author-id'] ) );
120
		isset( $_POST['wp_syndicate-default-post-status'] ) && update_post_meta( $post_id, 'wp_syndicate-default-post-status', trim( $_POST['wp_syndicate-default-post-status'] ) );
121
		isset( $_POST['wp_syndicate-default-post-type'] ) && update_post_meta( $post_id, 'wp_syndicate-default-post-type', trim( $_POST['wp_syndicate-default-post-type'] ) );
122
		isset( $_POST['wp_syndicate-registration-method'] ) && update_post_meta( $post_id, 'wp_syndicate-registration-method', trim( $_POST['wp_syndicate-registration-method'] ) );
123
		isset( $_POST['wp_syndicate-basic-auth-user'] ) && update_post_meta( $post_id, 'wp_syndicate-basic-auth-user', trim( $_POST['wp_syndicate-basic-auth-user'] ) );
124
		isset( $_POST['wp_syndicate-basic-auth-pass'] ) && update_post_meta( $post_id, 'wp_syndicate-basic-auth-pass', trim( $_POST['wp_syndicate-basic-auth-pass'] ) );
125
126
		if ( isset( $_POST['wp_syndicate_import_test_excute'] ) ) {
127
			remove_action( 'save_post', array( $this, 'save_meta_box' ) );
128
			$action = new WP_SYND_Action();
129
			$action->import( $post_id );
130
			add_action( 'save_post', array( $this, 'save_meta_box' ) );
131
		}
132
		
133
		do_action( 'wp_syndicate_save_meta_box', $post_id );
134
	}
135
}
136
new WP_SYNDICATE();
137