• Resolved Kathy Drewien

    (@kdrewien)


    Resolved: I added the following to the wp-config.php file

    define('WP_MEMORY_LIMIT', '64M');

    The following error occurs when I try to login from this URL:
    http://www.realty-advisors.com/wp-admin/

    Fatal error: Allowed memory size of 41943040 bytes exhausted (tried to allocate 122880 bytes) in /home/realty24/public_html/wp-content/themes/rac/functions.php on line 621

    When I attempt a login from http://realty-advisors.com/login the login page appears, yet generates a different error when I click the login button.

    Fatal error: Allowed memory size of 41943040 bytes exhausted (tried to allocate 122880 bytes) in /home/realty24/public_html/wp-includes/locale.php on line 152

    I’m baffled!

    The functions.php file references a plugin which, I believe, has been deactivated. Line 621 is:

    <label for="<?php echo $this->get_field_id('city'); ?>"><input id="<?php echo $this->get_field_id('city'); ?>" name="<?php echo $this->get_field_name('city'); ?>" type="checkbox" value="checked" <?php echo ( $city ) ? 'checked="checked"' : '' ?> /> Show City</label><br />

    Full section

    <p><br />
    	<em style="color:red;">This option requires AIOS Company Information Plugin</em><br />
    	<label for="<?php echo $this->get_field_id('company_name'); ?>"><input id="<?php echo $this->get_field_id('company_name'); ?>" name="<?php echo $this->get_field_name('company_name'); ?>" type="checkbox" value="checked" <?php echo ( $company_name ) ? 'checked="checked"' : '' ?> /> Show Company Name</label><br />
    	<label for="<?php echo $this->get_field_id('address1'); ?>"><input id="<?php echo $this->get_field_id('address1'); ?>" name="<?php echo $this->get_field_name('address1'); ?>" type="checkbox" value="checked" <?php echo ( $address1 ) ? 'checked="checked"' : '' ?> /> Show Address Line 1</label><br />
    	<label for="<?php echo $this->get_field_id('address2'); ?>"><input id="<?php echo $this->get_field_id('address2'); ?>" name="<?php echo $this->get_field_name('address2'); ?>" type="checkbox" value="checked" <?php echo ( $address2 ) ? 'checked="checked"' : '' ?> /> Show Address Line 2</label><br />
    	<label for="<?php echo $this->get_field_id('city'); ?>"><input id="<?php echo $this->get_field_id('city'); ?>" name="<?php echo $this->get_field_name('city'); ?>" type="checkbox" value="checked" <?php echo ( $city ) ? 'checked="checked"' : '' ?> /> Show City</label><br />
    	<label for="<?php echo $this->get_field_id('state'); ?>"><input id="<?php echo $this->get_field_id('state'); ?>" name="<?php echo $this->get_field_name('state'); ?>" type="checkbox" value="checked" <?php echo ( $state ) ? 'checked="checked"' : '' ?> /> Show State</label><br />
    	<label for="<?php echo $this->get_field_id('province'); ?>"><input id="<?php echo $this->get_field_id('province'); ?>" name="<?php echo $this->get_field_name('province'); ?>" type="checkbox" value="checked" <?php echo ( $province ) ? 'checked="checked"' : '' ?> /> Show Province</label><br />
    	<label for="<?php echo $this->get_field_id('zipcode'); ?>"><input id="<?php echo $this->get_field_id('zipcode'); ?>" name="<?php echo $this->get_field_name('zipcode'); ?>" type="checkbox" value="checked" <?php echo ( $zipcode ) ? 'checked="checked"' : '' ?> /> Show Zip Code</label><br />
    	<label for="<?php echo $this->get_field_id('country'); ?>"><input id="<?php echo $this->get_field_id('country'); ?>" name="<?php echo $this->get_field_name('country'); ?>" type="checkbox" value="checked" <?php echo ( $country ) ? 'checked="checked"' : '' ?> /> Show Country</label><br />
    	<label for="<?php echo $this->get_field_id('telephone1'); ?>"><input id="<?php echo $this->get_field_id('telephone1'); ?>" name="<?php echo $this->get_field_name('telephone1'); ?>" type="checkbox" value="checked" <?php echo ( $telephone1 ) ? 'checked="checked"' : '' ?> /> Show Telephone 1</label><br />
    	<label for="<?php echo $this->get_field_id('telephone2'); ?>"><input id="<?php echo $this->get_field_id('telephone2'); ?>" name="<?php echo $this->get_field_name('telephone2'); ?>" type="checkbox" value="checked" <?php echo ( $telephone2 ) ? 'checked="checked"' : '' ?> /> Show Telephone 2</label><br />
    	<label for="<?php echo $this->get_field_id('fax'); ?>"><input id="<?php echo $this->get_field_id('fax'); ?>" name="<?php echo $this->get_field_name('fax'); ?>" type="checkbox" value="checked" <?php echo ( $fax ) ? 'checked="checked"' : '' ?> /> Show Fax</label><br />
    	<label for="<?php echo $this->get_field_id('email1'); ?>"><input id="<?php echo $this->get_field_id('email1'); ?>" name="<?php echo $this->get_field_name('email1'); ?>" type="checkbox" value="checked" <?php echo ( $email1 ) ? 'checked="checked"' : '' ?> /> Show Email 1</label><br />
    	<label for="<?php echo $this->get_field_id('email2'); ?>"><input id="<?php echo $this->get_field_id('email2'); ?>" name="<?php echo $this->get_field_name('email2'); ?>" type="checkbox" value="checked" <?php echo ( $email2 ) ? 'checked="checked"' : '' ?> /> Show Email 2</label><br />
      </p>
    <?php
      }
    
      function update($new_instance, $old_instance)
      {
        $instance = $old_instance;
        $instance['title'] = $new_instance['title'];
    	$instance['page'] = $new_instance['page'];
    	$instance['thumb'] = $new_instance['thumb'];
    	$instance['width'] = $new_instance['width'];
    	$instance['height'] = $new_instance['height'];
    	$instance['excerpt'] = $new_instance['excerpt'];
    
    	$instance['company_name'] 	= $new_instance['company_name'];
    	$instance['address1'] 		= $new_instance['address1'];
    	$instance['address2'] 		= $new_instance['address2'];
    	$instance['city'] 			= $new_instance['city'];
    	$instance['state']			= $new_instance['state'];
    	$instance['province'] 		= $new_instance['province'];
    	$instance['zipcode'] 		= $new_instance['zipcode'];
    	$instance['country'] 		= $new_instance['country'];
    	$instance['telephone1']		= $new_instance['telephone1'];
    	$instance['telephone2']		= $new_instance['telephone2'];
    	$instance['fax']			= $new_instance['fax'];
    	$instance['email1'] 		= $new_instance['email1'];
    	$instance['email2'] 		= $new_instance['email2'];
    
    	$instance['moreLink'] = $new_instance['moreLink'];
        return $instance;
      }
    
      function widget($args, $instance)
      {
    	global $post;
        extract($args, EXTR_SKIP);
    
        echo $before_widget;
        $title = empty($instance['title']) ? ' ' : apply_filters('widget_title', $instance['title']);
    	$excerpt = $instance['excerpt'];
    	$page = $instance['page'];
    	$thumb = $instance['thumb'];
    	$width = $instance['width'];
    	$height = $instance['height'];
    
    	$info=array();
    	$info['company_name']		= $instance['company_name'];
    	$info['address1'] 			= $instance['address1'];
    	$info['address2'] 			= $instance['address2'];
    	$info['city']				= $instance['city'];
    	$info['state']				= $instance['state'];
    	$info['province'] 			= $instance['province'];
    	$info['zipcode'] 			= $instance['zipcode'];
    	$info['country'] 			= $instance['country'];
    	$info['telephone1']			= $instance['telephone1'];
    	$info['telephone2']			= $instance['telephone2'];
    	$info['fax']				= $instance['fax'];
    	$info['email1']				= $instance['email1'];
    	$info['email2'] 			= $instance['email2'];
    
    	$label=array( 'Company Name',
    				  'Address',
    				  'Address',
    				  'City',
    				  'State',
    				  'Province',
    				  'Zip Code',
    				  'Country',
    				  'Telephone',
    				  'Telephone',
    				  'Fax',
    				  'Email',
    				  'Email'
    				);
    
    	$moreLink = $instance['moreLink'];
    
        if (!empty($title))
          echo $before_title . $title . $after_title;;
    	  $post_args=array(
    						'post_type'		=>	'page',
    						'p'				=>	$page
    				);
    		query_posts($post_args);
    		$count=0;
    		if ( have_posts() ) : while ( have_posts() ) : the_post();
    	?>
    		<div class="ABwidget">
    			<div class="ABwidget-thumb">
    				<a href="<?php echo get_permalink($post->ID);?>"><?php
    				if(!empty($thumb))
    					the_post_thumbnail(array($width,$height));
    				?></a>
                </div>
                <div class="ABwidget-excerpt">
    				<?php echo substr( strip_tags($post->post_content),0,$excerpt).'';?><br>
    				<strong><a href="<?php echo get_permalink($post->ID);?>" id="ABlink"><?php echo ($moreLink) ? $moreLink : 'Read More..' ?></a></strong>
    			</div>
    			<div class="ABwidget-info">
    				<?php
    					foreach($info as $key=>$value){
    						if(!empty($value) && $value!=""){
    						?>
    							<span id="<?php echo $key;?>"><label><strong><?php echo $label[$count];?>:</strong> </label><?php echo do_shortcode('[aios-company-info field="'.$key.'"]');?></span><br>
    						<?php
    						}
    						$count++;
    					}
    				?>
    			</div>
    		</div>
    	<?php
    		endwhile; else:
    			_e('Sorry, no page matched your criteria.');
    		endif;
        echo $after_widget;
      }
    
    }
    add_action( 'widgets_init', create_function('', 'return register_widget("ABWidget");') );

  • The topic ‘Fatal error: Allowed memory size of 41943040 bytes exhausted’ is closed to new replies.