Please make sure to update to WPML 4.3.4 before reporting any issue

Hi, Amit here, I am the WPML Support Manager, our current ticket queue is high, update your WPML plugins and make sure you meet the minimal requirements for running WPML before reporting an issue please - many tickets are resolved doing that

Please look at our updated list of Known Issues and you can also use our support search to find helpful information and of course review our documentation before opening a ticket.

If you do need to open a ticket please make sure to provide us with all the needed information as described in this page

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.

Tagged: 

This topic contains 6 replies, has 2 voices.

Last updated by Bruno Kos 1 month ago.

Assigned support staff: Bruno Kos.

Author Posts
October 10, 2019 at 4:28 pm #4732885

maximeC-9

I am trying to: Access page of custom post (Product) on this website : hidden link.

Link to a page where the issue can be seen: hidden link

I expected to see: Product page

Instead, I got: Sometimes, Page Not Found, and sometimes, the page loads correctly. Problem is not constant.

I have modify the wp-config.php with the following configuration, but it didn't solve the problem :

define('WP_MEMORY_LIMIT', '256M');
define( 'WP_MAX_MEMORY_LIMIT', '256M' );

October 11, 2019 at 9:18 am #4736669

Bruno Kos
Supporter

Languages: English (English )

Timezone: Europe/Zagreb (GMT+01:00)

Hi,

Thank you for contacting WPML support!

Can you update WPML and its addons? Also, I can see that you are using Advanced Custom Fields PRO. Can you also install this plugin?

https://wpml.org/download/acfml/?section=changelog

Apart from that - when the URL becomes unavailable, turning into 404, does it help if you try to deactivate all the plugins apart from WPML and its addons any plugin which is responsible for this post type?

Also, when you see 404, can you also do this:

1. Edit wp-config.php and insert the following lines:

define( 'WP_DEBUG', true );
define( 'WP_DEBUG_LOG', true );
define( 'WP_DEBUG_DISPLAY', false );

2. Reproduce the issue - refresh the url few times.

3. Locate the debug log in: /wp-content/debug.log

4. Paste the latest lines here. No need to paste the entire log file, just 10 lines or so will do. Please censor any sensitive information.

https://codex.wordpress.org/Debugging_in_WordPress

Regards,
Bruno Kos

October 11, 2019 at 6:37 pm #4740789

maximeC-9

Hi!

Here's what I did:

1- Updated all plugins
2- Installed the plugin you suggested
3- I edited the w-config.php file. Here's the last lines of the debug.log file:

[11-Oct-2019 18:22:46 UTC] PHP Notice: Trying to get property 'ID' of non-object in /home/attitude/public_html/wp-content/plugins/alpacode_customization/alpacode_customization.php on line 694
[11-Oct-2019 18:23:46 UTC] PHP Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; wpaft_admin has a deprecated constructor in /home/attitude/public_html/wp-content/plugins/wp-custom-taxonomy-meta/includes/options.php on line 3
[11-Oct-2019 18:24:31 UTC] PHP Notice: Undefined index: field_5d56ea3de370a in /home/attitude/public_html/wp-content/themes/Avada-Child-Theme/functions.php on line 619
[11-Oct-2019 18:24:31 UTC] PHP Notice: Undefined index: field_5d56ea3de370a in /home/attitude/public_html/wp-content/themes/Avada-Child-Theme/functions.php on line 619
[11-Oct-2019 18:24:31 UTC] PHP Notice: Undefined index: field_5d56ea3de370a in /home/attitude/public_html/wp-content/themes/Avada-Child-Theme/functions.php on line 619
[11-Oct-2019 18:25:46 UTC] PHP Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; wpaft_admin has a deprecated constructor in /home/attitude/public_html/wp-content/plugins/wp-custom-taxonomy-meta/includes/options.php on line 3
[11-Oct-2019 18:27:46 UTC] PHP Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; wpaft_admin has a deprecated constructor in /home/attitude/public_html/wp-content/plugins/wp-custom-taxonomy-meta/includes/options.php on line 3
[11-Oct-2019 18:28:34 UTC] PHP Notice: Undefined variable: paged in /home/attitude/public_html/wp-content/plugins/alpacode_customization/alpacode_customization.php on line 211

As you can see, it's only notices. I doubt that can raise a 404. However, those shouldn't be there, so I'll work to correct them. But it doesn't solve the 404s. What is the next step?

Thanks for your help!

October 14, 2019 at 6:03 am #4747263

Bruno Kos
Supporter

Languages: English (English )

Timezone: Europe/Zagreb (GMT+01:00)

Hi,

Can I ask you the following then? In order to debug this issue , I will install Duplicator plugin, will create packages and will try this on my localhost and possibly escalate further to 2nd tier.

https://wpml.org/faq/provide-supporters-copy-site/

Let me know if this is OK with you.

