Embedder version 1.3.1 — (um — Fixes Ahoy?)

Okay, thanks to Phil’s feedback I have rooted out a couple of major problems when running on PHP4 and when you’re running the WordPress server on Windows. The fixes were just a few single line code changes here and there, so nothing too much to worry about, though I would recommend you upgrade from 1.3 since it will keep you up-to-date.

I can’t promise that I have fixed everything with the new parser in every possible configuration, but the plugin will now run much better in configurations running on PHP4 and Windows.

BTW: If you are still running PHP4, you really should consider moving to PHP5 as soon as possible, since WordPress is going to be dropping support for PHP4 altogether next year (about time, really!). I believe the majority of web hosts now provide a very quick and easy way to upgrade your server to PHP5, and it should only take a couple of minutes to do.

This entry was posted in Embedder Plugin. Bookmark the permalink.

4 Responses to Embedder version 1.3.1 — (um — Fixes Ahoy?)

  1. Marc Gamble says:

    We are experiencing array error issues when your plugin is activated on our LOGIN screen.

    The plugin seems to work fine, however, on our LOGIN screen we get dozens of errors as follows:

    “Warning: array_merge() [function.array-merge]: Argument #2 is not an array in /home/v4health/public_html/wp-content/plugins/embedder/nbbc-1.4.5/nbbc.php on line 1106”

    Here is a quick jing video of what we’re experiencing: http://screencast.com/t/AaGIjvOwat9

    Please help resolve this bug issue as we LOVE your plugin and hope to continue to use it… but we need to get this issue resolved ASAP.

    Thank you for your prompt response to my request.

  2. moztools says:

    Hey Marc — just seen the comment — I’ll take a quick look to see if I find out why you’re getting the error.

  3. moztools says:

    Okay — I’m not set up to do a full debug on why you’re getting the error (though I have my suspicions), but I think I have a way to prevent you from seeing the error. I can’t really put up a new version at the moment (just about to head off on vacation) but if you’re willing to edit one of the Embedder plugin files, I can give you something to try. Just follow these instructions:

    1. Go to the “Installed Plugins” screen and click on the “Edit” link for “Embedder”.
    2. That will take you to the “Edit Plugins” screen with a list of Embedder’s files down the right-hand side.
    3. Next click the “embedder/emb-parser.php” link, which will display that file on the screen.
    4. Now search for first occurrence of “AddRules” (you can use the browser search to do this). You should be taken to a line near the bottom of the file which I believe is the culprit. The line reads:
      $parser->AddRules($this->embeds[EMB_GLOBAL]);
    5. Now, before this line, add the following line:
      if (!empty($this->embeds[EMB_GLOBAL])) {

      (Make sure to include everything on the line above, including the opening curly bracket at the end of the line)

    6. Next, four lines down–after the line with the single closing curly bracket–add another closing curly bracket:
      }

      (There should four lines of code between the first line you add and the second.)

    7. In summary, the code that used to look like this:

              $parser->AddRules($this->embeds[EMB_GLOBAL]);
              if (in_array($filter, $this->filter_comment) && !empty($this->comments[EMB_GLOBAL])) {
                  $parser->FilterRules($this->comments[EMB_GLOBAL]);
              }

      Should now look like this:

              if (!empty($this->embeds[EMB_GLOBAL])) {
                  $parser->AddRules($this->embeds[EMB_GLOBAL]);
                  if (in_array($filter, $this->filter_comment) && !empty($this->comments[EMB_GLOBAL])) {
                      $parser->FilterRules($this->comments[EMB_GLOBAL]);
                  }
              }

      The new code just adds a test that should avoid cases where you were seeing the error. There is another call to AddRules a few lines further down, but I believe that code is okay the way it is.

      Let me know how you get on. Hopefully that should solve your problems, and nothing else should be affected by this change. It’s really something that should have been there already!

  4. Rumli says:

    Hi Mark,

    I just had this issue and wanted to let you know that your solution solved it. (Why didn’t Marc Gamble tell you? You gave such a helpful reply!)

    Regards,
    Rumli – your longtime “fan” 😉

    P.S.
    Please don’t forget further developing this wonderful plugin – and your other tools of course!