Method save_as_attachment_to_post_type
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function save_as_attachment_to_post_type( $post_id, $post ) {
// Autosave, do nothing
if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) {
return $post_id; }
File class-read-offline.php
has 266 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
if ( ! defined( 'FS_CHMOD_DIR' ) ) {
define( 'FS_CHMOD_DIR', ( 0755 & ~ umask() ) );
}
Function save_as_attachment_to_post_type
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
public function save_as_attachment_to_post_type( $post_id, $post ) {
// Autosave, do nothing
if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) {
return $post_id; }
- Read upRead up
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 _create_tmp_directories
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
private function _create_tmp_directories() {
global $wp_filesystem;
if ( ! $wp_filesystem || ! is_object( $wp_filesystem ) ) {
WP_Filesystem(); }
if ( ! is_object( $wp_filesystem ) ) {
- Read upRead up
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 __construct
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function __construct() {
self::$options = get_option( 'Read_Offline_Admin_Settings' );
// Only generate files for formats selected in plugin settings
Function _remove_tmp_directories
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
private function _remove_tmp_directories() {
global $wp_filesystem;
if ( ! $wp_filesystem || ! is_object( $wp_filesystem ) ) {
WP_Filesystem(); }
if ( ! is_object( $wp_filesystem ) ) {
- Read upRead up
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 __construct
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
private function __construct() {
self::$options = get_option( 'Read_Offline_Admin_Settings' );
// Only generate files for formats selected in plugin settings
- Read upRead up
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 read_offline_update
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function read_offline_update() {
$options = get_option( 'Read_Offline' );
$version = (isset( $options['version'] )) ? $options['version'] : '0';
- Read upRead up
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 $post_id; }
Avoid too many return
statements within this method. Open
return add_action( 'admin_notices', function() use ( $error ) {
$msg[] = '<div class="error"><p>';
$msg[] = '<strong>Read Offline</strong>: ';
$msg[] = sprintf( __( 'wp_upload_bits failed, error: "<strong>%s</strong>','read-offline' ), $error );
$msg[] = '</p></div>';
Avoid too many return
statements within this method. Open
return $post_id; }
Function image_create_frome_image
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public static function image_create_frome_image( $filepath ) {
$type = exif_imagetype( $filepath ); // [] if you don't have exif you could use getImageSize()
$allowed_types = array(
1, // [] gif
2, // [] jpg
- Read upRead up
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
Similar blocks of code found in 2 locations. Consider refactoring. Open
if ( true !== $wp_filesystem->rmdir( $directory , true ) ) {
return add_action( 'admin_notices', function() use ( $directory ) {
$msg[] = '<div class="error"><p>';
$msg[] = '<strong>Read Offline</strong>: ';
$msg[] = sprintf( __( 'Unable to remove cache directory "<strong>%s</strong>". Is it and its directories writable by the server?','read-offline' ), $directory );
- Read upRead up
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 93.
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
if ( ! $wp_filesystem->mkdir( $path, FS_CHMOD_DIR ) ) {
return add_action( 'admin_notices', function() use ( $path ) {
$msg[] = '<div class="error"><p>';
$msg[] = '<strong>Read Offline</strong>: ';
$msg[] = sprintf( __( 'Unable to create directory "<strong>%s</strong>". Is its parent directory writable by the server?','read-offline' ), $path );
- Read upRead up
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 93.
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
if ( false === isset( self::$options['mobi']['add_toc'] ) ) {
self::$options['mobi']['add_toc'] = 0;
self::$options['mobi']['toc'] = 0;
update_option( 'Read_Offline_Admin_Settings', self::$options );
}
- Read upRead up
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 77.
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
if ( false === isset( self::$options['epub']['add_toc'] ) ) {
self::$options['epub']['add_toc'] = 0;
self::$options['epub']['toc'] = 0;
update_option( 'Read_Offline_Admin_Settings', self::$options );
}
- Read upRead up
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 77.
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Identical blocks of code found in 3 locations. Consider refactoring. Open
$post_types = array_keys(array_intersect(
self::$options['where']['post_types'],
array(
'post' => 1,
'page' => 1,
- Read upRead up
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 46.
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Identical blocks of code found in 2 locations. Consider refactoring. Open
if ( ! is_object( $wp_filesystem ) ) {
wp_die( 'WP_Filesystem Error:' . print_r( $wp_filesystem,true ) ); }
- Read upRead up
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 41.
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Identical blocks of code found in 2 locations. Consider refactoring. Open
if ( ! is_object( $wp_filesystem ) ) {
wp_die( 'WP_Filesystem Error:' . print_r( $wp_filesystem,true ) ); }
- Read upRead up
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 41.
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
} else {
return sprintf('%s/index.php?read_offline_id=%s&read_offline_name=%s&&read_offline_format=%s%s',
site_url(),$post_id,$name,$format,
( $refresh ) ? '&read-offline-code=' . $code : ''
);
- Read upRead up
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 40.
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Identical blocks of code found in 2 locations. Consider refactoring. Open
$attachments = new WP_Query( array(
'post_type' => 'attachment',
'post_status' => 'any',
'posts_per_page' => 500,
'post_parent' => $post_id,
- Read upRead up
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 40.
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
if ( get_option( 'permalink_structure' ) ) {
return sprintf('%s/read-offline/%s/%s.%s%s',
site_url(),$post_id,$name,$format,
( $refresh ) ? '?read-offline-code=' . $code : ''
);
- Read upRead up
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 40.
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Tabs must be used to indent lines; spaces are not allowed Open
$allowed_types = array(
- Exclude checks
Terminating statement must be indented to the same level as the CASE body Open
break;
- Exclude checks
Tabs must be used to indent lines; spaces are not allowed Open
$the_excerpt = '<p>' . $the_excerpt . '</p>';
- Exclude checks
Space after opening control structure is required Open
if( (bool) self::$options['what']['formats']['epub'] ) {
- Exclude checks
Space after opening control structure is required Open
if( (bool) self::$options['what']['formats']['pdf'] ) {
- Exclude checks
Expected 1 space before ":"; 2 found Open
( $refresh ) ? '?read-offline-code=' . $code : ''
- Exclude checks
Tabs must be used to indent lines; spaces are not allowed Open
return false;
- Exclude checks
Tabs must be used to indent lines; spaces are not allowed Open
switch ( $type ) {
- Exclude checks
There must be no space before the colon in a CASE statement Open
case 1 :
- Exclude checks
Array item not aligned correctly; expected 16 spaces but found 17 Open
'page' => 1,
- Exclude checks
Terminating statement must be indented to the same level as the CASE body Open
break;
- Exclude checks
Tabs must be used to indent lines; spaces are not allowed Open
$the_excerpt = $the_post->post_content; //Gets post_content to be used as a basis for the excerpt
- Exclude checks
Equals sign not aligned with surrounding assignments; expected 10 spaces but found 1 space Open
$words = explode( ' ', $the_excerpt, $excerpt_length + 1 );
- Exclude checks
Tabs must be used to indent lines; spaces are not allowed Open
return $the_excerpt;
- Exclude checks
No space before opening parenthesis is prohibited Open
if( (bool) self::$options['what']['formats']['epub'] ) {
- Exclude checks
Tabs must be used to indent lines; spaces are not allowed Open
case 1 :
- Exclude checks
Tabs must be used to indent lines; spaces are not allowed Open
}
- Exclude checks
Tabs must be used to indent lines; spaces are not allowed Open
return $post_id; }
- Exclude checks
Tabs must be used to indent lines; spaces are not allowed Open
}
- Exclude checks
Tabs must be used to indent lines; spaces are not allowed Open
$im = imageCreateFromBmp( $filepath );
- Exclude checks
Tabs must be used to indent lines; spaces are not allowed Open
$words = explode( ' ', $the_excerpt, $excerpt_length + 1 );
- Exclude checks
Tabs must be used to indent lines; spaces are not allowed Open
if ( ! in_array( $type, $allowed_types ) ) {
- Exclude checks
Tabs must be used to indent lines; spaces are not allowed Open
case 3 :
- Exclude checks
Tabs must be used to indent lines; spaces are not allowed Open
$type = exif_imagetype( $filepath ); // [] if you don't have exif you could use getImageSize()
- Exclude checks
There must be no space before the colon in a CASE statement Open
case 2 :
- Exclude checks
Terminating statement must be indented to the same level as the CASE body Open
break;
- Exclude checks
Tabs must be used to indent lines; spaces are not allowed Open
break;
- Exclude checks
Tabs must be used to indent lines; spaces are not allowed Open
$the_excerpt = implode( ' ', $words );
- Exclude checks
Tabs must be used to indent lines; spaces are not allowed Open
return $post_id; }
- Exclude checks
No space before opening parenthesis is prohibited Open
if( (bool) self::$options['what']['formats']['pdf'] ) {
- Exclude checks
Found precision alignment of 1 spaces. Open
'page' => 1,
- Exclude checks
Equals sign not aligned with surrounding assignments; expected 10 spaces but found 1 space Open
$type = exif_imagetype( $filepath ); // [] if you don't have exif you could use getImageSize()
- Exclude checks
Tabs must be used to indent lines; spaces are not allowed Open
$im = imageCreateFromPng( $filepath );
- Exclude checks
Terminating statement must be indented to the same level as the CASE body Open
break;
- Exclude checks
Equals sign not aligned with surrounding assignments; expected 4 spaces but found 1 space Open
$the_excerpt = $the_post->post_content; //Gets post_content to be used as a basis for the excerpt
- Exclude checks
Tabs must be used to indent lines; spaces are not allowed Open
break;
- Exclude checks
Tabs must be used to indent lines; spaces are not allowed Open
case 2 :
- Exclude checks
Tabs must be used to indent lines; spaces are not allowed Open
return $im;
- Exclude checks
Tabs must be used to indent lines; spaces are not allowed Open
$the_post = get_post( $post_id ); //Gets post ID
- Exclude checks
Tabs must be used to indent lines; spaces are not allowed Open
array_pop( $words );
- Exclude checks
Tabs must be used to indent lines; spaces are not allowed Open
$msg[] = sprintf( __( 'Unable to remove cache directory "<strong>%s</strong>". Is it and its directories writable by the server?','read-offline' ), $directory );
- Exclude checks
Array item not aligned correctly; expected 16 spaces but found 17 Open
'post' => 1,
- Exclude checks
Tabs must be used to indent lines; spaces are not allowed Open
array_push( $words, '…' );
- Exclude checks
Equals sign not aligned with surrounding assignments; expected 5 spaces but found 1 space Open
self::$options['epub']['toc'] = 0;
- Exclude checks
Tabs must be used to indent lines; spaces are not allowed Open
$msg[] = '<div class="error"><p>';
- Exclude checks
Tabs must be used to indent lines; spaces are not allowed Open
$msg[] = '<div class="error"><p>';
- Exclude checks
A gettext call containing placeholders was found, but was not accompanied by a "translators:" comment on the line above to clarify the meaning of the placeholders. Open
$msg[] = sprintf( __( 'Unable to remove cache directory "<strong>%s</strong>". Is it and its directories writable by the server?','read-offline' ), $directory );
- Exclude checks
Equals sign not aligned with surrounding assignments; expected 3 spaces but found 1 space Open
$to_filename = sprintf( '%s.%s',$post->post_name,$file_extention );
- Exclude checks
Tabs must be used to indent lines; spaces are not allowed Open
echo implode( PHP_EOL, $msg );
- Exclude checks
Concat operator must be surrounded by a single space Open
header( 'Content-disposition: attachment; filename="'. basename( $attached_file ) .'"' );
- Exclude checks
Expected 1 space after open parenthesis; 0 found Open
$version = (isset( $options['version'] )) ? $options['version'] : '0';
- Exclude checks
Tabs must be used to indent lines; spaces are not allowed Open
$msg[] = '</p></div>';
- Exclude checks
Tabs must be used to indent lines; spaces are not allowed Open
echo implode( PHP_EOL, $msg );
- Exclude checks
Tabs must be used to indent lines; spaces are not allowed Open
$msg[] = sprintf( __( 'wp_upload_bits failed, error: "<strong>%s</strong>','read-offline' ), $error );
- Exclude checks
Tabs must be used to indent lines; spaces are not allowed Open
$im = imageCreateFromGif( $filepath );
- Exclude checks
Tabs must be used to indent lines; spaces are not allowed Open
break;
- Exclude checks
A gettext call containing placeholders was found, but was not accompanied by a "translators:" comment on the line above to clarify the meaning of the placeholders. Open
$msg[] = sprintf( __( 'wp_upload_bits failed, error: "<strong>%s</strong>','read-offline' ), $error );
- Exclude checks
Tabs must be used to indent lines; spaces are not allowed Open
return $post_id; }
- Exclude checks
Tabs must be used to indent lines; spaces are not allowed Open
return add_action( 'admin_notices', function() use ( $directory ) {
- Exclude checks
Space found before comma in function call Open
header( 'Content-Type: ' . $mime_type , false );
- Exclude checks
Space after opening control structure is required Open
if( (bool) self::$options['what']['formats']['mobi'] ) {
- Exclude checks
Expected 1 space before ":"; 2 found Open
( $refresh ) ? '&read-offline-code=' . $code : ''
- Exclude checks
Tabs must be used to indent lines; spaces are not allowed Open
6, // [] bmp
- Exclude checks
Tabs must be used to indent lines; spaces are not allowed Open
);
- Exclude checks
There must be no space before the colon in a CASE statement Open
case 6 :
- Exclude checks
No space before opening parenthesis is prohibited Open
if( (bool) self::$options['what']['formats']['mobi'] ) {
- Exclude checks
Equals sign not aligned with surrounding assignments; expected 5 spaces but found 1 space Open
$attachments = new WP_Query( array(
- Exclude checks
Tabs must be used to indent lines; spaces are not allowed Open
$msg[] = '<div class="error"><p>';
- Exclude checks
Tabs must be used to indent lines; spaces are not allowed Open
2, // [] jpg
- Exclude checks
Tabs must be used to indent lines; spaces are not allowed Open
$im = imageCreateFromJpeg( $filepath );
- Exclude checks
Tabs must be used to indent lines; spaces are not allowed Open
$excerpt_length = 35; //Sets excerpt length by word count
- Exclude checks
Tabs must be used to indent lines; spaces are not allowed Open
return $mime_types;
- Exclude checks
Tabs must be used to indent lines; spaces are not allowed Open
if ( count( $words ) > $excerpt_length ) :
- Exclude checks
Concat operator must be surrounded by a single space Open
header( 'Content-Length: '.filesize( $attached_file ) );
- Exclude checks
Tabs must be used to indent lines; spaces are not allowed Open
$msg[] = sprintf( __( 'Unable to create directory "<strong>%s</strong>". Is its parent directory writable by the server?','read-offline' ), $path );
- Exclude checks
Tabs must be used to indent lines; spaces are not allowed Open
$msg[] = '</p></div>';
- Exclude checks
Tabs must be used to indent lines; spaces are not allowed Open
$msg[] = '<strong>Read Offline</strong>: ';
- Exclude checks
Tabs must be used to indent lines; spaces are not allowed Open
}
- Exclude checks
Tabs must be used to indent lines; spaces are not allowed Open
$mime_types[ $file_extention ] = $mime_type;
- Exclude checks
Concat operator must be surrounded by a single space Open
header( 'Content-disposition: attachment; filename="'. basename( $attached_file ) .'"' );
- Exclude checks
Equals sign not aligned with surrounding assignments; expected 5 spaces but found 1 space Open
self::$options['mobi']['toc'] = 0;
- Exclude checks
Found precision alignment of 1 spaces. Open
'post' => 1,
- Exclude checks
Tabs must be used to indent lines; spaces are not allowed Open
endif;
- Exclude checks
Tabs must be used to indent lines; spaces are not allowed Open
$msg[] = '</p></div>';
- Exclude checks
Expected 1 space before close parenthesis; 0 found Open
$version = (isset( $options['version'] )) ? $options['version'] : '0';
- Exclude checks
Tabs must be used to indent lines; spaces are not allowed Open
3, // [] png
- Exclude checks
Tabs must be used to indent lines; spaces are not allowed Open
case 6 :
- Exclude checks
Tabs must be used to indent lines; spaces are not allowed Open
$the_excerpt = strip_tags( strip_shortcodes( $the_excerpt ) ); //Strips tags and images
- Exclude checks
Equals sign not aligned with surrounding assignments; expected 4 spaces but found 1 space Open
$the_excerpt = strip_tags( strip_shortcodes( $the_excerpt ) ); //Strips tags and images
- Exclude checks
A gettext call containing placeholders was found, but was not accompanied by a "translators:" comment on the line above to clarify the meaning of the placeholders. Open
$msg[] = sprintf( __( 'Unable to create directory "<strong>%s</strong>". Is its parent directory writable by the server?','read-offline' ), $path );
- Exclude checks
Tabs must be used to indent lines; spaces are not allowed Open
echo implode( PHP_EOL, $msg );
- Exclude checks
Tabs must be used to indent lines; spaces are not allowed Open
1, // [] gif
- Exclude checks
There must be no space before the colon in a CASE statement Open
case 3 :
- Exclude checks
Tabs must be used to indent lines; spaces are not allowed Open
break;
- Exclude checks
Equals sign not aligned with surrounding assignments; expected 7 spaces but found 1 space Open
$the_post = get_post( $post_id ); //Gets post ID
- Exclude checks
Tabs must be used to indent lines; spaces are not allowed Open
return $post_id; }
- Exclude checks
Tabs must be used to indent lines; spaces are not allowed Open
$msg[] = '<strong>Read Offline</strong>: ';
- Exclude checks
Tabs must be used to indent lines; spaces are not allowed Open
foreach ( self::$mime_types as $file_extention => $mime_type ) {
- Exclude checks
Concat operator must be surrounded by a single space Open
header( 'Last-Modified: '.gmdate( 'D, d M Y H:i:s' ).' GMT' );
- Exclude checks
Concat operator must be surrounded by a single space Open
header( 'Last-Modified: '.gmdate( 'D, d M Y H:i:s' ).' GMT' );
- Exclude checks
Space found before comma in function call Open
if ( true !== $wp_filesystem->rmdir( $directory , true ) ) {
- Exclude checks
Tabs must be used to indent lines; spaces are not allowed Open
$msg[] = '<strong>Read Offline</strong>: ';
- Exclude checks
No space found after comma in function call Open
add_action( 'save_post_' . $post_type, array( $this, 'save_as_attachment_to_post_type' ),10,2 );
- Exclude checks
Expected 1 space after IF keyword; 0 found Open
if( (bool) self::$options['what']['formats']['mobi'] ) {
- Exclude checks
No space found after comma in function call Open
site_url(),$post_id,$name,$format,
- Exclude checks
No space found after comma in function call Open
site_url(),$post_id,$name,$format,
- Exclude checks
No space found after comma in function call Open
site_url(),$post_id,$name,$format,
- Exclude checks
Expected 1 space after IF keyword; 0 found Open
if( (bool) self::$options['what']['formats']['epub'] ) {
- Exclude checks
No space found after comma in function call Open
$to_filename = sprintf( '%s.%s',$post->post_name,$file_extention );
- Exclude checks
No space found after comma in function call Open
site_url(),$post_id,$name,$format,
- Exclude checks
No space found after comma in function call Open
$to_filename = sprintf( '%s.%s',$post->post_name,$file_extention );
- Exclude checks
Whitespace found at end of line Open
- Exclude checks
Expected 1 space after IF keyword; 0 found Open
if( (bool) self::$options['what']['formats']['pdf'] ) {
- Exclude checks
No space found after comma in function call Open
$msg[] = sprintf( __( 'wp_upload_bits failed, error: "<strong>%s</strong>','read-offline' ), $error );
- Exclude checks
No space found after comma in function call Open
$readoffline_url = self::query_url( $post_id,$post->post_name,$file_extention,true );
- Exclude checks
No space found after comma in function call Open
wp_die( 'WP_Filesystem Error:' . print_r( $wp_filesystem,true ) ); }
- Exclude checks
No space found after comma in function call Open
$readoffline_url = self::query_url( $post_id,$post->post_name,$file_extention,true );
- Exclude checks
No space found after comma in function call Open
$msg[] = sprintf( __( 'Unable to create directory "<strong>%s</strong>". Is its parent directory writable by the server?','read-offline' ), $path );
- Exclude checks
No space found after comma in function call Open
wp_die( 'WP_Filesystem Error:' . print_r( $wp_filesystem,true ) ); }
- Exclude checks
No space found after comma in function call Open
add_action( 'save_post_' . $post_type, array( $this, 'save_as_attachment_to_post_type' ),10,2 );
- Exclude checks
No space found after comma in function call Open
site_url(),$post_id,$name,$format,
- Exclude checks
No space found after comma in function call Open
site_url(),$post_id,$name,$format,
- Exclude checks
No space found after comma in function call Open
$msg[] = sprintf( __( 'Unable to remove cache directory "<strong>%s</strong>". Is it and its directories writable by the server?','read-offline' ), $directory );
- Exclude checks
Whitespace found at end of line Open
- Exclude checks
No space found after comma in function call Open
$readoffline_url = self::query_url( $post_id,$post->post_name,$file_extention,true );
- Exclude checks