The MU forums have moved to WordPress.org

[Twitter for Wordpress] declaration and existance error (10 posts)

  1. Orca239
    Member
    Posted 16 years ago #

    I've activated the Twitter for Wordpress plugin into the main blog of my Mu site. I put the code to display tweets in header.php of my theme (Remedy 2), and it seemed to work. However, when someone tried to register and went to activate their account, it loaded the part of the page up to the point where the twitter display code is. There it gave an error saying the declared function to display the tweets (which is defined in the plugin's file) was... undefined? I think?

    I guess the registration pages took on the theme of the main blog, but isn't relevant to the plugins or something. The first thing I tried to do was activate it site-wide, but that didn't work. So I thought to try adding the function (am I even using that word correctly?) definition into the header file of the theme, but now when it tries to load the normal blog I get the error message: "Fatal error: Cannot redeclare twitter_messages() ..."

    That didn't work, and I'm kindof out of ideas. How can I fix this problem? Thanks.

  2. tdjcbe
    Member
    Posted 16 years ago #

    Let's start off with a link to the plugin, one to where you got this "Remedy 2" from, and the complete error message that you are receiving.

    Requested reading linked to from the readme file: http://codex.wordpress.org/Debugging_WPMU

  3. andrea_r
    Moderator
    Posted 16 years ago #

    tdjcbe - note the automated headline with the plugin name in it, pulled from the repo. (just like plugin support threads at the single wp forums).

  4. drewdeal
    Member
    Posted 16 years ago #

    well.. this nice plugin just only works for the main blog. I moved it back and forth from mu-plugins to plugins, and the function is not included for anything other than the main blog.

    There is a real uniformity problem here with plugins I would say.

    As a 9 year php guy, what would help is just a quick reference to where I can check on the logic for plugins and find the switch to force them on globally when that is what I expect from them. In the case of this plugin, it should be about that simple.

  5. drewdeal
    Member
    Posted 16 years ago #

    Ok.. I got it to work now... it is just the activation that is a hassle.

    My sublog did not have any active plugins set, so I just copied this over from the mail blog option in the db:
    a:3:{i:0;s:43:"all-in-one-seo-pack/all_in_one_seo_pack.php";i:1;s:37:"sms-text-message/sms-text-message.php";i:2;s:26:"twittertwinkle/twitter.php";}

    Am I wrong, or is "activate site-wide" not supposed to do this for you?
    - it did not respond that way at all.

    Also, can you direct me to a place where I can expect to see under what rules putting plugins into mu-plugins should just work? I saw this: "We have something extra called "mu-plugins" which auto-executes any PHP file in that directory, like plugins that are enabled by default." but my twitter plugin did not work, and the sidebar code is very straightforward in detecting...
    <?php if(function_exists('twitter_messages') && get_option('twituser') ) { ?>

    I have lots of plugins to install, and did not find in the codex what exactly to expect from these to work.

  6. drewdeal
    Member
    Posted 16 years ago #

    duh.. so sorry, as an experienced php guy, i should have skipped all the admin toolboxes and just pored through the config file first for these things. :-)

    Still would not mind a good doc to skim through for someone like me who prefers references on where the bodies are buried. :-0

  7. drewdeal
    Member
    Posted 16 years ago #

    Ok. still a bit goofy. list-all.php works in mu-plugins whether I comment this all out or not. but the http://wordpress.org/extend/plugins/announcement-and-vertical-scroll-news/ plugin which has subdirs, does not execute either way.

    So... in looking at settings.. it appears mu-plugins is only dug into on one level for the plugin to work, whereas the regular plugins dir recurses as deep as needed. Does that ring true to anyone else?

    --what I learned after last post...
    The settings file already covers this same default!
    // Location of mu-plugins
    //define( 'WPMU_PLUGIN_DIR', '' );
    //define( 'WPMU_PLUGIN_URL', '' );
    define( 'MUPLUGINDIR', 'wp-content/mu-plugins' );

  8. andrea_r
    Moderator
    Posted 16 years ago #

    "it appears mu-plugins is only dug into on one level for the plugin to work, whereas the regular plugins dir recurses as deep as needed. Does that ring true to anyone else?"

    Yep. default behaviour.

  9. drewdeal
    Member
    Posted 16 years ago #

    Thanks Andrea. I also saw here on Marco's cimy post:
    http://codex.wordpress.org/WPMU_Cimy_Extra_Fields_Plugin

    ... the bemoaning of dealing with plugins that need to create tables for each blog, and how he deals:

    WPMU does not honour WP's contract to plugins to let them activate when they first start. This means that plugins never get the chance to initialize tables.

    A crap (but effective) workaround is to manually install into plugins, activate, and move the plugin into Mu plugins. In order for this to work, you need to disable (remove) the copy on mu-plugins, activate this one, and then upload to mu-plugins.

    How have you dealt with this? When i installed an sms plugin last night, I had to give in and just make it a plugin each blog could install, which has drawbacks in my overall vision for ease of use for customers.

    Thanks.

  10. andrea_r
    Moderator
    Posted 16 years ago #

    mu-plugins is not meant for plugins that *need* activation. It's a folder that *auto-executes, which is slightly different.

    Yes, there have been mu-specific plugins that reside in the mu-plugins that have created tables just fine.

    Other ways to have the plugin enabled sitewide:

    - get the Plugin Commander plugin. it will do it. Activates plugins sitewide, on creation, all kinds of stuff.

    - test the wpmu 2.8.1 beta. it has "activate plugin sitewide" for regular plugins. the bugs may have been fixed (although I see there's a new one related to this)

About this Topic

  • Started 16 years ago by Orca239
  • Latest reply from andrea_r