Help with solving theme conflict

Hi

I’m trying to solve a theme (eduma) conflict with a plugin(eform), but I’m a bit lost. I already ask for support to the theme author and plugin author, but the support channel its a bit slow and I need this to be solve as soon as possible, that’s why I’m here.

I found on eform this article and I think that following this can be the answer for the problem. I went to the function.php file mentioned in the article and I couldn’t find the exact same code, instead I found this lines that could be the lines that the article mentioned:

if ( !function_exists( 'thim_scripts' ) ) {
function thim_scripts() {

$thim_options = get_theme_mods();

if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) {
wp_enqueue_script( 'comment-reply' );
}

// New script update from resca,sailing
wp_enqueue_script( 'thim-main', THIM_URI . 'assets/js/main.min.js', array( 'jquery' ), THIM_THEME_VERSION, true );

if ( !isset( $thim_options['thim_smooth_scroll'] ) || $thim_options['thim_smooth_scroll'] !== false ) {
wp_enqueue_script( 'thim-smooth-scroll', THIM_URI . 'assets/js/smooth_scroll.min.js', array( 'jquery' ), THIM_THEME_VERSION, true );
}

if ( thim_is_new_learnpress( '2.0' ) ) {
wp_enqueue_script( 'thim-custom-script', THIM_URI . 'assets/js/custom-script-v2.js', array( 'jquery' ), THIM_THEME_VERSION, true );
//wp_enqueue_script( 'thim-custom-script', THIM_URI . 'assets/js/custom-script-v2.min.js', array( 'jquery' ), THIM_THEME_VERSION, true );
} else if ( thim_is_new_learnpress( '1.0' ) ) {
//wp_enqueue_script( 'thim-custom-script', THIM_URI . 'assets/js/custom-script-v1.js', array( 'jquery' ), THIM_THEME_VERSION, true );
wp_enqueue_script( 'thim-custom-script', THIM_URI . 'assets/js/custom-script-v1.min.js', array( 'jquery' ), THIM_THEME_VERSION, true );
} else {
wp_enqueue_script( 'thim-custom-script', THIM_URI . 'assets/js/custom-script.min.js', array( 'jquery' ), THIM_THEME_VERSION, true );
//wp_enqueue_script( 'thim-custom-script', THIM_URI . 'assets/js/custom-script.js', array( 'jquery' ), THIM_THEME_VERSION, true );
}

// Localize the script with new data
wp_localize_script( 'thim-custom-script', 'thim_js_translate', array(
'login' => esc_attr__( 'Username', 'eduma' ),
'password' => esc_attr__( 'Password', 'eduma' ),
'close' => esc_html__( 'Close', 'eduma' ),
) );

if ( get_post_type() == 'portfolio' && ( is_category() || is_archive() || is_singular( 'portfolio' ) ) ) {
wp_enqueue_script( 'thim-portfolio-appear', THIM_URI . 'assets/js/jquery.appear.js', array( 'jquery' ), THIM_THEME_VERSION, true );
wp_enqueue_script( 'thim-portfolio-widget', THIM_URI . 'assets/js/portfolio.js', array(
'jquery',
'thim-main'
), THIM_THEME_VERSION, true );
}

wp_dequeue_script( 'framework-bootstrap' );

wp_dequeue_script( 'thim-flexslider' );

//Dequeue tp chameleon
wp_dequeue_style( 'tp-chameleon' );
wp_deregister_style( 'siteorigin-panels-front' );
wp_dequeue_style( 'nfgc-main-style' );

// Remove some scripts LearnPress
//wp_dequeue_style( 'learn-press' );
wp_dequeue_style( 'lpr-print-rate-css' );
wp_dequeue_style( 'tipsy' );
wp_dequeue_style( 'certificate' );
wp_dequeue_style( 'fib' );
wp_dequeue_style( 'sorting-choice' );
wp_dequeue_style( 'course-wishlist-style' );
wp_dequeue_script( 'tipsy' );
wp_dequeue_script( 'lpr-print-rate-js' );
wp_dequeue_script( 'course-wishlist-script' );
wp_dequeue_script( 'course-review' );
wp_dequeue_style( 'course-review' );

if ( !is_single( 'lpr_course' ) && !is_single( 'lpr_quiz' ) ) {
wp_dequeue_script( 'sorting-choice' );
wp_deregister_script( 'block-ui' );
}

if ( is_front_page() ) {

wp_dequeue_script( 'webfont' );
wp_dequeue_script( 'fabric-js' );
wp_dequeue_script( 'certificate' );

wp_dequeue_script( 'thim-event-countdown-plugin-js' );
wp_dequeue_script( 'thim-event-countdown-js' );
wp_dequeue_script( 'tp-event-auth' );

if ( !is_user_logged_in() ) {
wp_dequeue_style( 'dashicons' );
}
}

//Plugin tp-event
wp_dequeue_style( 'thim-event' );
wp_dequeue_style( 'tp-event-auth' );
wp_dequeue_style( 'tp-event-site-css-events.css' );
wp_dequeue_script( 'thim-event-owl-carousel-js' );
wp_dequeue_script( 'tp-event-site-js-events.js' );
wp_dequeue_style( 'thim-event-countdown-css' );
wp_dequeue_style( 'thim-event-owl-carousel-css' );

wp_dequeue_style( 'mo_openid_admin_settings_style' );
wp_dequeue_style( 'mo_openid_admin_settings_phone_style' );
wp_dequeue_style( 'mo-wp-bootstrap-social' );
wp_dequeue_style( 'mo-wp-bootstrap-main' );
wp_dequeue_style( 'mo-wp-font-awesome' );

wp_dequeue_style( 'contact-form-7' );
wp_dequeue_style( 'mc4wp-form-basic' );

//Woocommerce
wp_dequeue_script( 'jquery-cookie' );

//Miniorange-login
wp_dequeue_script( 'js-cookie-script' );
wp_dequeue_script( 'mo-social-login-script' );

if ( !thim_use_bbpress() ) {
wp_dequeue_style( 'bbp-default' );
wp_dequeue_script( 'bbpress-editor' );
}

//LearnPress 2.0
wp_dequeue_style( 'learn-press-style' );
wp_dequeue_style( 'owl_carousel_css' );
wp_dequeue_style( 'learn-press-course-coming-soon' );

}
}
add_action( 'wp_enqueue_scripts', 'thim_scripts', 1000 );

