Sindbad~EG File Manager
<?php
/**
* Plugin Name: RealPress
* Plugin URI: https://thimpress.com/
* Description: An useful Real Estate plugin
* Version: 1.1.2
* Author: ThimPress
* Author URI: https://thimpress.com/
* Requires at least: 6.0
* Requires PHP: 7.4
* Text Domain: realpress
* Domain Path: /languages
*/
namespace RealPress;
use RealPress\Controllers\AgentAdminController;
use RealPress\Controllers\CommentController;
use RealPress\Controllers\CompareController;
use RealPress\Controllers\EnqueueScriptsController;
use RealPress\Controllers\PermalinkController;
use RealPress\Controllers\PropertyController;
use RealPress\Controllers\TemplateController;
use RealPress\Controllers\WishListController;
use RealPress\Controllers\ImageController;
use RealPress\Controllers\EmailController;
use RealPress\Controllers\ContactFormController;
use RealPress\Controllers\UserController;
use RealPress\Controllers\BecomeAgentController;
use RealPress\Controllers\SetupWizardController;
use RealPress\Controllers\PageController;
use RealPress\Controllers\ModifyQueryController;
use RealPress\Controllers\SchemaController;
use RealPress\Controllers\ScheduleTourController;
use RealPress\Controllers\AdminMenuController;
use RealPress\Controllers\WPDropDownController;
use RealPress\Controllers\MenuController;
use RealPress\Controllers\TermController;
use RealPress\Controllers\SeoController;
use RealPress\Controllers\Translation\PolylangController;
use RealPress\Controllers\Translation\WPMLController;
use RealPress\Helpers\TemplateHooks\AgentDetail;
use RealPress\Helpers\TemplateHooks\AgentList;
use RealPress\Helpers\TemplateHooks\SingleProperty;
use RealPress\Helpers\TemplateHooks\ArchiveProperty;
use RealPress\Helpers\TemplateHooks\WishList;
use RealPress\Helpers\TemplateHooks\Compare;
use RealPress\Helpers\TemplateHooks\MyAccount;
use RealPress\Helpers\TemplateHooks\BecomeAgent;
use RealPress\Helpers\TemplateHooks\PropertyList as PropertyListTemp;
use RealPress\Helpers\Translation;
use RealPress\MetaBoxes\UserProfile;
use RealPress\MetaBoxes\PropertyMeta;
use RealPress\MetaBoxes\CommentMeta;
use RealPress\MetaBoxes\TermMeta;
use RealPress\Register\BlockTemplate\BlockTemplateHandle;
use RealPress\Register\Property;
use RealPress\Register\Setting;
use RealPress\Register\Widgets;
use RealPress\Shortcodes\ContactForm;
use RealPress\Shortcodes\BecomeAgentForm;
use RealPress\Shortcodes\AdvancedSearch;
use RealPress\Shortcodes\SearchWithMap;
use RealPress\Shortcodes\PropertyMap;
use RealPress\Shortcodes\PropertyList;
use RealPress\Helpers\Template;
/**
* Class RealPress
*/
class RealPress {
/**
* @var RealPress
*/
protected static $instance;
/**
* @var array
*/
public static $plugin_info;
/**
* Instance
*
* @return self
*/
public static function instance(): self {
if ( is_null( self::$instance ) ) {
self::$instance = new self();
}
return self::$instance;
}
/**
* Constructor
*/
protected function __construct() {
$default_headers = array(
'Version' => 'Version',
);
$plugin_info = get_file_data( __FILE__, $default_headers, 'plugin' );
self::$plugin_info = $plugin_info;
$this->set_constant();
require_once REALPRESS_DIR . 'vendor/autoload.php';
$this->hooks();
$this->include();
}
/**
* Set constant variable
*
* @return void
* @since 1.0.0
* @version 1.0.0
*/
protected function set_constant() {
include_once ABSPATH . 'wp-admin/includes/plugin.php';
//Prefix
define( 'REALPRESS_VERSION', self::$plugin_info['Version'] );
define( 'REALPRESS_DB_VERSION', '1.0.0' );
define( 'REALPRESS_PREFIX', 'realpress' );
define( 'REALPRESS_REST_VERSION', 'v1' );
//For class, id
//define( 'REALPRESS_PREFIX_', 'realpress_' );
//Dirs and Urls
define( 'REALPRESS_URL', plugin_dir_url( __FILE__ ) );
define( 'REALPRESS_DIR', plugin_dir_path( __FILE__ ) );
define( 'REALPRESS_CONFIG_DIR', REALPRESS_DIR . 'config/' );
define( 'REALPRESS_IMPORT_DEMO_DIR', REALPRESS_DIR . 'import/' );
define( 'REALPRESS_VIEWS', REALPRESS_DIR . 'views/' );
define( 'REALPRESS_ASSETS_URL', REALPRESS_URL . 'assets/' );
define(
'REALPRESS_FOLDER_ROOT_NAME',
str_replace(
array( '/', basename( __FILE__ ) ),
'',
plugin_basename( __FILE__ )
)
);
//Posttypes
define( 'REALPRESS_PROPERTY_CPT', 'realpress-property' );
//Agent role
define( 'REALPRESS_AGENT_ROLE', 'realpress-agent' );
//Pages
define( 'REALPRESS_SINGLE_PROPERTY_PAGE', 'single_property_page' );
define( 'REALPRESS_PROPERTY_ARCHIVE_PAGE', 'property_archive_page' );
define( 'REALPRESS_AGENT_LIST_PAGE', 'agent_list_page' );
define( 'REALPRESS_BECOME_AN_AGENT_PAGE', 'become_an_agent_page' );
define( 'REALPRESS_AGENT_DETAIL_PAGE', 'agent_detail_page' );
define( 'REALPRESS_WISHLIST_PAGE', 'wishlist_page' );
define( 'REALPRESS_COMPARE_PROPERTY_PAGE', 'compare_property_page' );
define( 'REALPRESS_MY_ACCOUNT_PAGE', 'my_account_page' );
define( 'REALPRESS_ADMIN_SINGLE_PROPERTY_PAGE', 'admin_single_property_page' );
define( 'REALPRESS_ADMIN_PROPERTY_TERM_PAGE', 'admin_property_term_page' );
define( 'REALPRESS_PROPERTY_EDIT_TAGS_PAGE', 'property_edit_tags_page' );
define( 'REALPRESS_PROPERTY_SETTING_PAGE', 'property_setting_page' );
define( 'REALPRESS_IMPORT_DEMO_PAGE', 'import_demo_page' );
define( 'REALPRESS_USER_PROFILE_PAGE', 'user_profile_page' );
define( 'REALPRESS_SETUP_PAGE', 'set_up_page' );
//Keys
define( 'REALPRESS_OPTION_KEY', 'realpress_option' );
define( 'REALPRESS_PROPERTY_META_KEY', 'realpress_property_meta_key' );
define( 'REALPRESS_PROPERTY_REVIEW_META_KEY', 'realpress_property_review_meta_key' );
define( 'REALPRESS_TERM_META_KEY', 'realpress_term_meta_key' );
define( 'REALPRESS_USER_META_KEY', 'realpress_user_meta_key' );
}
/**
* Include files
*
* @return void
* @since 1.0.0
* @version 1.0.0
*/
protected function include() {
if ( is_admin() ) {
//Metabox
new PropertyMeta();
add_action(
'init',
function () {
new TermMeta();
}
);
new CommentMeta();
//Register
new Setting();
} else {
new WishListController();
new CompareController();
new ModifyQueryController();
new SchemaController();
new ScheduleTourController();
ContactFormController::instance();
}
new EnqueueScriptsController();
new CommentController();
new PropertyController();
new PermalinkController();
new TemplateController();
new UserController();
new ImageController();
new EmailController();
new BecomeAgentController();
new PageController();
new SetupWizardController();
new AdminMenuController();
new WPDropDownController();
new MenuController();
new TermController();
new AgentAdminController();
new SeoController();
new PolylangController();
new WPMLController();
//Shortcode
new ContactForm();
new AdvancedSearch();
new BecomeAgentForm();
new SearchWithMap();
new PropertyMap();
new PropertyList();
//Register
new Property();
new Widgets();
//Metabox
new UserProfile();
BlockTemplateHandle::instance();
SingleProperty::instance();
ArchiveProperty::instance();
AgentDetail::instance();
AgentList::instance();
WishList::instance();
Compare::instance();
MyAccount::instance();
BecomeAgent::instance();
PropertyListTemp::instance();
}
/**
* Hooks to WP
*
* @return void
* @since 1.0.0
* @version 1.0.0
*/
protected function hooks() {
add_action( 'init', array( $this, 'load_text_domain' ), - 999999 );
register_activation_hook( __FILE__, array( $this, 'on_activate' ) );
add_action( 'admin_notices', array( $this, 'admin_notices' ) );
/* Add Widget for Thim-ekits to build with Elementor */
add_action(
'init',
function () {
if ( class_exists( 'Thim_EL_Kit' ) && defined( 'ELEMENTOR_VERSION' ) ) {
require_once REALPRESS_DIR . 'app/Elementor/modules/class-init.php';
}
}
);
}
public function on_activate() {
}
/**
* Load text domain
*
* @return void
*/
public function load_text_domain() {
load_plugin_textdomain( 'realpress', false, basename( __DIR__ ) . '/languages' );
Translation::load_text_domain();
}
public function admin_notices() {
if ( ! current_user_can( 'administrator' ) ) {
return;
}
if ( ! get_option( 'realpress_setup_wizard_completed', false ) ) {
Template::instance()->get_admin_template( 'setup/notice-setup.php' );
}
}
}
RealPress::instance();
//add_filter( 'block_type_metadata', function ( $metadata ) {
// if($metadata['name'] === 'learnpress/course-filter'){
// $metadata['supports'] = [
// 'align'=> true
// ];
// }
//
// return $metadata;
//} );
Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists