WordBay


The quickest way to start earning from Wordpress and eBay!

WordBay is released under GNU/GPL and is totally free to use. If you were previously sharing impressions with the Generosity option please set this to 0% - there may be an EPN TOS issue with this and I would rather not risk any trouble. Thanks to everyone who supported WordBay in this way.
Subscribe to stay up-to-date with new versions of WordBay.

Download latest version of WordBay.

  • Pages

    • About WordBay
    • Contact
    • Customising WordBay
    • Download latest version of WordBay
    • Features of WordBay
    • Installing and configuring WordBay
      • DEPRECATED: Installing and configuring WordBay
    • WordBay - marketing your niche site
    • WordBay bugs and to-do’s
  • Search

  • Archives

    • May 2010
    • April 2010
    • March 2010
    • February 2010
    • October 2009
    • September 2009
    • August 2009
    • June 2009
    • March 2009
    • February 2009
    • December 2008
    • November 2008
    • October 2008
    • September 2008
    • July 2008
    • June 2008
    • May 2008
    • April 2008
  • Subscribe

    • Log in
    • Feed - RSS
  • NEW VERSION 1.15: WordBay.css preservation revisited!

    OK, sorry to all of you (and thanks for letting me know) who got version 1.1 of WordBay only to discover that it did not work as advertised, i.e. did not preserve your lovingly-crafted WordBay.css file. This happened due to an oversight on my part: when using the Wordpress automatic plugin update in the backend, Wordpress deletes the contents of the plugin directory before installing the new one, thus leaving no CSS file to preserve! The CSS file would only be preserved if you installed manually, but obviously a great number of users will be relying on the automatic plugin update feature so I have completely rewritten that feature now so as to store the file in the WordPress database, which means that your css file is now edited in the backend (which is starting to look very cluttered). One proviso straight away:

    The first time you install this new version, you still need to back up your WordBay.css file first! Keep it safe somewhere! Unfortunately, I cannot stop Wordpress deleting it if you update automatically.

    Also, I realised from a user bug report that this version of the plugin will unfortunately not work with PHP4 - sorry guys, it’s really time to upgrade to PHP5 if at all possible (may be as simple as choosing PHP5 in your hosting control panel, though make sure all your sites work after!). It’s not really practical to keep providing back-compatibility with earlier versions of PHP - I am suprised that something like this has not happened sooner. If you get a failure like “Call to undefined function: file_put_contents() in…” that’s what that is. If you can’t upgrade to PHP5 then I suggest rolling back to WordBay v1.05 and sticking with it until you can upgrade PHP…

    Instructions

    1) You HAVE backed up your existing WordBay.css file, right?!

    2) Update the plugin either automatically or manually. If you do it manually, you can skip the next step, since your old WordBay.css will still be in the plugin directory.

    3) Copy your backed-up WordBay.css file into the wordbay plugin directory if necessary.

    4) NOW, when you go into the WordBay settings in your admin backend, you will see, near the bottom, an area where you can edit your CSS file. From now on, do not edit the WordBay.css file directly - use the back-end, otherwise your changes will just be overwritten the next time you change any WordBay settings.

    The plugin checks all the scenarios I could think of:

    - there is no existing WordBay.css file (for some reason) and you were using a version prior to v1.1 thus none was saved to memory: a new WordBay.css file will be created using the Wordbay.css.default file

    - there is an existing WordBay.css file (that you either copied in from a backup or was left after a manual update): this file will be used and again, you should edit it in the back-end from now on

    - (and this is the bit we all want to work properly now!) there is no existing WordBay.css file because it got overwritten by the automatic update, but you had been using v1.15 (this new version) or above, and so the WordBay.css file was stored in the Wordpress database and is lovingly restored as soon as you go into the backend. Yes, for now you WILL have to pay the backend a visit every time you update - all these checks are done by the backend not by the plugin frontend - I didn’t really want the plugin bogged down with all these checks every time the plugin cycles, though I’m sure there would be a simple way to do this.

    OK, this was inevitably more complicated than I expected so please let me know how things work - I have tested it quite extensively, but I know you guys can always find some scenario I didn’t plan for! And of course, this feature only really comes into its own once I put out a NEW version of WordBay, but you can try it out by maybe uninstalling WordBay and reinstalling it if you want.

    Let me know how you get on.

    Posted on August 25th, 2009 by markowe
    Filed under: Uncategorized

    11 Responses to “NEW VERSION 1.15: WordBay.css preservation revisited!”

    1. 3dogs, on August 26th, 2009 at 1:52 pm Said:

      Hello again. I see the saved css file. Cool. Glad you did it that way.

      One question, though. I just want to be sure - once we update the saved copy it will retain the changes through each new release? In other words, from now on it will just be a matter up upgrading the plugin and then clicking save on the WordBay options screen, right?

      ——————————-

      And, another question if you don’t mind… I asked this once in the past and really didn’t get a solution. Is it possible to embed a WordBay function into a template file? I would like to have it launch at the end of article posts automatically, passing category name into it. I’ve done this with a couple other plugins, but I can’t seem to make it work with WordBay.

    2. markowe, on August 27th, 2009 at 1:38 am Said:

      Hi, ok, just to clarify, as soon as you go into WB settings after installing 1.15, a check is done for the WordBay.css file according to the three scenarios I outlined above and a copy of it saved in memory, i.e. the Wordpress database, along with all your other settings.

      What SHOULD happen next time you install WordBay (that is, a new version): whether you do it automatically or manually, as soon as you go into WB settings again (which you do need to do), the plugin will retrieve the copy of the WordBay.css saved in memory, save a copy to your plugin directory (simply overwriting the existing one if it’s still there, which doesn’t matter since they will be identical), and of course allow you to edit it in the backend, which you should do from now on. Any changes made directly to the file will not be saved. That’s how it SHOULD work, and I believe it does - I simulated installing, uninstalling, reinstalling etc. and everything worked fine, but of course, it’s always possible to miss something…

      About your other question, you’re right, I never really got to grips with it last time - to be honest I am not sure. WordBay was written to solely function as part of the “Loop” - the routine to extract the wordbay tags from the post content, and the actual listings routine itself are all rolled into one, so I fear I would have to do a bit of a rewrite to separate these functions so you could call the listings functions independently from the template, passing parameters as you go. It might be possible - I will take a few minutes now to have a look at this and let you know what I figure out.

    3. markowe, on August 27th, 2009 at 6:54 am Said:

      P.S. Hmmm, hang in there… is a bit tricky…

    4. 3dogs, on August 27th, 2009 at 9:53 am Said:

      I guess I misunderstood the css issue - I assumed you were going to save a permanent “image” to the options file. And then, when you click save, the css file “image” would be copied from wp-options to wherever is has to live in the plugin directory. That way you’d only have to actually edit it once (though you’d have to “save” it each time) and it could always be recovered if need be.

      Wp-options remains the same between releases, right?

    5. 3dogs, on August 28th, 2009 at 11:57 am Said:

      Along with by previous question about embedding in templates - can WordBay be executed from a sidebar widget? Perhaps in some fashion using the shortcodes?

    6. Mark, on August 31st, 2009 at 12:08 pm Said:

      @3dogs

      Not sure I follow you - actually, there isn’t a wp-options file (unless you mean options.php in the admin directory) in the Wordpress installation, but in any case, Wordpress stores all its options in the database, in the wp-options table, not on disk, that probably wouldn’t be good practice anyway. But yes, these options persist between releases, so your css file should always pop up in the backend as soon as you install the new version, and it’s just a case of making sure it has re-created the WordBay.css file. This should be much more straightforward than it all sounds anyway..!

      About embedding in templates and the sidebar/widgets - the issue is essentially the same: basically, I never wrote the plugin to be called as an independent routine - it runs itself within the Wordpress content “loop”. However, that would, I think, be relatively simple to rewrite, so I will consider doing that ASAP as I think I would find that useful too :).

    7. Gaz, on October 4th, 2009 at 12:33 am Said:

      Mark

      I’ll be experimenting with embedding the WB results into the template using tags sometime this month. I’m not a programmer but can copy and hack quite well - the route I was considering (in plainish English) would be to -

      embed the function call for WB into the appropriate place in the template but call either the post category or the post tags as a text string, replacing the normal routine of user typing the keywords between the tags - there’s a WordPress series of functions for this in the WP Docs and it should be as simple as providing a radio button range the post page - e.g. -
      - use user set keywords
      - use post category as keywords
      - use post tags as keywords
      - use post title as keywords (just thought of this one - it might be useful)

      If option 1 is selected, then an input field “de-grays” and becomes available for the user to input the keywords.

      Where I’m thinking this would be very useful would for having a inside the post (e.g. a column of ads at top or bottom right or left) that auto-appears and refreshes with each page load.

      Another use could be to pad the side of the user comment input … with for example, ads for dictionaries or thesauruses (LOL) as a nag about how to use correct spelling - I really need that on one of my sites (the users seem to only know SMSspeak = really annoying).

      There’s loads of possibilities with WB - I guess it only needs some work? Maybe you could organise some form of tele-commuting “weekend of code” event where we could all link up to present hacks and ideas and “plugins” for WB?

      Gaz

    8. ChuckMcB, on October 21st, 2009 at 4:57 am Said:

      Here’s a wee bugette for you markowe.

      Each time I save the Wordbay settings the text box with my wordbay.css file contents gets twice as many backslashes in front of the single quote mark.

      [code]/* Classes for individual items - could put rounded corners in or something. You\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\’ll want to change these colours for sure */[/code]

      Hit save gives you:

      [code]/* Classes for individual items - could put rounded corners in or something. You\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\’ll want to change these colours for sure */[/code]

      :)

    9. markowe, on October 21st, 2009 at 5:11 am Said:

      Oh boy, will they ever end! :) Thanks Chuck - there are a couple of small quirks like that that need straightening out, though can’t imagine how that one got in there! I will get to it as soon as I summon the will to start spending time on EPN again, because right now my earnings are down the pan thanks to QCP and I am having trouble finding motivation to try to change that…

      Hopefully this bug won’t actually mess anything up, it will just GET messy.

    10. Mark, on November 16th, 2009 at 12:21 pm Said:

      thanks for your efforts Mark. Can you suggest how to get text to ride up on right side of image. float: left and article wrapping not doing it….thanks

    11. markowe, on February 9th, 2010 at 1:44 am Said:

      Mark, sorry, for some reason I missed your question! I guess you fixed it by now?! Float: left SHOULD do it, but maybe some other setting was breaking that behaviour…

    Leave a Reply

    « NEW VERSION 1.1: preservation of WordBay.css file EPN now includes Germany, Austria, Switzerland and Ireland - WordBay believed ready »