26 Responses

  1. Ryan
    Ryan Published |

    Great idea. As I rebuild my site site from the ground up I’ve thought more and more about performance issues regarding http requests. My idea was to use regex to look for a specific string in the results instead of the wp conditionals.

    For example, parse the output for rel=”lightbox” to see whether or not the js is needed. This would pretty much guarantee that you’re only loading what you need.

    I’m not much of a programmer so I’m not sure what is accessible before the loop fires for this sort of parsing.

    1. snatur
      snatur Published |

      “I’m not much of a programmer so I’m not sure what is accessible before the loop fires for this sort of parsing.” I think content above is clear .

  2. Wordpress UK » JavaScript Logic: WordPress Plugin
  3. WordPress Plugin Releases for 12/14 | Weblog Tools Collection
  4. Quasi.dot
    Quasi.dot at |
  5. WeblogToolsCollection Español » Archivo del Blog » Novedades Plugins de WordPress 14/12
  6. Circle Up
    Circle Up Published |

    Hey! Thanks for this brilliant idea! I have been looking for a way to do this for months!

    However, I could not get it to work at all. Tried inserting link to js from assorted plugins, then tried conditional tags: is_page(pageID), is_page(array(pageID, pageID)), comment_open() and a few others… none worked.

    Man… if you could get this working…genius!

    My only suggestion — other than making it work 😉 — is that it would seem much easier and useful in certain cases to be able to exclude the js, rather than include it. For instance: If we have a script that gets called on every page except for one. Know what I mean?


  7. Circle Up
    Circle Up Published |

    “Conditional tags are based on a condition (true or false), so you can exclude/include in any way you want.”
    Ok. I understand that. But your instructions are not altogether clear — because you say not to use <?php tags, but don’t mention anything about ‘if’, ‘else’, etc… and when I tried adding a full conditional statement, with ‘if’s’ and such (but without <?php tags) I got an error. Also, when inserting a link to the .js, should it be a full path, including http:// ?

    Perhaps you could clarify, by example, how I would include a script such as cforms.js only on pages with open commenting comment_open() — OR how would you exclude that same script from only index.php?


  8. WordPress Plugin Releases for 12/14 | BlogBroker24-7
  9. Circle Up
    Circle Up Published |

    So, if I understand correctly, you are asking me (and others) to pay $25 to ask you a question (on a forum that currently has not a single question/topic (that I could find) on even relating to this plugin), about a 5 day old plugin that came with minimal instructions, which you yourself state on this page “is an early beta release, so it’s not fully developed. There’s the likelihood of a bug here or there”?

    I certainly appreciate your hard work on this plugin, and as I stated in my 1st comment, it is greatly desired/needed. And I absolutley understand your need to earn a living for the time and hard work you put in. But I think what you are asking for is out of line for a 5 day old, ‘not fully developed beta release’.

    Very disapointed.

    Good luck with this.

  10. WordPress News: WordPress 2.7 Awesome, WordPress.com 5 Million, Plugins Updated, and WordCamp News » T Jantunen.com
  11. shockwheat
    shockwheat Published |

    Finally! I’ve been waiting to find something regarding superfluous script loading from WP plugins. It’s a shame to see so much waste with plugin scripts. With 100 pages but only 2 that require a lightbox or post tabs…very cool. This is possibly one of the most important plugin concepts I’ve seen all year.

  12. links for 2009-01-02 « On New Media
    links for 2009-01-02 « On New Media at |
  13. Jason
    Jason Published |

    Even though im not that much into coding and programming, but i do design wordpress themes, which gets coded by one of my friends and we quite a lot use JS resources, This plugin would be really great for us. Thanks mate.

  14. Ray
    Ray Published |

    Hi Justin,

    First of all, just want to say that I appreciate all the plugins and themes that you’ve done.

    Now onto a feature request, I think that JavaScript Logic could benefit from detecting a theme’s javascript folder.

    Kind of a how you have the select menu for internal Wordpress scripts and plugin scripts, a similar select menu can be done for the proposed theme javascript folder.

    The theme’s javascript folder could be defined as an input text field that the user defines somewhere in JL’s options.

    What do you think?


  15. Ray
    Ray Published |

    Also, have you thought of creating a sister plugin for stylesheets called “CSS Logic”? 😉

  16. My plugins are now hosted on the WordPress plugins repository
  17. Richard
    Richard Published |

    I was also unable to get this plugin to work on 2.7.1 Either using the plugin options page or the page specific fields. All js loaded on every page, even with simple test is_home() and full js uri in the script field. I’m wandering if this could be a theme specific problem? If you get a moment to pass by the wordpress forums you’ll see my post there about this. I can’t believe that Ive inputed the details wrong It’s so simple and $25 is a lot to find out my theme functions are just not compatible … The concept is desperately overdue however and I applaud your efforts to optimize wordpress. The headspace plugin tries to do something similar, but also fails if plugins don’t follow a certain design. The whole WP plugin archtecture needs an overhaul to standardise the way scripts are called and prevent so much dead weight being carried around.

  18. All my bookmarks ever | Daniel John Gayle
  19. Nobu
    Nobu Published |

    I add this plugin and I place javascript url ( in Javascript logic setting box on Write Post/Page page. But it’s doesn’t seem working. I see the source of page and javascript was not linked. Do I need to do something eles? Doyou have a tutorial for beginner?

  20. oikeus elämään
    oikeus elämään Published |

    Really good! I add the plugin and it is working perfectly.


  21. icute
    icute Published |

    I have tried your plugin and i must admit this is what im looking for all this while. It saved me hours just to figure out how to add JavaScript in however i want.
    I used this plugins together with custom fields for css, the “tag” way is awesome!.

    Thanks again :*

Comments are closed.