Skip Navigation

This is the technical support forum for WPML - the multilingual WordPress plugin.

Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- - 9:00 – 18:00 9:00 – 18:00 9:00 – 18:00 9:00 – 18:00 9:00 – 18:00
- - - - - - -

Supporter timezone: America/Lima (GMT-05:00)

Tagged: , ,

This topic contains 32 replies, has 2 voices.

Last updated by Andreas W. 1 month ago.

Assisted by: Andreas W..

Author Posts
October 17, 2024 at 3:50 pm
October 17, 2024 at 8:12 pm #16301949

Andreas W.
Supporter

Languages: English (English ) German (Deutsch )

Timezone: America/Lima (GMT-05:00)

I have an important question:

How is the "Mmi Families" Post Type getting created or where can I find the code that is responsible for the registration of this post type?

October 18, 2024 at 9:58 am #16303704

sandraF-13

Hi Andreas,

Do you have to check this down deep ?

I mean this particularly seems a global malfunction of WPML to me, earlier it was not translating any of the custom posts in bulk when selected more than 3-4 in number, but in last two days when I tried even converting a single post it showed 504 and the worst this time credits also get utilized. Code files from the site are clean and well optimized there should not be any issues, I can tell.

However, These are the .php files you can check in for mmi-families custom post type:
- mmi-post-type (where the post type is registered)(
- single-mmi-family
- functions.php (line no. : 170)

I hope that helps.
Attached an image for your ref.

Thanks

post-type-mmi.png
October 18, 2024 at 4:16 pm #16305688

Andreas W.
Supporter

Languages: English (English ) German (Deutsch )

Timezone: America/Lima (GMT-05:00)

I am really not sure, what is causing this issue and I can not simply add credits for testing as also we get charged for the usage byt Google, Microsoft or DeepL.

Do you agree if we try to migrate the site to our test server on Cloudways?

I could then connect this clone with a test engine to test the automattic translation.

October 21, 2024 at 10:31 am #16311636

sandraF-13

Hi Andreas,

I am sure any functionality or written code should not be a blocker for WPML plugin or is reason for its malfunctioning, also, I don't have any Issues going forward with the test you wanna conduct on cloud platform, unless It's production you wanna go forward with. Am comfortable with stage test.

Moreover, In any case, even If there comes certain requirement to conduct tests on production, I would ask you to be highly careful with it. In any circumstance, If I find anything malfunctioning or not working, I would assume it could be a fault from your side.

I already have detected one tiny issue, since I have implemented WPML translations : i.e. " /? " appearing at the end of every URL, please look into that as well, It will be highly appreciable.

Thanks

October 21, 2024 at 8:23 pm #16314375

Andreas W.
Supporter

Languages: English (English ) German (Deutsch )

Timezone: America/Lima (GMT-05:00)

On the migrated test site I still can see this notice and replicate the 504 error:

PHP Notice: Function wp_enqueue_script was called incorrectly. in /mnt/BLOCKSTORAGE/home/278662.cloudwaysapps.com/fpsqztefnn/public_html/wp-includes/functions.php on line 6085

Calling the scripts inside your Child Theme this way solves the issue:

<?php
function theme_enqueue_assets() {
    // Enqueue jQuery
    wp_enqueue_script('jquery');
    
    // Enqueue Styles
    wp_enqueue_style('child-style', get_stylesheet_directory_uri() . 'https://cdn.wpml.org/style.css', [], null);
    wp_enqueue_style('main-style', get_stylesheet_directory_uri() . 'https://cdn.wpml.org/inc/css/main.css', [], null);
    wp_enqueue_style('i4lmain-style', get_stylesheet_directory_uri() . 'https://cdn.wpml.org/inc/css/i4lmain.min.css', [], null);
    wp_enqueue_style('flexslider-css', '<em><u>hidden link</u></em>', [], null);
    wp_enqueue_style('lightbox-css', '<em><u>hidden link</u></em>', [], null);
    
    // Enqueue Scripts
    wp_enqueue_script('owl-carousel-script', get_stylesheet_directory_uri() . 'https://cdn.wpml.org/inc/js/owl.carousel.js', ['jquery'], null, true);
    wp_enqueue_script('mmi-script', get_stylesheet_directory_uri() . 'https://cdn.wpml.org/js/mmi.js', ['jquery'], null, true);
    wp_enqueue_script('search-filter-script', get_stylesheet_directory_uri() . 'https://cdn.wpml.org/js/search-filter-script.js', ['jquery'], null, true);
    wp_localize_script('search-filter-script', 'admin_ajax', array('ajax_url' => admin_url('admin-ajax.php')));
    wp_enqueue_script('flexslider-js', '<em><u>hidden link</u></em>', ['jquery'], null, true);
    wp_enqueue_script('lightbox-js', '<em><u>hidden link</u></em>', ['jquery'], null, true);

    // Conditional Enqueue for Bootstrap and Font Awesome
    if (is_singular('mmi-family') || is_search()) {
        wp_enqueue_style('bootstrapcss', '<em><u>hidden link</u></em>', [], null);
        wp_enqueue_style('font-awesome', '<em><u>hidden link</u></em>', [], null);
        wp_enqueue_script('bootstrap-js', '<em><u>hidden link</u></em>', ['jquery'], null, true);
    }
}
add_action('wp_enqueue_scripts', 'theme_enqueue_assets', 20);

At this moment automatic translations begin running, until the next error occurs:

PHP Warning:  session_start(): Session cannot be started after headers have already been sent in /mnt/BLOCKSTORAGE/home/278662.cloudwaysapps.com/fpsqztefnn/public_html/wp-content/plugins/filter-custom-fields-taxonomies-light/profi-search-filter.php on line 17

The plugin is doing there this:

if( !session_id() )
		session_start();

This should look usually like this:

// Start session correctly
function sf_start_session() {
    if (!session_id()) {
        session_start();
    }
}
add_action('init', 'sf_start_session', 1);

This file is part of the plugin "Filter Custom Fields & Taxonomies Light" and the PHP Warning should be reported the the plugin author. If I disable the plugin and continued testing the site seems to work as usual and I am not getting any further errors.

The issue I am facing, is that this site runs on a small test server with various sites and according to our admin there is a currently an issue with extended CPU use, which already occured before I migrated your site.

I would like to ask you to follow my advises and let me know in case this will not solve the issue.

The topic ‘[Closed] Language Translation’ is closed to new replies.