/**
  * Singleton.
  * 
  * @since    1.0
  * 
  * @return   void
  */
 public static function get_instance()
 {
     if (!isset(self::$instance)) {
         self::$instance = new static();
     }
     return self::$instance;
 }
 * @author  Charlie Merland <*****@*****.**>
 * @link    https://wordpress.org/plugins/media-drag-n-drop-url
 */
/**
 * Plugin Name: Media Drag n’ Drop URL
 * Plugin URI: https://wordpress.org/plugins/media-drag-n-drop-url
 * Description: Add URL Drag n’ Drop support to WordPress Media Uploader, allowing you to upload media directly by drag-n-dropping media URL to the Uploader.
 * Version: 1.0
 * Author: Charlie Merland
 * Author URI: http://www.caercam.org
 * License: MIT
 * Text Domain: mediadndurl
 */
// Don't call this directly
if (!function_exists('add_action')) {
    echo 'Hi there!  I\'m just a plugin, not much I can do when called directly.';
    exit;
}
define('MEDIADNDURL_NAME', 'Media Drag n’ Drop URL');
define('MEDIADNDURL_VERSION', '1.0');
define('MEDIADNDURL_MINIMUM_WP_VERSION', '4.4');
define('MEDIADNDURL_PLUGIN_URL', plugin_dir_url(__FILE__));
define('MEDIADNDURL_PLUGIN_DIR', plugin_dir_path(__FILE__));
require_once MEDIADNDURL_PLUGIN_DIR . 'class-media-drag-n-drop-url.php';
register_activation_hook(__FILE__, array('MediaDnDURL', 'plugin_activation'));
register_deactivation_hook(__FILE__, array('MediaDnDURL', 'plugin_deactivation'));
if (is_admin()) {
    require_once MEDIADNDURL_PLUGIN_DIR . 'class-media-drag-n-drop-url-admin.php';
    $mediadndurl = MediaDnDURL_Admin::get_instance();
    $mediadndurl->run();
}