From dc39ebe883dc6e5d8401a05aeb5fd02062bed931 Mon Sep 17 00:00:00 2001 From: magepeopleteam Date: Tue, 18 Aug 2020 12:08:58 +0000 Subject: [PATCH] file updated --- css/admin_style.css | 14 ++ inc/mep_cpt.php | 56 ++--- inc/mep_enque.php | 17 +- inc/mep_event_meta.php | 48 ++-- inc/mep_functions.php | 41 +++- inc/mep_tax.php | 4 + inc/mep_user_custom_style.php | 2 +- inc/template-prts/event_add_cart.php | 1 + .../event_ticket_type_loop_list.php | 4 +- inc/welcome/support.php | 4 +- inc/welcome/welcome.php | 2 +- js/mage-options-framework.js | 8 +- lib/appsero/.gitignore | 16 -- lib/appsero/composer.json | 21 -- lib/appsero/readme.md | 216 ------------------ lib/appsero/src/Insights.php | 97 +++++--- 16 files changed, 206 insertions(+), 345 deletions(-) delete mode 100755 lib/appsero/.gitignore delete mode 100755 lib/appsero/composer.json delete mode 100755 lib/appsero/readme.md diff --git a/css/admin_style.css b/css/admin_style.css index eeb0aaf..d103bff 100644 --- a/css/admin_style.css +++ b/css/admin_style.css @@ -282,4 +282,18 @@ ul.mep_rt_settings_list li { background: #ddd; margin-bottom: 30px; margin-top: 10px; +} +.mep_event_metabox_address .sec { + width: 48%; + display: inline-block; + padding: 0px 10px; +} +#poststuff .stuffbox>h3, #poststuff h2, #poststuff h3.hndle { + display: block; +} +span.event_meta_help_txt { + display: block; + font-size: 13px; + margin: 2px 0 20px; + color: #ba2720; } \ No newline at end of file diff --git a/inc/mep_cpt.php b/inc/mep_cpt.php index ea6c021..b91530f 100644 --- a/inc/mep_cpt.php +++ b/inc/mep_cpt.php @@ -18,29 +18,29 @@ function mep_cpt() 'singular_name' => __($event_label, 'mage-eventpress'), 'menu_name' => __($event_label, 'mage-eventpress'), 'name_admin_bar' => __($event_label, 'mage-eventpress'), - 'archives' => __($event_label.' List', 'mage-eventpress'), - 'attributes' => __($event_label.' List', 'mage-eventpress'), - 'parent_item_colon' => __($event_label.' Item:', 'mage-eventpress'), - 'all_items' => __('All '.$event_label, 'mage-eventpress'), - 'add_new_item' => __('Add New '.$event_label, 'mage-eventpress'), - 'add_new' => __('Add New '.$event_label, 'mage-eventpress'), - 'new_item' => __('New '.$event_label, 'mage-eventpress'), - 'edit_item' => __('Edit '.$event_label, 'mage-eventpress'), - 'update_item' => __('Update '.$event_label, 'mage-eventpress'), - 'view_item' => __('View '.$event_label, 'mage-eventpress'), - 'view_items' => __('View '.$event_label, 'mage-eventpress'), - 'search_items' => __('Search '.$event_label, 'mage-eventpress'), - 'not_found' => __($event_label.' Not found', 'mage-eventpress'), - 'not_found_in_trash' => __($event_label.' Not found in Trash', 'mage-eventpress'), - 'featured_image' => __($event_label.' Feature Image', 'mage-eventpress'), - 'set_featured_image' => __('Set '.$event_label.' featured image', 'mage-eventpress'), - 'remove_featured_image' => __('Remove '.$event_label.' featured image', 'mage-eventpress'), - 'use_featured_image' => __('Use as '.$event_label.' featured image', 'mage-eventpress'), - 'insert_into_item' => __('Insert into '.$event_label, 'mage-eventpress'), - 'uploaded_to_this_item' => __('Uploaded to this '.$event_label, 'mage-eventpress'), - 'items_list' => __($event_label.' list', 'mage-eventpress'), - 'items_list_navigation' => __($event_label.' list navigation', 'mage-eventpress'), - 'filter_items_list' => __('Filter '.$event_label.' list', 'mage-eventpress'), + 'archives' => __($event_label . ' List', 'mage-eventpress'), + 'attributes' => __($event_label . ' List', 'mage-eventpress'), + 'parent_item_colon' => __($event_label . ' Item:', 'mage-eventpress'), + 'all_items' => __('All ' . $event_label, 'mage-eventpress'), + 'add_new_item' => __('Add New ' . $event_label, 'mage-eventpress'), + 'add_new' => __('Add New ' . $event_label, 'mage-eventpress'), + 'new_item' => __('New ' . $event_label, 'mage-eventpress'), + 'edit_item' => __('Edit ' . $event_label, 'mage-eventpress'), + 'update_item' => __('Update ' . $event_label, 'mage-eventpress'), + 'view_item' => __('View ' . $event_label, 'mage-eventpress'), + 'view_items' => __('View ' . $event_label, 'mage-eventpress'), + 'search_items' => __('Search ' . $event_label, 'mage-eventpress'), + 'not_found' => __($event_label . ' Not found', 'mage-eventpress'), + 'not_found_in_trash' => __($event_label . ' Not found in Trash', 'mage-eventpress'), + 'featured_image' => __($event_label . ' Feature Image', 'mage-eventpress'), + 'set_featured_image' => __('Set ' . $event_label . ' featured image', 'mage-eventpress'), + 'remove_featured_image' => __('Remove ' . $event_label . ' featured image', 'mage-eventpress'), + 'use_featured_image' => __('Use as ' . $event_label . ' featured image', 'mage-eventpress'), + 'insert_into_item' => __('Insert into ' . $event_label, 'mage-eventpress'), + 'uploaded_to_this_item' => __('Uploaded to this ' . $event_label, 'mage-eventpress'), + 'items_list' => __($event_label . ' list', 'mage-eventpress'), + 'items_list_navigation' => __($event_label . ' list navigation', 'mage-eventpress'), + 'filter_items_list' => __('Filter ' . $event_label . ' list', 'mage-eventpress'), ); $args = array( @@ -48,7 +48,8 @@ function mep_cpt() 'labels' => $labels, 'menu_icon' => $event_icon, 'supports' => array('title', 'editor', 'thumbnail', 'excerpt'), - 'rewrite' => array('slug' => $event_slug) + 'rewrite' => array('slug' => $event_slug), + 'show_in_rest' => true ); register_post_type('mep_events', $args); @@ -89,11 +90,12 @@ function mep_cpt() 'menu_icon' => 'dashicons-calendar-alt', 'supports' => array('title', 'editor', 'thumbnail', 'excerpt'), 'rewrite' => array('slug' => 'event-speaker'), - 'show_in_menu' => 'edit.php?post_type=mep_events', + 'show_in_menu' => 'edit.php?post_type=mep_events', + 'show_in_rest' => true ); - - if($speaker_status == 'yes'){ + + if ($speaker_status == 'yes') { register_post_type('mep_event_speaker', $args); } } diff --git a/inc/mep_enque.php b/inc/mep_enque.php index 3569db4..a0d88e5 100644 --- a/inc/mep_enque.php +++ b/inc/mep_enque.php @@ -17,10 +17,6 @@ function mep_add_admin_scripts($hook) */ if ($hook == 'post-new.php' || $hook == 'post.php') { if ('mep_events' === $post->post_type) { - // wp_enqueue_script('jquery-ui-timepicker-addon', plugin_dir_url(__DIR__) . 'js/jquery-ui-timepicker-addon.js', array('jquery', 'jquery-ui-core'), 1, true); - // wp_enqueue_script('jquery-ui-timepicker-addon', plugin_dir_url(__DIR__) . 'js/jquery-ui-sliderAccess.js', array('jquery', 'jquery-ui-core', 'jquery-ui-timepicker-addon'), 1, true); - // wp_enqueue_script('mep_datepicker', plugin_dir_url(__DIR__) . 'js/mep_datepicker.js', array('jquery', 'jquery-ui-core', 'jquery-ui-timepicker-addon'), 1, true); - // wp_enqueue_style('jquery-ui-timepicker-addon', plugin_dir_url(__DIR__) . 'css/jquery-ui-timepicker-addon.css', array()); wp_enqueue_style('mep-jquery-ui-style', plugin_dir_url(__DIR__) . 'css/jquery-ui.css', array()); wp_enqueue_script('gmap-scripts', plugin_dir_url(__DIR__) . 'js/mkb-admin.js', array('jquery', 'jquery-ui-core'), 1, true); } @@ -56,7 +52,7 @@ function mep_add_admin_scripts($hook) wp_enqueue_script('wp-color-picker'); wp_enqueue_script('magepeople-options-framework', plugins_url('js/mage-options-framework.js', __DIR__), array('jquery')); wp_localize_script('PickpluginsOptionsFramework', 'PickpluginsOptionsFramework_ajax', array('PickpluginsOptionsFramework_ajaxurl' => admin_url('admin-ajax.php'))); - wp_enqueue_script('select2.min', plugins_url('js/select2.min.js', __DIR__), array('jquery')); +// wp_enqueue_script('select2.min', plugins_url('js/select2.min.js', __DIR__), array('jquery')); wp_enqueue_script('codemirror', plugin_dir_url(__DIR__) . 'js/codemirror.min.js', array('jquery'), null, false); wp_enqueue_script('form-field-dependency', plugins_url('js/form-field-dependency.js', __DIR__), array('jquery'), null, false); wp_localize_script('jquery', 'mep_ajax', array( 'mep_ajaxurl' => admin_url( 'admin-ajax.php'))); @@ -99,3 +95,14 @@ if($owlThemeLoad == 'no'){ } +// Ajax Issue +add_action('wp_head','mep_ajax_url',5); +add_action('admin_head','mep_ajax_url',5); +function mep_ajax_url(){ +?> + +ID ); $user_api = mep_get_option( 'google-map-api', 'general_setting_sec', ''); $map_type = mep_get_option( 'mep_google_map_type', 'general_setting_sec', 'iframe'); + +$mep_org_address = array_key_exists('mep_org_address', $values) ? $values['mep_org_address'][0] : 0 ; ?> -
- - > Yes (If Yes, Organizer Address will show from organizer area.) + + + +
- - - - +
;'>
@@ -325,20 +331,32 @@ $map_type = mep_get_option( 'mep_google_map_type', 'general_setting_sec', 'ifram '>
+ + +
+
> Yes
- - - - "; + if ( $this->is_local_server() ) { + return; } + + $optin_url = add_query_arg( $this->client->slug . '_tracker_optin', 'true' ); + $optout_url = add_query_arg( $this->client->slug . '_tracker_optout', 'true' ); + + if ( empty( $this->notice ) ) { + $notice = sprintf( $this->client->__trans( 'Want to help make %1$s even more awesome? Allow %1$s to collect non-sensitive diagnostic data and usage information.' ), $this->client->name ); + } else { + $notice = $this->notice; + } + + $policy_url = 'https://' . 'appsero.com/privacy-policy/'; + + $notice .= ' (' . $this->client->__trans( 'what we collect' ) . ')'; + $notice .= ''; + + echo '

'; + echo $notice; + echo '

'; + echo ' ' . $this->client->__trans( 'Allow' ) . ''; + echo ' ' . $this->client->__trans( 'No thanks' ) . ''; + echo '

'; + + echo " + "; } /** @@ -437,6 +450,8 @@ class Insights { update_option( $this->client->slug . '_allow_tracking', 'no' ); update_option( $this->client->slug . '_tracking_notice', 'hide' ); + $this->send_tracking_skipped_request(); + $this->clear_schedule_event(); } @@ -946,4 +961,24 @@ class Insights { return $site_name; } + + /** + * Send request to appsero if user skip to send tracking data + */ + private function send_tracking_skipped_request() { + $skipped = get_option( $this->client->slug . '_tracking_skipped' ); + + $data = [ + 'hash' => $this->client->hash, + 'previously_skipped' => false, + ]; + + if ( $skipped === 'yes' ) { + $data['previously_skipped'] = true; + } else { + update_option( $this->client->slug . '_tracking_skipped', 'yes' ); + } + + $this->client->send_request( $data, 'tracking-skipped' ); + } }