Meta Tag Manager - Version 3.0

Version Description

  • added open graph settings and support for home page
  • added twitter card open graph settings and support for home page
  • added schema / structured data / rich snippets front-page support
  • added easy site verification settings
  • added SCRIPT_DEBUG and MTM_DEBUG constant checks to decide whether to load non-minified files
  • moved context checking for a tag into MTM_Tag functions,
  • added Meta_Tag_Manager::is_archive()
  • fixed Meta_Tag_Manager::is_archive_page() to account for static posts page
  • added multiple actions and filters to MTM_Builder output
  • added multiple actions and filters to MTM_Tag object
  • fixed Array PHP caused by potentially non-existent contexts in a meta tag admin panel
  • added extra sanitization/validation of submitted context list in a tag
  • added MTM_Builder::get_contexts_list() to remove redundant code when excluding
  • tweaked JS and display issues for showing context lists in header of admin meta tag card
  • fixed css aesthetic issue when clicking a selectize active item turing grey
  • tweaked context selectize js to be more flexible and reusable for other context fields
  • moved admin-related files into admin folder
  • moved settings tab sections into dedicated files
  • moved handling of setting saving to Meta_Tag_Manager_Admin with a redirect instead of saving on same page load
Download this release

Release Info

Developer netweblogic
Plugin Icon 128x128 Meta Tag Manager
Version 3.0
Comparing to
See all releases

Code changes from version 2.3 to 3.0

admin/functions.php ADDED
@@ -0,0 +1,138 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ function mtm_input_select_items($array, $saved_value) {
3
+ $output = "";
4
+ foreach($array as $key => $item) {
5
+ $selected ='';
6
+ if ($key == $saved_value)
7
+ $selected = "selected='selected'";
8
+ $output .= "<option value='".esc_attr($key)."' $selected >".esc_html($item)."</option>\n";
9
+
10
+ }
11
+ echo $output;
12
+ }
13
+
14
+ function mtm_input_checkbox_items($name, $array, $saved_values, $horizontal = true) {
15
+ $output = "";
16
+ foreach($array as $key => $item) {
17
+ $checked = "";
18
+ if (in_array($key, $saved_values)) $checked = "checked='checked'";
19
+ $output .= "<label><input type='checkbox' name='".esc_attr($name)."[]' value='".esc_attr($key)."' $checked> ".esc_html($item)."</label>&nbsp; ";
20
+ if(!$horizontal)
21
+ $output .= "<br>\n";
22
+ }
23
+ echo $output;
24
+
25
+ }
26
+ function mtm_input_text($title, $name, $value='', $description ='', $ph = false, $classes = '') {
27
+ ?>
28
+ <tr valign="top" id='<?php echo esc_attr($name);?>_row'>
29
+ <th scope="row"><label for="<?php echo esc_attr($name); ?>"><?php echo esc_html($title); ?></label></th>
30
+ <td>
31
+ <input name="<?php echo esc_attr($name) ?>" value="<?php echo esc_attr($value); ?>" type="text" id="<?php echo esc_attr($name) ?>" class="widefat" <?php if($ph) echo 'placeholder="'.esc_attr($ph).'"'; ?> >
32
+ <?php if( !empty($description)): ?>
33
+ <p><em><?php echo $description; ?></em></p>
34
+ <?php endif; ?>
35
+ </td>
36
+ </tr>
37
+ <?php
38
+ }
39
+
40
+ function mtm_input_password($title, $name, $value, $description ='') {
41
+ ?>
42
+ <tr valign="top" id='<?php echo esc_attr($name);?>_row'>
43
+ <th scope="row"><label for="<?php echo esc_attr($name); ?>"><?php echo esc_html($title); ?></label></th>
44
+ <td>
45
+ <input name="<?php echo esc_attr($name) ?>" value="<?php echo esc_attr($value); ?>" type="password" id="<?php echo esc_attr($title) ?>" class="widefat" >
46
+ <?php if(!empty($description)): ?><p><em><?php echo $description; ?></em></p><?php endif; ?>
47
+ </td>
48
+ </tr>
49
+ <?php
50
+ }
51
+
52
+ function mtm_input_textarea($title, $name, $value, $description ='') {
53
+ ?>
54
+ <tr valign="top" id='<?php echo esc_attr($name);?>_row'>
55
+ <th scope="row"><label for="<?php echo esc_attr($name); ?>"><?php echo esc_html($title); ?></label></th>
56
+ <td>
57
+ <textarea name="<?php echo esc_attr($name) ?>" id="<?php echo esc_attr($name) ?>" class="widefat" cols="60"><?php echo esc_attr($value);?></textarea>
58
+ <?php if(!empty($description)): ?><p><em><?php echo $description; ?></em></p><?php endif; ?>
59
+ </td>
60
+ </tr>
61
+ <?php
62
+ }
63
+
64
+ function mtm_input_radio($name, $options, $option = '', $title='') {
65
+ ?>
66
+ <tr valign="top" id='<?php echo esc_attr($name);?>_row'>
67
+ <?php if( !empty($title) ): ?>
68
+ <th scope="row"><?php echo esc_html($title); ?></th>
69
+ <td>
70
+ <?php else: ?>
71
+ <td colspan="2">
72
+ <?php endif; ?>
73
+ <table>
74
+ <?php foreach($options as $value => $text): ?>
75
+ <tr>
76
+ <td><input id="<?php echo esc_attr($name) ?>_<?php echo esc_attr($value); ?>" name="<?php echo esc_attr($name) ?>" type="radio" value="<?php echo esc_attr($value); ?>" <?php if($option == $value) echo "checked='checked'"; ?>></td>
77
+ <td><label for="<?php echo esc_attr($name); ?>"><?php echo $text ?></label></td>
78
+ </tr>
79
+ <?php endforeach; ?>
80
+ </table>
81
+ </td>
82
+ </tr>
83
+ <?php
84
+ }
85
+
86
+ function mtm_input_radio_binary($title, $name, $value='', $description='', $option_names = '', $trigger='') {
87
+ if( empty($option_names) ) $option_names = array(0 => __('No','events-manager'), 1 => __('Yes','events-manager'));
88
+ $trigger_att = ($trigger) ? 'data-trigger="'.esc_attr($trigger).'" class="em-trigger"':'';
89
+ ?>
90
+ <tr valign="top" id='<?php echo $name;?>_row'>
91
+ <th scope="row"><?php echo esc_html($title); ?></th>
92
+ <td>
93
+ <label><?php echo $option_names[1]; ?> <input id="<?php echo esc_attr($name) ?>_yes" name="<?php echo esc_attr($name) ?>" type="radio" value="1" <?php if($value) echo "checked='checked'"; echo $trigger_att; ?> ></label>&nbsp;&nbsp;&nbsp;
94
+ <label><?php echo $option_names[0]; ?> <input id="<?php echo esc_attr($name) ?>_no" name="<?php echo esc_attr($name) ?>" type="radio" value="0" <?php if(!$value) echo "checked='checked'"; echo $trigger_att; ?> ></label>
95
+ <?php if(!empty($description)): ?><p><em><?php echo $description; ?></em></p><?php endif; ?>
96
+ </td>
97
+ </tr>
98
+ <?php
99
+ }
100
+
101
+ function mtm_input_select($title, $name, $list, $option_value = null, $description='', $classes = '') {
102
+ $required = !empty($list['']) ? 'required':'';
103
+ ?>
104
+ <tr valign="top" id='<?php echo esc_attr($name);?>_row' class="<?php echo esc_attr($classes); ?>">
105
+ <th scope="row"><label for="<?php echo esc_attr($name); ?>"><?php echo esc_html($title); ?></label></th>
106
+ <td>
107
+ <select name="<?php echo esc_attr($name); ?>" id="<?php echo esc_attr($name); ?>" class="widefat" <?php echo $required; ?>>
108
+ <?php
109
+ foreach($list as $key => $value) {
110
+ if( is_array($value) ){
111
+ ?><optgroup label="<?php echo $key; ?>"><?php
112
+ foreach( $value as $key_group => $value_group ){
113
+ ?>
114
+ <option value='<?php echo esc_attr($key_group) ?>' <?php echo ("$key_group" == $option_value) ? "selected='selected' " : ''; ?>>
115
+ <?php echo esc_html($value_group); ?>
116
+ </option>
117
+ <?php
118
+ }
119
+ ?></optgroup><?php
120
+ }else{
121
+ $ph = '';
122
+ if( $key === '' ) {
123
+ $ph = $option_value === null ? ' disabled selected hidden' : ' disabled hidden';
124
+ }
125
+ ?>
126
+ <option value='<?php echo esc_attr($key) ?>' <?php echo ("$key" == $option_value) ? "selected" : ''; echo $ph ?>>
127
+ <?php echo esc_html($value); ?>
128
+ </option>
129
+ <?php
130
+ }
131
+ }
132
+ ?>
133
+ </select>
134
+ <?php if(!empty($description)): ?><p><em><?php echo $description; ?></em></p><?php endif; ?>
135
+ </td>
136
+ </tr>
137
+ <?php
138
+ }
admin/mtm-admin-settings.php ADDED
@@ -0,0 +1,115 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if( !defined('ABSPATH') ) exit;
3
+ Meta_Tag_Manager::load(); // load everything
4
+ global $MTM_Notices;
5
+
6
+ // if previously saved
7
+ if( !empty($_GET['saved']) ) {
8
+ echo '<div id="message" class="updated fade"><p><strong>' . __('Settings saved.') . '</strong></p></div>'; // No textdomain: phrase used in core, too
9
+ }
10
+ // get tabs settings, in case we want to split them page by page rather than one page
11
+ if( defined('MTM_SETTINGS_TABS') && MTM_SETTINGS_TABS ){
12
+ $tabs_enabled = true;
13
+ $builder_tab_link = esc_url(add_query_arg( array('mtm_tab'=>'builder')));
14
+ $general_tab_link = esc_url(add_query_arg( array('mtm_tab'=>'general')));
15
+ }else{
16
+ $general_tab_link = $builder_tab_link = '';
17
+ }
18
+ // button for submission (reused)
19
+ global $mtm_submit_button;
20
+ $mtm_submit_button = '<p class="mtm-actions"><button type="submit" class="button-primary">'. esc_html__('Save Changes','meta-tag-manager') .'</button></p>';
21
+
22
+ ?>
23
+ <div class="wrap tabs-active">
24
+ <?php if( !empty($MTM_Notices) ) echo $MTM_Notices; ?>
25
+ <h1><?php esc_html_e( 'Meta Tag Manager', 'meta-tag-manager' ); ?></h1>
26
+ <h2 class="nav-tab-wrapper">
27
+ <?php
28
+ $tabs = $fixed_tabs = array(
29
+ 'custom-meta-tags' => esc_html__('Custom Meta Tags','meta-tag-manager'),
30
+ 'general' => esc_html__('General Options','meta-tag-manager'),
31
+ 'open-graph' => esc_html__('Open Graph','meta-tag-manager'),
32
+ 'schema' => esc_html__('Structured Data (Schema)','meta-tag-manager'),
33
+ 'verify-sites' => esc_html__('Site Verification','meta-tag-manager'),
34
+ );
35
+ if( !defined('MTM_PRO_VERSION') ){
36
+ $tabs['go-pro'] = $fixed_tabs['go-pro'] = '<span style="color:green;">'. esc_html__('Pro Features!','meta-tag-manager') . '</span>';
37
+ }
38
+ $tabs = apply_filters('mtm_settings_page_tabs', $tabs);
39
+ foreach( $tabs as $tab_key => $tab_name ){
40
+ $tab_link = !empty($tabs_enabled) ? esc_url(add_query_arg( array('mtm_tab'=>$tab_key))) : '';
41
+ $active_class = (!empty($tabs_enabled) && !empty($_GET['mtm_tab']) && $_GET['mtm_tab'] == $tab_key) || $tab_key == 'custom-meta-tags' ? 'nav-tab-active':'';
42
+ echo "<a href='$tab_link#$tab_key' id='mtm-menu-$tab_key' class='nav-tab $active_class'>$tab_name</a>";
43
+ }
44
+ ?>
45
+ </h2>
46
+ <div id="poststuff">
47
+ <div id="post-body" class="metabox-holder columns-2 mtm-settings">
48
+ <div id="postbox-container-2" class="postbox-container">
49
+ <form action="" method="post">
50
+ <?php
51
+ wp_nonce_field('mtm_options_submitted', 'mtm_nonce');
52
+ if( empty($tabs_enabled) || (!empty($_REQUEST['mtm_tab']) || $_REQUEST['mtm_tab'] == 'custom-meta-tags') ) {
53
+ ?>
54
+ <div class="mtm-menu-custom-meta-tags mtm-menu-group">
55
+ <?php include('settings/custom-meta-tags.php'); ?>
56
+ </div>
57
+ <?php
58
+ }
59
+ if( empty($tabs_enabled) || (!empty($_REQUEST['mtm_tab']) || $_REQUEST['mtm_tab'] == 'general') ){
60
+ ?>
61
+ <div class="mtm-menu-general mtm-menu-group">
62
+ <?php include('settings/general.php'); ?>
63
+ </div>
64
+ <?php
65
+ }
66
+ if( empty($tabs_enabled) || (!empty($_REQUEST['mtm_tab']) || $_REQUEST['mtm_tab'] == 'open-graph') ){
67
+ ?>
68
+ <div class="mtm-menu-open-graph mtm-menu-group">
69
+ <?php include('settings/open-graph.php'); ?>
70
+ </div>
71
+ <?php
72
+ }
73
+ if( empty($tabs_enabled) || (!empty($_REQUEST['mtm_tab']) || $_REQUEST['mtm_tab'] == 'schema') ){
74
+ ?>
75
+ <div class="mtm-menu-schema mtm-menu-group">
76
+ <?php include('settings/schema.php'); ?>
77
+ </div>
78
+ <?php
79
+ }
80
+ if( empty($tabs_enabled) || (!empty($_REQUEST['mtm_tab']) || $_REQUEST['mtm_tab'] == 'verify-sites') ){
81
+ ?>
82
+ <div class="mtm-menu-verify-sites mtm-menu-group">
83
+ <?php include('settings/verify-sites.php'); ?>
84
+ </div>
85
+ <?php
86
+ }
87
+ if( !defined('MTM_PRO_VERSION') && (empty($tabs_enabled) || (!empty($_REQUEST['mtm_tab']) || $_REQUEST['mtm_tab'] == 'go-pro')) ){
88
+ include('settings/go-pro.php');
89
+ }
90
+ // output custom tabs content here
91
+ if( !empty($tabs_enabled) && array_key_exists($_REQUEST['mtm_tab'], $tabs) && !array_key_exists($_REQUEST['mtm_tab'], $fixed_tabs) ){
92
+ ?>
93
+ <div class="mtm-menu-<?php echo esc_attr($_REQUEST['mtm_tab']) ?> mtm-menu-group">
94
+ <?php do_action('mtm_settings_page_tab_'. $_REQUEST['mtm_tab']); ?>
95
+ <?php echo $mtm_submit_button; ?>
96
+ </div>
97
+ <?php
98
+ }else{
99
+ foreach( $tabs as $tab_key => $tab_name ){
100
+ if( !empty($fixed_tabs[$tab_key]) ) continue;
101
+ ?>
102
+ <div class="mtm-menu-<?php echo esc_attr($tab_key) ?> mtm-menu-group" style="display:none;">
103
+ <?php do_action('mtm_settings_page_tab_'. $tab_key); ?>
104
+ <?php echo $mtm_submit_button; ?>
105
+ </div>
106
+ <?php
107
+ }
108
+ }
109
+ ?>
110
+ </form>
111
+ </div>
112
+ <?php include('settings/sidebar.php'); ?>
113
+ </div><!-- #post-body -->
114
+ </div><!-- #poststuff -->
115
+ </div>
mtm-builder.php → admin/mtm-builder.php RENAMED
@@ -21,9 +21,13 @@ class MTM_Builder {
21
  public static function output($meta_tags, $args = array() ){
22
  ?>
23
  <div class="mtm-builder">
 
24
  <div class="mtm-fields<?php if( empty($args['context']) ): ?> no-context<?php endif; ?><?php if( empty($args['reference']) ): ?> no-reference<?php endif; ?>">
25
  <?php
26
  $i = 0;
 
 
 
27
  foreach( $meta_tags as $tag ){
28
  self::output_field($i, $tag, $args);
29
  $i++;
@@ -50,19 +54,23 @@ class MTM_Builder {
50
  <?php endforeach; ?>
51
  </div>
52
  <button type="button" class="button-secondary mtm-add-field"><span class="dashicons dashicons-plus"></span> <?php esc_html_e('Add Meta Tag','meta-tag-manager'); ?></button>
 
53
  </div>
54
  <?php
55
  }
56
 
57
  public static function output_field( $i = '', $tag, $args = array() ){
 
58
  ?>
59
  <div class="mtm-field">
60
  <div class="mtm-field-header">
61
  <div class="mtm-field-header-toggle"></div>
62
  <div class="mtm-col-sort"><span class="dashicons dashicons-sort"></span></div>
 
63
  <div class="mtm-field-title">
64
  <?php if( !empty($args['reference']) ): ?>
65
  <div class="mtm-meta-reference">
 
66
  <?php $reference = empty($tag->reference) ? __('Custom Meta Tag','meta-tag-manager') : $tag->reference; ?>
67
  <span class="mtm-meta-reference-value" title="<?php esc_attr_e('Custom Meta Tag Reference','meta-tag-manager'); ?>"><?php echo esc_html($reference); ?></span>
68
  <label class="mtm-field-input-reference">
@@ -70,29 +78,17 @@ class MTM_Builder {
70
  <input type="text" name="mtm-fields[<?php echo esc_attr($i); ?>][reference]" value="<?php echo esc_attr($tag->reference); ?>" placeholder="<?php esc_html_e('optional reference name', 'meta-tag-manager'); ?>" class="mtm-field-input-tag-reference" />
71
  </label>
72
  <?php if( !empty($args['context']) ): ?>
73
- <span class="mtm-meta-context">
74
  <span class="dashicons dashicons-admin-page"></span>
75
  <span class="mtm-meta-context-values">
76
- <?php
77
- $context_value = empty($tag->context) ? array('all') : $tag->context;
78
- $display_contexts = array();
79
- foreach( self::get_context_options() as $context_label => $context_option ){
80
- if( is_array($context_option) ){
81
- foreach( $context_option as $context_option_label => $context_option_value )
82
- if( in_array($context_option_value, $context_value) ){
83
- $display_contexts[] = $context_option_label;
84
- }
85
- }else{
86
- if( in_array($context_option, $context_value) ){
87
- $display_contexts[] = $context_label;
88
- }
89
- }
90
- }
91
- echo implode(', ', $display_contexts);
92
- ?>
93
  </span>
94
  </span>
95
  <?php endif; ?>
 
96
  </div>
97
  <?php endif; ?>
98
  <code>
@@ -111,8 +107,10 @@ class MTM_Builder {
111
  </code>
112
  <a class="mtm-field-remove" title="<?php esc_attr_e('Remove Meta Tag','meta-tag-manager'); ?>"><span class="dashicons dashicons-trash"></span></a>
113
  </div>
 
114
  </div>
115
  <div class="mtm-field-data">
 
116
  <div class="mtm-field-input mtm-field-type-type">
117
  <label>
118
  <span class="mtm-field-input-label"><?php esc_html_e('Tag Type','meta-tag-manager'); ?></span>
@@ -148,50 +146,18 @@ class MTM_Builder {
148
  <?php if( !empty($args['context']) ): ?>
149
  <div class="mtm-field-input mtm-field-input-context">
150
  <label>
151
- <span class="mtm-field-input-label"><?php echo esc_html_e('Where to display this tag','meta-tag-manager'); ?></span>
152
- <select name="mtm-fields[<?php echo esc_attr($i); ?>][context][]" class="mtm-field-input-tag-context" multiple>
153
- <option value=""><?php esc_html_e('choose one or more contexts', 'meta-tag-manager'); ?></option>
154
  <?php
155
  $context_options = self::get_context_options();
156
- echo self::output_select_options($context_options, $context_value);
157
  ?>
158
  </select>
159
  </label>
160
  </div>
161
  <?php endif; ?>
162
- <?php
163
- /*
164
- This is currently shelved as a feature unless there's demand, due to the extra work involved.
165
- The intention of the bit below is to allow for extra custom attributes since the meta tag does allow for various global attributes.
166
- https://www.w3.org/TR/html5/document-metadata.html#the-meta-element
167
- If you're reading this and you want to see this functionality, drop us a line on the support forums (and maybe a little context as for why)
168
- so we know there's demand for it!
169
- */
170
- /*
171
- <div class="mtm-field-section">
172
- <div class="mtm-field-section-header">
173
- <div class="mtm-field-section-toggle"></div>
174
- <div class="mtm-field-section-title"><?php esc_html_e('Additional Attributes (Advanced)','meta-tag-manager'); ?></div>
175
- </div>
176
- <div class="mtm-field-section-data">
177
- <div class="mtm-field-type-custom">
178
- <div class="mtm-field-input mtm-field-type-custom-name">
179
- <label>
180
- <span class="screen-reader-text"><?php sprintf(esc_html_x('Custom %s', 'label for custom attribute name/value fields', 'meta-tag-manager'),esc_html__('attribute name','meta-tag-manager')); ?></span>
181
- <input type="text" name="mtm-fields[<?php echo esc_attr($i); ?>][][label]" value="" placeholder="<?php esc_attr_e('attribute name','meta-tag-manager'); ?>" />
182
- </label>
183
- </div>
184
- <div class="mtm-field-input mtm-field-type-custom-value">
185
- <label>
186
- <span class="screen-reader-text"><?php sprintf(esc_html_x('Custom %s', 'label for custom attribute name/value fields', 'meta-tag-manager'),esc_html__('attribute value','meta-tag-manager')); ?></span>
187
- <input type="text" name="mtm-fields[<?php echo esc_attr($i); ?>][][label]" value="" placeholder="<?php esc_attr_e('attribute value','meta-tag-manager'); ?>" />
188
- </label>
189
- </div>
190
- </div>
191
- <br class="clear" />
192
- </div>
193
- </div>
194
- */ ?>
195
  <div class="mtm-field-actions">
196
  <button type="button" class="button-secondary mtm-field-close"><?php esc_html_e('Close Meta Tag Options','meta-tag-manager'); ?></button>
197
  </div>
@@ -219,28 +185,52 @@ class MTM_Builder {
219
  }
220
  if( !preg_match('/selected="selected"/', $html) && !empty($selected) && $add_selected_option ){
221
  //value not existing, so we add it as an option
222
- $html = '<option selected="selected">'.esc_html($selected).'</option>' . $html;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
223
  }
224
- return $html;
225
  }
226
 
227
  public static function get_context_options(){
228
  if( !empty(self::$context_options) ) return self::$context_options;
229
- $context_options = array(
230
  __('All Pages', 'meta-tag-manager') => 'all',
231
  __('Front Page', 'meta-tag-manager') => 'home'
232
- );
233
- //Post Types
234
  $post_types_label = __('Post Types', 'meta-tag-manager');
235
  foreach( get_post_types(array('public'=>true), 'objects') as $post_type){
236
  $context_options[$post_types_label][$post_type->labels->name] = 'post-type_' . $post_type->name;
237
  }
238
- //Taxonomies
239
  $taxonomies_label = __('Taxonomies', 'meta-tag-manager');
240
  foreach( get_taxonomies(array('public'=>true), 'objects') as $taxonomy ){
241
  $context_options[$taxonomies_label][$taxonomy->labels->name] = 'taxonomy_' . $taxonomy->name;
242
  }
243
- self::$context_options = $context_options;
244
  return $context_options;
245
  }
246
  }
21
  public static function output($meta_tags, $args = array() ){
22
  ?>
23
  <div class="mtm-builder">
24
+ <?php do_action('mtm_builder_output_top'); ?>
25
  <div class="mtm-fields<?php if( empty($args['context']) ): ?> no-context<?php endif; ?><?php if( empty($args['reference']) ): ?> no-reference<?php endif; ?>">
26
  <?php
27
  $i = 0;
28
+ if( !empty($args['context']) && empty($args['context-placeholder']) ){
29
+ $args['context-placeholder'] = apply_filters('mtm_builder_context_placeholder', esc_html__('choose contexts, leave blank for all pages', 'meta-tag-manager'), $meta_tags, $args);
30
+ }
31
  foreach( $meta_tags as $tag ){
32
  self::output_field($i, $tag, $args);
33
  $i++;
54
  <?php endforeach; ?>
55
  </div>
56
  <button type="button" class="button-secondary mtm-add-field"><span class="dashicons dashicons-plus"></span> <?php esc_html_e('Add Meta Tag','meta-tag-manager'); ?></button>
57
+ <?php do_action('mtm_builder_output_bottom'); ?>
58
  </div>
59
  <?php
60
  }
61
 
62
  public static function output_field( $i = '', $tag, $args = array() ){
63
+ if( !empty($args['context']) && empty($args['context-placeholder']) ) $args['context-placeholder'] = esc_html__('choose contexts, leave blank for all pages', 'meta-tag-manager');
64
  ?>
65
  <div class="mtm-field">
66
  <div class="mtm-field-header">
67
  <div class="mtm-field-header-toggle"></div>
68
  <div class="mtm-col-sort"><span class="dashicons dashicons-sort"></span></div>
69
+ <?php do_action('mtm_builder_output_field_header_top', $i, $tag, $args ); ?>
70
  <div class="mtm-field-title">
71
  <?php if( !empty($args['reference']) ): ?>
72
  <div class="mtm-meta-reference">
73
+ <?php do_action('mtm_builder_output_field_header_reference_top', $i, $tag, $args ); ?>
74
  <?php $reference = empty($tag->reference) ? __('Custom Meta Tag','meta-tag-manager') : $tag->reference; ?>
75
  <span class="mtm-meta-reference-value" title="<?php esc_attr_e('Custom Meta Tag Reference','meta-tag-manager'); ?>"><?php echo esc_html($reference); ?></span>
76
  <label class="mtm-field-input-reference">
78
  <input type="text" name="mtm-fields[<?php echo esc_attr($i); ?>][reference]" value="<?php echo esc_attr($tag->reference); ?>" placeholder="<?php esc_html_e('optional reference name', 'meta-tag-manager'); ?>" class="mtm-field-input-tag-reference" />
79
  </label>
80
  <?php if( !empty($args['context']) ): ?>
81
+ <span class="mtm-meta-context mtm-meta-context-container">
82
  <span class="dashicons dashicons-admin-page"></span>
83
  <span class="mtm-meta-context-values">
84
+ <?php
85
+ $context_value = empty($tag->context) ? array('all') : $tag->context;
86
+ echo static::get_contexts_list( $context_value );
87
+ ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
88
  </span>
89
  </span>
90
  <?php endif; ?>
91
+ <?php do_action('mtm_builder_output_field_header_reference_bottom', $i, $tag, $args ); ?>
92
  </div>
93
  <?php endif; ?>
94
  <code>
107
  </code>
108
  <a class="mtm-field-remove" title="<?php esc_attr_e('Remove Meta Tag','meta-tag-manager'); ?>"><span class="dashicons dashicons-trash"></span></a>
109
  </div>
110
+ <?php do_action('mtm_builder_output_field_header_bottom', $i, $tag, $args ); ?>
111
  </div>
112
  <div class="mtm-field-data">
113
+ <?php do_action('mtm_builder_output_field_data_top', $i, $tag, $args ); ?>
114
  <div class="mtm-field-input mtm-field-type-type">
115
  <label>
116
  <span class="mtm-field-input-label"><?php esc_html_e('Tag Type','meta-tag-manager'); ?></span>
146
  <?php if( !empty($args['context']) ): ?>
147
  <div class="mtm-field-input mtm-field-input-context">
148
  <label>
149
+ <span class="mtm-field-input-label"><?php esc_html_e('Where to display this tag','meta-tag-manager'); ?></span>
150
+ <select name="mtm-fields[<?php echo esc_attr($i); ?>][context][]" class="mtm-field-input-tag-context mtm-field-input-tag-context-select" multiple data-values-text="mtm-meta-context-values" data-values-container="mtm-meta-context-container" data-values-default="all">
151
+ <option value=""><?php echo $args['context-placeholder']; ?></option>
152
  <?php
153
  $context_options = self::get_context_options();
154
+ echo self::output_select_options($context_options, $tag->context, false);
155
  ?>
156
  </select>
157
  </label>
158
  </div>
159
  <?php endif; ?>
160
+ <?php do_action('mtm_builder_output_field_data_bottom', $i, $tag, $args ); ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
161
  <div class="mtm-field-actions">
162
  <button type="button" class="button-secondary mtm-field-close"><?php esc_html_e('Close Meta Tag Options','meta-tag-manager'); ?></button>
163
  </div>
185
  }
186
  if( !preg_match('/selected="selected"/', $html) && !empty($selected) && $add_selected_option ){
187
  //value not existing, so we add it as an option
188
+ if( is_array($selected) ){
189
+ foreach( $selected as $s ){
190
+ $html = '<option selected="selected">'.esc_html($s).'</option>' . $html;
191
+ }
192
+ }else{
193
+ $html = '<option selected="selected">'.esc_html($selected).'</option>' . $html;
194
+ }
195
+ }
196
+ return apply_filters('mtm_builder_output_select_options', $html, $options, $selected, $add_selected_option);
197
+ }
198
+
199
+ public static function get_contexts_list( $contexts ){
200
+ if( empty($contexts) ) return '';
201
+ $display_contexts = array();
202
+ foreach( self::get_context_options() as $context_label => $context_option ){
203
+ if( is_array($context_option) ){
204
+ foreach( $context_option as $context_option_label => $context_option_value )
205
+ if( in_array($context_option_value, $contexts) ){
206
+ $display_contexts[] = $context_option_label;
207
+ }
208
+ }else{
209
+ if( in_array($context_option, $contexts) ){
210
+ $display_contexts[] = $context_label;
211
+ }
212
+ }
213
  }
214
+ return apply_filters('mtm_builder_get_contexts_list', implode(', ', $display_contexts), $display_contexts, $contexts);
215
  }
216
 
217
  public static function get_context_options(){
218
  if( !empty(self::$context_options) ) return self::$context_options;
219
+ $context_options = apply_filters('mtm_builder_context_options_main', array(
220
  __('All Pages', 'meta-tag-manager') => 'all',
221
  __('Front Page', 'meta-tag-manager') => 'home'
222
+ ));
223
+ // Post Types
224
  $post_types_label = __('Post Types', 'meta-tag-manager');
225
  foreach( get_post_types(array('public'=>true), 'objects') as $post_type){
226
  $context_options[$post_types_label][$post_type->labels->name] = 'post-type_' . $post_type->name;
227
  }
228
+ // Taxonomies
229
  $taxonomies_label = __('Taxonomies', 'meta-tag-manager');
230
  foreach( get_taxonomies(array('public'=>true), 'objects') as $taxonomy ){
231
  $context_options[$taxonomies_label][$taxonomy->labels->name] = 'taxonomy_' . $taxonomy->name;
232
  }
233
+ self::$context_options = apply_filters('mtm_builder_context_options', $context_options);
234
  return $context_options;
235
  }
236
  }
mtm-tag-admin.php → admin/mtm-tag-admin.php RENAMED
@@ -14,20 +14,25 @@ class MTM_Tag_Admin extends MTM_Tag {
14
  //all pages equates to no context, since when we're outputting global meta tags no context implies outputting it everywhere
15
  $values['context'] = false;
16
  }else{
17
- //implode the context values
18
- $values['context'] = wp_unslash(implode(',', $values['context']));
 
 
19
  }
20
  }
 
 
21
  //go through all non-empty values and wp_kses it
22
  foreach( $values as $k => $v ){
23
  if( $k == 'content'){
24
- $values[$k] = wp_unslash($v);
25
  }else{
26
- $values[$k] = wp_kses(wp_unslash($v), array());
27
  }
28
  }
 
29
  //now pass cleaned values to parent constructor
30
- parent::__construct($values);
31
  }
32
 
33
  public static function get_type_values($type = false){
@@ -48,7 +53,30 @@ class MTM_Tag_Admin extends MTM_Tag {
48
  if( !empty($type) ){
49
  return array_key_exists($type, self::$type_options) ? self::$type_options[$type] : array();
50
  }
51
- return apply_filters('mtm_tag_type_options', self::$type_options);
52
  }
53
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
54
  }
14
  //all pages equates to no context, since when we're outputting global meta tags no context implies outputting it everywhere
15
  $values['context'] = false;
16
  }else{
17
+ // sanitize context values so they are 'valid'
18
+ $values['context'] = MTM_Tag_Admin::sanitize_contexts( wp_unslash($values['context']) );
19
+ // implode the context values
20
+ $values['context'] = implode(',', $values['context']);
21
  }
22
  }
23
+ $values = apply_filters('mtm_tag_admin_values', $values, $this);
24
+ $values_cleaned = array();
25
  //go through all non-empty values and wp_kses it
26
  foreach( $values as $k => $v ){
27
  if( $k == 'content'){
28
+ $values_cleaned[$k] = wp_unslash($v);
29
  }else{
30
+ $values_cleaned[$k] = wp_kses(wp_unslash($v), array());
31
  }
32
  }
33
+ $values_cleaned = apply_filters('mtm_tag_admin_values_cleaned', $values_cleaned, $values, $this);
34
  //now pass cleaned values to parent constructor
35
+ parent::__construct($values_cleaned);
36
  }
37
 
38
  public static function get_type_values($type = false){
53
  if( !empty($type) ){
54
  return array_key_exists($type, self::$type_options) ? self::$type_options[$type] : array();
55
  }
56
+ return apply_filters('mtm_tag_admin_get_type_values', self::$type_options);
57
  }
58
 
59
+
60
+ public static function sanitize_contexts( $contexts ){
61
+ Meta_Tag_Manager_Admin::load_builder(); // just in case
62
+ $context_options = MTM_Builder::get_context_options();
63
+ $valid_contexts = array();
64
+ // flatten the valid contexts array
65
+ foreach( $context_options as $context ){
66
+ if( is_array($context) ){
67
+ foreach( $context as $subcontext ){
68
+ if( !is_array($subcontext) ) $valid_contexts[] = $subcontext;
69
+ }
70
+ }else{
71
+ $valid_contexts[] = $context;
72
+ }
73
+ }
74
+ $clean_contexts = array();
75
+ foreach( $contexts as $k => $context ){
76
+ if( in_array($context, $valid_contexts) ){
77
+ $clean_contexts[] = $context;
78
+ }
79
+ }
80
+ return apply_filters('mtm_tag_admin_sanitize_contexts', $clean_contexts, $contexts);
81
+ }
82
  }
admin/mtm-update.php ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if( defined('MTM_VERSION') ){
3
+ //coming in from MTM 1.x we change the values to something else
4
+ $mtm_version = get_option('mtm_version');
5
+ if( !$mtm_version ){
6
+ $mtm_data = get_option('mtm_data', array());
7
+ $new_mtm_data = array();
8
+ foreach($mtm_data as $mtm_tag){
9
+ $new_tag = array(
10
+ 'value' => $mtm_tag[0],
11
+ 'content' => $mtm_tag[1],
12
+ 'reference' => $mtm_tag[2],
13
+ 'type' => 'name'
14
+ );
15
+ if( !empty($mtm_tag[3]) ){
16
+ $new_tag['location'] = 'home';
17
+ }else{
18
+ $new_tag['location'] = 'all';
19
+ }
20
+ $new_mtm_data[] = $new_tag;
21
+ }
22
+ update_option('mtm_data', $new_mtm_data);
23
+ update_option('mtm_custom', array('post-types'=>get_post_types()));
24
+ }elseif( version_compare( MTM_VERSION, $mtm_version ) ){
25
+ delete_option('mtm_shiny_update_notice');
26
+ $mtm_custom = get_option('mtm_custom');
27
+ if( version_compare( '3.0', $mtm_version ) ){
28
+ if( empty($mtm_custom['admin_notices']) ) $mtm_custom['admin_notices'] = array();
29
+ $admin_notice = sprintf(esc_html__('Meta Tag Manager 3.0 introduces many new features including Open Graph and Schema support. Check out the newly updated %s!', 'meta-tag-manager'), '<a href="'.admin_url('options-general.php?page=meta-tag-manager').'">'. esc_html__('Settings Page', 'meta-tag-manager') .'</a>');
30
+ $Admin_Notice = new \Meta_Tag_Manager\Admin_Notice('new-features-3-0', 'info', $admin_notice, 'all');
31
+ \Meta_Tag_Manager\Admin_Notices::add( $Admin_Notice );
32
+ }
33
+ }
34
+
35
+ update_option('mtm_version', MTM_VERSION);
36
+ }
admin/notices/admin-notice.php ADDED
@@ -0,0 +1,178 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Meta_Tag_Manager;
3
+ /**
4
+ * A single admin notice which contains information about who to display it to, what to dispaly, when and where to display it.
5
+ * @since 5.8.2.0
6
+ */
7
+ class Admin_Notice {
8
+
9
+ /**
10
+ * Notice key
11
+ * @var string
12
+ */
13
+ public $name = '';
14
+ /**
15
+ * Which user should see this message. Can be 'admin', 'all' (or false), or a specific capability.
16
+ * Note that 'admin' in MultiSite context is considered a super admin, use the 'manage_options' cap instead.
17
+ * @var string
18
+ */
19
+ public $who = 'admin';
20
+ /**
21
+ * What kind of notices this is, which can be 'success','info','warning' or 'error'
22
+ * @var string
23
+ */
24
+ public $what = 'info';
25
+ /**
26
+ * Timestamp indicating when a notice should be shown. If empty, message will show immediately.
27
+ * @var int
28
+ */
29
+ public $when;
30
+ /**
31
+ * Where a message should be shown. Values accepted are 'all' (all pages), 'network_admin', 'plugin' (plugin-specific pages), 'settings'
32
+ * or any value representing an admin page in the events admin menu, e.g. 'events-manager-bookings' would be the bookings admin page.
33
+ *
34
+ * @var string
35
+ */
36
+ public $where = 'settings';
37
+ /**
38
+ * The actual message that will be displayed. If left blank, a filter will be applied upon output with format
39
+ * mtm_admin_notice_output_{$this->name}
40
+ * @var string
41
+ */
42
+ public $message = false; //the message
43
+ /**
44
+ * Whether a message is dismissable
45
+ * @var boolean
46
+ */
47
+ public $dismissible = true;
48
+ /**
49
+ * If a message is dismissable and this is set to true, it will be shown to every user matching the who property until dismissed.
50
+ * This is also set to true by default if the user type is not 'admin' and not previously set to true or false by the mtm_admin_notice_ hook.
51
+ * @var boolean
52
+ */
53
+ protected $user_notice = null;
54
+ /**
55
+ * If set to true, this is treated as a network-level notice, meaning it can apply to all sites on the network or the network admin in MultiSite mode.
56
+ * @var bool
57
+ */
58
+ public $network = false;
59
+
60
+ public function __construct( $key, $type = false, $message = false, $where = false ){
61
+ //process the supplied data
62
+ if( empty($message) ){
63
+ if( empty($type) && is_array($key) ){
64
+ $notice = $key;
65
+ }elseif( is_array($type) ){
66
+ $this->name = $key;
67
+ $notice = $type;
68
+ }elseif( is_array($key) ){
69
+ $notice = $key;
70
+ }else{
71
+ //we may even have simply a key/name for this notice, for hooking later on
72
+ if( is_string($key) ) $this->name = $key;
73
+ $notice = array();
74
+ }
75
+ }else{
76
+ //here we expect a string for eveything
77
+ $notice = array('name'=> (string) $key, 'what' => (string) $type, 'message' => (string) $message) ;
78
+ }
79
+ //we should have an array to process at this point
80
+ foreach( $notice as $key => $value ){
81
+ $this->$key = $value;
82
+ }
83
+ //add where if defined
84
+ if( !empty($where) ) $this->where = $where;
85
+ //call a hook
86
+ do_action('mtm_admin_notice_'.$this->name, $this);
87
+ if( !is_multisite() && $this->where == 'network_admin' ) $this->where = 'settings';
88
+ }
89
+
90
+ public function __set( $prop, $val ){
91
+ $this->$prop = $val;
92
+ }
93
+
94
+ public function __get( $prop ){
95
+ if( $prop == 'user_notice' ){
96
+ return $this->is_user_notice();
97
+ }
98
+ }
99
+
100
+ /**
101
+ * Returns whether or not this object should be dismissed on a per-user basis.
102
+ * @return boolean
103
+ */
104
+ public function is_user_notice(){
105
+ if( $this->who != 'admin' && $this->user_notice === null ){
106
+ //user_notice was not specifically set, so if notice is dismissible and not targetted at admins we assume it's dismissed at per-user basis
107
+ return $this->dismissible;
108
+ }
109
+ return $this->user_notice;
110
+ }
111
+
112
+ /**
113
+ * Returns notice as an array with non-default values.
114
+ * @return array
115
+ */
116
+ public function to_array(){
117
+ $default = new Admin_Notice('default');
118
+ $notice = array();
119
+ foreach( get_class_vars('Meta_Tag_Manager\Admin_Notice') as $var => $val ){
120
+ if( $this->$var != $default->$var ) $notice[$var] = $this->$var;
121
+ }
122
+ return $notice;
123
+ }
124
+
125
+ public function can_show(){
126
+ //check that we have at least a notice to show
127
+ if( empty($this->name) ) return false;
128
+ //can we display due to time?
129
+ $return = ( empty($this->when) || $this->when <= time() );
130
+ //who to display it to
131
+ if( $return && !empty($this->who) && $this->who != 'all' ){
132
+ $return = false; //unless this test passes, don't show it
133
+ if( $this->who == 'all' ) $return = true;
134
+ elseif ( $this->who == 'admin' ){
135
+ if( $this->network && is_super_admin() ) $return = true;
136
+ elseif( current_user_can('manage_options') ) $return = true;
137
+ }
138
+ elseif( $this->who == 'blog_admin' && current_user_can('manage_options') ) $return = true;
139
+ elseif( !$return && current_user_can($this->who) ) $return = true;
140
+ }
141
+ //can we display due to location?
142
+ if( $return ){
143
+ $return = false; //unless this test passes, don't show it
144
+ if( empty($this->where) || $this->where == 'all' ){
145
+ $return = true;
146
+ }elseif( !empty($_REQUEST['page']) && $_REQUEST['page'] == 'meta-tag-manager' ){
147
+ if( $this->where == 'plugin' || $this->where == 'settings' ) $return = true;
148
+ }elseif( is_network_admin() && !empty($_REQUEST['page']) && preg_match('/^meta\-tag\-manager\-/', $_REQUEST['page']) ){
149
+ $return = $this->where == 'plugin' || $this->where == 'settings' || $this->where == 'network_admin';
150
+ }elseif( !empty($_REQUEST['page']) && ($this->where == $_REQUEST['page'] || (is_array($this->where) && in_array($_REQUEST['page'], $this->where))) ){
151
+ $return = true;
152
+ }
153
+ }
154
+ //does this even have a message we can display?
155
+ if( $return && empty($this->message)){
156
+ $this->message = apply_filters('mtm_admin_notice_'.$this->name .'_message', false, $this);
157
+ $return = !empty($this->message);
158
+ }
159
+ //is this user-dismissable, and if so, did this user dismiss it?
160
+ if( $return && $this->is_user_notice() ){
161
+ $user_id = get_current_user_id();
162
+ $dismissed_notices = get_user_meta( $user_id, '_mtm_dismissed_notices', true);
163
+ $return = empty($dismissed_notices) || !in_array($this->name, $dismissed_notices);
164
+ }
165
+ return $return;
166
+ }
167
+
168
+ public function output(){
169
+ if( empty($this->message) ) return false;
170
+ $action = $this->network ? 'mtm_dismiss_network_admin_notice':'mtm_dismiss_admin_notice';
171
+ ?>
172
+ <div class="mtm-admin-notice notice notice-<?php echo esc_attr($this->what); ?> <?php if($this->dismissible) echo 'is-dismissible'?>" id="notice-<?php echo esc_attr($this->name); ?>" data-dismiss-action="<?php echo $action; ?>" data-dismiss-key="<?php echo esc_attr($this->name); ?>">
173
+ <p><?php echo $this->message; ?></p>
174
+ </div>
175
+ <?php
176
+ return true;
177
+ }
178
+ }
admin/notices/admin-notices.php ADDED
@@ -0,0 +1,205 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Meta_Tag_Manager;
3
+ /**
4
+ * Handles the registration and display of admin notices, including storage and retrieval of individual Admin_Notice notice objects.
5
+ * @since 5.8.2.0
6
+ */
7
+ class Admin_Notices {
8
+
9
+ /**
10
+ * Flag for whether or not to add dismissable notice JS to admin page footer.
11
+ * @var boolean
12
+ */
13
+ public static $js_footer = false;
14
+
15
+ /**
16
+ * Initialize EM Admin Notices by adding the relevant hooks.
17
+ */
18
+ public static function init(){
19
+ add_action('admin_notices', 'Meta_Tag_Manager\Admin_Notices::admin_notices');
20
+ add_action('wp_ajax_mtm_dismiss_admin_notice', 'Meta_Tag_Manager\Admin_Notices::dismiss_admin_notice');
21
+ if( is_multisite() ){
22
+ add_action('admin_notices', 'Meta_Tag_Manager\Admin_Notices::network_admin_notices');
23
+ add_action('network_admin_notices', 'Meta_Tag_Manager\Admin_Notices::network_admin_notices');
24
+ add_action('wp_ajax_mtm_dismiss_network_admin_notice', 'Meta_Tag_Manager\Admin_Notices::dismiss_admin_notice');
25
+ }
26
+ }
27
+
28
+ /**
29
+ * Adds an admin notice to the site. If $network is set to true, notice will be saved at network level.
30
+ * If a string is provided as $MTM_Admin_Notice, it will be considered as a notice requiring a hook to ouptut anything.
31
+ * If a notice with an identical key is provided, it will overwrite the previously stored notice.
32
+ * When adding a notice that all users will see and can dismiss, it's recommended you use a hook to build the Admin_Notice object, to avoid storing unecessary data in the DB
33
+ * @param Admin_Notice|string $MTM_Admin_Notice
34
+ * @param boolean $network
35
+ * @return boolean Returns true if added successfully, false if not or if the exact same record exists.
36
+ */
37
+ public static function add( $MTM_Admin_Notice, $network = false ){
38
+ $network = $network && is_multisite(); //make sure we are actually in multisite!
39
+ if( is_string($MTM_Admin_Notice) ){
40
+ $MTM_Admin_Notice = new Admin_Notice( $MTM_Admin_Notice );
41
+ $hook_notice = true;
42
+ }
43
+ if( !$MTM_Admin_Notice->name ) return false;
44
+ //get options data
45
+ $data = $network ? get_site_option('mtm_custom') : get_option('mtm_custom');
46
+ $data = empty($data) ? array() : maybe_unserialize($data);
47
+ if( !is_array($data)) $data = array();
48
+ $notices_data = $network ? get_site_option('mtm_admin_notices') : get_option('mtm_admin_notices');
49
+ $notices_data = empty($notices_data) ? array() : maybe_unserialize($notices_data);
50
+ if( !is_array($notices_data)) $notices_data = array(); //we store the data regarldess of whether a message will require a hook, since it contains location and caps considtions
51
+ //start building data
52
+ $notices = !empty($data['admin_notices']) ? $data['admin_notices'] : array();
53
+ $notices[$MTM_Admin_Notice->name] = !empty($MTM_Admin_Notice->when) ? $MTM_Admin_Notice->when : 0;
54
+ if( empty($hook_notice) ){ //we only skip this if simply a key is provided initially in $MTM_Admin_Notice
55
+ $notices_data[$MTM_Admin_Notice->name] = $MTM_Admin_Notice->to_array();
56
+ }
57
+ if( !empty($notices) ){
58
+ $data['admin_notices'] = $notices;
59
+ $update_notices = $network ? update_site_option('mtm_custom', $data) : update_option('mtm_custom', $data);
60
+ $update_notices_data = true;
61
+ if( !empty($notices_data) ){
62
+ $update_notices_data = $network ? update_site_option('mtm_admin_notices', $notices_data) : update_option('mtm_admin_notices', $notices_data, false);
63
+ }
64
+ return $update_notices && $update_notices_data;
65
+ }
66
+ return false;
67
+ }
68
+
69
+ /**
70
+ * Remove an admin notice. If $network is true, then a network-level admin notice will be removed.
71
+ * @param string $notice_key
72
+ * @param string $network
73
+ * @return boolean Returns true if successfully deleted, false if there's an error or if there's nothing to delete.
74
+ */
75
+ public static function remove( $notice_key, $network = false ){
76
+ $network = $network && is_multisite(); //make sure we are actually in multisite!
77
+ $data = $network ? get_site_option('mtm_custom') : get_option('mtm_custom');
78
+ if( !empty($data['admin_notices']) && isset($data['admin_notices'][$notice_key])){
79
+ unset($data['admin_notices'][$notice_key]);
80
+ if( empty($data['admin_notices']) ) unset($data['admin_notices']);
81
+ $result = $update_notices_data = $network ? update_site_option('mtm_custom', $data) : update_option('mtm_custom', $data);
82
+ $notices_data = $network ? get_site_option('mtm_admin_notices') : get_option('mtm_admin_notices');
83
+ if( !empty($notices_data[$notice_key]) ){
84
+ unset($notices_data[$notice_key]);
85
+ if( empty($notices_data) ){
86
+ $update_notices_data = $network ? delete_site_option('mtm_admin_notices') : delete_option('mtm_admin_notices');
87
+ }else{
88
+ $update_notices_data = $network ? update_site_option('mtm_admin_notices', $notices_data) : update_option('mtm_admin_notices', $notices_data, false);
89
+ }
90
+ }
91
+ return $result && $update_notices_data;
92
+ }
93
+ return false;
94
+ }
95
+
96
+ /**
97
+ * Adds admin notice to network rather than specific blog. Equivalent to self::add( $MTM_Admin_Notice, true );
98
+ * @see Admin_Notices::add()
99
+ */
100
+ public static function network_add( $MTM_Admin_Notice ){ return self::add( $MTM_Admin_Notice, true ); }
101
+
102
+ /**
103
+ * Removes admin notice from network rather than specific blog. Equivalent to self::remove( $MTM_Admin_Notice, true );
104
+ * @see Admin_Notices::remove()
105
+ */
106
+ public static function network_remove( $notice_key ){ return self::remove( $notice_key, true ); }
107
+
108
+ /**
109
+ * Output the admin notices we need to output now. If $network is true, MultiSite network messages will be output.
110
+ * @param string $network
111
+ */
112
+ public static function admin_notices( $network = false ){
113
+ $notices = array();
114
+ $data = $network ? get_site_option('mtm_custom') : get_option('mtm_custom');
115
+ $possible_notices = is_array($data) && !empty($data['admin_notices']) ? $data['admin_notices'] : array();
116
+ //we may have something to show, so we make sure that there's something to show right now
117
+ foreach( $possible_notices as $key => $val ){
118
+ //to avoid extra loading etc. we weed out time-based notices that aren't triggered right now
119
+ if( empty($val) || ($val > 0 && $val < time()) ){
120
+ //we have a match, so we add this to $notices
121
+ $notices[$key] = self::get_notice($key, $network);
122
+ }
123
+ }
124
+ self::output( $notices, $network );
125
+ }
126
+
127
+ public static function get_notice( $key, $network = false ){
128
+ //build notice object
129
+ $notice_data = $network ? get_site_option('mtm_admin_notices') : get_option('mtm_admin_notices');
130
+ if( empty($notice_data[$key]) || !is_array($notice_data[$key]) ){
131
+ $notice = array('name'=>$key, 'network'=>$network);
132
+ }else{
133
+ $notice = $notice_data[$key];
134
+ $notice['network'] = $network;
135
+ }
136
+ return new Admin_Notice($notice);
137
+ }
138
+
139
+ /**
140
+ * Outputs admin notices at network level, same as Meta_Tag_Manager\Admin_Notices::admin_notices(true)
141
+ * @see Admin_Notices::admin_notices()
142
+ */
143
+ public static function network_admin_notices(){ self::admin_notices(true); }
144
+
145
+ /**
146
+ * Outputs admin notices and calls the dismissable JS to be output at footer of admin page.
147
+ * If $network is true, only MultiSite network-level notices will be shown.
148
+ * @param array $notices
149
+ * @param boolean $network
150
+ */
151
+ public static function output( $notices, $network = false ){
152
+ foreach( $notices as $MTM_Admin_Notice ){
153
+ //output the notice if meant to
154
+ if( $MTM_Admin_Notice->can_show() ){
155
+ if( $MTM_Admin_Notice->output() ) self::$js_footer = true;
156
+ }
157
+ }
158
+ if( self::$js_footer ){
159
+ add_action('admin_footer', 'Meta_Tag_Manager\Admin_Notices::admin_footer');
160
+ }
161
+ }
162
+
163
+ /**
164
+ * If called via AJAX, the notice will be removed.
165
+ */
166
+ public static function dismiss_admin_notice(){
167
+ if( empty($_REQUEST['notice']) ) return;
168
+ $key = $_REQUEST['notice'];
169
+ $network = $_REQUEST['action'] == 'mtm_dismiss_network_admin_notice';
170
+ //get the notice
171
+ $MTM_Admin_Notice = self::get_notice($key, $network);
172
+ if( $MTM_Admin_Notice->is_user_notice() ){
173
+ //user-specific notices are flagged on the user-level
174
+ $user_id = get_current_user_id();
175
+ $dismissed_notices = get_user_meta( $user_id, '_mtm_dismissed_notices', true);
176
+ $dismissed_notices = is_array($dismissed_notices) ? $dismissed_notices : array();
177
+ if( !in_array($MTM_Admin_Notice->name, $dismissed_notices) ){
178
+ $dismissed_notices[] = $MTM_Admin_Notice->name;
179
+ $result = update_user_meta( $user_id, '_mtm_dismissed_notices', $dismissed_notices);
180
+ }
181
+ }else{
182
+ $result = self::remove($_REQUEST['notice'], $network);
183
+ }
184
+ echo !empty($result) ? 'Thou art dismissed!' : 'Thou shall not pass!';
185
+ exit();
186
+ }
187
+
188
+ /**
189
+ * Outputs JS for dismissing notices.
190
+ */
191
+ public static function admin_footer(){
192
+ ?>
193
+ <script type="text/javascript">
194
+ jQuery(document).ready( function($){
195
+ $('.mtm-admin-notice').on('click', 'button.notice-dismiss', function(e){
196
+ var the_notice = $(this).closest('.mtm-admin-notice');
197
+ $.get('<?php echo admin_url('admin-ajax.php'); ?>', {'action' : the_notice.data('dismiss-action'), 'notice' : the_notice.data('dismiss-key') });
198
+ });
199
+ });
200
+ </script>
201
+ <?php
202
+ }
203
+ }
204
+ include('admin-notice.php');
205
+ Admin_Notices::init();
admin/notices/notices.php ADDED
@@ -0,0 +1,267 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Meta_Tag_Manager;
3
+ /**
4
+ *
5
+ * @author marcus
6
+ *
7
+ */
8
+ class Notices implements \Iterator, \JsonSerializable {
9
+ /**
10
+ * If object has been displayed, this gets set to true, can be checked to avoid duplicates.
11
+ * @var boolean
12
+ * @since 5.5.7
13
+ */
14
+ public $displayed = false;
15
+ public $set_cookies = true;
16
+ public $notices = array('errors'=>array(), 'infos'=>array(), 'alerts'=>array(), 'confirms'=>array());
17
+
18
+ function __construct( $set_cookies = true ){
19
+ //Grab from cookie, if it exists
20
+ $this->set_cookies = $set_cookies == true;
21
+ if( $this->set_cookies ){
22
+ if( !empty($_COOKIE['mtm_notices']) ) {
23
+ $notices = json_decode(base64_decode($_COOKIE['mtm_notices']), true);
24
+ if( is_array($notices) ){
25
+ $this->notices = $notices;
26
+ setcookie('mtm_notices', '', time() - 3600, COOKIEPATH, COOKIE_DOMAIN, is_ssl(), true); //unset the cookie
27
+ }
28
+ }
29
+ }
30
+ add_filter('wp_redirect', array(&$this,'destruct'), 1,1);
31
+ }
32
+
33
+ function destruct($redirect = false){
34
+ //Flush notices that weren't made to stay cross-requests, we can do this if initialized immediately.
35
+ foreach($this->notices as $notice_type => $notices){
36
+ foreach ($notices as $key => $notice){
37
+ if( empty($notice['static']) ){
38
+ unset($this->notices[$notice_type][$key]);
39
+ }else{
40
+ unset($this->notices[$notice_type][$key]['static']); //so it gets removed next request
41
+ $has_static = true;
42
+ }
43
+ }
44
+ }
45
+ if( $this->set_cookies ){
46
+ if(count($this->notices['errors']) > 0 || count($this->notices['alerts']) > 0 || count($this->notices['infos']) > 0 || count($this->notices['confirms']) > 0){
47
+ setcookie('mtm_notices', base64_encode(json_encode($this->notices)), time() + 30, COOKIEPATH, COOKIE_DOMAIN, is_ssl(), true); //sets cookie for 30 seconds, which may be too much
48
+ }
49
+ }
50
+ return $redirect;
51
+ }
52
+
53
+ function __toString(){
54
+ $string = false;
55
+ if(count($this->notices['errors']) > 0){
56
+ $string .= "<div class='mtm-warning mtm-warning-errors notice notice-error'>{$this->get_errors()}</div>";
57
+ }
58
+ if(count($this->notices['alerts']) > 0){
59
+ $string .= "<div class='mtm-warning mtm-warning-alerts notice notice-warning'>{$this->get_alerts()}</div>";
60
+ }
61
+ if(count($this->notices['infos']) > 0){
62
+ $string .= "<div class='mtm-warning mtm-warning-infos notice notice-info'>{$this->get_infos()}</div>";
63
+ }
64
+ if(count($this->notices['confirms']) > 0){
65
+ $string .= "<div class='mtm-warning mtm-warning-confirms notice notice-success'>{$this->get_confirms()}</div>";
66
+ }
67
+ $this->displayed = true;
68
+ return ($string !== false) ? "<div class='statusnotice'>".$string."</div>" : '';
69
+ }
70
+
71
+ /* General */
72
+ function add($string, $type, $static = false){
73
+ if( is_array($string) ){
74
+ $result = true;
75
+ foreach($string as $key => $string_item){
76
+ if( !is_array($string_item) ){
77
+ if( $this->add($string_item, $type, $static) === false ){ $result = false; }
78
+ }else{
79
+ if( $this->add_item($string_item, $type, $static) === false ){ $result = false; }
80
+ }
81
+ }
82
+ return $result;
83
+ }
84
+ if($string != ''){
85
+ return $this->add_item($string, $type, $static);
86
+ }else{
87
+ return false;
88
+ }
89
+ }
90
+
91
+ function add_item($string, $type, $static = false){
92
+ if( isset($this->notices[$type]) ){
93
+ $notice_key = 0;
94
+ foreach( $this->notices[$type] as $notice_key => $notice ){
95
+ if($string == $notice['string']){
96
+ return $notice_key;
97
+ }elseif( is_array($string) && !empty($notice['title']) && $this->get_array_title($string) == $notice['title'] ){
98
+ return $notice_key;
99
+ }
100
+ }
101
+ $i = $notice_key+1;
102
+ if( is_array($string) ){
103
+ $this->notices[$type][$i]['title'] = $this->get_array_title($string);
104
+ $this->notices[$type][$i]['string'] = array_shift($string);
105
+ }else{
106
+ $this->notices[$type][$i]['string'] = $string;
107
+ }
108
+ if( $static ){
109
+ $this->notices[$type][$i]['static'] = true;
110
+ }
111
+ return $i;
112
+ }else{
113
+ return false;
114
+ }
115
+ }
116
+
117
+ /**
118
+ * Returns title of an array, assumes a assoc array with one item containing title => messages
119
+ * @param unknown_type $array
120
+ * @return unknown
121
+ */
122
+ function get_array_title($array){
123
+ foreach($array as $title => $msgs)
124
+ return $title;
125
+ }
126
+
127
+ function remove($key, $type){
128
+ if( isset($this->notices[$type]) ){
129
+ unset($this->notices[$type][$key]);
130
+ return true;
131
+ }else{
132
+ return false;
133
+ }
134
+ }
135
+
136
+ function remove_all(){
137
+ $this->notices = array('errors'=>array(), 'infos'=>array(), 'alerts'=>array(), 'confirms'=>array());
138
+ }
139
+
140
+ function get($type){
141
+ if( isset($this->notices[$type]) ){
142
+ $string = '';
143
+ foreach ($this->notices[$type] as $message){
144
+ if( !is_array($message['string']) ){
145
+ if( preg_match('/<p>/', $message['string']) ){
146
+ $string .= $message['string'];
147
+ }else{
148
+ $string .= "<p>{$message['string']}</p>";
149
+ }
150
+ }else{
151
+ $string .= "<p><strong>".$message['title']."</strong><ul>";
152
+ foreach($message['string'] as $msg){
153
+ if( trim($msg) != '' ){
154
+ $string .= "<li>$msg</li>";
155
+ }
156
+ }
157
+ $string .= "</ul></p>";
158
+ }
159
+ }
160
+ return $string;
161
+ }
162
+ return false;
163
+ }
164
+
165
+ function count($type){
166
+ if( isset($this->notices[$type]) ){
167
+ return count($this->notices[$type]);
168
+ }
169
+ return 0;
170
+ }
171
+
172
+ /* Errors */
173
+ function add_error($string, $static=false){
174
+ return $this->add($string, 'errors', $static);
175
+ }
176
+ function remove_error($key){
177
+ return $this->remove($key, 'errors');
178
+ }
179
+ function get_errors(){
180
+ return $this->get('errors');
181
+ }
182
+ function count_errors(){
183
+ return $this->count('errors');
184
+ }
185
+
186
+ /* Alerts */
187
+ function add_alert($string, $static=false){
188
+ return $this->add($string, 'alerts', $static);
189
+ }
190
+ function remove_alert($key){
191
+ return $this->remove($key, 'alerts');
192
+ }
193
+ function get_alerts(){
194
+ return $this->get('alerts');
195
+ }
196
+ function count_alerts(){
197
+ return $this->count('alerts');
198
+ }
199
+
200
+ /* Info */
201
+ function add_info($string, $static=false){
202
+ return $this->add($string, 'infos', $static);
203
+ }
204
+ function remove_info($key){
205
+ return $this->remove($key, 'infos');
206
+ }
207
+ function get_infos(){
208
+ return $this->get('infos');
209
+ }
210
+ function count_infos(){
211
+ return $this->count('infos');
212
+ }
213
+
214
+ /* Confirms */
215
+ function add_confirm($string, $static=false){
216
+ return $this->add($string, 'confirms', $static);
217
+ }
218
+ function remove_confirm($key){
219
+ return $this->remove($key, 'confirms');
220
+ }
221
+ function get_confirms(){
222
+ return $this->get('confirms');
223
+ }
224
+ function count_confirms(){
225
+ return $this->count('confirms');
226
+ }
227
+
228
+ // Encoiding in JsonSerializable
229
+ function jsonSerialize(){
230
+ $notices = array();
231
+ foreach( $notices as $k => $v ){
232
+ if( !empty($v) ){
233
+ $notices[$k] = $v;
234
+ }
235
+ }
236
+ return $notices;
237
+ }
238
+
239
+ //Iterator Implementation
240
+ function rewind(){
241
+ reset($this->bookings);
242
+ }
243
+ function current(){
244
+ $var = current($this->bookings);
245
+ return $var;
246
+ }
247
+ function key(){
248
+ $var = key($this->bookings);
249
+ return $var;
250
+ }
251
+ function next(){
252
+ $var = next($this->bookings);
253
+ return $var;
254
+ }
255
+ function valid(){
256
+ $key = key($this->bookings);
257
+ $var = ($key !== NULL && $key !== FALSE);
258
+ return $var;
259
+ }
260
+
261
+ }
262
+ function mtm_notices_init(){
263
+ global $MTM_Notices;
264
+ $MTM_Notices = new MTM_Notices();
265
+ }
266
+ add_action('plugins_loaded', 'mtm_notices_init');
267
+ ?>
admin/settings/custom-meta-tags.php ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ global $mtm_submit_button;
3
+ ?>
4
+ <div class="mtm-menu-custom-meta-tags mtm-menu-group">
5
+ <p><?php esc_html_e('Use the meta tag builder to create meta tags which will be used on your site. You can choose what kind of meta tag to display, as well as where to display them such as on all your pages, just the home page or specific post types and taxonomies.', 'meta-tag-manager'); ?></p>
6
+ <p><?php esc_html_e('You can also enter a reference name at the top of each field card (something to help you remember the meta tag) and then enter the values below it that you want the meta tag to hold.', 'meta-tag-manager'); ?></p>
7
+ <p><?php echo sprintf(esc_html__('Certain tag values for the "name" type such as %s cannot be repeated, and the last duplicate tag will take precendence unless there is a tag defined for the specific post type being viewed.', 'meta-tag-manager'), '<code>keywords, description</code>'); ?></p>
8
+ <p><?php esc_html_e('For adding meta tags to specific post types, please click on the \'General Options\' tab above.', 'meta-tag-manager'); ?></p>
9
+ <?php MTM_Builder::output(Meta_Tag_Manager::get_data(), array('context'=>true, 'reference'=>true)); ?>
10
+ <?php do_action('mtm_ettings_page_builder'); ?>
11
+ <?php echo $mtm_submit_button; ?>
12
+ </div>
admin/settings/general.php ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ global $mtm_submit_button;
3
+ $mtm_custom = get_option('mtm_custom');
4
+ ?>
5
+ <div class="mtm-menu-general mtm-menu-group" style="display:none;">
6
+ <div id="mtm-post-types" class="mtm-post-types">
7
+ <h3><?php esc_html_e('Post Type Support', 'meta-tag-manager'); ?></h3>
8
+ <p><?php echo sprintf(esc_html__('Enable the meta tag builder on the edit pages of your selected %1$s below. This will allow you to create specific %1$s for specific %2$s on your site. Leave blank for all %1$s.', 'meta-tag-manager'), esc_html__('post types', 'meta-tag-manager'), esc_html__('post types', 'meta-tag-manager')); ?></p>
9
+ <?php
10
+ //Post Types
11
+ $post_type_options = array();
12
+ foreach( get_post_types(array('public'=>true), 'objects') as $post_type){
13
+ $post_type_options[$post_type->labels->name] = $post_type->name;
14
+ }
15
+ ?>
16
+ <select name="mtm-post-types[]" class="mtm-post-types-select" multiple>
17
+ <option value=""><?php echo sprintf(esc_html__('choose one or more %s', 'mtm-pro'), esc_html__('post types', 'meta-tag-manager')); ?></option>
18
+ <?php
19
+ echo MTM_Builder::output_select_options($post_type_options, $mtm_custom['post-types']);
20
+ ?>
21
+ </select>
22
+ </div>
23
+ <?php do_action('mtm_settings_page_general'); ?>
24
+ <?php echo $mtm_submit_button; ?>
25
+ </div>
admin/settings/go-pro.php ADDED
@@ -0,0 +1,180 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ // TODO add upgrade nudge on OG for duplicity
3
+ ?>
4
+ <div class="mtm-menu-go-pro mtm-menu-group">
5
+ <p> Meta Tags Manager has been freely developed, maintained and supported since 2009. We've decided to provide premium support and create some new premium features to enable us to keep doing so for more years to come!</p>
6
+ <p>
7
+ <a href="https://metatagmanager.com?utm_source=gopro-tab&utm_medium=plugin&utm_campaign=plugin" target="_blank">Get the Pro version</a> and unlock new features! See below for a feature list comparison, hover over the feature for more info.
8
+ </p>
9
+
10
+ <table class="features">
11
+ <thead>
12
+ <tr>
13
+ <th></th>
14
+ <th>Free/Main Plugin</th>
15
+ <th>Pro Add-On</th>
16
+ </tr>
17
+ </thead>
18
+ <tbody>
19
+ <tr class="f-subheader"><th colspan="3">General Meta Tags</th></tr>
20
+ <tr>
21
+ <th data-title="Quickly and esaily create any valid meta tag, with included pre-selection of values and ability to create your own.">Meta Tag Builder</th>
22
+ <td><span class="dashicons dashicons-yes-alt"></span></td>
23
+ <td><span class="dashicons dashicons-yes-alt"></span></td>
24
+ </tr>
25
+ <tr>
26
+ <th data-title="Add meta tags to your general settings page which can display throughout your whole website.">Sitewide Meta Tags</th>
27
+ <td><span class="dashicons dashicons-yes-alt"></span></td>
28
+ <td><span class="dashicons dashicons-yes-alt"></span></td>
29
+ </tr>
30
+ <tr>
31
+ <th data-title="Choose where to display your meta tags from a range of contexts, such as the front page, specific post/taxonomy types, archives etc.">Basic display conditions</th>
32
+ <td><span class="dashicons dashicons-yes-alt"></span></td>
33
+ <td><span class="dashicons dashicons-yes-alt"></span></td>
34
+ </tr>
35
+ <tr>
36
+ <th data-title="Add exclusion rules for fine-grained control of where your tags display, and where they don't!">Exclude display conditions</th>
37
+ <td></td>
38
+ <td><span class="dashicons dashicons-yes-alt"></span></td>
39
+ </tr>
40
+ <tr>
41
+ <th data-title="Additional display contexts, allowing you to show and exclude your tags in more specific combinations.">Advanced display/exclusion contexts</th>
42
+ <td></td>
43
+ <td><span class="dashicons dashicons-yes-alt"></span></td>
44
+ </tr>
45
+ <tr>
46
+ <th data-title="Choose from a multitude of placeholders to dynamically display information about a page, including titles, comment counts and featured image urls.">Dynamic placeholders</th>
47
+ <td></td>
48
+ <td><span class="dashicons dashicons-yes-alt"></span></td>
49
+ </tr>
50
+ <tr>
51
+ <th data-title="Prevent duplicate tags created in Meta Tag Manager from displaying twice on your pages.">Unique tag detection</th>
52
+ <td></td>
53
+ <td><span class="dashicons dashicons-yes-alt"></span></td>
54
+ </tr>
55
+ <tr>
56
+ <th data-title="Duplicate tags created on a specific page, post type or taxonomy overrides those created in your settings page, allowing for a hierarchy of sophisticated meta tag detection.">Unique tag overriding</th>
57
+ <td></td>
58
+ <td><span class="dashicons dashicons-yes-alt"></span></td>
59
+ </tr>
60
+ <tr>
61
+ <th data-title="Add shortcode to your meta tags to include any dynamic information provided by other plugins, such as ACF.">Shortcode Support</th>
62
+ <td></td>
63
+ <td><span class="dashicons dashicons-yes-alt"></span></td>
64
+ </tr>
65
+ </tbody>
66
+ <tbody>
67
+ <tr class="f-subheader">
68
+ <th colspan="3">Individual Pages, Posts and Custom Post Types</th>
69
+ </tr>
70
+ <tr>
71
+ <th data-title="Build individual meta tags on specific pages and posts.">Pages and Posts</th>
72
+ <td><span class="dashicons dashicons-yes-alt"></span></td>
73
+ <td><span class="dashicons dashicons-yes-alt"></span></td>
74
+ </tr>
75
+ <tr>
76
+ <th data-title="Build individual meta tags on any custom post type, such as events, products, etc.">Custom Post Types</th>
77
+ <td><span class="dashicons dashicons-yes-alt"></span></td>
78
+ <td><span class="dashicons dashicons-yes-alt"></span></td>
79
+ </tr>
80
+ <tbody>
81
+ <tr class="f-subheader">
82
+ <th colspan="3">Taxonomy Support</th>
83
+ </tr>
84
+ <tr>
85
+ <th data-title="Create meta tags on your general settings page and display them on specific taxonomy pages.">General Taxonomy Meta Tags</th>
86
+ <td><span class="dashicons dashicons-yes-alt"></span></td>
87
+ <td><span class="dashicons dashicons-yes-alt"></span></td>
88
+ </tr>
89
+ <tr>
90
+ <th data-title="Create meta tags on specific taxonomy terms for fine-grained display.">Specific Taxonomy Terms</th>
91
+ <td></td>
92
+ <td><span class="dashicons dashicons-yes-alt"></span></td>
93
+ </tr>
94
+ <tr>
95
+ <th data-title="Add dynamic placeholders to easily create global meta tags for taxonomies, including the name, description, slug, id and more.">Dynamic placeholders</th>
96
+ <td></td>
97
+ <td><span class="dashicons dashicons-yes-alt"></span></td>
98
+ </tr>
99
+ </tbody>
100
+ <tbody>
101
+ <tr class="f-subheader">
102
+ <th colspan="3">Structured Data Support</th>
103
+ </tr>
104
+ <tr>
105
+ <th data-title="Add a rich snippet about your site on your homepage, so that Google and other search engines know more about your site.">Home Page Schema</th>
106
+ <td><span class="dashicons dashicons-yes-alt"></span></td>
107
+ <td><span class="dashicons dashicons-yes-alt"></span></td>
108
+ </tr>
109
+ <tr>
110
+ <th data-title="Add a list of sitelinks that can help Google expand your search results with sub-links below your main result.">Sitelinks Support</th>
111
+ <td><span class="dashicons dashicons-yes-alt"></span></td>
112
+ <td><span class="dashicons dashicons-yes-alt"></span></td>
113
+ </tr>
114
+ <tr>
115
+ <th data-title="Allow Google to add a search box below your result listing on Google.">Sitelinks Search Support</th>
116
+ <td><span class="dashicons dashicons-yes-alt"></span></td>
117
+ <td><span class="dashicons dashicons-yes-alt"></span></td>
118
+ </tr>
119
+ </tbody>
120
+ <tbody>
121
+ <tr class="f-subheader">
122
+ <th colspan="3">Open Graph Support</th>
123
+ </tr>
124
+ <tr>
125
+ <th data-title="Add open graph tags about yoru home page easily via your settings page.">Home Page Open Graph</th>
126
+ <td><span class="dashicons dashicons-yes-alt"></span></td>
127
+ <td><span class="dashicons dashicons-yes-alt"></span></td>
128
+ </tr>
129
+ <tr>
130
+ <th data-title="Add open graph tags about yoru home page easily via your settings page.">Home Page Twitter Cards</th>
131
+ <td><span class="dashicons dashicons-yes-alt"></span></td>
132
+ <td><span class="dashicons dashicons-yes-alt"></span></td>
133
+ </tr>
134
+ <tr>
135
+ <th data-title="Easily create global open graph tags in the meta tag builder combined with dynamic fields.">Custom Open Graph Tags</th>
136
+ <td><span class="dashicons dashicons-yes-alt"></span></td>
137
+ <td><span class="dashicons dashicons-yes-alt"></span></td>
138
+ </tr>
139
+ <tr>
140
+ <th data-title="Easily create global twitter card tags in the meta tag builder combined with dynamic fields.">Custom Twitter Card Tags</th>
141
+ <td><span class="dashicons dashicons-yes-alt"></span></td>
142
+ <td><span class="dashicons dashicons-yes-alt"></span></td>
143
+ </tr>
144
+ </tbody>
145
+ <tbody>
146
+ <tr class="f-subheader">
147
+ <th colspan="3">Site Verification</th>
148
+ </tr>
149
+ <tr>
150
+ <th data-title="Easy to use section where you can enter .">Verify Google, Bing, Yandex, Twitter, etc.</th>
151
+ <td><span class="dashicons dashicons-yes-alt"></span></td>
152
+ <td><span class="dashicons dashicons-yes-alt"></span></td>
153
+ </tr>
154
+ </tbody>
155
+ <tfoot>
156
+ <tr>
157
+ <th></th>
158
+ <th>
159
+ </th>
160
+ <th>
161
+ <span>From $49</span><span class="deal">Limited Offer!</span>
162
+ <a class="button-primary" href="https://metatagmanager.com?utm_source=gopro-tab&utm_medium=plugin&utm_campaign=plugin" target="_blank">Go Pro!</a>
163
+ </th>
164
+ </tr>
165
+ </tfoot>
166
+ </table>
167
+ </div>
168
+ <script type="text/javascript">
169
+ jQuery(document).ready(function($) {
170
+ tippy('table.features th[data-title]', {
171
+ content: (reference) => reference.getAttribute('data-title'),
172
+ placement : 'bottom-start',
173
+ });
174
+ });
175
+ // popperjs v2.6.0 - MIT License - https://github.com/popperjs/popper-core
176
+ "use strict";!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e=e||self).Popper={})}(this,(function(e){function t(e){return{width:(e=e.getBoundingClientRect()).width,height:e.height,top:e.top,right:e.right,bottom:e.bottom,left:e.left,x:e.left,y:e.top}}function n(e){return"[object Window]"!==e.toString()?(e=e.ownerDocument)&&e.defaultView||window:e}function r(e){return{scrollLeft:(e=n(e)).pageXOffset,scrollTop:e.pageYOffset}}function o(e){return e instanceof n(e).Element||e instanceof Element}function i(e){return e instanceof n(e).HTMLElement||e instanceof HTMLElement}function a(e){return e?(e.nodeName||"").toLowerCase():null}function s(e){return((o(e)?e.ownerDocument:e.document)||window.document).documentElement}function f(e){return t(s(e)).left+r(e).scrollLeft}function c(e){return n(e).getComputedStyle(e)}function p(e){return e=c(e),/auto|scroll|overlay|hidden/.test(e.overflow+e.overflowY+e.overflowX)}function l(e,o,c){void 0===c&&(c=!1);var l=s(o);e=t(e);var u=i(o),d={scrollLeft:0,scrollTop:0},m={x:0,y:0};return(u||!u&&!c)&&(("body"!==a(o)||p(l))&&(d=o!==n(o)&&i(o)?{scrollLeft:o.scrollLeft,scrollTop:o.scrollTop}:r(o)),i(o)?((m=t(o)).x+=o.clientLeft,m.y+=o.clientTop):l&&(m.x=f(l))),{x:e.left+d.scrollLeft-m.x,y:e.top+d.scrollTop-m.y,width:e.width,height:e.height}}function u(e){return{x:e.offsetLeft,y:e.offsetTop,width:e.offsetWidth,height:e.offsetHeight}}function d(e){return"html"===a(e)?e:e.assignedSlot||e.parentNode||e.host||s(e)}function m(e,t){void 0===t&&(t=[]);var r=function e(t){return 0<=["html","body","#document"].indexOf(a(t))?t.ownerDocument.body:i(t)&&p(t)?t:e(d(t))}(e);e="body"===a(r);var o=n(r);return r=e?[o].concat(o.visualViewport||[],p(r)?r:[]):r,t=t.concat(r),e?t:t.concat(m(d(r)))}function h(e){if(!i(e)||"fixed"===c(e).position)return null;if(e=e.offsetParent){var t=s(e);if("body"===a(e)&&"static"===c(e).position&&"static"!==c(t).position)return t}return e}function g(e){for(var t=n(e),r=h(e);r&&0<=["table","td","th"].indexOf(a(r))&&"static"===c(r).position;)r=h(r);if(r&&"body"===a(r)&&"static"===c(r).position)return t;if(!r)e:{for(e=d(e);i(e)&&0>["html","body"].indexOf(a(e));){if("none"!==(r=c(e)).transform||"none"!==r.perspective||r.willChange&&"auto"!==r.willChange){r=e;break e}e=e.parentNode}r=null}return r||t}function v(e){var t=new Map,n=new Set,r=[];return e.forEach((function(e){t.set(e.name,e)})),e.forEach((function(e){n.has(e.name)||function e(o){n.add(o.name),[].concat(o.requires||[],o.requiresIfExists||[]).forEach((function(r){n.has(r)||(r=t.get(r))&&e(r)})),r.push(o)}(e)})),r}function b(e){var t;return function(){return t||(t=new Promise((function(n){Promise.resolve().then((function(){t=void 0,n(e())}))}))),t}}function y(e){return e.split("-")[0]}function O(e,t){var r,o=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if((r=o)&&(r=o instanceof(r=n(o).ShadowRoot)||o instanceof ShadowRoot),r)do{if(t&&e.isSameNode(t))return!0;t=t.parentNode||t.host}while(t);return!1}function w(e){return Object.assign(Object.assign({},e),{},{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function x(e,o){if("viewport"===o){o=n(e);var a=s(e);o=o.visualViewport;var p=a.clientWidth;a=a.clientHeight;var l=0,u=0;o&&(p=o.width,a=o.height,/^((?!chrome|android).)*safari/i.test(navigator.userAgent)||(l=o.offsetLeft,u=o.offsetTop)),e=w(e={width:p,height:a,x:l+f(e),y:u})}else i(o)?((e=t(o)).top+=o.clientTop,e.left+=o.clientLeft,e.bottom=e.top+o.clientHeight,e.right=e.left+o.clientWidth,e.width=o.clientWidth,e.height=o.clientHeight,e.x=e.left,e.y=e.top):(u=s(e),e=s(u),l=r(u),o=u.ownerDocument.body,p=Math.max(e.scrollWidth,e.clientWidth,o?o.scrollWidth:0,o?o.clientWidth:0),a=Math.max(e.scrollHeight,e.clientHeight,o?o.scrollHeight:0,o?o.clientHeight:0),u=-l.scrollLeft+f(u),l=-l.scrollTop,"rtl"===c(o||e).direction&&(u+=Math.max(e.clientWidth,o?o.clientWidth:0)-p),e=w({width:p,height:a,x:u,y:l}));return e}function j(e,t,n){return t="clippingParents"===t?function(e){var t=m(d(e)),n=0<=["absolute","fixed"].indexOf(c(e).position)&&i(e)?g(e):e;return o(n)?t.filter((function(e){return o(e)&&O(e,n)&&"body"!==a(e)})):[]}(e):[].concat(t),(n=(n=[].concat(t,[n])).reduce((function(t,n){return n=x(e,n),t.top=Math.max(n.top,t.top),t.right=Math.min(n.right,t.right),t.bottom=Math.min(n.bottom,t.bottom),t.left=Math.max(n.left,t.left),t}),x(e,n[0]))).width=n.right-n.left,n.height=n.bottom-n.top,n.x=n.left,n.y=n.top,n}function M(e){return 0<=["top","bottom"].indexOf(e)?"x":"y"}function E(e){var t=e.reference,n=e.element,r=(e=e.placement)?y(e):null;e=e?e.split("-")[1]:null;var o=t.x+t.width/2-n.width/2,i=t.y+t.height/2-n.height/2;switch(r){case"top":o={x:o,y:t.y-n.height};break;case"bottom":o={x:o,y:t.y+t.height};break;case"right":o={x:t.x+t.width,y:i};break;case"left":o={x:t.x-n.width,y:i};break;default:o={x:t.x,y:t.y}}if(null!=(r=r?M(r):null))switch(i="y"===r?"height":"width",e){case"start":o[r]-=t[i]/2-n[i]/2;break;case"end":o[r]+=t[i]/2-n[i]/2}return o}function D(e){return Object.assign(Object.assign({},{top:0,right:0,bottom:0,left:0}),e)}function P(e,t){return t.reduce((function(t,n){return t[n]=e,t}),{})}function L(e,n){void 0===n&&(n={});var r=n;n=void 0===(n=r.placement)?e.placement:n;var i=r.boundary,a=void 0===i?"clippingParents":i,f=void 0===(i=r.rootBoundary)?"viewport":i;i=void 0===(i=r.elementContext)?"popper":i;var c=r.altBoundary,p=void 0!==c&&c;r=D("number"!=typeof(r=void 0===(r=r.padding)?0:r)?r:P(r,T));var l=e.elements.reference;c=e.rects.popper,a=j(o(p=e.elements[p?"popper"===i?"reference":"popper":i])?p:p.contextElement||s(e.elements.popper),a,f),p=E({reference:f=t(l),element:c,strategy:"absolute",placement:n}),c=w(Object.assign(Object.assign({},c),p)),f="popper"===i?c:f;var u={top:a.top-f.top+r.top,bottom:f.bottom-a.bottom+r.bottom,left:a.left-f.left+r.left,right:f.right-a.right+r.right};if(e=e.modifiersData.offset,"popper"===i&&e){var d=e[n];Object.keys(u).forEach((function(e){var t=0<=["right","bottom"].indexOf(e)?1:-1,n=0<=["top","bottom"].indexOf(e)?"y":"x";u[e]+=d[n]*t}))}return u}function k(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return!t.some((function(e){return!(e&&"function"==typeof e.getBoundingClientRect)}))}function B(e){void 0===e&&(e={});var t=e.defaultModifiers,n=void 0===t?[]:t,r=void 0===(e=e.defaultOptions)?V:e;return function(e,t,i){function a(){f.forEach((function(e){return e()})),f=[]}void 0===i&&(i=r);var s={placement:"bottom",orderedModifiers:[],options:Object.assign(Object.assign({},V),r),modifiersData:{},elements:{reference:e,popper:t},attributes:{},styles:{}},f=[],c=!1,p={state:s,setOptions:function(i){return a(),s.options=Object.assign(Object.assign(Object.assign({},r),s.options),i),s.scrollParents={reference:o(e)?m(e):e.contextElement?m(e.contextElement):[],popper:m(t)},i=function(e){var t=v(e);return N.reduce((function(e,n){return e.concat(t.filter((function(e){return e.phase===n})))}),[])}(function(e){var t=e.reduce((function(e,t){var n=e[t.name];return e[t.name]=n?Object.assign(Object.assign(Object.assign({},n),t),{},{options:Object.assign(Object.assign({},n.options),t.options),data:Object.assign(Object.assign({},n.data),t.data)}):t,e}),{});return Object.keys(t).map((function(e){return t[e]}))}([].concat(n,s.options.modifiers))),s.orderedModifiers=i.filter((function(e){return e.enabled})),s.orderedModifiers.forEach((function(e){var t=e.name,n=e.options;n=void 0===n?{}:n,"function"==typeof(e=e.effect)&&(t=e({state:s,name:t,instance:p,options:n}),f.push(t||function(){}))})),p.update()},forceUpdate:function(){if(!c){var e=s.elements,t=e.reference;if(k(t,e=e.popper))for(s.rects={reference:l(t,g(e),"fixed"===s.options.strategy),popper:u(e)},s.reset=!1,s.placement=s.options.placement,s.orderedModifiers.forEach((function(e){return s.modifiersData[e.name]=Object.assign({},e.data)})),t=0;t<s.orderedModifiers.length;t++)if(!0===s.reset)s.reset=!1,t=-1;else{var n=s.orderedModifiers[t];e=n.fn;var r=n.options;r=void 0===r?{}:r,n=n.name,"function"==typeof e&&(s=e({state:s,options:r,name:n,instance:p})||s)}}},update:b((function(){return new Promise((function(e){p.forceUpdate(),e(s)}))})),destroy:function(){a(),c=!0}};return k(e,t)?(p.setOptions(i).then((function(e){!c&&i.onFirstUpdate&&i.onFirstUpdate(e)})),p):p}}function W(e){var t,r=e.popper,o=e.popperRect,i=e.placement,a=e.offsets,f=e.position,c=e.gpuAcceleration,p=e.adaptive;e.roundOffsets?(e=window.devicePixelRatio||1,e={x:Math.round(a.x*e)/e||0,y:Math.round(a.y*e)/e||0}):e=a;var l=e;e=void 0===(e=l.x)?0:e,l=void 0===(l=l.y)?0:l;var u=a.hasOwnProperty("x");a=a.hasOwnProperty("y");var d,m="left",h="top",v=window;if(p){var b=g(r);b===n(r)&&(b=s(r)),"top"===i&&(h="bottom",l-=b.clientHeight-o.height,l*=c?1:-1),"left"===i&&(m="right",e-=b.clientWidth-o.width,e*=c?1:-1)}return r=Object.assign({position:f},p&&z),c?Object.assign(Object.assign({},r),{},((d={})[h]=a?"0":"",d[m]=u?"0":"",d.transform=2>(v.devicePixelRatio||1)?"translate("+e+"px, "+l+"px)":"translate3d("+e+"px, "+l+"px, 0)",d)):Object.assign(Object.assign({},r),{},((t={})[h]=a?l+"px":"",t[m]=u?e+"px":"",t.transform="",t))}function A(e){return e.replace(/left|right|bottom|top/g,(function(e){return G[e]}))}function H(e){return e.replace(/start|end/g,(function(e){return J[e]}))}function R(e,t,n){return void 0===n&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function S(e){return["top","right","bottom","left"].some((function(t){return 0<=e[t]}))}var T=["top","bottom","right","left"],q=T.reduce((function(e,t){return e.concat([t+"-start",t+"-end"])}),[]),C=[].concat(T,["auto"]).reduce((function(e,t){return e.concat([t,t+"-start",t+"-end"])}),[]),N="beforeRead read afterRead beforeMain main afterMain beforeWrite write afterWrite".split(" "),V={placement:"bottom",modifiers:[],strategy:"absolute"},I={passive:!0},_={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(e){var t=e.state,r=e.instance,o=(e=e.options).scroll,i=void 0===o||o,a=void 0===(e=e.resize)||e,s=n(t.elements.popper),f=[].concat(t.scrollParents.reference,t.scrollParents.popper);return i&&f.forEach((function(e){e.addEventListener("scroll",r.update,I)})),a&&s.addEventListener("resize",r.update,I),function(){i&&f.forEach((function(e){e.removeEventListener("scroll",r.update,I)})),a&&s.removeEventListener("resize",r.update,I)}},data:{}},U={name:"popperOffsets",enabled:!0,phase:"read",fn:function(e){var t=e.state;t.modifiersData[e.name]=E({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})},data:{}},z={top:"auto",right:"auto",bottom:"auto",left:"auto"},F={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(e){var t=e.state,n=e.options;e=void 0===(e=n.gpuAcceleration)||e;var r=n.adaptive;r=void 0===r||r,n=void 0===(n=n.roundOffsets)||n,e={placement:y(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:e},null!=t.modifiersData.popperOffsets&&(t.styles.popper=Object.assign(Object.assign({},t.styles.popper),W(Object.assign(Object.assign({},e),{},{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:r,roundOffsets:n})))),null!=t.modifiersData.arrow&&(t.styles.arrow=Object.assign(Object.assign({},t.styles.arrow),W(Object.assign(Object.assign({},e),{},{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:n})))),t.attributes.popper=Object.assign(Object.assign({},t.attributes.popper),{},{"data-popper-placement":t.placement})},data:{}},X={name:"applyStyles",enabled:!0,phase:"write",fn:function(e){var t=e.state;Object.keys(t.elements).forEach((function(e){var n=t.styles[e]||{},r=t.attributes[e]||{},o=t.elements[e];i(o)&&a(o)&&(Object.assign(o.style,n),Object.keys(r).forEach((function(e){var t=r[e];!1===t?o.removeAttribute(e):o.setAttribute(e,!0===t?"":t)})))}))},effect:function(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach((function(e){var r=t.elements[e],o=t.attributes[e]||{};e=Object.keys(t.styles.hasOwnProperty(e)?t.styles[e]:n[e]).reduce((function(e,t){return e[t]="",e}),{}),i(r)&&a(r)&&(Object.assign(r.style,e),Object.keys(o).forEach((function(e){r.removeAttribute(e)})))}))}},requires:["computeStyles"]},Y={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(e){var t=e.state,n=e.name,r=void 0===(e=e.options.offset)?[0,0]:e,o=(e=C.reduce((function(e,n){var o=t.rects,i=y(n),a=0<=["left","top"].indexOf(i)?-1:1,s="function"==typeof r?r(Object.assign(Object.assign({},o),{},{placement:n})):r;return o=(o=s[0])||0,s=((s=s[1])||0)*a,i=0<=["left","right"].indexOf(i)?{x:s,y:o}:{x:o,y:s},e[n]=i,e}),{}))[t.placement],i=o.x;o=o.y,null!=t.modifiersData.popperOffsets&&(t.modifiersData.popperOffsets.x+=i,t.modifiersData.popperOffsets.y+=o),t.modifiersData[n]=e}},G={left:"right",right:"left",bottom:"top",top:"bottom"},J={start:"end",end:"start"},K={name:"flip",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options;if(e=e.name,!t.modifiersData[e]._skip){var r=n.mainAxis;r=void 0===r||r;var o=n.altAxis;o=void 0===o||o;var i=n.fallbackPlacements,a=n.padding,s=n.boundary,f=n.rootBoundary,c=n.altBoundary,p=n.flipVariations,l=void 0===p||p,u=n.allowedAutoPlacements;p=y(n=t.options.placement),i=i||(p!==n&&l?function(e){if("auto"===y(e))return[];var t=A(e);return[H(e),t,H(t)]}(n):[A(n)]);var d=[n].concat(i).reduce((function(e,n){return e.concat("auto"===y(n)?function(e,t){void 0===t&&(t={});var n=t.boundary,r=t.rootBoundary,o=t.padding,i=t.flipVariations,a=t.allowedAutoPlacements,s=void 0===a?C:a,f=t.placement.split("-")[1];0===(i=(t=f?i?q:q.filter((function(e){return e.split("-")[1]===f})):T).filter((function(e){return 0<=s.indexOf(e)}))).length&&(i=t);var c=i.reduce((function(t,i){return t[i]=L(e,{placement:i,boundary:n,rootBoundary:r,padding:o})[y(i)],t}),{});return Object.keys(c).sort((function(e,t){return c[e]-c[t]}))}(t,{placement:n,boundary:s,rootBoundary:f,padding:a,flipVariations:l,allowedAutoPlacements:u}):n)}),[]);n=t.rects.reference,i=t.rects.popper;var m=new Map;p=!0;for(var h=d[0],g=0;g<d.length;g++){var v=d[g],b=y(v),O="start"===v.split("-")[1],w=0<=["top","bottom"].indexOf(b),x=w?"width":"height",j=L(t,{placement:v,boundary:s,rootBoundary:f,altBoundary:c,padding:a});if(O=w?O?"right":"left":O?"bottom":"top",n[x]>i[x]&&(O=A(O)),x=A(O),w=[],r&&w.push(0>=j[b]),o&&w.push(0>=j[O],0>=j[x]),w.every((function(e){return e}))){h=v,p=!1;break}m.set(v,w)}if(p)for(r=function(e){var t=d.find((function(t){if(t=m.get(t))return t.slice(0,e).every((function(e){return e}))}));if(t)return h=t,"break"},o=l?3:1;0<o&&"break"!==r(o);o--);t.placement!==h&&(t.modifiersData[e]._skip=!0,t.placement=h,t.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}},Q={name:"preventOverflow",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options;e=e.name;var r=n.mainAxis,o=void 0===r||r;r=void 0!==(r=n.altAxis)&&r;var i=n.tether;i=void 0===i||i;var a=n.tetherOffset,s=void 0===a?0:a;n=L(t,{boundary:n.boundary,rootBoundary:n.rootBoundary,padding:n.padding,altBoundary:n.altBoundary}),a=y(t.placement);var f=t.placement.split("-")[1],c=!f,p=M(a);a="x"===p?"y":"x";var l=t.modifiersData.popperOffsets,d=t.rects.reference,m=t.rects.popper,h="function"==typeof s?s(Object.assign(Object.assign({},t.rects),{},{placement:t.placement})):s;if(s={x:0,y:0},l){if(o){var v="y"===p?"top":"left",b="y"===p?"bottom":"right",O="y"===p?"height":"width";o=l[p];var w=l[p]+n[v],x=l[p]-n[b],j=i?-m[O]/2:0,E="start"===f?d[O]:m[O];f="start"===f?-m[O]:-d[O],m=t.elements.arrow,m=i&&m?u(m):{width:0,height:0};var D=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0};v=D[v],b=D[b],m=Math.max(0,Math.min(d[O],m[O])),E=c?d[O]/2-j-m-v-h:E-m-v-h,c=c?-d[O]/2+j+m+b+h:f+m+b+h,h=t.elements.arrow&&g(t.elements.arrow),d=t.modifiersData.offset?t.modifiersData.offset[t.placement][p]:0,h=l[p]+E-d-(h?"y"===p?h.clientTop||0:h.clientLeft||0:0),c=l[p]+c-d,i=Math.max(i?Math.min(w,h):w,Math.min(o,i?Math.max(x,c):x)),l[p]=i,s[p]=i-o}r&&(r=l[a],i=Math.max(r+n["x"===p?"top":"left"],Math.min(r,r-n["x"===p?"bottom":"right"])),l[a]=i,s[a]=i-r),t.modifiersData[e]=s}},requiresIfExists:["offset"]},Z={name:"arrow",enabled:!0,phase:"main",fn:function(e){var t,n=e.state;e=e.name;var r=n.elements.arrow,o=n.modifiersData.popperOffsets,i=y(n.placement),a=M(i);if(i=0<=["left","right"].indexOf(i)?"height":"width",r&&o){var s=n.modifiersData[e+"#persistent"].padding,f=u(r),c="y"===a?"top":"left",p="y"===a?"bottom":"right",l=n.rects.reference[i]+n.rects.reference[a]-o[a]-n.rects.popper[i];o=o[a]-n.rects.reference[a],l=(r=(r=g(r))?"y"===a?r.clientHeight||0:r.clientWidth||0:0)/2-f[i]/2+(l/2-o/2),i=Math.max(s[c],Math.min(l,r-f[i]-s[p])),n.modifiersData[e]=((t={})[a]=i,t.centerOffset=i-l,t)}},effect:function(e){var t=e.state,n=e.options;e=e.name;var r=n.element;if(r=void 0===r?"[data-popper-arrow]":r,n=void 0===(n=n.padding)?0:n,null!=r){if("string"==typeof r&&!(r=t.elements.popper.querySelector(r)))return;O(t.elements.popper,r)&&(t.elements.arrow=r,t.modifiersData[e+"#persistent"]={padding:D("number"!=typeof n?n:P(n,T))})}},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]},$={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(e){var t=e.state;e=e.name;var n=t.rects.reference,r=t.rects.popper,o=t.modifiersData.preventOverflow,i=L(t,{elementContext:"reference"}),a=L(t,{altBoundary:!0});n=R(i,n),r=R(a,r,o),o=S(n),a=S(r),t.modifiersData[e]={referenceClippingOffsets:n,popperEscapeOffsets:r,isReferenceHidden:o,hasPopperEscaped:a},t.attributes.popper=Object.assign(Object.assign({},t.attributes.popper),{},{"data-popper-reference-hidden":o,"data-popper-escaped":a})}},ee=B({defaultModifiers:[_,U,F,X]}),te=[_,U,F,X,Y,K,Q,Z,$],ne=B({defaultModifiers:te});e.applyStyles=X,e.arrow=Z,e.computeStyles=F,e.createPopper=ne,e.createPopperLite=ee,e.defaultModifiers=te,e.detectOverflow=L,e.eventListeners=_,e.flip=K,e.hide=$,e.offset=Y,e.popperGenerator=B,e.popperOffsets=U,e.preventOverflow=Q,Object.defineProperty(e,"__esModule",{value:!0})}));
177
+ // tippy.js v6.2.7 - MIT License - https://github.com/atomiks/tippyjs
178
+ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("@popperjs/core")):"function"==typeof define&&define.amd?define(["@popperjs/core"],e):(t=t||self).tippy=e(t.Popper)}(this,(function(t){"use strict";var e="undefined"!=typeof window&&"undefined"!=typeof document,n=e?navigator.userAgent:"",r=/MSIE |Trident\//.test(n),i={passive:!0,capture:!0};function o(t,e,n){if(Array.isArray(t)){var r=t[e];return null==r?Array.isArray(n)?n[e]:n:r}return t}function a(t,e){var n={}.toString.call(t);return 0===n.indexOf("[object")&&n.indexOf(e+"]")>-1}function s(t,e){return"function"==typeof t?t.apply(void 0,e):t}function u(t,e){return 0===e?t:function(r){clearTimeout(n),n=setTimeout((function(){t(r)}),e)};var n}function c(t,e){var n=Object.assign({},t);return e.forEach((function(t){delete n[t]})),n}function p(t){return[].concat(t)}function f(t,e){-1===t.indexOf(e)&&t.push(e)}function l(t){return t.split("-")[0]}function d(t){return[].slice.call(t)}function v(){return document.createElement("div")}function m(t){return["Element","Fragment"].some((function(e){return a(t,e)}))}function g(t){return a(t,"MouseEvent")}function h(t){return!(!t||!t._tippy||t._tippy.reference!==t)}function b(t){return m(t)?[t]:function(t){return a(t,"NodeList")}(t)?d(t):Array.isArray(t)?t:d(document.querySelectorAll(t))}function y(t,e){t.forEach((function(t){t&&(t.style.transitionDuration=e+"ms")}))}function x(t,e){t.forEach((function(t){t&&t.setAttribute("data-state",e)}))}function w(t){var e=p(t)[0];return e&&e.ownerDocument||document}function E(t,e,n){var r=e+"EventListener";["transitionend","webkitTransitionEnd"].forEach((function(e){t[r](e,n)}))}var T={isTouch:!1},C=0;function A(){T.isTouch||(T.isTouch=!0,window.performance&&document.addEventListener("mousemove",O))}function O(){var t=performance.now();t-C<20&&(T.isTouch=!1,document.removeEventListener("mousemove",O)),C=t}function L(){var t=document.activeElement;if(h(t)){var e=t._tippy;t.blur&&!e.state.isVisible&&t.blur()}}var D=Object.assign({appendTo:function(){return document.body},aria:{content:"auto",expanded:"auto"},delay:0,duration:[300,250],getReferenceClientRect:null,hideOnClick:!0,ignoreAttributes:!1,interactive:!1,interactiveBorder:2,interactiveDebounce:0,moveTransition:"",offset:[0,10],onAfterUpdate:function(){},onBeforeUpdate:function(){},onCreate:function(){},onDestroy:function(){},onHidden:function(){},onHide:function(){},onMount:function(){},onShow:function(){},onShown:function(){},onTrigger:function(){},onUntrigger:function(){},onClickOutside:function(){},placement:"top",plugins:[],popperOptions:{},render:null,showOnCreate:!1,touch:!0,trigger:"mouseenter focus",triggerTarget:null},{animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},{},{allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999}),k=Object.keys(D);function R(t){var e=(t.plugins||[]).reduce((function(e,n){var r=n.name,i=n.defaultValue;return r&&(e[r]=void 0!==t[r]?t[r]:i),e}),{});return Object.assign({},t,{},e)}function M(t,e){var n=Object.assign({},e,{content:s(e.content,[t])},e.ignoreAttributes?{}:function(t,e){return(e?Object.keys(R(Object.assign({},D,{plugins:e}))):k).reduce((function(e,n){var r=(t.getAttribute("data-tippy-"+n)||"").trim();if(!r)return e;if("content"===n)e[n]=r;else try{e[n]=JSON.parse(r)}catch(t){e[n]=r}return e}),{})}(t,e.plugins));return n.aria=Object.assign({},D.aria,{},n.aria),n.aria={expanded:"auto"===n.aria.expanded?e.interactive:n.aria.expanded,content:"auto"===n.aria.content?e.interactive?null:"describedby":n.aria.content},n}function P(t,e){t.innerHTML=e}function V(t){var e=v();return!0===t?e.className="tippy-arrow":(e.className="tippy-svg-arrow",m(t)?e.appendChild(t):P(e,t)),e}function j(t,e){m(e.content)?(P(t,""),t.appendChild(e.content)):"function"!=typeof e.content&&(e.allowHTML?P(t,e.content):t.textContent=e.content)}function I(t){var e=t.firstElementChild,n=d(e.children);return{box:e,content:n.find((function(t){return t.classList.contains("tippy-content")})),arrow:n.find((function(t){return t.classList.contains("tippy-arrow")||t.classList.contains("tippy-svg-arrow")})),backdrop:n.find((function(t){return t.classList.contains("tippy-backdrop")}))}}function S(t){var e=v(),n=v();n.className="tippy-box",n.setAttribute("data-state","hidden"),n.setAttribute("tabindex","-1");var r=v();function i(n,r){var i=I(e),o=i.box,a=i.content,s=i.arrow;r.theme?o.setAttribute("data-theme",r.theme):o.removeAttribute("data-theme"),"string"==typeof r.animation?o.setAttribute("data-animation",r.animation):o.removeAttribute("data-animation"),r.inertia?o.setAttribute("data-inertia",""):o.removeAttribute("data-inertia"),o.style.maxWidth="number"==typeof r.maxWidth?r.maxWidth+"px":r.maxWidth,r.role?o.setAttribute("role",r.role):o.removeAttribute("role"),n.content===r.content&&n.allowHTML===r.allowHTML||j(a,t.props),r.arrow?s?n.arrow!==r.arrow&&(o.removeChild(s),o.appendChild(V(r.arrow))):o.appendChild(V(r.arrow)):s&&o.removeChild(s)}return r.className="tippy-content",r.setAttribute("data-state","hidden"),j(r,t.props),e.appendChild(n),n.appendChild(r),i(t.props,t.props),{popper:e,onUpdate:i}}S.$$tippy=!0;var B=1,H=[],N=[];function U(e,n){var a,c,m,h,b,C,A,O,L,k=M(e,Object.assign({},D,{},R((a=n,Object.keys(a).reduce((function(t,e){return void 0!==a[e]&&(t[e]=a[e]),t}),{}))))),P=!1,V=!1,j=!1,S=!1,U=[],_=u(bt,k.interactiveDebounce),z=B++,F=(L=k.plugins).filter((function(t,e){return L.indexOf(t)===e})),W={id:z,reference:e,popper:v(),popperInstance:null,props:k,state:{isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},plugins:F,clearDelayTimeouts:function(){clearTimeout(c),clearTimeout(m),cancelAnimationFrame(h)},setProps:function(t){if(W.state.isDestroyed)return;it("onBeforeUpdate",[W,t]),gt();var n=W.props,r=M(e,Object.assign({},W.props,{},t,{ignoreAttributes:!0}));W.props=r,mt(),n.interactiveDebounce!==r.interactiveDebounce&&(st(),_=u(bt,r.interactiveDebounce));n.triggerTarget&&!r.triggerTarget?p(n.triggerTarget).forEach((function(t){t.removeAttribute("aria-expanded")})):r.triggerTarget&&e.removeAttribute("aria-expanded");at(),rt(),q&&q(n,r);W.popperInstance&&(Et(),Ct().forEach((function(t){requestAnimationFrame(t._tippy.popperInstance.forceUpdate)})));it("onAfterUpdate",[W,t])},setContent:function(t){W.setProps({content:t})},show:function(){var t=W.state.isVisible,e=W.state.isDestroyed,n=!W.state.isEnabled,r=T.isTouch&&!W.props.touch,i=o(W.props.duration,0,D.duration);if(t||e||n||r)return;if(Z().hasAttribute("disabled"))return;if(it("onShow",[W],!1),!1===W.props.onShow(W))return;W.state.isVisible=!0,Q()&&(Y.style.visibility="visible");rt(),ft(),W.state.isMounted||(Y.style.transition="none");if(Q()){var a=et(),u=a.box,c=a.content;y([u,c],0)}A=function(){if(W.state.isVisible&&!S){if(S=!0,Y.offsetHeight,Y.style.transition=W.props.moveTransition,Q()&&W.props.animation){var t=et(),e=t.box,n=t.content;y([e,n],i),x([e,n],"visible")}ot(),at(),f(N,W),W.state.isMounted=!0,it("onMount",[W]),W.props.animation&&Q()&&function(t,e){dt(t,e)}(i,(function(){W.state.isShown=!0,it("onShown",[W])}))}},function(){var t,e=W.props.appendTo,n=Z();t=W.props.interactive&&e===D.appendTo||"parent"===e?n.parentNode:s(e,[n]);t.contains(Y)||t.appendChild(Y);Et()}()},hide:function(){var t=!W.state.isVisible,e=W.state.isDestroyed,n=!W.state.isEnabled,r=o(W.props.duration,1,D.duration);if(t||e||n)return;if(it("onHide",[W],!1),!1===W.props.onHide(W))return;W.state.isVisible=!1,W.state.isShown=!1,S=!1,P=!1,Q()&&(Y.style.visibility="hidden");if(st(),lt(),rt(),Q()){var i=et(),a=i.box,s=i.content;W.props.animation&&(y([a,s],r),x([a,s],"hidden"))}ot(),at(),W.props.animation?Q()&&function(t,e){dt(t,(function(){!W.state.isVisible&&Y.parentNode&&Y.parentNode.contains(Y)&&e()}))}(r,W.unmount):W.unmount()},hideWithInteractivity:function(t){tt().addEventListener("mousemove",_),f(H,_),_(t)},enable:function(){W.state.isEnabled=!0},disable:function(){W.hide(),W.state.isEnabled=!1},unmount:function(){W.state.isVisible&&W.hide();if(!W.state.isMounted)return;Tt(),Ct().forEach((function(t){t._tippy.unmount()})),Y.parentNode&&Y.parentNode.removeChild(Y);N=N.filter((function(t){return t!==W})),W.state.isMounted=!1,it("onHidden",[W])},destroy:function(){if(W.state.isDestroyed)return;W.clearDelayTimeouts(),W.unmount(),gt(),delete e._tippy,W.state.isDestroyed=!0,it("onDestroy",[W])}};if(!k.render)return W;var X=k.render(W),Y=X.popper,q=X.onUpdate;Y.setAttribute("data-tippy-root",""),Y.id="tippy-"+W.id,W.popper=Y,e._tippy=W,Y._tippy=W;var $=F.map((function(t){return t.fn(W)})),J=e.hasAttribute("aria-expanded");return mt(),at(),rt(),it("onCreate",[W]),k.showOnCreate&&At(),Y.addEventListener("mouseenter",(function(){W.props.interactive&&W.state.isVisible&&W.clearDelayTimeouts()})),Y.addEventListener("mouseleave",(function(t){W.props.interactive&&W.props.trigger.indexOf("mouseenter")>=0&&(tt().addEventListener("mousemove",_),_(t))})),W;function G(){var t=W.props.touch;return Array.isArray(t)?t:[t,0]}function K(){return"hold"===G()[0]}function Q(){var t;return!!(null==(t=W.props.render)?void 0:t.$$tippy)}function Z(){return O||e}function tt(){var t=Z().parentNode;return t?w(t):document}function et(){return I(Y)}function nt(t){return W.state.isMounted&&!W.state.isVisible||T.isTouch||b&&"focus"===b.type?0:o(W.props.delay,t?0:1,D.delay)}function rt(){Y.style.pointerEvents=W.props.interactive&&W.state.isVisible?"":"none",Y.style.zIndex=""+W.props.zIndex}function it(t,e,n){var r;(void 0===n&&(n=!0),$.forEach((function(n){n[t]&&n[t].apply(void 0,e)})),n)&&(r=W.props)[t].apply(r,e)}function ot(){var t=W.props.aria;if(t.content){var n="aria-"+t.content,r=Y.id;p(W.props.triggerTarget||e).forEach((function(t){var e=t.getAttribute(n);if(W.state.isVisible)t.setAttribute(n,e?e+" "+r:r);else{var i=e&&e.replace(r,"").trim();i?t.setAttribute(n,i):t.removeAttribute(n)}}))}}function at(){!J&&W.props.aria.expanded&&p(W.props.triggerTarget||e).forEach((function(t){W.props.interactive?t.setAttribute("aria-expanded",W.state.isVisible&&t===Z()?"true":"false"):t.removeAttribute("aria-expanded")}))}function st(){tt().removeEventListener("mousemove",_),H=H.filter((function(t){return t!==_}))}function ut(t){if(!(T.isTouch&&(j||"mousedown"===t.type)||W.props.interactive&&Y.contains(t.target))){if(Z().contains(t.target)){if(T.isTouch)return;if(W.state.isVisible&&W.props.trigger.indexOf("click")>=0)return}else it("onClickOutside",[W,t]);!0===W.props.hideOnClick&&(W.clearDelayTimeouts(),W.hide(),V=!0,setTimeout((function(){V=!1})),W.state.isMounted||lt())}}function ct(){j=!0}function pt(){j=!1}function ft(){var t=tt();t.addEventListener("mousedown",ut,!0),t.addEventListener("touchend",ut,i),t.addEventListener("touchstart",pt,i),t.addEventListener("touchmove",ct,i)}function lt(){var t=tt();t.removeEventListener("mousedown",ut,!0),t.removeEventListener("touchend",ut,i),t.removeEventListener("touchstart",pt,i),t.removeEventListener("touchmove",ct,i)}function dt(t,e){var n=et().box;function r(t){t.target===n&&(E(n,"remove",r),e())}if(0===t)return e();E(n,"remove",C),E(n,"add",r),C=r}function vt(t,n,r){void 0===r&&(r=!1),p(W.props.triggerTarget||e).forEach((function(e){e.addEventListener(t,n,r),U.push({node:e,eventType:t,handler:n,options:r})}))}function mt(){var t;K()&&(vt("touchstart",ht,{passive:!0}),vt("touchend",yt,{passive:!0})),(t=W.props.trigger,t.split(/\s+/).filter(Boolean)).forEach((function(t){if("manual"!==t)switch(vt(t,ht),t){case"mouseenter":vt("mouseleave",yt);break;case"focus":vt(r?"focusout":"blur",xt);break;case"focusin":vt("focusout",xt)}}))}function gt(){U.forEach((function(t){var e=t.node,n=t.eventType,r=t.handler,i=t.options;e.removeEventListener(n,r,i)})),U=[]}function ht(t){var e,n=!1;if(W.state.isEnabled&&!wt(t)&&!V){var r="focus"===(null==(e=b)?void 0:e.type);b=t,O=t.currentTarget,at(),!W.state.isVisible&&g(t)&&H.forEach((function(e){return e(t)})),"click"===t.type&&(W.props.trigger.indexOf("mouseenter")<0||P)&&!1!==W.props.hideOnClick&&W.state.isVisible?n=!0:At(t),"click"===t.type&&(P=!n),n&&!r&&Ot(t)}}function bt(t){var e=t.target,n=Z().contains(e)||Y.contains(e);"mousemove"===t.type&&n||function(t,e){var n=e.clientX,r=e.clientY;return t.every((function(t){var e=t.popperRect,i=t.popperState,o=t.props.interactiveBorder,a=l(i.placement),s=i.modifiersData.offset;if(!s)return!0;var u="bottom"===a?s.top.y:0,c="top"===a?s.bottom.y:0,p="right"===a?s.left.x:0,f="left"===a?s.right.x:0,d=e.top-r+u>o,v=r-e.bottom-c>o,m=e.left-n+p>o,g=n-e.right-f>o;return d||v||m||g}))}(Ct().concat(Y).map((function(t){var e,n=null==(e=t._tippy.popperInstance)?void 0:e.state;return n?{popperRect:t.getBoundingClientRect(),popperState:n,props:k}:null})).filter(Boolean),t)&&(st(),Ot(t))}function yt(t){wt(t)||W.props.trigger.indexOf("click")>=0&&P||(W.props.interactive?W.hideWithInteractivity(t):Ot(t))}function xt(t){W.props.trigger.indexOf("focusin")<0&&t.target!==Z()||W.props.interactive&&t.relatedTarget&&Y.contains(t.relatedTarget)||Ot(t)}function wt(t){return!!T.isTouch&&K()!==t.type.indexOf("touch")>=0}function Et(){Tt();var n=W.props,r=n.popperOptions,i=n.placement,o=n.offset,a=n.getReferenceClientRect,s=n.moveTransition,u=Q()?I(Y).arrow:null,c=a?{getBoundingClientRect:a,contextElement:a.contextElement||Z()}:e,p=[{name:"offset",options:{offset:o}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!s}},{name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(t){var e=t.state;if(Q()){var n=et().box;["placement","reference-hidden","escaped"].forEach((function(t){"placement"===t?n.setAttribute("data-placement",e.placement):e.attributes.popper["data-popper-"+t]?n.setAttribute("data-"+t,""):n.removeAttribute("data-"+t)})),e.attributes.popper={}}}}];Q()&&u&&p.push({name:"arrow",options:{element:u,padding:3}}),p.push.apply(p,(null==r?void 0:r.modifiers)||[]),W.popperInstance=t.createPopper(c,Y,Object.assign({},r,{placement:i,onFirstUpdate:A,modifiers:p}))}function Tt(){W.popperInstance&&(W.popperInstance.destroy(),W.popperInstance=null)}function Ct(){return d(Y.querySelectorAll("[data-tippy-root]"))}function At(t){W.clearDelayTimeouts(),t&&it("onTrigger",[W,t]),ft();var e=nt(!0),n=G(),r=n[0],i=n[1];T.isTouch&&"hold"===r&&i&&(e=i),e?c=setTimeout((function(){W.show()}),e):W.show()}function Ot(t){if(W.clearDelayTimeouts(),it("onUntrigger",[W,t]),W.state.isVisible){if(!(W.props.trigger.indexOf("mouseenter")>=0&&W.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(t.type)>=0&&P)){var e=nt(!1);e?m=setTimeout((function(){W.state.isVisible&&W.hide()}),e):h=requestAnimationFrame((function(){W.hide()}))}}else lt()}}function _(t,e){void 0===e&&(e={});var n=D.plugins.concat(e.plugins||[]);document.addEventListener("touchstart",A,i),window.addEventListener("blur",L);var r=Object.assign({},e,{plugins:n}),o=b(t).reduce((function(t,e){var n=e&&U(e,r);return n&&t.push(n),t}),[]);return m(t)?o[0]:o}_.defaultProps=D,_.setDefaultProps=function(t){Object.keys(t).forEach((function(e){D[e]=t[e]}))},_.currentInput=T;var z={mouseover:"mouseenter",focusin:"focus",click:"click"};var F={name:"animateFill",defaultValue:!1,fn:function(t){var e;if(!(null==(e=t.props.render)?void 0:e.$$tippy))return{};var n=I(t.popper),r=n.box,i=n.content,o=t.props.animateFill?function(){var t=v();return t.className="tippy-backdrop",x([t],"hidden"),t}():null;return{onCreate:function(){o&&(r.insertBefore(o,r.firstElementChild),r.setAttribute("data-animatefill",""),r.style.overflow="hidden",t.setProps({arrow:!1,animation:"shift-away"}))},onMount:function(){if(o){var t=r.style.transitionDuration,e=Number(t.replace("ms",""));i.style.transitionDelay=Math.round(e/10)+"ms",o.style.transitionDuration=t,x([o],"visible")}},onShow:function(){o&&(o.style.transitionDuration="0ms")},onHide:function(){o&&x([o],"hidden")}}}};var W={clientX:0,clientY:0},X=[];function Y(t){var e=t.clientX,n=t.clientY;W={clientX:e,clientY:n}}var q={name:"followCursor",defaultValue:!1,fn:function(t){var e=t.reference,n=w(t.props.triggerTarget||e),r=!1,i=!1,o=!0,a=t.props;function s(){return"initial"===t.props.followCursor&&t.state.isVisible}function u(){n.addEventListener("mousemove",f)}function c(){n.removeEventListener("mousemove",f)}function p(){r=!0,t.setProps({getReferenceClientRect:null}),r=!1}function f(n){var r=!n.target||e.contains(n.target),i=t.props.followCursor,o=n.clientX,a=n.clientY,s=e.getBoundingClientRect(),u=o-s.left,c=a-s.top;!r&&t.props.interactive||t.setProps({getReferenceClientRect:function(){var t=e.getBoundingClientRect(),n=o,r=a;"initial"===i&&(n=t.left+u,r=t.top+c);var s="horizontal"===i?t.top:r,p="vertical"===i?t.right:n,f="horizontal"===i?t.bottom:r,l="vertical"===i?t.left:n;return{width:p-l,height:f-s,top:s,right:p,bottom:f,left:l}}})}function l(){t.props.followCursor&&(X.push({instance:t,doc:n}),function(t){t.addEventListener("mousemove",Y)}(n))}function d(){0===(X=X.filter((function(e){return e.instance!==t}))).filter((function(t){return t.doc===n})).length&&function(t){t.removeEventListener("mousemove",Y)}(n)}return{onCreate:l,onDestroy:d,onBeforeUpdate:function(){a=t.props},onAfterUpdate:function(e,n){var o=n.followCursor;r||void 0!==o&&a.followCursor!==o&&(d(),o?(l(),!t.state.isMounted||i||s()||u()):(c(),p()))},onMount:function(){t.props.followCursor&&!i&&(o&&(f(W),o=!1),s()||u())},onTrigger:function(t,e){g(e)&&(W={clientX:e.clientX,clientY:e.clientY}),i="focus"===e.type},onHidden:function(){t.props.followCursor&&(p(),c(),o=!0)}}}};var $={name:"inlinePositioning",defaultValue:!1,fn:function(t){var e,n=t.reference;var r=-1,i=!1,o={name:"tippyInlinePositioning",enabled:!0,phase:"afterWrite",fn:function(i){var o=i.state;t.props.inlinePositioning&&(e!==o.placement&&t.setProps({getReferenceClientRect:function(){return function(t){return function(t,e,n,r){if(n.length<2||null===t)return e;if(2===n.length&&r>=0&&n[0].left>n[1].right)return n[r]||e;switch(t){case"top":case"bottom":var i=n[0],o=n[n.length-1],a="top"===t,s=i.top,u=o.bottom,c=a?i.left:o.left,p=a?i.right:o.right;return{top:s,bottom:u,left:c,right:p,width:p-c,height:u-s};case"left":case"right":var f=Math.min.apply(Math,n.map((function(t){return t.left}))),l=Math.max.apply(Math,n.map((function(t){return t.right}))),d=n.filter((function(e){return"left"===t?e.left===f:e.right===l})),v=d[0].top,m=d[d.length-1].bottom;return{top:v,bottom:m,left:f,right:l,width:l-f,height:m-v};default:return e}}(l(t),n.getBoundingClientRect(),d(n.getClientRects()),r)}(o.placement)}}),e=o.placement)}};function a(){var e;i||(e=function(t,e){var n;return{popperOptions:Object.assign({},t.popperOptions,{modifiers:[].concat(((null==(n=t.popperOptions)?void 0:n.modifiers)||[]).filter((function(t){return t.name!==e.name})),[e])})}}(t.props,o),i=!0,t.setProps(e),i=!1)}return{onCreate:a,onAfterUpdate:a,onTrigger:function(e,n){if(g(n)){var i=d(t.reference.getClientRects()),o=i.find((function(t){return t.left-2<=n.clientX&&t.right+2>=n.clientX&&t.top-2<=n.clientY&&t.bottom+2>=n.clientY}));r=i.indexOf(o)}},onUntrigger:function(){r=-1}}}};var J={name:"sticky",defaultValue:!1,fn:function(t){var e=t.reference,n=t.popper;function r(e){return!0===t.props.sticky||t.props.sticky===e}var i=null,o=null;function a(){var s=r("reference")?(t.popperInstance?t.popperInstance.state.elements.reference:e).getBoundingClientRect():null,u=r("popper")?n.getBoundingClientRect():null;(s&&G(i,s)||u&&G(o,u))&&t.popperInstance&&t.popperInstance.update(),i=s,o=u,t.state.isMounted&&requestAnimationFrame(a)}return{onMount:function(){t.props.sticky&&a()}}}};function G(t,e){return!t||!e||(t.top!==e.top||t.right!==e.right||t.bottom!==e.bottom||t.left!==e.left)}return e&&function(t){var e=document.createElement("style");e.textContent=t,e.setAttribute("data-tippy-stylesheet","");var n=document.head,r=document.querySelector("head>style,head>link");r?n.insertBefore(e,r):n.appendChild(e)}('.tippy-box[data-animation=fade][data-state=hidden]{opacity:0}[data-tippy-root]{max-width:calc(100vw - 10px)}.tippy-box{position:relative;background-color:#333;color:#fff;border-radius:4px;font-size:14px;line-height:1.4;outline:0;transition-property:transform,visibility,opacity}.tippy-box[data-placement^=top]>.tippy-arrow{bottom:0}.tippy-box[data-placement^=top]>.tippy-arrow:before{bottom:-7px;left:0;border-width:8px 8px 0;border-top-color:initial;transform-origin:center top}.tippy-box[data-placement^=bottom]>.tippy-arrow{top:0}.tippy-box[data-placement^=bottom]>.tippy-arrow:before{top:-7px;left:0;border-width:0 8px 8px;border-bottom-color:initial;transform-origin:center bottom}.tippy-box[data-placement^=left]>.tippy-arrow{right:0}.tippy-box[data-placement^=left]>.tippy-arrow:before{border-width:8px 0 8px 8px;border-left-color:initial;right:-7px;transform-origin:center left}.tippy-box[data-placement^=right]>.tippy-arrow{left:0}.tippy-box[data-placement^=right]>.tippy-arrow:before{left:-7px;border-width:8px 8px 8px 0;border-right-color:initial;transform-origin:center right}.tippy-box[data-inertia][data-state=visible]{transition-timing-function:cubic-bezier(.54,1.5,.38,1.11)}.tippy-arrow{width:16px;height:16px;color:#333}.tippy-arrow:before{content:"";position:absolute;border-color:transparent;border-style:solid}.tippy-content{position:relative;padding:5px 9px;z-index:1}'),_.setDefaultProps({plugins:[F,q,$,J],render:S}),_.createSingleton=function(t,e){void 0===e&&(e={});var n,r=t,i=[],o=e.overrides,a=[];function s(){i=r.map((function(t){return t.reference}))}function u(t){r.forEach((function(e){t?e.enable():e.disable()}))}function p(t){return r.map((function(e){var r=e.setProps;return e.setProps=function(i){r(i),e.reference===n&&t.setProps(i)},function(){e.setProps=r}}))}u(!1),s();var f={fn:function(){return{onDestroy:function(){u(!0)},onTrigger:function(t,e){var a=e.currentTarget,s=i.indexOf(a);if(a!==n){n=a;var u=(o||[]).concat("content").reduce((function(t,e){return t[e]=r[s].props[e],t}),{});t.setProps(Object.assign({},u,{getReferenceClientRect:"function"==typeof u.getReferenceClientRect?u.getReferenceClientRect:function(){return a.getBoundingClientRect()}}))}}}}},l=_(v(),Object.assign({},c(e,["overrides"]),{plugins:[f].concat(e.plugins||[]),triggerTarget:i})),d=l.setProps;return l.setProps=function(t){o=t.overrides||o,d(t)},l.setInstances=function(t){u(!0),a.forEach((function(t){return t()})),r=t,u(!1),s(),p(l),l.setProps({triggerTarget:i})},a=p(l),l},_.delegate=function(t,e){var n=[],r=[],i=!1,o=e.target,a=c(e,["target"]),s=Object.assign({},a,{trigger:"manual",touch:!1}),u=Object.assign({},a,{showOnCreate:!0}),f=_(t,s);function l(t){if(t.target&&!i){var n=t.target.closest(o);if(n){var a=n.getAttribute("data-tippy-trigger")||e.trigger||D.trigger;if(!n._tippy&&!("touchstart"===t.type&&"boolean"==typeof u.touch||"touchstart"!==t.type&&a.indexOf(z[t.type])<0)){var s=_(n,u);s&&(r=r.concat(s))}}}}function d(t,e,r,i){void 0===i&&(i=!1),t.addEventListener(e,r,i),n.push({node:t,eventType:e,handler:r,options:i})}return p(f).forEach((function(t){var e=t.destroy,o=t.enable,a=t.disable;t.destroy=function(t){void 0===t&&(t=!0),t&&r.forEach((function(t){t.destroy()})),r=[],n.forEach((function(t){var e=t.node,n=t.eventType,r=t.handler,i=t.options;e.removeEventListener(n,r,i)})),n=[],e()},t.enable=function(){o(),r.forEach((function(t){return t.enable()})),i=!1},t.disable=function(){a(),r.forEach((function(t){return t.disable()})),i=!0},function(t){var e=t.reference;d(e,"touchstart",l),d(e,"mouseover",l),d(e,"focusin",l),d(e,"click",l)}(t)})),f},_.hideAll=function(t){var e=void 0===t?{}:t,n=e.exclude,r=e.duration;N.forEach((function(t){var e=!1;if(n&&(e=h(n)?t.reference===n:t.popper===n.popper),!e){var i=t.props.duration;t.setProps({duration:r}),t.hide(),t.state.isDestroyed||t.setProps({duration:i})}}))},_.roundArrow='<svg width="16" height="6" xmlns="http://www.w3.org/2000/svg"><path d="M0 6s1.796-.013 4.67-3.615C5.851.9 6.93.006 8 0c1.07-.006 2.148.887 3.343 2.385C14.233 6.005 16 6 16 6H0z"></svg>',_}));
179
+
180
+ </script>
admin/settings/open-graph.php ADDED
@@ -0,0 +1,97 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ use Meta_Tag_Manager\Open_Graph;
3
+
4
+ global $mtm_submit_button;
5
+ $og = Open_Graph::get_options( false ); // return with defaults merged in
6
+ $test_url_google = "https://search.google.com/test/rich-results?url=" . urlencode(get_site_url());
7
+ $test_url_fb = "https://developers.facebook.com/tools/debug/?q=" . urlencode(get_site_url());
8
+ $test_url_twitter = "https://developers.facebook.com/tools/debug/?q=" . urlencode(get_site_url());
9
+
10
+ ?>
11
+ <p>
12
+ <?php esc_html_e('Open Graph is a widely supported protocol which allows services like Facebook, Twitter, LinkedIn and any other site that parses links to your site to obtain more structured information about your website pages.', 'meta-tag-manager'); ?>
13
+ </p>
14
+ <p>
15
+ <?php esc_html_e('The settings below are specific to the home page of your website.', 'meta-tag-manager'); ?>
16
+ <?php echo sprintf(esc_html__('You can also choose to auto-generate open graph tags below, or generate your own using our meta tag builder in the %s tab above or on individual pages.', 'meta-tag-manager'), esc_html__('Custom Meta Tags','meta-tag-manager')); ?>
17
+ </p>
18
+ <label><input type="checkbox" name="mtm_og_enabled" class="mtm-settings-binary-trigger" data-trigger-content=".mtm-og-settings" value="1" <?php if( !empty($og['enabled']) ) echo 'checked'; ?>> <?php esc_html_e('Enable Open Graph Features', 'meta-tag-manager'); ?></label>
19
+ <div class="mtm-og-settings">
20
+ <h3><?php esc_html_e('Testing and Validation', 'meta-tag-manager'); ?></h3>
21
+ <p>
22
+ <?php
23
+ esc_html_e('Click the buttons below once you have saved your settings, or the \'Save & Test\' buttons at the bottom to save and test. Make sure your information is valid and readable by Google, Facebook, Twitter and others.', 'meta-tag-manager');
24
+ ?>
25
+ </p>
26
+ <p>
27
+ <a href="<?php echo esc_url($test_url_google) ?>" target="_blank" class="button-secondary"><?php echo sprintf(esc_html__('Test Open Graph Settings (%s)', 'meta-tag-manager'), 'Google'); ?></a>
28
+ <a href="<?php echo esc_url($test_url_fb) ?>" target="_blank" class="button-secondary"><?php echo sprintf(esc_html__('Test Open Graph Settings (%s)', 'meta-tag-manager'), 'Facebook'); ?></a>
29
+ <a href="<?php echo esc_url($test_url_twitter) ?>" target="_blank" class="button-secondary"><?php echo sprintf(esc_html__('Test Open Graph Settings (%s)', 'meta-tag-manager'), 'Twitter'); ?></a>
30
+ </p>
31
+ <h3><?php esc_html_e('General Information', 'meta-tag-manager'); ?></h3>
32
+ <table class="form-table">
33
+ <?php
34
+ mtm_input_text( esc_html__('Website Name', 'meta-tag-manager'), 'mtm_og_site_title', $og['home']['title'] );
35
+ mtm_input_text( esc_html__('Website Description', 'meta-tag-manager'), 'mtm_og_site_description', $og['home']['description'] );
36
+ $image_id = empty($og['home']['image']) ? get_theme_mod( 'custom_logo' ) : $og['home']['image'];
37
+ $image = intval( $image_id ) > 0 ? wp_get_attachment_image( $image_id ) : '';
38
+ ?>
39
+ <tr class="mtm-image-upload" data-action="mtm_get_logo_url">
40
+ <th><?php esc_html_e( 'Logo' ); ?></th>
41
+ <td>
42
+ <div class="mtm-image-upload-preview"><?php echo $image; ?></div>
43
+ <input type="hidden" name="mtm_og_site_logo" class="mtm-image-upload-input" value="<?php echo absint($image_id); ?>" class="regular-text">
44
+ <input type='button' class="button-primary mtm-image-upload-submit" value="<?php esc_attr_e('Select Image'); ?>" >
45
+ <input type='button' class="button-secondary mtm-image-upload-reset" value="<?php esc_attr_e('Remove'); ?>" >
46
+ <p><em><?php echo sprintf( esc_html__('The image size must be at least %s and one of the following formats : %s', 'meta-tag-manager'), '112px x 112px', 'BMP, GIF, JPEG, PNG, WebP or SVG'); ?></em></p>
47
+ </td>
48
+ </tr>
49
+ <?php
50
+ $description = esc_html__('If enabled, all posts, pages and custom post types will have default open graph meta tags generated.', 'meta-tag-manager');
51
+ mtm_input_radio_binary( esc_html__('Generate Open Graph for Posts/Pages?', 'meta-tag-manager'), 'mtm_og_generate_singular', $og['generate_singular'], $description );
52
+ ?>
53
+ </table>
54
+
55
+ <h3><?php esc_html_e('Twitter Cards', 'meta-tag-manager'); ?></h3>
56
+ <p>
57
+ <?php esc_html_e('Twitter has an addition open graph format called \'Twitter Cards\', which are similar and complimentary to Open Graph meta tags. You can enable the twitter:card meta tags and add additional information which will give more meaning to your shared links on Twitter.', 'meta-tag-manager'); ?>
58
+ <a href="https://developer.twitter.com/en/docs/twitter-for-websites/cards/guides/getting-started" target="_blank"><?php esc_html_e('Learn More', 'meta-tag-manager'); ?></a>
59
+ </p>
60
+ <p><?php echo sprintf( esc_html__('If enabled, the following meta tag will be added to your Open Graph meta tags : %s', 'meta-tag-manager'), '<code>&lt;meta name="twitter:card" content="summary" /&gt;</code>'); ?></p>
61
+ <p>
62
+ <label><input type="checkbox" name="mtm_og_twitter_enabled" class="mtm-settings-binary-trigger" data-trigger-content=".mtm-og-twitter-card" value="1" <?php if( !empty($og['twitter']['enabled']) ) echo 'checked'; ?>> <?php esc_html_e('Add Twitter Card Meta', 'meta-tag-manager'); ?></label>
63
+ </p>
64
+ <div class="mtm-og-twitter-card">
65
+ <p><?php echo sprintf(esc_html__('You can also generate twitter tags (such as the creator username) via our meta tag builder in the %s settings tab above or on individual pages.', 'meta-tag-manager'), esc_html__('Custom Meta Tags','meta-tag-manager')); ?></p>
66
+ <table class="form-table">
67
+ <?php
68
+ $description = esc_html__('@username on twitter.com for this website or comapny.', 'meta-tag-manager') .' '. esc_html__('This is optional and will be ignored if left blank.', 'meta-tag-manager');
69
+ mtm_input_text( esc_html__('Website Username', 'meta-tag-manager'), 'mtm_og_twitter_site', $og['twitter']['site'], $description, '@username' );
70
+ $description = esc_html__('@username on twitter.com of the content creator / author.', 'meta-tag-manager') .' '. esc_html__('This card will only be shown on the front-page.', 'meta-tag-manager') .' '. esc_html__('This is optional and will be ignored if left blank.', 'meta-tag-manager');
71
+ mtm_input_text( esc_html__('Creator Username', 'meta-tag-manager'), 'mtm_og_twitter_creator', $og['twitter']['creator'], $description, '@username' );
72
+ ?>
73
+ </table>
74
+ </div>
75
+ <?php
76
+ if( !empty($_GET['og_test']) && $_GET['og_test'] == 'google' ) echo '<script type="text/javascript">window.open("'. $test_url_google .'");</script>';
77
+ if( !empty($_GET['og_test']) && $_GET['og_test'] == 'fb' ) echo '<script type="text/javascript">window.open("'. $test_url_fb .'");</script>';
78
+ if( !empty($_GET['og_test']) && $_GET['og_test'] == 'twitter' ) echo '<script type="text/javascript">window.open("'. $test_url_twitter .'");</script>';
79
+ ?>
80
+ </div>
81
+
82
+ <p class="mtm-actions">
83
+ <button type="submit" class="button-primary"><?php esc_html_e('Save Changes','meta-tag-manager'); ?></button>
84
+ </p>
85
+ <p class="mtm-actions mtm-og-settings">
86
+ <button type="submit" class="button-primary mtm-og-save-and-test" data-validator="google"><?php echo sprintf(esc_html__('Save & Test (%s)', 'meta-tag-manager'), 'Google'); ?></button>
87
+ <button type="submit" class="button-primary mtm-og-save-and-test" data-validator="fb"><?php echo sprintf(esc_html__('Save & Test (%s)', 'meta-tag-manager'), 'Facebook'); ?></button>
88
+ <button type="submit" class="button-primary mtm-og-save-and-test" data-validator="twitter"><?php echo sprintf(esc_html__('Save & Test (%s)', 'meta-tag-manager'), 'Twitter'); ?></button>
89
+ </p>
90
+ <script type="text/javascript">
91
+ jQuery(document).ready( function($) {
92
+ $('.mtm-og-save-and-test').on('click', function(){
93
+ var el = $(this);
94
+ el.append('<input type="hidden" name="og_test_afterwards" value="'+ el.data('validator') +'">');
95
+ });
96
+ });
97
+ </script>
admin/settings/schema.php ADDED
@@ -0,0 +1,333 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ use Meta_Tag_Manager\Schema;
3
+
4
+ global $mtm_submit_button;
5
+ $schema = Schema::get_options();
6
+ $test_url_google = "https://search.google.com/test/rich-results?url=" . urlencode(get_site_url());
7
+ $test_url_schemaorg = "https://validator.schema.org/#url=" . urlencode(get_site_url());
8
+
9
+ $schema_types = array(
10
+ 'Person' => array( array( 'description' => esc_html__('Person', 'meta-tag-manager') ), ),
11
+ 'Organization' => array(
12
+ 'description' => esc_html__('Organization'),
13
+ 'types' => array(
14
+ 'Airline' => array( 'description' => esc_html__('Airline', 'meta-tag-manager') ),
15
+ 'Consortium' => array( 'description' => esc_html__('Consortium', 'meta-tag-manager') ),
16
+ 'Corporation' => array( 'description' => esc_html__('Corporation', 'meta-tag-manager') ),
17
+ 'EducationalOrganization' => array(
18
+ 'description' => esc_html__('Educational Organization', 'meta-tag-manager'),
19
+ 'types' => array(
20
+ 'CollegeOrUniversity' => array( 'description' => esc_html__('College Or University', 'meta-tag-manager') ),
21
+ 'ElementarySchool' => array( 'description' => esc_html__('Elementary School', 'meta-tag-manager') ),
22
+ 'HighSchool' => array( 'description' => esc_html__('High School', 'meta-tag-manager') ),
23
+ 'MiddleSchool' => array( 'description' => esc_html__('Middle School', 'meta-tag-manager') ),
24
+ 'Preschool' => array( 'description' => esc_html__('Preschool', 'meta-tag-manager') ),
25
+ 'School' => array( 'description' => esc_html__('School', 'meta-tag-manager') ),
26
+ ),
27
+ ),
28
+ 'FundingScheme' => array( 'description' => esc_html__('Funding Scheme', 'meta-tag-manager') ),
29
+ 'GovernmentOrganization' => array( 'description' => esc_html__('Government Organization', 'meta-tag-manager') ),
30
+ 'LibrarySystem' => array( 'description' => esc_html__('Library System', 'meta-tag-manager') ),
31
+ /*
32
+ 'LocalBusiness' => array(
33
+ 'description' => esc_html__('Local Business', 'meta-tag-manager'),
34
+ 'types' => array(
35
+ 'AnimalShelter' => array('description' => esc_html__('Animal Shelter', 'meta-tag-manager')),
36
+ 'ArchiveOrganization' => array('description' => esc_html__('Archive Organization', 'meta-tag-manager')),
37
+ 'AutomotiveBusiness' => array('description' => esc_html__('Automotive Business', 'meta-tag-manager')),
38
+ 'ChildCare' => array('description' => esc_html__('Child Care', 'meta-tag-manager')),
39
+ 'Dentist' => array('description' => esc_html__('Dentist', 'meta-tag-manager')),
40
+ 'DryCleaningOrLaundry' => array('description' => esc_html__('Dry Cleaning Or Laundry', 'meta-tag-manager')),
41
+ 'EmergencyService' => array('description' => esc_html__('Emergency Service', 'meta-tag-manager')),
42
+ 'EmploymentAgency' => array('description' => esc_html__('Employment Agency', 'meta-tag-manager')),
43
+ 'EntertainmentBusiness' => array('description' => esc_html__('Entertainment Business', 'meta-tag-manager')),
44
+ 'FinancialService' => array('description' => esc_html__('Financial Service', 'meta-tag-manager')),
45
+ 'FoodEstablishment' => array('description' => esc_html__('Food Establishment', 'meta-tag-manager')),
46
+ 'GovernmentOffice' => array('description' => esc_html__('Government Office', 'meta-tag-manager')),
47
+ 'HealthAndBeautyBusiness' => array('description' => esc_html__('Health And Beauty Business', 'meta-tag-manager')),
48
+ 'HomeAndConstructionBusiness' => array('description' => esc_html__('Home And Construction Business', 'meta-tag-manager')),
49
+ 'InternetCafe' => array('description' => esc_html__('Internet Cafe', 'meta-tag-manager')),
50
+ 'LegalService' => array('description' => esc_html__('Legal Service', 'meta-tag-manager')),
51
+ 'Library' => array('description' => esc_html__('Library', 'meta-tag-manager')),
52
+ 'LodgingBusiness' => array('description' => esc_html__('Lodging Business', 'meta-tag-manager')),
53
+ 'MedicalBusiness' => array('description' => esc_html__('Medical Business', 'meta-tag-manager')),
54
+ 'ProfessionalService' => array('description' => esc_html__('Professional Service', 'meta-tag-manager')),
55
+ 'RadioStation' => array('description' => esc_html__('Radio Station', 'meta-tag-manager')),
56
+ 'RealEstateAgent' => array('description' => esc_html__('Real Estate Agent', 'meta-tag-manager')),
57
+ 'RecyclingCenter' => array('description' => esc_html__('Recycling Center', 'meta-tag-manager')),
58
+ 'SelfStorage' => array('description' => esc_html__('Self Storage', 'meta-tag-manager')),
59
+ 'ShoppingCenter' => array('description' => esc_html__('Shopping Center', 'meta-tag-manager')),
60
+ 'SportsActivityLocation' => array('description' => esc_html__('Sports Activity Location', 'meta-tag-manager')),
61
+ 'Store' => array('description' => esc_html__('Store', 'meta-tag-manager')),
62
+ 'TelevisionStation' => array('description' => esc_html__('Television Station', 'meta-tag-manager')),
63
+ 'TouristInformationCenter' => array('description' => esc_html__('Tourist Information Center', 'meta-tag-manager')),
64
+ 'TravelAgency' => array('description' => esc_html__('Travel Agency', 'meta-tag-manager')),
65
+ )
66
+ ),
67
+ */
68
+ 'MedicalOrganization' => array(
69
+ 'description' => esc_html__('Medical Organization', 'meta-tag-manager'),
70
+ 'types' => array(
71
+ 'Dentist' => array( 'description' => esc_html__('Dentist', 'meta-tag-manager') ),
72
+ 'DiagnosticLab' => array( 'description' => esc_html__('Diagnostic Lab', 'meta-tag-manager') ),
73
+ 'Hospital' => array( 'description' => esc_html__('Hospital', 'meta-tag-manager') ),
74
+ 'MedicalClinic' => array( 'description' => esc_html__('Medical Clinic', 'meta-tag-manager') ),
75
+ 'Pharmacy' => array( 'description' => esc_html__('Pharmacy', 'meta-tag-manager') ),
76
+ 'Physician' => array( 'description' => esc_html__('Physician', 'meta-tag-manager') ),
77
+ 'VeterinaryCare' => array( 'description' => esc_html__('Veterinary Care', 'meta-tag-manager') ),
78
+ )
79
+ ),
80
+ 'NGO' => array( 'description' => esc_html__('NGO', 'meta-tag-manager') ),
81
+ 'NewsMediaOrganization' => array( 'description' => esc_html__('News Media Organization', 'meta-tag-manager') ),
82
+ 'PerformingGroup' => array(
83
+ 'description' => esc_html__('Performing Group', 'meta-tag-manager'),
84
+ 'types' => array(
85
+ 'DanceGroup' => array( 'description' => esc_html__('Dance Group', 'meta-tag-manager') ),
86
+ 'MusicGroup' => array( 'description' => esc_html__('Music Group', 'meta-tag-manager') ),
87
+ 'TheaterGroup' => array( 'description' => esc_html__('Theater Group', 'meta-tag-manager') ),
88
+ )
89
+ ),
90
+ 'Project' => array(
91
+ 'description' => esc_html__('Project', 'meta-tag-manager'),
92
+ 'types' => array(
93
+ 'FundingAgency' => array( 'description' => esc_html__('Funding Agency', 'meta-tag-manager') ),
94
+ 'ResearchProject' => array( 'description' => esc_html__('Research Project', 'meta-tag-manager') ),
95
+ ),
96
+ ),
97
+ 'ResearchOrganization' => array( 'description' => esc_html__('Research Organization', 'meta-tag-manager') ),
98
+ 'SportsOrganization' => array(
99
+ 'description' => esc_html__('Sports Organization', 'meta-tag-manager'),
100
+ 'types' => array(
101
+ 'SportsTeam' => array( 'description' => esc_html__('Sports Team', 'meta-tag-manager') ),
102
+ ),
103
+ ),
104
+ 'WorkersUnion' => array( 'description' => esc_html__('Workers Union', 'meta-tag-manager') ),
105
+ ),
106
+ )
107
+ );
108
+ $site_type_options = array(
109
+ '' => esc_html__('Chooase a site type', 'meta-tag-manager'),
110
+ 'Person' => esc_html__('Personal Website or Blog', 'meta-tag-manager'),
111
+ 'Organization' => esc_html__('Business or Organization', 'meta-tag-manager'),
112
+ );
113
+ ?>
114
+ <p>
115
+ <?php esc_html_e('These settings provide search engines and other services that read schema.org meta data information about your website in general. The more information you provide, the more additional information search engines like Google can provide when displaying your site in search results.', 'meta-tag-manager'); ?>
116
+ </p>
117
+ <p>
118
+ <label><input type="checkbox" name="mtm_schema_enabled" class="mtm-settings-binary-trigger" data-trigger-content=".mtm-schema-settings" id="mtm_schema_enabled" value="1" <?php if( !empty($schema['enabled']) ) echo 'checked'; ?>> <?php esc_html_e('Enable Structured Data (Schema) Features', 'meta-tag-manager'); ?></label>
119
+ <div class="mtm-schema-settings">
120
+ </p>
121
+ <p>
122
+ <?php
123
+ esc_html_e('Click the buttons below once you have saved your settings, or the \'Save & Test\' buttons at the bottom to save and test. Make sure your information is valid and readable by Google and others.', 'meta-tag-manager');
124
+ ?>
125
+ </p>
126
+ <p>
127
+ <a href="<?php echo esc_url($test_url_google) ?>" target="_blank" class="button-secondary"><?php echo sprintf(esc_html__('Test Schema Settings (%s)', 'meta-tag-manager'), 'Google'); ?></a>
128
+ <a href="<?php echo esc_url($test_url_schemaorg) ?>" target="_blank" class="button-secondary"><?php echo sprintf(esc_html__('Test Schema Settings (%s)', 'meta-tag-manager'), 'Schema.org'); ?></a>
129
+ </p>
130
+ <h3><?php esc_html_e('General Information', 'meta-tag-manager'); ?></h3>
131
+ <table class="form-table">
132
+ <?php
133
+ mtm_input_select( esc_html__('This website represents a ', 'meta-tag-manager'), 'mtm_schema_site_type', $site_type_options, $schema['type'] );
134
+ $org_types = array( 'Organization' => esc_html__('General/Other', 'meta-tag-manager') );
135
+ $org_subtypes = array();
136
+ foreach( $schema_types['Organization']['types'] as $type => $type_data ){
137
+ $org_types[$type] = $type_data['description'];
138
+ if( !empty($type_data['types']) ){
139
+ $org_subtypes[$type] = array( $type => esc_html__('General/Other', 'meta-tag-manager') );
140
+ foreach( $type_data['types'] as $subtype => $subtype_data ){
141
+ $org_subtypes[$type][$subtype] = $subtype_data['description'];
142
+ }
143
+ }
144
+ }
145
+ $image_id = empty($schema['logo']) ? get_theme_mod( 'custom_logo' ) : $schema['logo'];
146
+ $image = intval( $image_id ) > 0 ? wp_get_attachment_image( $image_id ) : '';
147
+ ?>
148
+ <tr class="mtm-image-upload" data-action="mtm_get_logo_url">
149
+ <th><?php esc_html_e( 'Logo' ); ?></th>
150
+ <td>
151
+ <div class="mtm-image-upload-preview"><?php echo $image; ?></div>
152
+ <input type="hidden" name="mtm_schema_site_logo" class="mtm-image-upload-input" value="<?php echo absint($image_id); ?>" class="regular-text">
153
+ <input type='button' class="button-primary mtm-image-upload-submit" value="<?php esc_attr_e('Select Image'); ?>" >
154
+ <input type='button' class="button-secondary mtm-image-upload-reset" value="<?php esc_attr_e('Remove'); ?>" >
155
+ <p><em><?php echo sprintf( esc_html__('The image size must be at least %s and one of the following formats : %s', 'meta-tag-manager'), '112px x 112px', 'BMP, GIF, JPEG, PNG, WebP or SVG'); ?></em></p>
156
+ </td>
157
+ </tr>
158
+ </table>
159
+ <table class="form-table mtm-schema-types mtm-schema-type-Person">
160
+ <?php
161
+ mtm_input_text( esc_html__('Name of Person', 'meta-tag-manager'), 'mtm_schema_person_name', $schema['name'] );
162
+ ?>
163
+ </table>
164
+ <table class="form-table mtm-schema-types mtm-schema-type-Organization">
165
+ <tbody class="mtm-schema-orgnization-types">
166
+ <?php
167
+ mtm_input_text( esc_html__('Organization Name', 'meta-tag-manager'), 'mtm_schema_organization_name', $schema['name']);
168
+ $description = sprintf(esc_html__('Choose a more specific type of %s your site represents. If none of these options fit, then leave it as General/Other.', 'meta-tag-manager'), esc_html__('Organization', 'meta-tag-manager'));
169
+ $description .= '<br>'. esc_html__('Local Business types are currently unavailable, coming soon!', 'meta-tag-manager');
170
+ mtm_input_select( esc_html__('Organization Type', 'meta-tag-manager'), 'mtm_schema_site_type_organization', $org_types, $schema['Organization']['type'], $description);
171
+ ?>
172
+ </tbody>
173
+ <tbody class="mtm-schema-orgnization-subtypes">
174
+ <?php
175
+ foreach( $org_subtypes as $type => $specific_org_subtypes ){
176
+ $description = sprintf(esc_html__('Choose a more specific type of %s your site represents. If none of these options fit, then leave it as General/Other.', 'meta-tag-manager'), $org_types[$type]);
177
+ mtm_input_select( esc_html__('Organization Subtype', 'meta-tag-manager'), 'mtm_schema_site_type_organization_specific_'.$type, $specific_org_subtypes, $schema['Organization']['subtype'], $description );
178
+ }
179
+ ?>
180
+ </tbody>
181
+ </table>
182
+ <h3><?php esc_html_e('Contact Information', 'meta-tag-manager'); ?></h3>
183
+ <table class="form-table">
184
+ <?php
185
+ mtm_input_radio_binary( esc_html__('Provide Contact Info?', 'meta-tag-manager'), 'mtm_schema_contact', $schema['Contact']['enabled']);
186
+ ?>
187
+ <tbody class="mtm-schema-contact-fields">
188
+ <?php
189
+ mtm_input_text( esc_html__('Contact Name or Department', 'meta-tag-manager'), 'mtm_schema_contact_name', $schema['Contact']['name'], esc_html__("This could be a name of a person or department such as 'Customer Service' or 'Technical Support'", 'meta-tag-manager'));
190
+ $contact_page_id = is_numeric($schema['Contact']['url']) ? $schema['Contact']['url'] : 0;
191
+ $contact_page_url = !is_numeric($schema['Contact']['url']) ? $schema['Contact']['url'] : '';
192
+ ?>
193
+ <tr>
194
+ <th><?php echo sprintf(esc_html__( '%s Page', 'events-manager'),esc_html__('Contact','events-manager')); ?></th>
195
+ <td>
196
+ <?php wp_dropdown_pages(array('name'=>'mtm_schema_contact_page', 'selected'=> $contact_page_id, 'show_option_none'=> esc_html__('Custom URL', 'meta-tag-manager') )); ?>
197
+ </td>
198
+ </tr>
199
+ <?php
200
+ mtm_input_text( esc_html__('Contact URL', 'meta-tag-manager'), 'mtm_schema_contact_url', $contact_page_url);
201
+ $description = sprintf(esc_html__('Enter a phone number in the international format, containing your %s. For example, in the US and Canada : %s'), '<a target="_blank" href="https://en.wikipedia.org/wiki/List_of_country_calling_codes">'.esc_html__('country code', 'meta-tag-manager').'</a>', '+1-800-123-1234');
202
+ mtm_input_text( esc_html__('Contact Phone', 'meta-tag-manager'), 'mtm_schema_contact_telephone', $schema['Contact']['telephone'], $description, '+1-800-123-1234');
203
+ mtm_input_text( esc_html__('Contact Email', 'meta-tag-manager'), 'mtm_schema_contact_email', $schema['Contact']['email'], '', 'contact@yoursite.com');
204
+ ?>
205
+ </tbody>
206
+ </table>
207
+
208
+
209
+ <h3><?php esc_html_e('Social/External Profiles', 'meta-tag-manager'); ?></h3>
210
+ <p><?php esc_html_e('If you have any external social media accounts or websites with your profile or a specific page about you, add the full URL here. If recognized by Google they will show up on your search results and provide added legitimacy to your company or brand. If you don\'t have a specific profile below, leave it blank.', 'meta-tag-manager'); ?></p>
211
+ <p><?php esc_html_e('Any other site such as pintrest, wikipedia, tumblr etc. could be added below, click the \'Add URL\' below to add additional profiles.', 'meta-tag-manager'); ?></p>
212
+ <table class="form-table mtm-schema-profiles">
213
+ <?php
214
+ $default_profiles = array('facebook' => '', 'instagram' => '', 'linkedin' => '', 'twitter' => '');
215
+ $schema['profiles'] = empty($schema['profiles']) ? $default_profiles : array_merge($default_profiles, $schema['profiles']);
216
+ mtm_input_text( 'Facebook', 'mtm_schema_profiles[facebook]', $schema['profiles']['facebook'], '', 'https://facebook.com/username');
217
+ mtm_input_text( 'Twitter', 'mtm_schema_profiles[twitter]', $schema['profiles']['twitter'], '', 'https://twitter.com/username');
218
+ mtm_input_text( 'Instagram', 'mtm_schema_profiles[instagram]', $schema['profiles']['instagram'], '', 'https://instagram.com/username');
219
+ mtm_input_text( 'LinkedIn', 'mtm_schema_profiles[linkedin]', $schema['profiles']['linkedin'], '', 'https://www.linkedin.com/in/username');
220
+ foreach( $schema['profiles'] as $k => $v ){
221
+ if( is_numeric($k) ){
222
+ ?>
223
+ <tr valign="top" class="mtm-schema-profiles-other">
224
+ <th scope="row">
225
+ <a href="#" class="mtm-schema-profile-remove"><span class="dashicons dashicons-no"></span></a>
226
+ <label for="mtm_schema_profiles">Other</label>
227
+ </th>
228
+ <td>
229
+ <input name="mtm_schema_profiles[]" value="<?php echo esc_url($v); ?>" type="text" id="mtm_schema_profiles" class="widefat" placeholder="https://site.com/about-your-site">
230
+ </td>
231
+ </tr>
232
+ <?php
233
+ }
234
+ }
235
+ ?>
236
+ <tr valign="top" id="mtm_schema_profiles_other_row" class="mtm-schema-profiles-other">
237
+ <th scope="row">
238
+ <a href="#" class="mtm-schema-profile-remove"><span class="dashicons dashicons-no"></span></a>
239
+ <label for="mtm_schema_profiles">Other</label>
240
+ </th>
241
+ <td>
242
+ <input name="mtm_schema_profiles[]" value="" type="text" id="mtm_schema_profiles" class="widefat" placeholder="https://site.com/about-your-site">
243
+ </td>
244
+ </tr>
245
+ </table>
246
+ <a href="#" class="button-secondary mtm-schema-profile-add"><?php esc_html_e('Add URL', 'meta-tag-manager'); ?></a>
247
+
248
+
249
+ <h3><?php esc_html_e('Google Sitelinks', 'meta-tag-manager'); ?></h3>
250
+ <p><?php esc_html_e('Google allows you to provide extra information about your site which they may use in their search results to produce expanded links and search forms within the search result, increasing the visibility of your search result and the changes of people clicking through to your site.', 'meta-tag-manager'); ?></p>
251
+ <table class="form-table mtm-schema-sitelinks">
252
+ <?php
253
+ $menus = wp_get_nav_menus();
254
+ $nav_menus = array( '' => esc_html__('Choose a nav menu', 'meta-tag-menu'), 0 => esc_html__('No Sitelinks Map', 'meta-tag-manager') );
255
+ foreach( $menus as $menu ){
256
+ $nav_menus[$menu->term_id] = $menu->name;
257
+ }
258
+ $description = esc_html__("Choose a menu containing the links you'd like Google to include in Sitelinks. This can be a menu you already have, or preferably a dedicated menu for sitelinks. It is not guaranteed they'll use them, but it will certainly increase the chances of them doing so. %s", 'meta-tag-manager');
259
+ $description = sprintf( $description, '<a href="https://developers.google.com/search/docs/advanced/appearance/sitelinks">'. esc_html__('Learn more', 'meta-tag-manager') .'</a>');
260
+ mtm_input_select( esc_html__('Sitelinks Map', 'meta-tag-manager'), 'mtm_schema_sitelinks_menu', $nav_menus, $schema['sitelinks']['menu'], $description);
261
+
262
+ $description = esc_html__("Google can choose to display a search box below your search result, directly allowing users to search your site. You can choose to enable this or specifically ask Google not to include it. %s", 'meta-tag-manager');
263
+ $description = sprintf( $description, '<a href="https://developers.google.com/search/docs/advanced/structured-data/sitelinks-searchbox">'. esc_html__('Learn more', 'meta-tag-manager') .'</a>');
264
+ $search_options = array( '' => esc_html__('Enable or Disable', 'meta-tag-manager'), 1 => esc_html__('Enable Sitelinks Search', 'meta-tag-manager'), 2 => esc_html__('Disable Sitelinks Search', 'meta-tag-manager') );
265
+ mtm_input_select( esc_html__('Enable Sitelinks Searchbox?', 'meta-tag-manager'), 'mtm_schema_sitelinks_search', $search_options, $schema['sitelinks']['menu'], $description)
266
+ ?>
267
+ </table>
268
+
269
+ <script type="text/javascript">
270
+ jQuery(document).ready( function($) {
271
+ $('input[name="mtm_schema_contact"]').on('change', function(){
272
+ if( $('input[name="mtm_schema_contact"]:checked').val() == 1 ){
273
+ $('tbody.mtm-schema-contact-fields').show();
274
+ }else{
275
+ $('tbody.mtm-schema-contact-fields').hide();
276
+ }
277
+ }).trigger('change');
278
+ $('#mtm_schema_site_type_organization').on('change', function(){
279
+ $('tbody.mtm-schema-orgnization-subtypes tr').hide();
280
+ var value = $(this).find(":selected").val();
281
+ var selected_value = $('#mtm_schema_site_type_organization_specific_'+ value + '_row');
282
+ if( selected_value.length > 0 ) selected_value.show();
283
+ }).trigger('change');
284
+ $('#mtm_schema_site_type').on('change', function(){
285
+ $('table.mtm-schema-types').hide();
286
+ var value = $(this).find(":selected").val();
287
+ var selected_value = $('.mtm-schema-type-'+ value );
288
+ if( selected_value.length > 0 ) selected_value.show();
289
+ }).trigger('change');
290
+ $('.mtm-schema-profile-add').on('click', function(e){
291
+ e.preventDefault();
292
+ var row = $('#mtm_schema_profiles_other_row').clone().removeAttr('id').show();
293
+ $('.mtm-schema-profiles').append( row );
294
+ });
295
+ $('.mtm-schema-profiles').on('click', '.mtm-schema-profile-remove', function(e){
296
+ e.preventDefault();
297
+ $(this).closest('.mtm-schema-profiles-other').remove();
298
+ });
299
+ $('#mtm_schema_enabled').on('change', function(){
300
+ if( $(this).val() > 0 ){
301
+ selected_value.show();
302
+ }else{
303
+
304
+ }
305
+ }).trigger('change');
306
+
307
+ $('#mtm_schema_contact_page').on('change', function(){
308
+ var value = $(this).find(":selected").val();
309
+ if( value == 0 ){
310
+ $('#mtm_schema_contact_url_row').show();
311
+ }else{
312
+ $('#mtm_schema_contact_url_row').hide();
313
+ }
314
+ }).trigger('change');
315
+
316
+ $('.mtm-schema-save-and-test').on('click', function(){
317
+ var el = $(this);
318
+ el.append('<input type="hidden" name="schema_test_afterwards" value="'+ el.data('validator') +'">');
319
+ });
320
+ });
321
+ </script>
322
+ <?php
323
+ if( !empty($_GET['schema_test']) && $_GET['schema_test'] == 'google' ) echo '<script type="text/javascript">window.open("'. $test_url_google .'");</script>';
324
+ if( !empty($_GET['schema_test']) && $_GET['schema_test'] == 'schema.org' ) echo '<script type="text/javascript">window.open("'. $test_url_schemaorg .'");</script>';
325
+ ?>
326
+ </div>
327
+ <p class="mtm-actions">
328
+ <button type="submit" class="button-primary"><?php esc_html_e('Save Changes','meta-tag-manager'); ?></button>
329
+ <span class="mtm-schema-settings">
330
+ <button type="submit" class="button-primary mtm-schema-save-and-test" data-validator="google"><?php echo sprintf(esc_html__('Save & Test (%s)', 'meta-tag-manager'), 'Google'); ?></button>
331
+ <button type="submit" class="button-primary mtm-schema-save-and-test" data-validator="schema.org"><?php echo sprintf(esc_html__('Save & Test (%s)', 'meta-tag-manager'), 'Schema.org'); ?></button>
332
+ </span>
333
+ </p>
admin/settings/sidebar.php ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ <div id="postbox-container-1" class="postbox-container">
3
+ <div id="mtm-plugin-info" class="postbox ">
4
+ <button type="button" class="handlediv button-link"
5
+ aria-expanded="true">
6
+ <span class="screen-reader-text"><?php echo sprintf(esc_html__('Toggle panel: %s'), esc_html__('About This Plugin','meta-tag-manager')); ?></span>
7
+ <span class="toggle-indicator" aria-hidden="true"></span>
8
+ </button>
9
+ <h2 class="hndle ui-sortable-handle">
10
+ <span><?php esc_html_e('About This Plugin','meta-tag-manager'); ?></span>
11
+ </h2>
12
+ <div class="inside">
13
+ <p>
14
+ <?php echo sprintf(esc_html__('This plugin was developed by %s.', 'meta-tag-manager'), '<a href="http://msyk.es/?utm_source=meta-tag-manager&utm_medium=settings&utm_campaign=plugins" target="_blank">Marcus Sykes</a>'); ?>
15
+ </p>
16
+ <p style="color:green; font-weight:bold;">
17
+ <?php
18
+ echo sprintf(esc_html__('Please leave us a %s review on %s to show your support and help us keep making this plugin better!','meta-tag-manager'),
19
+ '<a href="http://wordpress.org/support/view/plugin-reviews/meta-tag-manager?filter=5" target="_blank">★★★★★</a>',
20
+ '<a href="https://wordpress.org/plugins/meta-tag-manager/" target="_blank">WordPress.org</a>'
21
+ );
22
+ ?>
23
+ </p>
24
+ </div>
25
+ </div>
26
+ <div id="mtm-plugin-support" class="postbox ">
27
+ <button type="button" class="handlediv button-link"
28
+ aria-expanded="true">
29
+ <span class="screen-reader-text"><?php echo sprintf(esc_html__('Toggle panel: %s'), esc_html__('Need Help?','meta-tag-manager')); ?></span>
30
+ <span class="toggle-indicator" aria-hidden="true"></span>
31
+ </button>
32
+ <h2 class="hndle ui-sortable-handle">
33
+ <span><?php esc_html_e('Need Help?','meta-tag-manager'); ?></span>
34
+ </h2>
35
+ <div class="inside">
36
+ <p>
37
+ <?php echo sprintf(esc_html__('Please visit our %s if you have any questions.', 'meta-tag-manager'),
38
+ '<a href="http://wordpress.org/support/plugin/meta-tag-manager/" target="_blank">'.esc_html__('Support Forum','meta-tag-manager').'</a>'); ?>
39
+ </p>
40
+ </div>
41
+ </div>
42
+ </div>
admin/settings/verify-sites.php ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ global $mtm_submit_button;
3
+ $verify = \Meta_Tag_Manager\Verify_Sites::get_options(false);
4
+ ?>
5
+ <p><?php esc_html_e('Many websites or search engines offer ways to view private information about your domain or alternatively display your site as \'verified\' on profile pages etc.', 'meta-tag-manager'); ?></p>
6
+ <p><?php esc_html_e('Most platforms offer meta tag codes as a form of verification, below are some services where you can quickly post the ID value of a meta tag and let Meta Tag Manager do the rest!', 'meta-tag-manager'); ?></p>
7
+ <p><?php echo sprintf(esc_html__('Don\'t see the site you want to verify with here? You can always manually generate tags in the %s tab above.', 'meta-tag-manager'), esc_html__('Custom Meta Tags','meta-tag-manager')); ?></p>
8
+ <p><?php echo sprintf(esc_html__('Please paste the value in the %s part of the supplied meta tag, for example the bold part of %s.', 'meta-tag-manager'), '<code>contents="..."</code>', '<code>&lt;meta name="google-site-verification" contents="<strong>your_unique_id</strong>" /&gt;</code>'); ?></p>
9
+ <table class="form-table">
10
+ <?php
11
+ mtm_input_text( esc_html__('Google Webmaster Tools', 'meta-tag-manager'), 'mtm_verify_sites_google', $verify['google'] );
12
+ mtm_input_text( esc_html__('Bing Webmaster Tools', 'meta-tag-manager'), 'mtm_verify_sites_bing', $verify['bing'] );
13
+ mtm_input_text( esc_html__('Facebook Business', 'meta-tag-manager'), 'mtm_verify_sites_facebook', $verify['facebook'] );
14
+ mtm_input_text( esc_html__('Pintrest', 'meta-tag-manager'), 'mtm_verify_sites_pintrest', $verify['pintrest'] );
15
+ mtm_input_text( esc_html__('Sitelock', 'meta-tag-manager'), 'mtm_verify_sites_sitelock', $verify['sitelock'] );
16
+ mtm_input_text( esc_html__('Yandex', 'meta-tag-manager'), 'mtm_verify_sites_yandex', $verify['yandex'] );
17
+ ?>
18
+ </table>
19
+ <?php do_action('mtm_settings_page_site_verification'); ?>
20
+ <?php echo $mtm_submit_button; ?>
classes/open-graph-admin.php ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Meta_Tag_Manager;
3
+
4
+ class Open_Graph_Admin {
5
+
6
+ public static function get_post(){
7
+ $og = Open_Graph::get_options(true);
8
+ if( empty($_REQUEST['mtm_og_enabled']) ){
9
+ $og = array('enabled' => false);
10
+ } else {
11
+ $og['enabled'] = true;
12
+ $og['generate_singular'] = !empty($_REQUEST['mtm_og_generate_singular']);
13
+ if( !empty($_REQUEST['mtm_og_site_title']) ) $og['home']['title'] = sanitize_text_field($_REQUEST['mtm_og_site_title']);
14
+ if( !empty($_REQUEST['mtm_og_site_description']) ) $og['home']['description'] = sanitize_text_field($_REQUEST['mtm_og_site_description']);
15
+ if( !empty($_REQUEST['mtm_og_site_logo']) ) $og['home']['image'] = absint($_REQUEST['mtm_og_site_logo']);
16
+ $og['twitter'] = array('enabled' => !empty($_REQUEST['mtm_og_twitter_enabled']));
17
+ if( $og['twitter']['enabled'] ){
18
+ if( !empty($_REQUEST['mtm_og_twitter_site']) && preg_match('/^@[a-zA-Z0-9_]{4,15}$/', $_REQUEST['mtm_og_twitter_site']) ) $og['twitter']['site'] = sanitize_text_field($_REQUEST['mtm_og_twitter_site']);
19
+ if( !empty($_REQUEST['mtm_og_twitter_creator']) && preg_match('/^@[a-zA-Z0-9_]{4,15}$/', $_REQUEST['mtm_og_twitter_creator']) ) $og['twitter']['creator'] = sanitize_text_field($_REQUEST['mtm_og_twitter_creator']);
20
+ }
21
+ }
22
+ return $og;
23
+ }
24
+ }
classes/open-graph.php ADDED
@@ -0,0 +1,87 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Meta_Tag_Manager;
3
+ use Meta_Tag_Manager, MTM_Tag;
4
+
5
+ class Open_Graph {
6
+ public static function init(){
7
+ if( is_admin() ){
8
+ include('open-graph-admin.php');
9
+ }
10
+ add_filter('mtm_head_meta_tags', 'Meta_Tag_Manager\Open_Graph::add_tags', 10);
11
+ }
12
+
13
+ public static function add_tags( $mtm_tags ){
14
+ $og = static::get_options();
15
+ if( empty($og['enabled']) ) return $mtm_tags;
16
+ if( is_front_page() ){
17
+ // add front page tags
18
+ $this_page = array();
19
+ if( !empty($og['home']['image']) ) $og['home']['image'] = wp_get_attachment_url($og['home']['image']);
20
+ foreach( $og['home'] as $k => $v ){
21
+ if( empty($v) ) continue;
22
+ $this_page[] = array('type' => 'name', 'value' => 'og:'.$k, 'content' => $v, 'context' => 'home');
23
+ }
24
+ if( !empty($og['twitter']['enabled']) ){
25
+ $this_page[] = array('type' => 'name', 'value' => 'twitter:card', 'content' => 'summary', 'context' => 'home');
26
+ if( !empty($og['twitter']['site']) ) $this_page[] = array('type' => 'name', 'value' => 'twitter:site', 'content' => $og['twitter']['site'], 'context' => 'home');
27
+ if( !empty($og['twitter']['creator']) ) $this_page[] = array('type' => 'name', 'value' => 'twitter:creator', 'content' => $og['twitter']['creator'], 'context' => 'home');
28
+ }
29
+ foreach( array_reverse($this_page) as $tag_array ){
30
+ $meta_tag = new MTM_Tag($tag_array);
31
+ array_unshift($mtm_tags, $meta_tag);
32
+ }
33
+ }elseif( !empty($og['generate_singular']) && is_singular() ){
34
+ // generate og tags based on current page
35
+ $this_page = array(
36
+ 'og:type' => 'webssite',
37
+ 'og:title' => get_the_title(),
38
+ 'og:description' => get_the_excerpt(),
39
+ 'og:image' => get_the_post_thumbnail_url(),
40
+ 'og:locale' => determine_locale(),
41
+ 'og:site_name' => $og['home']['site_name'],
42
+ );
43
+ if( !empty($og['twitter']['enabled']) ){
44
+ $this_page['twitter:card'] = 'summary';
45
+ if( !empty($og['twitter']['site']) ) $this_page['twitter:site'] = $og['twitter']['site'];
46
+ if( !empty($og['twitter']['creator']) ) $this_page['twitter:site'] = $og['twitter']['creator'];
47
+ }
48
+ foreach( array_reverse( $this_page ) as $k => $v ){
49
+ $tag_array = array('type' => 'name', 'value' => $k, 'content' => $v, 'context' => 'post-type_'.get_post_type() );
50
+ $meta_tag = new MTM_Tag($tag_array);
51
+ array_unshift($mtm_tags, $meta_tag);
52
+ }
53
+ }
54
+ return $mtm_tags;
55
+ }
56
+
57
+ public static function get_options( $defaults = null ){
58
+ $mtm_custom = get_option('mtm_custom');
59
+ if( $defaults === null ) {
60
+ return !empty($mtm_custom['og']) ? $mtm_custom['og'] : false;
61
+ }else{
62
+ $og = array(
63
+ 'enabled' => false,
64
+ 'generate_singular' => false,
65
+ 'home' => array(
66
+ 'type' => 'website',
67
+ 'title' => get_bloginfo('name'),
68
+ 'description' => get_bloginfo('description'),
69
+ 'image' => get_theme_mod( 'custom_logo' ),
70
+ 'locale' => determine_locale(),
71
+ 'site_name' => get_bloginfo('name'),
72
+ ),
73
+ 'twitter' => array(
74
+ 'enabled' => true, // enabled if og is enabled, no harm
75
+ 'site' => '',
76
+ 'creator' => '',
77
+ )
78
+ );
79
+ if( !$defaults ){
80
+ $og = empty($mtm_custom['og']) ? $og : Meta_Tag_Manager::array_merge($og, $mtm_custom['og']);
81
+ $og['home']['site_name'] = $og['home']['title'];
82
+ }
83
+ }
84
+ return $og;
85
+ }
86
+ }
87
+ Open_Graph::init();
classes/schema-admin.php ADDED
@@ -0,0 +1,49 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Meta_Tag_Manager;
3
+
4
+ class Schema_Admin {
5
+ public static function get_post(){
6
+ $schema = Schema::get_options(true);
7
+ $schema['enabled'] = !empty($_REQUEST['mtm_schema_enabled']);
8
+ if( !empty($_REQUEST['mtm_schema_site_type']) ) $schema['type'] = sanitize_text_field($_REQUEST['mtm_schema_site_type']);
9
+ if( !empty($_REQUEST['mtm_schema_site_logo']) ) $schema['logo'] = absint($_REQUEST['mtm_schema_site_logo']);
10
+ if( $schema['type'] == 'Person' ){
11
+ if( !empty($_REQUEST['mtm_schema_person_name']) ) $schema['name'] = sanitize_text_field($_REQUEST['mtm_schema_person_name']);
12
+ }elseif( $schema['type'] == 'Organization' ) {
13
+ if( !empty($_REQUEST['mtm_schema_organization_name']) ) $schema['name'] = sanitize_text_field($_REQUEST['mtm_schema_organization_name']);
14
+ if( !empty($_REQUEST['mtm_schema_site_type_organization']) ) $schema['Organization']['type'] = sanitize_text_field($_REQUEST['mtm_schema_site_type_organization']);
15
+ if( !empty($_REQUEST['mtm_schema_site_type_organization_specific_'. $schema['Organization']['type']]) ) {
16
+ $schema['Organization']['subtype'] = sanitize_text_field($_REQUEST['mtm_schema_site_type_organization_specific_' . $schema['Organization']['type']]);
17
+ }else {
18
+ $schema['Organization']['subtype'] = $schema['Organization']['type'];
19
+ }
20
+ }
21
+ $schema['Contact']['enabled'] = !empty($_REQUEST['mtm_schema_contact']);
22
+ if( $schema['Contact']['enabled'] ) {
23
+ if( !empty($_REQUEST['mtm_schema_contact_name']) ) $schema['Contact']['name'] = sanitize_text_field($_REQUEST['mtm_schema_site_type']);
24
+ if( !empty($_REQUEST['mtm_schema_contact_page']) ) {
25
+ $schema['Contact']['url'] = get_permalink(absint($_REQUEST['mtm_schema_contact_page']));
26
+ }elseif( !empty($_REQUEST['mtm_schema_contact_url']) ) {
27
+ $schema['Contact']['url'] = esc_url_raw($_REQUEST['mtm_schema_contact_url']);
28
+ }
29
+ if( !empty($_REQUEST['mtm_schema_contact_telephone']) ) $schema['Contact']['telephone'] = sanitize_text_field($_REQUEST['mtm_schema_contact_telephone']);
30
+ if( !empty($_REQUEST['mtm_schema_contact_email']) ) $schema['Contact']['email'] = sanitize_email($_REQUEST['mtm_schema_contact_email']);
31
+ }
32
+ if( !empty($_REQUEST['mtm_schema_sitelinks_menu']) ) $schema['sitelinks']['menu'] = absint($_REQUEST['mtm_schema_sitelinks_menu']);
33
+ if( !empty($_REQUEST['mtm_schema_sitelinks_search']) ) $schema['sitelinks']['search'] = absint($_REQUEST['mtm_schema_sitelinks_search']);
34
+ if( !empty($_REQUEST['mtm_schema_profiles']) && is_array($_REQUEST['mtm_schema_profiles']) ){
35
+ $schema['profiles'] = array();
36
+ foreach( $_REQUEST['mtm_schema_profiles'] as $k => $profile ){
37
+ if( !empty($profile) && !in_array($profile, $schema['profiles']) ){
38
+ if( is_numeric($k) ){
39
+ $schema['profiles'][] = esc_url_raw($profile);
40
+ }else{
41
+ $k = sanitize_key($k);
42
+ $schema['profiles'][$k] = esc_url_raw($profile);
43
+ }
44
+ }
45
+ }
46
+ }
47
+ return $schema;
48
+ }
49
+ }
classes/schema.php ADDED
@@ -0,0 +1,161 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Meta_Tag_Manager;
3
+ use Meta_Tag_Manager;
4
+
5
+ class Schema {
6
+
7
+ public static function init(){
8
+ if( is_admin() ){
9
+ include('schema-admin.php');
10
+ }
11
+ }
12
+
13
+ public static function output(){
14
+ if( !is_front_page() ) return; // for now, only front page stuff
15
+ $schema_options = static::get_options();
16
+ ?>
17
+ <!-- Meta Tag Manager - Schema -->
18
+ <script type="application/ld+json">
19
+ <?php echo static::output_general() ."\n" ?>
20
+ </script>
21
+ <?php
22
+ if( !empty($schema_options['sitelinks']['search']) ){
23
+ if( $schema_options['sitelinks']['search'] == 1 ){
24
+ echo '<script type="application/ld+json">'."\n\t\t\t";
25
+ echo static::output_sitelinks_search();
26
+ echo "\n\t\t".'</script>';
27
+ }else{
28
+ echo '<meta name="google" content="nositelinkssearchbox" />';
29
+ }
30
+ }
31
+ if( !empty($schema_options['sitelinks']['menu']) ){
32
+ $sitelinks = static::output_sitelinks();
33
+ if( !empty($sitelinks) ){
34
+ echo "\n\t\t".'<script type="application/ld+json">'."\n\t\t\t";
35
+ echo static::output_sitelinks();
36
+ echo "\n\t\t".'</script>';
37
+ }
38
+ }
39
+ echo "\n";
40
+ ?>
41
+ <!-- / Meta Tag Manager - Schema -->
42
+ <?php
43
+ }
44
+
45
+ public static function output_general(){
46
+ $schema_options = static::get_options();
47
+ $schema = array('@context' => 'https://schema.org');
48
+ // get the type of
49
+ $schema['@type'] = esc_js($schema_options['type']);
50
+ $schema['name'] = esc_js($schema_options['name']);
51
+ $schema['url'] = get_site_url();
52
+ if( $schema_options['type'] == 'Organization' && !empty($schema_options['Organization']['subtype']) ){
53
+ $schema['@type'] = esc_js($schema_options['Organization']['subtype']);
54
+ }
55
+ if( !empty($schema_options['logo']) ){
56
+ $image = wp_get_attachment_image_src( $schema_options['logo'], 'full' );
57
+ if( $image ){
58
+ $schema['logo'] = array(
59
+ '@type' => 'ImageObject',
60
+ 'url' => $image[0],
61
+ 'width' => $image[1],
62
+ 'height' => $image[2],
63
+ );
64
+ }
65
+ }
66
+ if( !empty($schema_options['Contact']['enabled']) ){
67
+ $schema['ContactPoint'] = array(
68
+ '@type' => 'ContactPoint',
69
+ 'contactType' => esc_js($schema_options['Contact']['name']),
70
+ );
71
+ if( !empty($schema_options['Contact']['telephone']) ) $schema['ContactPoint']['telephone'] = esc_js($schema_options['Contact']['telephone']);
72
+ if( !empty($schema_options['Contact']['email']) ) $schema['ContactPoint']['email'] = esc_js($schema_options['Contact']['email']);
73
+ if( !empty($schema_options['Contact']['url']) ){
74
+ if( is_numeric($schema_options['Contact']['url']) ){
75
+ $schema['ContactPoint']['url'] = get_permalink($schema_options['Contact']['url']);
76
+ }else{
77
+ $schema['ContactPoint']['url'] = esc_url($schema_options['Contact']['url']);
78
+ }
79
+ }
80
+ }
81
+ if( !empty($schema_options['profiles']) ){
82
+ $schema['sameAs'] = array();
83
+ foreach( $schema_options['profiles'] as $profile ){
84
+ $schema['sameAs'][] = esc_url($profile);
85
+ }
86
+ }
87
+ return json_encode($schema);
88
+ }
89
+
90
+ public static function output_sitelinks(){
91
+ $schema_options = static::get_options();
92
+ if( !empty($schema_options['sitelinks']['menu']) ){
93
+ $menu_items = wp_get_nav_menu_items($schema_options['sitelinks']['menu']);
94
+ if( !empty($menu_items) ){
95
+ $schema = array (
96
+ '@context' => 'https://schema.org',
97
+ '@graph' => array (),
98
+ );
99
+ foreach( $menu_items as $menu_item ){
100
+ $schema['@graph'][] = array (
101
+ '@context' => 'https://schema.org',
102
+ '@type' => 'SiteNavigationElement',
103
+ 'id' => 'site-navigation',
104
+ 'name' => $menu_item->title,
105
+ 'url' => esc_js(esc_url($menu_item->url)),
106
+ );
107
+ }
108
+ return json_encode($schema);
109
+ }
110
+ }
111
+ return '';
112
+ }
113
+
114
+ public static function output_sitelinks_search(){
115
+ $schema = array (
116
+ '@context' => 'https://schema.org',
117
+ '@type' => 'WebSite',
118
+ 'name' => get_bloginfo('name'),
119
+ 'url' => get_site_url(),
120
+ 'potentialAction' =>
121
+ array (
122
+ 0 =>
123
+ array (
124
+ '@type' => 'SearchAction',
125
+ 'target' => home_url( '?s={search_term_string}' ),
126
+ 'query-input' => 'required name=search_term_string',
127
+ ),
128
+ ),
129
+ );
130
+ return json_encode($schema);
131
+ }
132
+
133
+ public static function get_options( $defaults = false ){
134
+ $mtm_custom = get_option('mtm_custom');
135
+ $schema_default = array(
136
+ 'enabled' => false,
137
+ 'type' => '',
138
+ 'logo' => 0,
139
+ 'name' => '',
140
+ 'Organization' => array(
141
+ 'type' => 'Organization',
142
+ 'subtype' => 'Organization',
143
+ ),
144
+ 'Contact' => array(
145
+ 'enabled' => 0,
146
+ 'name' => '',
147
+ 'telephone' => '',
148
+ 'url' => '',
149
+ 'email' => '',
150
+ ),
151
+ 'sitelinks' => array(
152
+ 'menu' => null,
153
+ 'search' => null,
154
+ ),
155
+ 'profiles' => array(),
156
+ );
157
+ return empty($mtm_custom['schema']) || $defaults ? $schema_default : Meta_Tag_Manager::array_merge($schema_default, $mtm_custom['schema']);
158
+ }
159
+
160
+ }
161
+ Schema::init();
classes/verify-sites-admin.php ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Meta_Tag_Manager;
3
+
4
+ class Verify_Sites_Admin {
5
+
6
+ public static function get_post(){
7
+ $verify_sites = array();
8
+ $sites = Verify_Sites::get_sites();
9
+ foreach( $sites as $site => $value ){
10
+ if( !empty($_REQUEST['mtm_verify_sites_'.$site]) ){
11
+ if( preg_match('/content=(["][^"]+|[\'][^\']+)/', wp_unslash($_REQUEST['mtm_verify_sites_'.$site]), $match) ){
12
+ $verify_sites[$site] = substr($match[1], 1);
13
+ }else{
14
+ $verify_sites[$site] = sanitize_text_field($_REQUEST['mtm_verify_sites_'.$site]);
15
+ }
16
+ }
17
+ }
18
+ return $verify_sites;
19
+ }
20
+ }
classes/verify-sites.php ADDED
@@ -0,0 +1,52 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Meta_Tag_Manager;
3
+ use Meta_Tag_Manager, MTM_Tag;
4
+
5
+ class Verify_Sites {
6
+ public static function init(){
7
+ if( is_admin() ){
8
+ include_once('verify-sites-admin.php');
9
+ }
10
+ add_filter('mtm_head_meta_tags', 'Meta_Tag_Manager\Verify_Sites::add_tags', 10);
11
+ }
12
+
13
+ public static function add_tags( $mtm_tags ){
14
+ $verify = static::get_options();
15
+ if( empty($verify) ) return $mtm_tags;
16
+ if( is_front_page() ){
17
+ $sites = static::get_sites();
18
+ foreach( $verify as $site => $site_key ){
19
+ if( !empty($sites[$site]) ) {
20
+ $mtm_tags[] = new MTM_Tag(array('type' => 'name', 'value' => $sites[$site], 'content' => $site_key, 'context' => 'home'));
21
+ }
22
+ }
23
+ }
24
+ return $mtm_tags;
25
+ }
26
+
27
+ public static function get_sites(){
28
+ return array(
29
+ 'google' => 'google-site-verification',
30
+ 'bing' => 'msvalidate.01', // https://www.bing.com/webmasters/help/add-and-verify-site-12184f8b
31
+ 'facebook' => 'facebook-domain-verification',
32
+ 'pintrest' => 'p:domain_verify', // https://help.pinterest.com/en/business/article/claim-your-website#section-12101
33
+ 'sitelock' => 'sitelock-site-verification',
34
+ 'yandex' => 'yandex-verification', // https://yandex.com/support/webmaster/service/rights.html
35
+ );
36
+ }
37
+
38
+ public static function get_options( $defaults = null ){
39
+ $mtm_custom = get_option('mtm_custom');
40
+ if( $defaults === null ) {
41
+ return !empty($mtm_custom['verify']) ? $mtm_custom['verify'] : false;
42
+ }else{
43
+ $verify = static::get_sites();
44
+ foreach( $verify as $k => $v ) $verify[$k] = ''; // empty string it
45
+ if( !$defaults ){
46
+ $verify = empty($mtm_custom['verify']) ? $verify : Meta_Tag_Manager::array_merge($verify, $mtm_custom['verify']);
47
+ }
48
+ }
49
+ return $verify;
50
+ }
51
+ }
52
+ Verify_Sites::init();
css/meta-tag-manager.css CHANGED
@@ -79,6 +79,7 @@
79
  }
80
  .mtm-field-title .mtm-meta-context .dashicons {
81
  font-size: 15px;
 
82
  }
83
  .mtm-field-title code {
84
  font-weight: bold;
@@ -189,12 +190,12 @@
189
  .mtm-settings .selectize-dropdown-content .optgroup .optgroup-header {
190
  font-weight: bold;
191
  }
192
- .mtm-settings .selectize-control.multi .selectize-input > div {
193
  background: #5cb85c;
194
  border-color: #4cae4c;
195
  color: #fff;
196
  }
197
- .mtm-settings .selectize-control.multi .selectize-input > div .remove {
198
  border-color: #4cae4c;
199
  }
200
  .mtm-builder .mtm-field button.mtm-field-remove {
@@ -217,6 +218,218 @@
217
  .mtm-builder .mtm-actions {
218
  padding-top: 15px;
219
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
220
  .selectize-control.plugin-drag_drop.multi > .selectize-input > div.ui-sortable-placeholder {
221
  visibility: visible !important;
222
  background: #f2f2f2 !important;
79
  }
80
  .mtm-field-title .mtm-meta-context .dashicons {
81
  font-size: 15px;
82
+ vertical-align: baseline;
83
  }
84
  .mtm-field-title code {
85
  font-weight: bold;
190
  .mtm-settings .selectize-dropdown-content .optgroup .optgroup-header {
191
  font-weight: bold;
192
  }
193
+ .mtm-settings .selectize-control.multi .selectize-input > .item {
194
  background: #5cb85c;
195
  border-color: #4cae4c;
196
  color: #fff;
197
  }
198
+ .mtm-settings .selectize-control.multi .selectize-input > .item .remove {
199
  border-color: #4cae4c;
200
  }
201
  .mtm-builder .mtm-field button.mtm-field-remove {
218
  .mtm-builder .mtm-actions {
219
  padding-top: 15px;
220
  }
221
+ /* Settings Page */
222
+ .mtm-settings select:invalid {
223
+ color: gray;
224
+ }
225
+ .mtm-settings h3 {
226
+ border-top: 1px solid #dedede;
227
+ padding-top: 25px;
228
+ margin-top: 20px;
229
+ }
230
+ .mtm-settings .postbox .handlediv {
231
+ display: none;
232
+ visibility: hidden;
233
+ }
234
+ .mtm-settings .postbox .inside {
235
+ border-top: 1px solid #dedede;
236
+ margin-top: 0px;
237
+ padding-top: 10px;
238
+ }
239
+ .mtm-settings .postbox h3 {
240
+ font-size: 16px;
241
+ }
242
+ .mtm-settings .postbox td,
243
+ .mtm-settings .postbox th {
244
+ vertical-align: top;
245
+ }
246
+ .mtm-settings .postbox th {
247
+ padding: 15px 20px;
248
+ margin: 0 !important;
249
+ font-size: 0.97em;
250
+ }
251
+ .mtm-settings .postbox .mtm-boxheader {
252
+ font-style: italic;
253
+ margin: 0;
254
+ padding: 10px 5px;
255
+ }
256
+ .mtm-settings .postbox tr.mtm-header td {
257
+ font-style: italic;
258
+ padding: 10px 5px;
259
+ margin: 0;
260
+ }
261
+ .mtm-settings .postbox tr.mtm-header h4,
262
+ .mtm-settings .postbox .postbox h4 {
263
+ font-weight: bold;
264
+ font-size: 15px;
265
+ font-style: normal;
266
+ border-bottom: 1px solid #dedede;
267
+ margin: 0 0 10px;
268
+ padding: 0 0 10px;
269
+ }
270
+ .mtm-settings .postbox tr.mtm-subheader td {
271
+ font-style: italic;
272
+ margin: 0;
273
+ padding: 5px 20px 2px;
274
+ }
275
+ .mtm-settings .postbox tr.mtm-subheader h5 {
276
+ font-style: normal;
277
+ margin: 10px 0;
278
+ padding: 0 0 5px;
279
+ font-weight: bold;
280
+ font-size: 15px;
281
+ border-bottom: 1px solid #efefef;
282
+ color: #000;
283
+ }
284
+ /* Schema Settings */
285
+ .mtm-settings .mtm-image-upload-preview {
286
+ margin-bottom: 10px;
287
+ }
288
+ .mtm-settings #mtm_schema_profiles_other_row {
289
+ display: none;
290
+ }
291
+ .mtm-settings .mtm-schema-profiles-other a.mtm-schema-profile-remove {
292
+ text-decoration: none;
293
+ color: black;
294
+ }
295
+ /* Go Pro Stuff */
296
+ .mtm-settings table.features {
297
+ border-spacing: 0;
298
+ border: 1px solid #dedede;
299
+ }
300
+ .mtm-settings table.features th,
301
+ table.features td {
302
+ background: #fff;
303
+ border: 0;
304
+ border-bottom: 1px solid #dedede;
305
+ padding: 5px;
306
+ }
307
+ .mtm-settings table.features tbody tr {
308
+ border-bottom: 1px solid #EFEFEF;
309
+ }
310
+ .mtm-settings table.features tbody tr:first-child th {
311
+ background: #EFEFEF;
312
+ }
313
+ .mtm-settings table.features tbody th {
314
+ text-align: left;
315
+ padding-left: 10px;
316
+ }
317
+ .mtm-settings table.features tr th:not(:first-child),
318
+ table.features tr td:not(:first-child) {
319
+ width: 150px;
320
+ padding-left: 10px;
321
+ padding-right: 10px;
322
+ text-align: center;
323
+ }
324
+ .mtm-settings table.features .dashicons-yes-alt {
325
+ color: darkgreen;
326
+ font-size: 20px;
327
+ }
328
+ .mtm-settings table.features tfoot th span {
329
+ display: block;
330
+ margin-bottom: 5px;
331
+ color: #8bc976;
332
+ font-size: 18px;
333
+ }
334
+ .mtm-settings table.features tfoot th span.deal {
335
+ color: #FC9840;
336
+ font-size: 14px;
337
+ }
338
+ .mtm-settings table.features tbody th[data-title] {
339
+ cursor: pointer;
340
+ }
341
+ /*! Tippy.js v6.2.7 - https://unpkg.com/tippy.js@6.2.7/themes/light-border.css */
342
+ .tippy-box[data-theme~=light-border] {
343
+ background-color: #fff;
344
+ background-clip: padding-box;
345
+ border: 1px solid rgba(0, 8, 16, 0.15);
346
+ color: #333;
347
+ box-shadow: 0 4px 14px -2px rgba(0, 8, 16, 0.08);
348
+ }
349
+ .tippy-box[data-theme~=light-border] > .tippy-backdrop {
350
+ background-color: #fff;
351
+ }
352
+ .tippy-box[data-theme~=light-border] > .tippy-arrow:after,
353
+ .tippy-box[data-theme~=light-border] > .tippy-svg-arrow:after {
354
+ content: "";
355
+ position: absolute;
356
+ z-index: -1;
357
+ }
358
+ .tippy-box[data-theme~=light-border] > .tippy-arrow:after {
359
+ border-color: transparent;
360
+ border-style: solid;
361
+ }
362
+ .tippy-box[data-theme~=light-border][data-placement^=top] > .tippy-arrow:before {
363
+ border-top-color: #fff;
364
+ }
365
+ .tippy-box[data-theme~=light-border][data-placement^=top] > .tippy-arrow:after {
366
+ border-top-color: rgba(0, 8, 16, 0.2);
367
+ border-width: 7px 7px 0;
368
+ top: 17px;
369
+ left: 1px;
370
+ }
371
+ .tippy-box[data-theme~=light-border][data-placement^=top] > .tippy-svg-arrow > svg {
372
+ top: 16px;
373
+ }
374
+ .tippy-box[data-theme~=light-border][data-placement^=top] > .tippy-svg-arrow:after {
375
+ top: 17px;
376
+ }
377
+ .tippy-box[data-theme~=light-border][data-placement^=bottom] > .tippy-arrow:before {
378
+ border-bottom-color: #fff;
379
+ bottom: 16px;
380
+ }
381
+ .tippy-box[data-theme~=light-border][data-placement^=bottom] > .tippy-arrow:after {
382
+ border-bottom-color: rgba(0, 8, 16, 0.2);
383
+ border-width: 0 7px 7px;
384
+ bottom: 17px;
385
+ left: 1px;
386
+ }
387
+ .tippy-box[data-theme~=light-border][data-placement^=bottom] > .tippy-svg-arrow > svg {
388
+ bottom: 16px;
389
+ }
390
+ .tippy-box[data-theme~=light-border][data-placement^=bottom] > .tippy-svg-arrow:after {
391
+ bottom: 17px;
392
+ }
393
+ .tippy-box[data-theme~=light-border][data-placement^=left] > .tippy-arrow:before {
394
+ border-left-color: #fff;
395
+ }
396
+ .tippy-box[data-theme~=light-border][data-placement^=left] > .tippy-arrow:after {
397
+ border-left-color: rgba(0, 8, 16, 0.2);
398
+ border-width: 7px 0 7px 7px;
399
+ left: 17px;
400
+ top: 1px;
401
+ }
402
+ .tippy-box[data-theme~=light-border][data-placement^=left] > .tippy-svg-arrow > svg {
403
+ left: 11px;
404
+ }
405
+ .tippy-box[data-theme~=light-border][data-placement^=left] > .tippy-svg-arrow:after {
406
+ left: 12px;
407
+ }
408
+ .tippy-box[data-theme~=light-border][data-placement^=right] > .tippy-arrow:before {
409
+ border-right-color: #fff;
410
+ right: 16px;
411
+ }
412
+ .tippy-box[data-theme~=light-border][data-placement^=right] > .tippy-arrow:after {
413
+ border-width: 7px 7px 7px 0;
414
+ right: 17px;
415
+ top: 1px;
416
+ border-right-color: rgba(0, 8, 16, 0.2);
417
+ }
418
+ .tippy-box[data-theme~=light-border][data-placement^=right] > .tippy-svg-arrow > svg {
419
+ right: 11px;
420
+ }
421
+ .tippy-box[data-theme~=light-border][data-placement^=right] > .tippy-svg-arrow:after {
422
+ right: 12px;
423
+ }
424
+ .tippy-box[data-theme~=light-border] > .tippy-svg-arrow {
425
+ fill: #fff;
426
+ }
427
+ .tippy-box[data-theme~=light-border] > .tippy-svg-arrow:after {
428
+ background-image: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iNiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJNMCA2czEuNzk2LS4wMTMgNC42Ny0zLjYxNUM1Ljg1MS45IDYuOTMuMDA2IDggMGMxLjA3LS4wMDYgMi4xNDguODg3IDMuMzQzIDIuMzg1QzE0LjIzMyA2LjAwNSAxNiA2IDE2IDZIMHoiIGZpbGw9InJnYmEoMCwgOCwgMTYsIDAuMikiLz48L3N2Zz4=);
429
+ background-size: 16px 6px;
430
+ width: 16px;
431
+ height: 6px;
432
+ }
433
  .selectize-control.plugin-drag_drop.multi > .selectize-input > div.ui-sortable-placeholder {
434
  visibility: visible !important;
435
  background: #f2f2f2 !important;
css/meta-tag-manager.css.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["meta-tag-manager.less","selectize/selectize.css"],"names":[],"mappings":";AACA;EAAoB,mBAAA;;AAGpB;EAAsB,aAAA;EAAc,kBAAA;;AAGpC;EACE,WAAA;EACA,uBAAA;EACA,sBAAA;EACA,eAAA;EACA,iBAAA;EACA,WAAA;EACA,kBAAA;EACA,gBAAA;EACA,eAAA;;AAEF,aAAa,WAAY;EAAyB,iBAAA;;AAElD;EACE,cAAA;EACA,WAAA;EACA,WAAA;EACA,yBAAA;EACA,sBAAA;EACA,gBAAA;;AAEF,UAAU,OAAQ;EAAkB,aAAA;EAAc,kBAAA;;AAElD,UAAW;EAAqB,WAAA;;;AAGhC;EACE,iBAAA;EACA,eAAA;;AAEF;EACE,cAAA;EACA,WAAA;EACA,WAAA;EACA,YAAA;EACA,0BAAA;EACA,WAAA;EACA,eAAA;EACA,aAAA;EACA,YAAA;EACA,cAAA;;AAEF,aAAa,WAAY;EAAgB,yBAAA;;;AAGzC;EAAmB,iBAAA;EAAkB,gBAAA;;AACrC,aAAa,WAAY;EAAmB,gBAAA;;AAC5C,gBAAiB;EAAsB,eAAA;EAAiB,mBAAA;;AACxD,gBAAiB;EAA4B,qBAAA;;AAE7C,gBAAiB;EACf,eAAA;EACA,mBAAA;EACA,cAAA;EACA,iBAAA;EACA,kBAAA;;AAEF,gBAAiB,kBAAkB;EAAa,eAAA;;AAEhD,gBAAiB;EAAO,iBAAA;;AACxB,gBAAiB,KAAK;AAAoB,gBAAiB,KAAK;EAC9D,kBAAA;EACA,mBAAA;EACA,yBAAA;;AAEF,gBAAiB,KAAK,kBAAiB;EAAU,aAAA;;;AAGjD,wBAAwB;AACxB,yBAAyB;EACvB,eAAA;;AAEF,wBAAwB;AACxB,yBAAyB;EACvB,YAAA;EACA,WAAA;EACA,YAAA;EACA,SAAS,OAAT;EACA,qBAAA;EACA,6BAAA;EACA,WAAA;EACA,mCAAA;EACA,kCAAA;EACA,gCAAA;;AAEF,UAAU,OAAQ,yBAAwB;EACxC,SAAS,OAAT;;;AAIF;;EAEE,6BAAA;EACA,uBAAA;;AAEF;EAAmB,wBAAA;EAAyB,WAAA;;AAC5C;EACE,qBAAA;EACA,kBAAA;EACA,YAAA;EACA,iBAAA;EACA,cAAA;;AAEF,sBAAuB;EAAK,kBAAA;EAAmB,mBAAA;EAAoB,gBAAA;;AACnE,gBAAiB;AAAO,gBAAiB;EACvC,WAAA;EACA,YAAA;EACA,eAAA;;;AAGF;EAAyB,WAAA;;AACzB,sBAAuB;EACrB,WAAA;EACA,WAAA;EACA,UAAA;EACA,eAAA;;;AAIF,gBAAgB;EACd,UAAA;EACA,WAAA;EACA,WAAA;;AAEF,gBAAgB;EACd,qBAAA;EACA,gBAAA;EACA,WAAA;;AAEF,gBAAiB,MAAK;EAA6B,WAAA;EAAY,WAAA;;AAI/D;EAAqB,gBAAA;;AACrB;EAA4B,gCAAA;EAAiC,oBAAA;;AAC7D;EAA2B,iBAAA;EAAkB,eAAA;;AAC7C;EAA0B,sBAAA;EAAuB,oBAAA;EAAqB,gCAAA;;;AAGtE,aAAc,4BAA4B,UAAU;EAAU,kBAAA;;AAC9D,aAAc,4BAA4B,UAAU;EAAmB,iBAAA;;AACvE,aAAc,mBAAkB,MAAO,iBAAiB;EAAQ,mBAAA;EAAoB,qBAAA;EAAsB,WAAA;;AAC1G,aAAc,mBAAkB,MAAO,iBAAiB,MAAM;EAAU,qBAAA;;AAExE,YAAa,WAAW,OAAM;EAAoB,yBAAA;EAA0B,qBAAA;EAAsB,cAAA;;AAClG,YAAa,WAAW,EAAC;EAAoB,eAAA;EAAgB,cAAA;;AAC7D,YAAa,OAAO;EAAa,gBAAA;EAAkB,iBAAA;EAAmB,WAAA;;AACtE,YAAa,OAAM,cAAe;EAAa,gBAAA;;AAE/C,YAAa;EAAe,iBAAA;;AC5J5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"meta-tag-manager.css"}
1
+ {"version":3,"sources":["meta-tag-manager.less","selectize/selectize.css"],"names":[],"mappings":";AACA;EAAoB,mBAAA;;AAGpB;EAAsB,aAAA;EAAc,kBAAA;;AAGpC;EACE,WAAA;EACA,uBAAA;EACA,sBAAA;EACA,eAAA;EACA,iBAAA;EACA,WAAA;EACA,kBAAA;EACA,gBAAA;EACA,eAAA;;AAEF,aAAa,WAAY;EAAyB,iBAAA;;AAElD;EACE,cAAA;EACA,WAAA;EACA,WAAA;EACA,yBAAA;EACA,sBAAA;EACA,gBAAA;;AAEF,UAAU,OAAQ;EAAkB,aAAA;EAAc,kBAAA;;AAElD,UAAW;EAAqB,WAAA;;;AAGhC;EACE,iBAAA;EACA,eAAA;;AAEF;EACE,cAAA;EACA,WAAA;EACA,WAAA;EACA,YAAA;EACA,0BAAA;EACA,WAAA;EACA,eAAA;EACA,aAAA;EACA,YAAA;EACA,cAAA;;AAEF,aAAa,WAAY;EAAgB,yBAAA;;;AAGzC;EAAmB,iBAAA;EAAkB,gBAAA;;AACrC,aAAa,WAAY;EAAmB,gBAAA;;AAC5C,gBAAiB;EAAsB,eAAA;EAAiB,mBAAA;;AACxD,gBAAiB;EAA4B,qBAAA;;AAE7C,gBAAiB;EACf,eAAA;EACA,mBAAA;EACA,cAAA;EACA,iBAAA;EACA,kBAAA;;AAEF,gBAAiB,kBAAkB;EAAa,eAAA;EAAgB,wBAAA;;AAEhE,gBAAiB;EAAO,iBAAA;;AACxB,gBAAiB,KAAK;AAAoB,gBAAiB,KAAK;EAC9D,kBAAA;EACA,mBAAA;EACA,yBAAA;;AAEF,gBAAiB,KAAK,kBAAiB;EAAU,aAAA;;;AAGjD,wBAAwB;AACxB,yBAAyB;EACvB,eAAA;;AAEF,wBAAwB;AACxB,yBAAyB;EACvB,YAAA;EACA,WAAA;EACA,YAAA;EACA,SAAS,OAAT;EACA,qBAAA;EACA,6BAAA;EACA,WAAA;EACA,mCAAA;EACA,kCAAA;EACA,gCAAA;;AAEF,UAAU,OAAQ,yBAAwB;EACxC,SAAS,OAAT;;;AAIF;;EAEE,6BAAA;EACA,uBAAA;;AAEF;EAAmB,wBAAA;EAAyB,WAAA;;AAC5C;EACE,qBAAA;EACA,kBAAA;EACA,YAAA;EACA,iBAAA;EACA,cAAA;;AAEF,sBAAuB;EAAK,kBAAA;EAAmB,mBAAA;EAAoB,gBAAA;;AACnE,gBAAiB;AAAO,gBAAiB;EACvC,WAAA;EACA,YAAA;EACA,eAAA;;;AAGF;EAAyB,WAAA;;AACzB,sBAAuB;EACrB,WAAA;EACA,WAAA;EACA,UAAA;EACA,eAAA;;;AAIF,gBAAgB;EACd,UAAA;EACA,WAAA;EACA,WAAA;;AAEF,gBAAgB;EACd,qBAAA;EACA,gBAAA;EACA,WAAA;;AAEF,gBAAiB,MAAK;EAA6B,WAAA;EAAY,WAAA;;AAI/D;EAAqB,gBAAA;;AACrB;EAA4B,gCAAA;EAAiC,oBAAA;;AAC7D;EAA2B,iBAAA;EAAkB,eAAA;;AAC7C;EAA0B,sBAAA;EAAuB,oBAAA;EAAqB,gCAAA;;;AAGtE,aAAc,4BAA4B,UAAU;EAAU,kBAAA;;AAC9D,aAAc,4BAA4B,UAAU;EAAmB,iBAAA;;AACvE,aAAc,mBAAkB,MAAO,iBAAiB;EAAU,mBAAA;EAAoB,qBAAA;EAAsB,WAAA;;AAC5G,aAAc,mBAAkB,MAAO,iBAAiB,QAAQ;EAAU,qBAAA;;AAE1E,YAAa,WAAW,OAAM;EAAoB,yBAAA;EAA0B,qBAAA;EAAsB,cAAA;;AAClG,YAAa,WAAW,EAAC;EAAoB,eAAA;EAAgB,cAAA;;AAC7D,YAAa,OAAO;EAAa,gBAAA;EAAkB,iBAAA;EAAmB,WAAA;;AACtE,YAAa,OAAM,cAAe;EAAa,gBAAA;;AAE/C,YAAa;EAAe,iBAAA;;;AAG5B,aAAc,OAAM;EAAW,WAAA;;AAC/B,aAAc;EAAK,6BAAA;EAA+B,iBAAA;EAAkB,gBAAA;;AACpE,aAAc,SAAS;EAAa,aAAA;EAAc,kBAAA;;AAClD,aAAc,SAAS;EAAU,6BAAA;EAA+B,eAAA;EAAgB,iBAAA;;AAChF,aAAc,SAAS;EAAK,eAAA;;AAC5B,aAAc,SAAS;AAAI,aAAc,SAAS;EAAK,mBAAA;;AACvD,aAAc,SAAS;EAAK,kBAAA;EAAoB,oBAAA;EAAqB,iBAAA;;AACrE,aAAc,SAAS;EAAiB,kBAAA;EAAmB,SAAA;EAAU,iBAAA;;AACrE,aAAc,SAAS,GAAE,WAAY;EAAK,kBAAA;EAAmB,iBAAA;EAAkB,SAAA;;AAC/E,aAAc,SAAS,GAAE,WAAY;AAAI,aAAc,SAAS,SAAS;EAAK,iBAAA;EAAkB,eAAA;EAAgB,kBAAA;EAAmB,gCAAA;EAAkC,gBAAA;EAAiB,iBAAA;;AACtL,aAAc,SAAS,GAAE,cAAe;EAAK,kBAAA;EAAmB,SAAA;EAAU,qBAAA;;AAC1E,aAAc,SAAS,GAAE,cAAe;EAAK,kBAAA;EAAmB,cAAA;EAAe,gBAAA;EAAiB,iBAAA;EAAkB,eAAA;EAAgB,gCAAA;EAAkC,WAAA;;;AAGpK,aAAc;EAA4B,mBAAA;;AAC1C,aAAc;EAAiC,aAAA;;AAC/C,aAAc,2BAA2B,EAAC;EAA6B,qBAAA;EAAuB,YAAA;;;AAG9F,aAAc,MAAK;EAAY,iBAAA;EAAmB,yBAAA;;AAClD,aAAc,MAAK,SAAU;AAAI,KAAK,SAAU;EAAK,gBAAA;EAAiB,SAAA;EAAU,gCAAA;EAAkC,YAAA;;AAClH,aAAc,MAAK,SAAU,MAAM;EAAK,gCAAA;;AACxC,aAAc,MAAK,SAAU,MAAM,GAAE,YAAa;EAAK,mBAAA;;AACvD,aAAc,MAAK,SAAU,MAAM;EAAM,gBAAA;EAAiB,kBAAA;;AAC1D,aAAc,MAAK,SAAU,GAAG,GAAE,IAAI;AAAgB,KAAK,SAAU,GAAG,GAAE,IAAI;EAAiB,YAAA;EAAa,kBAAA;EAAmB,mBAAA;EAAoB,kBAAA;;AACnJ,aAAc,MAAK,SAAU;EAAqB,gBAAA;EAAiB,eAAA;;AACnE,aAAc,MAAK,SAAU,MAAM,GAAG;EAAO,cAAA;EAAe,kBAAA;EAAmB,cAAA;EAAe,eAAA;;AAC9F,aAAc,MAAK,SAAU,MAAM,GAAG,KAAI;EAAQ,cAAA;EAAe,eAAA;;AACjE,aAAc,MAAK,SAAU,MAAM,GAAE;EAAe,eAAA;;;AAGpD,UAAU;EAA2B,sBAAA;EAAsB,4BAAA;EAA4B,sCAAA;EAAkC,WAAA;EAAW,gDAAA;;AAA4C,UAAU,0BAA0B;EAAiB,sBAAA;;AAAsB,UAAU,0BAA0B,eAAa;AAAO,UAAU,0BAA0B,mBAAiB;EAAO,SAAQ,EAAR;EAAW,kBAAA;EAAkB,WAAA;;AAAW,UAAU,0BAA0B,eAAa;EAAO,yBAAA;EAAyB,mBAAA;;AAAmB,UAAU,0BAA0B,qBAAqB,eAAa;EAAQ,sBAAA;;AAAsB,UAAU,0BAA0B,qBAAqB,eAAa;EAAO,qCAAA;EAAiC,uBAAA;EAAuB,SAAA;EAAS,SAAA;;AAAS,UAAU,0BAA0B,qBAAqB,mBAAiB;EAAK,SAAA;;AAAS,UAAU,0BAA0B,qBAAqB,mBAAiB;EAAO,SAAA;;AAAS,UAAU,0BAA0B,wBAAwB,eAAa;EAAQ,yBAAA;EAAyB,YAAA;;AAAY,UAAU,0BAA0B,wBAAwB,eAAa;EAAO,wCAAA;EAAoC,uBAAA;EAAuB,YAAA;EAAY,SAAA;;AAAS,UAAU,0BAA0B,wBAAwB,mBAAiB;EAAK,YAAA;;AAAY,UAAU,0BAA0B,wBAAwB,mBAAiB;EAAO,YAAA;;AAAY,UAAU,0BAA0B,sBAAsB,eAAa;EAAQ,uBAAA;;AAAuB,UAAU,0BAA0B,sBAAsB,eAAa;EAAO,sCAAA;EAAkC,2BAAA;EAA2B,UAAA;EAAU,QAAA;;AAAQ,UAAU,0BAA0B,sBAAsB,mBAAiB;EAAK,UAAA;;AAAU,UAAU,0BAA0B,sBAAsB,mBAAiB;EAAO,UAAA;;AAAU,UAAU,0BAA0B,uBAAuB,eAAa;EAAQ,wBAAA;EAAwB,WAAA;;AAAW,UAAU,0BAA0B,uBAAuB,eAAa;EAAO,2BAAA;EAA2B,WAAA;EAAW,QAAA;EAAQ,uCAAA;;AAAmC,UAAU,0BAA0B,uBAAuB,mBAAiB;EAAK,WAAA;;AAAW,UAAU,0BAA0B,uBAAuB,mBAAiB;EAAO,WAAA;;AAAW,UAAU,0BAA0B;EAAkB,UAAA;;AAAU,UAAU,0BAA0B,mBAAiB;EAAO,6UAAA;EAA6U,yBAAA;EAAyB,WAAA;EAAW,WAAA;;AC9L/uF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"meta-tag-manager.css"}
css/meta-tag-manager.less CHANGED
@@ -62,7 +62,7 @@
62
  font-weight:bold;
63
  font-style:italic;
64
  }
65
- .mtm-field-title .mtm-meta-context .dashicons { font-size:15px; }
66
 
67
  .mtm-field-title code { font-weight:bold; }
68
  .mtm-field-title code .mtm-meta-type-val, .mtm-field-title code .mtm-meta-content-value {
@@ -146,8 +146,8 @@
146
  /*.mtm-builder .selectize-input { padding:4px; }*/
147
  .mtm-settings .selectize-dropdown-content .optgroup .option { padding-left:10px; }
148
  .mtm-settings .selectize-dropdown-content .optgroup .optgroup-header { font-weight:bold; }
149
- .mtm-settings .selectize-control.multi .selectize-input > div { background:#5cb85c; border-color:#4cae4c; color:#fff; }
150
- .mtm-settings .selectize-control.multi .selectize-input > div .remove { border-color:#4cae4c; }
151
 
152
  .mtm-builder .mtm-field button.mtm-field-remove { background-color:#f4e3e3; border-color:#d8c5c5; color:#565656; }
153
  .mtm-builder .mtm-field a.mtm-field-remove { cursor:pointer; color:#d66b6b; }
@@ -156,4 +156,38 @@
156
 
157
  .mtm-builder .mtm-actions { padding-top:15px; }
158
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
159
  @import (inline) "selectize/selectize.css";
62
  font-weight:bold;
63
  font-style:italic;
64
  }
65
+ .mtm-field-title .mtm-meta-context .dashicons { font-size:15px; vertical-align: baseline; }
66
 
67
  .mtm-field-title code { font-weight:bold; }
68
  .mtm-field-title code .mtm-meta-type-val, .mtm-field-title code .mtm-meta-content-value {
146
  /*.mtm-builder .selectize-input { padding:4px; }*/
147
  .mtm-settings .selectize-dropdown-content .optgroup .option { padding-left:10px; }
148
  .mtm-settings .selectize-dropdown-content .optgroup .optgroup-header { font-weight:bold; }
149
+ .mtm-settings .selectize-control.multi .selectize-input > .item { background:#5cb85c; border-color:#4cae4c; color:#fff; }
150
+ .mtm-settings .selectize-control.multi .selectize-input > .item .remove { border-color:#4cae4c; }
151
 
152
  .mtm-builder .mtm-field button.mtm-field-remove { background-color:#f4e3e3; border-color:#d8c5c5; color:#565656; }
153
  .mtm-builder .mtm-field a.mtm-field-remove { cursor:pointer; color:#d66b6b; }
156
 
157
  .mtm-builder .mtm-actions { padding-top:15px; }
158
 
159
+ /* Settings Page */
160
+ .mtm-settings select:invalid { color: gray; }
161
+ .mtm-settings h3 { border-top: 1px solid #dedede; padding-top:25px; margin-top:20px; }
162
+ .mtm-settings .postbox .handlediv { display:none; visibility: hidden; }
163
+ .mtm-settings .postbox .inside { border-top: 1px solid #dedede; margin-top:0px; padding-top:10px; }
164
+ .mtm-settings .postbox h3 { font-size:16px; }
165
+ .mtm-settings .postbox td, .mtm-settings .postbox th { vertical-align:top; }
166
+ .mtm-settings .postbox th { padding: 15px 20px; margin:0 !important; font-size:0.97em; }
167
+ .mtm-settings .postbox .mtm-boxheader { font-style:italic; margin:0; padding:10px 5px; }
168
+ .mtm-settings .postbox tr.mtm-header td { font-style:italic; padding:10px 5px; margin:0; }
169
+ .mtm-settings .postbox tr.mtm-header h4, .mtm-settings .postbox .postbox h4 { font-weight:bold; font-size:15px; font-style:normal; border-bottom: 1px solid #dedede; margin:0 0 10px; padding:0 0 10px; }
170
+ .mtm-settings .postbox tr.mtm-subheader td { font-style:italic; margin:0; padding:5px 20px 2px; }
171
+ .mtm-settings .postbox tr.mtm-subheader h5 { font-style:normal; margin:10px 0; padding:0 0 5px; font-weight:bold; font-size:15px; border-bottom: 1px solid #efefef; color:#000; }
172
+
173
+ /* Schema Settings */
174
+ .mtm-settings .mtm-image-upload-preview { margin-bottom:10px; }
175
+ .mtm-settings #mtm_schema_profiles_other_row { display:none; }
176
+ .mtm-settings .mtm-schema-profiles-other a.mtm-schema-profile-remove { text-decoration: none; color:black; }
177
+
178
+ /* Go Pro Stuff */
179
+ .mtm-settings table.features { border-spacing: 0; border: 1px solid #dedede; }
180
+ .mtm-settings table.features th, table.features td { background:#fff; border:0; border-bottom: 1px solid #dedede; padding:5px; }
181
+ .mtm-settings table.features tbody tr { border-bottom:1px solid #EFEFEF; }
182
+ .mtm-settings table.features tbody tr:first-child th { background:#EFEFEF; }
183
+ .mtm-settings table.features tbody th { text-align:left; padding-left:10px; }
184
+ .mtm-settings table.features tr th:not(:first-child), table.features tr td:not(:first-child) { width:150px; padding-left:10px; padding-right:10px; text-align: center; }
185
+ .mtm-settings table.features .dashicons-yes-alt { color:darkgreen; font-size:20px; }
186
+ .mtm-settings table.features tfoot th span { display:block; margin-bottom:5px; color:#8bc976; font-size:18px; }
187
+ .mtm-settings table.features tfoot th span.deal { color:#FC9840; font-size:14px; }
188
+ .mtm-settings table.features tbody th[data-title] { cursor: pointer; }
189
+
190
+ /*! Tippy.js v6.2.7 - https://unpkg.com/tippy.js@6.2.7/themes/light-border.css */
191
+ .tippy-box[data-theme~=light-border]{background-color:#fff;background-clip:padding-box;border:1px solid rgba(0,8,16,.15);color:#333;box-shadow:0 4px 14px -2px rgba(0,8,16,.08)}.tippy-box[data-theme~=light-border]>.tippy-backdrop{background-color:#fff}.tippy-box[data-theme~=light-border]>.tippy-arrow:after,.tippy-box[data-theme~=light-border]>.tippy-svg-arrow:after{content:"";position:absolute;z-index:-1}.tippy-box[data-theme~=light-border]>.tippy-arrow:after{border-color:transparent;border-style:solid}.tippy-box[data-theme~=light-border][data-placement^=top]>.tippy-arrow:before{border-top-color:#fff}.tippy-box[data-theme~=light-border][data-placement^=top]>.tippy-arrow:after{border-top-color:rgba(0,8,16,.2);border-width:7px 7px 0;top:17px;left:1px}.tippy-box[data-theme~=light-border][data-placement^=top]>.tippy-svg-arrow>svg{top:16px}.tippy-box[data-theme~=light-border][data-placement^=top]>.tippy-svg-arrow:after{top:17px}.tippy-box[data-theme~=light-border][data-placement^=bottom]>.tippy-arrow:before{border-bottom-color:#fff;bottom:16px}.tippy-box[data-theme~=light-border][data-placement^=bottom]>.tippy-arrow:after{border-bottom-color:rgba(0,8,16,.2);border-width:0 7px 7px;bottom:17px;left:1px}.tippy-box[data-theme~=light-border][data-placement^=bottom]>.tippy-svg-arrow>svg{bottom:16px}.tippy-box[data-theme~=light-border][data-placement^=bottom]>.tippy-svg-arrow:after{bottom:17px}.tippy-box[data-theme~=light-border][data-placement^=left]>.tippy-arrow:before{border-left-color:#fff}.tippy-box[data-theme~=light-border][data-placement^=left]>.tippy-arrow:after{border-left-color:rgba(0,8,16,.2);border-width:7px 0 7px 7px;left:17px;top:1px}.tippy-box[data-theme~=light-border][data-placement^=left]>.tippy-svg-arrow>svg{left:11px}.tippy-box[data-theme~=light-border][data-placement^=left]>.tippy-svg-arrow:after{left:12px}.tippy-box[data-theme~=light-border][data-placement^=right]>.tippy-arrow:before{border-right-color:#fff;right:16px}.tippy-box[data-theme~=light-border][data-placement^=right]>.tippy-arrow:after{border-width:7px 7px 7px 0;right:17px;top:1px;border-right-color:rgba(0,8,16,.2)}.tippy-box[data-theme~=light-border][data-placement^=right]>.tippy-svg-arrow>svg{right:11px}.tippy-box[data-theme~=light-border][data-placement^=right]>.tippy-svg-arrow:after{right:12px}.tippy-box[data-theme~=light-border]>.tippy-svg-arrow{fill:#fff}.tippy-box[data-theme~=light-border]>.tippy-svg-arrow:after{background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iNiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJNMCA2czEuNzk2LS4wMTMgNC42Ny0zLjYxNUM1Ljg1MS45IDYuOTMuMDA2IDggMGMxLjA3LS4wMDYgMi4xNDguODg3IDMuMzQzIDIuMzg1QzE0LjIzMyA2LjAwNSAxNiA2IDE2IDZIMHoiIGZpbGw9InJnYmEoMCwgOCwgMTYsIDAuMikiLz48L3N2Zz4=);background-size:16px 6px;width:16px;height:6px}
192
+
193
  @import (inline) "selectize/selectize.css";
css/meta-tag-manager.min.css CHANGED
@@ -1 +1,3 @@
1
- .mtm-menu-builder{margin-bottom:15px}.mtm-field-template{display:none;visibility:hidden}.mtm-field-placeholder{width:100%;border:1px dashed #aaa;background-color:#ddd;font-size:18px;padding:30px 0;color:#555;text-align:center;margin:10px 0;cursor:pointer}.no-reference.no-context .mtm-field-placeholder{padding:20px 0}.mtm-field{display:block;clear:both;width:100%;border:1px solid #c3c3c3;background-color:#fff;margin:10px 0}.mtm-field.closed .mtm-field-data{display:none;visibility:hidden}.mtm-field .mtm-field-actions{clear:both}.mtm-field-header{padding:10px 0;cursor:pointer}.mtm-col-sort{display:block;float:left;width:20px;height:20px;padding:10px 0 0 10px;margin:0;font-size:20px;align:center;cursor:move;color:#dedede}.no-reference.no-context .mtm-col-sort{padding:0 0 0 10px}.mtm-field-title{margin-left:40px;min-height:50px}.no-reference.no-context .mtm-field-title{min-height:20px}.mtm-field-title .mtm-meta-reference{font-size:18px;padding-bottom:5px}.mtm-field-title .mtm-meta-reference-value{display:inline-block}.mtm-field-title .mtm-meta-context{font-size:12px;padding-bottom:3px;color:#bcbcbc;font-weight:700;font-style:italic}.mtm-field-title .mtm-meta-context .dashicons{font-size:15px}.mtm-field-title code{font-weight:700}.mtm-field-title code .mtm-meta-content-value,.mtm-field-title code .mtm-meta-type-val{font-style:italic;font-weight:400;background-color:#fefefe}.mtm-field-title code .mtm-meta-content.hidden{display:none}.mtm-field-header-toggle:hover,.mtm-field-section-toggle:hover{cursor:pointer}.mtm-field-header-toggle:before,.mtm-field-section-toggle:before{float:right;width:32px;height:32px;content:"\f142";display:inline-block;font:20px/1 dashicons;speak:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-decoration:none!important}.mtm-field.closed .mtm-field-header-toggle:before{content:"\f140"}.mtm-field-data{border-top:1px solid #e5e5e5;padding:10px 10px 15px}.mtm-field-input{margin:0 0 15px;clear:both}.mtm-field-input-label{margin-bottom:3px;padding:2px;font-weight:700;display:block}.mtm-field-input-label em{font-style:normal;background:#eaeaea;padding:1px 2px}.mtm-field-input input,.mtm-field-input select{width:100%;padding:4px;font-size:13px}.mtm-field-type-custom{clear:both}.mtm-field-type-custom>div{clear:none;float:left;width:48%;margin:10px 1%}.mtm-field-input.mtm-field-type-type{width:20%;float:left;clear:none}.mtm-field-input.mtm-field-type-value{width:79%!important;margin-left:21%;clear:none}.mtm-field-input input.mtm-field-input-tag-value{float:left;clear:none}.mtm-field-section{margin-top:20px}.mtm-field-section-header{border-bottom:1px solid #e3e3e3;padding-bottom:10px}.mtm-field-section-title{font-weight:700;font-size:15px}.mtm-field-section-data{margin:10px 10px 20px;padding-bottom:10px;border-bottom:1px solid #e3e3e3}.mtm-settings .selectize-dropdown-content .optgroup .option{padding-left:10px}.mtm-settings .selectize-dropdown-content .optgroup .optgroup-header{font-weight:700}.mtm-settings .selectize-control.multi .selectize-input>div{background:#5cb85c;border-color:#4cae4c;color:#fff}.mtm-settings .selectize-control.multi .selectize-input>div .remove{border-color:#4cae4c}.mtm-builder .mtm-field button.mtm-field-remove{background-color:#f4e3e3;border-color:#d8c5c5;color:#565656}.mtm-builder .mtm-field a.mtm-field-remove{cursor:pointer;color:#d66b6b}.mtm-builder button .dashicons{padding:3px 0;margin-left:-5px;color:#888}.mtm-builder button.mtm-add-field .dashicons{padding:4px 0}.mtm-builder .mtm-actions{padding-top:15px}.selectize-control.plugin-drag_drop.multi>.selectize-input>div.ui-sortable-placeholder{visibility:visible!important;background:#f2f2f2!important;background:rgba(0,0,0,.06)!important;border:0!important;-webkit-box-shadow:inset 0 0 12px 4px #fff;box-shadow:inset 0 0 12px 4px #fff}.selectize-control.plugin-drag_drop .ui-sortable-placeholder::after{content:'!';visibility:hidden}.selectize-control.plugin-drag_drop .ui-sortable-helper{-webkit-box-shadow:0 2px 5px rgba(0,0,0,.2);box-shadow:0 2px 5px rgba(0,0,0,.2)}.selectize-dropdown-header{position:relative;padding:5px 8px;border-bottom:1px solid #d0d0d0;background:#f8f8f8;-webkit-border-radius:3px 3px 0 0;-moz-border-radius:3px 3px 0 0;border-radius:3px 3px 0 0}.selectize-dropdown-header-close{position:absolute;right:8px;top:50%;color:#303030;opacity:.4;margin-top:-12px;line-height:20px;font-size:20px!important}.selectize-dropdown-header-close:hover{color:#000}.selectize-dropdown.plugin-optgroup_columns .optgroup{border-right:1px solid #f2f2f2;border-top:0 none;float:left;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.selectize-dropdown.plugin-optgroup_columns .optgroup:last-child{border-right:0 none}.selectize-dropdown.plugin-optgroup_columns .optgroup:before{display:none}.selectize-dropdown.plugin-optgroup_columns .optgroup-header{border-top:0 none}.selectize-control.plugin-remove_button [data-value]{position:relative;padding-right:24px!important}.selectize-control.plugin-remove_button [data-value] .remove{z-index:1;position:absolute;top:0;right:0;bottom:0;width:17px;text-align:center;font-weight:700;font-size:12px;color:inherit;text-decoration:none;vertical-align:middle;display:inline-block;padding:2px 0 0;border-left:1px solid #d0d0d0;-webkit-border-radius:0 2px 2px 0;-moz-border-radius:0 2px 2px 0;border-radius:0 2px 2px 0;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.selectize-control.plugin-remove_button [data-value] .remove:hover{background:rgba(0,0,0,.05)}.selectize-control.plugin-remove_button [data-value].active .remove{border-left-color:#cacaca}.selectize-control.plugin-remove_button .disabled [data-value] .remove:hover{background:0 0}.selectize-control.plugin-remove_button .disabled [data-value] .remove{border-left-color:#fff}.selectize-control.plugin-remove_button .remove-single{position:absolute;right:0;top:0;font-size:23px}.selectize-control{position:relative}.selectize-dropdown,.selectize-input,.selectize-input input{color:#303030;font-family:inherit;font-size:13px;line-height:18px;-webkit-font-smoothing:inherit}.selectize-input{cursor:text;border:1px solid #d0d0d0;padding:8px;width:100%;overflow:hidden;position:relative;z-index:1;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.1);box-shadow:inset 0 1px 1px rgba(0,0,0,.1);-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}.selectize-control.single .selectize-input.input-active,.selectize-input{background:#fff;display:inline-block}.selectize-control.multi .selectize-input.has-items{padding:6px 8px 3px}.selectize-input.full{background-color:#fff}.selectize-input.disabled,.selectize-input.disabled *{cursor:default!important}.selectize-input.focus{-webkit-box-shadow:inset 0 1px 2px rgba(0,0,0,.15);box-shadow:inset 0 1px 2px rgba(0,0,0,.15)}.selectize-input.dropdown-active{-webkit-border-radius:3px 3px 0 0;-moz-border-radius:3px 3px 0 0;border-radius:3px 3px 0 0}.selectize-input>*{vertical-align:baseline;display:-moz-inline-stack;display:inline-block;zoom:1;*display:inline}.selectize-control.multi .selectize-input>div{cursor:pointer;margin:0 3px 3px 0;padding:2px 6px;background:#f2f2f2;color:#303030;border:0 solid #d0d0d0}.selectize-control.multi .selectize-input>div.active{background:#e8e8e8;color:#303030;border:0 solid #cacaca}.selectize-control.multi .selectize-input.disabled>div,.selectize-control.multi .selectize-input.disabled>div.active{color:#7d7d7d;background:#fff;border:0 solid #fff}.selectize-input>input{display:inline-block!important;padding:0!important;min-height:0!important;max-height:none!important;max-width:100%!important;margin:0 2px 0 0!important;text-indent:0!important;border:0!important;background:0 0!important;line-height:inherit!important;-webkit-user-select:auto!important;-webkit-box-shadow:none!important;box-shadow:none!important}.selectize-input>input::-ms-clear{display:none}.selectize-input>input:focus{outline:0!important}.selectize-input>input[placeholder]{box-sizing:initial}.selectize-input::after{content:' ';display:block;clear:left}.selectize-input.dropdown-active::before{content:' ';display:block;position:absolute;background:#f0f0f0;height:1px;bottom:0;left:0;right:0}.selectize-dropdown{position:absolute;z-index:10;border:1px solid #d0d0d0;background:#fff;margin:-1px 0 0;border-top:0 none;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;-webkit-box-shadow:0 1px 3px rgba(0,0,0,.1);box-shadow:0 1px 3px rgba(0,0,0,.1);-webkit-border-radius:0 0 3px 3px;-moz-border-radius:0 0 3px 3px;border-radius:0 0 3px 3px}.selectize-dropdown [data-selectable]{cursor:pointer;overflow:hidden}.selectize-dropdown [data-selectable] .highlight{background:rgba(125,168,208,.2);-webkit-border-radius:1px;-moz-border-radius:1px;border-radius:1px}.selectize-dropdown .optgroup-header,.selectize-dropdown .option{padding:5px 8px}.selectize-dropdown .option,.selectize-dropdown [data-disabled],.selectize-dropdown [data-disabled] [data-selectable].option{cursor:inherit;opacity:.5}.selectize-dropdown [data-selectable].option{opacity:1}.selectize-dropdown .optgroup:first-child .optgroup-header{border-top:0 none}.selectize-dropdown .optgroup-header{color:#303030;background:#fff;cursor:default}.selectize-dropdown .active{background-color:#f5fafd;color:#495c68}.selectize-dropdown .active.create{color:#495c68}.selectize-dropdown .create{color:rgba(48,48,48,.5)}.selectize-dropdown-content{overflow-y:auto;overflow-x:hidden;max-height:200px;-webkit-overflow-scrolling:touch}.selectize-control.single .selectize-input,.selectize-control.single .selectize-input input{cursor:pointer}.selectize-control.single .selectize-input.input-active,.selectize-control.single .selectize-input.input-active input{cursor:text}.selectize-control.single .selectize-input:after{content:' ';display:block;position:absolute;top:50%;right:15px;margin-top:-3px;width:0;height:0;border-style:solid;border-width:5px 5px 0;border-color:gray transparent transparent}.selectize-control.single .selectize-input.dropdown-active:after{margin-top:-4px;border-width:0 5px 5px;border-color:transparent transparent gray}.selectize-control.rtl.single .selectize-input:after{left:15px;right:auto}.selectize-control.rtl .selectize-input>input{margin:0 4px 0 -2px!important}.selectize-control .selectize-input.disabled{opacity:.5;background-color:#fafafa}
 
 
1
+ .mtm-menu-builder{margin-bottom:15px}.mtm-field-template{display:none;visibility:hidden}.mtm-field-placeholder{width:100%;border:1px dashed #aaa;background-color:#ddd;font-size:18px;padding:30px 0;color:#555;text-align:center;margin:10px 0;cursor:pointer}.no-reference.no-context .mtm-field-placeholder{padding:20px 0}.mtm-field{display:block;clear:both;width:100%;border:1px solid #c3c3c3;background-color:#fff;margin:10px 0}.mtm-field.closed .mtm-field-data{display:none;visibility:hidden}.mtm-field .mtm-field-actions{clear:both}.mtm-field-header{padding:10px 0;cursor:pointer}.mtm-col-sort{display:block;float:left;width:20px;height:20px;padding:10px 0 0 10px;margin:0;font-size:20px;align:center;cursor:move;color:#dedede}.no-reference.no-context .mtm-col-sort{padding:0 0 0 10px}.mtm-field-title{margin-left:40px;min-height:50px}.no-reference.no-context .mtm-field-title{min-height:20px}.mtm-field-title .mtm-meta-reference{font-size:18px;padding-bottom:5px}.mtm-field-title .mtm-meta-reference-value{display:inline-block}.mtm-field-title .mtm-meta-context{font-size:12px;padding-bottom:3px;color:#bcbcbc;font-weight:700;font-style:italic}.mtm-field-title .mtm-meta-context .dashicons{font-size:15px;vertical-align:baseline}.mtm-field-title code{font-weight:700}.mtm-field-title code .mtm-meta-content-value,.mtm-field-title code .mtm-meta-type-val{font-style:italic;font-weight:400;background-color:#fefefe}.mtm-field-title code .mtm-meta-content.hidden,.mtm-settings #mtm_schema_profiles_other_row{display:none}.mtm-field-header-toggle:hover,.mtm-field-section-toggle:hover{cursor:pointer}.mtm-field-header-toggle:before,.mtm-field-section-toggle:before{float:right;width:32px;height:32px;content:"\f142";display:inline-block;font:20px/1 dashicons;speak:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-decoration:none!important}.mtm-field.closed .mtm-field-header-toggle:before{content:"\f140"}.mtm-field-data{border-top:1px solid #e5e5e5;padding:10px 10px 15px}.mtm-field-input{margin:0 0 15px;clear:both}.mtm-field-input-label{margin-bottom:3px;padding:2px;font-weight:700;display:block}.mtm-field-input-label em{font-style:normal;background:#eaeaea;padding:1px 2px}.mtm-field-input input,.mtm-field-input select{width:100%;padding:4px;font-size:13px}.mtm-field-type-custom{clear:both}.mtm-field-type-custom>div{clear:none;float:left;width:48%;margin:10px 1%}.mtm-field-input.mtm-field-type-type{width:20%;float:left;clear:none}.mtm-field-input.mtm-field-type-value{width:79%!important;margin-left:21%;clear:none}.mtm-field-input input.mtm-field-input-tag-value{float:left;clear:none}.mtm-field-section{margin-top:20px}.mtm-field-section-header{border-bottom:1px solid #e3e3e3;padding-bottom:10px}.mtm-field-section-title{font-weight:700;font-size:15px}.mtm-field-section-data{margin:10px 10px 20px;padding-bottom:10px;border-bottom:1px solid #e3e3e3}.mtm-settings .selectize-dropdown-content .optgroup .option{padding-left:10px}.mtm-settings .selectize-dropdown-content .optgroup .optgroup-header{font-weight:700}.mtm-settings .selectize-control.multi .selectize-input>.item{background:#5cb85c;border-color:#4cae4c;color:#fff}.mtm-settings .selectize-control.multi .selectize-input>.item .remove{border-color:#4cae4c}.mtm-builder .mtm-field button.mtm-field-remove{background-color:#f4e3e3;border-color:#d8c5c5;color:#565656}.mtm-builder .mtm-field a.mtm-field-remove{cursor:pointer;color:#d66b6b}.mtm-builder button .dashicons{padding:3px 0;margin-left:-5px;color:#888}.mtm-builder button.mtm-add-field .dashicons{padding:4px 0}.mtm-builder .mtm-actions{padding-top:15px}.mtm-settings select:invalid{color:gray}.mtm-settings h3{border-top:1px solid #dedede;padding-top:25px;margin-top:20px}.mtm-settings .postbox .handlediv{display:none;visibility:hidden}.mtm-settings .postbox .inside{border-top:1px solid #dedede;margin-top:0;padding-top:10px}.mtm-settings .postbox h3{font-size:16px}.mtm-settings .postbox td,.mtm-settings .postbox th{vertical-align:top}.mtm-settings .postbox th{padding:15px 20px;margin:0!important;font-size:.97em}.mtm-settings .postbox .mtm-boxheader,.mtm-settings .postbox tr.mtm-header td{font-style:italic;padding:10px 5px;margin:0}.mtm-settings .postbox .postbox h4,.mtm-settings .postbox tr.mtm-header h4,.mtm-settings .postbox tr.mtm-subheader h5{font-weight:700;font-size:15px;font-style:normal;border-bottom:1px solid #dedede;margin:0 0 10px;padding:0 0 10px}.mtm-settings .postbox tr.mtm-subheader td{font-style:italic;margin:0;padding:5px 20px 2px}.mtm-settings .postbox tr.mtm-subheader h5{margin:10px 0;padding:0 0 5px;border-bottom:1px solid #efefef;color:#000}.mtm-settings .mtm-image-upload-preview{margin-bottom:10px}.mtm-settings .mtm-schema-profiles-other a.mtm-schema-profile-remove{text-decoration:none;color:#000}.mtm-settings table.features{border-spacing:0;border:1px solid #dedede}.mtm-settings table.features th,table.features td{background:#fff;border:0;border-bottom:1px solid #dedede;padding:5px}.mtm-settings table.features tbody tr{border-bottom:1px solid #efefef}.mtm-settings table.features tbody tr:first-child th{background:#efefef}.mtm-settings table.features tbody th{text-align:left;padding-left:10px}.mtm-settings table.features tr th:not(:first-child),table.features tr td:not(:first-child){width:150px;padding-left:10px;padding-right:10px;text-align:center}.mtm-settings table.features .dashicons-yes-alt{color:#006400;font-size:20px}.mtm-settings table.features tfoot th span{display:block;margin-bottom:5px;color:#8bc976;font-size:18px}.mtm-settings table.features tfoot th span.deal{color:#fc9840;font-size:14px}.mtm-settings table.features tbody th[data-title]{cursor:pointer}
2
+ /*! Tippy.js v6.2.7 - https://unpkg.com/tippy.js@6.2.7/themes/light-border.css */
3
+ .tippy-box[data-theme~=light-border]{background-color:#fff;background-clip:padding-box;border:1px solid rgba(0,8,16,.15);color:#333;box-shadow:0 4px 14px -2px rgba(0,8,16,.08)}.tippy-box[data-theme~=light-border]>.tippy-backdrop{background-color:#fff}.tippy-box[data-theme~=light-border]>.tippy-arrow:after,.tippy-box[data-theme~=light-border]>.tippy-svg-arrow:after{content:"";position:absolute;z-index:-1}.tippy-box[data-theme~=light-border]>.tippy-arrow:after{border-color:transparent;border-style:solid}.tippy-box[data-theme~=light-border][data-placement^=top]>.tippy-arrow:before{border-top-color:#fff}.tippy-box[data-theme~=light-border][data-placement^=top]>.tippy-arrow:after{border-top-color:rgba(0,8,16,.2);border-width:7px 7px 0;top:17px;left:1px}.tippy-box[data-theme~=light-border][data-placement^=top]>.tippy-svg-arrow>svg{top:16px}.tippy-box[data-theme~=light-border][data-placement^=top]>.tippy-svg-arrow:after{top:17px}.tippy-box[data-theme~=light-border][data-placement^=bottom]>.tippy-arrow:before{border-bottom-color:#fff;bottom:16px}.tippy-box[data-theme~=light-border][data-placement^=bottom]>.tippy-arrow:after{border-bottom-color:rgba(0,8,16,.2);border-width:0 7px 7px;bottom:17px;left:1px}.tippy-box[data-theme~=light-border][data-placement^=bottom]>.tippy-svg-arrow>svg{bottom:16px}.tippy-box[data-theme~=light-border][data-placement^=bottom]>.tippy-svg-arrow:after{bottom:17px}.tippy-box[data-theme~=light-border][data-placement^=left]>.tippy-arrow:before{border-left-color:#fff}.tippy-box[data-theme~=light-border][data-placement^=left]>.tippy-arrow:after{border-left-color:rgba(0,8,16,.2);border-width:7px 0 7px 7px;left:17px;top:1px}.tippy-box[data-theme~=light-border][data-placement^=left]>.tippy-svg-arrow>svg{left:11px}.tippy-box[data-theme~=light-border][data-placement^=left]>.tippy-svg-arrow:after{left:12px}.tippy-box[data-theme~=light-border][data-placement^=right]>.tippy-arrow:before{border-right-color:#fff;right:16px}.tippy-box[data-theme~=light-border][data-placement^=right]>.tippy-arrow:after{border-width:7px 7px 7px 0;right:17px;top:1px;border-right-color:rgba(0,8,16,.2)}.tippy-box[data-theme~=light-border][data-placement^=right]>.tippy-svg-arrow>svg{right:11px}.tippy-box[data-theme~=light-border][data-placement^=right]>.tippy-svg-arrow:after{right:12px}.tippy-box[data-theme~=light-border]>.tippy-svg-arrow{fill:#fff}.tippy-box[data-theme~=light-border]>.tippy-svg-arrow:after{background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iNiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJNMCA2czEuNzk2LS4wMTMgNC42Ny0zLjYxNUM1Ljg1MS45IDYuOTMuMDA2IDggMGMxLjA3LS4wMDYgMi4xNDguODg3IDMuMzQzIDIuMzg1QzE0LjIzMyA2LjAwNSAxNiA2IDE2IDZIMHoiIGZpbGw9InJnYmEoMCwgOCwgMTYsIDAuMikiLz48L3N2Zz4=);background-size:16px 6px;width:16px;height:6px}.selectize-control.plugin-drag_drop.multi>.selectize-input>div.ui-sortable-placeholder{visibility:visible!important;background:#f2f2f2!important;background:rgba(0,0,0,.06)!important;border:0!important;-webkit-box-shadow:inset 0 0 12px 4px #fff;box-shadow:inset 0 0 12px 4px #fff}.selectize-control.plugin-drag_drop .ui-sortable-placeholder::after{content:'!';visibility:hidden}.selectize-control.plugin-drag_drop .ui-sortable-helper{-webkit-box-shadow:0 2px 5px rgba(0,0,0,.2);box-shadow:0 2px 5px rgba(0,0,0,.2)}.selectize-dropdown-header{position:relative;padding:5px 8px;border-bottom:1px solid #d0d0d0;background:#f8f8f8;-webkit-border-radius:3px 3px 0 0;-moz-border-radius:3px 3px 0 0;border-radius:3px 3px 0 0}.selectize-dropdown-header-close{position:absolute;right:8px;top:50%;color:#303030;opacity:.4;margin-top:-12px;line-height:20px;font-size:20px!important}.selectize-dropdown-header-close:hover{color:#000}.selectize-dropdown.plugin-optgroup_columns .optgroup{border-right:1px solid #f2f2f2;border-top:0 none;float:left;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.selectize-dropdown.plugin-optgroup_columns .optgroup:last-child{border-right:0 none}.selectize-dropdown.plugin-optgroup_columns .optgroup:before{display:none}.selectize-dropdown.plugin-optgroup_columns .optgroup-header{border-top:0 none}.selectize-control.plugin-remove_button [data-value]{position:relative;padding-right:24px!important}.selectize-control.plugin-remove_button [data-value] .remove{z-index:1;position:absolute;top:0;right:0;bottom:0;width:17px;text-align:center;font-weight:700;font-size:12px;color:inherit;text-decoration:none;vertical-align:middle;display:inline-block;padding:2px 0 0;border-left:1px solid #d0d0d0;-webkit-border-radius:0 2px 2px 0;-moz-border-radius:0 2px 2px 0;border-radius:0 2px 2px 0;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.selectize-control.plugin-remove_button [data-value] .remove:hover{background:rgba(0,0,0,.05)}.selectize-control.plugin-remove_button [data-value].active .remove{border-left-color:#cacaca}.selectize-control.plugin-remove_button .disabled [data-value] .remove:hover{background:0 0}.selectize-control.plugin-remove_button .disabled [data-value] .remove{border-left-color:#fff}.selectize-control.plugin-remove_button .remove-single{position:absolute;right:0;top:0;font-size:23px}.selectize-control{position:relative}.selectize-dropdown,.selectize-input,.selectize-input input{color:#303030;font-family:inherit;font-size:13px;line-height:18px;-webkit-font-smoothing:inherit}.selectize-input{cursor:text;border:1px solid #d0d0d0;padding:8px;width:100%;overflow:hidden;position:relative;z-index:1;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.1);box-shadow:inset 0 1px 1px rgba(0,0,0,.1);-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}.selectize-control.single .selectize-input.input-active,.selectize-input{background:#fff;display:inline-block}.selectize-control.multi .selectize-input.has-items{padding:6px 8px 3px}.selectize-input.full{background-color:#fff}.selectize-input.disabled,.selectize-input.disabled *{cursor:default!important}.selectize-input.focus{-webkit-box-shadow:inset 0 1px 2px rgba(0,0,0,.15);box-shadow:inset 0 1px 2px rgba(0,0,0,.15)}.selectize-input.dropdown-active{-webkit-border-radius:3px 3px 0 0;-moz-border-radius:3px 3px 0 0;border-radius:3px 3px 0 0}.selectize-input>*{vertical-align:baseline;display:-moz-inline-stack;display:inline-block;zoom:1;*display:inline}.selectize-control.multi .selectize-input>div{cursor:pointer;margin:0 3px 3px 0;padding:2px 6px;background:#f2f2f2;color:#303030;border:0 solid #d0d0d0}.selectize-control.multi .selectize-input>div.active{background:#e8e8e8;color:#303030;border:0 solid #cacaca}.selectize-control.multi .selectize-input.disabled>div,.selectize-control.multi .selectize-input.disabled>div.active{color:#7d7d7d;background:#fff;border:0 solid #fff}.selectize-input>input{display:inline-block!important;padding:0!important;min-height:0!important;max-height:none!important;max-width:100%!important;margin:0 2px 0 0!important;text-indent:0!important;border:0!important;background:0 0!important;line-height:inherit!important;-webkit-user-select:auto!important;-webkit-box-shadow:none!important;box-shadow:none!important}.selectize-input>input::-ms-clear{display:none}.selectize-input>input:focus{outline:0!important}.selectize-input>input[placeholder]{box-sizing:initial}.selectize-input::after{content:' ';display:block;clear:left}.selectize-input.dropdown-active::before{content:' ';display:block;position:absolute;background:#f0f0f0;height:1px;bottom:0;left:0;right:0}.selectize-dropdown{position:absolute;z-index:10;border:1px solid #d0d0d0;background:#fff;margin:-1px 0 0;border-top:0 none;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;-webkit-box-shadow:0 1px 3px rgba(0,0,0,.1);box-shadow:0 1px 3px rgba(0,0,0,.1);-webkit-border-radius:0 0 3px 3px;-moz-border-radius:0 0 3px 3px;border-radius:0 0 3px 3px}.selectize-dropdown [data-selectable]{cursor:pointer;overflow:hidden}.selectize-dropdown [data-selectable] .highlight{background:rgba(125,168,208,.2);-webkit-border-radius:1px;-moz-border-radius:1px;border-radius:1px}.selectize-dropdown .optgroup-header,.selectize-dropdown .option{padding:5px 8px}.selectize-dropdown .option,.selectize-dropdown [data-disabled],.selectize-dropdown [data-disabled] [data-selectable].option{cursor:inherit;opacity:.5}.selectize-dropdown [data-selectable].option{opacity:1}.selectize-dropdown .optgroup:first-child .optgroup-header{border-top:0 none}.selectize-dropdown .optgroup-header{color:#303030;background:#fff;cursor:default}.selectize-dropdown .active{background-color:#f5fafd;color:#495c68}.selectize-dropdown .active.create{color:#495c68}.selectize-dropdown .create{color:rgba(48,48,48,.5)}.selectize-dropdown-content{overflow-y:auto;overflow-x:hidden;max-height:200px;-webkit-overflow-scrolling:touch}.selectize-control.single .selectize-input,.selectize-control.single .selectize-input input{cursor:pointer}.selectize-control.single .selectize-input.input-active,.selectize-control.single .selectize-input.input-active input{cursor:text}.selectize-control.single .selectize-input:after{content:' ';display:block;position:absolute;top:50%;right:15px;margin-top:-3px;width:0;height:0;border-style:solid;border-width:5px 5px 0;border-color:gray transparent transparent}.selectize-control.single .selectize-input.dropdown-active:after{margin-top:-4px;border-width:0 5px 5px;border-color:transparent transparent gray}.selectize-control.rtl.single .selectize-input:after{left:15px;right:auto}.selectize-control.rtl .selectize-input>input{margin:0 4px 0 -2px!important}.selectize-control .selectize-input.disabled{opacity:.5;background-color:#fafafa}
css/selectize/selectize.min.css ADDED
@@ -0,0 +1 @@
 
1
+ .selectize-control.plugin-drag_drop.multi>.selectize-input>div.ui-sortable-placeholder{visibility:visible!important;background:#f2f2f2!important;background:rgba(0,0,0,.06)!important;border:0!important;-webkit-box-shadow:inset 0 0 12px 4px #fff;box-shadow:inset 0 0 12px 4px #fff}.selectize-control.plugin-drag_drop .ui-sortable-placeholder::after{content:'!';visibility:hidden}.selectize-control.plugin-drag_drop .ui-sortable-helper{-webkit-box-shadow:0 2px 5px rgba(0,0,0,.2);box-shadow:0 2px 5px rgba(0,0,0,.2)}.selectize-dropdown-header{position:relative;padding:5px 8px;border-bottom:1px solid #d0d0d0;background:#f8f8f8;-webkit-border-radius:3px 3px 0 0;-moz-border-radius:3px 3px 0 0;border-radius:3px 3px 0 0}.selectize-dropdown-header-close{position:absolute;right:8px;top:50%;color:#303030;opacity:.4;margin-top:-12px;line-height:20px;font-size:20px!important}.selectize-dropdown-header-close:hover{color:#000}.selectize-dropdown.plugin-optgroup_columns .optgroup{border-right:1px solid #f2f2f2;border-top:0 none;float:left;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.selectize-dropdown.plugin-optgroup_columns .optgroup:last-child{border-right:0 none}.selectize-dropdown.plugin-optgroup_columns .optgroup:before{display:none}.selectize-dropdown.plugin-optgroup_columns .optgroup-header{border-top:0 none}.selectize-control.plugin-remove_button [data-value]{position:relative;padding-right:24px!important}.selectize-control.plugin-remove_button [data-value] .remove{z-index:1;position:absolute;top:0;right:0;bottom:0;width:17px;text-align:center;font-weight:700;font-size:12px;color:inherit;text-decoration:none;vertical-align:middle;display:inline-block;padding:2px 0 0;border-left:1px solid #d0d0d0;-webkit-border-radius:0 2px 2px 0;-moz-border-radius:0 2px 2px 0;border-radius:0 2px 2px 0;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.selectize-control.plugin-remove_button [data-value] .remove:hover{background:rgba(0,0,0,.05)}.selectize-control.plugin-remove_button [data-value].active .remove{border-left-color:#cacaca}.selectize-control.plugin-remove_button .disabled [data-value] .remove:hover{background:0 0}.selectize-control.plugin-remove_button .disabled [data-value] .remove{border-left-color:#fff}.selectize-control.plugin-remove_button .remove-single{position:absolute;right:0;top:0;font-size:23px}.selectize-control{position:relative}.selectize-dropdown,.selectize-input,.selectize-input input{color:#303030;font-family:inherit;font-size:13px;line-height:18px;-webkit-font-smoothing:inherit}.selectize-input{cursor:text;border:1px solid #d0d0d0;padding:8px;width:100%;overflow:hidden;position:relative;z-index:1;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.1);box-shadow:inset 0 1px 1px rgba(0,0,0,.1);-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}.selectize-control.single .selectize-input.input-active,.selectize-input{background:#fff;display:inline-block}.selectize-control.multi .selectize-input.has-items{padding:6px 8px 3px}.selectize-input.full{background-color:#fff}.selectize-input.disabled,.selectize-input.disabled *{cursor:default!important}.selectize-input.focus{-webkit-box-shadow:inset 0 1px 2px rgba(0,0,0,.15);box-shadow:inset 0 1px 2px rgba(0,0,0,.15)}.selectize-input.dropdown-active{-webkit-border-radius:3px 3px 0 0;-moz-border-radius:3px 3px 0 0;border-radius:3px 3px 0 0}.selectize-input>*{vertical-align:baseline;display:-moz-inline-stack;display:inline-block;zoom:1;*display:inline}.selectize-control.multi .selectize-input>div{cursor:pointer;margin:0 3px 3px 0;padding:2px 6px;background:#f2f2f2;color:#303030;border:0 solid #d0d0d0}.selectize-control.multi .selectize-input>div.active{background:#e8e8e8;color:#303030;border:0 solid #cacaca}.selectize-control.multi .selectize-input.disabled>div,.selectize-control.multi .selectize-input.disabled>div.active{color:#7d7d7d;background:#fff;border:0 solid #fff}.selectize-input>input{display:inline-block!important;padding:0!important;min-height:0!important;max-height:none!important;max-width:100%!important;margin:0 2px 0 0!important;text-indent:0!important;border:0!important;background:0 0!important;line-height:inherit!important;-webkit-user-select:auto!important;-webkit-box-shadow:none!important;box-shadow:none!important}.selectize-input>input::-ms-clear{display:none}.selectize-input>input:focus{outline:0!important}.selectize-input>input[placeholder]{box-sizing:initial}.selectize-input::after{content:' ';display:block;clear:left}.selectize-input.dropdown-active::before{content:' ';display:block;position:absolute;background:#f0f0f0;height:1px;bottom:0;left:0;right:0}.selectize-dropdown{position:absolute;z-index:10;border:1px solid #d0d0d0;background:#fff;margin:-1px 0 0;border-top:0 none;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;-webkit-box-shadow:0 1px 3px rgba(0,0,0,.1);box-shadow:0 1px 3px rgba(0,0,0,.1);-webkit-border-radius:0 0 3px 3px;-moz-border-radius:0 0 3px 3px;border-radius:0 0 3px 3px}.selectize-dropdown [data-selectable]{cursor:pointer;overflow:hidden}.selectize-dropdown [data-selectable] .highlight{background:rgba(125,168,208,.2);-webkit-border-radius:1px;-moz-border-radius:1px;border-radius:1px}.selectize-dropdown .optgroup-header,.selectize-dropdown .option{padding:5px 8px}.selectize-dropdown .option,.selectize-dropdown [data-disabled],.selectize-dropdown [data-disabled] [data-selectable].option{cursor:inherit;opacity:.5}.selectize-dropdown [data-selectable].option{opacity:1}.selectize-dropdown .optgroup:first-child .optgroup-header{border-top:0 none}.selectize-dropdown .optgroup-header{color:#303030;background:#fff;cursor:default}.selectize-dropdown .active{background-color:#f5fafd;color:#495c68}.selectize-dropdown .active.create{color:#495c68}.selectize-dropdown .create{color:rgba(48,48,48,.5)}.selectize-dropdown-content{overflow-y:auto;overflow-x:hidden;max-height:200px;-webkit-overflow-scrolling:touch}.selectize-control.single .selectize-input,.selectize-control.single .selectize-input input{cursor:pointer}.selectize-control.single .selectize-input.input-active,.selectize-control.single .selectize-input.input-active input{cursor:text}.selectize-control.single .selectize-input:after{content:' ';display:block;position:absolute;top:50%;right:15px;margin-top:-3px;width:0;height:0;border-style:solid;border-width:5px 5px 0;border-color:gray transparent transparent}.selectize-control.single .selectize-input.dropdown-active:after{margin-top:-4px;border-width:0 5px 5px;border-color:transparent transparent gray}.selectize-control.rtl.single .selectize-input:after{left:15px;right:auto}.selectize-control.rtl .selectize-input>input{margin:0 4px 0 -2px!important}.selectize-control .selectize-input.disabled{opacity:.5;background-color:#fafafa}
js/meta-tag-manager-settings.js CHANGED
@@ -29,8 +29,9 @@ jQuery(document).ready(function($){
29
  }
30
  }else{
31
  //set to general tab by default, so we can also add clicked subsections
32
- document.location = navUrl+"#builder";
33
  }
 
34
  $('.nav-tab-link').on('click', function(){ $($(this).attr('rel')).trigger('click'); }); //links to mimick tabs
35
  $('input[type="submit"]').on('click', function(){
36
  var el = $(this).parents('.postbox').first();
@@ -45,4 +46,71 @@ jQuery(document).ready(function($){
45
  }
46
  document.location = newloc;
47
  });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
48
  });
29
  }
30
  }else{
31
  //set to general tab by default, so we can also add clicked subsections
32
+ document.location = navUrl+"#custom-meta-tags";
33
  }
34
+ $('.tabs-active .nav-tab-wrapper .nav-tab.nav-tab-active').trigger('click');
35
  $('.nav-tab-link').on('click', function(){ $($(this).attr('rel')).trigger('click'); }); //links to mimick tabs
36
  $('input[type="submit"]').on('click', function(){
37
  var el = $(this).parents('.postbox').first();
46
  }
47
  document.location = newloc;
48
  });
49
+
50
+ // settings trigger
51
+ $('.mtm-settings-binary-trigger').on('change', function(){
52
+ var el = $(this);
53
+ if( el.prop('checked') ){
54
+ $(el.data('trigger-content')).show();
55
+ }else{
56
+ $(el.data('trigger-content')).hide();
57
+ }
58
+ }).trigger('change');
59
+
60
+ // image uploader
61
+
62
+ jQuery(document).ready( function($) {
63
+
64
+ $('.mtm-image-upload input.mtm-image-upload-submit').on('click', function(e) {
65
+ e.preventDefault();
66
+ var wrap = $(this).closest('.mtm-image-upload');
67
+ var image_frame;
68
+ if(image_frame){
69
+ image_frame.open();
70
+ }
71
+ image_frame = wp.media({
72
+ title: 'Select Media',
73
+ multiple : false,
74
+ library : {
75
+ type : 'image',
76
+ }
77
+ });
78
+ image_frame.on('close',function() {
79
+ // get selections and save to hidden input plus other AJAX stuff etc.
80
+ var selection = image_frame.state().get('selection');
81
+ var gallery_ids = new Array();
82
+ var my_index = 0;
83
+ selection.each(function(attachment) {
84
+ gallery_ids[my_index] = attachment['id'];
85
+ my_index++;
86
+ });
87
+ var ids = gallery_ids.join(",");
88
+ wrap.find('.mtm-image-upload-input').val(ids);
89
+ // refresh image
90
+ var data = {
91
+ action: wrap.data('action'),
92
+ id: ids
93
+ };
94
+ jQuery.get( ajaxurl, data, function (response) {
95
+ if (response.success === true) {
96
+ wrap.find('.mtm-image-upload-preview').html(response.data.image);
97
+ }
98
+ });
99
+ });
100
+ image_frame.on('open',function() {
101
+ var selection = image_frame.state().get('selection');
102
+ ids = wrap.find('.mtm-image-upload-input').val().split(',');
103
+ ids.forEach(function(id) {
104
+ attachment = wp.media.attachment(id);
105
+ attachment.fetch();
106
+ selection.add( attachment ? [ attachment ] : [] );
107
+ });
108
+
109
+ });
110
+ image_frame.on('toolbar:create:select',function() {
111
+ image_frame.state().set('filterable', 'uploaded');
112
+ });
113
+ image_frame.open();
114
+ });
115
+ });
116
  });
js/meta-tag-manager-settings.min.js ADDED
@@ -0,0 +1 @@
 
1
+ jQuery(document).ready(function($){$(".tabs-active .nav-tab-wrapper .nav-tab").on("click",function(){el=$(this);elid=el.attr("id");$(".mtm-menu-group").hide();$("."+elid).show()});$(".nav-tab-wrapper .nav-tab").on("click",function(){$(".nav-tab-wrapper .nav-tab").removeClass("nav-tab-active");$(this).addClass("nav-tab-active").blur()});var navUrl=document.location.toString();if(navUrl.match("#")){var nav_tab=navUrl.split("#");var current_tab="a#mtm-menu-"+nav_tab[1];$(current_tab).trigger("click");if(nav_tab.length>2){section=$("#mtm-opt-"+nav_tab[2]);if(section.length>0){section.children("h2").trigger("click");$("html, body").animate({scrollTop:section.offset().top-30})}}}else{document.location=navUrl+"#custom-meta-tags"}$(".tabs-active .nav-tab-wrapper .nav-tab.nav-tab-active").trigger("click");$(".nav-tab-link").on("click",function(){$($(this).attr("rel")).trigger("click")});$('input[type="submit"]').on("click",function(){var el=$(this).parents(".postbox").first();var docloc=document.location.toString().split("#");var newloc=docloc[0];if(docloc.length>1){var nav_tab=docloc[1].split("#");newloc=newloc+"#"+nav_tab[0];if(el.attr("id")){newloc=newloc+"#"+el.attr("id").replace("mtm-opt-","")}}document.location=newloc});$(".mtm-settings-binary-trigger").on("change",function(){var el=$(this);if(el.prop("checked")){$(el.data("trigger-content")).show()}else{$(el.data("trigger-content")).hide()}}).trigger("change");jQuery(document).ready(function($){$(".mtm-image-upload input.mtm-image-upload-submit").on("click",function(e){e.preventDefault();var wrap=$(this).closest(".mtm-image-upload");var image_frame;if(image_frame){image_frame.open()}image_frame=wp.media({title:"Select Media",multiple:false,library:{type:"image"}});image_frame.on("close",function(){var selection=image_frame.state().get("selection");var gallery_ids=new Array;var my_index=0;selection.each(function(attachment){gallery_ids[my_index]=attachment["id"];my_index++});var ids=gallery_ids.join(",");wrap.find(".mtm-image-upload-input").val(ids);var data={action:wrap.data("action"),id:ids};jQuery.get(ajaxurl,data,function(response){if(response.success===true){wrap.find(".mtm-image-upload-preview").html(response.data.image)}})});image_frame.on("open",function(){var selection=image_frame.state().get("selection");ids=wrap.find(".mtm-image-upload-input").val().split(",");ids.forEach(function(id){attachment=wp.media.attachment(id);attachment.fetch();selection.add(attachment?[attachment]:[])})});image_frame.on("toolbar:create:select",function(){image_frame.state().set("filterable","uploaded")});image_frame.open()})})});
js/meta-tag-manager.js CHANGED
@@ -27,38 +27,57 @@ jQuery(document).ready( function($) {
27
  }
28
  });
29
  //add selectize for contexts, which is a tag-style selection
30
- container.find('.mtm-field-input-tag-context').selectize({
31
  plugins: ['remove_button'],
32
- maxItems: 100,
33
- closeAfterSelect: true,
34
- //add some extra functions in case 'all' is selected, hence no need to select other things
35
- onItemAdd: function(value, item){
36
- if( this.items.length > 1 ){
37
- if( value == 'all' ){
38
- this.clear(true);
39
- this.addItem('all', true);
40
- //this.settings.maxItems = 1;
41
- }else if( this.getItem('all').length ){
42
- this.removeItem('all', true);
43
- }
44
- }
45
- },
46
- //update display values on header of field card
47
- onChange: function(items){
48
- var values = [];
49
- if( typeof items == 'object' && items ){
50
- items.forEach(function(item){
51
- values.push(this.getItem(item).text().replace(/×$/i, ''));
52
- }, this);
53
- }
54
- this.$control.closest('.mtm-field').find('.mtm-meta-context-values').text(values.join(', '));
55
- }
56
- }).on('click', function(){ this.selectize.open(); });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
57
  //general selectize for other selectizable dropdowns
58
  container.find('.mtm-field-input-selectize').selectize({
59
  create: true,
60
  });
61
  container.find('.mtm-field-input-tag-reference').hide();
 
62
  }
63
  //init displayed fields on page load
64
  $('.mtm-builder .mtm-fields .mtm-field').addClass('closed')
27
  }
28
  });
29
  //add selectize for contexts, which is a tag-style selection
30
+ var selectize_context_options = {
31
  plugins: ['remove_button'],
32
+ maxItems: 100,
33
+ closeAfterSelect: true,
34
+ //add some extra functions in case 'all' is selected, hence no need to select other things
35
+ onItemAdd: function(value, item){
36
+ if( this.items.length > 1 ){
37
+ if( value == 'all' ){
38
+ this.clear(true);
39
+ this.addItem('all', true);
40
+ //this.settings.maxItems = 1;
41
+ }else if( this.getItem('all').length ){
42
+ this.removeItem('all', true);
43
+ }
44
+ }
45
+ },
46
+ //update display values on header of field card
47
+ onChange: function(items){
48
+ var field = this.$control.closest('.mtm-field');
49
+ var context_class = $(this.$input[0]).data('values-container');
50
+ var context_text_class = $(this.$input[0]).data('values-text');
51
+ var context_default = $(this.$input[0]).data('values-default');
52
+ if( items.length == 0 ){
53
+ if( context_default ){
54
+ var default_option = this.options[context_default];
55
+ var default_text = this.options.all.text;
56
+ field.find('.' + context_text_class).text(default_text);
57
+ }else{
58
+ field.find('.' + context_text_class).text('');
59
+ field.find('.' + context_class).first().hide();
60
+ }
61
+ }else {
62
+ var values = [];
63
+ if (typeof items == 'object' && items) {
64
+ items.forEach(function (item) {
65
+ values.push(this.getItem(item).text().replace(/×$/i, ''));
66
+ }, this);
67
+ }
68
+ field.find('.' + context_class).first().show();
69
+ field.find('.' + context_text_class).text(values.join(', '));
70
+ }
71
+ }
72
+ };
73
+ $(document).triggerHandler('mtm_selectize_context_options', [selectize_context_options]);
74
+ container.find('.mtm-field-input-tag-context').selectize(selectize_context_options).on('click', function(){ this.selectize.open(); });
75
  //general selectize for other selectizable dropdowns
76
  container.find('.mtm-field-input-selectize').selectize({
77
  create: true,
78
  });
79
  container.find('.mtm-field-input-tag-reference').hide();
80
+ $(document).triggerHandler('mtm_tag_init', [container]);
81
  }
82
  //init displayed fields on page load
83
  $('.mtm-builder .mtm-fields .mtm-field').addClass('closed')
js/meta-tag-manager.min.js ADDED
@@ -0,0 +1 @@
 
1
+ jQuery(document).ready(function($){var init_fields=function(container){container.find(".mtm-field-input-tag-type").each(function(e){if(this.value=="charset"){$(this).closest(".mtm-field").find(".mtm-field-type-content").show()}});container.find(".mtm-field-input-tag-type").selectize().on("change",function(e){var parent=$(this).closest(".mtm-field");parent.find(".mtm-field-type-content").hide();if(this.value!="charset"){parent.find(".mtm-field-type-content").show()}var value_template=$(this).closest(".mtm-builder").find(".mtm-field-type-templates .mtm-field-input-tag-"+this.value).first().clone();if(value_template.length>0){value_template=value_template.clone();var current_value=parent.find("select.mtm-field-input-tag-value, input.mtm-field-input-tag-value");var current_value_name=current_value.attr("name");current_value.each(function(){if(typeof this.selectize!="undefined")this.selectize.destroy()}).replaceWith(value_template);parent.find(".mtm-field-input.mtm-field-type-value label em").text(this.value);value_template.attr("name",current_value_name).trigger("change");if(value_template.is("select"))value_template.selectize({create:true})}});var selectize_context_options={plugins:["remove_button"],maxItems:100,closeAfterSelect:true,onItemAdd:function(value,item){if(this.items.length>1){if(value=="all"){this.clear(true);this.addItem("all",true)}else if(this.getItem("all").length){this.removeItem("all",true)}}},onChange:function(items){var field=this.$control.closest(".mtm-field");var context_class=$(this.$input[0]).data("values-container");var context_text_class=$(this.$input[0]).data("values-text");var context_default=$(this.$input[0]).data("values-default");if(items.length==0){if(context_default){var default_option=this.options[context_default];var default_text=this.options.all.text;field.find("."+context_text_class).text(default_text)}else{field.find("."+context_text_class).text("");field.find("."+context_class).first().hide()}}else{var values=[];if(typeof items=="object"&&items){items.forEach(function(item){values.push(this.getItem(item).text().replace(/×$/i,""))},this)}field.find("."+context_class).first().show();field.find("."+context_text_class).text(values.join(", "))}}};$(document).triggerHandler("mtm_selectize_context_options",[selectize_context_options]);container.find(".mtm-field-input-tag-context").selectize(selectize_context_options).on("click",function(){this.selectize.open()});container.find(".mtm-field-input-selectize").selectize({create:true});container.find(".mtm-field-input-tag-reference").hide();$(document).triggerHandler("mtm_tag_init",[container])};$(".mtm-builder .mtm-fields .mtm-field").addClass("closed");init_fields($(".mtm-builder .mtm-fields"));var build_meta_tag=function(container){var meta_type=container.find(".mtm-field-input-tag-type option:selected").val();if(meta_type){container.find(".mtm-field-title code").show();var meta_value=container.find("select.mtm-field-input-tag-"+meta_type+" option:selected").val();container.find(".mtm-field-title code .mtm-meta-type-att").text(meta_type).css("opacity","0.1").animate({opacity:"1"});container.find(".mtm-field-title code .mtm-meta-type-val").text(meta_value).css("opacity","0.1").animate({opacity:"1"});if(meta_type=="charset"){container.find(".mtm-field-title code .mtm-meta-content").hide()}else{container.find(".mtm-field-title code .mtm-meta-content").fadeIn().children(".mtm-meta-content-value").text(container.find(".mtm-field-input-tag-content").val()).css("opacity","0.1").animate({opacity:"1"})}}};$(".mtm-builder").on("change",".mtm-field-input-tag-type",function(){build_meta_tag($(this).closest(".mtm-field"))});$(".mtm-builder").on("keyup change",".mtm-field-input-tag-content",function(){$(this).closest(".mtm-field").find(".mtm-field-title code .mtm-meta-content-value").css("opacity","0.1").animate({opacity:"1"}).text(this.value)});$(".mtm-builder").on("change keyup",".mtm-field-input-tag-value",function(){$(this).closest(".mtm-field").find(".mtm-field-title code .mtm-meta-type-val").css("opacity","0.1").animate({opacity:"1"}).text(this.value)});$(".mtm-builder").on("keyup change",".mtm-field-input-tag-reference",function(){$(this).closest(".mtm-field").find(".mtm-field-title .mtm-meta-reference .mtm-meta-reference-value").text(this.value)});$(".mtm-builder").on("blur",".mtm-field-input-tag-reference",function(e){e.preventDefault()});$(".mtm-builder .mtm-fields").sortable({placeholder:"mtm-field-placeholder",handle:".mtm-field-header",start:function(event,ui){ui.item.addClass("closed").data("openField",false);ui.item.css("height","auto")}});$(".mtm-builder").on("mousedown mouseup",".mtm-field-header, button.mtm-field-close",function(e){if($(e.target).hasClass("mtm-field-input-tag-reference"))return;var field=$(this).closest(".mtm-field");if(e.type=="mousedown"){field.data("openField",field.hasClass("closed"));field.addClass("closed");field.find(".mtm-meta-reference .mtm-meta-reference-value").show();field.find(".mtm-meta-reference .mtm-field-input-tag-reference").hide()}else if(field.data("openField")){field.siblings(".mtm-field").addClass("closed");field.removeClass("closed");field.find(".mtm-meta-reference .mtm-meta-reference-value").hide();field.find(".mtm-meta-reference .mtm-field-input-tag-reference").show()}}).on("click",".mtm-field-remove",function(){if($(this).closest(".mtm-fields").children(".mtm-field").length<=1){$(this).closest(".mtm-builder").find(".mtm-field-placeholder").show()}$(this).closest(".mtm-field").remove()}).on("click",".mtm-add-field",function(e){e.preventDefault();var container=$(this).closest(".mtm-builder");container.find(".mtm-field-placeholder").hide();container.find(".mtm-field").addClass("closed");var index=container.data("nextIndex");container.data("nextIndex",index+1);var new_field=$(".mtm-field-template .mtm-field").clone().data("thisIndex",index);new_field.find("[name*='[t]']").each(function(i){var new_attribute=$(this).attr("name").replace("mtm-fields[t]","mtm-fields["+index+"]");$(this).attr("name",new_attribute)});$(".mtm-builder .mtm-fields").append(new_field);init_fields(new_field);new_field.removeClass("closed");new_field.find(".mtm-meta-reference .mtm-meta-reference-value").hide();new_field.find(".mtm-meta-reference .mtm-field-input-tag-reference").show();$(this).blur()}).data("nextIndex",$(".mtm-builder .mtm-fields .mtm-field").length);$(".mtm-settings .mtm-post-types .mtm-post-types-select").selectize({plugins:["remove_button"],maxItems:100,closeAfterSelect:false}).on("click",function(){this.selectize.open()})});
meta-tag-manager-admin.php CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
  /*
3
- Copyright (C) 2016 Marcus Sykes
4
 
5
  This program is free software; you can redistribute it and/or modify
6
  it under the terms of the GNU General Public License as published by
@@ -20,12 +20,15 @@ if( !defined('ABSPATH') ) exit;
20
  class Meta_Tag_Manager_Admin {
21
 
22
  /** loads the plugin */
23
- public static function init() {
24
- global $pagenow;
 
 
 
25
  // add plugin page to admin menu
26
  add_action ( 'admin_menu', array ( __CLASS__, 'menus' ) );
27
  if( version_compare(MTM_VERSION, get_option('mtm_version', 0)) ){
28
- include_once('mtm-update.php');
29
  }
30
  if($pagenow == 'post.php' || $pagenow == 'post-new.php' ){ //only needed if editing post
31
  //meta boxes
@@ -35,7 +38,43 @@ class Meta_Tag_Manager_Admin {
35
  //special for attachments (if supported)
36
  add_action('attachment_updated', 'Meta_Tag_Manager_Admin::wp_insert_attachment_data');
37
  add_action('add_attachment', 'Meta_Tag_Manager_Admin::wp_insert_attachment_data');
38
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
39
  }
40
 
41
  public static function load_plugin_textdomain(){
@@ -51,23 +90,37 @@ class Meta_Tag_Manager_Admin {
51
 
52
  /** loads javascript on plugin admin page */
53
  public static function scripts( $hook ) {
54
- if( in_array($hook, array('post.php', 'post-new.php', 'settings_page_meta-tag-manager')) ){
55
  if($hook == 'post.php' || $hook == 'post-new.php' ){
56
  global $post;
57
  $mtm_custom = get_option('mtm_custom');
58
  if( !empty($mtm_custom['post-types']) && !in_array($post->post_type, $mtm_custom['post-types']) ) return;
59
  }
 
60
  $jquery_deps = array('jquery','jquery-ui-core','jquery-ui-widget','jquery-ui-mouse','jquery-ui-sortable');
61
- if( defined('WP_DEBUG') && WP_DEBUG ){
62
  wp_enqueue_script('mtm-selectize', plugins_url('js/selectize.js',__FILE__), $jquery_deps, MTM_VERSION);
63
  wp_enqueue_script('meta-tag-manager', plugins_url('js/meta-tag-manager.js',__FILE__), $jquery_deps, MTM_VERSION);
64
  wp_enqueue_style('mtm-selectize', plugins_url('css/selectize/selectize.css',__FILE__), array(), MTM_VERSION);
65
  wp_enqueue_style('meta-tag-manager', plugins_url('css/meta-tag-manager.css',__FILE__), array(), MTM_VERSION);
 
 
 
66
  }else{
67
  wp_enqueue_script('mtm-selectize', plugins_url('js/selectize.min.js',__FILE__), $jquery_deps, MTM_VERSION);
68
- wp_enqueue_script('meta-tag-manager', plugins_url('js/meta-tag-manager.js',__FILE__), $jquery_deps, MTM_VERSION);
69
  wp_enqueue_style('meta-tag-manager', plugins_url('css/meta-tag-manager.min.css',__FILE__), array(), MTM_VERSION);
 
 
 
70
  }
 
 
 
 
 
 
 
71
  }
72
  }
73
 
@@ -81,8 +134,12 @@ class Meta_Tag_Manager_Admin {
81
  public static function post_meta_box(){
82
  global $post;
83
  //output builder
84
- include('mtm-builder.php');
85
- echo MTM_Builder::output(Meta_Tag_Manager::get_post_data($post->ID), array('context'=>false));
 
 
 
 
86
  }
87
 
88
  public static function wp_insert_post_data( $data, $postarr ){
@@ -91,7 +148,7 @@ class Meta_Tag_Manager_Admin {
91
  $mtm_custom = get_option('mtm_custom');
92
  //get posted meta tag data and save it to CPT meta
93
  if( $post_ID && !empty($mtm_custom['post-types']) && in_array($post_type, $mtm_custom['post-types']) ){
94
- include_once('mtm-builder.php');
95
  $mtm_data = MTM_Builder::get_post(array('context'=>false));
96
  if( !empty($mtm_data) ){
97
  update_post_meta($post_ID, 'mtm_data', $mtm_data);
@@ -114,8 +171,35 @@ class Meta_Tag_Manager_Admin {
114
 
115
  /** the plugin options page */
116
  public static function options() {
117
- include_once('mtm-builder.php');
118
- include('mtm-admin-settings.php');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
119
  }
120
  }
121
 
1
  <?php
2
  /*
3
+ Copyright (C) 2021 Marcus Sykes
4
 
5
  This program is free software; you can redistribute it and/or modify
6
  it under the terms of the GNU General Public License as published by
20
  class Meta_Tag_Manager_Admin {
21
 
22
  /** loads the plugin */
23
+ public static function init() {
24
+ global $pagenow, $MTM_Notices;
25
+ include_once('admin/notices/admin-notices.php');
26
+ include_once('admin/notices/notices.php');
27
+ $MTM_Notices = new \Meta_Tag_Manager\Notices();
28
  // add plugin page to admin menu
29
  add_action ( 'admin_menu', array ( __CLASS__, 'menus' ) );
30
  if( version_compare(MTM_VERSION, get_option('mtm_version', 0)) ){
31
+ include_once('admin/mtm-update.php');
32
  }
33
  if($pagenow == 'post.php' || $pagenow == 'post-new.php' ){ //only needed if editing post
34
  //meta boxes
38
  //special for attachments (if supported)
39
  add_action('attachment_updated', 'Meta_Tag_Manager_Admin::wp_insert_attachment_data');
40
  add_action('add_attachment', 'Meta_Tag_Manager_Admin::wp_insert_attachment_data');
41
+ }
42
+ add_action('admin_init', 'Meta_Tag_Manager_Admin::admin_init');
43
+
44
+ // Ajax action to refresh the user image
45
+ add_action( 'wp_ajax_mtm_get_logo_url', 'Meta_Tag_Manager_Admin::ajax_logo_preview' );
46
+ }
47
+
48
+ public static function admin_init(){
49
+ if ( !empty($_REQUEST['mtm_nonce']) && wp_verify_nonce($_REQUEST['mtm_nonce'], 'mtm_options_submitted') ) {
50
+ Meta_Tag_Manager::load();
51
+ $mtm_data = MTM_Builder::get_post();
52
+ update_option ( 'mtm_data', $mtm_data );
53
+ //quickly sanitize the post type custom data and save
54
+ $mtm_custom = array('post-types'=>array());
55
+ if( !empty($_REQUEST['mtm-post-types']) ){
56
+ $post_types = get_post_types(array('public'=>true), 'names');
57
+ foreach( $_REQUEST['mtm-post-types'] as $post_type ){
58
+ if( in_array($post_type, $post_types) ){
59
+ $mtm_custom['post-types'][] = sanitize_text_field($post_type);
60
+ }
61
+ }
62
+ }
63
+ // save schema, og, etc.
64
+ $mtm_custom['schema'] = \Meta_Tag_Manager\Schema_Admin::get_post();
65
+ $mtm_custom['og'] = \Meta_Tag_Manager\Open_Graph_Admin::get_post();
66
+ $mtm_custom['verify'] = \Meta_Tag_Manager\Verify_Sites_Admin::get_post();
67
+ // filters/actions and save
68
+ $mtm_custom = apply_filters('mtm_custom_settings_save', $mtm_custom);
69
+ update_option('mtm_custom', $mtm_custom);
70
+ do_action('meta_tag_manager_settings_saved');
71
+ $url = add_query_arg('saved', 1, wp_get_referer());
72
+ // add test link
73
+ if( !empty($_REQUEST['schema_test_afterwards']) && in_array($_REQUEST['schema_test_afterwards'],array('google', 'schema.org')) ) $url = add_query_arg('schema_test', $_REQUEST['schema_test_afterwards'], $url);
74
+ if( !empty($_REQUEST['og_test_afterwards']) && in_array($_REQUEST['og_test_afterwards'],array('google', 'twitter', 'fb')) ) $url = add_query_arg('og_test', $_REQUEST['og_test_afterwards'], $url);
75
+ wp_redirect( $url );
76
+ exit;
77
+ }
78
  }
79
 
80
  public static function load_plugin_textdomain(){
90
 
91
  /** loads javascript on plugin admin page */
92
  public static function scripts( $hook ) {
93
+ if( in_array($hook, array('post.php', 'post-new.php', 'settings_page_meta-tag-manager', 'force_load')) ){
94
  if($hook == 'post.php' || $hook == 'post-new.php' ){
95
  global $post;
96
  $mtm_custom = get_option('mtm_custom');
97
  if( !empty($mtm_custom['post-types']) && !in_array($post->post_type, $mtm_custom['post-types']) ) return;
98
  }
99
+ if ( ! did_action( 'wp_enqueue_media' ) ) wp_enqueue_media(); // include upload image field for logo
100
  $jquery_deps = array('jquery','jquery-ui-core','jquery-ui-widget','jquery-ui-mouse','jquery-ui-sortable');
101
+ if( (defined('WP_DEBUG') && WP_DEBUG) || defined('SCRIPT_DEBUG') && SCRIPT_DEBUG || defined('MTM_DEBUG') && MTM_DEBUG ){
102
  wp_enqueue_script('mtm-selectize', plugins_url('js/selectize.js',__FILE__), $jquery_deps, MTM_VERSION);
103
  wp_enqueue_script('meta-tag-manager', plugins_url('js/meta-tag-manager.js',__FILE__), $jquery_deps, MTM_VERSION);
104
  wp_enqueue_style('mtm-selectize', plugins_url('css/selectize/selectize.css',__FILE__), array(), MTM_VERSION);
105
  wp_enqueue_style('meta-tag-manager', plugins_url('css/meta-tag-manager.css',__FILE__), array(), MTM_VERSION);
106
+ if( $hook == 'settings_page_meta-tag-manager' ) {
107
+ wp_enqueue_script('meta-tag-manager-settings', plugins_url('js/meta-tag-manager-settings.js', __FILE__), $jquery_deps, MTM_VERSION);
108
+ }
109
  }else{
110
  wp_enqueue_script('mtm-selectize', plugins_url('js/selectize.min.js',__FILE__), $jquery_deps, MTM_VERSION);
111
+ wp_enqueue_script('meta-tag-manager', plugins_url('js/meta-tag-manager.min.js',__FILE__), $jquery_deps, MTM_VERSION);
112
  wp_enqueue_style('meta-tag-manager', plugins_url('css/meta-tag-manager.min.css',__FILE__), array(), MTM_VERSION);
113
+ if( $hook == 'settings_page_meta-tag-manager' ){
114
+ wp_enqueue_script('meta-tag-manager-settings', plugins_url('js/meta-tag-manager-settings.min.js',__FILE__), $jquery_deps, MTM_VERSION);
115
+ }
116
  }
117
+ do_action('mtm_admin_scripts', $hook);
118
+
119
+ if($hook == 'post.php' || $hook == 'post-new.php' ){
120
+ do_action('mtm_admin_scripts_posts', $hook);
121
+ }elseif( $hook == 'settings_page_meta-tag-manager' ){
122
+ do_action('mtm_admin_scripts_settings');
123
+ }
124
  }
125
  }
126
 
134
  public static function post_meta_box(){
135
  global $post;
136
  //output builder
137
+ static::load_builder();
138
+ MTM_Builder::output(Meta_Tag_Manager::get_post_data($post->ID), array('context'=>false));
139
+ }
140
+
141
+ public static function load_builder(){
142
+ Meta_Tag_Manager::load('builder'); //legacy function
143
  }
144
 
145
  public static function wp_insert_post_data( $data, $postarr ){
148
  $mtm_custom = get_option('mtm_custom');
149
  //get posted meta tag data and save it to CPT meta
150
  if( $post_ID && !empty($mtm_custom['post-types']) && in_array($post_type, $mtm_custom['post-types']) ){
151
+ Meta_Tag_Manager::load('builder');
152
  $mtm_data = MTM_Builder::get_post(array('context'=>false));
153
  if( !empty($mtm_data) ){
154
  update_post_meta($post_ID, 'mtm_data', $mtm_data);
171
 
172
  /** the plugin options page */
173
  public static function options() {
174
+ static::load_builder();
175
+ include_once('admin/functions.php');
176
+ include('admin/mtm-admin-settings.php');
177
+ }
178
+
179
+ public static function ajax_logo_preview() {
180
+ if( isset($_GET['id']) ){
181
+ $image = wp_get_attachment_image( filter_input( INPUT_GET, 'id', FILTER_VALIDATE_INT ) );
182
+ $data = array( 'image' => $image );
183
+ wp_send_json_success( $data );
184
+ } else {
185
+ wp_send_json_error();
186
+ }
187
+ }
188
+
189
+ /**
190
+ * Outputs JS for dismissing notices.
191
+ */
192
+ public static function admin_footer(){
193
+ ?>
194
+ <script type="text/javascript">
195
+ jQuery(document).ready( function($){
196
+ $('.mtm-admin-notice').on('click', 'button.notice-dismiss', function(e){
197
+ var the_notice = $(this).closest('.mtm-admin-notice');
198
+ $.get('<?php echo admin_url('admin-ajax.php'); ?>', {'action' : the_notice.data('dismiss-action'), 'notice' : the_notice.data('dismiss-key') });
199
+ });
200
+ });
201
+ </script>
202
+ <?php
203
  }
204
  }
205
 
meta-tag-manager.php CHANGED
@@ -2,10 +2,10 @@
2
  /*
3
  Plugin Name: Meta Tag Manager
4
  Plugin URI: https://wordpress.org/plugins/meta-tag-manager/
5
- Description: A simple plugin to manage meta tags that appear on aread of your site or individual posts. This can be used for verifiying google, yahoo, and more.
6
  Author: Marcus Sykes
7
- Version: 2.3
8
- Author URI: http://msyk.es/?utm_source=meta-tag-manager&utm_medium=plugin-header&utm_campaign=plugins
9
  Text Domain: meta-tag-manager
10
  */
11
  /*
@@ -26,13 +26,12 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
26
  */
27
  if( !defined('ABSPATH') ) exit;
28
 
29
- define('MTM_VERSION', '2.3');
 
30
 
31
  class Meta_Tag_Manager {
32
  /** loads the plugin */
33
  public static function init() {
34
- //include MTM_Tag class
35
- include('mtm-tag.php');
36
  // Include admin backend if needed
37
  if ( is_admin() ) {
38
  require_once ( 'meta-tag-manager-admin.php' );
@@ -43,39 +42,31 @@ class Meta_Tag_Manager {
43
 
44
  /** puts the meta tags in the head */
45
  public static function head() {
 
46
  //If options form has been submitted, create a $_POST value that will be saved on databse
47
  $meta_tags = array();
 
 
 
 
 
 
 
 
 
 
 
 
 
48
  //check global tags and filter out ones we'll show for this page
49
- foreach( self::get_data() as $tag ){
50
- if( !empty($tag->context) ){ //if empty, we assume it's meant to be output everywhere
51
- foreach( $tag->context as $context ){
52
- if( $context == 'home' && ( is_home() || is_front_page() ) ){
53
- $meta_tags[] = $tag;
54
- continue; //match found, quit the loop
55
- }else{
56
- //check post types and taxonomies
57
- if( preg_match('/^post-type_/', $context) ){
58
- $post_type = str_replace('post-type_', '', $context);
59
- if( is_single() && get_post_type() == $post_type ){
60
- $meta_tags[] = $tag;
61
- }
62
- continue; //match found, quit the loop
63
- }elseif( preg_match('/^taxonomy_/', $context) ){
64
- $taxonomy = str_replace('taxonomy_', '', $context);
65
- if( is_tax( $taxonomy ) || ($taxonomy == 'category' && is_category()) || ($taxonomy == 'post_tag' && is_tag()) ){
66
- $meta_tags[] = $tag;
67
- }
68
- continue; //match found, quit the loop
69
- }
70
- }
71
- }
72
- }else{
73
  $meta_tags[] = $tag;
74
  }
75
  }
76
  //check individual post in case we have specific post meta tags to show
77
  if( is_single() || is_page() ){
78
- $mtm_custom = get_option('mtm_custom');
79
  if( !empty($mtm_custom['post-types']) && in_array(get_post_type(), $mtm_custom['post-types']) ){
80
  $post_meta_tags = self::get_post_data();
81
  //remove unique meta tags from being output within MTM (not other plugins), where specific tags take precendence
@@ -102,6 +93,7 @@ class Meta_Tag_Manager {
102
  $meta_tags = array_merge($meta_tags, $post_meta_tags);
103
  }
104
  }
 
105
  //output the filtered out tags that pass validation
106
  if( !empty($meta_tags) ){
107
  //add as keys to prevent duplicates
@@ -114,11 +106,11 @@ class Meta_Tag_Manager {
114
  }
115
  //output tags if there are any
116
  if( !empty($meta_tag_strings) ){
117
- echo "\r\n\t".'<!-- Meta Tag Manager -->';
118
  foreach( $meta_tag_strings as $tag_string => $v ){
119
- echo "\r\n\t".$tag_string;
120
  }
121
- echo "\r\n\t".'<!-- / Meta Tag Manager -->';
122
  echo "\r\n";
123
  }
124
  }
@@ -132,7 +124,7 @@ class Meta_Tag_Manager {
132
  $meta_tags[] = new MTM_Tag($meta_tag_data);
133
  }
134
  }
135
- return $meta_tags;
136
  }
137
 
138
  public static function get_post_data( $post_id = false ){
@@ -146,6 +138,63 @@ class Meta_Tag_Manager {
146
  }
147
  return $meta_tags;
148
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
149
  }
150
  // Start this plugin once all other plugins are fully loaded
151
  add_action( 'plugins_loaded', array('Meta_Tag_Manager', 'init'), 100 );
2
  /*
3
  Plugin Name: Meta Tag Manager
4
  Plugin URI: https://wordpress.org/plugins/meta-tag-manager/
5
+ Description: A simple plugin to manage meta tags and other meta data that appear on aread of your site or individual posts. This can be used for verifiying google adding open graph tags, SEO meta and more.
6
  Author: Marcus Sykes
7
+ Version: 3.0
8
+ Author URI: https://metatagmanager/?utm_source=plugin-header&utm_medium=plugin&utm_campaign=plugin
9
  Text Domain: meta-tag-manager
10
  */
11
  /*
26
  */
27
  if( !defined('ABSPATH') ) exit;
28
 
29
+ define('MTM_VERSION', '3.0');
30
+ define('MTM_DIR', dirname( __FILE__ )); //an absolute path to this directory
31
 
32
  class Meta_Tag_Manager {
33
  /** loads the plugin */
34
  public static function init() {
 
 
35
  // Include admin backend if needed
36
  if ( is_admin() ) {
37
  require_once ( 'meta-tag-manager-admin.php' );
42
 
43
  /** puts the meta tags in the head */
44
  public static function head() {
45
+ static::load('meta-tags');
46
  //If options form has been submitted, create a $_POST value that will be saved on databse
47
  $meta_tags = array();
48
+ $mtm_custom = get_option('mtm_custom');
49
+ // load open graph
50
+ if( !empty($mtm_custom['og']['enabled']) ){
51
+ Meta_Tag_Manager::load('open-graph');
52
+ }
53
+ // load and output schema - front page only (for now)
54
+ if( !empty($mtm_custom['schema']['enabled']) && is_front_page() ){
55
+ Meta_Tag_Manager::load('schema');
56
+ }
57
+ // load and output schema - front page only (for now)
58
+ if( !empty($mtm_custom['verify']) && is_front_page() ){
59
+ Meta_Tag_Manager::load('verify-sites');
60
+ }
61
  //check global tags and filter out ones we'll show for this page
62
+ $meta_tags_data = apply_filters('mtm_head_meta_tags_pre', self::get_data());
63
+ foreach( $meta_tags_data as $tag ){
64
+ if( $tag->is_in_context() ){
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
65
  $meta_tags[] = $tag;
66
  }
67
  }
68
  //check individual post in case we have specific post meta tags to show
69
  if( is_single() || is_page() ){
 
70
  if( !empty($mtm_custom['post-types']) && in_array(get_post_type(), $mtm_custom['post-types']) ){
71
  $post_meta_tags = self::get_post_data();
72
  //remove unique meta tags from being output within MTM (not other plugins), where specific tags take precendence
93
  $meta_tags = array_merge($meta_tags, $post_meta_tags);
94
  }
95
  }
96
+ $meta_tags = apply_filters('mtm_head_meta_tags', $meta_tags);
97
  //output the filtered out tags that pass validation
98
  if( !empty($meta_tags) ){
99
  //add as keys to prevent duplicates
106
  }
107
  //output tags if there are any
108
  if( !empty($meta_tag_strings) ){
109
+ echo "\r\n\t\t".'<!-- Meta Tag Manager -->';
110
  foreach( $meta_tag_strings as $tag_string => $v ){
111
+ echo "\r\n\t\t".$tag_string;
112
  }
113
+ echo "\r\n\t\t".'<!-- / Meta Tag Manager -->';
114
  echo "\r\n";
115
  }
116
  }
124
  $meta_tags[] = new MTM_Tag($meta_tag_data);
125
  }
126
  }
127
+ return apply_filters('mtm_get_data', $meta_tags, $mtm_data);
128
  }
129
 
130
  public static function get_post_data( $post_id = false ){
138
  }
139
  return $meta_tags;
140
  }
141
+
142
+ // Page type conditionals
143
+
144
+ public static function is_cpt_page( $post_type = null ){
145
+ return apply_filters('mtm_is_cpt_page', is_singular($post_type), $post_type);
146
+ }
147
+
148
+ public static function is_taxonomy_page( $taxonomy = null ) {
149
+ if( empty($taxonomy) ){
150
+ $result = is_tax() || is_category() || is_tag();
151
+ }else{
152
+ $result = is_tax( $taxonomy ) || ($taxonomy == 'category' && is_category()) || ($taxonomy == 'post_tag' && is_tag());
153
+ }
154
+ return apply_filters('mtm_is_taxonomy_page', $result, $taxonomy);
155
+ }
156
+
157
+ public static function is_archive_page( $post_type = null ){
158
+ $is_archive = is_post_type_archive( $post_type ) || get_option( 'page_for_posts' ) == get_queried_object_id();
159
+ return apply_filters('mtm_is_archive_page', $is_archive, $post_type);
160
+ }
161
+
162
+ public static function is_archive(){
163
+ return apply_filters('mtm_is_archive', is_archive());
164
+ }
165
+
166
+ // util functions
167
+
168
+ public static function array_merge( array &$array1, array &$array2 ) {
169
+ $merged = $array1;
170
+ foreach ( $array2 as $key => &$value ) {
171
+ if( is_array($value) && isset($merged[$key]) && is_array($merged[$key]) ){
172
+ $merged[$key] = self::array_merge($merged[$key], $value);
173
+ } else {
174
+ $merged[$key] = $value;
175
+ }
176
+ }
177
+ return $merged;
178
+ }
179
+
180
+ public static function load( $module = 'all' ){
181
+ if( $module == 'meta-tags' || $module == 'all' ){
182
+ include_once('mtm-tag.php');
183
+ }
184
+ if( $module == 'schema' || $module == 'all'){
185
+ include_once('classes/schema.php');
186
+ }
187
+ if( $module == 'open-graph' || $module == 'all'){
188
+ include_once('classes/open-graph.php');
189
+ }
190
+ if( $module == 'verify-sites' || $module == 'all'){
191
+ include_once('classes/verify-sites.php');
192
+ }
193
+ if( $module == 'builder' || $module == 'all' ){
194
+ include_once('mtm-tag.php');
195
+ include_once('admin/mtm-builder.php');
196
+ }
197
+ }
198
  }
199
  // Start this plugin once all other plugins are fully loaded
200
  add_action( 'plugins_loaded', array('Meta_Tag_Manager', 'init'), 100 );
mtm-admin-settings.php DELETED
@@ -1,112 +0,0 @@
1
- <?php
2
- if( !defined('ABSPATH') ) exit;
3
-
4
- $count = 0;
5
- if (is_admin () and !empty($_REQUEST['mtm_nonce']) && wp_verify_nonce($_REQUEST['mtm_nonce'], 'mtm_options_submitted') ) {
6
- $mtm_data = MTM_Builder::get_post();
7
- update_option ( 'mtm_data', $mtm_data );
8
- //quickly sanitize the post type custom data and save
9
- $mtm_custom = array('post-types'=>array());
10
- if( !empty($_REQUEST['mtm-post-types']) ){
11
- $post_types = get_post_types(array('public'=>true), 'names');
12
- foreach( $_REQUEST['mtm-post-types'] as $post_type ){
13
- if( in_array($post_type, $post_types) ){
14
- $mtm_custom['post-types'][] = $post_type;
15
- }
16
- }
17
- }
18
- update_option('mtm_custom', $mtm_custom);
19
- echo '<div id="message" class="updated fade"><p><strong>' . __ ( 'Settings saved.' ) . '</strong></p></div>'; // No textdomain: phrase used in core, too
20
- } else {
21
- $mtm_custom = get_option('mtm_custom', array('post-type'=>array()));
22
- }
23
- ?>
24
- <script type="text/javascript" charset="utf-8"><?php include('js/meta-tag-manager-settings.js'); ?></script>
25
- <div class="wrap tabs-active">
26
- <h1><?php esc_html_e( 'Meta Tag Manager', 'meta-tag-manager' ); ?></h1>
27
- <h2 class="nav-tab-wrapper">
28
- <a href="#builder" id="mtm-menu-builder" class="nav-tab nav-tab-active"><?php esc_html_e('Custom Meta Tags','meta-tag-manager'); ?></a>
29
- <a href="#general" id="mtm-menu-general" class="nav-tab"><?php esc_html_e('General Options','meta-tag-manager'); ?></a>
30
- </h2>
31
- <div id="poststuff">
32
- <div id="post-body" class="metabox-holder columns-2 mtm-settings">
33
- <div id="postbox-container-2" class="postbox-container">
34
- <form action="" method="post">
35
- <?php wp_nonce_field('mtm_options_submitted', 'mtm_nonce'); ?>
36
- <div class="mtm-menu-general mtm-menu-group" style="display:none;">
37
- <div id="mtm-post-types" class="postbox mtm-post-types">
38
- <h2 class="hndle"><?php esc_html_e('Post Type Support', 'meta-tag-manager'); ?></h2>
39
- <div class="inside">
40
- <p><?php esc_html_e('Enable the meta tag builder on the edit pages of your selected post types below. This will allow you to create specific post types for specific posts on your site. Leave blank for all post types.', 'meta-tag-manager'); ?></p>
41
- <?php
42
- //Post Types
43
- $post_type_options = array();
44
- foreach( get_post_types(array('public'=>true), 'objects') as $post_type){
45
- $post_type_options[$post_type->labels->name] = $post_type->name;
46
- }
47
- ?>
48
- <select name="mtm-post-types[]" class="mtm-post-types-select" multiple>
49
- <option value=""><?php esc_html_e('choose one or more post types', 'meta-tag-manager'); ?></option>
50
- <?php
51
- echo MTM_Builder::output_select_options($post_type_options, $mtm_custom['post-types']);
52
- ?>
53
- </select>
54
- </div>
55
- </div>
56
- </div>
57
- <div class="mtm-menu-builder mtm-menu-group">
58
- <p><?php esc_html_e('Use the meta tag builder to create meta tags which will be used on your site. You can choose what kind of meta tag to display, as well as where to display them such as on all your pages, just the home page or specific post types and taxonomies.', 'meta-tag-manager'); ?></p>
59
- <p><?php esc_html_e('You can also enter a reference name at the top of each field card (something to help you remember the meta tag) and then enter the values below it that you want the meta tag to hold.', 'meta-tag-manager'); ?></p>
60
- <p><?php echo sprintf(esc_html__('Certain tag values for the "name" type such as %s cannot be repeated, and the last duplicate tag will take precendence unless there is a tag defined for the specific post type being viewed.', 'meta-tag-manager'), '<code>keywords, description</code>'); ?></p>
61
- <p><?php esc_html_e('For adding meta tags to specific post types, please click on the \'General Options\' tab above.', 'meta-tag-manager'); ?></p>
62
- <?php MTM_Builder::output(Meta_Tag_Manager::get_data(), array('context'=>true, 'reference'=>true)); ?>
63
- </div>
64
- <div class="mtm-actions">
65
- <button type="submit" class="button-primary"><?php esc_html_e('Save Changes','meta-tag-manager'); ?></button>
66
- </div>
67
- </form>
68
- </div>
69
- <div id="postbox-container-1" class="postbox-container">
70
- <div id="mtm-plugin-info" class="postbox ">
71
- <button type="button" class="handlediv button-link"
72
- aria-expanded="true">
73
- <span class="screen-reader-text"><?php echo sprintf(esc_html__('Toggle panel: %s'), esc_html__('About This Plugin','meta-tag-manager')); ?></span>
74
- <span class="toggle-indicator" aria-hidden="true"></span>
75
- </button>
76
- <h2 class="hndle ui-sortable-handle">
77
- <span><?php esc_html_e('About This Plugin','meta-tag-manager'); ?></span>
78
- </h2>
79
- <div class="inside">
80
- <p>
81
- <?php echo sprintf(esc_html__('This plugin was developed by %s.', 'meta-tag-manager'), '<a href="http://msyk.es/?utm_source=meta-tag-manager&utm_medium=settings&utm_campaign=plugins" target="_blank">Marcus Sykes</a>'); ?>
82
- </p>
83
- <p style="color:green; font-weight:bold;">
84
- <?php
85
- echo sprintf(esc_html__('Please leave us a %s review on %s to show your support and help us keep making this plugin better!','meta-tag-manager'),
86
- '<a href="http://wordpress.org/support/view/plugin-reviews/meta-tag-manager?filter=5" target="_blank">★★★★★</a>',
87
- '<a href="https://wordpress.org/plugins/meta-tag-manager/" target="_blank">WordPress.org</a>'
88
- );
89
- ?>
90
- </p>
91
- </div>
92
- </div>
93
- <div id="mtm-plugin-support" class="postbox ">
94
- <button type="button" class="handlediv button-link"
95
- aria-expanded="true">
96
- <span class="screen-reader-text"><?php echo sprintf(esc_html__('Toggle panel: %s'), esc_html__('Need Help?','meta-tag-manager')); ?></span>
97
- <span class="toggle-indicator" aria-hidden="true"></span>
98
- </button>
99
- <h2 class="hndle ui-sortable-handle">
100
- <span><?php esc_html_e('Need Help?','meta-tag-manager'); ?></span>
101
- </h2>
102
- <div class="inside">
103
- <p>
104
- <?php echo sprintf(esc_html__('Please visit our %s if you have any questions.', 'meta-tag-manager'),
105
- '<a href="http://wordpress.org/support/plugin/meta-tag-manager/" target="_blank">'.esc_html__('Support Forum','meta-tag-manager').'</a>'); ?>
106
- </p>
107
- </div>
108
- </div>
109
- </div>
110
- </div><!-- #post-body -->
111
- </div><!-- #poststuff -->
112
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
mtm-tag.php CHANGED
@@ -17,6 +17,7 @@ class MTM_Tag {
17
  if( !empty($values['context']) ){
18
  $this->context = explode(',', $values['context']);
19
  }
 
20
  }
21
 
22
  public function output(){
@@ -49,19 +50,19 @@ class MTM_Tag {
49
  if( $this->context !== false && is_array($this->context) ){
50
  $array['context'] = implode(',', $this->context);
51
  }
52
- return $array;
53
  }
54
 
55
  public function is_valid(){
56
- if( in_array($this->type, $this->get_types()) ){ //pass
57
- if( !empty($this->value) ){ //pass
58
- if( $this->has_content() && empty($this->content) ){ //fail
59
- return false; //empty content, no point in outputting
 
60
  }
61
- return true; //if we get here, we're good
62
  }
63
  }
64
- return false;
65
  }
66
 
67
  public function get_content(){
@@ -69,16 +70,52 @@ class MTM_Tag {
69
  }
70
 
71
  public static function get_types(){
72
- if( empty(self::$types) ){
73
- self::$types = apply_filters('mtm_tag_get_types', array('name','http-equiv','charset','itemprop','property'));
74
  }
75
- return self::$types;
76
  }
77
 
78
  public function has_content(){
79
- if( empty(self::$types_with_content) ){
80
- self::$types_with_content = apply_filters('mtm_types_with_content', array('name','http-equiv','itemprop','property'));
81
  }
82
- return in_array($this->type, self::$types_with_content);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
83
  }
84
  }
17
  if( !empty($values['context']) ){
18
  $this->context = explode(',', $values['context']);
19
  }
20
+ do_action('mtm_tag', $values, $this);
21
  }
22
 
23
  public function output(){
50
  if( $this->context !== false && is_array($this->context) ){
51
  $array['context'] = implode(',', $this->context);
52
  }
53
+ return apply_filters('mtm_tag_to_array', $array, $this);
54
  }
55
 
56
  public function is_valid(){
57
+ $return = false;
58
+ if( in_array($this->type, static::get_types()) ){ //pass
59
+ if( !empty($this->value) ){ // pass ... so far
60
+ if( !($this->has_content() && empty($this->content)) ){ // if this doesn't pass, it fails
61
+ $return = true; //if we get here, we're good
62
  }
 
63
  }
64
  }
65
+ return apply_filters('mtm_tag_is_valid', $return, $this);
66
  }
67
 
68
  public function get_content(){
70
  }
71
 
72
  public static function get_types(){
73
+ if( empty(static::$types) ){
74
+ static::$types = apply_filters('mtm_tag_get_types', array('name','http-equiv','charset','itemprop','property'));
75
  }
76
+ return static::$types;
77
  }
78
 
79
  public function has_content(){
80
+ if( empty(static::$types_with_content) ){
81
+ static::$types_with_content = apply_filters('mtm_types_with_content', array('name','http-equiv','itemprop','property'));
82
  }
83
+ return in_array($this->type, static::$types_with_content);
84
+ }
85
+
86
+ public function is_in_context(){
87
+ $return = true;
88
+ if( !empty($this->context) ){ //if empty, we assume it's meant to be output everywhere
89
+ $return = static::check_context( $this->context );
90
+ }
91
+ return apply_filters('mtm_tag_is_in_context', $return, $this);
92
+ }
93
+
94
+ /**
95
+ * Checks if the currently displayed page meets the array of supplied contexts
96
+ * @param array $contexts
97
+ * @return bool
98
+ */
99
+ public static function check_context( $contexts ){
100
+ $return = empty($contexts);
101
+ foreach( $contexts as $context ){
102
+ if( $context == 'home' && is_front_page() ){
103
+ $return = true;
104
+ }else{
105
+ //check post types and taxonomies
106
+ if( preg_match('/^post-type_/', $context) ){
107
+ $post_type = str_replace('post-type_', '', $context);
108
+ if( Meta_Tag_Manager::is_cpt_page($post_type) ){
109
+ $return = true;
110
+ }
111
+ }elseif( preg_match('/^taxonomy_/', $context) ){
112
+ $taxonomy = str_replace('taxonomy_', '', $context);
113
+ if( Meta_Tag_Manager::is_taxonomy_page( $taxonomy ) ){
114
+ $return = true;
115
+ }
116
+ }
117
+ }
118
+ }
119
+ return apply_filters('mtm_tag_check_context', $return, $contexts);
120
  }
121
  }
mtm-update.php DELETED
@@ -1,26 +0,0 @@
1
- <?php
2
- if( defined('MTM_VERSION') ){
3
- //coming in from MTM 1.x we change the values to something else
4
- if( !get_option('mtm_version') ){
5
- $mtm_data = get_option('mtm_data', array());
6
- $new_mtm_data = array();
7
- foreach($mtm_data as $mtm_tag){
8
- $new_tag = array(
9
- 'value' => $mtm_tag[0],
10
- 'content' => $mtm_tag[1],
11
- 'reference' => $mtm_tag[2],
12
- 'type' => 'name'
13
- );
14
- if( !empty($mtm_tag[3]) ){
15
- $new_tag['location'] = 'home';
16
- }else{
17
- $new_tag['location'] = 'all';
18
- }
19
- $new_mtm_data[] = $new_tag;
20
- }
21
- update_option('mtm_data', $new_mtm_data);
22
- update_option('mtm_custom', array('post-types'=>get_post_types()));
23
- update_option('mtm_shiny_update_notice', 1);
24
- }
25
- update_option('mtm_version', MTM_VERSION);
26
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
readme.txt CHANGED
@@ -1,30 +1,44 @@
1
  === Meta Tag Manager ===
2
  Contributors: netweblogic
3
- Tags: google, SEO, yahoo, tags, webmaster tools, meta, meta tags, meta-tags, og, ogp, open graph, twitter cards
4
  Text Domain: meta-tag-manager
5
  Requires at least: 3.6
6
  Tested up to: 5.8.1
7
- Stable tag: 2.3
8
 
9
  Easily add and manage custom meta tags to various parts of your site or on individual posts, such as Yahoo and Google verification tags.
10
 
11
  == Description ==
12
 
13
- <blockquote>Meta Tag Manager 2.0 is a complete rewrite with many improvments on the first versions. Whilst there are many improvements, this first rewrite isn't a great departure from the original plugin, although it adds some fundemental improvements.
14
 
15
  We have plenty of ideas of what to add to the plugin, we'd love to hear your suggestions too, please let us know on our <a href="https://wordpress.org/support/plugin/meta-tag-manager">support forums</a>.</blockquote>
16
 
17
  Meta Tags Manager is a simple, lightweight plugin which allows you to add custom meta tags to your site. Features include:
18
 
19
  * Supports meta tags including the name, property, http-equiv, charset and itemprop attributes.
 
20
  * Add meta tags to specific posts, choose what Custom Post Types to support from our settings page.
21
  * Add global meta tags that will display on specific CPTs, Taxonomies, your front page or your whole site.
 
 
 
 
22
 
23
  Use cases include:
24
 
25
  * Adding Google and Yahoo site verification tags
26
  * Adding additional open graph, twitter card or other social media meta info not supported by other SEO/Meta plugins
27
 
 
 
 
 
 
 
 
 
 
28
  == Installation ==
29
 
30
  1. Upload the entire `meta-tag-manager` directory to the `/wp-content/plugins/` directory
@@ -69,6 +83,27 @@ Please visit our <a href="https://wordpress.org/support/plugin/meta-tag-manager"
69
  3. If enabled you can add meta tags to a specific post in it's own meta box
70
 
71
  == Changelog ==
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
72
  = 2.3 =
73
  * added multiple filters and actions for easier extension
74
  * added use of overridable MTM_Tag::get_content() during the output() method
1
  === Meta Tag Manager ===
2
  Contributors: netweblogic
3
+ Tags: google, SEO, yahoo, tags, webmaster tools, meta, meta tags, meta-tags, og, ogp, open graph, twitter cards, schema, rich-snippets, structured-data
4
  Text Domain: meta-tag-manager
5
  Requires at least: 3.6
6
  Tested up to: 5.8.1
7
+ Stable tag: 3.0
8
 
9
  Easily add and manage custom meta tags to various parts of your site or on individual posts, such as Yahoo and Google verification tags.
10
 
11
  == Description ==
12
 
13
+ <blockquote>Meta Tag Manager 3.0 builds on the great success of 2.0 and also marks the launch of our <a href="https://metatagmanager/gopro/?utm_source=plugin-readme&utm_medium=plugin&utm_campaign=plugin">new Pro Add-on</a>. Since 2009 we've provided a freely available, regularly maintained plugin with support and we hope to continue doing so for many years to come!
14
 
15
  We have plenty of ideas of what to add to the plugin, we'd love to hear your suggestions too, please let us know on our <a href="https://wordpress.org/support/plugin/meta-tag-manager">support forums</a>.</blockquote>
16
 
17
  Meta Tags Manager is a simple, lightweight plugin which allows you to add custom meta tags to your site. Features include:
18
 
19
  * Supports meta tags including the name, property, http-equiv, charset and itemprop attributes.
20
+ * Choose from predefined types, such as 'name="keyword"' or create your own by typing it in.
21
  * Add meta tags to specific posts, choose what Custom Post Types to support from our settings page.
22
  * Add global meta tags that will display on specific CPTs, Taxonomies, your front page or your whole site.
23
+ * Automatically add Open Graph details to your home page.
24
+ * Automatically add Schema and Structured Data to your home page.
25
+ * Add Google Sitelinks and Sitelinks Search markup.
26
+ * Easily add verification codes for services like Facebook, Google Webmaster Tools, Bing Webmaster Tools, Yandex and more (or... create your own custom meta tags!).
27
 
28
  Use cases include:
29
 
30
  * Adding Google and Yahoo site verification tags
31
  * Adding additional open graph, twitter card or other social media meta info not supported by other SEO/Meta plugins
32
 
33
+ <a href="https://metatagmanager/gopro/?utm_source=plugin-readme&utm_medium=plugin&utm_campaign=plugin">Go Pro</a> for many newly added features, including:
34
+
35
+ * Dynamic placeholders to include data about the page being displayed, such as page title, comment count, thumbnail URLs and more!
36
+ * Additional contexts to add global meta tags, as well as exclusion rules for finer-grained controls.
37
+ * Shortcode support within meta descriptions, allowing for more dynamic data insertion with plugins such as ACF
38
+ * Unique tag detaction of Meta Tag Manager tags with hierarchical precedence, avoid creating duplicate meta tags.
39
+ * Taxonomy support - create meta tags for individual taxonomy term pages such as a single tag or category.
40
+ * More to come! Go Pro now and get an early-bird discount of up to 50%!
41
+
42
  == Installation ==
43
 
44
  1. Upload the entire `meta-tag-manager` directory to the `/wp-content/plugins/` directory
83
  3. If enabled you can add meta tags to a specific post in it's own meta box
84
 
85
  == Changelog ==
86
+ = 3.0 =
87
+ * added open graph settings and support for home page
88
+ * added twitter card open graph settings and support for home page
89
+ * added schema / structured data / rich snippets front-page support
90
+ * added easy site verification settings
91
+ * added SCRIPT_DEBUG and MTM_DEBUG constant checks to decide whether to load non-minified files
92
+ * moved context checking for a tag into MTM_Tag functions,
93
+ * added Meta_Tag_Manager::is_archive()
94
+ * fixed Meta_Tag_Manager::is_archive_page() to account for static posts page
95
+ * added multiple actions and filters to MTM_Builder output
96
+ * added multiple actions and filters to MTM_Tag object
97
+ * fixed Array PHP caused by potentially non-existent contexts in a meta tag admin panel
98
+ * added extra sanitization/validation of submitted context list in a tag
99
+ * added MTM_Builder::get_contexts_list() to remove redundant code when excluding
100
+ * tweaked JS and display issues for showing context lists in header of admin meta tag card
101
+ * fixed css aesthetic issue when clicking a selectize active item turing grey
102
+ * tweaked context selectize js to be more flexible and reusable for other context fields
103
+ * moved admin-related files into admin folder
104
+ * moved settings tab sections into dedicated files
105
+ * moved handling of setting saving to Meta_Tag_Manager_Admin with a redirect instead of saving on same page load
106
+
107
  = 2.3 =
108
  * added multiple filters and actions for easier extension
109
  * added use of overridable MTM_Tag::get_content() during the output() method