-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.php
More file actions
101 lines (79 loc) · 2.52 KB
/
index.php
File metadata and controls
101 lines (79 loc) · 2.52 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
<?php
/**
* Plugin Name: Rownd Accounts and Authentication
* Plugin URI: https://github.com/rownd/wordpress
* Description: Instantly turn visitors into users with Rownd's radically simple, user-centric authentication.
* Author: Rownd, Inc.
* Author URI: https://rownd.io
* Text Domain: rownd
* Domain Path: /languages
* Version: 1.3.5
* License: Apache 2.0
* License URI: http://www.apache.org/licenses/LICENSE-2.0
*
* @package Rownd
*/
// Your code starts here.
/**
* @global string $plugin_dir_url
*/
if (!defined('ROWND_PLUGIN_VERSION')) {
define('ROWND_PLUGIN_VERSION', '1.3.5');
}
if (!defined('ROWND_PLUGIN_IMAGE_DIR')) {
define('ROWND_PLUGIN_IMAGE_DIR', plugin_dir_url(__FILE__) . 'images');
}
if (!defined('ROWND_PLUGIN_JS_DIR')) {
define('ROWND_PLUGIN_JS_DIR', plugin_dir_url(__FILE__) . 'js');
}
if (!defined('ROWND_PLUGIN_CSS_DIR')) {
define('ROWND_PLUGIN_CSS_DIR', plugin_dir_url(__FILE__) . 'css');
}
if (!defined('ROWND_PLUGIN_LANG_DIR')) {
define('ROWND_PLUGIN_LANG_DIR', basename(dirname(__FILE__)) . '/languages/');
}
if (!defined('ROWND_PLUGIN_TEXT_DOMAIN')) {
define('ROWND_PLUGIN_TEXT_DOMAIN', 'rownd-plugin');
}
if (!defined('ROWND_PLUGIN_SETTINGS')) {
define('ROWND_PLUGIN_SETTINGS', 'rownd-plugin-settings');
}
if (!defined('ROWND_PLUGIN_PLUGIN_DIR')) {
define('ROWND_PLUGIN_PLUGIN_DIR', plugin_dir_path(__FILE__));
}
// require all of our src files
require_once(plugin_dir_path(__FILE__) . '/vendor/autoload.php');
register_activation_hook(__FILE__, 'rownd_on_activation');
function rownd_on_activation()
{
if (!current_user_can('activate_plugins')) {
return;
}
$plugin = isset($_REQUEST['plugin']) ? sanitize_text_field($_REQUEST['plugin']) : '';
check_admin_referer("activate-plugin_{$plugin}");
if (!get_option(ROWND_PLUGIN_SETTINGS)) {
include_once('src/lib/activation.php');
}
# Uncomment the following line to see the function in action
// exit( var_dump( $_GET ) );
}
if (!function_exists('rownd_write_log')) {
function rownd_write_log($log) {
if (true === WP_DEBUG) {
if (is_array($log) || is_object($log)) {
error_log(print_r($log, true));
} else {
error_log($log);
}
}
}
}
if (!function_exists('rownd_is_plugin_active')) {
function rownd_is_plugin_active($pluginPath) {
if(in_array($pluginPath, apply_filters('active_plugins', get_option('active_plugins')))){
return true;
}
return false;
}
}
new Rownd\WordPress\Plugin();