• Resolved afmadvertising

    (@afmadvertising)


    Hi, I’m using your Feature a Page widget and have had a lot of success with it on other sites. Currently, I’m working on consideringadoption.com. Everything was working just fine, but now I’m unable to access my widgets or the customizer. It works on the same theme (X, by Themeco) on other sites that are up to date, the only difference is the amount I’ve used it on this site is considerably higher. Has there ever been an issue with overuse?

    https://www.ads-software.com/plugins/feature-a-page-widget/

Viewing 3 replies - 1 through 3 (of 3 total)
  • 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?

    Thread Starter afmadvertising

    (@afmadvertising)

    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: https://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;
    }
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Limit to use?’ is closed to new replies.