These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
| 1 | <?php |
||
| 2 | /** |
||
| 3 | * MslsOptionsPost |
||
| 4 | * @author Dennis Ploetner <[email protected]> |
||
| 5 | * @since 0.9.8 |
||
| 6 | */ |
||
| 7 | |||
| 8 | /** |
||
| 9 | * Post options |
||
| 10 | * @package Msls |
||
| 11 | */ |
||
| 12 | class MslsOptionsPost extends MslsOptions { |
||
| 13 | |||
| 14 | /** |
||
| 15 | * Separator |
||
| 16 | * @var string |
||
| 17 | */ |
||
| 18 | protected $sep = '_'; |
||
| 19 | |||
| 20 | /** |
||
| 21 | * Autoload |
||
| 22 | * @var string |
||
| 23 | */ |
||
| 24 | protected $autoload = 'no'; |
||
| 25 | |||
| 26 | /** |
||
| 27 | * Get postlink |
||
| 28 | * @param string $language |
||
| 29 | * @return string |
||
| 30 | */ |
||
| 31 | public function get_postlink( $language ) { |
||
| 32 | if ( ! $this->has_value( $language ) ) { |
||
| 33 | return ''; |
||
| 34 | } |
||
| 35 | |||
| 36 | $post = get_post( (int) $this->__get( $language ) ); |
||
| 37 | if ( is_null( $post ) || 'publish' != $post->post_status ) { |
||
| 38 | return ''; |
||
| 39 | } |
||
| 40 | |||
| 41 | if ( is_null( $this->with_front ) ) { |
||
| 42 | $post_object = get_post_type_object( $post->post_type ); |
||
| 43 | $this->with_front = ! empty( $post_object->rewrite['with_front'] ); |
||
| 44 | } |
||
| 45 | |||
| 46 | global $current_site; |
||
| 47 | $blog_id = MslsBlogCollection::instance()->get_blog_id( $language ); |
||
| 48 | if ( $current_site->blog_id != $blog_id ) { |
||
| 49 | $option = get_blog_option( $blog_id, 'msls' ); |
||
|
0 ignored issues
–
show
|
|||
| 50 | //error_log( print_r( $option, true ) ); |
||
| 51 | } |
||
| 52 | |||
| 53 | return apply_filters( 'check_url', get_permalink( $post ), $this ); |
||
| 54 | } |
||
| 55 | |||
| 56 | /** |
||
| 57 | * Get current link |
||
| 58 | * @return string |
||
| 59 | */ |
||
| 60 | public function get_current_link() { |
||
| 61 | return (string) get_permalink( $this->get_arg( 0, 0 ) ); |
||
| 62 | } |
||
| 63 | |||
| 64 | } |
||
| 65 |
This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.
Both the
$myVarassignment in line 1 and the$higherassignment in line 2 are dead. The first because$myVaris never used and the second because$higheris always overwritten for every possible time line.