🎉 Happy 4th of July! Get 15% off GP Premium with the discount code: 4THOFJULY2020

[Resolved] Unexecuted PHP codes are being displayed on Shop sections & products

Home Forums Support Unexecuted PHP codes are being displayed on Shop sections & products

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #1159678
    Nitin

    Unexecuted PHP codes are being displayed on Shop sections & products.

    Here are some codes that are appearing at the front-end:

    get_id() ) ) { $attachment_ids[0] = get_post_thumbnail_id( $product->get_id() ); $attachment = wp_get_attachment_image_src( $attachment_ids[0], ‘full’ ); ?> get_gallery_image_ids(); foreach( $product_image_ids as $product_image_id ) { $image_url = wp_get_attachment_url( $product_image_id, ‘full’ ); echo ”; } } // Closing div found in Close Summary Wrap element ?>

    ‘name’, ‘order’ => ‘asc’, ‘hide_empty’ => true, ); $product_categories = get_terms( ‘product_cat’, $cat_args ); if ( ! empty( $product_categories ) ) { echo ‘
    ‘; foreach ( $product_categories as $key => $category ) { printf( ‘
    %2$S
    ‘, get_term_link( $category ), $category->name ); } echo ‘
    ‘; } ?>

    Note: This is testing for my client but once it’s solved I’ll create the same site for my client so please let me know why the issue happened.

    #1159735
    David
    Staff
    Customer Support

    Hi there,

    the Niche site uses a few Hook Elements – more info on each can be found in the Sites blog – The Shop post and The Single Product post.

    I assume that your sites wp-config has define( 'DISALLOW_FILE_EDIT', true ); set.

    Choices are:

    1. Set DISALLOW_FILE_EDIT to false.
    2. Allow PHP Execution in GP Hooks – see here for the PHP Snippet to allow that

    https://docs.generatepress.com/article/generate_hooks_execute_php/

    3. Remove those Hooked functions from the site ….

    #1160169
    Nitin

    It was done using Sucuri. I reverted the hardening but there should have been a different way I guess.

    As it can compromise with the security of the site. However, thank for the help!

    #1160363
    David
    Staff
    Customer Support

    Option 2 will limit the editing capability to just the Hook Element.
    Which is less likely to be known about by a hacker that gains access to your admin.

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