[Resolved] Latest Version of PHP

Home Forums Support Latest Version of PHP

Viewing 15 posts - 1 through 15 (of 15 total)
  • Author
    Posts
  • #1006967
    David

    Hello,

    I received a notification from WordPress that I need to update my site to the latest PHP version. Does the current version of GeneratePress run the latest PHP?

    Thank you.

    #1006970
    Leo
    Staff
    Customer Support

    Hi there,

    Yes we always make sure GP is compatible with the latest version of PHP 🙂

    #1006981
    David

    Hi Leo!

    Thanks for your reply. Why does wordpress say I need to update my version of PHP then?

    Thanks!

    #1006997
    Leo
    Staff
    Customer Support

    The PHP version of your site isn’t related to GP.

    Your hosting should be able to update that for you 🙂

    #1007021
    David

    Ok!

    Thanks Leo!

    #1007034
    Leo
    Staff
    Customer Support
    #1355038
    Vinod

    Hello,

    I had the same message from WordPress – it said my PHP version isn’t secure.So I updated to the latest version from the server side.

    After upgrading, I get a gp-premium warning on all my blog posts. I had to roll it back to the ‘insecure’ version to get rid of the warning.

    Warning: Use of undefined constant ID – assumed ‘ID’ (this will throw an Error in a future version of PHP) in /home/***/public_html/wp-content/plugins/gp-premium/elements/class-hooks.php(180) : eval()’d code on line 10

    Please help.

    #1355123
    David
    Staff
    Customer Support

    Hi there,

    Go to Appearance > Elements – do you have any Hooks that contain PHP? If so disable the hook by Quick Editing them and setting the status to draft.

    Let us know if that resolves the error.

    #1355153
    Vinod

    The only hook which I seem to have put in, is a mailchimp pop-up — and that doesn’t seem to contain PHP.

    (Sorry. Non-programmer here. I tested for PHP by just checking if the letters php appeared in the hook’s script. Guessing that’s the right way to tell if a hook ‘contains PHP’.)

    The warning I mention is appearing in a single post’s sidebar. And I see that there is a hook titled ‘Single Post Sidebar’.

    But I think this hook came as part of the GP’s bold theme.

    #1355208
    David
    Staff
    Customer Support

    Could you edit the Single Post Sidebar element. And copy and paste the code here.
    Before submitting please highlight the code and hit the CODE button. This will preserve its formatting.

    #1355236
    Vinod
    <div class="author-box">
    	<?php 
    	
    	global $post;
    	
    
    	
    	?>
    	
    	<div class="avatar"><?php echo get_avatar( get_the_author_meta( ID )); ?></div>
     
            <h5 class="author-title"><?php printf( esc_attr__( 'About %s', 'the author' ), get_the_author_meta( 'display_name') );?></h5>
    	
    				<div class="author-summary">
    	
            <p class="author-description"><?php echo wp_kses( get_the_author_meta( 'description' ), null ); ?></p>
     
            <div class="author-links">
     
                <a href="<?php echo get_author_posts_url( get_the_author_meta( 'ID' ) ); ?>" title="Read more">
                    Read more of my posts.
                </a>
     
            </div>
     
        </div>
     
    </div>

    Hoping that the code copy-pasting worked.

    #1355241
    Vinod

    <div class="avatar"><?php echo get_avatar( get_the_author_meta( ID )); ?></div>

    I suspect this line to be throwing the warning. Because the warning appears right above the ‘Author-title’ in the sidebar for the single post page… I could be wrong.

    Edit: And I just realized this is ‘line 10’ of the hook’s script, and the warning mentions line 10. So probably more likely it’s this.

    #1355442
    David
    Staff
    Customer Support

    Try replacing the code with:

    <div class="author-box">
    	<div class="avatar">
    		<?php 
    		global $post;
    		$author_id = $post->post_author;
    		echo get_avatar( $author_id );
    		?>
    	</div>
    	<h5 class="author-title">
    		<?php printf( esc_attr__( 'About %s', 'the author' ), get_the_author_meta( 'display_name') );?>
    	</h5>
    	<div class="author-summary">
    		<p class="author-description"><?php echo wp_kses( get_the_author_meta( 'description' ), null ); ?></p>
    		<div class="author-links">
    			<a href="<?php echo get_author_posts_url( get_the_author_meta( $author_id ) ); ?>" title="Read more">Read more of my posts.</a>
    		</div>
    	</div>
    </div>
    #1355860
    Vinod

    Thank you David. That seems to have worked.

    #1356177
    David
    Staff
    Customer Support

    Thanks for testing – we’ll get the Site Library updated.

Viewing 15 posts - 1 through 15 (of 15 total)
  • You must be logged in to reply to this topic.