PluginProbe
Admin and Site Enhancements (ASE) / 7.4.6
Admin and Site Enhancements (ASE) v7.4.6
9.1.1 9.1.0 9.0.2 9.0.1 9.0.0 8.9.2 8.9.1 8.9.0 8.8.8 8.8.7 8.8.6 8.8.5 8.8.4 8.8.3 8.8.2 8.8.1 8.8.0 8.7.3 8.7.2 8.7.1 8.2.1 8.2.2 8.2.3 8.3.0 8.3.1 All 273 releases
admin-site-enhancements / admin-site-enhancements.php
admin-site-enhancements.php
117 lines 3.7 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 /**
4 * Plugin Name: Admin and Site Enhancements (ASE)
5 * Plugin URI: https://www.wpase.com/plugin-uri
6 * Description: Easily enable enhancements and features that usually require multiple plugins.
7 * Version: 7.4.6
8 * Author: wpase.com
9 * Author URI: https://www.wpase.com/author-uri
10 * License: GPL-2.0+
11 * License URI: http://www.gnu.org/licenses/gpl-2.0.txt
12 * Text Domain: admin-site-enhancements
13 * Domain Path: /languages
14 *
15 */
16 // If this file is called directly, abort.
17 if ( !defined( 'ABSPATH' ) ) {
18 exit;
19 }
20
21 define( 'ASENHA_VERSION', '7.4.6' );
22 define( 'ASENHA_ID', 'asenha' );
23 define( 'ASENHA_SLUG', 'admin-site-enhancements' );
24 define( 'ASENHA_SLUG_U', 'admin_site_enhancements' );
25 define( 'ASENHA_URL', plugins_url( '/', __FILE__ ) ); // e.g. https://www.example.com/wp-content/plugins/this-plugin/
26 define( 'ASENHA_PATH', plugin_dir_path( __FILE__ ) ); // e.g. /home/user/apps/wp-root/wp-content/plugins/this-plugin/
27 // define( 'ASENHA_BASE', plugin_basename( __FILE__ ) ); // e.g. plugin-slug/this-file.php
28 // define( 'ASENHA_FILE', __FILE__ ); // /home/user/apps/wp-root/wp-content/plugins/this-plugin/this-file.php
29
30 /**
31 * Autoload classes defined by this plugin
32 *
33 * @param string $class_name e.g. \ASENHA\Classes\The_Name
34 * @since 1.0.0
35 */
36 function asenha_autoloader( $class_name ) {
37
38 $namespace = 'ASENHA';
39
40 // Only process classes within this plugin's namespace
41
42 if ( false !== strpos( $class_name, $namespace ) ) {
43
44 // Assemble file path where class is defined
45
46 // \ASENHA\Classes\The_Name => \Classes\The_Name
47 $path = str_replace( $namespace, "", $class_name );
48
49 // \Classes\The_Name => /classes/the_name
50 $path = str_replace( "\\", DIRECTORY_SEPARATOR, strtolower( $path ) );
51
52 // /classes/the_name => /classes/the-name.php
53 $path = str_replace( "_", "-", $path ) . '.php';
54
55 // /classes/the-name.php => /classes/class-the-name.php
56 $path = str_replace( "classes" . DIRECTORY_SEPARATOR, "classes" . DIRECTORY_SEPARATOR . "class-", $path );
57
58 // Remove first '/'
59 $path = substr( $path, 1 );
60
61 // Get /plugin-path/classes/class-the-name.php
62 $path = ASENHA_PATH . $path;
63
64 if ( file_exists( $path ) ) {
65 require_once( $path );
66 }
67
68 }
69
70 }
71
72 // Register autoloading classes
73 spl_autoload_register( 'asenha_autoloader' );
74
75 /**
76 * Code that runs on plugin activation
77 *
78 * @since 1.0.0
79 */
80 function asenha_on_activation() {
81 $activation = new ASENHA\Classes\Activation;
82 $activation->create_failed_logins_log_table();
83 }
84
85 /**
86 * Code that runs on plugin deactivation
87 *
88 * @since 1.0.0
89 */
90 function asenha_on_deactivation() {
91 $deactivation = new ASENHA\Classes\Deactivation;
92 $deactivation->delete_failed_logins_log_table();
93 }
94
95 // Register code that runs on plugin activation
96 register_activation_hook( __FILE__, 'asenha_on_activation');
97
98 // Register code that runs on plugin deactivation
99 register_deactivation_hook( __FILE__, 'asenha_on_deactivation' );
100
101 // Load translations
102 function asenha_free_load_textdomain() {
103 load_plugin_textdomain( 'admin-site-enhancements', false, dirname( plugin_basename( __FILE__ ) ) . '/languages' );
104 }
105 add_action( 'init', 'asenha_free_load_textdomain' );
106
107 // Functions for setting up admin menu, admin page, the settings sections and fields and other fondational stuff
108 require_once ASENHA_PATH . 'settings.php';
109
110 // Other required functions
111 require_once ASENHA_PATH . 'functions.php';
112
113 // Load vendor libraries
114 // require_once ASENHA_PATH . 'vendor/autoload.php';
115
116 // Bootstrap all the functionalities of this plugin
117 require_once ASENHA_PATH . 'bootstrap.php';