I'm getting this error when trying to activate a custom plugin on my localhost, I have a working copy of the website working that runs php 5.2, where this problem does not occur.
localhost: PHP Version 5.5.14
this is the offending snippet, at the last line:
...
// Widget Backend
public function form( $instance ) {
if ( isset( $instance[ 'title' ] ) ) {
$title = $instance[ 'title' ];
} else {
$title = __( 'Delivery', 'delivery_widget_domain' );
}
if (isset($instance['sub_title'])){
$sub_title = $instance['sub_title'];
} else {
$sub_title = __('escolha uma categoria', 'delivery_widget_domain');
}
// Widget admin form
?>
<p>
<label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php _e( 'Title:' ); ?></label>
<input class="widefat" id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" type="text" value="<?php echo esc_attr( $title ); ?>" />
</p>
<p>
<label for="<?php echo $this->get_field_id('sub_title'); ?>"><?php _e('Sub Título:'); ?></label>
<input class="widefat" id="<?php echo $this->get_field_id('sub_title');?>" name="<?php echo $this->get_field_name('sub_title'); ?>" type="text" value="<?php echo esc_attr($sub_title); ?>" />
</p>
<?php
} // <----- this line
...
Why this is happening?
EDIT: paste bin of the file, the error is on line 55 http://pastebin.com/hHxnfsDA
error message ( ! ) Parse error: parse error in /.../widgets/delivery.php on line 55
Call Stack
# Time Memory Function Location
1 0.0013 391472 {main}( ) ../plugins.php:0
2 0.8336 47175152 plugin_sandbox_scrape( ) ../plugins.php:153
3 0.8337 47177328 include( '/.../plugins/portalsabores-plugin/portalsabores-plugin.php' ) ../plugins.php:151
and on cli:
Parse error: syntax error, unexpected '}' in Sites/portalsabores/wp-content/plugins/portalsabores-plugin/widgets/delivery.php on line 55