assemblee-virtuelle/wp-ldp

View on GitHub

Showing 378 of 379 total issues

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

Using cURL functions is highly discouraged. Use wp_remote_get() instead.
Open

                $ch = curl_init();
Severity: Minor
Found in class-site-taxonomy.php by phpcodesniffer

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

                                    'slug' => $term,
Severity: Minor
Found in class-settings.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_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

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

                        $current_site = $response->{'@graph'}[0];
Severity: Minor
Found in class-site-taxonomy.php by phpcodesniffer

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

                'show_in_nav_menus'          => true,
Severity: Minor
Found in class-site-taxonomy.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 '__'.
Open

            echo "<p class='description'>" . __( 'The LDP-compatible JSON Model for this container', 'wpldp' ) . '</p></td>';
Severity: Minor
Found in class-container-taxonomy.php by phpcodesniffer

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

                        'document' => array(
Severity: Minor
Found in class-settings.php by phpcodesniffer

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

            $term_id = $term->term_id;
Severity: Minor
Found in class-site-taxonomy.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

Processing form data without nonce verification.
Open

                $term_meta = $_POST['ldp_site_url'];
Severity: Minor
Found in class-site-taxonomy.php by phpcodesniffer

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

            if ( 'options-general.php' === $pagenow && 'wpldp' === $_GET['page'] ) { // change my-plugin to your plugin page.
Severity: Minor
Found in class-settings.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

Expected type hint "{\WP_REST_Request}"; found "\WP_REST_Request" for $request
Open

        public function add_new_site( \WP_REST_Request $request, \WP_REST_Response $response = null ) {
Severity: Minor
Found in class-site-taxonomy.php by phpcodesniffer

Expected 2 spaces after parameter type; 1 found
Open

         * @param  \WP_REST_Request $request The current HTTP request object.
Severity: Minor
Found in class-site-taxonomy.php by phpcodesniffer

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

No space after opening parenthesis is prohibited
Open

            foreach ($outputs as $site_url => $output ) {
Severity: Minor
Found in class-site-taxonomy.php by phpcodesniffer

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

                        'key' => 'ldp_site_url',
Severity: Minor
Found in class-site-taxonomy.php by phpcodesniffer
Severity
Category
Status
Source
Language