WordPress.org

Forums

Basic Comment Quicktags
[resolved] plugin doesn't work with P2 (12 posts)

  1. careb
    Member
    Posted 1 year ago #

    the plugin doesn't hook into wp_head(); under P2

    when editing the header.php file to put in the script and css links manually, the plugin still doesn't work unless i kill the css behind P2. then the buttons show and work fine.

    there's probably too much going on in P2 to make it work as plugin.

    i looked into adding your code to the theme directly ... but there's a lot going on in those files, i'd prefer a plugin.

    https://wordpress.org/plugins/basic-comment-quicktags/

  2. It used to work on P2... I'm not surprised it doesn't, since the tweaks there to add in their own comment quicktags probably butt heads.

    I'll see if I can force it back round :/

  3. Okay it works on comments on individual pages (which I think I did on purpose so as not to slaughter the speed of a site). You want it to show up on the front page for comments only?

  4. careb
    Member
    Posted 1 year ago #

    is that possible?

    I'm not surprised it doesn't, since the tweaks there to add in their own comment quicktags probably butt heads.

    maybe i should go nag Automatic about how to turn on their quicktags.

  5. It MAY be possible. I recall having issues with CPU usage last time.

    FWIW, Automatic's headed towards http://geto2.com/ instead which does have quicktags working and built in, so this just may not be possible right now :(

  6. careb
    Member
    Posted 10 months ago #

    update:

    i've been able to get it to work with P2 by changing:

    if ( is_singular() && comments_open() && ( $options['comments'] != '0') && !is_null($options['comments']) ) {
                    $this->add_scripts();
                }

    to

    if ( comments_open() && ( $options['comments'] != '0') && !is_null($options['comments']) ) {
                    $this->add_scripts();
                }

    lines 88 and 102 need the same edit to load the script and the css.

    another minor issue i encountered was with Akismet. on my multisite install, if Akismet is deactivated, the plugin will not work even if it's activated (locally or network wide) on the main site. the plugin will continue to work on any other blog it is enabled on, but not the main site.

    something, i don't know what, prevents the plugin from loading. if Akismet is activated, locally or network wide, the plugin loads and works fine with the quicktags bar showing for comments AND the frontend post field (which was a nice, unexpected bonus).

    the differences in code are - with Akismet on:

    </p>
    <p style="display: none;">
    <input type="hidden" id="akismet_comment_nonce" name="akismet_comment_nonce" value="63d5c0c54b" />
    </p>
    <input type="hidden" id="_wp_unfiltered_html_comment_disabled" name="_wp_unfiltered_html_comment_disabled" value="bb28b63bd0" />
    <script>
    (function(){if(window===window.parent){document.getElementById('_wp_unfiltered_html_comment_disabled').name='_wp_unfiltered_html_comment';}})();
    </script>
    <p style="display: none;">
    <input type="hidden" id="ak_js" name="ak_js" value="15"/>
    </p>
    </form>

    with Akismet off:

    </p>
    <input type="hidden" id="_wp_unfiltered_html_comment_disabled" name="_wp_unfiltered_html_comment_disabled" value="bb28b63bd0" />
    <script>
    (function(){if(window===window.parent){document.getElementById('_wp_unfiltered_html_comment_disabled').name='_wp_unfiltered_html_comment';}})();
    </script>
    </form>
  7. Is Akismet only a problem on the p2 blog? That's really odd...

    I'll see about folding in the checks for p2 though.

  8. Aha. The is_singular check is why.

    Damn... Okay, so that's in part because I didn't WANT to load it on pages that didn't need it, so as to limit how much JS we're loading per page. While it is pretty lightweight, calling JS like that on every page load is not a great idea.

    If I do a check-only for P2s, then I'll have the same problem with o2 (which admittedly doesn't need this plugin at all) or any theme that uses an in-page comment system like this.

    I'm going to have to read up on how P2 puts in the comment/reply on each page and see if I can check for THAT existence instead of just grabbing the singular page.

  9. careb
    Member
    Posted 10 months ago #

    dang. i fingered Akismet too soon.

    today i got the plugin to not load on the main site regardless of whether Akismet was activated or not.

    i can't get it to work again. something ... probably in P2 is preventing it from loading. it works if i switch to twentyfourteen.

    it still works on all the subsites it's enabled on with P2 though. (i've got a subfolders, not a subdomains install.)

    this server is for a very small user group that will mostly want access from the intranet. i don't have to worry about resources that much.

  10. it still works on all the subsites it's enabled on with P2 though. (i've got a subfolders, not a subdomains install.)

    So ... just not the MAIN site? o.O What's different about that one? Any weird plugins?

    FWIW, two places to change:

    https://plugins.trac.wordpress.org/browser/basic-comment-quicktags/trunk/quicktags.php#L85

    https://plugins.trac.wordpress.org/browser/basic-comment-quicktags/trunk/quicktags.php#L96

    Both of those need is_singular() && comments_open() changed to JUST comments_open()

    You may even want to change the lines to this:

    if ( ($options['comments'] != '0') && !is_null($options['comments']) ) {
  11. careb
    Member
    Posted 10 months ago #

    the main has site wide tags driving content from all the sub sites into it. when these posts arrive, they have the comments disabled (closed) which is disabling the plugin.

    i changed this:

    if ( comments_open() )

    to this:

    if ( comments_open() || is_main_site() )

    which seems to be working.

  12. they have the comments disabled (closed) which is disabling the plugin.

    Hah, Damn you P2!

    FWIW, O2 (the replacement for P2) doesn't need this plugin. Comes with it built in.

    Try doing is_front_page() instead of main site.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Basic Comment Quicktags
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic