Sindbad~EG File Manager
<?php
/*
* Security : blocking direct access
* Source : http://codex.wordpress.org/Theme_Development#Template_Files
*/
defined('ABSPATH') or die("Access Restricted");
/*
* 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', esc_url($ajax_url));
define( 'MWP_AJAX_PREFIX', 'mwpajax');
} else {
define( 'MWP_AJAX_ENDPOINT', esc_url(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 caching HIT
*
* @MWP_PATH_URL : If you do not like to use CDN, change value of MWP_PATH_URL 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.26');
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;
}
/*
* Skins Helper
*
*/
require_once( get_template_directory() . '/panel/core/skin.php' );
/*
* Check Ioncube
*
* Load Panel Based On PHP Version
*
*/
if ( extension_loaded( "IonCube Loader" ) ) {
if (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION == 6 || PHP_MAJOR_VERSION == 7 && PHP_MINOR_VERSION == 0) {
define( 'MWP_PATH_PHP', get_template_directory() . '/panel/admin-php7/' );
require_once( MWP_PATH_PHP . 'settings.php' );
} elseif (PHP_MAJOR_VERSION == 7 && PHP_MINOR_VERSION == 1) {
define( 'MWP_PATH_PHP', get_template_directory() . '/panel/admin-php7.1/' );
require_once( MWP_PATH_PHP . 'settings.php' );
} elseif (PHP_MAJOR_VERSION == 7 && PHP_MINOR_VERSION == 2 || PHP_MAJOR_VERSION == 7 && PHP_MINOR_VERSION == 3) {
define( 'MWP_PATH_PHP', get_template_directory() . '/panel/admin-php7.2/' );
require_once( MWP_PATH_PHP . 'settings.php' );
} else {
define( 'MWP_PATH_PHP', get_template_directory() . '/panel/admin/' );
require_once( MWP_PATH_PHP . 'settings.php' );
}
} else {
require_once( get_template_directory() . '/panel/Ioncube-Msg.php' );
mwp_check_ionCube();
}
/*
* Load For Admin only
*
*/
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' );
/*
* 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/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/mega-menu.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/prayer.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.php' );
require_once( get_template_directory() . '/functions/helper/ads-rs.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( MWP_PATH_PHP . 'inc/extra.php' );
require_once( get_template_directory() . '/functions/load-styles.php' );
require_once( get_template_directory() . '/functions/load-scripts.php' );
require_once( get_template_directory() . '/functions/single-elements.php' );
/*
* Widgets
*
*/
require_once( get_template_directory() . '/functions/widgets/register.php' );
require_once( get_template_directory() . '/functions/widgets/home-ads.php' );
require_once( get_template_directory() . '/functions/widgets/home-modules.php' );
require_once( get_template_directory() . '/functions/widgets/home-modules-large.php' );
require_once( get_template_directory() . '/functions/widgets/home-modules-4c.php' );
require_once( get_template_directory() . '/functions/widgets/home-modules-2c.php' );
require_once( get_template_directory() . '/functions/widgets/sidebar.php' );
require_once( get_template_directory() . '/functions/widgets/sidebar-addon.php' );
require_once( get_template_directory() . '/functions/widgets/sidebar-adunit.php' );
require_once( get_template_directory() . '/functions/widgets/sidebar-jquery.php' );
require_once( get_template_directory() . '/functions/widgets/sidebar-most.php' );
require_once( get_template_directory() . '/functions/widgets/footer.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
*
*/
require_once( get_template_directory() . '/functions/ajax/login.php' );
require_once( get_template_directory() . '/functions/ajax/page-archive.php' );
if (class_exists( 'Jetpack' ) && Jetpack::is_module_active( 'stats' ) || function_exists('the_views')) {
require_once( get_template_directory() . '/functions/ajax/views.php' );
}
if (mwp_option('urgent-news-ajax') == 1) {
require_once( get_template_directory() . '/functions/ajax/urgent-news.php' );
}
if (mwp_option('sc-ajax-enable') == 1) {
require_once( get_template_directory() . '/functions/ajax/category-default.php' );
}
if (mwp_option('vc-ajax-enable') == 1) {
require_once( get_template_directory() . '/functions/ajax/category-video.php' );
}
if (mwp_option('gc-ajax-enable') == 1) {
require_once( get_template_directory() . '/functions/ajax/category-gallery.php' );
}
if (mwp_option('cc-ajax-enable') == 1) {
require_once( get_template_directory() . '/functions/ajax/category-caricature.php' );
}
if (mwp_option('ebm-ajax-enable') == 1) {
require_once( get_template_directory() . '/functions/ajax/category-books.php' );
}
if (mwp_option('ac-ajax-enable') == 1) {
require_once( get_template_directory() . '/functions/ajax/category-article.php' );
}
if (mwp_option('author-ajax-enable') == 1) {
require_once( get_template_directory() . '/functions/ajax/author.php' );
}
if (mwp_option('home-type') == 1) {
if ( mwp_option( 'home-blog-style') == 1 ) {
require_once( get_template_directory() . '/functions/ajax/blog-1.php' );
} elseif ( mwp_option( 'home-blog-style') == 2 ) {
require_once( get_template_directory() . '/functions/ajax/blog-2.php' );
} elseif ( mwp_option( 'home-blog-style') == 3 ) {
require_once( get_template_directory() . '/functions/ajax/blog-3.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