assemblee-virtuelle/wp-ldp

View on GitHub
wp-ldp.php

Summary

Maintainability
F
5 days
Test Coverage

Function save_ldp_meta_for_post has a Cognitive Complexity of 78 (exceeds 5 allowed). Consider refactoring.
Open

        public function save_ldp_meta_for_post( $resource_id ) {
            $fields = Utils::get_resource_fields_list( $resource_id );

            if ( ! empty( $fields ) ) {
                foreach ( $_POST as $key => $value ) {
Severity: Minor
Found in wp-ldp.php - About 1 day 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

File wp-ldp.php has 500 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php
/**
 * The WP-LDP Plugin main file
 * @package     WPLDP
 * @author      Benoit Alessandroni
Severity: Minor
Found in wp-ldp.php - About 1 day to fix

    Function wpldp_plugin_update has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
    Open

            function wpldp_plugin_update() {
                $plugin_version = get_option( 'wpldp_version' );
                $update_option = null;
    
                if ( self::$version_number !== $plugin_version ) {
    Severity: Minor
    Found in wp-ldp.php - About 4 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

    WpLdp has 21 functions (exceeds 20 allowed). Consider refactoring.
    Open

        class WpLdp {
    
            /**
             * The front page url, defaulted as 'wp-ldp/front'.
             */
    Severity: Minor
    Found in wp-ldp.php - About 2 hrs to fix

      Method save_ldp_meta_for_post has 52 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              public function save_ldp_meta_for_post( $resource_id ) {
                  $fields = Utils::get_resource_fields_list( $resource_id );
      
                  if ( ! empty( $fields ) ) {
                      foreach ( $_POST as $key => $value ) {
      Severity: Major
      Found in wp-ldp.php - About 2 hrs to fix

        Method wpldp_plugin_update has 50 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                function wpldp_plugin_update() {
                    $plugin_version = get_option( 'wpldp_version' );
                    $update_option = null;
        
                    if ( self::$version_number !== $plugin_version ) {
        Severity: Minor
        Found in wp-ldp.php - About 2 hrs to fix

          Method ldp_enqueue_script has 47 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  public function ldp_enqueue_script() {
                      global $pagenow, $post_type;
                      $screen = get_current_screen();
                      if ( Wpldp::RESOURCE_POST_TYPE === $post_type ) {
                          wp_enqueue_media();
          Severity: Minor
          Found in wp-ldp.php - About 1 hr to fix

            Method wpldpfront_enqueue_script has 40 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                    public function wpldpfront_enqueue_script() {
                        $current_url = $_SERVER['REQUEST_URI'];
                        if ( strstr( $current_url, Wpldp::FRONT_PAGE_URL ) ) {
                            // Loading the JqueryUI library.
                            wp_register_script(
            Severity: Minor
            Found in wp-ldp.php - About 1 hr to fix

              Function wpldp_db_upgrade has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
              Open

                      private function wpldp_db_upgrade() {
                          $flush_cache = wp_cache_flush();
                          global $wpdb;
                          $wpdb->query(
                              "UPDATE $wpdb->postmeta
              Severity: Minor
              Found in wp-ldp.php - About 1 hr 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 wpldp_edit_form_advanced has 39 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                      public function wpldp_edit_form_advanced( $post ) {
                          if ( Wpldp::RESOURCE_POST_TYPE === $post->post_type ) {
                              $resource_uri = Utils::get_resource_uri( $post );
              
                              $term = get_the_terms( $post->post_id, 'ldp_container' );
              Severity: Minor
              Found in wp-ldp.php - About 1 hr to fix

                Function wpldp_edit_form_advanced has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                Open

                        public function wpldp_edit_form_advanced( $post ) {
                            if ( Wpldp::RESOURCE_POST_TYPE === $post->post_type ) {
                                $resource_uri = Utils::get_resource_uri( $post );
                
                                $term = get_the_terms( $post->post_id, 'ldp_container' );
                Severity: Minor
                Found in wp-ldp.php - About 1 hr 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 create_ldp_type has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                        public function create_ldp_type() {
                            register_post_type( 'ldp_resource',
                                array(
                                    'labels'  => array(
                                        'name'               => __( 'Resources', 'wpldp' ),
                Severity: Minor
                Found in wp-ldp.php - About 1 hr to fix

                  Method wpldp_db_upgrade has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                          private function wpldp_db_upgrade() {
                              $flush_cache = wp_cache_flush();
                              global $wpdb;
                              $wpdb->query(
                                  "UPDATE $wpdb->postmeta
                  Severity: Minor
                  Found in wp-ldp.php - About 1 hr to fix

                    Method container_meta_box_callback has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                            function container_meta_box_callback( $post ) {
                                wp_nonce_field(
                                    'wpldp_save_container_box_data',
                                    'wpldp_container_box_nonce'
                                );
                    Severity: Minor
                    Found in wp-ldp.php - About 1 hr to fix

                      Function ldp_resource_post_link has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                      Open

                              function ldp_resource_post_link( $post_link, $id = 0 ) {
                                  $post = get_post( $id );
                      
                                  if ( Wpldp::RESOURCE_POST_TYPE === get_post_type( $post ) ) {
                                      if ( is_object( $post ) ) {
                      Severity: Minor
                      Found in wp-ldp.php - About 55 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

                      Avoid deeply nested control flow statements.
                      Open

                                                                  if ( empty( $term ) || ! is_array( $term ) ) {
                                                                      $site_url_parsed = wp_parse_url( $site );
                                                                      $term = wp_insert_term(
                                                                          $site_url_parsed['host'] . ' ' . $site_url_parsed['path'],
                                                                          'ldp_site'
                      Severity: Major
                      Found in wp-ldp.php - About 45 mins to fix

                        Function container_meta_box_callback has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                        Open

                                function container_meta_box_callback( $post ) {
                                    wp_nonce_field(
                                        'wpldp_save_container_box_data',
                                        'wpldp_container_box_nonce'
                                    );
                        Severity: Minor
                        Found in wp-ldp.php - About 35 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

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

                                public static function generate_menu_item() {
                                    $menu_name = 'primary';
                                    $locations = get_nav_menu_locations();
                        
                                    if ( ! empty( $locations ) && isset( $locations[ $menu_name ] ) ) {
                        Severity: Minor
                        Found in wp-ldp.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

                        "require_once" is a statement not a function; no parentheses are required
                        Open

                        require_once( 'class-container-taxonomy.php' );
                        Severity: Minor
                        Found in wp-ldp.php by phpcodesniffer

                        "require_once" is a statement not a function; no parentheses are required
                        Open

                        require_once( 'class-site-taxonomy.php' );
                        Severity: Minor
                        Found in wp-ldp.php by phpcodesniffer

                        The parameter """" at position #2 of load_plugin_textdomain() has been deprecated since WordPress version 2.7.0. Use "" instead.
                        Open

                                    load_plugin_textdomain( 'wpldp', "", $path );
                        Severity: Minor
                        Found in wp-ldp.php by phpcodesniffer

                        Visibility must be declared on method "display_container_meta_box"
                        Open

                                function display_container_meta_box( $post_type ) {
                        Severity: Minor
                        Found in wp-ldp.php by phpcodesniffer

                        All output should be run through an escaping function (see the Security sections in the WordPress Developer Handbooks), found '$term'.
                        Open

                                            <input id="in-ldp_container-<?php echo $term->term_id; ?>" type="radio" name="tax_input[ldp_container][]" value="<?php echo $term->term_id; ?>" checked>
                        Severity: Minor
                        Found in wp-ldp.php by phpcodesniffer

                        All output should be run through an escaping function (see the Security sections in the WordPress Developer Handbooks), found '__'.
                        Open

                                    <p><?php echo __( 'If you need to upload a media during your editing, click here.', 'wpldp' ); ?></p>
                        Severity: Minor
                        Found in wp-ldp.php by phpcodesniffer

                        Equals sign not aligned correctly; expected 1 space but found 8 spaces
                        Open

                                    $path        = dirname( plugin_basename( __FILE__ ) ) . '/languages';
                        Severity: Minor
                        Found in wp-ldp.php by phpcodesniffer

                        All output should be run through an escaping function (see the Security sections in the WordPress Developer Handbooks), found '$resource_uri'.
                        Open

                                                wpldp.render('#ldpform', '<?php echo $resource_uri; ?>', undefined, undefined, '<?php echo $term[0]->slug; ?>');
                        Severity: Minor
                        Found in wp-ldp.php by phpcodesniffer

                        Resource version not set in call to wp_register_script(). This means new versions of the script will not always be loaded due to browser caching.
                        Open

                                        wp_register_script(
                        Severity: Minor
                        Found in wp-ldp.php by phpcodesniffer

                        All output should be run through an escaping function (see the Security sections in the WordPress Developer Handbooks), found '$term'.
                        Open

                                            <input id="in-ldp_container-<?php echo $term->term_id; ?>" type="radio" name="tax_input[ldp_container][]" value="<?php echo $term->term_id; ?>">
                        Severity: Minor
                        Found in wp-ldp.php by phpcodesniffer

                        Resource version not set in call to wp_register_script(). This means new versions of the script will not always be loaded due to browser caching.
                        Open

                                        wp_register_script(
                        Severity: Minor
                        Found in wp-ldp.php by phpcodesniffer

                        In footer ($in_footer) is not set explicitly wp_register_script; It is recommended to load scripts in the footer. Please set this value to true to load it in the footer, or explicitly false if it should be loaded in the header.
                        Open

                                        wp_register_script(
                        Severity: Minor
                        Found in wp-ldp.php by phpcodesniffer

                        Resource version not set in call to wp_register_script(). This means new versions of the script will not always be loaded due to browser caching.
                        Open

                                        wp_register_script(
                        Severity: Minor
                        Found in wp-ldp.php by phpcodesniffer

                        Resource version not set in call to wp_register_style(). This means new versions of the style will not always be loaded due to browser caching.
                        Open

                                    wp_register_style(
                        Severity: Minor
                        Found in wp-ldp.php by phpcodesniffer

                        Direct database call without caching detected. Consider using wp_cache_get() / wp_cache_set() or wp_cache_delete().
                        Open

                                    $wpdb->query(
                        Severity: Minor
                        Found in wp-ldp.php by phpcodesniffer

                        All output should be run through an escaping function (see the Security sections in the WordPress Developer Handbooks), found '$ldp_model'.
                        Open

                                                    models: <?php echo $ldp_model; ?>
                        Severity: Minor
                        Found in wp-ldp.php by phpcodesniffer

                        In footer ($in_footer) is not set explicitly wp_register_script; It is recommended to load scripts in the footer. Please set this value to true to load it in the footer, or explicitly false if it should be loaded in the header.
                        Open

                                        wp_register_script(
                        Severity: Minor
                        Found in wp-ldp.php by phpcodesniffer

                        In footer ($in_footer) is not set explicitly wp_register_script; It is recommended to load scripts in the footer. Please set this value to true to load it in the footer, or explicitly false if it should be loaded in the header.
                        Open

                                        wp_register_script(
                        Severity: Minor
                        Found in wp-ldp.php by phpcodesniffer

                        Resource version not set in call to wp_register_script(). This means new versions of the script will not always be loaded due to browser caching.
                        Open

                                        wp_register_script(
                        Severity: Minor
                        Found in wp-ldp.php by phpcodesniffer

                        There must be exactly one blank line before the tags in a doc comment
                        Open

                         * @package     WPLDP
                        Severity: Minor
                        Found in wp-ldp.php by phpcodesniffer

                        Equals sign not aligned with surrounding assignments; expected 4 spaces but found 1 space
                        Open

                                            $project_term = get_term_by( 'slug', 'project', 'ldp_container' );
                        Severity: Minor
                        Found in wp-ldp.php by phpcodesniffer

                        Direct database call without caching detected. Consider using wp_cache_get() / wp_cache_set() or wp_cache_delete().
                        Open

                                    $wpdb->query(
                        Severity: Minor
                        Found in wp-ldp.php by phpcodesniffer

                        Opening PHP tag must be on a line by itself
                        Open

                                    </a><?php
                        Severity: Minor
                        Found in wp-ldp.php by phpcodesniffer

                        Equals sign not aligned with surrounding assignments; expected 12 spaces but found 1 space
                        Open

                                                                        $term = wp_insert_term(
                        Severity: Minor
                        Found in wp-ldp.php by phpcodesniffer

                        In footer ($in_footer) is not set explicitly wp_register_script; It is recommended to load scripts in the footer. Please set this value to true to load it in the footer, or explicitly false if it should be loaded in the header.
                        Open

                                        wp_register_script(
                        Severity: Minor
                        Found in wp-ldp.php by phpcodesniffer

                        In footer ($in_footer) is not set explicitly wp_register_script; It is recommended to load scripts in the footer. Please set this value to true to load it in the footer, or explicitly false if it should be loaded in the header.
                        Open

                                        wp_register_script(
                        Severity: Minor
                        Found in wp-ldp.php by phpcodesniffer

                        In footer ($in_footer) is not set explicitly wp_register_script; It is recommended to load scripts in the footer. Please set this value to true to load it in the footer, or explicitly false if it should be loaded in the header.
                        Open

                                        wp_register_script(
                        Severity: Minor
                        Found in wp-ldp.php by phpcodesniffer

                        Class file names should be based on the class name with "class-" prepended. Expected class-wpldp.php, but found wp-ldp.php.
                        Wontfix

                        <?php
                        Severity: Minor
                        Found in wp-ldp.php by phpcodesniffer

                        "require_once" is a statement not a function; no parentheses are required
                        Open

                        require_once( 'class-api.php' );
                        Severity: Minor
                        Found in wp-ldp.php by phpcodesniffer

                        Usage of a direct database call is discouraged.
                        Open

                                    $wpdb->query(
                        Severity: Minor
                        Found in wp-ldp.php by phpcodesniffer

                        Visibility must be declared on method "container_meta_box_callback"
                        Open

                                function container_meta_box_callback( $post ) {
                        Severity: Minor
                        Found in wp-ldp.php by phpcodesniffer

                        Equals sign not aligned with surrounding assignments; expected 3 spaces but found 1 space
                        Open

                                            $term_id = $term[0]->term_id;
                        Severity: Minor
                        Found in wp-ldp.php by phpcodesniffer

                        In footer ($in_footer) is not set explicitly wp_register_script; It is recommended to load scripts in the footer. Please set this value to true to load it in the footer, or explicitly false if it should be loaded in the header.
                        Open

                                        wp_register_script(
                        Severity: Minor
                        Found in wp-ldp.php by phpcodesniffer

                        String "" does not require double quotes; use single quotes instead
                        Open

                                    load_plugin_textdomain( 'wpldp', "", $path );
                        Severity: Minor
                        Found in wp-ldp.php by phpcodesniffer

                        All output should be run through an escaping function (see the Security sections in the WordPress Developer Handbooks), found '$term'.
                        Open

                                            <input id="in-ldp_container-<?php echo $term->term_id; ?>" type="radio" name="tax_input[ldp_container][]" value="<?php echo $term->term_id; ?>">
                        Severity: Minor
                        Found in wp-ldp.php by phpcodesniffer

                        All output should be run through an escaping function (see the Security sections in the WordPress Developer Handbooks), found '$term'.
                        Open

                                        <?php echo $term->name; ?>
                        Severity: Minor
                        Found in wp-ldp.php by phpcodesniffer

                        Usage of a direct database call is discouraged.
                        Open

                                    $wpdb->query(
                        Severity: Minor
                        Found in wp-ldp.php by phpcodesniffer

                        All output should be run through an escaping function (see the Security sections in the WordPress Developer Handbooks), found 'get_option'.
                        Open

                                                    context: "<?php echo get_option( 'ldp_context', 'http://lov.okfn.org/dataset/lov/context' ); ?>",
                        Severity: Minor
                        Found in wp-ldp.php by phpcodesniffer

                        In footer ($in_footer) is not set explicitly wp_register_script; It is recommended to load scripts in the footer. Please set this value to true to load it in the footer, or explicitly false if it should be loaded in the header.
                        Open

                                        wp_register_script(
                        Severity: Minor
                        Found in wp-ldp.php by phpcodesniffer

                        Resource version not set in call to wp_register_script(). This means new versions of the script will not always be loaded due to browser caching.
                        Open

                                        wp_register_script(
                        Severity: Minor
                        Found in wp-ldp.php by phpcodesniffer

                        Detected usage of a non-sanitized input variable: $_SERVER
                        Open

                                    $current_url = $_SERVER['REQUEST_URI'];
                        Severity: Minor
                        Found in wp-ldp.php by phpcodesniffer

                        Resource version not set in call to wp_register_style(). This means new versions of the style will not always be loaded due to browser caching.
                        Open

                                    wp_register_style(
                        Severity: Minor
                        Found in wp-ldp.php by phpcodesniffer

                        Visibility must be declared on method "load_translations_file"
                        Open

                                function load_translations_file() {
                        Severity: Minor
                        Found in wp-ldp.php by phpcodesniffer

                        Detected usage of a non-validated input variable: $_SERVER
                        Open

                                    $current_url = $_SERVER['REQUEST_URI'];
                        Severity: Minor
                        Found in wp-ldp.php by phpcodesniffer

                        Resource version not set in call to wp_register_script(). This means new versions of the script will not always be loaded due to browser caching.
                        Open

                                        wp_register_script(
                        Severity: Minor
                        Found in wp-ldp.php by phpcodesniffer

                        In footer ($in_footer) is not set explicitly wp_register_script; It is recommended to load scripts in the footer. Please set this value to true to load it in the footer, or explicitly false if it should be loaded in the header.
                        Open

                                        wp_register_script(
                        Severity: Minor
                        Found in wp-ldp.php by phpcodesniffer

                        Missing wp_unslash() before sanitization.
                        Open

                                    $current_url = $_SERVER['REQUEST_URI'];
                        Severity: Minor
                        Found in wp-ldp.php by phpcodesniffer

                        Array double arrow not aligned correctly; expected 1 space(s) between "'show_in_admin_bar'" and double arrow, but found 5.
                        Open

                                            'show_in_admin_bar'     => true,
                        Severity: Minor
                        Found in wp-ldp.php by phpcodesniffer

                        All output should be run through an escaping function (see the Security sections in the WordPress Developer Handbooks), found '$term'.
                        Open

                                                    template: "{{{form '<?php echo $term[0]->slug; ?>'}}}",
                        Severity: Minor
                        Found in wp-ldp.php by phpcodesniffer

                        Detected usage of meta_query, possible slow query.
                        Open

                                                                            'meta_query' => array(
                        Severity: Minor
                        Found in wp-ldp.php by phpcodesniffer

                        In footer ($in_footer) is not set explicitly wp_register_script; It is recommended to load scripts in the footer. Please set this value to true to load it in the footer, or explicitly false if it should be loaded in the header.
                        Open

                                        wp_register_script(
                        Severity: Minor
                        Found in wp-ldp.php by phpcodesniffer

                        Resource version not set in call to wp_register_script(). This means new versions of the script will not always be loaded due to browser caching.
                        Open

                                        wp_register_script(
                        Severity: Minor
                        Found in wp-ldp.php by phpcodesniffer

                        In footer ($in_footer) is not set explicitly wp_register_script; It is recommended to load scripts in the footer. Please set this value to true to load it in the footer, or explicitly false if it should be loaded in the header.
                        Open

                                        wp_register_script(
                        Severity: Minor
                        Found in wp-ldp.php by phpcodesniffer

                        Resource version not set in call to wp_register_style(). This means new versions of the style will not always be loaded due to browser caching.
                        Open

                                        wp_register_style(
                        Severity: Minor
                        Found in wp-ldp.php by phpcodesniffer

                        Usage of a direct database call is discouraged.
                        Open

                                    $result = $wpdb->get_results(
                        Severity: Minor
                        Found in wp-ldp.php by phpcodesniffer

                        All output should be run through an escaping function (see the Security sections in the WordPress Developer Handbooks), found '$resource_uri'.
                        Open

                                                    container: '<?php echo $resource_uri; ?>',
                        Severity: Minor
                        Found in wp-ldp.php by phpcodesniffer

                        In footer ($in_footer) is not set explicitly wp_register_script; It is recommended to load scripts in the footer. Please set this value to true to load it in the footer, or explicitly false if it should be loaded in the header.
                        Open

                                        wp_register_script(
                        Severity: Minor
                        Found in wp-ldp.php by phpcodesniffer

                        All output should be run through an escaping function (see the Security sections in the WordPress Developer Handbooks), found '$term'.
                        Open

                                                wpldp.render('#ldpform', '<?php echo $resource_uri; ?>', undefined, undefined, '<?php echo $term[0]->slug; ?>');
                        Severity: Minor
                        Found in wp-ldp.php by phpcodesniffer

                        Detected usage of a non-validated input variable: $_SERVER
                        Open

                                    $current_url = $_SERVER['REQUEST_URI'];
                        Severity: Minor
                        Found in wp-ldp.php by phpcodesniffer

                        Processing form data without nonce verification.
                        Open

                                        foreach ( $_POST as $key => $value ) {
                        Severity: Minor
                        Found in wp-ldp.php by phpcodesniffer

                        Resource version not set in call to wp_register_script(). This means new versions of the script will not always be loaded due to browser caching.
                        Open

                                        wp_register_script(
                        Severity: Minor
                        Found in wp-ldp.php by phpcodesniffer

                        Resource version not set in call to wp_register_style(). This means new versions of the style will not always be loaded due to browser caching.
                        Open

                                        wp_register_style(
                        Severity: Minor
                        Found in wp-ldp.php by phpcodesniffer

                        "require_once" is a statement not a function; no parentheses are required
                        Open

                        require_once( 'class-settings.php' );
                        Severity: Minor
                        Found in wp-ldp.php by phpcodesniffer

                        Array double arrow not aligned correctly; expected 7 space(s) between "'description'" and double arrow, but found 11.
                        Open

                                            'description'           => __( 'LDP Resource', 'wpldp' ),
                        Severity: Minor
                        Found in wp-ldp.php by phpcodesniffer

                        Missing wp_unslash() before sanitization.
                        Open

                                    $current_url = $_SERVER['REQUEST_URI'];
                        Severity: Minor
                        Found in wp-ldp.php by phpcodesniffer

                        Equals sign not aligned with surrounding assignments; expected 2 spaces but found 1 space
                        Open

                                    $update_option = null;
                        Severity: Minor
                        Found in wp-ldp.php by phpcodesniffer

                        Array double arrow not aligned correctly; expected 7 space(s) between "'has_archive'" and double arrow, but found 11.
                        Open

                                            'has_archive'           => true,
                        Severity: Minor
                        Found in wp-ldp.php by phpcodesniffer

                        Opening PHP tag must be on a line by itself
                        Open

                                    ?><ul><?php
                        Severity: Minor
                        Found in wp-ldp.php by phpcodesniffer

                        All output should be run through an escaping function (see the Security sections in the WordPress Developer Handbooks), found '$term'.
                        Open

                                            <li id="ldp_container-<?php echo $term->term_id; ?>" class="category">
                        Severity: Minor
                        Found in wp-ldp.php by phpcodesniffer

                        Resource version not set in call to wp_register_style(). This means new versions of the style will not always be loaded due to browser caching.
                        Open

                                    wp_register_style(
                        Severity: Minor
                        Found in wp-ldp.php by phpcodesniffer

                        Resource version not set in call to wp_register_style(). This means new versions of the style will not always be loaded due to browser caching.
                        Open

                                    wp_register_style(
                        Severity: Minor
                        Found in wp-ldp.php by phpcodesniffer

                        Missing short description in doc comment
                        Open

                                /**
                        Severity: Minor
                        Found in wp-ldp.php by phpcodesniffer

                        Array double arrow not aligned correctly; expected 12 space(s) between "'public'" and double arrow, but found 16.
                        Open

                                            'public'                => true,
                        Severity: Minor
                        Found in wp-ldp.php by phpcodesniffer

                        Array double arrow not aligned correctly; expected 6 space(s) between "'show_in_menu'" and double arrow, but found 10.
                        Open

                                            'show_in_menu'          => true,
                        Severity: Minor
                        Found in wp-ldp.php by phpcodesniffer

                        Array double arrow not aligned correctly; expected 10 space(s) between "'supports'" and double arrow, but found 14.
                        Open

                                            'supports'              => array(
                        Severity: Minor
                        Found in wp-ldp.php by phpcodesniffer

                        All output should be run through an escaping function (see the Security sections in the WordPress Developer Handbooks), found '$term'.
                        Open

                                            <input id="in-ldp_container-<?php echo $term->term_id; ?>" type="radio" name="tax_input[ldp_container][]" value="<?php echo $term->term_id; ?>" checked>
                        Severity: Minor
                        Found in wp-ldp.php by phpcodesniffer

                        Visibility must be declared on method "display_media_meta_box"
                        Open

                                function display_media_meta_box( $post_type ) {
                        Severity: Minor
                        Found in wp-ldp.php by phpcodesniffer

                        json_encode() is discouraged. Use wp_json_encode() instead.
                        Open

                                                $ldp_model = json_encode( json_decode( $term_meta['ldp_model'] ) );
                        Severity: Minor
                        Found in wp-ldp.php by phpcodesniffer

                        Resource version not set in call to wp_register_script(). This means new versions of the script will not always be loaded due to browser caching.
                        Open

                                        wp_register_script(
                        Severity: Minor
                        Found in wp-ldp.php by phpcodesniffer

                        Resource version not set in call to wp_register_script(). This means new versions of the script will not always be loaded due to browser caching.
                        Open

                                        wp_register_script(
                        Severity: Minor
                        Found in wp-ldp.php by phpcodesniffer

                        Visibility must be declared on method "wpldp_plugin_update"
                        Open

                                function wpldp_plugin_update() {
                        Severity: Minor
                        Found in wp-ldp.php by phpcodesniffer

                        Array double arrow not aligned correctly; expected 9 space(s) between "'menu_icon'" and double arrow, but found 13.
                        Open

                                            'menu_icon'             => 'dashicons-image-filter',
                        Severity: Minor
                        Found in wp-ldp.php by phpcodesniffer

                        Opening PHP tag must be on a line by itself
                        Open

                                </ul><?php
                        Severity: Minor
                        Found in wp-ldp.php by phpcodesniffer

                        Resource version not set in call to wp_register_script(). This means new versions of the script will not always be loaded due to browser caching.
                        Open

                                        wp_register_script(
                        Severity: Minor
                        Found in wp-ldp.php by phpcodesniffer

                        Resource version not set in call to wp_register_script(). This means new versions of the script will not always be loaded due to browser caching.
                        Open

                                        wp_register_script(
                        Severity: Minor
                        Found in wp-ldp.php by phpcodesniffer

                        "require_once" is a statement not a function; no parentheses are required
                        Open

                        require_once( 'class-utils.php' );
                        Severity: Minor
                        Found in wp-ldp.php by phpcodesniffer

                        Equals sign not aligned with surrounding assignments; expected 2 spaces but found 1 space
                        Open

                                            $actor_term = get_term_by( 'slug', 'actor', 'ldp_container' );
                        Severity: Minor
                        Found in wp-ldp.php by phpcodesniffer

                        Direct database call without caching detected. Consider using wp_cache_get() / wp_cache_set() or wp_cache_delete().
                        Open

                                    $result = $wpdb->get_results(
                        Severity: Minor
                        Found in wp-ldp.php by phpcodesniffer

                        Array double arrow not aligned correctly; expected 12 space(s) between "'labels'" and double arrow, but found 2.
                        Open

                                            'labels'  => array(
                        Severity: Minor
                        Found in wp-ldp.php by phpcodesniffer

                        Array double arrow not aligned correctly; expected 2 space(s) between "'show_in_nav_menu'" and double arrow, but found 6.
                        Open

                                            'show_in_nav_menu'      => true,
                        Severity: Minor
                        Found in wp-ldp.php by phpcodesniffer

                        Array double arrow not aligned correctly; expected 11 space(s) between "'rewrite'" and double arrow, but found 15.
                        Open

                                            'rewrite'               => array(
                        Severity: Minor
                        Found in wp-ldp.php by phpcodesniffer

                        Visibility must be declared on method "ldp_resource_post_link"
                        Open

                                function ldp_resource_post_link( $post_link, $id = 0 ) {
                        Severity: Minor
                        Found in wp-ldp.php by phpcodesniffer

                        Found precision alignment of 2 spaces.
                        Open

                                                                          strpos( $site, 'https://' ) !== false )
                        Severity: Minor
                        Found in wp-ldp.php by phpcodesniffer

                        Resource version not set in call to wp_register_script(). This means new versions of the script will not always be loaded due to browser caching.
                        Open

                                        wp_register_script(
                        Severity: Minor
                        Found in wp-ldp.php by phpcodesniffer

                        Detected usage of a non-sanitized input variable: $_SERVER
                        Open

                                    $current_url = $_SERVER['REQUEST_URI'];
                        Severity: Minor
                        Found in wp-ldp.php by phpcodesniffer

                        In footer ($in_footer) is not set explicitly wp_register_script; It is recommended to load scripts in the footer. Please set this value to true to load it in the footer, or explicitly false if it should be loaded in the header.
                        Open

                                        wp_register_script(
                        Severity: Minor
                        Found in wp-ldp.php by phpcodesniffer

                        Space found before semicolon; expected "];" but found "] ;"
                        Open

                                    $menu_id = $locations[ $menu_name ] ;
                        Severity: Minor
                        Found in wp-ldp.php by phpcodesniffer

                        Equals sign not aligned with surrounding assignments; expected 3 spaces but found 1 space
                        Open

                                    $locations = get_nav_menu_locations();
                        Severity: Minor
                        Found in wp-ldp.php by phpcodesniffer

                        Space found before semicolon; expected "];" but found "] ;"
                        Open

                                        $menu_id = $locations[ $menu_name ] ;
                        Severity: Minor
                        Found in wp-ldp.php by phpcodesniffer

                        Array double arrow not aligned correctly; expected 3 space(s) between "'menu-item-title'" and double arrow, but found 1.
                        Open

                                                    'menu-item-title' => __( 'Ecosystem', 'wpldp' ),
                        Severity: Minor
                        Found in wp-ldp.php by phpcodesniffer

                        Array double arrow not aligned correctly; expected 5 space(s) between "'menu-item-url'" and double arrow, but found 1.
                        Open

                                                    'menu-item-url' => home_url( Wpldp::FRONT_PAGE_URL, 'relative' ),
                        Severity: Minor
                        Found in wp-ldp.php by phpcodesniffer

                        Equals sign not aligned with surrounding assignments; expected 3 spaces but found 1 space
                        Open

                                    $menu_name = 'primary';
                        Severity: Minor
                        Found in wp-ldp.php by phpcodesniffer

                        Array double arrow not aligned correctly; expected 2 space(s) between "'menu-item-status'" and double arrow, but found 1.
                        Open

                                                    'menu-item-status' => 'publish',
                        Severity: Minor
                        Found in wp-ldp.php by phpcodesniffer

                        Equals sign not aligned with surrounding assignments; expected 7 spaces but found 1 space
                        Open

                                    $items = wp_get_nav_menu_items( $menu_id );
                        Severity: Minor
                        Found in wp-ldp.php by phpcodesniffer

                        Equals sign not aligned with surrounding assignments; expected 5 spaces but found 1 space
                        Open

                                    $menu_id = $locations[ $menu_name ] ;
                        Severity: Minor
                        Found in wp-ldp.php by phpcodesniffer

                        Line indented incorrectly; expected 0 tabs, found 3
                        Open

                                    foreach ( $terms as $term ) {
                        Severity: Minor
                        Found in wp-ldp.php by phpcodesniffer

                        There are no issues that match your filters.

                        Category
                        Status