Title: Loop inside new php-exec plugin freezing widgets?
Last modified: August 19, 2016

---

# Loop inside new php-exec plugin freezing widgets?

 *  [badm00n](https://wordpress.org/support/users/badm00n/)
 * (@badm00n)
 * [17 years, 12 months ago](https://wordpress.org/support/topic/loop-inside-new-php-exec-plugin-freezing-widgets/)
 * hey – just upgraded to the new version of php-exec plugin and put some php code
   into a text widget for my blog. I have a loop that seems to be causing some problems
   that I didn’t have in the older version of the plugin. Here is the code:
 *     ```
       <?php
       while ($i < 10) {
       $randnum = rand(1, $x) -1;
       if (!in_array($randnum, $numarray)) {
       $numarray[$i] = $randnum;
       $i++;
       }
       }
       ?>
       ```
   
 * The code works fine when you look at the website, but now when i click on the
   widgets option in the admin panel it freezes up.
 * The only way I can view my widgets again is to disable the php-exec plugin, go
   back to widgets and remove the loop.
 * Any ideas as to what is causing the widget panel to freeze with loops?

Viewing 1 replies (of 1 total)

 *  [kulpreetsingh](https://wordpress.org/support/users/kulpreetsingh/)
 * (@kulpreetsingh)
 * [17 years, 12 months ago](https://wordpress.org/support/topic/loop-inside-new-php-exec-plugin-freezing-widgets/#post-770157)
 * I would suggest instead of using the text widget to include php, you should just
   put the php directly in the template in your theme directory for your sidebar.
   php.

Viewing 1 replies (of 1 total)

The topic ‘Loop inside new php-exec plugin freezing widgets?’ is closed to new replies.

## Tags

 * [loops](https://wordpress.org/support/topic-tag/loops/)
 * [php-exec](https://wordpress.org/support/topic-tag/php-exec/)
 * [widgets](https://wordpress.org/support/topic-tag/widgets/)

 * 1 reply
 * 2 participants
 * Last reply from: [kulpreetsingh](https://wordpress.org/support/users/kulpreetsingh/)
 * Last activity: [17 years, 12 months ago](https://wordpress.org/support/topic/loop-inside-new-php-exec-plugin-freezing-widgets/#post-770157)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
