• Hi,

    I’m using your plugin and I’m pretty happy with it ?? Thanks for your great work!

    It would be great though if you can remove the laoding of font-awesome from an external source (https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css) as I want to have control over all content which is loaded from external pages. Which means I currently need to change the class-wpel-register-scripts.php and replace the external link to one which points to my website every time you update your plugin.

    I would really love to see that font-awesome is not loaded when the icon option is disabled or to replace the font-awesome source to be a local one (maybe through a setting in the admin panel?).

    Thanks,
    Christian

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Alexandru Tapuleasa

    (@talextech)

    Hi Christian,

    Sorry to hear you are having issues but we have already fixed this recently and Font Awesome should not be loaded if you do not use a Font Awesome icon for your links. Are you using the latest version of WP External Links?

    You can check the code in wp-external-links/includes/class-wpel-front.php ~line 96 and you will see we have an IF there to verify that fontawesome is selected for the link icon.

    Thread Starter graviox

    (@graviox)

    Thanks for the quick reply. I do have the latest version though but the described issue still occurs.

    I’m not very familiar with how WordPress works internally but I suspect that the register of font awesome in class-wpel-register-scripts.php:40 is already enough to make the css being included.

    Here are my settings:

    WordPress-URL:  XXXX
    WordPress-Version:  5.3.2
    PHP-Version:  7.3.13-1+0~20191218.50+debian8~1.gbp23c2da
    Aktivierte Plugins:
     - Attachment Pages Redirect, version: 1.1.1
     - Autoptimize, version: 2.6.1
     - Bounce Handler Mailpoet, version: 1.3.20
     - BST DSGVO Cookie, version: 1.2.7
     - Cachify, version: 2.2.4
     - Classic Editor, version: 1.5
     - Code Snippets, version: 2.13.3
     - Comment Approved, version: 1.6.1
     - Contact Form 7, version: 5.1.6
     - EWWW Image Optimizer, version: 5.1.3
     - Featured Image In Rss Feed, version: 2.1
     - Insert Headers and Footers, version: 1.4.4
     - MailPoet 3 (New), version: 3.42.0
     - Related Posts for WordPress, version: 2.0.3
     - Responsive Lightbox & Gallery, version: 2.2.2
     - Simple Custom CSS, version: 4.0.3
     - WP External Links, version: 2.43
     - WP GDPR Compliance, version: 1.5.2
     - WP Mail SMTP, version: 1.8.1
     - WP Original Media Path, version: 2.4.0
     - Yoast SEO, version: 12.7.1
    
    WP External Links - Einstellungen:
    array(
    'wpel-external-link-settings' => array (
      'apply_settings' => '1',
      'target' => '_blank',
      'target_overwrite' => '1',
      'rel_follow' => 'nofollow',
      'rel_follow_overwrite' => '1',
      'rel_noopener' => '1',
      'rel_noreferrer' => '',
      'rel_external' => '1',
      'rel_sponsored' => '0',
      'rel_ugc' => '0',
      'title' => '{title}',
      'class' => '',
      'icon_type' => '',
      'icon_image' => '6',
      'icon_dashicon' => 'dashicons-menu',
      'icon_fontawesome' => 'fa-500px',
      'icon_position' => 'right',
      'no_icon_for_img' => '1',
    ),
    'wpel-internal-link-settings' => array (
      'apply_settings' => '',
      'target' => '',
      'target_overwrite' => '',
      'rel_follow' => '',
      'rel_follow_overwrite' => '',
      'rel_noopener' => '1',
      'rel_noreferrer' => '1',
      'title' => '{title}',
      'class' => '',
      'icon_type' => '',
      'icon_image' => '1',
      'icon_dashicon' => '',
      'icon_fontawesome' => '',
      'icon_position' => 'right',
      'no_icon_for_img' => '1',
    ),
    'wpel-excluded-link-settings' => array (
      'apply_settings' => '1',
      'target' => '_blank',
      'target_overwrite' => '1',
      'rel_follow' => 'follow',
      'rel_follow_overwrite' => '1',
      'rel_noopener' => '1',
      'rel_noreferrer' => '',
      'title' => '{title}',
      'class' => '',
      'icon_type' => '',
      'icon_image' => '1',
      'icon_dashicon' => 'dashicons-menu',
      'icon_fontawesome' => 'fa-500px',
      'icon_position' => 'right',
      'no_icon_for_img' => '1',
    ),
    'wpel-exceptions-settings' => array (
      'apply_all' => '1',
      'apply_post_content' => '1',
      'apply_comments' => '1',
      'apply_widgets' => '1',
      'skip_post_ids' => '',
      'ignore_classes' => '',
      'subdomains_as_internal_links' => '',
      'include_urls' => '',
      'exclude_urls' => 'XXX
      XXX
      XXX',
      'excludes_as_internal_links' => '',
      'ignore_script_tags' => '1',
      'ignore_mailto_links' => '1',
    ),
    'wpel-admin-settings' => array (
      'own_admin_menu' => '1',
    ),
    );
    Thread Starter graviox

    (@graviox)

    I’ve quickly debugged it and the code from class-wpel-front.php:96 works so that wp_enqueue_style( 'font-awesome' ); is not executed but the font-awesome css is still loaded.

    If I uncomment the register of font-aweseome in class-wpel-register-scripts.php:40 it’s no longer loaded. I hope that helps.

    Thread Starter graviox

    (@graviox)

    I found the issue. My theeme also uses this line wp_enqueue_style('font-awesome'); but registers font-awesome with a local referenced file but as your plugin is registering font-awesome from the external source it loads both variants on wp_enqueue_style.

    Would be cool if you add an option to load font-awesome from a local file instead or even better: Load from a locally shipped file by default. Thanks!

    Plugin Author Alexandru Tapuleasa

    (@talextech)

    Hi,

    Yes, that seems to be the issue. We will get it fixed in the next update, sorry for the inconvenience. ??

    In the meantime you can just comment out the wp_register_script call in WP External Links.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Font-Awesome always loaded’ is closed to new replies.