- WPCS for defined constants;

* um_url -> UM_URL
   * um_path -> UM_PATH
   * um_plugin -> UM_PLUGIN
   * ultimatemember_version -> UM_VERSION
   * ultimatemember_plugin_name -> UM_PLUGIN_NAME
This commit is contained in:
Mykyta Synelnikov
2023-09-13 22:56:32 +03:00
parent 57159f2496
commit b83da8b814
25 changed files with 213 additions and 213 deletions
+56 -56
View File
@@ -62,11 +62,11 @@ if ( ! class_exists( 'um\admin\core\Admin_Enqueue' ) ) {
* Admin_Enqueue constructor.
*/
public function __construct() {
$this->js_url = um_url . 'includes/admin/assets/js/';
$this->css_url = um_url . 'includes/admin/assets/css/';
$this->js_url = UM_URL . 'includes/admin/assets/js/';
$this->css_url = UM_URL . 'includes/admin/assets/css/';
$this->front_js_baseurl = um_url . 'assets/js/';
$this->front_css_baseurl = um_url . 'assets/css/';
$this->front_js_baseurl = UM_URL . 'assets/js/';
$this->front_css_baseurl = UM_URL . 'assets/css/';
$this->suffix = ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG || defined( 'UM_SCRIPT_DEBUG' ) ) ? '' : '.min';
@@ -98,22 +98,22 @@ if ( ! class_exists( 'um\admin\core\Admin_Enqueue' ) ) {
* Enqueue Gutenberg Block Editor assets
*/
public function block_editor() {
wp_register_style( 'um_ui', um_url . 'assets/css/jquery-ui.css', array(), ultimatemember_version );
wp_register_style( 'um_members', um_url . 'assets/css/um-members.css', array( 'um_ui' ), ultimatemember_version );
wp_register_style( 'um_ui', UM_URL . 'assets/css/jquery-ui.css', array(), UM_VERSION );
wp_register_style( 'um_members', UM_URL . 'assets/css/um-members.css', array( 'um_ui' ), UM_VERSION );
if ( is_rtl() ) {
wp_register_style( 'um_members_rtl', um_url . 'assets/css/um-members-rtl.css', array( 'um_members' ), ultimatemember_version );
wp_register_style( 'um_members_rtl', UM_URL . 'assets/css/um-members-rtl.css', array( 'um_members' ), UM_VERSION );
}
wp_register_style( 'um_styles', um_url . 'assets/css/um-styles.css', array(), ultimatemember_version );
wp_register_style( 'um_profile', um_url . 'assets/css/um-profile.css', array(), ultimatemember_version );
wp_register_style( 'um_crop', um_url . 'assets/css/um-crop.css', array(), ultimatemember_version );
wp_register_style( 'um_responsive', um_url . 'assets/css/um-responsive.css', array( 'um_profile', 'um_crop' ), ultimatemember_version );
wp_register_style( 'um_account', um_url . 'assets/css/um-account.css', array(), ultimatemember_version );
wp_register_style( 'um_default_css', um_url . 'assets/css/um-old-default.css', array(), ultimatemember_version );
wp_register_style( 'um_fonticons_fa', um_url . 'assets/css/um-fonticons-fa.css', array(), ultimatemember_version );
wp_register_style( 'select2', um_url . 'assets/css/select2/select2' . $this->suffix . '.css', array(), ultimatemember_version );
wp_register_style( 'um_fonticons_ii', um_url . 'assets/css/um-fonticons-ii.css', array(), ultimatemember_version );
wp_register_style( 'um_styles', UM_URL . 'assets/css/um-styles.css', array(), UM_VERSION );
wp_register_style( 'um_profile', UM_URL . 'assets/css/um-profile.css', array(), UM_VERSION );
wp_register_style( 'um_crop', UM_URL . 'assets/css/um-crop.css', array(), UM_VERSION );
wp_register_style( 'um_responsive', UM_URL . 'assets/css/um-responsive.css', array( 'um_profile', 'um_crop' ), UM_VERSION );
wp_register_style( 'um_account', UM_URL . 'assets/css/um-account.css', array(), UM_VERSION );
wp_register_style( 'um_default_css', UM_URL . 'assets/css/um-old-default.css', array(), UM_VERSION );
wp_register_style( 'um_fonticons_fa', UM_URL . 'assets/css/um-fonticons-fa.css', array(), UM_VERSION );
wp_register_style( 'select2', UM_URL . 'assets/css/select2/select2' . $this->suffix . '.css', array(), UM_VERSION );
wp_register_style( 'um_fonticons_ii', UM_URL . 'assets/css/um-fonticons-ii.css', array(), UM_VERSION );
wp_register_script( 'um_admin_blocks_shortcodes', um_url . 'assets/js/um-blocks' . $this->suffix . '.js', array( 'wp-i18n', 'wp-blocks', 'wp-components' ), ultimatemember_version, true );
wp_register_script( 'um_admin_blocks_shortcodes', UM_URL . 'assets/js/um-blocks' . $this->suffix . '.js', array( 'wp-i18n', 'wp-blocks', 'wp-components' ), UM_VERSION, true );
wp_set_script_translations( 'um_admin_blocks_shortcodes', 'ultimate-member' );
if ( ! empty( UM()->account()->get_tab_fields( 'notifications', array() ) ) ) {
@@ -149,12 +149,12 @@ if ( ! class_exists( 'um\admin\core\Admin_Enqueue' ) ) {
wp_enqueue_script( 'um_admin_blocks_shortcodes' );
wp_register_script( 'select2', um_url . 'assets/js/select2/select2.full' . $this->suffix . '.js', array( 'jquery', 'jquery-masonry' ), ultimatemember_version, true );
wp_register_script( 'um_datetime', um_url . 'assets/js/pickadate/picker.js', array( 'jquery' ), ultimatemember_version, true );
wp_register_script( 'um_datetime_date', um_url . 'assets/js/pickadate/picker.date.js', array( 'jquery', 'um_datetime' ), ultimatemember_version, true );
wp_register_script( 'um_datetime_time', um_url . 'assets/js/pickadate/picker.time.js', array( 'jquery', 'um_datetime' ), ultimatemember_version, true );
wp_register_script( 'um_conditional', um_url . 'assets/js/um-conditional' . $this->suffix . '.js', array( 'jquery', 'wp-hooks' ), ultimatemember_version, true );
wp_register_script( 'um_scripts', um_url . 'assets/js/um-scripts' . $this->suffix . '.js', array( 'jquery', 'wp-util', 'um_conditional', 'um_datetime', 'um_datetime_date', 'um_datetime_time', 'select2' ), ultimatemember_version, true );
wp_register_script( 'select2', UM_URL . 'assets/js/select2/select2.full' . $this->suffix . '.js', array( 'jquery', 'jquery-masonry' ), UM_VERSION, true );
wp_register_script( 'um_datetime', UM_URL . 'assets/js/pickadate/picker.js', array( 'jquery' ), UM_VERSION, true );
wp_register_script( 'um_datetime_date', UM_URL . 'assets/js/pickadate/picker.date.js', array( 'jquery', 'um_datetime' ), UM_VERSION, true );
wp_register_script( 'um_datetime_time', UM_URL . 'assets/js/pickadate/picker.time.js', array( 'jquery', 'um_datetime' ), UM_VERSION, true );
wp_register_script( 'um_conditional', UM_URL . 'assets/js/um-conditional' . $this->suffix . '.js', array( 'jquery', 'wp-hooks' ), UM_VERSION, true );
wp_register_script( 'um_scripts', UM_URL . 'assets/js/um-scripts' . $this->suffix . '.js', array( 'jquery', 'wp-util', 'um_conditional', 'um_datetime', 'um_datetime_date', 'um_datetime_time', 'select2' ), UM_VERSION, true );
$max_upload_size = wp_max_upload_size();
if ( ! $max_upload_size ) {
$max_upload_size = 0;
@@ -169,14 +169,14 @@ if ( ! class_exists( 'um\admin\core\Admin_Enqueue' ) ) {
);
wp_localize_script( 'um_scripts', 'um_scripts', $localize_data );
wp_register_script( 'um_dropdown', um_url . 'assets/js/dropdown' . $this->suffix . '.js', array( 'jquery' ), ultimatemember_version, true );
wp_register_script( 'um_members', um_url . 'assets/js/um-members' . $this->suffix . '.js', array( 'jquery', 'wp-util', 'jquery-ui-slider', 'um_dropdown', 'wp-hooks', 'jquery-masonry', 'um_scripts' ), ultimatemember_version, true );
wp_register_script( 'um_dropdown', UM_URL . 'assets/js/dropdown' . $this->suffix . '.js', array( 'jquery' ), UM_VERSION, true );
wp_register_script( 'um_members', UM_URL . 'assets/js/um-members' . $this->suffix . '.js', array( 'jquery', 'wp-util', 'jquery-ui-slider', 'um_dropdown', 'wp-hooks', 'jquery-masonry', 'um_scripts' ), UM_VERSION, true );
wp_register_script( 'um_account', um_url . 'assets/js/um-account' . $this->suffix . '.js', array( 'jquery', 'wp-hooks' ), ultimatemember_version, true );
wp_register_script( 'um_scrollbar', um_url . 'assets/js/simplebar' . $this->suffix . '.js', array( 'jquery' ), ultimatemember_version, true );
wp_register_script( 'um_crop', um_url . 'assets/js/um-crop' . $this->suffix . '.js', array( 'jquery' ), ultimatemember_version, true );
wp_register_script( 'um_functions', um_url . 'assets/js/um-functions' . $this->suffix . '.js', array( 'jquery', 'jquery-masonry', 'wp-util', 'um_scrollbar' ), ultimatemember_version, true );
wp_register_script( 'um_responsive', um_url . 'assets/js/um-responsive' . $this->suffix . '.js', array( 'jquery', 'um_functions', 'um_crop' ), ultimatemember_version, true );
wp_register_script( 'um_account', UM_URL . 'assets/js/um-account' . $this->suffix . '.js', array( 'jquery', 'wp-hooks' ), UM_VERSION, true );
wp_register_script( 'um_scrollbar', UM_URL . 'assets/js/simplebar' . $this->suffix . '.js', array( 'jquery' ), UM_VERSION, true );
wp_register_script( 'um_crop', UM_URL . 'assets/js/um-crop' . $this->suffix . '.js', array( 'jquery' ), UM_VERSION, true );
wp_register_script( 'um_functions', UM_URL . 'assets/js/um-functions' . $this->suffix . '.js', array( 'jquery', 'jquery-masonry', 'wp-util', 'um_scrollbar' ), UM_VERSION, true );
wp_register_script( 'um_responsive', UM_URL . 'assets/js/um-responsive' . $this->suffix . '.js', array( 'jquery', 'um_functions', 'um_crop' ), UM_VERSION, true );
// render blocks
wp_enqueue_script( 'um_datetime' );
@@ -239,33 +239,33 @@ if ( ! class_exists( 'um\admin\core\Admin_Enqueue' ) ) {
}
wp_register_script( 'select2', $this->front_js_baseurl . 'select2/select2.full' . $this->suffix . '.js', array( 'jquery', 'jquery-masonry' ), '4.0.13', true );
wp_register_script( 'um_jquery_form', $this->front_js_baseurl . 'um-jquery-form' . $this->suffix . '.js', array( 'jquery' ), ultimatemember_version, true );
wp_register_script( 'um_fileupload', $this->front_js_baseurl . 'um-fileupload.js', array( 'jquery' ), ultimatemember_version, true );
wp_register_script( 'um_crop', $this->front_js_baseurl . 'um-crop' . $this->suffix . '.js', array( 'jquery' ), ultimatemember_version, true );
wp_register_script( 'um_tipsy', $this->front_js_baseurl . 'um-tipsy' . $this->suffix . '.js', array( 'jquery' ), ultimatemember_version, true );
wp_register_script( 'um_functions', $this->front_js_baseurl . 'um-functions' . $this->suffix . '.js', array( 'jquery', 'um_tipsy', 'um_scrollbar' ), ultimatemember_version, true );
wp_register_script( 'um_jquery_form', $this->front_js_baseurl . 'um-jquery-form' . $this->suffix . '.js', array( 'jquery' ), UM_VERSION, true );
wp_register_script( 'um_fileupload', $this->front_js_baseurl . 'um-fileupload.js', array( 'jquery' ), UM_VERSION, true );
wp_register_script( 'um_crop', $this->front_js_baseurl . 'um-crop' . $this->suffix . '.js', array( 'jquery' ), UM_VERSION, true );
wp_register_script( 'um_tipsy', $this->front_js_baseurl . 'um-tipsy' . $this->suffix . '.js', array( 'jquery' ), UM_VERSION, true );
wp_register_script( 'um_functions', $this->front_js_baseurl . 'um-functions' . $this->suffix . '.js', array( 'jquery', 'um_tipsy', 'um_scrollbar' ), UM_VERSION, true );
wp_register_script( 'um_datetime', $this->front_js_baseurl . 'pickadate/picker.js', array( 'jquery' ), ultimatemember_version, true );
wp_register_script( 'um_datetime_date', $this->front_js_baseurl . 'pickadate/picker.date.js', array( 'jquery', 'um_datetime' ), ultimatemember_version, true );
wp_register_script( 'um_datetime_time', $this->front_js_baseurl . 'pickadate/picker.time.js', array( 'jquery', 'um_datetime' ), ultimatemember_version, true );
//wp_register_script( 'um_datetime_legacy', $this->front_js_baseurl . 'pickadate/legacy.js', array( 'jquery', 'um_datetime' ), ultimatemember_version, true );
wp_register_script( 'um_datetime', $this->front_js_baseurl . 'pickadate/picker.js', array( 'jquery' ), UM_VERSION, true );
wp_register_script( 'um_datetime_date', $this->front_js_baseurl . 'pickadate/picker.date.js', array( 'jquery', 'um_datetime' ), UM_VERSION, true );
wp_register_script( 'um_datetime_time', $this->front_js_baseurl . 'pickadate/picker.time.js', array( 'jquery', 'um_datetime' ), UM_VERSION, true );
//wp_register_script( 'um_datetime_legacy', $this->front_js_baseurl . 'pickadate/legacy.js', array( 'jquery', 'um_datetime' ), UM_VERSION, true );
// load a localized version for date/time
$locale = get_locale();
if ( $locale ) {
if ( file_exists( WP_LANG_DIR . '/plugins/ultimate-member/assets/js/pickadate/' . $locale . '.js' ) ) {
wp_register_script( 'um_datetime_locale', content_url() . '/languages/plugins/ultimate-member/assets/js/pickadate/' . $locale . '.js', array( 'jquery', 'um_datetime' ), ultimatemember_version, true );
} elseif ( file_exists( um_path . 'assets/js/pickadate/translations/' . $locale . '.js' ) ) {
wp_register_script( 'um_datetime_locale', um_url . 'assets/js/pickadate/translations/' . $locale . '.js', array( 'jquery', 'um_datetime' ), ultimatemember_version, true );
wp_register_script( 'um_datetime_locale', content_url() . '/languages/plugins/ultimate-member/assets/js/pickadate/' . $locale . '.js', array( 'jquery', 'um_datetime' ), UM_VERSION, true );
} elseif ( file_exists( UM_PATH . 'assets/js/pickadate/translations/' . $locale . '.js' ) ) {
wp_register_script( 'um_datetime_locale', UM_URL . 'assets/js/pickadate/translations/' . $locale . '.js', array( 'jquery', 'um_datetime' ), UM_VERSION, true );
}
}
wp_register_script( 'um_scripts', $this->front_js_baseurl . 'um-scripts' . $this->suffix . '.js', array( 'um_functions', 'um_crop', 'um_raty', 'select2', 'um_jquery_form', 'um_fileupload', 'um_datetime', 'um_datetime_date', 'um_datetime_time'/*, 'um_datetime_legacy'*/ ), ultimatemember_version, true );
wp_register_script( 'um_responsive', $this->front_js_baseurl . 'um-responsive' . $this->suffix . '.js', array( 'um_scripts' ), ultimatemember_version, true );
wp_register_script( 'um_modal', $this->front_js_baseurl . 'um-modal' . $this->suffix . '.js', array( 'um_responsive' ), ultimatemember_version, true );
wp_register_script( 'um_scripts', $this->front_js_baseurl . 'um-scripts' . $this->suffix . '.js', array( 'um_functions', 'um_crop', 'um_raty', 'select2', 'um_jquery_form', 'um_fileupload', 'um_datetime', 'um_datetime_date', 'um_datetime_time'/*, 'um_datetime_legacy'*/ ), UM_VERSION, true );
wp_register_script( 'um_responsive', $this->front_js_baseurl . 'um-responsive' . $this->suffix . '.js', array( 'um_scripts' ), UM_VERSION, true );
wp_register_script( 'um_modal', $this->front_js_baseurl . 'um-modal' . $this->suffix . '.js', array( 'um_responsive' ), UM_VERSION, true );
wp_register_style( 'select2', $this->front_css_baseurl . 'select2/select2' . $this->suffix . '.css', array(), '4.0.13' );
wp_register_style( 'um_datetime', $this->front_css_baseurl . 'pickadate/default.css', array(), ultimatemember_version );
wp_register_style( 'um_datetime_date', $this->front_css_baseurl . 'pickadate/default.date.css', array( 'um_datetime' ), ultimatemember_version );
wp_register_style( 'um_datetime', $this->front_css_baseurl . 'pickadate/default.css', array(), UM_VERSION );
wp_register_style( 'um_datetime_date', $this->front_css_baseurl . 'pickadate/default.date.css', array( 'um_datetime' ), UM_VERSION );
wp_register_style( 'um_datetime_time', $this->front_css_baseurl . 'pickadate/default.time.css', array( 'um_datetime' ), ultimatemember_version );
wp_register_style( 'um_scrollbar', $this->front_css_baseurl . 'simplebar.css', array(), ultimatemember_version );
@@ -485,8 +485,8 @@ if ( ! class_exists( 'um\admin\core\Admin_Enqueue' ) ) {
* Load functions js
*/
public function load_functions() {
wp_register_script( 'um_scrollbar', um_url . 'assets/js/simplebar.js', array( 'jquery' ), ultimatemember_version, true );
wp_register_script( 'um_functions', um_url . 'assets/js/um-functions.js', array( 'jquery', 'jquery-masonry', 'wp-util', 'um_scrollbar' ), ultimatemember_version, true );
wp_register_script( 'um_scrollbar', UM_URL . 'assets/js/simplebar.js', array( 'jquery' ), ultimatemember_version, true );
wp_register_script( 'um_functions', UM_URL . 'assets/js/um-functions.js', array( 'jquery', 'jquery-masonry', 'wp-util', 'um_scrollbar' ), ultimatemember_version, true );
wp_enqueue_script( 'um_functions' );
}
@@ -495,10 +495,10 @@ if ( ! class_exists( 'um\admin\core\Admin_Enqueue' ) ) {
* Load Fonticons
*/
public function load_fonticons() {
wp_register_style( 'um_fonticons_ii', um_url . 'assets/css/um-fonticons-ii.css', array(), ultimatemember_version );
wp_register_style( 'um_fonticons_ii', UM_URL . 'assets/css/um-fonticons-ii.css', array(), ultimatemember_version );
wp_enqueue_style( 'um_fonticons_ii' );
wp_register_style( 'um_fonticons_fa', um_url . 'assets/css/um-fonticons-fa.css', array(), ultimatemember_version );
wp_register_style( 'um_fonticons_fa', UM_URL . 'assets/css/um-fonticons-fa.css', array(), ultimatemember_version );
wp_enqueue_style( 'um_fonticons_fa' );
}
@@ -528,8 +528,8 @@ if ( ! class_exists( 'um\admin\core\Admin_Enqueue' ) ) {
if ( $locale ) {
if ( file_exists( WP_LANG_DIR . '/plugins/ultimate-member/assets/js/pickadate/' . $locale . '.js' ) ) {
wp_register_script( 'um_datetime_locale', content_url() . '/languages/plugins/ultimate-member/assets/js/pickadate/' . $locale . '.js', array( 'jquery', 'um_datetime' ), ultimatemember_version, true );
} elseif ( file_exists( um_path . 'assets/js/pickadate/translations/' . $locale . '.js' ) ) {
wp_register_script( 'um_datetime_locale', um_url . 'assets/js/pickadate/translations/' . $locale . '.js', array( 'jquery', 'um_datetime' ), ultimatemember_version, true );
} elseif ( file_exists( UM_PATH . 'assets/js/pickadate/translations/' . $locale . '.js' ) ) {
wp_register_script( 'um_datetime_locale', UM_URL . 'assets/js/pickadate/translations/' . $locale . '.js', array( 'jquery', 'um_datetime' ), ultimatemember_version, true );
}
}
@@ -694,10 +694,10 @@ if ( ! class_exists( 'um\admin\core\Admin_Enqueue' ) ) {
UM()->enqueue()->load_modal();
UM()->enqueue()->load_responsive();
wp_register_script( 'um_raty', um_url . 'assets/js/um-raty' . UM()->enqueue()->suffix . '.js', array( 'jquery', 'wp-i18n' ), ultimatemember_version, true );
wp_register_style( 'um_raty', um_url . 'assets/css/um-raty.css', array(), ultimatemember_version );
wp_register_script( 'um_raty', UM_URL . 'assets/js/um-raty' . UM()->enqueue()->suffix . '.js', array( 'jquery', 'wp-i18n' ), ultimatemember_version, true );
wp_register_style( 'um_raty', UM_URL . 'assets/css/um-raty.css', array(), ultimatemember_version );
wp_register_style( 'um_default_css', um_url . 'assets/css/um-old-default.css', '', ultimatemember_version, 'all' );
wp_register_style( 'um_default_css', UM_URL . 'assets/css/um-old-default.css', '', ultimatemember_version, 'all' );
wp_enqueue_style( 'um_default_css' );
if ( is_rtl() ) {
+4 -4
View File
@@ -137,7 +137,7 @@ if ( ! class_exists( 'um\admin\core\Admin_GDPR' ) ) {
*/
function plugin_add_suggested_privacy_content() {
$content = $this->plugin_get_default_privacy_content();
wp_add_privacy_policy_content( ultimatemember_plugin_name, $content );
wp_add_privacy_policy_content( UM_PLUGIN_NAME, $content );
}
@@ -152,7 +152,7 @@ if ( ! class_exists( 'um\admin\core\Admin_GDPR' ) ) {
*/
function plugin_register_exporters( $exporters ) {
$exporters[] = array(
'exporter_friendly_name' => ultimatemember_plugin_name,
'exporter_friendly_name' => UM_PLUGIN_NAME,
'callback' => array( &$this, 'data_exporter' )
);
return $exporters;
@@ -222,7 +222,7 @@ if ( ! class_exists( 'um\admin\core\Admin_GDPR' ) ) {
// If you define your own group, the first exporter to
// include a label will be used as the group label in the
// final exported report
$group_label = ultimatemember_plugin_name;
$group_label = UM_PLUGIN_NAME;
// Plugins can add as many items in the item data array as they want
//$data = array();
@@ -257,7 +257,7 @@ if ( ! class_exists( 'um\admin\core\Admin_GDPR' ) ) {
*/
function plugin_register_erasers( $erasers = array() ) {
$erasers[] = array(
'eraser_friendly_name' => ultimatemember_plugin_name,
'eraser_friendly_name' => UM_PLUGIN_NAME,
'callback' => array( &$this, 'data_eraser' )
);
return $erasers;
+3 -3
View File
@@ -192,9 +192,9 @@ if ( ! class_exists( 'um\admin\core\Admin_Menu' ) ) {
*/
function um_roles_pages() {
if ( empty( $_GET['tab'] ) ) {
include_once um_path . 'includes/admin/core/list-tables/roles-list-table.php';
include_once UM_PATH . 'includes/admin/core/list-tables/roles-list-table.php';
} elseif ( 'add' === sanitize_key( $_GET['tab'] ) || 'edit' === sanitize_key( $_GET['tab'] ) ) {
include_once um_path . 'includes/admin/templates/role/role-edit.php';
include_once UM_PATH . 'includes/admin/templates/role/role-edit.php';
} else {
um_js_redirect( add_query_arg( array( 'page' => 'um_roles' ), get_admin_url( 'admin.php' ) ) );
}
@@ -301,7 +301,7 @@ if ( ! class_exists( 'um\admin\core\Admin_Menu' ) ) {
<div id="um-metaboxes-general" class="wrap">
<h1>Ultimate Member <sup><?php echo ultimatemember_version; ?></sup></h1>
<h1>Ultimate Member <sup><?php echo UM_VERSION; ?></sup></h1>
<?php wp_nonce_field( 'um-metaboxes-general' ); ?>
<?php wp_nonce_field( 'closedpostboxes', 'closedpostboxesnonce', false ); ?>
+7 -7
View File
@@ -710,7 +710,7 @@ if ( ! class_exists( 'um\admin\core\Admin_Metabox' ) ) {
$path = $matches[0];
$box['id'] = preg_replace('~(\\{[^}]+\\})~','', $box['id'] );
} else {
$path = um_path;
$path = UM_PATH;
}
$path = str_replace('{','', $path );
@@ -746,7 +746,7 @@ if ( ! class_exists( 'um\admin\core\Admin_Metabox' ) ) {
$path = $matches[0];
$box['id'] = preg_replace('~(\\{[^}]+\\})~','', $box['id'] );
} else {
$path = um_path;
$path = UM_PATH;
}
$path = str_replace('{','', $path );
@@ -778,7 +778,7 @@ if ( ! class_exists( 'um\admin\core\Admin_Metabox' ) ) {
$path = $matches[0];
$box['id'] = preg_replace('~(\\{[^}]+\\})~','', $box['id'] );
} else {
$path = um_path;
$path = UM_PATH;
}
$path = str_replace('{','', $path );
@@ -810,7 +810,7 @@ if ( ! class_exists( 'um\admin\core\Admin_Metabox' ) ) {
$path = $matches[0];
$box['id'] = preg_replace('~(\\{[^}]+\\})~','', $box['id'] );
} else {
$path = um_path;
$path = UM_PATH;
}
$path = str_replace('{','', $path );
@@ -1229,17 +1229,17 @@ if ( ! class_exists( 'um\admin\core\Admin_Metabox' ) ) {
$screen = get_current_screen();
if ( isset( $screen->id ) && strstr( $screen->id, 'um_form' ) ) {
foreach ( glob( um_path . 'includes/admin/templates/modal/forms/*.php' ) as $modal_content ) {
foreach ( glob( UM_PATH . 'includes/admin/templates/modal/forms/*.php' ) as $modal_content ) {
include_once $modal_content;
}
}
if ( $this->init_icon ) {
include_once um_path . 'includes/admin/templates/modal/forms/fonticons.php';
include_once UM_PATH . 'includes/admin/templates/modal/forms/fonticons.php';
}
if ( 'users' === $screen->id ) {
include_once um_path . 'includes/admin/templates/modal/dynamic_registration_preview.php';
include_once UM_PATH . 'includes/admin/templates/modal/dynamic_registration_preview.php';
}
// needed on forms only
+11 -11
View File
@@ -365,7 +365,7 @@ if ( ! class_exists( 'um\admin\core\Admin_Notices' ) ) {
array(
'class' => 'error',
// translators: %1$s is a plugin name; %2$s is a plugin version; %3$s is a plugin name; %4$s is a doc link.
'message' => '<p>' . sprintf( __( '<strong>%1$s %2$s</strong> requires 2.0 extensions. You have pre 2.0 extensions installed on your site. <br /> Please update %3$s extensions to latest versions. For more info see this <a href="%4$s" target="_blank">doc</a>.', 'ultimate-member' ), ultimatemember_plugin_name, ultimatemember_version, ultimatemember_plugin_name, 'https://docs.ultimatemember.com/article/201-how-to-update-your-site' ) . '</p>',
'message' => '<p>' . sprintf( __( '<strong>%1$s %2$s</strong> requires 2.0 extensions. You have pre 2.0 extensions installed on your site. <br /> Please update %3$s extensions to latest versions. For more info see this <a href="%4$s" target="_blank">doc</a>.', 'ultimate-member' ), UM_PLUGIN_NAME, UM_VERSION, UM_PLUGIN_NAME, 'https://docs.ultimatemember.com/article/201-how-to-update-your-site' ) . '</p>',
),
0
);
@@ -396,7 +396,7 @@ if ( ! class_exists( 'um\admin\core\Admin_Notices' ) ) {
<p>
<?php
// translators: %s: Plugin name.
echo wp_kses( sprintf( __( '%s needs to create several pages (User Profiles, Account, Registration, Login, Password Reset, Logout, Member Directory) to function correctly.', 'ultimate-member' ), ultimatemember_plugin_name ), UM()->get_allowed_html( 'admin_notice' ) );
echo wp_kses( sprintf( __( '%s needs to create several pages (User Profiles, Account, Registration, Login, Password Reset, Logout, Member Directory) to function correctly.', 'ultimate-member' ), UM_PLUGIN_NAME ), UM()->get_allowed_html( 'admin_notice' ) );
?>
</p>
@@ -569,7 +569,7 @@ if ( ! class_exists( 'um\admin\core\Admin_Notices' ) ) {
function check_wrong_install_folder() {
$invalid_folder = false;
$slug_array = explode( '/', um_plugin );
$slug_array = explode( '/', UM_PLUGIN );
if ( $slug_array[0] != 'ultimate-member' ) {
$invalid_folder = true;
}
@@ -580,7 +580,7 @@ if ( ! class_exists( 'um\admin\core\Admin_Notices' ) ) {
array(
'class' => 'error',
// translators: %s: Plugin name.
'message' => '<p>' . sprintf( __( 'You have installed <strong>%s</strong> with wrong folder name. Correct folder name is <strong>"ultimate-member"</strong>.', 'ultimate-member' ), ultimatemember_plugin_name ) . '</p>',
'message' => '<p>' . sprintf( __( 'You have installed <strong>%s</strong> with wrong folder name. Correct folder name is <strong>"ultimate-member"</strong>.', 'ultimate-member' ), UM_PLUGIN_NAME ) . '</p>',
),
1
);
@@ -615,7 +615,7 @@ if ( ! class_exists( 'um\admin\core\Admin_Notices' ) ) {
array(
'class' => 'error',
// translators: %1$s is a inactive license number; %2$s is a plugin name; %3$s is a store link.
'message' => '<p>' . sprintf( __( 'There are %1$s inactive %2$s license keys for this site. This site is not authorized to get plugin updates. You can active this site on <a href="%3$s">www.ultimatemember.com</a>.', 'ultimate-member' ), count( $arr_inactive_license_keys ), ultimatemember_plugin_name, UM()->store_url ) . '</p>',
'message' => '<p>' . sprintf( __( 'There are %1$s inactive %2$s license keys for this site. This site is not authorized to get plugin updates. You can active this site on <a href="%3$s">www.ultimatemember.com</a>.', 'ultimate-member' ), count( $arr_inactive_license_keys ), UM_PLUGIN_NAME, UM()->store_url ) . '</p>',
),
3
);
@@ -627,7 +627,7 @@ if ( ! class_exists( 'um\admin\core\Admin_Notices' ) ) {
array(
'class' => 'error',
// translators: %1$s is a invalid license; %2$s is a plugin name; %3$s is a license link.
'message' => '<p>' . sprintf( __( 'You have %1$s invalid or expired license keys for %2$s. Please go to the <a href="%3$s">Licenses page</a> to correct this issue.', 'ultimate-member' ), $invalid_license, ultimatemember_plugin_name, add_query_arg( array( 'page' => 'um_options', 'tab' => 'licenses' ), admin_url( 'admin.php' ) ) ) . '</p>',
'message' => '<p>' . sprintf( __( 'You have %1$s invalid or expired license keys for %2$s. Please go to the <a href="%3$s">Licenses page</a> to correct this issue.', 'ultimate-member' ), $invalid_license, UM_PLUGIN_NAME, add_query_arg( array( 'page' => 'um_options', 'tab' => 'licenses' ), admin_url( 'admin.php' ) ) ) . '</p>',
),
3
);
@@ -645,7 +645,7 @@ if ( ! class_exists( 'um\admin\core\Admin_Notices' ) ) {
<p>
<?php
// translators: %1$s is a plugin name; %2$s is a plugin version; %3$s is a plugin name; %4$s is a plugin version; %5$s is a upgrade link.
echo wp_kses( sprintf( __( '<strong>%1$s version %2$s</strong> needs to be updated to work correctly.<br />It is necessary to update the structure of the database and options that are associated with <strong>%3$s %4$s</strong>.<br />Please visit <a href="%5$s">"Upgrade"</a> page and run the upgrade process.', 'ultimate-member' ), ultimatemember_plugin_name, ultimatemember_version, ultimatemember_plugin_name, ultimatemember_version, $url ), UM()->get_allowed_html( 'admin_notice' ) );
echo wp_kses( sprintf( __( '<strong>%1$s version %2$s</strong> needs to be updated to work correctly.<br />It is necessary to update the structure of the database and options that are associated with <strong>%3$s %4$s</strong>.<br />Please visit <a href="%5$s">"Upgrade"</a> page and run the upgrade process.', 'ultimate-member' ), UM_PLUGIN_NAME, UM_VERSION, UM_PLUGIN_NAME, UM_VERSION, $url ), UM()->get_allowed_html( 'admin_notice' ) );
?>
</p>
@@ -673,7 +673,7 @@ if ( ! class_exists( 'um\admin\core\Admin_Notices' ) ) {
array(
'class' => 'updated',
// translators: %1$s is a plugin name title; %2$s is a plugin version.
'message' => '<p>' . sprintf( __( '<strong>%1$s %2$s</strong> Successfully Upgraded', 'ultimate-member' ), ultimatemember_plugin_name, ultimatemember_version ) . '</p>',
'message' => '<p>' . sprintf( __( '<strong>%1$s %2$s</strong> Successfully Upgraded', 'ultimate-member' ), UM_PLUGIN_NAME, UM_VERSION ) . '</p>',
),
4
);
@@ -704,7 +704,7 @@ if ( ! class_exists( 'um\admin\core\Admin_Notices' ) ) {
<p>
<?php
// translators: %s: plugin name.
echo wp_kses( sprintf( __( 'Hey there! It\'s been one month since you installed %s. How have you found the plugin so far?', 'ultimate-member' ), ultimatemember_plugin_name ), UM()->get_allowed_html( 'admin_notice' ) );
echo wp_kses( sprintf( __( 'Hey there! It\'s been one month since you installed %s. How have you found the plugin so far?', 'ultimate-member' ), UM_PLUGIN_NAME ), UM()->get_allowed_html( 'admin_notice' ) );
?>
</p>
<p>
@@ -715,7 +715,7 @@ if ( ! class_exists( 'um\admin\core\Admin_Notices' ) ) {
</div>
<div class="um_hidden_notice" data-key="love">
<p>
<?php printf( __( 'Great! We\'re happy to hear that you love the plugin. It would be amazing if you could let others know why you like %s by leaving a review of the plugin. This will help %s to grow and become more popular and would be massively appreciated by us!' ), ultimatemember_plugin_name, ultimatemember_plugin_name ); ?>
<?php printf( __( 'Great! We\'re happy to hear that you love the plugin. It would be amazing if you could let others know why you like %s by leaving a review of the plugin. This will help %s to grow and become more popular and would be massively appreciated by us!' ), UM_PLUGIN_NAME, UM_PLUGIN_NAME ); ?>
</p>
<p>
@@ -761,7 +761,7 @@ if ( ! class_exists( 'um\admin\core\Admin_Notices' ) ) {
<p>
<?php
// translators: %1$s is a plugin name; %2$s is a #.
echo wp_kses( sprintf( __( '<strong>%1$s</strong> future plans! Detailed future list is <a href="%2$s" target="_blank">here</a>', 'ultimate-member' ), ultimatemember_plugin_name, '#' ), UM()->get_allowed_html( 'admin_notice' ) );
echo wp_kses( sprintf( __( '<strong>%1$s</strong> future plans! Detailed future list is <a href="%2$s" target="_blank">here</a>', 'ultimate-member' ), UM_PLUGIN_NAME, '#' ), UM()->get_allowed_html( 'admin_notice' ) );
?>
</p>
+7 -7
View File
@@ -1474,7 +1474,7 @@ if ( ! class_exists( 'um\admin\core\Admin_Settings' ) ) {
'tooltip' => __( 'You can change the default profile picture globally here. Please make sure that the photo is 300x300px.', 'ultimate-member' ),
'upload_frame_title' => __( 'Select Default Profile Photo', 'ultimate-member' ),
'default' => array(
'url' => um_url . 'assets/img/default_avatar.jpg',
'url' => UM_URL . 'assets/img/default_avatar.jpg',
),
),
array(
@@ -2660,7 +2660,7 @@ if ( ! class_exists( 'um\admin\core\Admin_Settings' ) ) {
$emails = UM()->config()->email_notifications;
if ( empty( $email_key ) || empty( $emails[ $email_key ] ) ) {
include_once um_path . 'includes/admin/core/list-tables/emails-list-table.php';
include_once UM_PATH . 'includes/admin/core/list-tables/emails-list-table.php';
}
}
@@ -3121,7 +3121,7 @@ if ( ! class_exists( 'um\admin\core\Admin_Settings' ) ) {
</p>
<?php
include_once um_path . 'includes/admin/core/list-tables/version-template-list-table.php';
include_once UM_PATH . 'includes/admin/core/list-tables/version-template-list-table.php';
}
@@ -3132,7 +3132,7 @@ if ( ! class_exists( 'um\admin\core\Admin_Settings' ) ) {
*/
public function get_override_templates( $get_list = false ) {
$outdated_files = array();
$scan_files['um'] = $this->scan_template_files( um_path . '/templates/' );
$scan_files['um'] = $this->scan_template_files( UM_PATH . '/templates/' );
/**
* Filters an array of the template files for scanning versions.
*
@@ -3199,8 +3199,8 @@ if ( ! class_exists( 'um\admin\core\Admin_Settings' ) ) {
$core_path = $located['core'];
$core_file_path = stristr( $core_path, 'wp-content' );
} else {
$core_path = um_path . '/templates/' . $core_file;
$core_file_path = stristr( um_path . 'templates/' . $core_file, 'wp-content' );
$core_path = UM_PATH . '/templates/' . $core_file;
$core_file_path = stristr( UM_PATH . 'templates/' . $core_file, 'wp-content' );
}
$core_version = $this->get_file_version( $core_path );
$theme_version = $this->get_file_version( $theme_file );
@@ -3312,7 +3312,7 @@ if ( ! class_exists( 'um\admin\core\Admin_Settings' ) ) {
global $wpdb;
if ( ! class_exists( '\Browser' ) )
require_once um_path . 'includes/lib/browser.php';
require_once UM_PATH . 'includes/lib/browser.php';
// Detect browser
$browser = new \Browser();
+5 -5
View File
@@ -69,7 +69,7 @@ if ( ! class_exists( 'um\admin\core\Admin_Upgrade' ) ) {
add_action( 'wp_loaded', array( $this, 'initialize_upgrade_packages' ), 0 );
}
add_action( 'in_plugin_update_message-' . um_plugin, array( $this, 'in_plugin_update_message' ) );
add_action( 'in_plugin_update_message-' . UM_PLUGIN, array( $this, 'in_plugin_update_message' ) );
}
/**
@@ -92,7 +92,7 @@ if ( ! class_exists( 'um\admin\core\Admin_Upgrade' ) ) {
function in_plugin_update_message( $args ) {
$show_additional_notice = false;
if ( isset( $args['new_version'] ) ) {
$old_version_array = explode( '.', ultimatemember_version );
$old_version_array = explode( '.', UM_VERSION );
$new_version_array = explode( '.', $args['new_version'] );
if ( $old_version_array[0] < $new_version_array[0] ) {
@@ -175,7 +175,7 @@ if ( ! class_exists( 'um\admin\core\Admin_Upgrade' ) ) {
$all_packages = $this->get_packages();
foreach ( $all_packages as $package ) {
if ( version_compare( $um_last_version_upgrade, $package, '<' ) && version_compare( $package, ultimatemember_version, '<=' ) ) {
if ( version_compare( $um_last_version_upgrade, $package, '<' ) && version_compare( $package, UM_VERSION, '<=' ) ) {
$diff_packages[] = $package;
}
}
@@ -257,13 +257,13 @@ if ( ! class_exists( 'um\admin\core\Admin_Upgrade' ) ) {
<h2>
<?php
// translators: %s: plugin name.
echo wp_kses( sprintf( __( '%s - Upgrade Process', 'ultimate-member' ), ultimatemember_plugin_name ), UM()->get_allowed_html( 'admin_notice' ) );
echo wp_kses( sprintf( __( '%s - Upgrade Process', 'ultimate-member' ), UM_PLUGIN_NAME ), UM()->get_allowed_html( 'admin_notice' ) );
?>
</h2>
<p>
<?php
// translators: %1$s is a plugin version; %2$s is a last version upgrade.
echo wp_kses( sprintf( __( 'You have installed <strong>%1$s</strong> version. Your latest DB version is <strong>%2$s</strong>. We recommend creating a backup of your site before running the update process. Do not exit the page before the update process has complete.', 'ultimate-member' ), ultimatemember_version, $um_last_version_upgrade ), UM()->get_allowed_html( 'admin_notice' ) );
echo wp_kses( sprintf( __( 'You have installed <strong>%1$s</strong> version. Your latest DB version is <strong>%2$s</strong>. We recommend creating a backup of your site before running the update process. Do not exit the page before the update process has complete.', 'ultimate-member' ), UM_VERSION, $um_last_version_upgrade ), UM()->get_allowed_html( 'admin_notice' ) );
?>
</p>
<p><?php _e( 'After clicking the <strong>"Run"</strong> button, the update process will start. All information will be displayed in the <strong>"Upgrade Log"</strong> field.', 'ultimate-member' ); ?></p>
@@ -50,7 +50,7 @@ function um_upgrade20beta1_get_template_file( $location, $template_name, $html =
$template_path = trailingslashit( get_stylesheet_directory() . '/ultimate-member/email' . $blog_id ). $template_name_file . $ext;
break;
case 'plugin':
$path = ! empty( UM()->mail()->path_by_slug[ $template_name ] ) ? UM()->mail()->path_by_slug[ $template_name ] : um_path . 'templates/email';
$path = ! empty( UM()->mail()->path_by_slug[ $template_name ] ) ? UM()->mail()->path_by_slug[ $template_name ] : UM_PATH . 'templates/email';
$template_path = trailingslashit( $path ) . $template_name . $ext;
break;
}
@@ -194,4 +194,4 @@ if ( is_multisite() ) {
restore_current_blog();
} else {
um_upgrade20beta1_email_templates_process();
}
}
+2 -2
View File
@@ -232,7 +232,7 @@ $free['terms-conditions'] = array(
<div class="plugin-card">
<div class="plugin-image-wrapper">
<a href="<?php echo esc_url( $info['url'] ); ?>" class="plugin-image<?php if ( false !== strpos( $info['img'], '.svg' ) ) { ?> svg-image<?php } ?>">
<img id="<?php echo esc_attr( 'um_' . $key . '_image' ); ?>" src="<?php echo esc_url( um_url . 'assets/img/extensions/' . $info['img'] ); ?>" alt="<?php echo esc_attr( $info['name'] ) ?>" />
<img id="<?php echo esc_attr( 'um_' . $key . '_image' ); ?>" src="<?php echo esc_url( UM_URL . 'assets/img/extensions/' . $info['img'] ); ?>" alt="<?php echo esc_attr( $info['name'] ) ?>" />
</a>
</div>
<div class="plugin-card-top">
@@ -261,7 +261,7 @@ $free['terms-conditions'] = array(
<div class="plugin-card">
<div class="plugin-image-wrapper">
<a href="<?php echo esc_url( $info['url'] ); ?>" class="plugin-image<?php if ( false !== strpos( $info['img'], '.svg' ) ) { ?> svg-image<?php } ?>">
<img id="<?php echo esc_attr( 'um_' . $key . '_image' ); ?>" src="<?php echo esc_url( um_url . 'assets/img/extensions/' . $info['img'] ); ?>" alt="<?php echo esc_attr( $info['name'] ) ?>" />
<img id="<?php echo esc_attr( 'um_' . $key . '_image' ); ?>" src="<?php echo esc_url( UM_URL . 'assets/img/extensions/' . $info['img'] ); ?>" alt="<?php echo esc_attr( $info['name'] ) ?>" />
</a>
</div>
<div class="plugin-card-top">
+2 -2
View File
@@ -9,7 +9,7 @@
<p>
<?php
// translators: %s: plugin name.
echo wp_kses( sprintf( __( '%s provides you with forms for user registration, login and profiles.', 'ultimate-member' ), ultimatemember_plugin_name ), UM()->get_allowed_html( 'admin_notice' ) );
echo wp_kses( sprintf( __( '%s provides you with forms for user registration, login and profiles.', 'ultimate-member' ), UM_PLUGIN_NAME ), UM()->get_allowed_html( 'admin_notice' ) );
?>
</p>
<p>
@@ -38,7 +38,7 @@
<p>
<?php
// translators: %s: plugin name.
echo wp_kses( sprintf( __( '%s does not send any user data outside of your site by default.', 'ultimate-member' ), ultimatemember_plugin_name ), UM()->get_allowed_html( 'admin_notice' ) );
echo wp_kses( sprintf( __( '%s does not send any user data outside of your site by default.', 'ultimate-member' ), UM_PLUGIN_NAME ), UM()->get_allowed_html( 'admin_notice' ) );
?>
</p>
<p>