constant MLA_PLUGIN_PATH';
}
else {
/**
* Provides path information to the plugin root in file system format, including the trailing slash.
*/
define( 'MLA_PLUGIN_PATH', plugin_dir_path( __FILE__ ) );
}
if ( defined( 'MLA_PLUGIN_BASENAME' ) ) {
$mla_name_conflict_error_messages .= '
constant MLA_PLUGIN_BASENAME';
}
else {
/**
* Provides the plugin's directory name, relative to the plugins directory, without leading or trailing slashes.
*/
define( 'MLA_PLUGIN_BASENAME', dirname( plugin_basename( __FILE__ ) ) );
}
if ( defined( 'MLA_PLUGIN_URL' ) ) {
$mla_name_conflict_error_messages .= 'constant MLA_PLUGIN_URL';
}
else {
/**
* Provides path information to the plugin root in URL format.
*/
define( 'MLA_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
}
if ( ! defined( 'MLA_BACKUP_DIR' ) ) {
/**
* Provides the absolute path to the MLA backup directory, including the trailing slash.
* This constant can be overriden by defining it in the wp_config.php file.
*/
$content_dir = ( defined('WP_CONTENT_DIR') ) ? WP_CONTENT_DIR : ABSPATH . 'wp-content';
define( 'MLA_BACKUP_DIR', $content_dir . '/mla-backup/' );
unset( $content_dir );
}
/**
* Defines classes, functions and constants for name conflict tests. There are no global functions
* or other constants in this version; everything is wrapped in classes to minimize potential conflicts.
*
* @since 0.20
*/
$mla_name_conflict_candidates =
array (
'CPAC_Deprecated_Storage_Model_MLA' => 'class',
'ACP_Addon_MLA_Editing_Strategy' => 'class',
'AC_Addon_MLA_ListScreen' => 'class',
'ACP_Addon_MLA_Editing_Model_Media_Title' => 'class',
'ACP_Addon_MLA_Column_Parent' => 'class',
'ACP_Addon_MLA_Column_Date' => 'class',
'MLA_Ajax' => 'class',
'MLACore' => 'class',
'MLACoreOptions' => 'class',
'MLA_Checklist_Walker' => 'class',
'MLAPDF' => 'class',
'MLAQuery' => 'class',
'MLAReferences' => 'class',
'MLAData_Source' => 'class',
'MLAData' => 'class',
'MLAEdit' => 'class',
'MLAFileDownloader' => 'class',
'MLAImageProcessor' => 'class',
'MLAMutex' => 'class',
'MLA_List_Table' => 'class',
'MLA' => 'class',
'MLAModal_Ajax' => 'class',
'MLAModal' => 'class',
'MLAMime' => 'class',
'MLAObjects' => 'class',
'MLATextWidget' => 'class',
'MLAOptions' => 'class',
'MLA_Polylang_Shortcodes' => 'class',
'MLA_Polylang' => 'class',
'MLASettings_CustomFields' => 'class',
'MLA_Custom_Fields_List_Table' => 'class',
'MLA_Custom_Field_Query' => 'class',
'MLASettings_Documentation' => 'class',
'MLA_Example_List_Table' => 'class',
'MLA_Upgrader_Skin' => 'class',
'MLASettings_IPTCEXIF' => 'class',
'MLA_IPTC_EXIF_List_Table' => 'class',
'MLA_IPTC_EXIF_Query' => 'class',
'MLASettings_Shortcodes' => 'class',
'MLA_Template_List_Table' => 'class',
'MLA_Template_Query' => 'class',
'MLASettings_Upload' => 'class',
'MLA_Upload_List_Table' => 'class',
'MLA_Upload_Optional_List_Table' => 'class',
'MLASettings_View' => 'class',
'MLA_View_List_Table' => 'class',
'MLASettings' => 'class',
'MLAShortcode_Support' => 'class',
'MLAShortcodes' => 'class',
'MLATemplate_Support' => 'class',
'MLA_Thumbnail' => 'class',
'MLA_WPML' => 'class',
'MLA_WPML_List_Table' => 'class',
'MLA_WPML_Table' => 'class',
'MLATest' => 'class',
//'MLA_BACKUP_DIR' => 'constant'
);
// Check for conflicting names, i.e., already defined by some other plugin or theme
foreach ( $mla_name_conflict_candidates as $value => $type ) {
switch ($type) {
case 'class':
if ( class_exists( $value ) )
$mla_name_conflict_error_messages .= "class {$value}";
break;
case 'function':
if ( function_exists( $value ) )
$mla_name_conflict_error_messages .= "function {$value}";
break;
case 'constant':
if ( defined( $value ) )
$mla_name_conflict_error_messages .= "constant {$value}";
break;
default:
} // switch $type
}
/**
* Displays name conflict error messages at the top of the Dashboard
*
* @since 0.20
*/
function mla_name_conflict_reporting_action () {
global $mla_name_conflict_error_messages;
echo 'The Media Library Assistant cannot load. Another plugin or theme has declared conflicting class, function or constant names:
'."\r\n";
echo "
{$mla_name_conflict_error_messages}
\r\n";
echo '
You must resolve these conflicts before this plugin can safely load.
'."\r\n";
}
// Load the plugin or display conflict message(s)
if ( empty( $mla_name_conflict_error_messages ) ) {
require_once('includes/mla-plugin-loader.php');
if ( class_exists( 'MLASettings' ) ) {
register_activation_hook( __FILE__, array( 'MLASettings', 'mla_activation_hook' ) );
register_deactivation_hook( __FILE__, array( 'MLASettings', 'mla_deactivation_hook' ) );
}
}
else {
add_action( 'admin_notices', 'mla_name_conflict_reporting_action' );
}
?>