On header.php file I haven’t found the lines or similar lines that the article said.

Are my suspicions right about that line of code? Which type of files should I look for if this is not right? Can you point me to the right direction? Do you need more info about this?

Many thanks in advance

  • Nastia
    • Support Rock Star

    Hello Cultiva Tus Ideas , I trust you are doing well!

    I am afraid I am not a PHP expert so I’ve flagged a second level support developers here to provide you a feedback.

    Please note the SLS developer’s response time might take longer than the usual staff, because they are dealing with complex tasks on a daily basis.

    Also please let us know what is the conflict and what errors you see while activating the plugin along with the theme?

    Have a nice day and take care!

    Kind regards,

    Nastia

  • Cultiva Tus Ideas
    • Site Builder, Child of Zeus

    Hi Nastia

    Thanks you for flagging this to sls developer's. The error I get while activating the plugin along with the theme are in the pictures attached to this reply.

    This is line 1132 (the entire line doesn't fit in a picture). This error might not be the source since, the site I'm trying this is a test site, so contacto@eunatest0.wpengine.com it's not the real mail.

    <script src="https://eunamed.agilecrm.com/stats/min/agile-min.js"></script><script>_agile.set_Cuenta de Alumno("sbtkb7ur37hjghuqc1j5ngd4e3","eunamed");_agile.track_page_view();_agile_execute_web_rules();_agile.set_email("contacto@eunatest0.wpengine.com");</script> <script type="text/javascript">

    Many thanks and let me know if you need more info.

    Have nice day.

    Diego

  • Sajid
    • DEV MAN’s Sidekick

    Hello Cultiva Tus Ideas,

    Hope you are doing good today :slight_smile:

    I noticed that, the issue is with de Alumno in below line of the code. If its a function or variable then there should not be spaces in it.

    _agile.set_Cuenta de Alumno("sbtkb7ur37hjghuqc1j5ngd4e3","eunamed");

    It should be like this:

    _agile.set_CuentadeAlumno("sbtkb7ur37hjghuqc1j5ngd4e3","eunamed");

    Or this instead:

    _agile.set_Cuenta_de_Alumno("sbtkb7ur37hjghuqc1j5ngd4e3","eunamed");

    I can’t find any instance of _agile.set_Cuenta de Alumno or just _agile.set_Cuenta in this file on what this method is dependent on:

    https://eunamed.agilecrm.com/stats/min/agile-min.js

    The code you posted above from functions.php file is not responsible for this one. Since those are to include the file but this one seems to printed in the page directly from somewhere else.

    Most theme authors use wp_print_footer_scripts or wp_print_scripts hook to print scripts on a page.

    So try to find based on above action hooks to further troubleshoot this issue.

    But also, its best if you hear from the developer of theme because he is the one who would know what function there should be and for what purpose.

    Take care and have a nice day :slight_smile:

    Best Regards,

    Sajid – WPMU DEV Support

  • Cultiva Tus Ideas
    • Site Builder, Child of Zeus

    Hi Sajid

    Thanks for your answer. I'm already in touch with the author. I deactivated agile plugin and the error still appearring. I'm adding the captures of the console, the problem seems to be with this lines:

    <script type='text/javascript'>
    jQuery(function() {
    moment.locale( 'es.min' );
    });
    </script>

    Can you figure something out of this? I'm going to find out about hooks that you mentioned on your answer.

    Thanks

  • Sajid
    • DEV MAN’s Sidekick

    Hello Cultiva Tus Ideas,

    Hope you are doing good today :slight_smile:

    The above error indicates that, moment.locale is not defined. That means, the library (.js file) this function is declared in is not included in this page at all or it is located after this code.

    That is called jQuery/JavaScript dependency. That means, if a function is called, it must be declared above that one.

    So, you have to find the file where this function is declared and first make sure this file is included in the page. If included, then move this code after that file or move that file above this code.

    Take care and have a nice day :slight_smile:

    Best Regards,

    Sajid – WPMU DEV Support

  • Cultiva Tus Ideas
    • Site Builder, Child of Zeus

    Great Sajid, very good help.

    We found the function is declared in bp-core-cssjs.php. (buddypress/bp-core/bp-core-cssjs.php)

    But:

    1. we do not know hoy to check if its being declared after its called or if its not being called at all.
    2. We do not know how to move or insert the file before the code that calls the function.

    Please keep helping us here :smiley:

    Thanks a lot!!!

  • Sajid
    • DEV MAN’s Sidekick

    Hello Cultiva Tus Ideas,

    Hope you are doing good today :slight_smile:

    I am glad I could help.

    You can try to move the files using Minification (reposition file to footer) feature of Hummingbird. This should work here.

    But if no then I would have to further take a closer look at its files. To do so, I would definitely need FTP and WordPress admin access to your site.

    You can send the requested details via our secure contact form in following format.

    Subject: “Attn: Sajid Javed”

    – WordPress admin username

    – WordPress admin password

    – login url

    – FTP credentials (host/username/password)

    – link back to this thread for reference

    Take care and have a nice day :slight_smile:

    Best Regards,

    Sajid – WPMU DEV Support

  • Cultiva Tus Ideas
    • Site Builder, Child of Zeus

    Ok Sajid, thanks again!

    Hummingbird Minifying feature did not work, it triggered a second error, as you can see in the screenshot.

    Wisely we did a backup before trying and then restored it, so if you get in to look, you will not found any hummingbird evidence.

    I just sent you the info requested, via contact form using subject “Attn: Sajid Javed”

    Thanks again Sajid!

    Cristian

  • Sajid
    • DEV MAN’s Sidekick

    Hello Cultiva Tus Ideas,

    Hope you are doing good today :slight_smile:

    Thanks for sending in the FTP and WordPress admin credentials directly. I could login with WordPress admin credentials but FTP did not work for me.

    I keep getting Error: Connection timed out after 20 seconds of inactivity in FileZilla.

    Could you please double check on your end and let me know if that work for you ?

    Also, could you please explain what conflict you have with plugin and theme ? So I know what exactly I should be checking.

    Take care and have a nice day :slight_smile:

    Best Regards,

    Sajid – WPMU DEV Support

  • Sajid
    • DEV MAN’s Sidekick

    Hello Cultiva Tus Ideas,

    Hope you are doing good today :slight_smile:

    Thanks for updated information. I used that port and it worked fine this time but I could not find the reason of why exactly its happening. I could not find the traces of the code you posted above as a conflicting script too.

    From this point the further debugging and then fixing this issue will require a good amount of time. That is, unfortunately, beyond the level of support we can provide here. Sorry!

    Since these are third party products and we have tried what we could so far. So for further assistance, please contact plugin or theme author support.

    Best Regards,

    Sajid – WPMU DEV Support

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.