Version Description
- code styling: code now wrapped in classes
- bug fixed: magic quotes
- bug fixed: character escaping using wp_specialchars on the site and htmlspecialchars on the admin page
- separated the code into two .php files
- meta-tag-manager.php the main plugin file, always loaded, contains minimal code to reduce loading time
- meta-tag-manager-admin.php contains the admin backend parts of the plugin and is only loaded in the backend
- i18n
- l10n for: de_DE (language file by Martin Lormes)
- meta tags can be flagged to appear on the homepage only
- fixed bug which threw a Notice error when no meta tags were defined
- fixed the bug where the rss feeds kept breaking
Download this release
Release Info
Developer | netweblogic |
Plugin | Meta Tag Manager |
Version | 1.0 |
Comparing to | |
See all releases |
Code changes from version 0.5 to 1.0
- meta-tag-manager-admin.php +148 -0
- meta-tag-manager-de_DE.mo +0 -0
- meta-tag-manager-de_DE.po +63 -0
- meta-tag-manager.php +54 -120
- meta-tag-manager.pot +67 -0
- mtm_script.js +68 -61
- readme.txt +29 -26
meta-tag-manager-admin.php
ADDED
@@ -0,0 +1,148 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/*
|
3 |
+
Copyright (C) 2009 NetWebLogic LLC
|
4 |
+
Copyright (C) 2009 Martin Lormes
|
5 |
+
|
6 |
+
This program is free software; you can redistribute it and/or modify
|
7 |
+
it under the terms of the GNU General Public License as published by
|
8 |
+
the Free Software Foundation; either version 3 of the License, or
|
9 |
+
(at your option) any later version.
|
10 |
+
|
11 |
+
This program is distributed in the hope that it will be useful,
|
12 |
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
13 |
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
14 |
+
GNU General Public License for more details.
|
15 |
+
|
16 |
+
You should have received a copy of the GNU General Public License
|
17 |
+
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
18 |
+
*/
|
19 |
+
|
20 |
+
class MetaTagManagerAdmin {
|
21 |
+
|
22 |
+
/** loads the plugin */
|
23 |
+
function init() {
|
24 |
+
// i18n
|
25 |
+
load_plugin_textdomain ( 'meta-tag-manager', '', basename ( dirname ( __FILE__ ) ) );
|
26 |
+
// add plugin page to admin menu
|
27 |
+
add_action ( 'admin_menu', array ( __CLASS__, 'menus' ) );
|
28 |
+
}
|
29 |
+
|
30 |
+
/** adds plugin page to admin menu; put it under 'Settings' */
|
31 |
+
function menus() {
|
32 |
+
$page = add_options_page ( __ ( 'Meta Tag Manager', 'meta-tag-manager' ), __ ( 'Meta Tag Manager', 'meta-tag-manager' ), 8, 'mtmverification', array ( __CLASS__, 'options' ) );
|
33 |
+
// add javascript
|
34 |
+
add_action ( "admin_print_scripts-$page", array ( __CLASS__, 'scripts' ) );
|
35 |
+
}
|
36 |
+
|
37 |
+
/** loads javascript on plugin admin page */
|
38 |
+
function scripts() {
|
39 |
+
wp_enqueue_script ( 'meta-tag-manager', path_join ( WP_PLUGIN_URL, basename ( dirname ( __FILE__ ) ) . '/mtm_script.js' ), array ('jquery' ) );
|
40 |
+
}
|
41 |
+
|
42 |
+
/** the plugin page and all the admin code � old php style spaghetti code */
|
43 |
+
function options() {
|
44 |
+
add_option ( 'mtm_data' );
|
45 |
+
$mtm_data = array ();
|
46 |
+
if (is_admin () and 1 == $_POST ['mtm_submitted']) {
|
47 |
+
check_admin_referer ( 'mtmverification' );
|
48 |
+
for($i = 1; isset ( $_POST ["mtm_{$i}_ref"] ); $i ++) {
|
49 |
+
$name = trim ( $_POST ["mtm_{$i}_name"] );
|
50 |
+
$content = trim ( $_POST ["mtm_{$i}_content"] );
|
51 |
+
$ref = trim ( $_POST ["mtm_{$i}_ref"] );
|
52 |
+
|
53 |
+
if (get_magic_quotes_gpc ()) {
|
54 |
+
$name = stripslashes ( $name );
|
55 |
+
$content = stripslashes ( $content );
|
56 |
+
$ref = stripslashes ( $ref );
|
57 |
+
}
|
58 |
+
|
59 |
+
if ('' != $name and '' != $content) {
|
60 |
+
$meta = array ($name, $content, $ref );
|
61 |
+
if (isset ( $_POST ["mtm_{$i}_homepageonly"] ))
|
62 |
+
$meta [3] = 1;
|
63 |
+
$mtm_data [] = $meta;
|
64 |
+
}
|
65 |
+
}
|
66 |
+
update_option ( 'mtm_data', $mtm_data );
|
67 |
+
echo '<div id="message" class="updated fade"><p><strong>' . __ ( 'Settings saved.' ) . '</strong></p></div>'; // No textdomain: phrase used in core, too
|
68 |
+
} else {
|
69 |
+
$mtm_data = get_option ( 'mtm_data' );
|
70 |
+
}
|
71 |
+
?>
|
72 |
+
<div class="wrap nwl-plugin">
|
73 |
+
<h2><?php _e ( 'Meta Tag Manager', 'meta-tag-manager' ); ?></h2>
|
74 |
+
<div id="poststuff" class="metabox-holder has-right-sidebar">
|
75 |
+
<div id="side-info-column" class="inner-sidebar">
|
76 |
+
<div id="categorydiv" class="postbox ">
|
77 |
+
<div class="handlediv" title="Click to toggle"></div>
|
78 |
+
<h3 class="hndle">Plugin Information</h3>
|
79 |
+
<div class="inside">
|
80 |
+
<p>This plugin was developed by <a href="http://twitter.com/marcussykes">Marcus Sykes</a> @ <a href="http://netweblogic.com">NetWebLogic</a></p>
|
81 |
+
<p>Please visit <a href="http://netweblogic.com/forums/">our forum</a> for plugin support.</p>
|
82 |
+
</div>
|
83 |
+
</div>
|
84 |
+
<div id="categorydiv" class="postbox ">
|
85 |
+
<div class="handlediv" title="Click to toggle"></div>
|
86 |
+
<h3 class="hndle">Special Thanks</h3>
|
87 |
+
<div class="inside">
|
88 |
+
<p><a href="http://ten-fingers-and-a-brain.com">Martin Lormes</a> for his contribution.</p>
|
89 |
+
</div>
|
90 |
+
</div>
|
91 |
+
</div>
|
92 |
+
<div id="post-body">
|
93 |
+
<div id="post-body-content">
|
94 |
+
<p><?php _e ( 'Enter a reference name (something to help you remember the meta tag) and then enter the values that you want the meta tag to hold.', 'meta-tag-manager' ); ?></p>
|
95 |
+
<form method="post" action="">
|
96 |
+
<?php wp_nonce_field ( 'mtmverification' ); ?>
|
97 |
+
<table class="form-table">
|
98 |
+
<thead>
|
99 |
+
<tr valign="top">
|
100 |
+
<td><strong><?php _e ( 'Reference Name', 'meta-tag-manager' ); ?></strong></td>
|
101 |
+
<td><strong><?php _e ( 'Meta Tag', 'meta-tag-manager' ); ?></strong></td>
|
102 |
+
<td><strong><?php _e ( 'Homepage only', 'meta-tag-manager' ); ?></strong></td>
|
103 |
+
</tr>
|
104 |
+
</thead>
|
105 |
+
<tbody id="mtm_body">
|
106 |
+
<?php if ( is_array ( $mtm_data ) AND count ( $mtm_data ) > 0 ) : ?>
|
107 |
+
<?php foreach ( $mtm_data as $name => $meta ) : $count++; ?>
|
108 |
+
<tr valign="top" id="mtm_<?php echo $count; ?>">
|
109 |
+
<td scope="row">
|
110 |
+
<input type="text" name="mtm_<?php echo $count; ?>_ref" value="<?php echo ( isset ( $meta[2] ) ) ? htmlspecialchars ( $meta[2] ) : $name; // $name is for backward compatibility of mtm_data ?>" />
|
111 |
+
<a href="#" rel="<?php echo $count; ?>"><?php _e ( 'Remove', 'meta-tag-manager' ); ?></a></td>
|
112 |
+
<td><meta name="<input type="text" name="mtm_<?php echo $count; ?>_name" value="<?php echo htmlspecialchars ( $meta[0] ); ?>" />" content="<input type="text" name="mtm_<?php echo $count; ?>_content" value="<?php echo htmlspecialchars ( $meta[1] ); ?>" class="regular-text" />" /></td>
|
113 |
+
<td><input type="checkbox" name="mtm_<?php echo $count; ?>_homepageonly" value="1"<?php echo ( isset ( $meta[3] ) ) ? ' checked="checked"' : ''; ?> /></td>
|
114 |
+
</tr>
|
115 |
+
<?php endforeach; ?>
|
116 |
+
<?php else : ?>
|
117 |
+
<tr valign="top" id="mtm_1">
|
118 |
+
<td scope="row">
|
119 |
+
<input type="text" name="mtm_1_ref" value="" />
|
120 |
+
<a href="#" rel="1"><?php _e ( 'Remove', 'meta-tag-manager' ); ?></a></td>
|
121 |
+
<td><meta name="<input type="text" name="mtm_1_name" value="" />" content="<input type="text" name="mtm_1_content" value="" class="regular-text" />" /></td>
|
122 |
+
<td><input type="checkbox" name="mtm_1_homepageonly" value="1" /></td>
|
123 |
+
</tr>
|
124 |
+
<?php endif; ?>
|
125 |
+
</tbody>
|
126 |
+
<tfoot>
|
127 |
+
<tr valign="top">
|
128 |
+
<td colspan="2"><a href="#" id="mtm_add_tag"><?php _e ( 'Add new tag', 'meta-tag-manager' ); ?></a></td>
|
129 |
+
</tr>
|
130 |
+
</tfoot>
|
131 |
+
</table>
|
132 |
+
<input type="hidden" name="mtm_submitted" value="1" />
|
133 |
+
<p class="submit">
|
134 |
+
<input type="submit" class="button-primary" value="<?php _e('Save Changes'); // No textdomain: phrase used in core, too ?>" />
|
135 |
+
</p>
|
136 |
+
</form>
|
137 |
+
</div>
|
138 |
+
</div>
|
139 |
+
</div>
|
140 |
+
</div>
|
141 |
+
</div>
|
142 |
+
<?php
|
143 |
+
}
|
144 |
+
|
145 |
+
}
|
146 |
+
|
147 |
+
// Start this plugin once all other plugins are fully loaded
|
148 |
+
add_action( 'init', array('MetaTagManagerAdmin', 'init') );
|
meta-tag-manager-de_DE.mo
ADDED
Binary file
|
meta-tag-manager-de_DE.po
ADDED
@@ -0,0 +1,63 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
msgid ""
|
2 |
+
msgstr ""
|
3 |
+
"Project-Id-Version: \n"
|
4 |
+
"Report-Msgid-Bugs-To: http://wordpress.org/tag/meta-tag-manager\n"
|
5 |
+
"POT-Creation-Date: 2009-09-21 15:06+0000\n"
|
6 |
+
"PO-Revision-Date: \n"
|
7 |
+
"Last-Translator: Martin Lormes <martinhh@gmail.com>\n"
|
8 |
+
"Language-Team: Martin Lormes <martinhh@gmail.com>\n"
|
9 |
+
"MIME-Version: 1.0\n"
|
10 |
+
"Content-Type: text/plain; charset=UTF-8\n"
|
11 |
+
"Content-Transfer-Encoding: 8bit\n"
|
12 |
+
"X-Poedit-Language: German\n"
|
13 |
+
"X-Poedit-Country: GERMANY\n"
|
14 |
+
"X-Poedit-SourceCharset: utf-8\n"
|
15 |
+
|
16 |
+
#. #-#-#-#-# plugin.pot (meta-tag-manager 0.5.1) #-#-#-#-#
|
17 |
+
#. Plugin Name of an extension
|
18 |
+
#: meta-tag-manager-admin.php:11
|
19 |
+
#: meta-tag-manager-admin.php:49
|
20 |
+
msgid "Meta Tag Manager"
|
21 |
+
msgstr "Meta-Tag Manager"
|
22 |
+
|
23 |
+
#: meta-tag-manager-admin.php:50
|
24 |
+
msgid "Enter a reference name (something to help you remember the meta tag) and then enter the values that you want the meta tag to hold."
|
25 |
+
msgstr "Geben Sie eine Beschreibung ein (damit Sie sich an den Verwendungszweck des Meta-Tags erinnern) und dann den Namen und den Inhalt des Meta-Tags."
|
26 |
+
|
27 |
+
#: meta-tag-manager-admin.php:56
|
28 |
+
msgid "Reference Name"
|
29 |
+
msgstr "Beschreibung"
|
30 |
+
|
31 |
+
#: meta-tag-manager-admin.php:57
|
32 |
+
msgid "Meta Tag"
|
33 |
+
msgstr "Meta-Tag"
|
34 |
+
|
35 |
+
#: meta-tag-manager-admin.php:58
|
36 |
+
msgid "Homepage only"
|
37 |
+
msgstr "Nur auf der Homepage"
|
38 |
+
|
39 |
+
#: meta-tag-manager-admin.php:67
|
40 |
+
#: meta-tag-manager-admin.php:76
|
41 |
+
msgid "Remove"
|
42 |
+
msgstr "Löschen"
|
43 |
+
|
44 |
+
#: meta-tag-manager-admin.php:84
|
45 |
+
msgid "Add new tag"
|
46 |
+
msgstr "Neues Tag hinzufügen"
|
47 |
+
|
48 |
+
#. Plugin URI of an extension
|
49 |
+
msgid "http://netweblogic.com/wordpress/plugins/meta-tag-manager/"
|
50 |
+
msgstr ""
|
51 |
+
|
52 |
+
#. Description of an extension
|
53 |
+
msgid "A simple plugin to manage meta tags that appear on all your pages. This can be used for verifiying google, yahoo, and more. — <a href=\"options-general.php?page=mtmverification\">Settings page</a> — edited by <a href=\"http://ten-fingers-and-a-brain.com/\">Martin Lormes</a>"
|
54 |
+
msgstr "Ein einfaches Plugin um Meta-Tags zu verwalten, die auf allen Seiten eingebunden werden. Dieses Plugin kann verwendet werden, um die Verwendung von Google Webmaster Tools, Yahoo, u.v.m. zu bestätigen. — <a href=\"options-general.php?page=mtmverification\">Einstellungen</a> — Mit Änderungen von <a href=\"http://ten-fingers-and-a-brain.com/\">Martin Lormes</a>"
|
55 |
+
|
56 |
+
#. Author of an extension
|
57 |
+
msgid "NetWebLogic LLC"
|
58 |
+
msgstr ""
|
59 |
+
|
60 |
+
#. Author URI of an extension
|
61 |
+
msgid "http://netweblogic.com/"
|
62 |
+
msgstr ""
|
63 |
+
|
meta-tag-manager.php
CHANGED
@@ -1,129 +1,63 @@
|
|
1 |
<?php
|
2 |
-
/*
|
3 |
-
Plugin Name: Meta Tag Manager
|
4 |
-
Plugin URI: http://
|
5 |
-
Description: A simple plugin to manage meta tags that appear on all your pages. This can be used for verifiying google, yahoo, and more.
|
6 |
-
Author: NetWebLogic LLC
|
7 |
-
Version: 0
|
8 |
-
Author URI: http://
|
|
|
9 |
*/
|
10 |
-
/*
|
11 |
-
Copyright (C)
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
function
|
31 |
-
|
32 |
-
add_action("admin_print_scripts-$page", 'mtm_list_scripts');
|
33 |
-
}
|
34 |
-
|
35 |
-
function mtm_list_scripts( ) {
|
36 |
-
wp_enqueue_script( "meta-tag-manager", path_join(WP_PLUGIN_URL, basename( dirname( __FILE__ ) )."/mtm_script.js"), array( 'jquery' ) );
|
37 |
-
}
|
38 |
-
|
39 |
-
function mtm_options() {
|
40 |
-
add_option('mtm_data');
|
41 |
-
$mtm_data = array();
|
42 |
-
|
43 |
-
if( is_admin() and $_POST['mtm_submitted']==1 ){
|
44 |
-
for($i=1 ; trim($_POST["mtm_{$i}_ref"])!='' ; $i++ ){
|
45 |
-
if(trim($_POST["mtm_{$i}_name"]) != '' and trim($_POST["mtm_{$i}_content"]) != ''){
|
46 |
-
$mtm_data[$_POST["mtm_{$i}_ref"]] = array($_POST["mtm_{$i}_name"], $_POST["mtm_{$i}_content"]);
|
47 |
-
}
|
48 |
-
}
|
49 |
-
update_option('mtm_data', $mtm_data);
|
50 |
-
?>
|
51 |
-
<div class="updated"><p><strong><?php _e('Options saved.', 'mt_trans_domain' ); ?></strong></p></div>
|
52 |
-
<?php
|
53 |
-
}else{
|
54 |
-
$mtm_data = get_option('mtm_data');
|
55 |
}
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
<thead>
|
63 |
-
<tr valign="top">
|
64 |
-
<td><strong>Reference Name</strong></td>
|
65 |
-
<td><strong>Meta Tag</strong></td>
|
66 |
-
</tr>
|
67 |
-
</thead>
|
68 |
-
<tbody id="mtm_body">
|
69 |
-
<?php
|
70 |
-
$count = 1;
|
71 |
-
if( is_array($mtm_data) and count($mtm_data) > 0){
|
72 |
-
foreach( $mtm_data as $name => $meta){
|
73 |
-
?>
|
74 |
-
<tr valign="top" id="mtm_<?= $count ?>">
|
75 |
-
<td scope="row"><input type="text" name="mtm_<?= $count ?>_ref" value="<?= $name ?>" /> <a href="#" rel="<?= $count ?>">Remove</a></td>
|
76 |
-
<td><meta name="<input type="text" name="mtm_<?= $count ?>_name" value="<?= $meta[0] ?>" />" content="<input type="text" name="mtm_<?= $count ?>_content" value="<?= $meta[1] ?>" />" /></td>
|
77 |
-
</tr>
|
78 |
-
<?php
|
79 |
-
$count++;
|
80 |
-
}
|
81 |
-
}else{
|
82 |
-
?>
|
83 |
-
<tr valign="top" id="mtm_<?= $count ?>">
|
84 |
-
<td scope="row"><input type="text" name="mtm_<?= $count ?>_ref" value="<?= $name ?>" /> <a href="#" rel="<?= $count ?>">Remove</a></td>
|
85 |
-
<td><meta name="<input type="text" name="mtm_<?= $count ?>_name" value="<?= $meta[0] ?>" />" content="<input type="text" name="mtm_<?= $count ?>_content" value="<?= $meta[1] ?>" />" /></td>
|
86 |
-
</tr>
|
87 |
-
<?php
|
88 |
-
}
|
89 |
-
?>
|
90 |
-
</tbody>
|
91 |
-
<tfoot>
|
92 |
-
<tr valign="top">
|
93 |
-
<td colspan="3"><a href="#" id="mtm_add_tag">Add new tag</a></td>
|
94 |
-
</tr>
|
95 |
-
</tfoot>
|
96 |
-
</table>
|
97 |
-
|
98 |
-
<input type="hidden" name="mtm_submitted" value="1" />
|
99 |
-
<p class="submit">
|
100 |
-
<input type="submit" class="button-primary" value="<?php _e('Save Changes') ?>" />
|
101 |
-
</p>
|
102 |
-
</form>
|
103 |
-
</div>
|
104 |
-
<?php
|
105 |
-
}
|
106 |
-
|
107 |
-
add_action('wp_head', 'mtm_head');
|
108 |
-
|
109 |
-
|
110 |
-
function mtm_head() {
|
111 |
-
//If options form has been submitted, create a $_POST value that will be saved on databse
|
112 |
-
$mtm_data = get_option('mtm_data');
|
113 |
-
?>
|
114 |
<!-- Meta Manager Start -->
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
|
|
|
|
|
|
|
|
120 |
}
|
121 |
-
|
122 |
-
?>
|
123 |
<!-- Meta Manager End -->
|
124 |
-
|
|
|
125 |
}
|
126 |
|
|
|
|
|
|
|
|
|
127 |
|
128 |
-
|
129 |
-
|
1 |
<?php
|
2 |
+
/*
|
3 |
+
Plugin Name: Meta Tag Manager
|
4 |
+
Plugin URI: http://netweblogic.com/wordpress/plugins/meta-tag-manager/
|
5 |
+
Description: A simple plugin to manage meta tags that appear on all your pages. This can be used for verifiying google, yahoo, and more. — <a href="options-general.php?page=mtmverification">Settings page</a> — edited by <a href="http://ten-fingers-and-a-brain.com/">Martin Lormes</a>
|
6 |
+
Author: NetWebLogic LLC
|
7 |
+
Version: 1.0
|
8 |
+
Author URI: http://netweblogic.com/
|
9 |
+
Text Domain: meta-tag-manager
|
10 |
*/
|
11 |
+
/*
|
12 |
+
Copyright (C) 2009 NetWebLogic LLC
|
13 |
+
Copyright (C) 2009 Martin Lormes
|
14 |
+
|
15 |
+
This program is free software; you can redistribute it and/or modify
|
16 |
+
it under the terms of the GNU General Public License as published by
|
17 |
+
the Free Software Foundation; either version 3 of the License, or
|
18 |
+
(at your option) any later version.
|
19 |
+
|
20 |
+
This program is distributed in the hope that it will be useful,
|
21 |
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
22 |
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
23 |
+
GNU General Public License for more details.
|
24 |
+
|
25 |
+
You should have received a copy of the GNU General Public License
|
26 |
+
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
27 |
+
*/
|
28 |
+
|
29 |
+
class MetaTagManager {
|
30 |
+
/** loads the plugin */
|
31 |
+
function init() {
|
32 |
+
add_action ( 'wp_head', array ( __CLASS__, 'head' ) );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
33 |
}
|
34 |
+
|
35 |
+
/** puts the meta tags in the head */
|
36 |
+
function head() {
|
37 |
+
//If options form has been submitted, create a $_POST value that will be saved on databse
|
38 |
+
$mtm_data = get_option('mtm_data');
|
39 |
+
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
40 |
<!-- Meta Manager Start -->
|
41 |
+
<?php
|
42 |
+
if(is_array($mtm_data)){
|
43 |
+
foreach( $mtm_data as $meta){
|
44 |
+
if (! isset ( $meta [3] ) or (1 != $meta [3]) or (is_home () and 'posts' == get_option ( 'show_on_front' )) or is_front_page ()) {
|
45 |
+
$name = wp_specialchars ( $meta [0], 1 );
|
46 |
+
$content = wp_specialchars ( $meta [1], 1 );
|
47 |
+
echo "<meta name=\"$name\" content=\"$content\" />\n";
|
48 |
+
}
|
49 |
+
}
|
50 |
}
|
51 |
+
?>
|
|
|
52 |
<!-- Meta Manager End -->
|
53 |
+
<?php
|
54 |
+
}
|
55 |
}
|
56 |
|
57 |
+
// Include admin backend if needed
|
58 |
+
if ( is_admin() ) {
|
59 |
+
require_once ( 'meta-tag-manager-admin.php' );
|
60 |
+
}
|
61 |
|
62 |
+
// Start this plugin once all other plugins are fully loaded
|
63 |
+
add_action( 'init', array('MetaTagManager', 'init') );
|
meta-tag-manager.pot
ADDED
@@ -0,0 +1,67 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Language File for 'Meta Tag Manager' (Wordpress Plugin).
|
2 |
+
# Copyright (C) 2008 NetWebLogic LLC
|
3 |
+
# Copyright (c) 2009 Martin Lormes <martinhh@gmail.com>
|
4 |
+
# This file is distributed under the same license as the meta-tag-manager package.
|
5 |
+
#
|
6 |
+
#, fuzzy
|
7 |
+
msgid ""
|
8 |
+
msgstr ""
|
9 |
+
"Project-Id-Version: meta-tag-manager 0.5.2\n"
|
10 |
+
"Report-Msgid-Bugs-To: http://wordpress.org/tag/meta-tag-manager\n"
|
11 |
+
"POT-Creation-Date: 2009-09-21 15:06+0000\n"
|
12 |
+
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
13 |
+
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
14 |
+
"Language-Team: LANGUAGE <LL@li.org>\n"
|
15 |
+
"MIME-Version: 1.0\n"
|
16 |
+
"Content-Type: text/plain; charset=CHARSET\n"
|
17 |
+
"Content-Transfer-Encoding: 8bit\n"
|
18 |
+
|
19 |
+
#. #-#-#-#-# plugin.pot (meta-tag-manager 0.5.1) #-#-#-#-#
|
20 |
+
#. Plugin Name of an extension
|
21 |
+
#: meta-tag-manager-admin.php:11 meta-tag-manager-admin.php:49
|
22 |
+
msgid "Meta Tag Manager"
|
23 |
+
msgstr ""
|
24 |
+
|
25 |
+
#: meta-tag-manager-admin.php:50
|
26 |
+
msgid "Enter a reference name (something to help you remember the meta tag) and then enter the values that you want the meta tag to hold."
|
27 |
+
msgstr ""
|
28 |
+
|
29 |
+
#: meta-tag-manager-admin.php:56
|
30 |
+
msgid "Reference Name"
|
31 |
+
msgstr ""
|
32 |
+
|
33 |
+
#: meta-tag-manager-admin.php:57
|
34 |
+
msgid "Meta Tag"
|
35 |
+
msgstr ""
|
36 |
+
|
37 |
+
#: meta-tag-manager-admin.php:58
|
38 |
+
msgid "Homepage only"
|
39 |
+
msgstr ""
|
40 |
+
|
41 |
+
#: meta-tag-manager-admin.php:67 meta-tag-manager-admin.php:76
|
42 |
+
msgid "Remove"
|
43 |
+
msgstr ""
|
44 |
+
|
45 |
+
#: meta-tag-manager-admin.php:84
|
46 |
+
msgid "Add new tag"
|
47 |
+
msgstr ""
|
48 |
+
|
49 |
+
#. Plugin URI of an extension
|
50 |
+
msgid "http://netweblogic.com/wordpress/plugins/meta-tag-manager/"
|
51 |
+
msgstr ""
|
52 |
+
|
53 |
+
#. Description of an extension
|
54 |
+
msgid ""
|
55 |
+
"A simple plugin to manage meta tags that appear on all your pages. This can "
|
56 |
+
"be used for verifiying google, yahoo, and more. — <a "
|
57 |
+
"href=\"options-general.php?page=mtmverification\">Settings page</a> — "
|
58 |
+
"edited by <a href=\"http://ten-fingers-and-a-brain.com/\">Martin Lormes</a>"
|
59 |
+
msgstr ""
|
60 |
+
|
61 |
+
#. Author of an extension
|
62 |
+
msgid "NetWebLogic LLC"
|
63 |
+
msgstr ""
|
64 |
+
|
65 |
+
#. Author URI of an extension
|
66 |
+
msgid "http://netweblogic.com/"
|
67 |
+
msgstr ""
|
mtm_script.js
CHANGED
@@ -1,61 +1,68 @@
|
|
1 |
-
/*
|
2 |
-
Plugin Name: Meta Tag Manager
|
3 |
-
Plugin URI: http://
|
4 |
-
Description: A simple plugin to manage meta tags that appear on all your pages. This can be used for verifiying google, yahoo, and more.
|
5 |
-
Author: Marcus Sykes
|
6 |
-
Version: 0.
|
7 |
-
Author URI: http://
|
8 |
-
License : GNU General Public License
|
9 |
-
Copyright (C) 2008 NetWebLogic LLC
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
metaCopy.
|
20 |
-
metaCopy.find('
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
metaCopy
|
50 |
-
metaCopy.
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
}
|
60 |
-
|
61 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/*
|
2 |
+
Plugin Name: Meta Tag Manager
|
3 |
+
Plugin URI: http://netweblogic.com/wordpress/plugins/meta-tag-manager/
|
4 |
+
Description: A simple plugin to manage meta tags that appear on all your pages. This can be used for verifiying google, yahoo, and more.
|
5 |
+
Author: Marcus Sykes
|
6 |
+
Version: 0.5.2
|
7 |
+
Author URI: http://netweblogic.com/
|
8 |
+
License : GNU General Public License
|
9 |
+
Copyright (C) 2008 NetWebLogic LLC
|
10 |
+
Copyright (C) 2009 Martin Lormes
|
11 |
+
*/
|
12 |
+
jQuery(document).ready( function($) {
|
13 |
+
jQuery('#mtm_add_tag').click( function() {
|
14 |
+
// Get All meta rows
|
15 |
+
var metas = jQuery('#mtm_body').children();
|
16 |
+
// Copy first row and change values
|
17 |
+
var metaCopy = jQuery(metas[0]).clone(true);
|
18 |
+
newId = metas.length + 1;
|
19 |
+
metaCopy.attr('id', 'mtm_'+newId);
|
20 |
+
metaCopy.find('a').attr('rel', newId);
|
21 |
+
metaCopy.find('[name=mtm_1_ref]').attr({
|
22 |
+
name:'mtm_'+newId+'_ref' ,
|
23 |
+
value:''
|
24 |
+
});
|
25 |
+
metaCopy.find('[name=mtm_1_content]').attr( {
|
26 |
+
name:'mtm_'+newId+'_content' ,
|
27 |
+
value:''
|
28 |
+
});
|
29 |
+
metaCopy.find('[name=mtm_1_name]').attr( {
|
30 |
+
name:'mtm_'+newId+'_name' ,
|
31 |
+
value:''
|
32 |
+
});
|
33 |
+
metaCopy.find('[name=mtm_1_homepageonly]').attr( {
|
34 |
+
name:'mtm_'+newId+'_homepageonly' ,
|
35 |
+
checked:false
|
36 |
+
});
|
37 |
+
// Insert into end of file
|
38 |
+
jQuery('#mtm_body').append(metaCopy);
|
39 |
+
// Duplicate the last entry, remove values and rename id
|
40 |
+
});
|
41 |
+
|
42 |
+
jQuery('#mtm_body a').click( function() {
|
43 |
+
// Only remove if there's more than 1 meta tag
|
44 |
+
if(jQuery('#mtm_body').children().length > 1) {
|
45 |
+
// Remove the item
|
46 |
+
jQuery(jQuery(this).parent().parent().get(0)).remove();
|
47 |
+
//Renumber all the items
|
48 |
+
jQuery('#mtm_body').children().each( function(i) {
|
49 |
+
metaCopy = jQuery(this);
|
50 |
+
oldId = metaCopy.attr('id').replace('mtm_','');
|
51 |
+
newId = i+1;
|
52 |
+
metaCopy.attr('id', 'mtm_'+newId);
|
53 |
+
metaCopy.find('a').attr('rel', newId);
|
54 |
+
metaCopy.find('[name=mtm_'+ oldId +'_ref]').attr('name', 'mtm_'+newId+'_ref');
|
55 |
+
metaCopy.find('[name=mtm_'+ oldId +'_content]').attr('name', 'mtm_'+newId+'_content');
|
56 |
+
metaCopy.find('[name=mtm_'+ oldId +'_name]').attr( 'name', 'mtm_'+newId+'_name');
|
57 |
+
metaCopy.find('[name=mtm_'+ oldId +'_homepageonly]').attr( 'name', 'mtm_'+newId+'_homepageonly');
|
58 |
+
});
|
59 |
+
} else {
|
60 |
+
metaCopy = jQuery(jQuery(this).parent().parent().get(0));
|
61 |
+
metaCopy.find('[name=mtm_1_ref]').attr( 'value', '' );
|
62 |
+
metaCopy.find('[name=mtm_1_content]').attr( 'value', '' );
|
63 |
+
metaCopy.find('[name=mtm_1_name]').attr( 'value', '' );
|
64 |
+
metaCopy.find('[name=mtm_1_homepageonly]').attr( 'checked', false );
|
65 |
+
alert("If you don't want any meta tags, just leave the text boxes blank and submit");
|
66 |
+
}
|
67 |
+
});
|
68 |
+
});
|
readme.txt
CHANGED
@@ -1,49 +1,52 @@
|
|
1 |
=== Meta Tag Manager ===
|
2 |
-
|
3 |
Contributors: netweblogic
|
4 |
Tags: Google, SEO, Yahoo, Webmaster Tools, Meta, Meta Tags
|
5 |
Requires at least: 2.5
|
6 |
-
Tested up to: 2.
|
7 |
-
Stable tag: 0
|
8 |
|
9 |
This plugin will allow you to easily add and manage special meta tags to your whole site, such as Yahoo and Google verification tags.
|
10 |
|
11 |
== Description ==
|
12 |
|
13 |
-
Simple plugin which allows you to add custom meta tags that will show across all pages on your blog.
|
14 |
|
15 |
Just upload, activate, and immediately start adding meta tags.
|
16 |
|
17 |
This can be used for adding Google and Yahoo site verification tags along with any other meta tags you may want to add.
|
18 |
|
19 |
-
If you
|
20 |
-
|
21 |
-
Revision Summary
|
22 |
-
|
23 |
-
* 0.5 - Fixed bug which threw a Notice error when no meta tags were defined
|
24 |
-
* 0.4 - Fixed the bug where the rss feeds kept breaking
|
25 |
|
|
|
26 |
|
27 |
== Installation ==
|
28 |
|
29 |
-
1.
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
4. Enter the values in the text boxes. The first text box is so you can give your meta tag a memorable name and is not displayed on the website.
|
36 |
|
37 |
-
|
38 |
-
|
39 |
-
6. Save your changes
|
40 |
|
|
|
41 |
|
42 |
== Screenshots ==
|
43 |
|
44 |
-
1. Once activated you can add/edit/delete tags from the menu in Settings > Meta Tag Manager
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
=== Meta Tag Manager ===
|
|
|
2 |
Contributors: netweblogic
|
3 |
Tags: Google, SEO, Yahoo, Webmaster Tools, Meta, Meta Tags
|
4 |
Requires at least: 2.5
|
5 |
+
Tested up to: 2.8.5
|
6 |
+
Stable tag: 1.0
|
7 |
|
8 |
This plugin will allow you to easily add and manage special meta tags to your whole site, such as Yahoo and Google verification tags.
|
9 |
|
10 |
== Description ==
|
11 |
|
12 |
+
Simple plugin which allows you to add custom meta tags that will show across all pages on your blog or on the homepage only.
|
13 |
|
14 |
Just upload, activate, and immediately start adding meta tags.
|
15 |
|
16 |
This can be used for adding Google and Yahoo site verification tags along with any other meta tags you may want to add.
|
17 |
|
18 |
+
If you have any problems with the plugins, please visit our [http://netweblogic.com/forums/](support forums) for further information and provide some feedback first, we may be able to help. It's considered rude to just give low ratings and nothing reason for doing so.
|
|
|
|
|
|
|
|
|
|
|
19 |
|
20 |
+
If you find this plugin useful and would like to say thanks, a link, digg, or some other form of recognition to the plugin page on our blog would be appreciated.
|
21 |
|
22 |
== Installation ==
|
23 |
|
24 |
+
1. Download and unzip the plugin, then upload the entire `meta-tag-manager` directory to the `/wp-content/plugins` directory; or simply upload the zip file if you use WordPress 2.7 or newer
|
25 |
+
1. Activate the plugin through the 'Plugins' menu in WordPress
|
26 |
+
1. Go to *Settings > Meta Tag Manager*
|
27 |
+
1. Enter the values in the text boxes. The first text box is so you can give your meta tag a memorable name and is not displayed on the website
|
28 |
+
1. Add tags by clicking on the add tag link under the meta rows, and remove tags by clicking on the links next to the meta in question
|
29 |
+
1. Save your changes
|
|
|
30 |
|
31 |
+
== Frequently Asked Questions ==
|
|
|
|
|
32 |
|
33 |
+
Please see our [http://netweblogic.com/forums/](support forums).
|
34 |
|
35 |
== Screenshots ==
|
36 |
|
37 |
+
1. Once the plugin is activated you can add/edit/delete tags from the menu in *Settings > Meta Tag Manager*
|
38 |
+
|
39 |
+
== Changelog ==
|
40 |
+
|
41 |
+
= 1.0 =
|
42 |
+
* code styling: code now wrapped in classes
|
43 |
+
* bug fixed: magic quotes
|
44 |
+
* bug fixed: character escaping using wp_specialchars on the site and htmlspecialchars on the admin page
|
45 |
+
* separated the code into two .php files
|
46 |
+
* meta-tag-manager.php the main plugin file, always loaded, contains minimal code to reduce loading time
|
47 |
+
* meta-tag-manager-admin.php contains the admin backend parts of the plugin and is only loaded in the backend
|
48 |
+
* i18n
|
49 |
+
* l10n for: de_DE (language file by [Martin Lormes](http://ten-fingers-and-a-brain.com))
|
50 |
+
* meta tags can be flagged to appear on the homepage only
|
51 |
+
* fixed bug which threw a Notice error when no meta tags were defined
|
52 |
+
* fixed the bug where the rss feeds kept breaking
|