If yes, I will need WordPress admin username and password so I could do this. I have marked your next reply private so you can safely add this information.

https://wpml.org/purchase/support-policy/privacy-and-security-when-providing-debug-information-for-support/

Please make a full backup of your site before sharing this info!

Regards,
Bruno Kos

October 17, 2019 at 10:16 am #4772357

Bruno Kos
Supporter

Languages: English (English )

Timezone: Europe/Zagreb (GMT+01:00)

Hi,

Can you tell me if you tried talking to your hosting maybe if they are picking up anything in their server logs? The trouble with finding a solution is just as you mentioned initially - it doesn't happen always and debug log did not provide any clues to us.

See here - it is working properly now. After few minutes (or even after few seconds), it will not work but then after one or two refreshes, it will work again. So even if I try some troubleshooting functions, the trouble is that we will not know whether the thing started working again for no apparent reason or because we used troubleshooting functions (or for example, disabling all the other plug-ins, leaving only WPML active)...

So somehow we are helpless here at the moment. Maybe you can check .htaccess file if it exists, if there are some overwrites there, then if there some sort of a caching mechanism behind it which you can then disable and then check how the site behaves over the course of time, etc.

But I would start with reaching out to hosting support first and checking your they have some information that could potentially help us.

Regards,
Bruno Kos

October 18, 2019 at 5:45 am #4778681

maximeC-9

Hello!

Here's the .htaccess file content currently on the server.


# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . index.php [L]
</IfModule>

# END WordPress
# BEGIN ShortPixelWebp

# END ShortPixelWebp

# Wordfence WAF
<Files ".user.ini">
<IfModule mod_authz_core.c>
	Require all denied
</IfModule>
<IfModule !mod_authz_core.c>
	Order deny,allow
	Deny from all
</IfModule>
</Files>

# END Wordfence WAF

# BEGIN cPanel-generated php ini directives, do not edit
# Manual editing of this file may result in unexpected behavior.
# To make changes to this file, use the cPanel MultiPHP INI Editor (Home >> Software >> MultiPHP INI Editor)
# For more information, read our documentation (<em><u>hidden link</u></em>)
<IfModule php7_module>
   php_flag display_errors Off
   php_value max_execution_time 3000
   php_value max_input_time -1
   php_value max_input_vars 1000
   php_value memory_limit 1024M
   php_value post_max_size 2048M
   php_value session.gc_maxlifetime 1440
   php_value session.save_path "/var/cpanel/php/sessions/ea-php72"
   php_value upload_max_filesize 2048M
   php_flag zlib.output_compression Off
</IfModule>
<IfModule lsapi_module>
   php_flag display_errors Off
   php_value max_execution_time 3000
   php_value max_input_time -1
   php_value max_input_vars 1000
   php_value memory_limit 1024M
   php_value post_max_size 2048M
   php_value session.gc_maxlifetime 1440
   php_value session.save_path "/var/cpanel/php/sessions/ea-php72"
   php_value upload_max_filesize 2048M
   php_flag zlib.output_compression Off
</IfModule>
# END cPanel-generated php ini directives, do not edit

# php -- BEGIN cPanel-generated handler, do not edit
# Set the "ea-php72" package as the default "PHP" programming language.
<IfModule mime_module>
  AddHandler application/x-httpd-ea-php72 .php .php7 .phtml
</IfModule>
# php -- END cPanel-generated handler, do not edit

I'll contact the hosting provider to see if they can provide us and you with more details.

Best,

October 18, 2019 at 7:54 am #4779185

Bruno Kos
Supporter

Languages: English (English )

Timezone: Europe/Zagreb (GMT+01:00)

Hi,

I talked to 2nd tier support about this - it seems like that the issue could be coming from this:

//Change Permalink produc to product

function update_produc_slug( $args, $post_type ) {

    if ( 'produc' === $post_type ) {
        
        if (ICL_LANGUAGE_CODE == "fr") {
            $my_args = array(
            'rewrite' => array( 'slug' => 'salades-et-legumes-prepares', 'with_front' => false )
            );    
        }else {
            $my_args = array(
            'rewrite' => array( 'slug' => 'fresh-salad-and-produce', 'with_front' => false )
            );
        }

        //$args['rewrite']['slug'] = 'presidentes';
                    
        return array_merge( $args, $my_args );
    }

This is how you removed the slug of this custom post type, so that's where the issue may be coming from.

Perhaps you should experiment with these and try various combinations until you get it working properly:

https://wordpress.stackexchange.com/a/189196

Also see this:
https://wordpress.stackexchange.com/a/144356

Or perhaps finding a plugins for this:
https://wordpress.org/support/topic/how-to-remove-cpt-slug-from-url/
https://wordpress.org/plugins/remove-cpt-base/

I'm afraid to this will require some thorough testing and tweaking on your end, there isn't a simple solution for this.

Regards,
Bruno Kos