AP Extended MIME Types
Plugin uses plugins_url, should be plugin_dir_path? (2 posts)

  1. bivald
    Posted 3 years ago #


    The plugin uses plugins_url (i.e it tries to download the file over HTTP, instead of opening the actual file on disc). This pretty much renders the plugin useless if you have strict PHP settings (i.e can't download files over http via file()).

    Following code uses the local file, instead of remote:

    $file = 'mime-types.txt';
    $file = plugin_dir_path(__FILE__) . $file;
    $mime_file_lines = file($file);


  2. lucile
    Posted 3 years ago #

    Thanks for the tip, it solved the following warnings:

    Warning: file() [function.file]: php_network_getaddresses: getaddrinfo failed: Name or service not known in /(...)/web/wp-content/plugins/ap-extended-mime-types/ap-extended-mime-types.php on line 40
    Warning: file(http://(...)/wp-content/plugins/ap-extended-mime-types/mime-types.txt) [function.file]: failed to open stream: Success in /(...)/web/wp-content/plugins/ap-extended-mime-types/ap-extended-mime-types.php on line 40
    Warning: Invalid argument supplied for foreach() in /(...)/web/wp-content/plugins/ap-extended-mime-types/ap-extended-mime-types.php on line 42

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • AP Extended MIME Types
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic