Forum Replies Created

Viewing 6 replies - 1 through 6 (of 6 total)
  • Hi Tijmen, great plugin.. looking forward to this update too =)

    Sure will. Thanks =)

    Hi Matt, Our temporary ip solution stopped working and I was able to test your code. Unfortunately it didn’t stop the issue as it was the API fetch causing the admin to time out and come to a crawling speed.

    I made a modification to /better-font-awesome-library/lib/better-font-awesome-library.php line 442 and it stopped the error by using the bfa_force_fallback filter. The admin is fast again. Thanks for pointing me in the right direction.

    private function setup_api_data() {
    	$force_fallback = apply_filters( 'bfa_force_fallback', false );
    	// Log the CSS fetch error.
    	if ( ! $force_fallback ) {
    		$this->api_data = $this->fetch_api_data( self::JSDELIVR_API_URL );
    	}
    }

    I leave this code with you and hopefully you can modify the plugin or make my modification better.

    Regards

    Thanks a lot Matt, I appreciate you taking time from your busy day, our server person temporarily whitelisted the IP and I am not able to test your new code on that server. However will try the new code and see what it does on my local install.
    I think the issue is more with stopping the API fetch. As the add_filter( 'bfa_force_fallback', '__return_true' ); already stops the latest CSS from loading.

    Hi mattkeys, I’ve got a similar problem on our server but not on my local xampp install.

    Using WordPress 4.5.3
    ACF PRO 5.4.0
    Advanced Custom Fields: Font Awesome 1.7.2

    I think it has to do with the server blocking the API and CDN URLs.

    Is it possible to just use the fallback font-awesome without trying to connect to those URLs and get the latest font-awesome library?

    Having this plugin active with this error slows down the admin pages to 30sec – 1 minute per page load.

    I have tried the following filer add_filter( 'bfa_force_fallback', '__return_true' ); but it only removes the Remote CSS Error, not the API Error

    Please see complete Error:

    Better Font Awesome
    API Error
    The attempt to reach the jsDelivr API server failed with the following error: http_request_failed: Connection timed out after 10161 milliseconds (URL: http://api.jsdelivr.com/v1/jsdelivr/libraries/fontawesome/?fields=versions,lastversion)
    Remote CSS Error
    The attempt to fetch the remote Font Awesome stylesheet failed with the following error: http_request_failed: Connection timed out after 10161 milliseconds (URL: //cdn.jsdelivr.net/fontawesome/4.3.0/css/font-awesome.min.css)
    The embedded fallback Font Awesome will be used instead (version: 4.3.0).
    Don’t worry! Better Font Awesome will still render using the included fallback version: 4.3.0
    Solution
    This may be the result of a temporary server or connectivity issue which will resolve shortly. However if the problem persists please file a support ticket on the plugin forum, citing the errors listed above.

    Thread Starter fusionplanet

    (@fusionplanet)

    Answering my own question. Please see below for someone who may encounter this issue.

    Create an MU plugin:

    add_filter( 'option_active_plugins', 'disable_ipa_plugin' );
    
    function disable_ipa_plugin($plugins){
    	if(strpos($_SERVER['REQUEST_URI'], '/path-to-page-to-not-run-plugin/') !== FALSE AND strpos($_SERVER['REQUEST_URI'], '/wp-admin/') === FALSE ) {
            $key = array_search( 'insert-post-ads/insert-post-ads.php' , $plugins );
            if ( false !== $key ) {
                unset( $plugins[$key] );
            }
        }
        return $plugins;
    }

    credits where credits are due: Modified from Kamil Grzegorczyk solution.

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