Issues (865)

Security Analysis    4 potential vulnerabilities

This project does not seem to handle request data directly as such no vulnerable execution paths were found.

  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.
  Regex Injection
Regex Injection enables an attacker to execute arbitrary code in your PHP process.
  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.
  Response Splitting
Response Splitting can be used to send arbitrary responses.
  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.
  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.
  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.
  Code Injection (1)
Code Injection enables an attacker to execute arbitrary code on the server.
  Variable Injection (2)
Variable Injection enables an attacker to overwrite program variables with custom data, and can lead to further vulnerabilities.
  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.
  Other Vulnerability
This category comprises other attack vectors such as manipulating the PHP runtime, loading custom extensions, freezing the runtime, or similar.
  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.
  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.
  Cross-Site Scripting (1)
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.
  Header Injection
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.

components/class-aui-component-pagination.php (3 issues)

1
<?php
2
3
if ( ! defined( 'ABSPATH' ) ) {
4
	exit; // Exit if accessed directly
5
}
6
7
/**
8
 * A component class for rendering a bootstrap pagination.
9
 *
10
 * @since 1.0.0
11
 */
12
class AUI_Component_Pagination {
13
14
	/**
15
	 * Build the component.
16
	 *
17
	 * @param array $args
18
	 *
19
	 * @return string The rendered component.
20
	 */
21
	public static function get( $args = array() ) {
22
		global $wp_query, $aui_bs5;
23
24
		$defaults = array(
25
			'class'              => '',
26
			'mid_size'           => 2,
27
			'prev_text'          => '<i class="fas fa-chevron-left"></i>',
28
			'next_text'          => '<i class="fas fa-chevron-right"></i>',
29
			'screen_reader_text' => __( 'Posts navigation', 'ayecode-connect' ),
30
			'before_paging'      => '',
31
			'after_paging'       => '',
32
			'type'               => 'array',
33
			'total'              => isset( $wp_query->max_num_pages ) ? $wp_query->max_num_pages : 1,
34
			'links'              => array(), // an array of links if using custom links, this includes the a tag.
35
			'rounded_style'      => false,
36
			'custom_next_text'   => '', // Custom next page text
37
			'custom_prev_text'   => '', // Custom prev page text
38
		);
39
40
		/**
41
		 * Parse incoming $args into an array and merge it with $defaults
42
		 */
43
		$args = wp_parse_args( $args, $defaults );
44
45
		$output = '';
46
47
		// Don't print empty markup if there's only one page.
48
		if ( $args['total'] > 1 ) {
49
			// Set up paginated links.
50
			$links = !empty(  $args['links'] ) ? $args['links'] :  paginate_links( $args );
51
52
			$class = !empty($args['class']) ? $args['class'] : '';
53
54
			$custom_prev_link = '';
55
			$custom_next_link = '';
56
57
			// make the output bootstrap ready
58
			$links_html = "<ul class='pagination m-0 p-0 $class'>";
59
			if ( ! empty( $links ) ) {
60
				foreach ( $links as $link ) {
61
					$_link = $link;
62
63
					if ( $aui_bs5 ) {
64
						$link_class = $args['rounded_style'] ? 'page-link badge rounded-pill border-0 mx-1 fs-base text-dark link-primary' : 'page-link';
65
						$link_class_active = $args['rounded_style'] ? ' current active fw-bold badge rounded-pill' : ' current active';
66
						$links_html .= "<li class='page-item mx-0'>";
67
						$link = str_replace( array( "page-numbers", " current" ), array( $link_class, $link_class_active ), $link );
68
						$link = str_replace( 'text-dark link-primary current', 'current', $link );
69
						$links_html .=  $link;
70
						$links_html .= "</li>";
71
					} else {
72
						$active = strpos( $link, 'current' ) !== false ? 'active' : '';
73
						$links_html .= "<li class='page-item $active'>";
74
						$links_html .= str_replace( "page-numbers", "page-link", $link );
75
						$links_html .= "</li>";
76
					}
77
78
					if ( strpos( $_link, 'next page-numbers' ) || strpos( $_link, 'prev page-numbers' ) ) {
79
						$link = str_replace( array( "page-numbers", " current" ), array( 'btn btn-outline-primary rounded' . ( $args['rounded_style'] ? '-pill' : '' ) . ' mx-1 fs-base text-dark link-primary', ' current active fw-bold badge rounded-pill' ), $_link );
80
						$link = str_replace( 'text-dark link-primary current', 'current', $link );
81
82
						if ( strpos( $_link, 'next page-numbers' ) && ! empty( $args['custom_next_text'] ) ) {
83
							$custom_next_link = str_replace( $args['next_text'], $args['custom_next_text'], $link );
84
						} else if ( strpos( $_link, 'prev page-numbers' ) && ! empty( $args['custom_prev_text'] ) ) {
85
							$custom_prev_link = str_replace( $args['prev_text'], $args['custom_prev_text'], $link );
86
						}
87
					}
88
				}
89
			}
90
			$links_html .= "</ul>";
91
92
			if ( $links ) {
93
				$output .= '<section class="px-0 py-2 w-100">';
94
				$output .= _navigation_markup( $links_html, 'aui-pagination', $args['screen_reader_text'] );
95
				$output .= '</section>';
96
			}
97
98
			$output = str_replace( "screen-reader-text", "screen-reader-text sr-only" . ( $aui_bs5 ? ' visually-hidden' : '' ), $output );
99
			$output = str_replace( "nav-links", "aui-nav-links", $output );
100
		}
101
102
		if ( $output ) {
103
			if ( $custom_next_link || $custom_prev_link ) {
0 ignored issues
show
Comprehensibility Best Practice introduced by
The variable $custom_next_link does not seem to be defined for all execution paths leading up to this point.
Loading history...
Comprehensibility Best Practice introduced by
The variable $custom_prev_link does not seem to be defined for all execution paths leading up to this point.
Loading history...
104
				$total   = isset( $wp_query->max_num_pages ) ? $wp_query->max_num_pages : 1;
0 ignored issues
show
The assignment to $total is dead and can be removed.
Loading history...
105
				$current = get_query_var( 'paged' ) ? (int) get_query_var( 'paged' ) : 1;
106
107
				$output = '<div class="row d-flex align-items-center justify-content-between"><div class="col text-start">' . $custom_prev_link . '</div><div class="col text-center d-none d-md-block">' . $output . '</div><div class="col text-center d-md-none">' . $current . '/' . $args['total'] . '</div><div class="col text-end">' . $custom_next_link . '</div></div>';
108
			}
109
110
			if ( ! empty( $args['before_paging'] ) ) {
111
				$output = $args['before_paging'] . $output;
112
			}
113
114
			if ( ! empty( $args['after_paging'] ) ) {
115
				$output = $output . $args['after_paging'];
116
			}
117
		}
118
119
		return $output;
120
	}
121
122
}