Sindbad~EG File Manager
<?php
/*
* Security : blocking direct access
* Source : http://codex.wordpress.org/Theme_Development#Template_Files
*/
defined('ABSPATH') or die("Access Restricted");
define( 'MWP_OPTIONS_DB', 'mwp_new_newsbt' );
/*
* Text Domain
*
*/
define( 'MWP_TEXT_DOMAIN', 'newsbt' , true);
/*
* AJAX CUSTOM ENDPOINT
*
* Cloudflare Users !!!!!!!!!!
*
* You must Change ENDPOINT to default wordpress admin_url
*
* Update MWP_AJAX_ENDPOINT & MWP_AJAX_PREFIX To :
*
* define( 'MWP_AJAX_ENDPOINT', admin_url( 'admin-ajax.php' ));
* define( 'MWP_AJAX_PREFIX', 'wp_ajax');
*
* WPML USERS Note about MWP_AJAX_ENDPOINT
*
* you must change first variable $ajax_url for MWP_AJAX_ENDPOINT line 41
* and change line 49 for MWP_AJAX_PREFIX
*
* contact us if you wante change this lines at [email protected]
*
*/
/*
* WPML Compatibility
*
* using default ajax url instead of custom ajax url
* https://wpml.org/forums/topic/ie11-wpml-issue-with-ajax-call-only-default-language-is-displayed/#post-998915
*
*/
if ( function_exists('icl_object_id') ) {
$ajax_url = get_template_directory_uri(). '/ajax-admin.php';
$my_current_lang = apply_filters( 'wpml_current_language', NULL );
if ( $my_current_lang ) {
$ajax_url = $ajax_url . '?lang=' . $my_current_lang;
}
define( 'MWP_AJAX_ENDPOINT', $ajax_url);
define( 'MWP_AJAX_PREFIX', 'mwpajax');
} else {
define( 'MWP_AJAX_ENDPOINT', get_template_directory_uri(). '/ajax-admin.php');
define( 'MWP_AJAX_PREFIX', 'mwpajax');
}
/*
* MT-Boost
* https://www.npmjs.com/package/mt-boost
*
* @MWP_CDN_URL : Select one from list below if you wonte to load files from CDN
* 1 - https://cdn.jsdelivr.net/npm/
* 2 - https://unpkg.com/
*
* @MWP_CDN_PNAME : is package name hosted on npm : https://www.npmjs.com/package/mt-boost
* 1 - you can use your own if have one package on npm
* 2 - package must have some names of the files and directory order
*
* @MWP_CDN_VERSION : we use version for best caching from CDN
*
* @MWP_PATH_URL : If you do not want to use CDN you can change it to [ get_template_directory_uri() ]
* and all files will be loaded from your server
*
* ---> define( 'MWP_PATH_URL', get_template_directory_uri());
*
*/
define( 'MWP_CDN_DOMAIN', 'https://cdn.jsdelivr.net');
define( 'MWP_CDN_URL', 'https://cdn.jsdelivr.net/npm/');
define( 'MWP_CDN_PNAME', 'mt-boost');
define( 'MWP_CDN_VERSION', '@1.0.24');
define( 'MWP_PATH_URL', MWP_CDN_URL . MWP_CDN_PNAME . MWP_CDN_VERSION . '/dist');
//define( 'MWP_PATH_URL', get_template_directory_uri());
/*
* Check if Block Editor is active.
* Must only be used after plugins_loaded action is fired.
*
* @return bool
* @source : https://wordpress.stackexchange.com/a/320654
*/
function mwp_is_gb_active() {
// Gutenberg plugin is installed and activated.
$gutenberg = ! ( false === has_filter( 'replace_editor', 'gutenberg_init' ) );
// Block editor since 5.0.
$block_editor = version_compare( $GLOBALS['wp_version'], '5.0-beta', '>' );
if ( ! $gutenberg && ! $block_editor ) {
return false;
}
if ( mwp_is_classic_editor_plugin_active() ) {
$editor_option = get_option( 'classic-editor-replace' );
$block_editor_active = array( 'no-replace', 'block' );
return in_array( $editor_option, $block_editor_active, true );
}
return true;
}
/*
* Check if Classic Editor plugin is active.
*
* @return bool
* @source : https://wordpress.stackexchange.com/a/320654
*/
function mwp_is_classic_editor_plugin_active() {
if ( ! function_exists( 'is_plugin_active' ) ) {
include_once ABSPATH . 'wp-admin/includes/plugin.php';
}
if ( is_plugin_active( 'classic-editor/classic-editor.php' ) ) {
return true;
}
return false;
}
/*
* Function mwp_option()
* Get Settings option from Responsive Theme
* don't remove this function
*
*/
function mwp_option( $option ) {
$options = get_option( MWP_OPTIONS_DB );
if ( isset( $options[$option] ) )
return $options[$option];
else
return false;
}
/*
* Mobile Helper
*
*/
require_once( get_template_directory() . '/functions/mobile-helper.php' );
if (is_admin()) {
/*
* Panel - MetaBox
*
*/
require_once( get_template_directory() . '/panel/metabox/settings.php' );
require_once( get_template_directory() . '/panel/metabox/page.php' );
/*
* Video Core
*
*/
require_once( get_template_directory() . '/panel/core/video.php' );
require_once( get_template_directory() . '/panel/core/update.php' );
/*
* TinyMCE Editor
* Old TinyMCE Editor
*
*/
require_once( get_template_directory() . '/panel/core/tinymce.php' );
}
/*
* Gutenberg Helper functions
*
*/
require_once( get_template_directory() . '/panel/gutenberg/gutenberg.php' );
/*
* Helper functions
*
*/
require_once( get_template_directory() . '/functions/helper/general.php' );
require_once( get_template_directory() . '/functions/helper/archive-ppp.php' );
require_once( get_template_directory() . '/functions/helper/theme-support.php' );
require_once( get_template_directory() . '/functions/helper/template-support.php' );
require_once( get_template_directory() . '/functions/helper/local.php' );
require_once( get_template_directory() . '/functions/helper/skin.php' );
require_once( get_template_directory() . '/functions/helper/wp-head.php' );
require_once( get_template_directory() . '/functions/helper/breadcrumbs.php' );
require_once( get_template_directory() . '/functions/helper/related.php' );
require_once( get_template_directory() . '/functions/helper/post-meta.php' );
require_once( get_template_directory() . '/functions/helper/post-content.php' );
require_once( get_template_directory() . '/functions/helper/comments.php' );
require_once( get_template_directory() . '/functions/helper/embed.php' );
require_once( get_template_directory() . '/functions/helper/user-profile.php' );
require_once( get_template_directory() . '/functions/helper/jetpack-views.php' );
require_once( get_template_directory() . '/functions/helper/jetpack.php' );
require_once( get_template_directory() . '/functions/helper/shortcode.php' );
require_once( get_template_directory() . '/functions/helper/pagination.php' );
require_once( get_template_directory() . '/functions/helper/bfi-thumb.php' );
require_once( get_template_directory() . '/functions/helper/default-gallery.php' );
require_once( get_template_directory() . '/functions/helper/ads-rs.php' );
require_once( get_template_directory() . '/functions/helper/ads.php' );
require_once( get_template_directory() . '/functions/helper/thumbnail.php' );
require_once( get_template_directory() . '/functions/helper/thumbnail-video.php' );
require_once( get_template_directory() . '/functions/helper/wp-mediaelement.php' );
require_once( get_template_directory() . '/functions/seo/seo.php' );
require_once( get_template_directory() . '/functions/load-styles.php' );
require_once( get_template_directory() . '/functions/load-scripts.php' );
/*
* Single Elements
*
*/
require_once( get_template_directory() . '/functions/single-elements.php' );
/*
* AMP Core
*
*/
if (function_exists( 'is_amp_endpoint' )) {
require_once( get_template_directory() . '/amp/admin/amp-metabox.php' );
require_once( get_template_directory() . '/amp/helper/misc.php' );
require_once( get_template_directory() . '/amp/helper/ads.php' );
require_once( get_template_directory() . '/amp/helper/social.php' );
require_once( get_template_directory() . '/amp/helper/navigation.php' );
require_once( get_template_directory() . '/amp/helper/analytics.php' );
require_once( get_template_directory() . '/amp/helper/seo.php' );
require_once( get_template_directory() . '/amp/helper/related.php' );
require_once( get_template_directory() . '/amp/helper/thumbnail.php' );
require_once( get_template_directory() . '/amp/helper/video-optional.php' );
require_once( get_template_directory() . '/amp/helper/gallery-optional.php' );
require_once( get_template_directory() . '/amp/helper/fonts.php' );
require_once( get_template_directory() . '/amp/helper/css.php' );
require_once( get_template_directory() . '/amp/helper/web-push.php' );
}
/*
* Ajax Functions
*
*/
if (class_exists( 'Jetpack' ) && Jetpack::is_module_active( 'stats' ) || function_exists('the_views')) {
require_once( get_template_directory() . '/functions/ajax/views.php' );
}
/*
* Count DataBase Queries
*
*/
function mwp_footer_db_queries(){
echo PHP_EOL .'<!-- '.get_num_queries().' queries in '.timer_stop(0).' seconds. -->'.PHP_EOL;
}
//add_action('wp_footer', 'mwp_footer_db_queries', 9999999999999);
Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists