Plugin Author
mrwweb
(@mrwweb)
@afmadvertising, thanks for using the plugin and sorry to hear you’re having trouble with it.
I don’t think I’ve heard of any problems with using too many versions of the widget. There was some anecdotal evidence of too many posts causing the Widgets admin page to not load, though I could never quite confirm the issue or figure out a fix.
If you know how, can you please look in your JS console and also enable WP_DEBUG to see if there are any errors?
Thanks for the response.
Here was the issue:
[:error] [pid 32212] [client 24.123.104.230:31768] PHP Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 36864 bytes) in /nas/content/live/consideradopt/wp-content/plugins/feature-a-page-widget/inc/fpw_widget.class.php on line 55, referer: http://consideringadoption.com/wp-admin/
Here was the solution:
wp-config.php
define(‘WP_MEMORY_LIMIT’,’512M’); define(‘WP_MAX_MEMORY_LIMIT’,’512M’);
It seems to be working fine now.
Plugin Author
mrwweb
(@mrwweb)
Glad you were able to make that work for you!
The place where it runs out of memory is where it gets all the posts on your site to display in the drop down. If you are only using the Widget for certain post types, you’ll be able to speed up that admin screen by limiting the widget to only the post types you need:
/**
* only allow Pages to be featured in Feature a Page Widget
*
* @param $post_types array array of post_type slugs that can be featured with the widget
*/
add_filter( 'fpw_post_types', 'fpw_remove_post_type_to_feature' );
function fpw_remove_post_type_to_feature( $post_types ) {
return array( 'page' );
}
Alternately, you could just exclude a post type if it has way more posts than any other types and you want to keep your options open:
/**
* only all post types except Posts to be featured in Feature a Page Widget
*
* @param $post_types array array of post_type slugs that can be featured with the widget
*/
add_filter( 'fpw_post_types', 'fpw_remove_post_type_to_feature' );
function fpw_remove_post_type_to_feature( $post_types ) {
unset( $post_types['post'];
return $post_types;
}