mambax7/extgallery

View on GitHub
assets/js/ml-slider/inc/slide/metaslide.image.class.php

Summary

Maintainability
C
1 day
Test Coverage

ajax_create_slide accesses the super-global variable $_POST.
Open

    public function ajax_create_slide()
    {
        // security check
        if (!wp_verify_nonce($_REQUEST['_wpnonce'], 'metaslider_addslide')) {
            echo "<tr><td colspan='2'>" . __('Security check failed. Refresh page and try again.', 'metaslider') . '</td></tr>';

Superglobals

Since: 0.2

Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.

Example

class Foo {
    public function bar() {
        $name = $_POST['foo'];
    }
}

Source

ajax_create_slide accesses the super-global variable $_REQUEST.
Open

    public function ajax_create_slide()
    {
        // security check
        if (!wp_verify_nonce($_REQUEST['_wpnonce'], 'metaslider_addslide')) {
            echo "<tr><td colspan='2'>" . __('Security check failed. Refresh page and try again.', 'metaslider') . '</td></tr>';

Superglobals

Since: 0.2

Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.

Example

class Foo {
    public function bar() {
        $name = $_POST['foo'];
    }
}

Source

ajax_create_slide accesses the super-global variable $_POST.
Open

    public function ajax_create_slide()
    {
        // security check
        if (!wp_verify_nonce($_REQUEST['_wpnonce'], 'metaslider_addslide')) {
            echo "<tr><td colspan='2'>" . __('Security check failed. Refresh page and try again.', 'metaslider') . '</td></tr>';

Superglobals

Since: 0.2

Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.

Example

class Foo {
    public function bar() {
        $name = $_POST['foo'];
    }
}

Source

ajax_resize_slide accesses the super-global variable $_POST.
Open

    public function ajax_resize_slide()
    {
        check_admin_referer('metaslider_resize');

        $slider_id = (int)$_POST['slider_id'];

Superglobals

Since: 0.2

Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.

Example

class Foo {
    public function bar() {
        $name = $_POST['foo'];
    }
}

Source

ajax_resize_slide accesses the super-global variable $_POST.
Open

    public function ajax_resize_slide()
    {
        check_admin_referer('metaslider_resize');

        $slider_id = (int)$_POST['slider_id'];

Superglobals

Since: 0.2

Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.

Example

class Foo {
    public function bar() {
        $name = $_POST['foo'];
    }
}

Source

File metaslide.image.class.php has 258 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php

/**
 * Generic Slider super class. Extended by library specific classes.
 */
Severity: Minor
Found in assets/js/ml-slider/inc/slide/metaslide.image.class.php - About 2 hrs to fix

    Method get_admin_slide has 48 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        protected function get_admin_slide()
        {
            // get some slide settings
            $imageHelper = new MetaSliderImageHelper($this->slide->ID, 150, 150, 'false', $this->use_wp_image_editor());
            $thumb       = $imageHelper->get_image_url();
    Severity: Minor
    Found in assets/js/ml-slider/inc/slide/metaslide.image.class.php - About 1 hr to fix

      Method get_public_slide has 34 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          protected function get_public_slide()
          {
              // get the image url (and handle cropping)
              // disable wp_image_editor if metadata does not exist for the slide
              $imageHelper = new MetaSliderImageHelper($this->slide->ID, $this->settings['width'], $this->settings['height'], isset($this->settings['smartCrop']) ? $this->settings['smartCrop'] : 'false', $this->use_wp_image_editor());
      Severity: Minor
      Found in assets/js/ml-slider/inc/slide/metaslide.image.class.php - About 1 hr to fix

        Function ajax_create_slide has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
        Open

            public function ajax_create_slide()
            {
                // security check
                if (!wp_verify_nonce($_REQUEST['_wpnonce'], 'metaslider_addslide')) {
                    echo "<tr><td colspan='2'>" . __('Security check failed. Refresh page and try again.', 'metaslider') . '</td></tr>';
        Severity: Minor
        Found in assets/js/ml-slider/inc/slide/metaslide.image.class.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

        Avoid too many return statements within this method.
        Open

                        return $this->get_flex_slider_markup($slide);
        Severity: Major
        Found in assets/js/ml-slider/inc/slide/metaslide.image.class.php - About 30 mins to fix

          Missing class import via use statement (line '74', column '28').
          Open

                  $imageHelper = new MetaSliderImageHelper($slide_id, $settings['width'], $settings['height'], isset($settings['smartCrop']) ? $settings['smartCrop'] : 'false', $this->use_wp_image_editor());

          MissingImport

          Since: 2.7.0

          Importing all external classes in a file through use statements makes them clearly visible.

          Example

          function make() {
              return new \stdClass();
          }

          Source http://phpmd.org/rules/cleancode.html#MissingImport

          Missing class import via use statement (line '91', column '28').
          Open

                  $imageHelper = new MetaSliderImageHelper($this->slide->ID, 150, 150, 'false', $this->use_wp_image_editor());

          MissingImport

          Since: 2.7.0

          Importing all external classes in a file through use statements makes them clearly visible.

          Example

          function make() {
              return new \stdClass();
          }

          Source http://phpmd.org/rules/cleancode.html#MissingImport

          Missing class import via use statement (line '180', column '28').
          Open

                  $imageHelper = new MetaSliderImageHelper($this->slide->ID, $this->settings['width'], $this->settings['height'], isset($this->settings['smartCrop']) ? $this->settings['smartCrop'] : 'false', $this->use_wp_image_editor());

          MissingImport

          Since: 2.7.0

          Importing all external classes in a file through use statements makes them clearly visible.

          Example

          function make() {
              return new \stdClass();
          }

          Source http://phpmd.org/rules/cleancode.html#MissingImport

          The method ajax_create_slide uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
          Open

                          } else {
                              $this->tag_slide_to_slider();
                              $this->add_or_update_or_delete_meta($slide_id, 'type', 'image');
          
                              // override the width and height to kick off the AJAX image resizing on save

          ElseExpression

          Since: 1.4.0

          An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

          Example

          class Foo
          {
              public function bar($flag)
              {
                  if ($flag) {
                      // one branch
                  } else {
                      // another branch
                  }
              }
          }

          Source https://phpmd.org/rules/cleancode.html#elseexpression

          The method ajax_create_slide() contains an exit expression.
          Open

                      exit();

          ExitExpression

          Since: 0.2

          An exit-expression within regular code is untestable and therefore it should be avoided. Consider to move the exit-expression into some kind of startup script where an error/exception code is returned to the calling environment.

          Example

          class Foo {
              public function bar($param)  {
                  if ($param === 42) {
                      exit(23);
                  }
              }
          }

          Source https://phpmd.org/rules/design.html#exitexpression

          The method ajax_create_slide() contains an exit expression.
          Open

                  exit();

          ExitExpression

          Since: 0.2

          An exit-expression within regular code is untestable and therefore it should be avoided. Consider to move the exit-expression into some kind of startup script where an error/exception code is returned to the calling environment.

          Example

          class Foo {
              public function bar($param)  {
                  if ($param === 42) {
                      exit(23);
                  }
              }
          }

          Source https://phpmd.org/rules/design.html#exitexpression

          The method ajax_resize_slide() contains an exit expression.
          Open

                  exit();

          ExitExpression

          Since: 0.2

          An exit-expression within regular code is untestable and therefore it should be avoided. Consider to move the exit-expression into some kind of startup script where an error/exception code is returned to the calling environment.

          Example

          class Foo {
              public function bar($param)  {
                  if ($param === 42) {
                      exit(23);
                  }
              }
          }

          Source https://phpmd.org/rules/design.html#exitexpression

          Similar blocks of code found in 2 locations. Consider refactoring.
          Open

                  $attributes = apply_filters('metaslider_responsive_slider_image_attributes', [
                      'src'    => $slide['src'],
                      'height' => $slide['height'],
                      'width'  => $slide['width'],
                      'alt'    => $slide['alt'],
          Severity: Minor
          Found in assets/js/ml-slider/inc/slide/metaslide.image.class.php and 1 other location - About 30 mins to fix
          assets/js/ml-slider/inc/slide/metaslide.image.class.php on lines 271..279

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 91.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Similar blocks of code found in 2 locations. Consider refactoring.
          Open

                  $attributes = apply_filters('metaslider_flex_slider_image_attributes', [
                      'src'    => $slide['src'],
                      'height' => $slide['height'],
                      'width'  => $slide['width'],
                      'alt'    => $slide['alt'],
          Severity: Minor
          Found in assets/js/ml-slider/inc/slide/metaslide.image.class.php and 1 other location - About 30 mins to fix
          assets/js/ml-slider/inc/slide/metaslide.image.class.php on lines 346..354

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 91.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Each class must be in a namespace of at least one level (a top-level vendor name)
          Open

          class MetaImageSlide extends MetaSlide

          The CASE body must start on the line following the statement
          Open

                      case 'responsive':

          Method name "MetaImageSlide::get_coin_slider_markup" is not in camel caps format
          Open

              private function get_coin_slider_markup($slide)

          The CASE body must start on the line following the statement
          Open

                      case 'flex':

          Method name "MetaImageSlide::is_valid_image" is not in camel caps format
          Open

              public function is_valid_image()

          Method name "MetaImageSlide::get_nivo_slider_markup" is not in camel caps format
          Open

              private function get_nivo_slider_markup($slide)

          Method name "MetaImageSlide::ajax_create_slide" is not in camel caps format
          Open

              public function ajax_create_slide()

          Method name "MetaImageSlide::ajax_resize_slide" is not in camel caps format
          Open

              public function ajax_resize_slide()

          Method name "MetaImageSlide::use_wp_image_editor" is not in camel caps format
          Open

              public function use_wp_image_editor()

          The CASE body must start on the line following the statement
          Open

                      case 'nivo':

          The DEFAULT body must start on the line following the statement
          Open

                      default:

          Method name "MetaImageSlide::get_responsive_slides_markup" is not in camel caps format
          Open

              private function get_responsive_slides_markup($slide)

          Method name "MetaImageSlide::get_flex_slider_markup" is not in camel caps format
          Open

              private function get_flex_slider_markup($slide)

          Method name "MetaImageSlide::get_public_slide" is not in camel caps format
          Open

              protected function get_public_slide()

          Method name "MetaImageSlide::get_admin_slide" is not in camel caps format
          Open

              protected function get_admin_slide()

          The CASE body must start on the line following the statement
          Open

                      case 'coin':

          Line exceeds 120 characters; contains 195 characters
          Open

                              echo "<tr><td colspan='2'>ID: {$slide_id} \"" . get_the_title($slide_id) . '" - ' . __('Failed to add slide. Slide already exists in slideshow.', 'metaslider') . '</td></tr>';

          Line exceeds 120 characters; contains 147 characters
          Open

                  $row .= "                <textarea name='attachment[{$this->slide->ID}][post_excerpt]' placeholder='{$str_caption}'>{$caption}</textarea>";

          Line exceeds 120 characters; contains 146 characters
          Open

                  $row .= "                <div class='row'><input type='text' size='50' name='attachment[{$this->slide->ID}][alt]' value='{$alt}' ></div>";

          Line exceeds 120 characters; contains 197 characters
          Open

                  $imageHelper = new MetaSliderImageHelper($slide_id, $settings['width'], $settings['height'], isset($settings['smartCrop']) ? $settings['smartCrop'] : 'false', $this->use_wp_image_editor());

          Line exceeds 120 characters; contains 155 characters
          Open

                  $row .= "                    <label>{$str_new_window}<input type='checkbox' name='attachment[{$this->slide->ID}][new_window]' {$target} ></label>";

          Line exceeds 120 characters; contains 128 characters
          Open

                  $thumb = isset($slide['data-thumb']) && mb_strlen($slide['data-thumb']) ? " data-thumb=\"{$slide['data-thumb']}\"" : '';

          Line exceeds 120 characters; contains 127 characters
          Open

                      $row .= "<div class='warning'>" . __('Warning: Image data does not exist. Please re-upload the image.') . '</div>';

          Line exceeds 120 characters; contains 153 characters
          Open

                  $row .= "        <input type='hidden' class='menu_order' name='attachment[{$this->slide->ID}][menu_order]' value='{$this->slide->menu_order}' >";

          Line exceeds 120 characters; contains 128 characters
          Open

                      echo "<tr><td colspan='2'>" . __('Security check failed. Refresh page and try again.', 'metaslider') . '</td></tr>';

          Line exceeds 120 characters; contains 190 characters
          Open

                              echo "<tr><td colspan='2'>ID: {$slide_id} \"" . get_the_title($slide_id) . '" - ' . __("Failed to add slide. Slide is not of type 'image'.", 'metaslider') . '</td></tr>';

          Line exceeds 120 characters; contains 154 characters
          Open

                  $row .= "            <a class='delete-slide confirm' href='?page=metaslider&amp;id={$this->slider->ID}&amp;deleteSlide={$this->slide->ID}'>x</a>";

          Line exceeds 120 characters; contains 150 characters
          Open

                  $row .= "                <input class='url' type='text' name='attachment[{$this->slide->ID}][url]' placeholder='{$str_url}' value='{$url}' >";

          Line exceeds 120 characters; contains 189 characters
          Open

                  $row .= "        <input type='hidden' name='resize_slide_id' data-slide_id='{$this->slide->ID}' data-width='{$this->settings['width']}' data-height='{$this->settings['height']}' >";

          Line exceeds 120 characters; contains 150 characters
          Open

                  $row .= "                <div class='row'><input type='text' size='50' name='attachment[{$this->slide->ID}][title]' value='{$title}' ></div>";

          Line exceeds 120 characters; contains 228 characters
          Open

                  $imageHelper = new MetaSliderImageHelper($this->slide->ID, $this->settings['width'], $this->settings['height'], isset($this->settings['smartCrop']) ? $this->settings['smartCrop'] : 'false', $this->use_wp_image_editor());

          The variable $slide_id is not named in camelCase.
          Open

              public function ajax_create_slide()
              {
                  // security check
                  if (!wp_verify_nonce($_REQUEST['_wpnonce'], 'metaslider_addslide')) {
                      echo "<tr><td colspan='2'>" . __('Security check failed. Refresh page and try again.', 'metaslider') . '</td></tr>';

          CamelCaseVariableName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name variables.

          Example

          class ClassName {
              public function doSomething() {
                  $data_module = new DataModule();
              }
          }

          Source

          The variable $slider_id is not named in camelCase.
          Open

              public function ajax_create_slide()
              {
                  // security check
                  if (!wp_verify_nonce($_REQUEST['_wpnonce'], 'metaslider_addslide')) {
                      echo "<tr><td colspan='2'>" . __('Security check failed. Refresh page and try again.', 'metaslider') . '</td></tr>';

          CamelCaseVariableName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name variables.

          Example

          class ClassName {
              public function doSomething() {
                  $data_module = new DataModule();
              }
          }

          Source

          The variable $slider_id is not named in camelCase.
          Open

              public function ajax_create_slide()
              {
                  // security check
                  if (!wp_verify_nonce($_REQUEST['_wpnonce'], 'metaslider_addslide')) {
                      echo "<tr><td colspan='2'>" . __('Security check failed. Refresh page and try again.', 'metaslider') . '</td></tr>';

          CamelCaseVariableName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name variables.

          Example

          class ClassName {
              public function doSomething() {
                  $data_module = new DataModule();
              }
          }

          Source

          The variable $slide_id is not named in camelCase.
          Open

              public function ajax_create_slide()
              {
                  // security check
                  if (!wp_verify_nonce($_REQUEST['_wpnonce'], 'metaslider_addslide')) {
                      echo "<tr><td colspan='2'>" . __('Security check failed. Refresh page and try again.', 'metaslider') . '</td></tr>';

          CamelCaseVariableName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name variables.

          Example

          class ClassName {
              public function doSomething() {
                  $data_module = new DataModule();
              }
          }

          Source

          The variable $slider_id is not named in camelCase.
          Open

              public function ajax_create_slide()
              {
                  // security check
                  if (!wp_verify_nonce($_REQUEST['_wpnonce'], 'metaslider_addslide')) {
                      echo "<tr><td colspan='2'>" . __('Security check failed. Refresh page and try again.', 'metaslider') . '</td></tr>';

          CamelCaseVariableName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name variables.

          Example

          class ClassName {
              public function doSomething() {
                  $data_module = new DataModule();
              }
          }

          Source

          The variable $slide_id is not named in camelCase.
          Open

              public function ajax_create_slide()
              {
                  // security check
                  if (!wp_verify_nonce($_REQUEST['_wpnonce'], 'metaslider_addslide')) {
                      echo "<tr><td colspan='2'>" . __('Security check failed. Refresh page and try again.', 'metaslider') . '</td></tr>';

          CamelCaseVariableName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name variables.

          Example

          class ClassName {
              public function doSomething() {
                  $data_module = new DataModule();
              }
          }

          Source

          The variable $slider_id is not named in camelCase.
          Open

              public function ajax_create_slide()
              {
                  // security check
                  if (!wp_verify_nonce($_REQUEST['_wpnonce'], 'metaslider_addslide')) {
                      echo "<tr><td colspan='2'>" . __('Security check failed. Refresh page and try again.', 'metaslider') . '</td></tr>';

          CamelCaseVariableName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name variables.

          Example

          class ClassName {
              public function doSomething() {
                  $data_module = new DataModule();
              }
          }

          Source

          The variable $slider_id is not named in camelCase.
          Open

              public function ajax_resize_slide()
              {
                  check_admin_referer('metaslider_resize');
          
                  $slider_id = (int)$_POST['slider_id'];

          CamelCaseVariableName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name variables.

          Example

          class ClassName {
              public function doSomething() {
                  $data_module = new DataModule();
              }
          }

          Source

          The variable $slide_id is not named in camelCase.
          Open

              public function ajax_resize_slide()
              {
                  check_admin_referer('metaslider_resize');
          
                  $slider_id = (int)$_POST['slider_id'];

          CamelCaseVariableName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name variables.

          Example

          class ClassName {
              public function doSomething() {
                  $data_module = new DataModule();
              }
          }

          Source

          The variable $slider_id is not named in camelCase.
          Open

              public function ajax_resize_slide()
              {
                  check_admin_referer('metaslider_resize');
          
                  $slider_id = (int)$_POST['slider_id'];

          CamelCaseVariableName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name variables.

          Example

          class ClassName {
              public function doSomething() {
                  $data_module = new DataModule();
              }
          }

          Source

          The variable $str_url is not named in camelCase.
          Open

              protected function get_admin_slide()
              {
                  // get some slide settings
                  $imageHelper = new MetaSliderImageHelper($this->slide->ID, 150, 150, 'false', $this->use_wp_image_editor());
                  $thumb       = $imageHelper->get_image_url();

          CamelCaseVariableName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name variables.

          Example

          class ClassName {
              public function doSomething() {
                  $data_module = new DataModule();
              }
          }

          Source

          The variable $str_label is not named in camelCase.
          Open

              protected function get_admin_slide()
              {
                  // get some slide settings
                  $imageHelper = new MetaSliderImageHelper($this->slide->ID, 150, 150, 'false', $this->use_wp_image_editor());
                  $thumb       = $imageHelper->get_image_url();

          CamelCaseVariableName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name variables.

          Example

          class ClassName {
              public function doSomething() {
                  $data_module = new DataModule();
              }
          }

          Source

          The variable $slide_label is not named in camelCase.
          Open

              protected function get_admin_slide()
              {
                  // get some slide settings
                  $imageHelper = new MetaSliderImageHelper($this->slide->ID, 150, 150, 'false', $this->use_wp_image_editor());
                  $thumb       = $imageHelper->get_image_url();

          CamelCaseVariableName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name variables.

          Example

          class ClassName {
              public function doSomething() {
                  $data_module = new DataModule();
              }
          }

          Source

          The variable $anchor_attributes is not named in camelCase.
          Open

              private function get_nivo_slider_markup($slide)
              {
                  $attributes = apply_filters('metaslider_nivo_slider_image_attributes', [
                      'src'        => $slide['src'],
                      'height'     => $slide['height'],

          CamelCaseVariableName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name variables.

          Example

          class ClassName {
              public function doSomething() {
                  $data_module = new DataModule();
              }
          }

          Source

          The variable $slide_label is not named in camelCase.
          Open

              protected function get_admin_slide()
              {
                  // get some slide settings
                  $imageHelper = new MetaSliderImageHelper($this->slide->ID, 150, 150, 'false', $this->use_wp_image_editor());
                  $thumb       = $imageHelper->get_image_url();

          CamelCaseVariableName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name variables.

          Example

          class ClassName {
              public function doSomething() {
                  $data_module = new DataModule();
              }
          }

          Source

          The variable $str_new_window is not named in camelCase.
          Open

              protected function get_admin_slide()
              {
                  // get some slide settings
                  $imageHelper = new MetaSliderImageHelper($this->slide->ID, 150, 150, 'false', $this->use_wp_image_editor());
                  $thumb       = $imageHelper->get_image_url();

          CamelCaseVariableName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name variables.

          Example

          class ClassName {
              public function doSomething() {
                  $data_module = new DataModule();
              }
          }

          Source

          The variable $anchor_attributes is not named in camelCase.
          Open

              private function get_responsive_slides_markup($slide)
              {
                  $attributes = apply_filters('metaslider_responsive_slider_image_attributes', [
                      'src'    => $slide['src'],
                      'height' => $slide['height'],

          CamelCaseVariableName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name variables.

          Example

          class ClassName {
              public function doSomething() {
                  $data_module = new DataModule();
              }
          }

          Source

          The variable $slide_id is not named in camelCase.
          Open

              public function ajax_create_slide()
              {
                  // security check
                  if (!wp_verify_nonce($_REQUEST['_wpnonce'], 'metaslider_addslide')) {
                      echo "<tr><td colspan='2'>" . __('Security check failed. Refresh page and try again.', 'metaslider') . '</td></tr>';

          CamelCaseVariableName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name variables.

          Example

          class ClassName {
              public function doSomething() {
                  $data_module = new DataModule();
              }
          }

          Source

          The variable $slide_id is not named in camelCase.
          Open

              public function ajax_create_slide()
              {
                  // security check
                  if (!wp_verify_nonce($_REQUEST['_wpnonce'], 'metaslider_addslide')) {
                      echo "<tr><td colspan='2'>" . __('Security check failed. Refresh page and try again.', 'metaslider') . '</td></tr>';

          CamelCaseVariableName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name variables.

          Example

          class ClassName {
              public function doSomething() {
                  $data_module = new DataModule();
              }
          }

          Source

          The variable $str_new_window is not named in camelCase.
          Open

              protected function get_admin_slide()
              {
                  // get some slide settings
                  $imageHelper = new MetaSliderImageHelper($this->slide->ID, 150, 150, 'false', $this->use_wp_image_editor());
                  $thumb       = $imageHelper->get_image_url();

          CamelCaseVariableName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name variables.

          Example

          class ClassName {
              public function doSomething() {
                  $data_module = new DataModule();
              }
          }

          Source

          The variable $str_caption is not named in camelCase.
          Open

              protected function get_admin_slide()
              {
                  // get some slide settings
                  $imageHelper = new MetaSliderImageHelper($this->slide->ID, 150, 150, 'false', $this->use_wp_image_editor());
                  $thumb       = $imageHelper->get_image_url();

          CamelCaseVariableName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name variables.

          Example

          class ClassName {
              public function doSomething() {
                  $data_module = new DataModule();
              }
          }

          Source

          The variable $slide_id is not named in camelCase.
          Open

              public function ajax_create_slide()
              {
                  // security check
                  if (!wp_verify_nonce($_REQUEST['_wpnonce'], 'metaslider_addslide')) {
                      echo "<tr><td colspan='2'>" . __('Security check failed. Refresh page and try again.', 'metaslider') . '</td></tr>';

          CamelCaseVariableName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name variables.

          Example

          class ClassName {
              public function doSomething() {
                  $data_module = new DataModule();
              }
          }

          Source

          The variable $str_url is not named in camelCase.
          Open

              protected function get_admin_slide()
              {
                  // get some slide settings
                  $imageHelper = new MetaSliderImageHelper($this->slide->ID, 150, 150, 'false', $this->use_wp_image_editor());
                  $thumb       = $imageHelper->get_image_url();

          CamelCaseVariableName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name variables.

          Example

          class ClassName {
              public function doSomething() {
                  $data_module = new DataModule();
              }
          }

          Source

          The variable $anchor_attributes is not named in camelCase.
          Open

              private function get_responsive_slides_markup($slide)
              {
                  $attributes = apply_filters('metaslider_responsive_slider_image_attributes', [
                      'src'    => $slide['src'],
                      'height' => $slide['height'],

          CamelCaseVariableName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name variables.

          Example

          class ClassName {
              public function doSomething() {
                  $data_module = new DataModule();
              }
          }

          Source

          The variable $anchor_attributes is not named in camelCase.
          Open

              private function get_responsive_slides_markup($slide)
              {
                  $attributes = apply_filters('metaslider_responsive_slider_image_attributes', [
                      'src'    => $slide['src'],
                      'height' => $slide['height'],

          CamelCaseVariableName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name variables.

          Example

          class ClassName {
              public function doSomething() {
                  $data_module = new DataModule();
              }
          }

          Source

          The variable $slide_id is not named in camelCase.
          Open

              public function ajax_create_slide()
              {
                  // security check
                  if (!wp_verify_nonce($_REQUEST['_wpnonce'], 'metaslider_addslide')) {
                      echo "<tr><td colspan='2'>" . __('Security check failed. Refresh page and try again.', 'metaslider') . '</td></tr>';

          CamelCaseVariableName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name variables.

          Example

          class ClassName {
              public function doSomething() {
                  $data_module = new DataModule();
              }
          }

          Source

          The variable $new_window is not named in camelCase.
          Open

              protected function save($fields)
              {
                  // update the slide
                  wp_update_post([
                                     'ID'           => $this->slide->ID,

          CamelCaseVariableName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name variables.

          Example

          class ClassName {
              public function doSomething() {
                  $data_module = new DataModule();
              }
          }

          Source

          The variable $slide_id is not named in camelCase.
          Open

              public function ajax_create_slide()
              {
                  // security check
                  if (!wp_verify_nonce($_REQUEST['_wpnonce'], 'metaslider_addslide')) {
                      echo "<tr><td colspan='2'>" . __('Security check failed. Refresh page and try again.', 'metaslider') . '</td></tr>';

          CamelCaseVariableName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name variables.

          Example

          class ClassName {
              public function doSomething() {
                  $data_module = new DataModule();
              }
          }

          Source

          The variable $anchor_attributes is not named in camelCase.
          Open

              private function get_nivo_slider_markup($slide)
              {
                  $attributes = apply_filters('metaslider_nivo_slider_image_attributes', [
                      'src'        => $slide['src'],
                      'height'     => $slide['height'],

          CamelCaseVariableName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name variables.

          Example

          class ClassName {
              public function doSomething() {
                  $data_module = new DataModule();
              }
          }

          Source

          The variable $anchor_attributes is not named in camelCase.
          Open

              private function get_flex_slider_markup($slide)
              {
                  $attributes = apply_filters('metaslider_flex_slider_image_attributes', [
                      'src'    => $slide['src'],
                      'height' => $slide['height'],

          CamelCaseVariableName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name variables.

          Example

          class ClassName {
              public function doSomething() {
                  $data_module = new DataModule();
              }
          }

          Source

          The variable $anchor_attributes is not named in camelCase.
          Open

              private function get_flex_slider_markup($slide)
              {
                  $attributes = apply_filters('metaslider_flex_slider_image_attributes', [
                      'src'    => $slide['src'],
                      'height' => $slide['height'],

          CamelCaseVariableName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name variables.

          Example

          class ClassName {
              public function doSomething() {
                  $data_module = new DataModule();
              }
          }

          Source

          The variable $str_label is not named in camelCase.
          Open

              protected function get_admin_slide()
              {
                  // get some slide settings
                  $imageHelper = new MetaSliderImageHelper($this->slide->ID, 150, 150, 'false', $this->use_wp_image_editor());
                  $thumb       = $imageHelper->get_image_url();

          CamelCaseVariableName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name variables.

          Example

          class ClassName {
              public function doSomething() {
                  $data_module = new DataModule();
              }
          }

          Source

          The variable $slider_id is not named in camelCase.
          Open

              public function ajax_create_slide()
              {
                  // security check
                  if (!wp_verify_nonce($_REQUEST['_wpnonce'], 'metaslider_addslide')) {
                      echo "<tr><td colspan='2'>" . __('Security check failed. Refresh page and try again.', 'metaslider') . '</td></tr>';

          CamelCaseVariableName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name variables.

          Example

          class ClassName {
              public function doSomething() {
                  $data_module = new DataModule();
              }
          }

          Source

          The variable $slide_id is not named in camelCase.
          Open

              public function ajax_resize_slide()
              {
                  check_admin_referer('metaslider_resize');
          
                  $slider_id = (int)$_POST['slider_id'];

          CamelCaseVariableName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name variables.

          Example

          class ClassName {
              public function doSomething() {
                  $data_module = new DataModule();
              }
          }

          Source

          The variable $new_window is not named in camelCase.
          Open

              protected function save($fields)
              {
                  // update the slide
                  wp_update_post([
                                     'ID'           => $this->slide->ID,

          CamelCaseVariableName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name variables.

          Example

          class ClassName {
              public function doSomething() {
                  $data_module = new DataModule();
              }
          }

          Source

          The variable $str_caption is not named in camelCase.
          Open

              protected function get_admin_slide()
              {
                  // get some slide settings
                  $imageHelper = new MetaSliderImageHelper($this->slide->ID, 150, 150, 'false', $this->use_wp_image_editor());
                  $thumb       = $imageHelper->get_image_url();

          CamelCaseVariableName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name variables.

          Example

          class ClassName {
              public function doSomething() {
                  $data_module = new DataModule();
              }
          }

          Source

          The variable $slider_id is not named in camelCase.
          Open

              public function ajax_resize_slide()
              {
                  check_admin_referer('metaslider_resize');
          
                  $slider_id = (int)$_POST['slider_id'];

          CamelCaseVariableName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name variables.

          Example

          class ClassName {
              public function doSomething() {
                  $data_module = new DataModule();
              }
          }

          Source

          The variable $slide_id is not named in camelCase.
          Open

              public function ajax_resize_slide()
              {
                  check_admin_referer('metaslider_resize');
          
                  $slider_id = (int)$_POST['slider_id'];

          CamelCaseVariableName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name variables.

          Example

          class ClassName {
              public function doSomething() {
                  $data_module = new DataModule();
              }
          }

          Source

          The variable $anchor_attributes is not named in camelCase.
          Open

              private function get_nivo_slider_markup($slide)
              {
                  $attributes = apply_filters('metaslider_nivo_slider_image_attributes', [
                      'src'        => $slide['src'],
                      'height'     => $slide['height'],

          CamelCaseVariableName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name variables.

          Example

          class ClassName {
              public function doSomething() {
                  $data_module = new DataModule();
              }
          }

          Source

          The variable $anchor_attributes is not named in camelCase.
          Open

              private function get_flex_slider_markup($slide)
              {
                  $attributes = apply_filters('metaslider_flex_slider_image_attributes', [
                      'src'    => $slide['src'],
                      'height' => $slide['height'],

          CamelCaseVariableName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name variables.

          Example

          class ClassName {
              public function doSomething() {
                  $data_module = new DataModule();
              }
          }

          Source

          The variable $slide_id is not named in camelCase.
          Open

              public function ajax_create_slide()
              {
                  // security check
                  if (!wp_verify_nonce($_REQUEST['_wpnonce'], 'metaslider_addslide')) {
                      echo "<tr><td colspan='2'>" . __('Security check failed. Refresh page and try again.', 'metaslider') . '</td></tr>';

          CamelCaseVariableName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name variables.

          Example

          class ClassName {
              public function doSomething() {
                  $data_module = new DataModule();
              }
          }

          Source

          The method ajax_create_slide is not named in camelCase.
          Open

              public function ajax_create_slide()
              {
                  // security check
                  if (!wp_verify_nonce($_REQUEST['_wpnonce'], 'metaslider_addslide')) {
                      echo "<tr><td colspan='2'>" . __('Security check failed. Refresh page and try again.', 'metaslider') . '</td></tr>';

          CamelCaseMethodName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name methods.

          Example

          class ClassName {
              public function get_name() {
              }
          }

          Source

          The method get_responsive_slides_markup is not named in camelCase.
          Open

              private function get_responsive_slides_markup($slide)
              {
                  $attributes = apply_filters('metaslider_responsive_slider_image_attributes', [
                      'src'    => $slide['src'],
                      'height' => $slide['height'],

          CamelCaseMethodName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name methods.

          Example

          class ClassName {
              public function get_name() {
              }
          }

          Source

          The method use_wp_image_editor is not named in camelCase.
          Open

              public function use_wp_image_editor()
              {
                  return apply_filters('metaslider_use_image_editor', $this->is_valid_image());
              }

          CamelCaseMethodName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name methods.

          Example

          class ClassName {
              public function get_name() {
              }
          }

          Source

          The method get_nivo_slider_markup is not named in camelCase.
          Open

              private function get_nivo_slider_markup($slide)
              {
                  $attributes = apply_filters('metaslider_nivo_slider_image_attributes', [
                      'src'        => $slide['src'],
                      'height'     => $slide['height'],

          CamelCaseMethodName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name methods.

          Example

          class ClassName {
              public function get_name() {
              }
          }

          Source

          The method ajax_resize_slide is not named in camelCase.
          Open

              public function ajax_resize_slide()
              {
                  check_admin_referer('metaslider_resize');
          
                  $slider_id = (int)$_POST['slider_id'];

          CamelCaseMethodName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name methods.

          Example

          class ClassName {
              public function get_name() {
              }
          }

          Source

          The method get_flex_slider_markup is not named in camelCase.
          Open

              private function get_flex_slider_markup($slide)
              {
                  $attributes = apply_filters('metaslider_flex_slider_image_attributes', [
                      'src'    => $slide['src'],
                      'height' => $slide['height'],

          CamelCaseMethodName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name methods.

          Example

          class ClassName {
              public function get_name() {
              }
          }

          Source

          The method is_valid_image is not named in camelCase.
          Open

              public function is_valid_image()
              {
                  $meta = wp_get_attachment_metadata($this->slide->ID);
          
                  return isset($meta['width'], $meta['height']);

          CamelCaseMethodName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name methods.

          Example

          class ClassName {
              public function get_name() {
              }
          }

          Source

          The method get_public_slide is not named in camelCase.
          Open

              protected function get_public_slide()
              {
                  // get the image url (and handle cropping)
                  // disable wp_image_editor if metadata does not exist for the slide
                  $imageHelper = new MetaSliderImageHelper($this->slide->ID, $this->settings['width'], $this->settings['height'], isset($this->settings['smartCrop']) ? $this->settings['smartCrop'] : 'false', $this->use_wp_image_editor());

          CamelCaseMethodName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name methods.

          Example

          class ClassName {
              public function get_name() {
              }
          }

          Source

          The method get_coin_slider_markup is not named in camelCase.
          Open

              private function get_coin_slider_markup($slide)
              {
                  $attributes = apply_filters('metaslider_coin_slider_image_attributes', [
                      'src'    => $slide['src'],
                      'height' => $slide['height'],

          CamelCaseMethodName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name methods.

          Example

          class ClassName {
              public function get_name() {
              }
          }

          Source

          The method get_admin_slide is not named in camelCase.
          Open

              protected function get_admin_slide()
              {
                  // get some slide settings
                  $imageHelper = new MetaSliderImageHelper($this->slide->ID, 150, 150, 'false', $this->use_wp_image_editor());
                  $thumb       = $imageHelper->get_image_url();

          CamelCaseMethodName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name methods.

          Example

          class ClassName {
              public function get_name() {
              }
          }

          Source

          There are no issues that match your filters.

          Category
          Status