Roseta and Codex Incompatible with wpForo

  • Author
    Posts
  • #114522

    When the Roseta/Codex theme is applied to a WordPress site that is using the wpForo forum plugin, most of the post moderation tools (such as like, approve, delete, etc.) are unusable, even as an admin. When the Roseta/Codex theme is deactivated, the wpForo plugin works again.

    In the developer console, when loading the wpForo forum page with Roseta/Codex active, I get an error in a wpForo js file, namely an Uncaught ReferenceError that $wpf is not defined in /wp-content/plugins/wpforo/wpf-assets/ajax.js, ver=1.9.4 at line 3.

    The code in question is

    $wpf.ajaxSetup({
        url: wpforo.ajax_url,
        data:{
            referer: window.location.origin + window.location.pathname
        }
    });

    ajaxSetup refers to a function in /wp-includes/js/jquery/jquery.js and /wp-includes/js/jquery/jquery.min.js

    This error arises in a clean install of WordPress 5.6.2 with only Roseta/Codex, 2019, 2020 and 2021 themes and only wpForo, Hello Dolly and Akismet plugins installed, with only wpForo activated.

    WordPress is running on a Linux/SUSE server with:
    Apache 2.4.43
    PHP 7.4.6
    MySQL 5.5.5

    Let me know if there is any more information that is needed. Suggestions welcome.

    Thanks

    Website: hazelden.ca/wordpress/index.php/community

    #114533

    Problem solved.

    The wpForo team pointed me to topics that discussed the <script> defer attribute. Examining my site’s page source revealed the presence of the defer attribute on wpForo scripts. Turning off the JS Defer option in the Miscellaneous section of the theme solved the problem.

    #114716
    Zed
    Cryout Creations Team

    Hi,

    Deferring some scripts can speed up loading and improve score with site scrapers, but can cause issues with more complex scripts where execution order matters.
    This is why we’re including the control option in the theme – which I’m glad you found and used to resolve the issue on the site.


    If you like our creations, help us share by rating them on WordPress.org.
    Please read the available documentation and search the forums before posting.
    #114718

    @Zed, thanks for the reply.

    If deferring javascript has the benefits you suggest, then a good feature request might be to implement a whitelist system where you could choose to not defer some problematic scripts when the JS Defer option is ON.

    #114753
    Zed
    Cryout Creations Team

    If deferring needs to be handled on a per-script basis, there are plugins that provide that level of control.


    If you like our creations, help us share by rating them on WordPress.org.
    Please read the available documentation and search the forums before posting.
Viewing 5 posts - 1 through 5 (of 5 total)

You need to log in to reply to this topic.