Forums

My plugin is called six times! (9 posts)

  1. Reuben
    Member
    Posted 5 months ago #

    I have a basic shortcode plugin. I noticed that the shortcode was being rendered twice, and so added a couple log statements to my plugin; they are logged 6 times when I am rendering a single page.

    I tried turning off my plugin, and added a log statement to a different plugin; it was called the same number of times.

    I notice that the number of calls varies between different types of pages (e.g. single post is only 4; the home page is 3; etc.)

    Adding log statements to the template files themselves hasn't yielded any clues so far. I don't see evidence of double loops. A log statement in page.php is printed only once.

    What's going on here?

    Thanks

  2. Reuben
    Member
    Posted 5 months ago #

    Also, I tried turning off all other plugins, 2 or 3 at a time; the issue wasn't fixed by the absence of any.

  3. Reuben
    Member
    Posted 5 months ago #

    BUMP. This is not fixed by changing templates either.

  4. Mark (podz)
    Support Maven
    Posted 5 months ago #

    Have you contacted the plugin author?

  5. Which plugin is it or is it something you've written?

    And seriously, don't bump.

  6. Reuben
    Member
    Posted 5 months ago #

    It's my own plugin. It literally is doing nothing but debugging a log statement (and similar same happens in all plugins).

    And seriously, I'll bump if there's no activity in a week on a question.

    Thanks

  7. Are you doing an add_filter or add _action an when in the loop do you want it to run? After the wp_head in the main loop?

    As you've found out the plugin is getting called more times than you thought it would. If you can narrow down where you want it to run you could add conditionals to limit when the plugin should be implemented.

    And seriously, I'll bump if there's no activity in a week on a question.

    Well then. Good luck with your problem.

  8. Reuben
    Member
    Posted 5 months ago #

    Actually I just hacked up a backtrace debug function; this identical stack is output multiple times per page. Thus I think this must be outwith wordpress itself.

    file=memberprofile.php, line=56, function=dbug
    file=wp-settings.php, line=192, function=include_once
    file=wp-config.php, line=87, function=require_once
    file=wp-load.php, line=29, function=require_once
    file=wp-blog-header.php, line=12, function=require_once
    file=index.php, line=17, function=require

    > Well then. Good luck with your problem.

    There's a stick somewhere near your posterior that needs to be freed.

  9. Reuben
    Member
    Posted 5 months ago #

    Alright, wp-ecommerce was the plugin causing the three index calls. Disabling that reduced by half the number of calls to the plugins.

    I still have two calls to plugins from pages; debugging now.

    [17-Dec-2011 13:15:22] file=functions.php, line=4580, function=whereCalled
    file=memberprofile.php, line=56, function=dbug
    file=wp-settings.php, line=192, function=include_once
    file=wp-config.php, line=87, function=require_once
    file=wp-load.php, line=29, function=require_once
    file=wp-blog-header.php, line=12, function=require_once
    file=index.php, line=17, function=require

    [17-Dec-2011 13:15:22] initialized
    [17-Dec-2011 13:15:22] test
    [17-Dec-2011 13:15:22] file=functions.php, line=4580, function=whereCalled
    file=memberprofile.php, line=56, function=dbug
    file=wp-settings.php, line=192, function=include_once
    file=wp-config.php, line=87, function=require_once
    file=wp-load.php, line=29, function=require_once
    file=wp-cron.php, line=26, function=require_once

Reply

You must log in to post.

About this Topic