ThatGerber/dfp-ads

View on GitHub
includes/DFP_Ads.php

Summary

Maintainability
A
25 mins
Test Coverage

Function get_tag_targeting has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    protected function get_tag_targeting() {
        global $post;
        $targets = array();
        if ( $post ) {
            $tags = get_the_tags( $post->ID );
Severity: Minor
Found in includes/DFP_Ads.php - About 25 mins to fix

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

PHP keywords must be lowercase; expected "class" but found "Class"
Open

Class DFP_Ads {
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Method name "DFP_Ads::set_asynchronous_loading" is not in camel caps format
Open

    public function set_asynchronous_loading( $val ) {
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Opening brace of a class must be on the line after the definition
Open

Class DFP_Ads {
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Expected 0 spaces between opening bracket and argument "$id"; 1 found
Open

    public function set_account_id( $id ) {
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Expected 0 spaces between argument "$val" and closing bracket; 1 found
Open

    public function set_asynchronous_loading( $val ) {
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Method name "DFP_Ads::set_account_id" is not in camel caps format
Open

    public function set_account_id( $id ) {
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Method name "DFP_Ads::set_targeting" is not in camel caps format
Open

    public function set_targeting() {
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Expected 0 spaces between opening bracket and argument "$val"; 1 found
Open

    public function set_asynchronous_loading( $val ) {
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Expected 0 spaces between argument "$id" and closing bracket; 1 found
Open

    public function set_account_id( $id ) {
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Blank line found at end of control structure
Open


Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Expected 0 spaces before closing bracket; 1 found
Open

        if ( defined( 'DFP_CONCAT_SCRIPTS' ) && true === DFP_CONCAT_SCRIPTS ) {
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Space found before closing bracket of FOREACH loop
Open

                foreach ( $tags as $tag ) {
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Expected 0 spaces before closing bracket; 1 found
Open

            if ( count( $url_parts ) >= 2 ) {
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Method name "DFP_Ads::get_category_targeting" is not in camel caps format
Open

    protected function get_category_targeting() {
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Expected 0 spaces between argument "$atts" and closing bracket; 1 found
Open

    public function shortcode( $atts ) {
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Method name "DFP_Ads::get_page_targeting" is not in camel caps format
Open

    protected function get_page_targeting() {
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

The closing brace for the Class must go on the next line after the body
Open

}
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Space found after opening bracket of FOREACH loop
Open

            foreach ( $categories as $c ) {
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Expected 0 spaces before closing bracket; 1 found
Open

            if ( $tags ) {
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Expected 0 spaces between opening bracket and argument "$atts"; 1 found
Open

    public function shortcode( $atts ) {
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Expected 0 spaces between opening bracket and argument "$dfp_ads"; 1 found
Open

    public function send_ads_to_js( $dfp_ads ) {
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Expected 0 spaces between argument "$dfp_ads" and closing bracket; 1 found
Open

    public function send_ads_to_js( $dfp_ads ) {
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Expected 0 spaces before closing bracket; 1 found
Open

        if ( $wp->request != null ) {
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Expected 0 spaces before closing bracket; 1 found
Open

                foreach ( $tags as $tag ) {
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Method name "DFP_Ads::send_ads_to_js" is not in camel caps format
Open

    public function send_ads_to_js( $dfp_ads ) {
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Expected 0 spaces before closing bracket; 1 found
Open

            foreach ( $categories as $c ) {
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Method name "DFP_Ads::scripts_and_styles" is not in camel caps format
Open

    public function scripts_and_styles() {
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Expected 0 spaces before closing bracket; 1 found
Open

        if ( $post ) {
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Space found after opening bracket of FOREACH loop
Open

                foreach ( $tags as $tag ) {
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Expected 0 spaces before closing bracket; 1 found
Open

        if ( $post ) {
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Method name "DFP_Ads::get_tag_targeting" is not in camel caps format
Open

    protected function get_tag_targeting() {
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Space found before closing bracket of FOREACH loop
Open

            foreach ( $categories as $c ) {
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     */
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     * @access public
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     * @var array
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     *
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     * @since  0.0.1
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     * Sets page level targeting
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

        'Tag'      => array(),
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     * @since  0.0.1
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    public function set_account_id( $id ) {
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    }
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     * Set Asynchronous Loading
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     * people want to be able to turn it off.
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     * @access public
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    /**
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     * @since  0.0.1
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     * @since  0.3.1
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    /**
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    /**
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    public function set_asynchronous_loading( $val ) {
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     * @since  0.0.1
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     * or synchronous
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     * @var bool $account_id
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     * @var Position DFP_Ads Position
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     * PHP5 Constructor
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     * @since  0.0.1
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     *
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     * @var string $script_name
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     * @return bool|string
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     */
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     * @access public
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     *
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     *
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     * @var string $dir_uri
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    /**
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    /**
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     */
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     */
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     * Ad Positions - Array
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

        return ( isset( $this->account_id ) ? $this->account_id : false );
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     * @since  0.0.1
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     * the normal, correct way. This is because asynchronous is default and some
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     *
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     *
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     * @param string $val
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     * @access public
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     * Loads Google Ads JS to header
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     *
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    );
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    /**
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     * Sets the DFP Property Code. An 8-digit integer
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     *
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

        $this->asynch = ( $val == 'on' ? false : true );
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     * @access public
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     */
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     * Sets all ad targeting
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     *
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     *
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

        return ( isset( $this->asynch ) ? $this->asynch : false );
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     * @return mixed
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    /**
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     * @access public
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    public $asynch;
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    /**
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    public $page_targeting = array(
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     *
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    public function __construct() {
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     * @var string $account_id
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

        add_shortcode( 'dfp_ads', array( $this, 'shortcode' ) );
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

        'Page'     => array(),
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     */
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     */
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     *
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     * @access public
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

        // Categories
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     * @access public
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     *
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     *
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     * Setting for whether to load an ad as asynchronous
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     */
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     * Stores the URI of the directory
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     * @access public
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    /**
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     * @access public
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     * @access public
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     * so it will send 'on' when it's set to load synchronously, rather than
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     */
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    public function set_targeting() {
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    public $account_id;
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     *
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     *
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    public $positions;
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     *
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     * Sets the flag for how the ads should load. By default, the setting is off,
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     * @since  0.3.1
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     * @since  0.0.1
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    public $google_ad_script_name = 'google_ad_js';
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

        'Category' => array(),
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     *
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     * Set DFP Property Code
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     * @param $id int Code ID Number
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     * DFP Account ID. Includes the two slashes
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     */
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

        $this->account_id = '/' . $id . '/';
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    }
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     *
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     * @var string $google_ad_script_name
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     */
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     * Name of the javascript file.
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    public $script_name = 'dfp_ads';
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    /**
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    public $dir_uri;
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     * @since  0.0.1
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     *
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     * @since  0.0.1
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     *
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

        /** Creates DFP_Ads Shortcode */
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    }
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    /**
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     *
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     * @return bool
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     *
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

        // Page Title
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

        $this->page_targeting['Page'] = $this->get_page_targeting();
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

        $this->page_targeting['Tag'] = $this->get_tag_targeting();
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

        $object->positions   = dfp_get_ad_positions();
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

            $current_url = $wp->query_string;
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

            if ( count( $url_parts ) >= 2 ) {
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     * Sets the tag targeting on the object
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     *
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

        );
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

            array( $this->google_ad_script_name, 'jquery' ),
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

            false,
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     */
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    public function scripts_and_styles() {
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

        /* Get the Final Ad Positions */
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

        wp_localize_script( $this->google_ad_script_name, 'dfp_ad_object', array( $ad_positions ) );
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    /**
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     *
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     * @access public
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     * Example: [ '2015', '10', '11', 'post_slug' ]
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     */
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

                    $targets[] = $tag->name;
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

            false,
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     *
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

        } else {
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    /**
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    protected function get_category_targeting() {
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

            foreach ( $categories as $c ) {
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

        return ( count( $targets ) < 1 ? '' : $targets );
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

        global $post;
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

            if ( $tags ) {
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

            false
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    /**
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     * @return DFP_Ads
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     *
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     * @return array|string
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    protected function get_page_targeting() {
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

        $object->set_targeting();
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

        global $post;
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

        global $wp;
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

        /*
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    /**
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    }
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     * @return array|string
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     *
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

        // Send data to front end.
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     */
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

        }
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

        $object->script_name = null;
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     *
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     * @access protected
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

        $targets = array();
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

            $this->script_name,
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     * Display Shortcode
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     *
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

        return $position->get_position();
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

        $this->page_targeting['Category'] = $this->get_category_targeting();
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

        $object->dir_uri     = null;
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

            $current_url = $wp->request;
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

            $array       = explode( '/', $current_url );
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     * @access protected
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

        if ( $wp->request != null ) {
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

        if ( $post ) {
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

        }
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     * @since  0.0.1
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

        return ( count( $array ) < 1 ? array( 'Home' ) : $array );
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

        return ( count( $targets ) < 1 ? '' : $targets );
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     *
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    /**
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     * @access public
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

        if ( defined( 'DFP_CONCAT_SCRIPTS' ) && true === DFP_CONCAT_SCRIPTS ) {
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     * @since  0.0.1
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

        wp_register_script(
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

            $dfp_ads_script_url,
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

            $gads_script_url    = $this->dir_uri . '/assets/js/google-ads.js';
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     * @return mixed Returns HTML data for the position
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

        // Google Ads JS Script
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     * @param $atts array
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     * Adds URL sections to targeting
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     */
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

        $position = dfp_get_ad_position( $atts['id'] );
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

            $categories = get_the_category( $post->ID );
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    }
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     */
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

        if ( $post ) {
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

            $tags = get_the_tags( $post->ID );
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     *
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     * @return mixed
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     */
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

            $gads_script_url    = $this->dir_uri . '/assets/js/google-ads.min.js';
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

        } else {
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

        wp_enqueue_script( $this->google_ad_script_name );
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

        // Preps the script
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

        wp_enqueue_script( $this->script_name );
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     * @since  0.0.1
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     *
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

        // Copy the original
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

        $object = clone $this;
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    }
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

        return $object;
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     * This function will return an array of page directories without the URL.
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

        // Tags
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    }
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     *
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     * Sets the category targeting on the object
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     * @since  0.0.1
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     *
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

            $url_parts   = explode( '=', $current_url );
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     * @return array|string
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    /**
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

            } else {
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    }
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

                $array = array();
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

            array( 'jquery' ),
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

            }
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

        wp_register_script(
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    }
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

            $dfp_ads_script_url = $this->dir_uri . '/assets/js/dfp-ads.js';
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

        }
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     * @access protected
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

                $targets[] = $cat->name;
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     * Registers Scripts. Localizes data to interstitial_ad.js
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

            $gads_script_url,
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

        $ad_positions = apply_filters( 'pre_dfp_ads_to_js', $this );
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

            false
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

        );
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    public function send_ads_to_js( $dfp_ads ) {
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

                $array[ $url_parts[0] ] = $url_parts[1];
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     *
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

        $targets = array();
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

                $cat       = get_category( $c );
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

            }
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

        }
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    protected function get_tag_targeting() {
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     * @param DFP_Ads $dfp_ads
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

                }
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     *
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    public function shortcode( $atts ) {
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    }
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     * @since  0.0.1
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

                foreach ( $tags as $tag ) {
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

            }
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

            $dfp_ads_script_url = $this->dir_uri . '/assets/js/dfp-ads.min.js';
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

            $this->google_ad_script_name,
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Space after opening parenthesis of function call prohibited
Open

        return ( isset( $this->asynch ) ? $this->asynch : false );
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Opening brace should be on a new line
Open

    public function __construct() {
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Opening brace should be on a new line
Open

    public function set_account_id( $id ) {
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Space after opening parenthesis of function call prohibited
Open

        add_shortcode( 'dfp_ads', array( $this, 'shortcode' ) );
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Opening brace should be on a new line
Open

    public function set_targeting() {
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Opening brace should be on a new line
Open

    public function set_asynchronous_loading( $val ) {
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Class name "DFP_Ads" is not in camel caps format
Open

Class DFP_Ads {
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Expected 0 spaces before closing bracket; 1 found
Open

        add_shortcode( 'dfp_ads', array( $this, 'shortcode' ) );
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Expected 0 spaces before closing bracket; 1 found
Open

        return ( isset( $this->asynch ) ? $this->asynch : false );
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Space after opening parenthesis of function call prohibited
Open

        return ( isset( $this->account_id ) ? $this->account_id : false );
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Expected 0 spaces before closing bracket; 1 found
Open

        return ( isset( $this->account_id ) ? $this->account_id : false );
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Space after opening parenthesis of function call prohibited
Open

            $url_parts   = explode( '=', $current_url );
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Expected 0 spaces after opening bracket; 1 found
Open

                foreach ( $tags as $tag ) {
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Expected 0 spaces before closing bracket; 1 found
Open

        wp_enqueue_script( $this->google_ad_script_name );
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Space after opening parenthesis of function call prohibited
Open

            if ( count( $url_parts ) >= 2 ) {
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Space after opening parenthesis of function call prohibited
Open

            $tags = get_the_tags( $post->ID );
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Expected 0 spaces before closing bracket; 1 found
Open

            $url_parts   = explode( '=', $current_url );
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Space after opening parenthesis of function call prohibited
Open

        return ( count( $targets ) < 1 ? '' : $targets );
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Expected 0 spaces before closing bracket; 1 found
Open

        return ( count( $targets ) < 1 ? '' : $targets );
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Space after opening parenthesis of function call prohibited
Open

        if ( defined( 'DFP_CONCAT_SCRIPTS' ) && true === DFP_CONCAT_SCRIPTS ) {
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Space after opening parenthesis of function call prohibited
Open

        wp_enqueue_script( $this->google_ad_script_name );
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Expected 0 spaces after opening bracket; 1 found
Open

            foreach ( $categories as $c ) {
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Expected 0 spaces before closing bracket; 1 found
Open

        $ad_positions = apply_filters( 'pre_dfp_ads_to_js', $this );
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Expected 1 newline at end of file; 0 found
Open

}
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Expected 0 spaces after opening bracket; 1 found
Open

        if ( $wp->request != null ) {
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Expected 0 spaces before closing bracket; 1 found
Open

            $array       = explode( '/', $current_url );
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Expected 0 spaces before closing bracket; 1 found
Open

        return ( count( $targets ) < 1 ? '' : $targets );
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Space after opening parenthesis of function call prohibited
Open

        $ad_positions = apply_filters( 'pre_dfp_ads_to_js', $this );
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Expected 0 spaces before closing bracket; 1 found
Open

        $position = dfp_get_ad_position( $atts['id'] );
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Expected 0 spaces after opening bracket; 1 found
Open

            if ( count( $url_parts ) >= 2 ) {
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Expected 0 spaces before closing bracket; 1 found
Open

            $tags = get_the_tags( $post->ID );
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Expected 0 spaces after opening bracket; 1 found
Open

            if ( $tags ) {
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Opening brace should be on a new line
Open

    public function shortcode( $atts ) {
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Expected 0 spaces before closing bracket; 1 found
Open

                $cat       = get_category( $c );
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Space after opening parenthesis of function call prohibited
Open

            $array       = explode( '/', $current_url );
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Expected 0 spaces after opening bracket; 1 found
Open

        if ( defined( 'DFP_CONCAT_SCRIPTS' ) && true === DFP_CONCAT_SCRIPTS ) {
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Opening brace should be on a new line
Open

    protected function get_category_targeting() {
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Opening brace should be on a new line
Open

    protected function get_page_targeting() {
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Space after opening parenthesis of function call prohibited
Open

            $categories = get_the_category( $post->ID );
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Expected 0 spaces after opening bracket; 1 found
Open

        if ( $post ) {
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Space after opening parenthesis of function call prohibited
Open

        return ( count( $targets ) < 1 ? '' : $targets );
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Expected 0 spaces after opening bracket; 1 found
Open

        if ( $post ) {
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Space after opening parenthesis of function call prohibited
Open

        wp_localize_script( $this->google_ad_script_name, 'dfp_ad_object', array( $ad_positions ) );
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Space after opening parenthesis of function call prohibited
Open

        return ( count( $array ) < 1 ? array( 'Home' ) : $array );
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Expected 0 spaces before closing bracket; 1 found
Open

        if ( defined( 'DFP_CONCAT_SCRIPTS' ) && true === DFP_CONCAT_SCRIPTS ) {
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Expected 0 spaces before closing bracket; 1 found
Open

        wp_localize_script( $this->google_ad_script_name, 'dfp_ad_object', array( $ad_positions ) );
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Space after opening parenthesis of function call prohibited
Open

        $position = dfp_get_ad_position( $atts['id'] );
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Opening brace should be on a new line
Open

    public function send_ads_to_js( $dfp_ads ) {
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Expected 0 spaces before closing bracket; 1 found
Open

            $categories = get_the_category( $post->ID );
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Opening brace should be on a new line
Open

    protected function get_tag_targeting() {
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Opening brace should be on a new line
Open

    public function scripts_and_styles() {
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Space after opening parenthesis of function call prohibited
Open

        wp_enqueue_script( $this->script_name );
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Expected 0 spaces before closing bracket; 1 found
Open

            if ( count( $url_parts ) >= 2 ) {
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Expected 0 spaces before closing bracket; 1 found
Open

        return ( count( $array ) < 1 ? array( 'Home' ) : $array );
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Space after opening parenthesis of function call prohibited
Open

                $cat       = get_category( $c );
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

Expected 0 spaces before closing bracket; 1 found
Open

        wp_enqueue_script( $this->script_name );
Severity: Minor
Found in includes/DFP_Ads.php by phpcodesniffer

There are no issues that match your filters.

Category
Status