Title: Admin load time exceeded server limits
Last modified: August 21, 2016

---

# Admin load time exceeded server limits

 *  [Service RTM](https://wordpress.org/support/users/service-rtm/)
 * (@service-rtm)
 * [11 years, 10 months ago](https://wordpress.org/support/topic/admin-load-time-exceeded-server-limits/)
 * We are using the Plugin Smart blocks of content in a site with many smart blocks
   and widgets.
    When logging in as an admin into the site altering the content 
   of pages the load time to edit a page (but also the display of widgets) is extremely
   long. We believe this is caused bij the number of content smartblocks, which 
   takes very long to be retrieved. We changed to WordPress 3.9.1 version but that
   didn’t resolve the slow loading.
 * We looked at the code (retrieval of all posts one by one) and would like to ask
   you if there is a more efficient way of retrieving the smartblocks in these pages.
 * [https://wordpress.org/plugins/smart-wysiwyg-blocks-of-content/](https://wordpress.org/plugins/smart-wysiwyg-blocks-of-content/)

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Plugin Author [Coen Jacobs](https://wordpress.org/support/users/coenjacobs/)
 * (@coenjacobs)
 * [11 years, 10 months ago](https://wordpress.org/support/topic/admin-load-time-exceeded-server-limits/#post-5120520)
 * What number of smart blocks are we talking about here?
 * Also, what page is the one that gets slow, the edit page or the widgets page?
   It’s in the administration panel, right?
 *  Thread Starter [Service RTM](https://wordpress.org/support/users/service-rtm/)
 * (@service-rtm)
 * [11 years, 10 months ago](https://wordpress.org/support/topic/admin-load-time-exceeded-server-limits/#post-5120521)
 * Roughly 900 smartblocks. It is when admin is logged-in to edit a page the load
   time is 2 minutes (also the display of widgets menu option). It makes editing
   almost impossible.
 *  Thread Starter [Service RTM](https://wordpress.org/support/users/service-rtm/)
 * (@service-rtm)
 * [11 years, 10 months ago](https://wordpress.org/support/topic/admin-load-time-exceeded-server-limits/#post-5120522)
 * We suspect the amount of posts that is loading takes a long time.
    Could it be
   the loading part in the class-swboc-widget.php on line 19-30 AND in the form 
   function om line 56-75 ? Can it be made faster (more efficient) to load?
 * class-swboc-widget.php in the widget function:
 * _[ Moderator note: code fixed. Please wrap code in the backtick character or 
   [use the code button](http://codex.wordpress.org/Forum_Welcome#Posting_Code).]_
 *     ```
       if ( ! empty( $swboc_title ) )
          echo $before_title . $swboc_title . $after_title;
   
         $args = array (
          'post__in'  => array ( $swboc_id ),
          'post_type' => 'smartblock',
         );
   
         $swboc_posts = get_posts( $args );
   
         remove_filter( 'the_content', 'prepend_attachment' );
   
         foreach ( $swboc_posts as $post ) {
          echo apply_filters( 'the_content', $post->post_content );
         }
   
       class-swboc-widget.php in the form function om line 56-75
         $args = array (
          'post_type'      => 'smartblock',
          'posts_per_page' => -1,
          'orderby'        => 'ID',
          'order'          => 'ASC'
         );
   
         $swboc_posts = get_posts( $args );
   
         foreach ( $swboc_posts as $post ) {
             $currentID = $post->ID;
   
          if ( $currentID == $swboc_id ) {
           $extra = 'SELECTED';
          } else {
           $extra = '';
          }
   
          echo '<option value="' . $currentID . '" ' . $extra . '>' . $post->post_title . '</option>';
         }
       ```
   

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Admin load time exceeded server limits’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/smart-wysiwyg-blocks-of-content.svg)
 * [Smart WYSIWYG Blocks Of Content](https://wordpress.org/plugins/smart-wysiwyg-blocks-of-content/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/smart-wysiwyg-blocks-of-content/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/smart-wysiwyg-blocks-of-content/)
 * [Active Topics](https://wordpress.org/support/plugin/smart-wysiwyg-blocks-of-content/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/smart-wysiwyg-blocks-of-content/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/smart-wysiwyg-blocks-of-content/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [Service RTM](https://wordpress.org/support/users/service-rtm/)
 * Last activity: [11 years, 10 months ago](https://wordpress.org/support/topic/admin-load-time-exceeded-server-limits/#post-5120522)
 * Status: not resolved