• Resolved generosus

    (@generosus)


    Your plugin works great as noted here. Unfortunately, upon installing your plugin, the following happens:

    1. WordPress’ Site Health Status check reveals the following message: PHP default timezone is invalid
    2. WordPress Translation Updates cannot be installed. That is, every time we click “Update Translations“, nothing happens. The updates cannot be installed (indefinite loop).

    Can you kindly look into this for a possible fix?

    Thank you!

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author drmikegreen

    (@drmikegreen)

    I’ll look into this. The problem may not, however, be able to be resolved. See the note just after the license on the plugin’s home page. (Sorry, that note is not separated from the license. I’ll try to correct that soon.)

    Thread Starter generosus

    (@generosus)

    Hey @drmikegreen,

    That would be great. Our temporary solution below does not address the root causes. It’s a simple band-aid.

    Any help to solve the above would be appreciated. The rest of your plugin works great.

    For starters, making sure your plugin is compatible with WP 6.3.1 and PHP 8.2.11 would be nice.

    Thank you!

    _________________________

    Temporary Solution:

    1. Disable WordPress’ Health Check for ‘PHP Default Timezone” using the following code snippet:

    function disable_php_default_timezone_check( $tests ) {
    unset( $tests['async']['php_default_timezone'] );
    return $tests;
    }
    add_filter( 'site_status_tests', 'disable_php_default_timezone_check', 10000 );

    2. Disable Automatic Translation Updates using the following code snippet:

    if( function_exists('add_filter') ){
    add_filter( 'auto_update_translation', '__return_false' );
    }

    Plugin Author drmikegreen

    (@drmikegreen)

    I think I have effected a fix for Translation updates.

    I have placed the resulting Version 1.1.5-beta-1 at https://u.pcloud.link/publink/show?code=XZRX9iVZBr2yX4oLQ8S314zhpVGeT57i52Ny for you to download and test.

    I doubt that will address your other issue. But please check both and let me know, so that I can proceed.

    Thread Starter generosus

    (@generosus)

    Hey @drmikegreen,

    Thanks for that! Unfortunately, your plugin (beta version) did not help. However, there are some good news about this.

    PHP Default Timezone is Invalid:

    We disabled WP’s “PHP Default Timezone” health check using the updated code snippet provided below. We disabled the health check with confidence since no obvious issues have been detected as a result of using your plugin.

    function disable_php_default_timezone_check( $tests ) { unset( $tests['direct']['php_default_timezone'] ); // For this function to work, use 'direct' return $tests; } add_filter( 'site_status_tests', 'disable_php_default_timezone_check', 10000 );

    Translation Updates Issue:

    We performed additional tests and can confirm (so far) this issue lies with the plugin, MailPoet. In short, there’s a plugin conflict. Also, the code snippet provided above to disable translation updates did not work for us after all (the issue resurfaced).

    Action Summary:

    Based on the above, if you can think of anything else to solve this issue, please advise. Perhaps you can install MailPoet into your test site to learn more about the conflict and come up with a possible solution (e.g., a code snippet to deactivate MailPoet’s language translation function).

    Cheers 🙂

    Plugin Author drmikegreen

    (@drmikegreen)

    I am hoping you will be able to figure out what the conflict is with MailPoet. I am going to have to “cut bait” on this because of time limitations.

    I will, however, remove the “beta” status of the plugin and commit Version 1.1.5 to the WordPress repository.

    (Also, I’d be glad to pass ownership of this plugin to someone else. I am well into my retirement years and health issues allow me very limited amounts of time to work on plugins, even though I enjoy doing so. And I have another plugin which is at a critical development stage and which, therefore demands what little time I have.)

    Thread Starter generosus

    (@generosus)

    Hey @drmikegreen,

    Thank you so much. Good news. In addition to your plugin update, V1.1.5, we solved the rest of our issues as follows:

    PHP Default Timezone is Invalid:

    We applied the code snippet provided above. Our website’s time/timezone functions are working with no identifiable issues.

    Translation Updates Issue:

    The translation update issue caused by MailPoet was solved with the following code snippet:

    add_filter( 'pre_http_request', function ( $result, $args, $url ) {
    
    if ( wp_parse_url( $url, PHP_URL_HOST ) === 'translate.wordpress.com/api/translations-updates/mailpoet/' ) {
        return new WP_Error( 'http_request_not_executed', __( 'User has blocked requests through HTTP.' ) );
    }
    
    return $result;
    
    }, 10, 3 );
    
    add_filter( 'pre_http_request', function ( $bFalse, $args, $sUrl ) {
    			
    if ( strpos( $sUrl, '//translate.wordpress.com/api/translations-updates/mailpoet/' ) ) {
    		return new WP_Error( 'http_request_not_executed', __( 'User has blocked requests through HTTP.') ); 
        }
    	
    return $bFalse;
    	
    }, 10, 3 );

    Hoping the above will help those reading this topic.

    One Final Suggestion:

    To fine-tune things further, we modified your plugin’s name and desciption in the backend to reflect better what it does — in a simpler format.

    Name: Use Visitor’s Time Zone

    Description: This plugin detects and displays the site visitor’s local time and time zone on the site’s front end. Flawlessly.

    Personal Note:

    Mission accomplished. You’re a genius. Your plugin is the ONLY plugin in WordPress’ repository capable of detecting and displaying a site visitor’s local time and timezone via JavaScript.

    Enjoy your retirement. Salud!

    Plugin Author drmikegreen

    (@drmikegreen)

    Many, many thanks!

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘Plugin Triggers Two Issues | Site Health and Translation Updates’ is closed to new replies.