Support » Plugin: PHP Code for posts » Plugin Freezing when saving update

  • When I update the code in a snippet and then click ‘Save’ – what often happens is that the plugin seems to freeze. The button changes to ‘Saving’ but doesn’t actually save, and I need to close the page without having made any update.

    Seems to save no problem if I just add a comment like…
    //comment here

    But if I add php such as the following then it only saves about one attempt in ten…
    echo "Hello World!";

    Any ideas?

    https://wordpress.org/plugins/php-code-for-posts/

Viewing 2 replies - 1 through 2 (of 2 total)
  • …I just found that it works (saves every time) if I place a comment after each line of PHP code.

    Is this a requirement of the plugin or is this something about how PHP works?

    For example, I can save this:

    <?php
    //CODE HERE
    echo get_the_title( $_parameters["pageid"] );
    
    //code here too
    
    echo get_the_title( $_parameters["pageid"] );
    
    //code here too
    
    echo "Hello World";
    
    //code here too
    
    echo "Hello World";
    
    //code here too
    
    echo wp_get_attachment_image(664,medium);
    
    //code here too
    
    ?>

    But not this…

    <?php
    //CODE HERE
    echo get_the_title( $_parameters["pageid"] );
    
    //code here too
    
    echo get_the_title( $_parameters["pageid"] );
    
    //code here too
    
    echo "Hello World";
    
    echo "Hello World";
    
    //code here too
    
    echo wp_get_attachment_image(664,medium);
    
    //code here too
    
    ?>

    (ie. two Hello Worlds without a comment in between will not save)

    Any ideas on why this occurs?

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Plugin Freezing when saving update’ is closed to new replies.