includes/Functions.php
Function dfp_get_ad_positions
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
Open
function dfp_get_ad_positions() {
$args = array(
'post_type' => 'dfp_ads',
'post_status' => 'publish',
'posts_per_page' => - 1,
- Read upRead up
- Create a ticketCreate a ticket
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function dfp_get_ad_sizes
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
Open
function dfp_get_ad_sizes( $size_string ) {
$sizes_array = array();
// Check if there are any sizes to explode
if ( strlen( $size_string ) > 0 ) {
$sizes = explode( ',', $size_string );
- Read upRead up
- Create a ticketCreate a ticket
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Blank line found at start of control structure Open
Open
if ( ! is_array( $input ) ) {
- Create a ticketCreate a ticket
- Exclude checks
Expected 0 spaces between argument "$id" and closing bracket; 1 found Open
Open
function dfp_ad_position( $id ) {
- Create a ticketCreate a ticket
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
Open
if ( strlen( $size_string ) > 0 ) {
- Create a ticketCreate a ticket
- Exclude checks
Expected 0 spaces between opening bracket and argument "$post_id"; 1 found Open
Open
function dfp_ads_shortcode_field( $post_id ) {
- Create a ticketCreate a ticket
- Exclude checks
Expected 0 spaces between argument "$setting" and closing bracket; 1 found Open
Open
function dfp_get_settings_value( $setting ) {
- Create a ticketCreate a ticket
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
Open
if ( $position !== null && $position->post_type === 'dfp_ads' ) {
- Create a ticketCreate a ticket
- Exclude checks
Space found before closing bracket of FOREACH loop Open
Open
foreach ( $sizes as $size ) {
- Create a ticketCreate a ticket
- Exclude checks
Expected 0 spaces between opening bracket and argument "$setting"; 1 found Open
Open
function dfp_get_settings_value( $setting ) {
- Create a ticketCreate a ticket
- Exclude checks
Space found after opening bracket of FOREACH loop Open
Open
foreach ( $positions as $position ) {
- Create a ticketCreate a ticket
- Exclude checks
Space found after opening bracket of FOREACH loop Open
Open
foreach ( $positions as $key => $position ) {
- Create a ticketCreate a ticket
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
Open
foreach ( $positions as $key => $position ) {
- Create a ticketCreate a ticket
- Exclude checks
Blank line found at start of control structure Open
Open
if ( ! is_array( $array ) ) {
- Create a ticketCreate a ticket
- Exclude checks
Expected 0 spaces between opening bracket and argument "$input"; 1 found Open
Open
function dfp_trim_array( $input ) {
- Create a ticketCreate a ticket
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
Open
if ( ! is_array( $input ) ) {
- Create a ticketCreate a ticket
- Exclude checks
Expected 0 spaces between opening bracket and argument "$value"; 1 found Open
Open
function dfp_ad_select_options( $value ) {
- Create a ticketCreate a ticket
- Exclude checks
Expected 0 spaces between argument "$size_string" and closing bracket; 1 found Open
Open
function dfp_get_ad_sizes( $size_string ) {
- Create a ticketCreate a ticket
- Exclude checks
Expected 0 spaces between opening bracket and argument "$array"; 1 found Open
Open
function dfp_intval_array( $array ) {
- Create a ticketCreate a ticket
- Exclude checks
Expected 0 spaces between argument "$post_id" and closing bracket; 1 found Open
Open
function dfp_ads_shortcode_field( $post_id ) {
- Create a ticketCreate a ticket
- Exclude checks
Expected 0 spaces between argument "$array" and closing bracket; 1 found Open
Open
function dfp_intval_array( $array ) {
- Create a ticketCreate a ticket
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
Open
foreach ( $sizes as $size ) {
- Create a ticketCreate a ticket
- Exclude checks
Expected 0 spaces between opening bracket and argument "$id"; 1 found Open
Open
function dfp_ad_position( $id ) {
- Create a ticketCreate a ticket
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
Open
if ( ! is_array( $array ) ) {
- Create a ticketCreate a ticket
- Exclude checks
Space found before closing bracket of FOREACH loop Open
Open
foreach ( $positions as $position ) {
- Create a ticketCreate a ticket
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
Open
if ( $all_ads->have_posts() ) {
- Create a ticketCreate a ticket
- Exclude checks
Expected 0 spaces between opening bracket and argument "$id"; 1 found Open
Open
function dfp_get_ad_position( $id ) {
- Create a ticketCreate a ticket
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
Open
if ( $position->post_id == null ) {
- Create a ticketCreate a ticket
- Exclude checks
Blank line found at start of control structure Open
Open
if ( $position !== null && $position->post_type === 'dfp_ads' ) {
- Create a ticketCreate a ticket
- Exclude checks
Expected 0 spaces between argument "$id" and closing bracket; 1 found Open
Open
function dfp_get_ad_position( $id ) {
- Create a ticketCreate a ticket
- Exclude checks
Expected 0 spaces between opening bracket and argument "$title"; 1 found Open
Open
function dfp_get_ad_position_by_name( $title ) {
- Create a ticketCreate a ticket
- Exclude checks
Expected 0 spaces between opening bracket and argument "$size_string"; 1 found Open
Open
function dfp_get_ad_sizes( $size_string ) {
- Create a ticketCreate a ticket
- Exclude checks
Expected 0 spaces between argument "$input" and closing bracket; 1 found Open
Open
function dfp_trim_array( $input ) {
- Create a ticketCreate a ticket
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
Open
if ( $_SERVER["SERVER_PORT"] != "80" ) {
- Create a ticketCreate a ticket
- Exclude checks
Expected 0 spaces between argument "$value" and closing bracket; 1 found Open
Open
function dfp_ad_select_options( $value ) {
- Create a ticketCreate a ticket
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
Open
while ( $all_ads->have_posts() ) :
- Create a ticketCreate a ticket
- Exclude checks
Space found before closing bracket of FOREACH loop Open
Open
foreach ( $positions as $key => $position ) {
- Create a ticketCreate a ticket
- Exclude checks
Expected 0 spaces between argument "$title" and closing bracket; 1 found Open
Open
function dfp_get_ad_position_by_name( $title ) {
- Create a ticketCreate a ticket
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
Open
if ( count( $sizes ) > 1 ) {
- Create a ticketCreate a ticket
- Exclude checks
Space found after opening bracket of FOREACH loop Open
Open
foreach ( $sizes as $size ) {
- Create a ticketCreate a ticket
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
Open
foreach ( $positions as $position ) {
- Create a ticketCreate a ticket
- Exclude checks
Blank line found at start of control structure Open
Open
} else {
- Create a ticketCreate a ticket
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
Open
if ( isset( $_SERVER["HTTPS"] ) && $_SERVER["HTTPS"] == "on" ) {
- Create a ticketCreate a ticket
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
endwhile;
- Create a ticketCreate a ticket
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
return false;
- Create a ticketCreate a ticket
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
}
- Create a ticketCreate a ticket
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
$positions = dfp_get_ad_positions();
- Create a ticketCreate a ticket
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
if ( $all_ads->have_posts() ) {
- Create a ticketCreate a ticket
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
while ( $all_ads->have_posts() ) :
- Create a ticketCreate a ticket
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
}
- Create a ticketCreate a ticket
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
// Trim array and eval everything into integers
- Create a ticketCreate a ticket
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
<input style="text-align:center;" type="text" readonly
- Create a ticketCreate a ticket
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
$option_array = get_option( 'DFP_Ads_Settings' );
- Create a ticketCreate a ticket
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
echo '<option' . selected( $value, $position->post_id ) . ' value="' . $position->post_id . '">(' . $position->post_id . ') ' . $position->title . '</option>';
- Create a ticketCreate a ticket
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
if ( $position !== null && $position->post_type === 'dfp_ads' ) {
- Create a ticketCreate a ticket
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
return ( $position->post_type !== 'dfp_ads' ? false : new DFP_Ad_Position( $position->ID ) );
- Create a ticketCreate a ticket
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
// Check if there are any sizes to explode
- Create a ticketCreate a ticket
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
}
- Create a ticketCreate a ticket
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
}
- Create a ticketCreate a ticket
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
}
- Create a ticketCreate a ticket
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
return new DFP_Ad_Position( $position->ID );
- Create a ticketCreate a ticket
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
if ( ! is_array( $input ) ) {
- Create a ticketCreate a ticket
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
if ( $_SERVER["SERVER_PORT"] != "80" ) {
- Create a ticketCreate a ticket
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
$position = new DFP_Ad_Position( $id );
- Create a ticketCreate a ticket
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
'post_type' => 'dfp_ads',
- Create a ticketCreate a ticket
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
return apply_filters( DFP_Ads_Post_Type::FIELDS_FILTER, array() );
- Create a ticketCreate a ticket
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
}
- Create a ticketCreate a ticket
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
if ( isset( $_SERVER["HTTPS"] ) && $_SERVER["HTTPS"] == "on" ) {
- Create a ticketCreate a ticket
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
$pageURL .= "://";
- Create a ticketCreate a ticket
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
} else {
- Create a ticketCreate a ticket
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
}
- Create a ticketCreate a ticket
- Exclude checks
Line exceeds 120 characters; contains 167 characters Open
Open
echo '<option' . selected( $value, $position->post_id ) . ' value="' . $position->post_id . '">(' . $position->post_id . ') ' . $position->title . '</option>';
- Create a ticketCreate a ticket
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
}
- Create a ticketCreate a ticket
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
if ( $position->post_id == null ) {
- Create a ticketCreate a ticket
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
/**
- Create a ticketCreate a ticket
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
}
- Create a ticketCreate a ticket
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
$positions = array();
- Create a ticketCreate a ticket
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
$position = apply_filters( 'get_dfp_ad_position', get_post( $id ) );
- Create a ticketCreate a ticket
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
if ( ! is_array( $array ) ) {
- Create a ticketCreate a ticket
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
$sizes_array[] = explode( 'x', $size );
- Create a ticketCreate a ticket
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
return array_map( 'dfp_trim_array', $input );
- Create a ticketCreate a ticket
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
$pageURL .= "s";
- Create a ticketCreate a ticket
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
$all_ads = new WP_Query( $args );
- Create a ticketCreate a ticket
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
$all_ads->the_post();
- Create a ticketCreate a ticket
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
unset( $positions[ $key ] );
- Create a ticketCreate a ticket
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
'post_status' => 'publish',
- Create a ticketCreate a ticket
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
return null;
- Create a ticketCreate a ticket
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
return trim( $input );
- Create a ticketCreate a ticket
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
return $pageURL;
- Create a ticketCreate a ticket
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
$position->display_position();
- Create a ticketCreate a ticket
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
'ignore_sticky_posts' => 1
- Create a ticketCreate a ticket
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
foreach ( $positions as $key => $position ) {
- Create a ticketCreate a ticket
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
$positions[] = new DFP_Ad_Position( get_the_ID() );
- Create a ticketCreate a ticket
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
$sizes = explode( ',', $size_string );
- Create a ticketCreate a ticket
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
} else {
- Create a ticketCreate a ticket
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
$sizes_array = array();
- Create a ticketCreate a ticket
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
if ( count( $sizes ) > 1 ) {
- Create a ticketCreate a ticket
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
$sizes_array = explode( 'x', $sizes[0] );
- Create a ticketCreate a ticket
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
return intval( $array );
- Create a ticketCreate a ticket
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
return array_map( 'dfp_intval_array', $array );
- Create a ticketCreate a ticket
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
value="<?php printf( __( '[dfp_ads id=%1s]', 'dfp-ads' ), $post_id ); ?>"/>
- Create a ticketCreate a ticket
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
foreach ( $positions as $position ) {
- Create a ticketCreate a ticket
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
echo '<option value="false">Select Position</option>';
- Create a ticketCreate a ticket
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
$args = array(
- Create a ticketCreate a ticket
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
* @var WP_Query $all_ads
- Create a ticketCreate a ticket
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
wp_reset_query();
- Create a ticketCreate a ticket
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
} else {
- Create a ticketCreate a ticket
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
return dfp_intval_array( dfp_trim_array( $sizes_array ) );
- Create a ticketCreate a ticket
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
?>
- Create a ticketCreate a ticket
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
$pageURL = 'http';
- Create a ticketCreate a ticket
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
$pageURL .= $_SERVER["SERVER_NAME"] . ":" . $_SERVER["SERVER_PORT"] . $_SERVER["REQUEST_URI"];
- Create a ticketCreate a ticket
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
return ( isset( $option_array[ $setting ] ) ? $option_array[ $setting ] : null );
- Create a ticketCreate a ticket
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
return $positions;
- Create a ticketCreate a ticket
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
$position = apply_filters( 'get_dfp_ad_position', get_page_by_title( $title, $output = 'OBJECT', $post_type = 'dfp_ads' ) );
- Create a ticketCreate a ticket
- Exclude checks
Line exceeds 120 characters; contains 128 characters Open
Open
$position = apply_filters( 'get_dfp_ad_position', get_page_by_title( $title, $output = 'OBJECT', $post_type = 'dfp_ads' ) );
- Create a ticketCreate a ticket
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
if ( strlen( $size_string ) > 0 ) {
- Create a ticketCreate a ticket
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
foreach ( $sizes as $size ) {
- Create a ticketCreate a ticket
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
}
- Create a ticketCreate a ticket
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
$pageURL .= $_SERVER["SERVER_NAME"] . $_SERVER["REQUEST_URI"];
- Create a ticketCreate a ticket
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
'posts_per_page' => - 1,
- Create a ticketCreate a ticket
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
);
- Create a ticketCreate a ticket
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
*/
- Create a ticketCreate a ticket
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
}
- Create a ticketCreate a ticket
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
} else {
- Create a ticketCreate a ticket
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
}
- Create a ticketCreate a ticket
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
<?php
- Create a ticketCreate a ticket
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
Open
unset( $positions[ $key ] );
- Create a ticketCreate a ticket
- Exclude checks
Space after opening parenthesis of function call prohibited Open
Open
$position = apply_filters( 'get_dfp_ad_position', get_post( $id ) );
- Create a ticketCreate a ticket
- Exclude checks
Space after opening parenthesis of function call prohibited Open
Open
$position = apply_filters( 'get_dfp_ad_position', get_post( $id ) );
- Create a ticketCreate a ticket
- Exclude checks
Opening brace should be on a new line Open
Open
function dfp_get_ad_position_by_name( $title ) {
- Create a ticketCreate a ticket
- Exclude checks
Space after opening parenthesis of function call prohibited Open
Open
if ( strlen( $size_string ) > 0 ) {
- Create a ticketCreate a ticket
- Exclude checks
Space after opening parenthesis of function call prohibited Open
Open
echo '<option' . selected( $value, $position->post_id ) . ' value="' . $position->post_id . '">(' . $position->post_id . ') ' . $position->title . '</option>';
- Create a ticketCreate a ticket
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
Open
$position = apply_filters( 'get_dfp_ad_position', get_page_by_title( $title, $output = 'OBJECT', $post_type = 'dfp_ads' ) );
- Create a ticketCreate a ticket
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
Open
return ( isset( $option_array[ $setting ] ) ? $option_array[ $setting ] : null );
- Create a ticketCreate a ticket
- Exclude checks
Opening brace should be on a new line Open
Open
function dfp_get_ad_position( $id ) {
- Create a ticketCreate a ticket
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
Open
$position = apply_filters( 'get_dfp_ad_position', get_post( $id ) );
- Create a ticketCreate a ticket
- Exclude checks
Space after opening parenthesis of function call prohibited Open
Open
$sizes = explode( ',', $size_string );
- Create a ticketCreate a ticket
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
Open
if ( ! is_array( $input ) ) {
- Create a ticketCreate a ticket
- Exclude checks
Space after opening parenthesis of function call prohibited Open
Open
$option_array = get_option( 'DFP_Ads_Settings' );
- Create a ticketCreate a ticket
- Exclude checks
Space after opening parenthesis of function call prohibited Open
Open
return ( isset( $option_array[ $setting ] ) ? $option_array[ $setting ] : null );
- Create a ticketCreate a ticket
- Exclude checks
Expected 0 spaces after opening bracket; 1 found Open
Open
foreach ( $positions as $position ) {
- Create a ticketCreate a ticket
- Exclude checks
Opening brace should be on a new line Open
Open
function dfp_get_ad_positions() {
- Create a ticketCreate a ticket
- Exclude checks
Expected 0 spaces after opening bracket; 1 found Open
Open
while ( $all_ads->have_posts() ) :
- Create a ticketCreate a ticket
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
Open
if ( strlen( $size_string ) > 0 ) {
- Create a ticketCreate a ticket
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
Open
if ( isset( $_SERVER["HTTPS"] ) && $_SERVER["HTTPS"] == "on" ) {
- Create a ticketCreate a ticket
- Exclude checks
Expected 0 spaces after opening bracket; 1 found Open
Open
if ( $all_ads->have_posts() ) {
- Create a ticketCreate a ticket
- Exclude checks
Space after opening parenthesis of function call prohibited Open
Open
return new DFP_Ad_Position( $position->ID );
- Create a ticketCreate a ticket
- Exclude checks
Space after opening parenthesis of function call prohibited Open
Open
return intval( $array );
- Create a ticketCreate a ticket
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
Open
$sizes_array = explode( 'x', $sizes[0] );
- Create a ticketCreate a ticket
- Exclude checks
Space after opening parenthesis of function call prohibited Open
Open
return array_map( 'dfp_intval_array', $array );
- Create a ticketCreate a ticket
- Exclude checks
Space after opening parenthesis of function call prohibited Open
Open
if ( ! is_array( $input ) ) {
- Create a ticketCreate a ticket
- Exclude checks
Space after opening parenthesis of function call prohibited Open
Open
if ( isset( $_SERVER["HTTPS"] ) && $_SERVER["HTTPS"] == "on" ) {
- Create a ticketCreate a ticket
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
Open
$option_array = get_option( 'DFP_Ads_Settings' );
- Create a ticketCreate a ticket
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
Open
$positions[] = new DFP_Ad_Position( get_the_ID() );
- Create a ticketCreate a ticket
- Exclude checks
Expected 0 spaces after opening bracket; 1 found Open
Open
if ( $position !== null && $position->post_type === 'dfp_ads' ) {
- Create a ticketCreate a ticket
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
Open
return ( $position->post_type !== 'dfp_ads' ? false : new DFP_Ad_Position( $position->ID ) );
- Create a ticketCreate a ticket
- Exclude checks
Space after opening parenthesis of function call prohibited Open
Open
return ( $position->post_type !== 'dfp_ads' ? false : new DFP_Ad_Position( $position->ID ) );
- Create a ticketCreate a ticket
- Exclude checks
Space after opening parenthesis of function call prohibited Open
Open
if ( count( $sizes ) > 1 ) {
- Create a ticketCreate a ticket
- Exclude checks
Space after opening parenthesis of function call prohibited Open
Open
if ( ! is_array( $array ) ) {
- Create a ticketCreate a ticket
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
Open
return dfp_intval_array( dfp_trim_array( $sizes_array ) );
- Create a ticketCreate a ticket
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
Open
return dfp_intval_array( dfp_trim_array( $sizes_array ) );
- Create a ticketCreate a ticket
- Exclude checks
Space after opening parenthesis of function call prohibited Open
Open
value="<?php printf( __( '[dfp_ads id=%1s]', 'dfp-ads' ), $post_id ); ?>"/>
- Create a ticketCreate a ticket
- Exclude checks
Opening brace should be on a new line Open
Open
function dfp_get_settings_value( $setting ) {
- Create a ticketCreate a ticket
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
Open
$position = apply_filters( 'get_dfp_ad_position', get_page_by_title( $title, $output = 'OBJECT', $post_type = 'dfp_ads' ) );
- Create a ticketCreate a ticket
- Exclude checks
Opening brace should be on a new line Open
Open
function dfp_get_ad_sizes( $size_string ) {
- Create a ticketCreate a ticket
- Exclude checks
Expected 0 spaces after opening bracket; 1 found Open
Open
if ( strlen( $size_string ) > 0 ) {
- Create a ticketCreate a ticket
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
Open
if ( count( $sizes ) > 1 ) {
- Create a ticketCreate a ticket
- Exclude checks
Opening brace should be on a new line Open
Open
function dfp_trim_array( $input ) {
- Create a ticketCreate a ticket
- Exclude checks
Space after opening parenthesis of function call prohibited Open
Open
$position = new DFP_Ad_Position( $id );
- Create a ticketCreate a ticket
- Exclude checks
Space after opening parenthesis of function call prohibited Open
Open
$positions[] = new DFP_Ad_Position( get_the_ID() );
- Create a ticketCreate a ticket
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
Open
return array_map( 'dfp_trim_array', $input );
- Create a ticketCreate a ticket
- Exclude checks
Expected 0 spaces after opening bracket; 1 found Open
Open
if ( $_SERVER["SERVER_PORT"] != "80" ) {
- Create a ticketCreate a ticket
- Exclude checks
Space after opening parenthesis of function call prohibited Open
Open
$all_ads = new WP_Query( $args );
- Create a ticketCreate a ticket
- Exclude checks
Expected 0 spaces after opening bracket; 1 found Open
Open
foreach ( $positions as $key => $position ) {
- Create a ticketCreate a ticket
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
Open
return new DFP_Ad_Position( $position->ID );
- Create a ticketCreate a ticket
- Exclude checks
Space after opening parenthesis of function call prohibited Open
Open
$position = apply_filters( 'get_dfp_ad_position', get_page_by_title( $title, $output = 'OBJECT', $post_type = 'dfp_ads' ) );
- Create a ticketCreate a ticket
- Exclude checks
Space after opening parenthesis of function call prohibited Open
Open
return apply_filters( DFP_Ads_Post_Type::FIELDS_FILTER, array() );
- Create a ticketCreate a ticket
- Exclude checks
Expected 0 spaces after opening bracket; 1 found Open
Open
foreach ( $sizes as $size ) {
- Create a ticketCreate a ticket
- Exclude checks
Space after opening parenthesis of function call prohibited Open
Open
$sizes_array = explode( 'x', $sizes[0] );
- Create a ticketCreate a ticket
- Exclude checks
Space after opening parenthesis of function call prohibited Open
Open
return array_map( 'dfp_trim_array', $input );
- Create a ticketCreate a ticket
- Exclude checks
Space after opening parenthesis of function call prohibited Open
Open
value="<?php printf( __( '[dfp_ads id=%1s]', 'dfp-ads' ), $post_id ); ?>"/>
- Create a ticketCreate a ticket
- Exclude checks
Opening brace should be on a new line Open
Open
function dfp_ads_shortcode_field( $post_id ) {
- Create a ticketCreate a ticket
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
Open
if ( ! is_array( $array ) ) {
- Create a ticketCreate a ticket
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
Open
return array_map( 'dfp_intval_array', $array );
- Create a ticketCreate a ticket
- Exclude checks
Space after opening parenthesis of function call prohibited Open
Open
return trim( $input );
- Create a ticketCreate a ticket
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
Open
$all_ads = new WP_Query( $args );
- Create a ticketCreate a ticket
- Exclude checks
Expected 0 spaces after opening bracket; 1 found Open
Open
if ( count( $sizes ) > 1 ) {
- Create a ticketCreate a ticket
- Exclude checks
Space after opening parenthesis of function call prohibited Open
Open
$sizes_array[] = explode( 'x', $size );
- Create a ticketCreate a ticket
- Exclude checks
Space after opening parenthesis of function call prohibited Open
Open
return dfp_intval_array( dfp_trim_array( $sizes_array ) );
- Create a ticketCreate a ticket
- Exclude checks
Expected 0 spaces after opening bracket; 1 found Open
Open
if ( ! is_array( $array ) ) {
- Create a ticketCreate a ticket
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
Open
$position = new DFP_Ad_Position( $id );
- Create a ticketCreate a ticket
- Exclude checks
Expected 0 spaces after opening bracket; 1 found Open
Open
if ( $position->post_id == null ) {
- Create a ticketCreate a ticket
- Exclude checks
Space after opening parenthesis of function call prohibited Open
Open
unset( $positions[ $key ] );
- Create a ticketCreate a ticket
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
Open
$position = apply_filters( 'get_dfp_ad_position', get_post( $id ) );
- Create a ticketCreate a ticket
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
Open
return apply_filters( DFP_Ads_Post_Type::FIELDS_FILTER, array() );
- Create a ticketCreate a ticket
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
Open
value="<?php printf( __( '[dfp_ads id=%1s]', 'dfp-ads' ), $post_id ); ?>"/>
- Create a ticketCreate a ticket
- Exclude checks
Opening brace should be on a new line Open
Open
function dfp_get_url() {
- Create a ticketCreate a ticket
- Exclude checks
Expected 0 spaces after opening bracket; 1 found Open
Open
if ( isset( $_SERVER["HTTPS"] ) && $_SERVER["HTTPS"] == "on" ) {
- Create a ticketCreate a ticket
- Exclude checks
Opening brace should be on a new line Open
Open
function dfp_ad_select_options( $value ) {
- Create a ticketCreate a ticket
- Exclude checks
Opening brace should be on a new line Open
Open
function dfp_ad_position( $id ) {
- Create a ticketCreate a ticket
- Exclude checks
Space after opening parenthesis of function call prohibited Open
Open
$position = apply_filters( 'get_dfp_ad_position', get_page_by_title( $title, $output = 'OBJECT', $post_type = 'dfp_ads' ) );
- Create a ticketCreate a ticket
- Exclude checks
Opening brace should be on a new line Open
Open
function dfp_get_fields() {
- Create a ticketCreate a ticket
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
Open
$sizes = explode( ',', $size_string );
- Create a ticketCreate a ticket
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
Open
$sizes_array[] = explode( 'x', $size );
- Create a ticketCreate a ticket
- Exclude checks
Space after opening parenthesis of function call prohibited Open
Open
return dfp_intval_array( dfp_trim_array( $sizes_array ) );
- Create a ticketCreate a ticket
- Exclude checks
Opening brace should be on a new line Open
Open
function dfp_intval_array( $array ) {
- Create a ticketCreate a ticket
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
Open
return intval( $array );
- Create a ticketCreate a ticket
- Exclude checks
Expected 0 spaces after opening bracket; 1 found Open
Open
if ( ! is_array( $input ) ) {
- Create a ticketCreate a ticket
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
Open
return trim( $input );
- Create a ticketCreate a ticket
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
Open
value="<?php printf( __( '[dfp_ads id=%1s]', 'dfp-ads' ), $post_id ); ?>"/>
- Create a ticketCreate a ticket
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
Open
echo '<option' . selected( $value, $position->post_id ) . ' value="' . $position->post_id . '">(' . $position->post_id . ') ' . $position->title . '</option>';
- Create a ticketCreate a ticket
- Exclude checks