# Please help to fix syntax error PHP

**URL:** <https://www.phphelp.com/t/please-help-to-fix-syntax-error-php/31634>\
**Category:** Help with WordPress\
**Created:** [April 18, 2020, 12:43pm UTC](https://www.phphelp.com/t/please-help-to-fix-syntax-error-php/31634 "2020-04-18T12:43:49Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![albash](https://www.phphelp.com/letter_avatar_proxy/v4/letter/a/47e85d/32.png) [@albash](https://www.phphelp.com/u/albash)\
**Post date:** [April 18, 2020, 12:43pm UTC](https://www.phphelp.com/t/please-help-to-fix-syntax-error-php/31634/1 "2020-04-18T12:43:49Z")

</div>

hello All, Greetings of the Day… i recently decided to make a website by using plesk hosting, wordpress app. So when i try to install plugins, i’m getting an error PHP Parse error: syntax error, unexpected ‘public’ (T\_PUBLIC)……so i found the related root directory and the code. Please can someone provide the fix for this. error is in this line public function reset() {

”,  
‘nonce’ =\> ”,  
);  
$args = wp\_parse\_args( $args, $defaults );

parent::\_\_construct( $args );  
}

/\*\*  
_/  
public function add\_strings() {  
$this-\>upgrader-\>strings[‘skin\_upgrade\_start’] = \_\_( ‘The update process is starting. This process may take a while on some hosts, so please be patient.’ );  
/_ translators: 1: Title of an update, 2: Error message. _/  
$this-\>upgrader-\>strings[‘skin\_update\_failed\_error’] = \_\_( ‘An error occurred while updating %1$s: %2$s’ );  
/_ translators: %s: Title of an update. _/  
$this-\>upgrader-\>strings[‘skin\_update\_failed’] = \_\_( ‘The update of %s failed.’ );  
/_ translators: %s: Title of an update. \*/  
$this-\>upgrader-\>strings[‘skin\_update\_successful’] = \_\_( ‘%s updated successfully.’ );  
$this-\>upgrader-\>strings[‘skin\_upgrade\_end’] = \_\_( ‘All updates have been completed.’ );  
}

/\*\*

- @param string $string
- @param mixed …$args Optional text replacements.  
\*/  
public function feedback( $string, …$args ) {  
if ( isset( $this-\>upgrader-\>strings[$string] ) ) {  
$string = $this-\>upgrader-\>strings[$string];  
}

if ( strpos( $string, ‘%’ ) !== false ) {  
if ( $args ) {  
$args = array\_map( ‘strip\_tags’, $args );  
$args = array\_map( ‘esc\_html’, $args );  
$string = vsprintf( $string, $args );  
}  
}  
if ( empty( $string ) ) {  
return;  
}  
if ( $this-\>in\_loop ) {  
echo “$string\n”;  
} else {  
echo “$string\n”;  
}  
}

/\*\*  
\*/  
public function header() {  
// Nothing, This will be displayed within a iframe.  
}

/\*\*  
\*/  
public function footer() {  
// Nothing, This will be displayed within a iframe.  
}

/\*\*

- @param string|WP\_Error $error  
\*/  
public function error( $error ) {  
if ( is\_string( $error ) && isset( $this-\>upgrader-\>strings[$error] ) ) {  
$this-\>error = $this-\>upgrader-\>strings[$error];  
}

if ( is\_wp\_error( $error ) ) {  
$messages = array();  
foreach ( $error-\>get\_error\_messages() as $emessage ) {  
if ( $error-\>get\_error\_data() && is\_string( $error-\>get\_error\_data() ) ) {  
$messages[] = $emessage . ‘ ‘ . esc\_html( strip\_tags( $error-\>get\_error\_data() ) );  
} else {  
$messages[] = $emessage;  
}  
}  
$this-\>error = implode( ‘, ‘, $messages );  
}  
echo ‘jQuery(\’.waiting-‘ . esc\_js( $this-\>upgrader-\>update\_current ) . ‘\’).hide();’;  
}

/\*\*  
\*/  
public function bulk\_header() {  
$this-\>feedback( ‘skin\_upgrade\_start’ );  
}

/\*\*  
\*/  
public function bulk\_footer() {  
$this-\>feedback( ‘skin\_upgrade\_end’ );  
}

/\*\*

- @param string $title  
\*/  
public function before( $title = ” ) {  
$this-\>in\_loop = true;  
printf( ” . $this-\>upgrader-\>strings[‘skin\_before\_update\_header’] . ‘ upgrader-\>update\_current . ‘”\>’, $title, $this-\>upgrader-\>update\_current, $this-\>upgrader-\>update\_count );  
echo ‘jQuery(\’.waiting-‘ . esc\_js( $this-\>upgrader-\>update\_current ) . ‘\’).css(“display”, “inline-block”);’;  
// This progress messages div gets moved via JavaScript when clicking on “Show details.”.  
echo ‘upgrader-\>update\_current ) . ‘”\>’;  
$this-\>flush\_output();  
}

/\*\*

- @param string $title  
\*/  
public function after( $title = ” ) {  
echo ”;  
if ( $this-\>error || ! $this-\>result ) {  
if ( $this-\>error ) {  
echo ” . sprintf( $this-\>upgrader-\>strings[‘skin\_update\_failed\_error’], $title, ‘ **‘ . $this-\>error . ‘** ‘ ) . ”;  
} else {  
echo ” . sprintf( $this-\>upgrader-\>strings[‘skin\_update\_failed’], $title ) . ”;  
}

echo ‘jQuery(\’#progress-‘ . esc\_js( $this-\>upgrader-\>update\_current ) . ‘\’).show();’;  
}  
if ( $this-\>result && ! is\_wp\_error( $this-\>result ) ) {  
if ( ! $this-\>error )  
echo ” . sprintf($this-\>upgrader-\>strings[‘skin\_update\_successful’], $title, ‘jQuery(\’#progress-‘ . esc\_js($this-\>upgrader-\>update\_current) . ‘\’).toggle();jQuery(\’span\’, this).toggle(); return false;’) . ”;  
echo ‘jQuery(\’.waiting-‘ . esc\_js( $this-\>upgrader-\>update\_current ) . ‘\’).hide();’;

$this-\>reset();  
$this-\>flush\_output();  
}

/\*\*  
\*/  
public function reset() {  
$this-\>in\_loop = false;  
$this-\>error = false;  
}

/\*\*  
\*/  
public function flush\_output() {  
wp\_ob\_end\_flush\_all();  
flush();  
}  
}
