dsifford/academic-bloggers-toolkit

View on GitHub
src/php/endpoints.php

Summary

Maintainability
C
1 day
Test Coverage

Function get_website_meta has a Cognitive Complexity of 40 (exceeds 5 allowed). Consider refactoring.
Open

function get_website_meta() {
    if ( ! extension_loaded( 'dom' ) || ! extension_loaded( 'libxml' ) ) {
        wp_send_json_error( [], 501 );
        exit;
    }
Severity: Minor
Found in src/php/endpoints.php - About 6 hrs 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

Method get_website_meta has 119 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function get_website_meta() {
    if ( ! extension_loaded( 'dom' ) || ! extension_loaded( 'libxml' ) ) {
        wp_send_json_error( [], 501 );
        exit;
    }
Severity: Major
Found in src/php/endpoints.php - About 4 hrs to fix

    A file should declare new symbols (classes, functions, constants, etc.) and cause no other side effects, or it should execute logic with side effects, but should not do both. The first symbol is defined on line 19 and the first side effect is on line 12.
    Open

    <?php
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Expected 0 spaces before closing bracket; 1 found
    Open

        if ( ! extension_loaded( 'dom' ) || ! extension_loaded( 'libxml' ) ) {
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Space found after opening bracket of FOREACH loop
    Open

        foreach ( $authors as $node ) {
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Expected 0 spaces before closing bracket; 1 found
    Open

        if ( 'custom' === $current_style['kind'] ) {
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Expected 0 spaces before closing bracket; 1 found
    Open

        foreach ( $authors as $node ) {
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Expected 0 spaces before closing bracket; 1 found
    Open

        if ( $issued ) {
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Expected 0 spaces before closing bracket; 1 found
    Open

        if ( ! isset( $_POST['url'] ) ) {
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Expected 0 spaces before closing bracket; 1 found
    Open

            if ( ! is_int( array_search( $a, $payload['authors'], true ) ) ) {
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Space found before closing bracket of FOREACH loop
    Open

        foreach ( $authors as $node ) {
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Space found after opening bracket of FOREACH loop
    Open

        foreach ( $sailthru as $node ) {
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Expected 0 spaces before closing bracket; 1 found
    Open

            if ( ! is_int( array_search( $a, $payload['authors'], true ) ) ) {
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Expected 0 spaces before closing bracket; 1 found
    Open

        if ( is_null( $state ) ) {
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Expected 0 spaces before closing bracket; 1 found
    Open

            if ( 'author' === $key ) {
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Expected 0 spaces before closing bracket; 1 found
    Open

                if ( ! is_int( array_search( $a, $payload['authors'], true ) ) ) {
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Space found after opening bracket of FOREACH loop
    Open

        foreach ( $abt as $node ) {
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Expected 0 spaces before closing bracket; 1 found
    Open

        foreach ( $opengraph as $node ) {
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Expected 0 spaces before closing bracket; 1 found
    Open

        if ( ! $payload['title'] ) {
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Expected 0 spaces before closing bracket; 1 found
    Open

            if ( $title ) {
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Expected 0 spaces before closing bracket; 1 found
    Open

            } elseif ( $issued->hasAttribute( 'content' ) ) {
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Expected 0 spaces before closing bracket; 1 found
    Open

            if ( $issued->hasAttribute( 'datetime' ) ) {
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Expected 0 spaces before closing bracket; 1 found
    Open

        foreach ( $article as $node ) {
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Space found before closing bracket of FOREACH loop
    Open

        foreach ( $opengraph as $node ) {
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Expected 0 spaces before closing bracket; 1 found
    Open

            if ( $author->nodeName === 'meta' ) {
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Expected 0 spaces before closing bracket; 1 found
    Open

        if ( ! isset( $_POST['state'], $_POST['post_id'] ) ) {
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Space found before closing bracket of FOREACH loop
    Open

        foreach ( $abt as $node ) {
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Space found after opening bracket of FOREACH loop
    Open

        foreach ( $opengraph as $node ) {
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Space found before closing bracket of FOREACH loop
    Open

        foreach ( $article as $node ) {
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Space found after opening bracket of FOREACH loop
    Open

        foreach ( $authors as $author ) {
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Space found before closing bracket of FOREACH loop
    Open

        foreach ( $sailthru as $node ) {
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Expected 0 spaces before closing bracket; 1 found
    Open

        foreach ( $sailthru as $node ) {
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Expected 0 spaces before closing bracket; 1 found
    Open

        foreach ( $abt as $node ) {
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Space found after opening bracket of FOREACH loop
    Open

        foreach ( $article as $node ) {
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Expected 0 spaces before closing bracket; 1 found
    Open

                if ( strlen( $value ) > 50 ) {
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Space found before closing bracket of FOREACH loop
    Open

        foreach ( $authors as $author ) {
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Expected 0 spaces before closing bracket; 1 found
    Open

        foreach ( $authors as $author ) {
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Expected 0 spaces before closing bracket; 1 found
    Open

        if ( $issued ) {
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Expected 0 spaces before closing bracket; 1 found
    Open

                if ( ! is_int( array_search( $a, $payload['authors'], true ) ) ) {
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Expected 0 spaces before closing bracket; 1 found
    Open

        if ( $title ) {
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Expected 0 spaces before closing bracket; 1 found
    Open

            if ( 'author' === $key ) {
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

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

            'sailthru' => [],
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

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

         */
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

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

        if ( $issued ) {
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

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

        $raw  = wp_remote_retrieve_body( wp_safe_remote_get( $url ) );
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

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

        $issued = $xpath->query( '//meta[ @name="pubdate" ]' )->item( 0 );
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

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

        check_ajax_referer( 'abt-ajax' );
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

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

        if ( ! extension_loaded( 'dom' ) || ! extension_loaded( 'libxml' ) ) {
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

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

        $xpath = new \DOMXPath( $html );
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

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

        $payload = [
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

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

            $a = explode( ' ', sanitize_text_field( $node->getAttribute( 'content' ) ), 2 );
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

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

        $html->loadHTML( $raw );
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

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

                $payload['authors'][] = $a;
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

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

        }
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

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

        $current_style = get_option( ABT_OPTIONS_KEY )['citation_style'];
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

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

            wp_send_json_error( [], 501 );
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

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

        if ( ! isset( $_POST['url'] ) ) {
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

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

        wp_send_json( $styles );
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

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

        ];
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

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

        foreach ( $authors as $node ) {
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

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

            'authors'  => [],
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

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

        $authors = $xpath->query( '//meta[ @name="author" ]' );
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

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

            $payload['issued'] = sanitize_text_field( $issued->getAttribute( 'content' ) );
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

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

        $styles        = get_citation_styles();
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

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

            wp_send_json_error( [], 400 );
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

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

            'article'  => [],
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

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

            'og'       => [],
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

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

            $a = [
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

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

            if ( ! is_int( array_search( $a, $payload['authors'], true ) ) ) {
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

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

        }
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

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

            $styles->styles[] = $current_style;
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

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

            exit;
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

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

        }
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

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

        libxml_use_internal_errors( true );
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

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

                'family' => $a[1],
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

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

            ];
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

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

        if ( 'custom' === $current_style['kind'] ) {
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

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

        $url  = esc_url_raw( wp_unslash( $_POST['url'] ) );
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

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

        /**
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

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

         * Stray Meta "name" Tags.
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

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

        check_ajax_referer( 'abt-ajax' );
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

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

                'given'  => $a[0],
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

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

        }
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

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

        $html = new \DOMDocument();
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

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

            }
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

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

            $value                      = sanitize_text_field( $node->getAttribute( 'content' ) );
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

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

        }
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

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

        /**
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

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

        $sailthru = $xpath->query( '//meta[ starts-with( @name, "sailthru" ) ]' );
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

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

                'given'  => $a[0],
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

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

                    'given'  => $a[0],
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

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

                    'family' => $a[1],
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

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

        /**
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

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

            $value                 = sanitize_text_field( $node->getAttribute( 'content' ) );
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

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

            $expl                       = explode( ':', $node->getAttribute( 'property' ), 2 );
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

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

        if ( $issued ) {
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

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

        foreach ( $authors as $author ) {
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

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

        if ( $title ) {
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

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

        $abt = $xpath->query( '//meta[ starts-with( @property, "abt:" ) ]' );
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

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

            if ( 'author' === $key ) {
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

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

                $a = explode( '|', $value, 2 );
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

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

            $title = $xpath->query( '/html/head/title' )->item( 0 );
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

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

        wp_send_json( $payload );
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

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

        $opengraph = $xpath->query( '//meta[ starts-with( @property, "og:" ) ]' );
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

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

         */
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

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

                if ( ! is_int( array_search( $a, $payload['authors'], true ) ) ) {
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

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

                wp_json_encode( $state )
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

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

            if ( $issued->hasAttribute( 'datetime' ) ) {
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

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

            $a = [
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

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

            }
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

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

            $payload['title'] = sanitize_text_field( $title->textContent );
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

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

            $key   = sanitize_key( $expl[1] );
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

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

        if ( ! $payload['title'] ) {
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

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

        foreach ( $article as $node ) {
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

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

            $key                        = sanitize_key( $expl[1] );
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

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

         * Itemprop Tags.
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

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

                    $payload['authors'][] = $a;
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

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

            $key                   = sanitize_key( str_replace( ':', '_', $expl[1] ) );
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

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

        $post_id = intval( $_POST['post_id'] );
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

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

        $state   = json_decode( wp_unslash( $_POST['state'] ) ); // phpcs:ignore
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

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

        );
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Line exceeds 120 characters; contains 123 characters
    Open

        $authors = $xpath->query( '//*[ @itemprop="author" ][ not( ancestor::*[ @itemtype="http://schema.org/Comment" ] ) ]' );
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

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

                continue;
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

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

                $payload['authors'][] = $a;
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

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

            $post_id,
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

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

        }
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

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

                ];
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

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

                }
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

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

            }
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

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

                $a = [
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

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

        }
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

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

            } elseif ( $issued->hasAttribute( 'content' ) ) {
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

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

        $issued = $xpath->query( '//*[ @itemprop="datePublished" ]' )->item( 0 );
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

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

        // Last ditch effort to get a title of the site.
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

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

            }
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

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

        }
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

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

            $a = explode( ' ', sanitize_text_field( $author->textContent ), 2 );
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

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

            if ( ! is_int( array_search( $a, $payload['authors'], true ) ) ) {
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

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

        }
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

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

        }
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

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

        }
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

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

            wp_send_json_error( 'required fields not sent', 400 );
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

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

            '_abt_state',
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

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

         */
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

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

            $value = sanitize_text_field( $node->getAttribute( 'content' ) );
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

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

            if ( $title ) {
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

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

        }
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

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

         * Sailthru Tags.
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

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

            $expl  = explode( '.', $node->getAttribute( 'name' ), 2 );
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

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

            $payload['sailthru'][ $key ] = $value;
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

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

            if ( $author->nodeName === 'meta' ) {
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

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

         * Open Graph Tags.
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

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

            $payload['og'][ $key ] = $value;
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

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

         */
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

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

        /**
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

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

                continue;
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

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

            $payload['article'][ $key ] = $value;
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

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

                    'family' => $a[1],
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

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

                    $payload['authors'][] = $a;
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

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

        /**
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

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

        $title = $xpath->query( '//*[ @itemprop="headline" ]' )->item( 0 );
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

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

         */
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

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

                if ( ! is_int( array_search( $a, $payload['authors'], true ) ) ) {
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

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

        if ( ! isset( $_POST['state'], $_POST['post_id'] ) ) {
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

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

        if ( is_null( $state ) ) {
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

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

            }
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

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

        }
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

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

                $payload['title'] = sanitize_text_field( $title->textContent );
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

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

            wp_send_json_error( 'state is null', 400 );
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

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

        }
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

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

            )
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

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

         */
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

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

        $article = $xpath->query( '//meta[ starts-with( @property, "article:" ) ]' );
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

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

            if ( 'author' === $key ) {
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

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

                    continue;
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

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

                $payload['issued'] = esc_attr( $issued->getAttribute( 'datetime' ) );
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

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

        foreach ( $opengraph as $node ) {
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

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

                $payload['issued'] = esc_attr( $issued->getAttribute( 'content' ) );
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

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

        $authors = $xpath->query( '//*[ @itemprop="author" ][ not( ancestor::*[ @itemtype="http://schema.org/Comment" ] ) ]' );
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

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

            $expl                  = explode( ':', $node->getAttribute( 'property' ), 2 );
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

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

            ];
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

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

        foreach ( $abt as $node ) {
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

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

            $value = sanitize_text_field( $node->getAttribute( 'content' ) );
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

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

                $a = [
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

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

                    'given'  => $a[0],
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

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

                ];
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

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

        check_ajax_referer( 'abt-ajax' );
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

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

            $expl  = explode( ':', $node->getAttribute( 'property' ), 2 );
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

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

                }
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

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

            }
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

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

        $updated = update_post_meta(
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

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

            wp_slash(
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

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

        }
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

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

         * Article Tags.
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

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

        foreach ( $sailthru as $node ) {
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

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

                if ( strlen( $value ) > 50 ) {
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

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

                }
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

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

            $key   = sanitize_key( $expl[1] );
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

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

            }
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

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

                $a = explode( ' ', $value, 2 );
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

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

                'family' => $a[1],
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

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

        wp_send_json_success( $state );
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

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

        /**
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

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

         * ABT Tags.
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Space after opening parenthesis of function call prohibited
    Open

        check_ajax_referer( 'abt-ajax' );
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Expected 0 spaces after opening bracket; 1 found
    Open

        foreach ( $authors as $node ) {
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Space after opening parenthesis of function call prohibited
    Open

        check_ajax_referer( 'abt-ajax' );
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Space after opening parenthesis of function call prohibited
    Open

        wp_send_json( $styles );
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Space after opening parenthesis of function call prohibited
    Open

        $url  = esc_url_raw( wp_unslash( $_POST['url'] ) );
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Expected 0 spaces before closing bracket; 1 found
    Open

        $raw  = wp_remote_retrieve_body( wp_safe_remote_get( $url ) );
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Expected 0 spaces before closing bracket; 1 found
    Open

            if ( ! is_int( array_search( $a, $payload['authors'], true ) ) ) {
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Expected 0 spaces before closing bracket; 1 found
    Open

        check_ajax_referer( 'abt-ajax' );
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Space after opening parenthesis of function call prohibited
    Open

    add_action( 'wp_ajax_get_style_json', __NAMESPACE__ . '\get_style_json' );
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Expected 0 spaces before closing bracket; 1 found
    Open

    add_action( 'wp_ajax_get_style_json', __NAMESPACE__ . '\get_style_json' );
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Expected 0 spaces before closing bracket; 1 found
    Open

        if ( ! extension_loaded( 'dom' ) || ! extension_loaded( 'libxml' ) ) {
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Expected 0 spaces before closing bracket; 1 found
    Open

        wp_send_json( $styles );
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Space after opening parenthesis of function call prohibited
    Open

        $raw  = wp_remote_retrieve_body( wp_safe_remote_get( $url ) );
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Space after opening parenthesis of function call prohibited
    Open

        libxml_use_internal_errors( true );
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Expected 0 spaces before closing bracket; 1 found
    Open

        $xpath = new \DOMXPath( $html );
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Space after opening parenthesis of function call prohibited
    Open

        $issued = $xpath->query( '//meta[ @name="pubdate" ]' )->item( 0 );
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Space after opening parenthesis of function call prohibited
    Open

        if ( ! extension_loaded( 'dom' ) || ! extension_loaded( 'libxml' ) ) {
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Expected 0 spaces before closing bracket; 1 found
    Open

            wp_send_json_error( [], 501 );
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Space after opening parenthesis of function call prohibited
    Open

            wp_send_json_error( [], 400 );
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Expected 0 spaces before closing bracket; 1 found
    Open

        $html->loadHTML( $raw );
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Space after opening parenthesis of function call prohibited
    Open

        $xpath = new \DOMXPath( $html );
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Space after opening parenthesis of function call prohibited
    Open

            $a = explode( ' ', sanitize_text_field( $node->getAttribute( 'content' ) ), 2 );
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Space after opening parenthesis of function call prohibited
    Open

            $a = explode( ' ', sanitize_text_field( $node->getAttribute( 'content' ) ), 2 );
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Space after opening parenthesis of function call prohibited
    Open

        $issued = $xpath->query( '//meta[ @name="pubdate" ]' )->item( 0 );
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Space after opening parenthesis of function call prohibited
    Open

            $payload['issued'] = sanitize_text_field( $issued->getAttribute( 'content' ) );
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Expected 0 spaces before closing bracket; 1 found
    Open

    defined( 'ABSPATH' ) || exit;
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Expected 0 spaces after opening bracket; 1 found
    Open

        if ( ! extension_loaded( 'dom' ) || ! extension_loaded( 'libxml' ) ) {
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Space after opening parenthesis of function call prohibited
    Open

            if ( ! is_int( array_search( $a, $payload['authors'], true ) ) ) {
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Space after opening parenthesis of function call prohibited
    Open

            $payload['issued'] = sanitize_text_field( $issued->getAttribute( 'content' ) );
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Space after opening parenthesis of function call prohibited
    Open

        if ( ! isset( $_POST['url'] ) ) {
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Expected 0 spaces before closing bracket; 1 found
    Open

        $raw  = wp_remote_retrieve_body( wp_safe_remote_get( $url ) );
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Expected 0 spaces before closing bracket; 1 found
    Open

        $authors = $xpath->query( '//meta[ @name="author" ]' );
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Expected 0 spaces before closing bracket; 1 found
    Open

            wp_send_json_error( [], 400 );
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Space after opening parenthesis of function call prohibited
    Open

        $html->loadHTML( $raw );
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Expected 0 spaces before closing bracket; 1 found
    Open

            if ( ! is_int( array_search( $a, $payload['authors'], true ) ) ) {
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Space after opening parenthesis of function call prohibited
    Open

        $current_style = get_option( ABT_OPTIONS_KEY )['citation_style'];
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Expected 0 spaces after opening bracket; 1 found
    Open

        if ( $issued ) {
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Expected 0 spaces before closing bracket; 1 found
    Open

            $payload['issued'] = sanitize_text_field( $issued->getAttribute( 'content' ) );
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Expected 0 spaces before closing bracket; 1 found
    Open

        $current_style = get_option( ABT_OPTIONS_KEY )['citation_style'];
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Space after opening parenthesis of function call prohibited
    Open

        $raw  = wp_remote_retrieve_body( wp_safe_remote_get( $url ) );
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Expected 0 spaces before closing bracket; 1 found
    Open

            $a = explode( ' ', sanitize_text_field( $node->getAttribute( 'content' ) ), 2 );
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Expected 0 spaces after opening bracket; 1 found
    Open

            if ( ! is_int( array_search( $a, $payload['authors'], true ) ) ) {
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Space after opening parenthesis of function call prohibited
    Open

            wp_send_json_error( [], 501 );
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Expected 0 spaces before closing bracket; 1 found
    Open

        $url  = esc_url_raw( wp_unslash( $_POST['url'] ) );
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Space after opening parenthesis of function call prohibited
    Open

        $url  = esc_url_raw( wp_unslash( $_POST['url'] ) );
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Space after opening parenthesis of function call prohibited
    Open

    defined( 'ABSPATH' ) || exit;
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Opening brace should be on a new line
    Open

    function get_website_meta() {
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Expected 0 spaces after opening bracket; 1 found
    Open

        if ( ! isset( $_POST['url'] ) ) {
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Expected 0 spaces before closing bracket; 1 found
    Open

        if ( ! isset( $_POST['url'] ) ) {
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Expected 0 spaces before closing bracket; 1 found
    Open

            $a = explode( ' ', sanitize_text_field( $node->getAttribute( 'content' ) ), 2 );
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Expected 0 spaces before closing bracket; 1 found
    Open

            $a = explode( ' ', sanitize_text_field( $node->getAttribute( 'content' ) ), 2 );
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Expected 0 spaces before closing bracket; 1 found
    Open

        $issued = $xpath->query( '//meta[ @name="pubdate" ]' )->item( 0 );
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Expected 0 spaces before closing bracket; 1 found
    Open

            $payload['issued'] = sanitize_text_field( $issued->getAttribute( 'content' ) );
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Opening brace should be on a new line
    Open

    function get_style_json() {
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Space after opening parenthesis of function call prohibited
    Open

        if ( ! extension_loaded( 'dom' ) || ! extension_loaded( 'libxml' ) ) {
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Expected 0 spaces before closing bracket; 1 found
    Open

        check_ajax_referer( 'abt-ajax' );
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Expected 0 spaces before closing bracket; 1 found
    Open

        $issued = $xpath->query( '//meta[ @name="pubdate" ]' )->item( 0 );
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Expected 0 spaces after opening bracket; 1 found
    Open

        if ( 'custom' === $current_style['kind'] ) {
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Space after opening parenthesis of function call prohibited
    Open

        $authors = $xpath->query( '//meta[ @name="author" ]' );
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Expected 0 spaces before closing bracket; 1 found
    Open

        if ( ! extension_loaded( 'dom' ) || ! extension_loaded( 'libxml' ) ) {
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Expected 0 spaces before closing bracket; 1 found
    Open

        $url  = esc_url_raw( wp_unslash( $_POST['url'] ) );
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Space after opening parenthesis of function call prohibited
    Open

            if ( ! is_int( array_search( $a, $payload['authors'], true ) ) ) {
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Expected 0 spaces before closing bracket; 1 found
    Open

        libxml_use_internal_errors( true );
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Space after opening parenthesis of function call prohibited
    Open

            $a = explode( ' ', sanitize_text_field( $node->getAttribute( 'content' ) ), 2 );
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Space after opening parenthesis of function call prohibited
    Open

            $key                   = sanitize_key( str_replace( ':', '_', $expl[1] ) );
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Space after opening parenthesis of function call prohibited
    Open

            $value                 = sanitize_text_field( $node->getAttribute( 'content' ) );
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Space after opening parenthesis of function call prohibited
    Open

            $value                      = sanitize_text_field( $node->getAttribute( 'content' ) );
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Expected 0 spaces before closing bracket; 1 found
    Open

            $value                      = sanitize_text_field( $node->getAttribute( 'content' ) );
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Space after opening parenthesis of function call prohibited
    Open

                if ( ! is_int( array_search( $a, $payload['authors'], true ) ) ) {
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Expected 0 spaces before closing bracket; 1 found
    Open

                $payload['issued'] = esc_attr( $issued->getAttribute( 'content' ) );
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Expected 0 spaces before closing bracket; 1 found
    Open

    add_action( 'wp_ajax_get_website_meta', __NAMESPACE__ . '\get_website_meta' );
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Expected 0 spaces before closing bracket; 1 found
    Open

            $key                   = sanitize_key( str_replace( ':', '_', $expl[1] ) );
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Space after opening parenthesis of function call prohibited
    Open

        $article = $xpath->query( '//meta[ starts-with( @property, "article:" ) ]' );
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Expected 0 spaces after opening bracket; 1 found
    Open

        foreach ( $article as $node ) {
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Expected 0 spaces before closing bracket; 1 found
    Open

                if ( strlen( $value ) > 50 ) {
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Space after opening parenthesis of function call prohibited
    Open

            $expl  = explode( ':', $node->getAttribute( 'property' ), 2 );
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Expected 0 spaces before closing bracket; 1 found
    Open

                if ( ! is_int( array_search( $a, $payload['authors'], true ) ) ) {
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Expected 0 spaces before closing bracket; 1 found
    Open

        wp_send_json( $payload );
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Space after opening parenthesis of function call prohibited
    Open

        if ( ! isset( $_POST['state'], $_POST['post_id'] ) ) {
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Space after opening parenthesis of function call prohibited
    Open

        $state   = json_decode( wp_unslash( $_POST['state'] ) ); // phpcs:ignore
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Expected 0 spaces before closing bracket; 1 found
    Open

        if ( is_null( $state ) ) {
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Space after opening parenthesis of function call prohibited
    Open

        $opengraph = $xpath->query( '//meta[ starts-with( @property, "og:" ) ]' );
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Space after opening parenthesis of function call prohibited
    Open

            $key   = sanitize_key( $expl[1] );
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Expected 0 spaces before closing bracket; 1 found
    Open

                $a = explode( ' ', $value, 2 );
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Expected 0 spaces before closing bracket; 1 found
    Open

            } elseif ( $issued->hasAttribute( 'content' ) ) {
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Space after opening parenthesis of function call prohibited
    Open

        $authors = $xpath->query( '//*[ @itemprop="author" ][ not( ancestor::*[ @itemtype="http://schema.org/Comment" ] ) ]' );
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Expected 0 spaces after opening bracket; 1 found
    Open

        foreach ( $authors as $author ) {
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Space after opening parenthesis of function call prohibited
    Open

            $value                 = sanitize_text_field( $node->getAttribute( 'content' ) );
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Expected 0 spaces before closing bracket; 1 found
    Open

            $a = explode( ' ', sanitize_text_field( $author->textContent ), 2 );
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Expected 0 spaces before closing bracket; 1 found
    Open

            $expl  = explode( '.', $node->getAttribute( 'name' ), 2 );
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Expected 0 spaces after opening bracket; 1 found
    Open

                if ( ! is_int( array_search( $a, $payload['authors'], true ) ) ) {
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Space after opening parenthesis of function call prohibited
    Open

                $payload['title'] = sanitize_text_field( $title->textContent );
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Expected 0 spaces before closing bracket; 1 found
    Open

        $issued = $xpath->query( '//*[ @itemprop="datePublished" ]' )->item( 0 );
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Space after opening parenthesis of function call prohibited
    Open

        $state   = json_decode( wp_unslash( $_POST['state'] ) ); // phpcs:ignore
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Expected 0 spaces after opening bracket; 1 found
    Open

        if ( $issued ) {
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Space after opening parenthesis of function call prohibited
    Open

            $value = sanitize_text_field( $node->getAttribute( 'content' ) );
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Space after opening parenthesis of function call prohibited
    Open

                $a = explode( '|', $value, 2 );
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Expected 0 spaces before closing bracket; 1 found
    Open

                $a = explode( '|', $value, 2 );
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Expected 0 spaces before closing bracket; 1 found
    Open

            $value                 = sanitize_text_field( $node->getAttribute( 'content' ) );
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Expected 0 spaces after opening bracket; 1 found
    Open

                if ( strlen( $value ) > 50 ) {
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Expected 0 spaces before closing bracket; 1 found
    Open

                if ( ! is_int( array_search( $a, $payload['authors'], true ) ) ) {
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Expected 0 spaces before closing bracket; 1 found
    Open

                if ( ! is_int( array_search( $a, $payload['authors'], true ) ) ) {
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Expected 0 spaces before closing bracket; 1 found
    Open

        $issued = $xpath->query( '//*[ @itemprop="datePublished" ]' )->item( 0 );
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Space after opening parenthesis of function call prohibited
    Open

            $a = explode( ' ', sanitize_text_field( $author->textContent ), 2 );
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Expected 0 spaces before closing bracket; 1 found
    Open

        $title = $xpath->query( '//*[ @itemprop="headline" ]' )->item( 0 );
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Space after opening parenthesis of function call prohibited
    Open

                if ( ! is_int( array_search( $a, $payload['authors'], true ) ) ) {
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Space after opening parenthesis of function call prohibited
    Open

        $title = $xpath->query( '//*[ @itemprop="headline" ]' )->item( 0 );
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Space after opening parenthesis of function call prohibited
    Open

        $abt = $xpath->query( '//meta[ starts-with( @property, "abt:" ) ]' );
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Space after opening parenthesis of function call prohibited
    Open

            $title = $xpath->query( '/html/head/title' )->item( 0 );
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Expected 0 spaces before closing bracket; 1 found
    Open

            $title = $xpath->query( '/html/head/title' )->item( 0 );
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Expected 0 spaces after opening bracket; 1 found
    Open

        if ( ! isset( $_POST['state'], $_POST['post_id'] ) ) {
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Space after opening parenthesis of function call prohibited
    Open

            $expl                  = explode( ':', $node->getAttribute( 'property' ), 2 );
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Expected 0 spaces before closing bracket; 1 found
    Open

            $value = sanitize_text_field( $node->getAttribute( 'content' ) );
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Space after opening parenthesis of function call prohibited
    Open

                if ( strlen( $value ) > 50 ) {
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Space after opening parenthesis of function call prohibited
    Open

            $expl                       = explode( ':', $node->getAttribute( 'property' ), 2 );
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Space after opening parenthesis of function call prohibited
    Open

        $issued = $xpath->query( '//*[ @itemprop="datePublished" ]' )->item( 0 );
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Expected 0 spaces after opening bracket; 1 found
    Open

        if ( $title ) {
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Space after opening parenthesis of function call prohibited
    Open

            if ( $issued->hasAttribute( 'datetime' ) ) {
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Space after opening parenthesis of function call prohibited
    Open

                if ( ! is_int( array_search( $a, $payload['authors'], true ) ) ) {
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Space after opening parenthesis of function call prohibited
    Open

            } elseif ( $issued->hasAttribute( 'content' ) ) {
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Space after opening parenthesis of function call prohibited
    Open

        check_ajax_referer( 'abt-ajax' );
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Space after opening parenthesis of function call prohibited
    Open

        $post_id = intval( $_POST['post_id'] );
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Expected 0 spaces after opening bracket; 1 found
    Open

            if ( ! is_int( array_search( $a, $payload['authors'], true ) ) ) {
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Expected 0 spaces after opening bracket; 1 found
    Open

        foreach ( $abt as $node ) {
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Expected 0 spaces before closing bracket; 1 found
    Open

            $expl  = explode( ':', $node->getAttribute( 'property' ), 2 );
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Expected 0 spaces before closing bracket; 1 found
    Open

            $expl  = explode( ':', $node->getAttribute( 'property' ), 2 );
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Space after opening parenthesis of function call prohibited
    Open

            $key   = sanitize_key( $expl[1] );
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Space after opening parenthesis of function call prohibited
    Open

            $value = sanitize_text_field( $node->getAttribute( 'content' ) );
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Space after opening parenthesis of function call prohibited
    Open

            $title = $xpath->query( '/html/head/title' )->item( 0 );
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Expected 0 spaces after opening bracket; 1 found
    Open

        if ( is_null( $state ) ) {
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Expected 0 spaces before closing bracket; 1 found
    Open

                wp_json_encode( $state )
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Expected 0 spaces before closing bracket; 1 found
    Open

            $value                      = sanitize_text_field( $node->getAttribute( 'content' ) );
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Space after opening parenthesis of function call prohibited
    Open

        $sailthru = $xpath->query( '//meta[ starts-with( @name, "sailthru" ) ]' );
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Space after opening parenthesis of function call prohibited
    Open

            $value = sanitize_text_field( $node->getAttribute( 'content' ) );
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Expected 0 spaces before closing bracket; 1 found
    Open

            $expl                  = explode( ':', $node->getAttribute( 'property' ), 2 );
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Expected 0 spaces before closing bracket; 1 found
    Open

                $payload['issued'] = esc_attr( $issued->getAttribute( 'datetime' ) );
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Expected 0 spaces before closing bracket; 1 found
    Open

        $title = $xpath->query( '//*[ @itemprop="headline" ]' )->item( 0 );
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Expected 0 spaces before closing bracket; 1 found
    Open

            $value                 = sanitize_text_field( $node->getAttribute( 'content' ) );
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Expected 0 spaces before closing bracket; 1 found
    Open

                if ( ! is_int( array_search( $a, $payload['authors'], true ) ) ) {
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Space after opening parenthesis of function call prohibited
    Open

    add_action( 'wp_ajax_get_website_meta', __NAMESPACE__ . '\get_website_meta' );
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Expected 0 spaces before closing bracket; 1 found
    Open

            $expl                       = explode( ':', $node->getAttribute( 'property' ), 2 );
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Expected 0 spaces before closing bracket; 1 found
    Open

        if ( ! isset( $_POST['state'], $_POST['post_id'] ) ) {
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Expected 0 spaces before closing bracket; 1 found
    Open

        $post_id = intval( $_POST['post_id'] );
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Space after opening parenthesis of function call prohibited
    Open

            wp_send_json_error( 'state is null', 400 );
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Space after opening parenthesis of function call prohibited
    Open

            $value = sanitize_text_field( $node->getAttribute( 'content' ) );
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Expected 0 spaces after opening bracket; 1 found
    Open

            if ( 'author' === $key ) {
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Space after opening parenthesis of function call prohibited
    Open

                $payload['issued'] = esc_attr( $issued->getAttribute( 'datetime' ) );
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Expected 0 spaces before closing bracket; 1 found
    Open

        $authors = $xpath->query( '//*[ @itemprop="author" ][ not( ancestor::*[ @itemtype="http://schema.org/Comment" ] ) ]' );
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Expected 0 spaces after opening bracket; 1 found
    Open

            if ( $author->nodeName === 'meta' ) {
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Space after opening parenthesis of function call prohibited
    Open

            $a = explode( ' ', sanitize_text_field( $author->textContent ), 2 );
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Space after opening parenthesis of function call prohibited
    Open

            if ( ! is_int( array_search( $a, $payload['authors'], true ) ) ) {
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Expected 0 spaces before closing bracket; 1 found
    Open

            if ( ! is_int( array_search( $a, $payload['authors'], true ) ) ) {
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Space after opening parenthesis of function call prohibited
    Open

        $title = $xpath->query( '//*[ @itemprop="headline" ]' )->item( 0 );
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Expected 0 spaces before closing bracket; 1 found
    Open

            $key   = sanitize_key( $expl[1] );
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Expected 0 spaces before closing bracket; 1 found
    Open

            $title = $xpath->query( '/html/head/title' )->item( 0 );
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Space after opening parenthesis of function call prohibited
    Open

        if ( is_null( $state ) ) {
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Expected 0 spaces before closing bracket; 1 found
    Open

            $expl                  = explode( ':', $node->getAttribute( 'property' ), 2 );
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Expected 0 spaces before closing bracket; 1 found
    Open

            $key                   = sanitize_key( str_replace( ':', '_', $expl[1] ) );
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Expected 0 spaces before closing bracket; 1 found
    Open

        $article = $xpath->query( '//meta[ starts-with( @property, "article:" ) ]' );
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Expected 0 spaces before closing bracket; 1 found
    Open

            $expl                       = explode( ':', $node->getAttribute( 'property' ), 2 );
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Space after opening parenthesis of function call prohibited
    Open

            $expl  = explode( '.', $node->getAttribute( 'name' ), 2 );
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Space after opening parenthesis of function call prohibited
    Open

            $key                        = sanitize_key( $expl[1] );
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Space after opening parenthesis of function call prohibited
    Open

        $issued = $xpath->query( '//*[ @itemprop="datePublished" ]' )->item( 0 );
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Space after opening parenthesis of function call prohibited
    Open

                $payload['issued'] = esc_attr( $issued->getAttribute( 'datetime' ) );
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Expected 0 spaces before closing bracket; 1 found
    Open

                $payload['issued'] = esc_attr( $issued->getAttribute( 'datetime' ) );
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Expected 0 spaces before closing bracket; 1 found
    Open

            $payload['title'] = sanitize_text_field( $title->textContent );
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Expected 0 spaces before closing bracket; 1 found
    Open

            $value = sanitize_text_field( $node->getAttribute( 'content' ) );
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Expected 0 spaces after opening bracket; 1 found
    Open

            if ( 'author' === $key ) {
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Expected 0 spaces after opening bracket; 1 found
    Open

            if ( $issued->hasAttribute( 'datetime' ) ) {
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Opening brace should be on a new line
    Open

    function update_abt_state() {
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Space after opening parenthesis of function call prohibited
    Open

                $payload['issued'] = esc_attr( $issued->getAttribute( 'content' ) );
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Space after opening parenthesis of function call prohibited
    Open

            if ( ! is_int( array_search( $a, $payload['authors'], true ) ) ) {
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Expected 0 spaces before closing bracket; 1 found
    Open

            $value = sanitize_text_field( $node->getAttribute( 'content' ) );
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Expected 0 spaces before closing bracket; 1 found
    Open

    add_action( 'wp_ajax_update_abt_state', __NAMESPACE__ . '\update_abt_state' );
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Space after opening parenthesis of function call prohibited
    Open

            $key                   = sanitize_key( str_replace( ':', '_', $expl[1] ) );
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Expected 0 spaces before closing bracket; 1 found
    Open

            $key                        = sanitize_key( $expl[1] );
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Expected 0 spaces before closing bracket; 1 found
    Open

            $value = sanitize_text_field( $node->getAttribute( 'content' ) );
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Expected 0 spaces after opening bracket; 1 found
    Open

            } elseif ( $issued->hasAttribute( 'content' ) ) {
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Expected 0 spaces after opening bracket; 1 found
    Open

        foreach ( $sailthru as $node ) {
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Space after opening parenthesis of function call prohibited
    Open

                $a = explode( ' ', $value, 2 );
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Expected 0 spaces before closing bracket; 1 found
    Open

            if ( ! is_int( array_search( $a, $payload['authors'], true ) ) ) {
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Expected 0 spaces before closing bracket; 1 found
    Open

        $abt = $xpath->query( '//meta[ starts-with( @property, "abt:" ) ]' );
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Expected 0 spaces before closing bracket; 1 found
    Open

            wp_send_json_error( 'required fields not sent', 400 );
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Expected 0 spaces after opening bracket; 1 found
    Open

        if ( ! $payload['title'] ) {
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Expected 0 spaces before closing bracket; 1 found
    Open

        $opengraph = $xpath->query( '//meta[ starts-with( @property, "og:" ) ]' );
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Expected 0 spaces before closing bracket; 1 found
    Open

                $payload['title'] = sanitize_text_field( $title->textContent );
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Expected 0 spaces after opening bracket; 1 found
    Open

        foreach ( $opengraph as $node ) {
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Space after opening parenthesis of function call prohibited
    Open

            wp_send_json_error( 'required fields not sent', 400 );
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Expected 0 spaces before closing bracket; 1 found
    Open

        $state   = json_decode( wp_unslash( $_POST['state'] ) ); // phpcs:ignore
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Space after opening parenthesis of function call prohibited
    Open

            $expl                  = explode( ':', $node->getAttribute( 'property' ), 2 );
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Space after opening parenthesis of function call prohibited
    Open

                wp_json_encode( $state )
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Expected 0 spaces before closing bracket; 1 found
    Open

        wp_send_json_success( $state );
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Space after opening parenthesis of function call prohibited
    Open

            $expl                       = explode( ':', $node->getAttribute( 'property' ), 2 );
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Space after opening parenthesis of function call prohibited
    Open

            $value                      = sanitize_text_field( $node->getAttribute( 'content' ) );
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Expected 0 spaces before closing bracket; 1 found
    Open

        $sailthru = $xpath->query( '//meta[ starts-with( @name, "sailthru" ) ]' );
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Space after opening parenthesis of function call prohibited
    Open

            $expl  = explode( '.', $node->getAttribute( 'name' ), 2 );
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Expected 0 spaces before closing bracket; 1 found
    Open

            $expl  = explode( '.', $node->getAttribute( 'name' ), 2 );
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Space after opening parenthesis of function call prohibited
    Open

                if ( ! is_int( array_search( $a, $payload['authors'], true ) ) ) {
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Expected 0 spaces before closing bracket; 1 found
    Open

            $key   = sanitize_key( $expl[1] );
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Space after opening parenthesis of function call prohibited
    Open

                $payload['issued'] = esc_attr( $issued->getAttribute( 'content' ) );
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Expected 0 spaces after opening bracket; 1 found
    Open

                if ( ! is_int( array_search( $a, $payload['authors'], true ) ) ) {
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Space after opening parenthesis of function call prohibited
    Open

            $payload['title'] = sanitize_text_field( $title->textContent );
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Expected 0 spaces before closing bracket; 1 found
    Open

            if ( $issued->hasAttribute( 'datetime' ) ) {
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Expected 0 spaces before closing bracket; 1 found
    Open

        check_ajax_referer( 'abt-ajax' );
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Expected 0 spaces before closing bracket; 1 found
    Open

                $payload['issued'] = esc_attr( $issued->getAttribute( 'content' ) );
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Expected 0 spaces before closing bracket; 1 found
    Open

        $state   = json_decode( wp_unslash( $_POST['state'] ) ); // phpcs:ignore
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Expected 0 spaces before closing bracket; 1 found
    Open

            $a = explode( ' ', sanitize_text_field( $author->textContent ), 2 );
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Space after opening parenthesis of function call prohibited
    Open

        wp_send_json_success( $state );
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Space after opening parenthesis of function call prohibited
    Open

            $expl  = explode( ':', $node->getAttribute( 'property' ), 2 );
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Expected 0 spaces after opening bracket; 1 found
    Open

            if ( $title ) {
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Space after opening parenthesis of function call prohibited
    Open

        wp_send_json( $payload );
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Expected 0 spaces before closing bracket; 1 found
    Open

            wp_send_json_error( 'state is null', 400 );
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    Space after opening parenthesis of function call prohibited
    Open

    add_action( 'wp_ajax_update_abt_state', __NAMESPACE__ . '\update_abt_state' );
    Severity: Minor
    Found in src/php/endpoints.php by phpcodesniffer

    There are no issues that match your filters.

    Category
    Status