Version Description
Download this release
Release Info
Developer | pbaylies |
Plugin | All in One SEO Pack |
Version | 2.2.4 |
Comparing to | |
See all releases |
Code changes from version 2.2.3.1 to 2.2.4
- aioseop_class.php +905 -613
- aioseop_functions.php +45 -12
- aioseop_module.css +46 -1
- aioseop_module_class.php +74 -17
- aioseop_opengraph.php +154 -65
- aioseop_performance.php +11 -7
- aioseop_sitemap.php +55 -31
- all_in_one_seo_pack.php +44 -23
- images/wincherbanner.png +0 -0
- readme.txt +1 -1
aioseop_class.php
CHANGED
@@ -58,10 +58,7 @@ class All_in_One_SEO_Pack extends All_in_One_SEO_Pack_Module {
|
|
58 |
$this->do_log = false;
|
59 |
|
60 |
$this->init();
|
61 |
-
|
62 |
-
$aioseop_plugin_name = __( 'All in One SEO Pack', 'all_in_one_seo_pack' );
|
63 |
-
if ( ! defined( 'AIOSEOP_PLUGIN_NAME' ) )
|
64 |
-
define( 'AIOSEOP_PLUGIN_NAME', $aioseop_plugin_name );
|
65 |
$this->name = sprintf( __( '%s Plugin Options', 'all_in_one_seo_pack' ), AIOSEOP_PLUGIN_NAME );
|
66 |
$this->menu_name = __( 'General Settings', 'all_in_one_seo_pack' );
|
67 |
|
@@ -71,24 +68,26 @@ class All_in_One_SEO_Pack extends All_in_One_SEO_Pack_Module {
|
|
71 |
$this->file = __FILE__; // the current file
|
72 |
parent::__construct();
|
73 |
|
74 |
-
$help_text = Array(
|
75 |
"donate" => __( "All donations support continued development of this free software.", 'all_in_one_seo_pack'),
|
76 |
-
"can" => __( "This option will automatically generate Canonical URLs for your entire WordPress installation. This will help to prevent duplicate content penalties by <a href=\'http://googlewebmastercentral.blogspot.com/2009/02/specify-your-canonical.html\' target=\'_blank\'>Google</a>.", 'all_in_one_seo_pack'),
|
77 |
"no_paged_canonical_links"=> __( "Checking this option will set the Canonical URL for all paginated content to the first page.", 'all_in_one_seo_pack'),
|
78 |
-
"
|
79 |
-
"
|
80 |
-
"
|
81 |
-
"
|
82 |
-
"
|
83 |
-
"
|
84 |
-
"
|
85 |
-
"
|
86 |
-
"
|
87 |
-
"
|
88 |
-
"
|
89 |
-
"
|
|
|
|
|
90 |
"page_title_format" =>
|
91 |
-
__( "This controls the format of the title tag for Pages.<br
|
92 |
. '<ul><li>' . __( '%blog_title% - Your blog title', 'all_in_one_seo_pack' ) . '</li><li>' .
|
93 |
__( '%blog_description% - Your blog description', 'all_in_one_seo_pack' ) . '</li><li>' .
|
94 |
__( '%page_title% - The original title of the page', 'all_in_one_seo_pack' ) . '</li><li>' .
|
@@ -100,7 +99,7 @@ class All_in_One_SEO_Pack extends All_in_One_SEO_Pack_Module {
|
|
100 |
__( "%page_author_lastname% - This page's author' last name (capitalized)", 'all_in_one_seo_pack' ) . '</li>' .
|
101 |
'</ul>',
|
102 |
"post_title_format" =>
|
103 |
-
__( "This controls the format of the title tag for Posts.<br
|
104 |
. '<ul><li>' . __( '%blog_title% - Your blog title', 'all_in_one_seo_pack' ) . '</li><li>' .
|
105 |
__( '%blog_description% - Your blog description', 'all_in_one_seo_pack' ) . '</li><li>' .
|
106 |
__( '%post_title% - The original title of the post', 'all_in_one_seo_pack' ) . '</li><li>' .
|
@@ -112,18 +111,18 @@ class All_in_One_SEO_Pack extends All_in_One_SEO_Pack_Module {
|
|
112 |
__( "%post_author_lastname% - This post's author' last name (capitalized)", 'all_in_one_seo_pack' ) . '</li>' .
|
113 |
'</ul>',
|
114 |
"category_title_format" =>
|
115 |
-
__( "This controls the format of the title tag for Category Archives.<br
|
116 |
'<ul><li>' . __( '%blog_title% - Your blog title', 'all_in_one_seo_pack' ) . '</li><li>' .
|
117 |
__( '%blog_description% - Your blog description', 'all_in_one_seo_pack' ) . '</li><li>' .
|
118 |
__( '%category_title% - The original title of the category', 'all_in_one_seo_pack' ) . '</li><li>' .
|
119 |
__( '%category_description% - The description of the category', 'all_in_one_seo_pack' ) . '</li></ul>',
|
120 |
"archive_title_format" =>
|
121 |
-
__( "This controls the format of the title tag for Custom Post Archives.<br
|
122 |
'<ul><li>' . __( '%blog_title% - Your blog title', 'all_in_one_seo_pack' ) . '</li><li>' .
|
123 |
__( '%blog_description% - Your blog description', 'all_in_one_seo_pack' ) . '</li><li>' .
|
124 |
__( '%archive_title - The original archive title given by wordpress', 'all_in_one_seo_pack' ) . '</li></ul>',
|
125 |
-
"date_title_format" =>
|
126 |
-
__( "This controls the format of the title tag for Date Archives.<br
|
127 |
'<ul><li>' . __( '%blog_title% - Your blog title', 'all_in_one_seo_pack' ) . '</li><li>' .
|
128 |
__( '%blog_description% - Your blog description', 'all_in_one_seo_pack' ) . '</li><li>' .
|
129 |
__( '%date% - The original archive title given by wordpress, e.g. "2007" or "2007 August"', 'all_in_one_seo_pack' ) . '</li><li>' .
|
@@ -131,82 +130,157 @@ class All_in_One_SEO_Pack extends All_in_One_SEO_Pack_Module {
|
|
131 |
__( '%month% - The original archive month given by wordpress, e.g. "August"', 'all_in_one_seo_pack' ) . '</li><li>' .
|
132 |
__( '%year% - The original archive year given by wordpress, e.g. "2007"', 'all_in_one_seo_pack' ) . '</li></ul>',
|
133 |
"author_title_format" =>
|
134 |
-
__( "This controls the format of the title tag for Author Archives.<br
|
135 |
'<ul><li>' . __( '%blog_title% - Your blog title', 'all_in_one_seo_pack' ) . '</li><li>' .
|
136 |
__( '%blog_description% - Your blog description', 'all_in_one_seo_pack' ) . '</li><li>' .
|
137 |
__( '%author% - The original archive title given by wordpress, e.g. "Steve" or "John Smith"', 'all_in_one_seo_pack' ) . '</li></ul>',
|
138 |
"tag_title_format" =>
|
139 |
-
__( "This controls the format of the title tag for Tag Archives.<br
|
140 |
'<ul><li>' . __( '%blog_title% - Your blog title', 'all_in_one_seo_pack' ) . '</li><li>' .
|
141 |
__( '%blog_description% - Your blog description', 'all_in_one_seo_pack' ) . '</li><li>' .
|
142 |
__( '%tag% - The name of the tag', 'all_in_one_seo_pack' ) . '</li></ul>',
|
143 |
"search_title_format" =>
|
144 |
-
__( "This controls the format of the title tag for the Search page.<br
|
145 |
'<ul><li>' . __( '%blog_title% - Your blog title', 'all_in_one_seo_pack' ) . '</li><li>' .
|
146 |
__( '%blog_description% - Your blog description', 'all_in_one_seo_pack' ) . '</li><li>' .
|
147 |
__( '%search% - What was searched for', 'all_in_one_seo_pack' ) . '</li></ul>',
|
148 |
-
"description_format" => __( "This controls the format of Meta Descriptions
|
149 |
'<ul><li>' . __( '%blog_title% - Your blog title', 'all_in_one_seo_pack' ) . '</li><li>' .
|
150 |
__( '%blog_description% - Your blog description', 'all_in_one_seo_pack' ) . '</li><li>' .
|
151 |
__( '%description% - The original description as determined by the plugin, e.g. the excerpt if one is set or an auto-generated one if that option is set', 'all_in_one_seo_pack' ) . '</li><li>' .
|
152 |
__( '%post_title% - The original title of the post', 'all_in_one_seo_pack' ) . '</li><li>' .
|
153 |
__( '%wp_title% - The original wordpress title, e.g. post_title for posts', 'all_in_one_seo_pack' ) . '</li></ul>',
|
154 |
-
"404_title_format" => __( "This controls the format of the title tag for the 404 page.<br
|
155 |
'<ul><li>' . __( '%blog_title% - Your blog title', 'all_in_one_seo_pack' ) . '</li><li>' .
|
156 |
__( '%blog_description% - Your blog description', 'all_in_one_seo_pack' ) . '</li><li>' .
|
157 |
__( '%request_url% - The original URL path, like "/url-that-does-not-exist/"', 'all_in_one_seo_pack' ) . '</li><li>' .
|
158 |
__( '%request_words% - The URL path in human readable form, like "Url That Does Not Exist"', 'all_in_one_seo_pack' ) . '</li><li>' .
|
159 |
__( '%404_title% - Additional 404 title input"', 'all_in_one_seo_pack' ) . '</li></ul>',
|
160 |
-
"paged_format" => __( "This string gets appended/prepended to titles of paged index pages (like home or archive pages)
|
161 |
. __( 'The following macros are supported:', 'all_in_one_seo_pack' )
|
162 |
. '<ul><li>' . __( '%page% - The page number', 'all_in_one_seo_pack' ) . '</li></ul>',
|
163 |
-
"enablecpost" => __( "Check this if you want to use All in One SEO Pack with any Custom Post Types on this site
|
164 |
-
"cpostadvanced" => __( "This will show or hide the advanced options for SEO for Custom Post Types
|
165 |
-
"cpostactive" => __( "Use these checkboxes to select which Post Types you want to use All in One SEO Pack with
|
166 |
-
"cposttitles" => __( "This allows you to set the title tags for each Custom Post Type
|
167 |
-
"posttypecolumns" => __( "This lets you select which screens display the SEO Title, SEO Keywords and SEO Description columns
|
168 |
-
"admin_bar" => __( "Check this to add All in One SEO Pack to the Admin Bar for easy access to your SEO settings
|
169 |
-
"custom_menu_order" => __( "Check this to move the All in One SEO Pack menu item to the top of your WordPress Dashboard menu
|
170 |
"google_verify" => __( "Enter your verification code here to verify your site with Google Webmaster Tools.<br /><a href='http://semperplugins.com/documentation/google-webmaster-tools-verification/' target='_blank'>Click here for documentation on this setting</a>", 'all_in_one_seo_pack' ),
|
171 |
"bing_verify" => __( "Enter your verification code here to verify your site with Bing Webmaster Tools.<br /><a href='http://semperplugins.com/documentation/bing-webmaster-verification/' target='_blank'>Click here for documentation on this setting</a>", 'all_in_one_seo_pack' ),
|
172 |
"pinterest_verify" => __( "Enter your verification code here to verify your site with Pinterest.<br /><a href='http://semperplugins.com/documentation/pinterest-site-verification/' target='_blank'>Click here for documentation on this setting</a>", 'all_in_one_seo_pack' ),
|
173 |
-
"google_publisher" => __( "Enter your Google+ Profile URL here to add the rel=“author” tag to your site for Google authorship. It is recommended that the URL you enter here should be your personal Google+ profile. Use the Advanced Authorship Options below if you want greater control over the use of authorship
|
174 |
-
"google_disable_profile"=> __( "Check this to remove the Google Plus field from the user profile screen
|
175 |
-
"google_author_advanced"=> __( "Enable this to display advanced options for controlling Google Plus authorship information on your website
|
176 |
-
"google_author_location"=> __( "This option allows you to control which types of pages you want to display rel=\"author\" on for Google authorship. The options include the Front Page (the homepage of your site), Posts, Pages, and any Custom Post Types. The Everywhere Else option includes 404, search, categories, tags, custom taxonomies, date archives, author archives and any other page template
|
177 |
-
"google_enable_publisher"=> __( "This option allows you to control whether rel=\"publisher\" is displayed on the homepage of your site. Google recommends using this if the site is a business website
|
178 |
-
"google_specify_publisher"=> __( "The Google+ profile you enter here will appear on your homepage only as the rel=\"publisher\" tag. It is recommended that the URL you enter here should be the Google+ profile for your business
|
|
|
179 |
"google_connect" => __( "Press the connect button to connect with Google Analytics; or if already connected, press the disconnect button to disable and remove any stored analytics credentials.", 'all_in_one_seo_pack' ),
|
180 |
-
"google_analytics_id" => __( "Enter your Google Analytics ID here to track visitor behavior on your site using Google Analytics
|
181 |
-
"ga_use_universal_analytics" => __( "Use the new Universal Analytics tracking code for Google Analytics
|
182 |
-
"
|
183 |
-
"
|
184 |
-
"
|
185 |
-
"
|
|
|
|
|
186 |
"ga_exclude_users" => __( "Exclude logged-in users from Google Analytics tracking by role.", 'all_in_one_seo_pack' ),
|
187 |
-
"ga_track_outbound_links"=> __( "Check this if you want to track outbound links with Google Analytics
|
188 |
-
"
|
189 |
-
"
|
190 |
-
"
|
191 |
-
"
|
192 |
-
"
|
193 |
-
"
|
194 |
-
"
|
195 |
-
"
|
196 |
-
"
|
|
|
|
|
197 |
'noodp' => __( 'Check this box to ask search engines not to use descriptions from the Open Directory Project for your entire site.', 'all_in_one_seo_pack' ),
|
|
|
198 |
'noydir' => __( 'Check this box to ask Yahoo! not to use descriptions from the Yahoo! directory for your entire site.', 'all_in_one_seo_pack' ),
|
199 |
-
|
200 |
-
"
|
201 |
-
"
|
202 |
-
"
|
203 |
-
"
|
204 |
-
"
|
205 |
-
"
|
206 |
-
"
|
207 |
-
"
|
208 |
-
"
|
209 |
-
"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
210 |
);
|
211 |
|
212 |
$meta_help_text = Array(
|
@@ -214,6 +288,7 @@ class All_in_One_SEO_Pack extends All_in_One_SEO_Pack_Module {
|
|
214 |
'title' => __( 'A custom title that shows up in the title tag for this page.', 'all_in_one_seo_pack' ),
|
215 |
'description' => __( 'The META description for this page. This will override any autogenerated descriptions.', 'all_in_one_seo_pack' ),
|
216 |
'keywords' => __( 'A comma separated list of your most important keywords for this page that will be written as META keywords.', 'all_in_one_seo_pack' ),
|
|
|
217 |
'noindex' => __( 'Check this box to ask search engines not to index this page.', 'all_in_one_seo_pack' ),
|
218 |
'nofollow' => __( 'Check this box to ask search engines not to follow links from this page.', 'all_in_one_seo_pack' ),
|
219 |
'noodp' => __( 'Check this box to ask search engines not to use descriptions from the Open Directory Project for this page.', 'all_in_one_seo_pack' ),
|
@@ -226,8 +301,8 @@ class All_in_One_SEO_Pack extends All_in_One_SEO_Pack_Module {
|
|
226 |
);
|
227 |
|
228 |
$this->default_options = array(
|
229 |
-
|
230 |
-
|
231 |
"home_title"=> Array(
|
232 |
'name' => __( 'Home Title:', 'all_in_one_seo_pack' ),
|
233 |
'default' => null, 'type' => 'textarea', 'sanitize' => 'text' ),
|
@@ -248,10 +323,23 @@ class All_in_One_SEO_Pack extends All_in_One_SEO_Pack_Module {
|
|
248 |
"can"=> Array(
|
249 |
'name' => __( 'Canonical URLs:', 'all_in_one_seo_pack' ),
|
250 |
'default' => 1),
|
251 |
-
|
252 |
'name' => __( 'No Pagination for Canonical URLs:', 'all_in_one_seo_pack' ),
|
253 |
'default' => 0,
|
254 |
'condshow' => Array( "aiosp_can" => 'on' ) ),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
255 |
"rewrite_titles"=> Array(
|
256 |
'name' => __( 'Rewrite Titles:', 'all_in_one_seo_pack' ),
|
257 |
'default' => 1,
|
@@ -290,11 +378,11 @@ class All_in_One_SEO_Pack extends All_in_One_SEO_Pack_Module {
|
|
290 |
'name' => __( 'Category Title Format:', 'all_in_one_seo_pack' ),
|
291 |
'type' => 'text', 'default' => '%category_title% | %blog_title%',
|
292 |
'condshow' => Array( "aiosp_rewrite_titles" => 1 ) ),
|
293 |
-
|
294 |
'name' => __( 'Archive Title Format:', 'all_in_one_seo_pack' ),
|
295 |
'type' => 'text', 'default' => '%archive_title% | %blog_title%',
|
296 |
'condshow' => Array( "aiosp_rewrite_titles" => 1 ) ),
|
297 |
-
|
298 |
'name' => __( 'Date Archive Title Format:', 'all_in_one_seo_pack' ),
|
299 |
'type' => 'text', 'default' => '%date% | %blog_title%',
|
300 |
'condshow' => Array( "aiosp_rewrite_titles" => 1 ) ),
|
@@ -352,6 +440,16 @@ class All_in_One_SEO_Pack extends All_in_One_SEO_Pack_Module {
|
|
352 |
'type' => 'multicheckbox', 'default' => array(),
|
353 |
'condshow' => Array( 'aiosp_enablecpost' => 'on', 'aiosp_cpostadvanced' => 'on' )
|
354 |
),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
355 |
"cposttitles" => Array(
|
356 |
'name' => __( 'Custom titles:', 'all_in_one_seo_pack' ),
|
357 |
'type' => 'checkbox', 'default' => 0,
|
@@ -381,6 +479,9 @@ class All_in_One_SEO_Pack extends All_in_One_SEO_Pack_Module {
|
|
381 |
"google_disable_profile"=> Array(
|
382 |
'name' => __( 'Disable Google Plus Profile:', 'all_in_one_seo_pack' ), 'default' => 0, 'type' => 'checkbox'
|
383 |
),
|
|
|
|
|
|
|
384 |
"google_author_advanced" => Array(
|
385 |
'name' => __( 'Advanced Authorship Options:', 'all_in_one_seo_pack' ),
|
386 |
'default' => 0, 'type' => 'radio',
|
@@ -407,35 +508,54 @@ class All_in_One_SEO_Pack extends All_in_One_SEO_Pack_Module {
|
|
407 |
),
|
408 |
"google_analytics_id"=> Array(
|
409 |
'name' => __( 'Google Analytics ID:', 'all_in_one_seo_pack' ),
|
410 |
-
'default' => null, 'type' => 'text' ),
|
411 |
"ga_use_universal_analytics" => Array(
|
412 |
'name' => __( 'Use Universal Analytics:', 'all_in_one_seo_pack' ),
|
413 |
'default' => 0,
|
414 |
'condshow' => Array( 'aiosp_google_analytics_id' => Array( 'lhs' => 'aiosp_google_analytics_id', 'op' => '!=', 'rhs' => '' ) ) ),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
415 |
"ga_domain"=> Array(
|
416 |
'name' => __( 'Tracking Domain:', 'all_in_one_seo_pack' ),
|
417 |
'type' => 'text',
|
418 |
-
'condshow' => Array( 'aiosp_google_analytics_id' => Array( 'lhs' => 'aiosp_google_analytics_id', 'op' => '!=', 'rhs' => '' ) ) ),
|
419 |
"ga_multi_domain"=> Array(
|
420 |
'name' => __( 'Track Multiple Domains:', 'all_in_one_seo_pack' ),
|
421 |
'default' => 0,
|
422 |
-
'condshow' => Array( 'aiosp_google_analytics_id' => Array( 'lhs' => 'aiosp_google_analytics_id', 'op' => '!=', 'rhs' => '' ) ) ),
|
|
|
|
|
|
|
|
|
423 |
"ga_anonymize_ip"=> Array(
|
424 |
'name' => __( 'Anonymize IP Addresses:', 'all_in_one_seo_pack' ),
|
425 |
'type' => 'checkbox',
|
426 |
-
'condshow' => Array( 'aiosp_google_analytics_id' => Array( 'lhs' => 'aiosp_google_analytics_id', 'op' => '!=', 'rhs' => '' ) ) ),
|
427 |
"ga_display_advertising"=> Array(
|
428 |
-
'name' => __( '
|
429 |
'type' => 'checkbox',
|
430 |
-
'condshow' => Array( 'aiosp_google_analytics_id' => Array( 'lhs' => 'aiosp_google_analytics_id', 'op' => '!=', 'rhs' => '' ) ) ),
|
431 |
"ga_exclude_users"=> Array(
|
432 |
'name' => __( 'Exclude Users From Tracking:', 'all_in_one_seo_pack' ),
|
433 |
'type' => 'multicheckbox',
|
434 |
-
'condshow' => Array( 'aiosp_google_analytics_id' => Array( 'lhs' => 'aiosp_google_analytics_id', 'op' => '!=', 'rhs' => '' ) ) ),
|
435 |
"ga_track_outbound_links"=> Array(
|
436 |
'name' => __( 'Track Outbound Links:', 'all_in_one_seo_pack' ),
|
437 |
'default' => 0,
|
438 |
-
'condshow' => Array( 'aiosp_google_analytics_id' => Array( 'lhs' => 'aiosp_google_analytics_id', 'op' => '!=', 'rhs' => '' ) ) ),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
439 |
"use_categories"=> Array(
|
440 |
'name' => __( 'Use Categories for META keywords:', 'all_in_one_seo_pack' ),
|
441 |
'default' => 0,
|
@@ -517,7 +637,7 @@ class All_in_One_SEO_Pack extends All_in_One_SEO_Pack_Module {
|
|
517 |
$this->locations = Array(
|
518 |
'default' => Array( 'name' => $this->name, 'prefix' => 'aiosp_', 'type' => 'settings', 'options' => null ),
|
519 |
'aiosp' => Array( 'name' => $this->plugin_name, 'type' => 'metabox', 'prefix' => '', 'help_link' => 'http://semperplugins.com/sections/postpage-settings/',
|
520 |
-
'options' => Array( 'edit', 'nonce-aioseop-edit', 'upgrade', 'snippet', 'title', 'description', 'keywords', 'noindex', 'nofollow', 'noodp', 'noydir', 'titleatr', 'menulabel', 'sitemap_exclude', 'disable', 'disable_analytics' ),
|
521 |
'default_options' => Array(
|
522 |
'edit' => Array( 'type' => 'hidden', 'default' => 'aiosp_edit', 'prefix' => true, 'nowrap' => 1 ),
|
523 |
'nonce-aioseop-edit' => Array( 'type' => 'hidden', 'default' => null, 'prefix' => false, 'nowrap' => 1 ),
|
@@ -541,6 +661,7 @@ class All_in_One_SEO_Pack extends All_in_One_SEO_Pack_Module {
|
|
541 |
'title' => Array( 'name' => __( 'Title', 'all_in_one_seo_pack' ), 'type' => 'text', 'count' => true, 'size' => 60 ),
|
542 |
'description' => Array( 'name' => __( 'Description', 'all_in_one_seo_pack' ), 'type' => 'textarea', 'count' => true, 'cols' => 80, 'rows' => 2 ),
|
543 |
'keywords' => Array( 'name' => __( 'Keywords (comma separated)', 'all_in_one_seo_pack' ), 'type' => 'text' ),
|
|
|
544 |
'noindex' => Array( 'name' => __( "Robots Meta NOINDEX", 'all_in_one_seo_pack' ), 'default' => '' ),
|
545 |
'nofollow' => Array( 'name' => __( "Robots Meta NOFOLLOW", 'all_in_one_seo_pack' ), 'default' => '' ),
|
546 |
'noodp' => Array( 'name' => __( "Robots Meta NOODP", 'all_in_one_seo_pack' ) ),
|
@@ -553,10 +674,6 @@ class All_in_One_SEO_Pack extends All_in_One_SEO_Pack_Module {
|
|
553 |
'display' => null )
|
554 |
);
|
555 |
|
556 |
-
if ( !empty( $help_text ) )
|
557 |
-
foreach( $help_text as $k => $v )
|
558 |
-
$this->default_options[$k]['help_text'] = $v;
|
559 |
-
|
560 |
if ( !empty( $meta_help_text ) )
|
561 |
foreach( $meta_help_text as $k => $v )
|
562 |
$this->locations['aiosp']['default_options'][$k]['help_text'] = $v;
|
@@ -601,13 +718,14 @@ class All_in_One_SEO_Pack extends All_in_One_SEO_Pack_Module {
|
|
601 |
'google' => Array(
|
602 |
'name' => __( 'Google Settings', 'all_in_one_seo_pack' ),
|
603 |
'help_link' => 'http://semperplugins.com/documentation/google-settings/',
|
604 |
-
'options' => Array( "google_publisher", "google_disable_profile", "google_author_advanced", "google_author_location", "google_enable_publisher" , "google_specify_publisher",
|
605 |
-
"google_connect",
|
|
|
606 |
),
|
607 |
'noindex' => Array(
|
608 |
'name' => __( 'Noindex Settings', 'all_in_one_seo_pack' ),
|
609 |
'help_link' => 'http://semperplugins.com/documentation/noindex-settings/',
|
610 |
-
'options' => Array( 'cpostnoindex', 'cpostnofollow', 'category_noindex', 'archive_date_noindex', 'archive_author_noindex', 'tags_noindex', 'search_noindex', 'paginated_noindex', 'paginated_nofollow', 'noodp', 'noydir' )
|
611 |
),
|
612 |
'advanced' => Array(
|
613 |
'name' => __( 'Advanced Settings', 'all_in_one_seo_pack' ),
|
@@ -623,115 +741,140 @@ class All_in_One_SEO_Pack extends All_in_One_SEO_Pack_Module {
|
|
623 |
$this->layout['default']['options'] = array_diff( array_keys( $this->default_options ), $other_options );
|
624 |
|
625 |
if ( is_admin() ) {
|
|
|
626 |
add_action( "aioseop_global_settings_header", Array( $this, 'display_right_sidebar' ) );
|
627 |
add_action( "aioseop_global_settings_footer", Array( $this, 'display_settings_footer' ) );
|
628 |
add_action( "output_option", Array( $this, 'custom_output_option' ), 10, 2 );
|
629 |
}
|
630 |
}
|
631 |
|
632 |
-
|
633 |
-
|
634 |
-
if ( $
|
635 |
-
|
636 |
-
|
637 |
-
|
638 |
-
|
639 |
-
|
640 |
-
|
641 |
-
|
642 |
-
|
643 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
644 |
}
|
645 |
-
if ( is_object( $post ) ) {
|
646 |
-
$post_id = $p->ID;
|
647 |
-
if (! $post->post_modified_gmt != '' )
|
648 |
-
$wp_query = new WP_Query( array( 'p' => $post_id, 'post_type' => $post->post_type ) );
|
649 |
-
if ( $post->post_type == 'page' )
|
650 |
-
$wp_query->is_page = true;
|
651 |
-
elseif ( $post->post_type == 'attachment' )
|
652 |
-
$wp_query->is_attachment = true;
|
653 |
-
else
|
654 |
-
$wp_query->is_single = true;
|
655 |
-
if ( empty( $wp_query->is_front_page ) ) $wp_query->is_front_page = false;
|
656 |
-
if ( get_option( 'show_on_front' ) == 'page' ) {
|
657 |
-
if ( is_page() && $post->ID == get_option( 'page_on_front' ) )
|
658 |
-
$wp_query->is_front_page = true;
|
659 |
-
elseif ( $post->ID == get_option( 'page_for_posts' ) )
|
660 |
-
$wp_query->is_home = true;
|
661 |
-
}
|
662 |
-
$wp_query->queried_object = $post;
|
663 |
-
if ( !empty( $post ) && !$wp_query->is_home && !$wp_query->is_front_page ) {
|
664 |
-
$title = $this->internationalize( get_post_meta( $post->ID, "_aioseop_title", true ) );
|
665 |
-
if ( empty( $title ) ) $title = $post->post_title;
|
666 |
-
}
|
667 |
-
$title_format = '';
|
668 |
-
if ( empty( $title ) ) {
|
669 |
-
$title = $this->wp_title();
|
670 |
-
$title_format = '%post_title%';
|
671 |
-
}
|
672 |
-
$description = $this->get_aioseop_description( $post );
|
673 |
-
if ( empty( $title_format ) ) {
|
674 |
-
if ( is_page() )
|
675 |
-
$title_format = $aioseop_options['aiosp_page_title_format'];
|
676 |
-
elseif ( is_single() || is_attachment() )
|
677 |
-
$title_format = $this->get_post_title_format();
|
678 |
-
}
|
679 |
-
} else if ( is_object( $term ) ) {
|
680 |
-
if ( $_GET['taxonomy'] == 'category' ) {
|
681 |
-
query_posts( Array( 'cat' => $_GET['tag_ID'] ) );
|
682 |
-
} else if ( $_GET['taxonomy'] == 'post_tag' ) {
|
683 |
-
query_posts( Array( 'tag' => $term->slug ) );
|
684 |
-
} else {
|
685 |
-
query_posts( Array( 'page' => '', $_GET['taxonomy'] => $term->slug, 'post_type' => $_GET['post_type'] ) );
|
686 |
-
}
|
687 |
-
if ( empty( $this->meta_opts ) )
|
688 |
-
$this->meta_opts = $this->get_current_options( Array(), 'aiosp' );
|
689 |
-
$title = $this->get_tax_name( $_GET['taxonomy'] );
|
690 |
-
$title_format = $this->get_tax_title_format();
|
691 |
-
$opts = $this->meta_opts;
|
692 |
-
if ( !empty( $opts ) ) $description = $opts['aiosp_description'];
|
693 |
-
if ( empty( $description ) ) $description = term_description();
|
694 |
-
$description = $this->internationalize( $description );
|
695 |
-
} else return '';
|
696 |
-
|
697 |
-
$show_page = true;
|
698 |
-
if ( !empty( $aioseop_options["aiosp_no_paged_canonical_links"] ) ) $show_page = false;
|
699 |
-
|
700 |
-
if ( ( $aioseop_options['aiosp_can'] ) && ( $url = $this->aiosp_mrt_get_url( $wp_query, $show_page ) ) )
|
701 |
-
$url = apply_filters( 'aioseop_canonical_url', $url );
|
702 |
-
if ( !$url ) $url = get_permalink();
|
703 |
-
|
704 |
-
$title = $this->apply_cf_fields( $title );
|
705 |
-
$description = $this->apply_cf_fields( $description );
|
706 |
-
$description = apply_filters( 'aioseop_description', $description );
|
707 |
-
|
708 |
-
wp_reset_postdata();
|
709 |
-
$wp_query = $w; $post = $p;
|
710 |
-
|
711 |
-
if ( $this->strlen( $title ) > 70 ) $title = $this->trim_excerpt_without_filters( $title, 70 ) . '...';
|
712 |
-
if ( $this->strlen( $description ) > 156 ) $description = $this->trim_excerpt_without_filters( $description, 156 ) . '...';
|
713 |
-
|
714 |
-
$extra_title_len = 0;
|
715 |
if ( empty( $title_format ) ) {
|
716 |
-
$
|
|
|
|
|
|
|
|
|
|
|
|
|
717 |
} else {
|
718 |
-
|
719 |
-
$title_format = $this->apply_cf_fields( $title_format );
|
720 |
-
$replace_title = '<span id="aioseop_snippet_title">' . esc_attr( wp_strip_all_tags( $title ) ) . '</span>';
|
721 |
-
if ( strpos( $title_format, '%post_title%' ) !== false ) $title_format = str_replace( '%post_title%', $replace_title, $title_format );
|
722 |
-
if ( strpos( $title_format, '%page_title%' ) !== false ) $title_format = str_replace( '%page_title%', $replace_title, $title_format );
|
723 |
-
if ( strpos( $title_format, '%category_title%' ) !== false ) $title_format = str_replace( '%category_title%', $replace_title, $title_format );
|
724 |
-
if ( strpos( $title_format, '%taxonomy_title%' ) !== false ) $title_format = str_replace( '%taxonomy_title%', $replace_title, $title_format );
|
725 |
-
$title_format = preg_replace( '/%([^%]*?)%/', '', $title_format );
|
726 |
-
$title = $title_format;
|
727 |
-
$extra_title_len = strlen( str_replace( $replace_title, '', $title_format ) );
|
728 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
729 |
|
730 |
-
$
|
731 |
-
$
|
732 |
-
$
|
733 |
-
$buf = $this->get_option_row( $args['name'], $args['options'], $args );
|
734 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
735 |
return $buf;
|
736 |
}
|
737 |
|
@@ -860,6 +1003,8 @@ class All_in_One_SEO_Pack extends All_in_One_SEO_Pack_Module {
|
|
860 |
$this->default_options["cpostactive"]['initial_options'] = $post_types;
|
861 |
$this->default_options["cpostnoindex"]['initial_options'] = $post_types;
|
862 |
$this->default_options["cpostnofollow"]['initial_options'] = $post_types;
|
|
|
|
|
863 |
$this->default_options["google_author_location"]['initial_options'] = $post_types;
|
864 |
$this->default_options['google_author_location' ]['initial_options'] = array_merge( Array( 'front' => __( 'Front Page', 'all_in_one_seo_pack' ) ), $post_types, Array( 'all' => __( 'Everywhere Else', 'all_in_one_seo_pack' ) ) );
|
865 |
$this->default_options["google_author_location"]['default'] = array_keys( $this->default_options["google_author_location"]['initial_options'] );
|
@@ -870,22 +1015,22 @@ class All_in_One_SEO_Pack extends All_in_One_SEO_Pack_Module {
|
|
870 |
if ( !isset( $this->default_options[$field] ) ) {
|
871 |
$this->default_options[$field] = Array (
|
872 |
'name' => "$name " . __( 'Title Format:', 'all_in_one_seo_pack' ) . "<br />($p)",
|
873 |
-
'help_text' =>
|
874 |
-
__( 'The following macros are supported:', 'all_in_one_seo_pack' )
|
875 |
-
. '<ul><li>' . __( '%blog_title% - Your blog title', 'all_in_one_seo_pack' ) . '</li><li>' .
|
876 |
-
__( '%blog_description% - Your blog description', 'all_in_one_seo_pack' ) . '</li><li>' .
|
877 |
-
__( '%post_title% - The original title of the post', 'all_in_one_seo_pack' ) . '</li><li>' .
|
878 |
-
__( '%category_title% - The (main) category of the post', 'all_in_one_seo_pack' ) . '</li><li>' .
|
879 |
-
__( '%category% - Alias for %category_title%', 'all_in_one_seo_pack' ) . '</li><li>' .
|
880 |
-
__( "%post_author_login% - This post's author' login", 'all_in_one_seo_pack' ) . '</li><li>' .
|
881 |
-
__( "%post_author_nicename% - This post's author' nicename", 'all_in_one_seo_pack' ) . '</li><li>' .
|
882 |
-
__( "%post_author_firstname% - This post's author' first name (capitalized)", 'all_in_one_seo_pack' ) . '</li><li>' .
|
883 |
-
__( "%post_author_lastname% - This post's author' last name (capitalized)", 'all_in_one_seo_pack' ) . '</li>' .
|
884 |
-
'</ul>',
|
885 |
'type' => 'text',
|
886 |
'default' => '%post_title% | %blog_title%',
|
887 |
'condshow' => Array( 'aiosp_rewrite_titles' => 1, 'aiosp_enablecpost' => 'on', 'aiosp_cpostadvanced' => 'on', 'aiosp_cposttitles' => 'on', 'aiosp_cpostactive\[\]' => $p )
|
888 |
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
889 |
$this->layout['cpt']['options'][] = $field;
|
890 |
}
|
891 |
}
|
@@ -898,6 +1043,7 @@ class All_in_One_SEO_Pack extends All_in_One_SEO_Pack_Module {
|
|
898 |
$this->default_options["ga_exclude_users"]['initial_options'] = $role_names;
|
899 |
|
900 |
$this->setting_options();
|
|
|
901 |
add_filter( "{$this->prefix}display_options", Array( $this, 'filter_options' ), 10, 2 );
|
902 |
parent::add_page_hooks();
|
903 |
}
|
@@ -959,7 +1105,11 @@ class All_in_One_SEO_Pack extends All_in_One_SEO_Pack_Module {
|
|
959 |
if ( is_object( $post_id ) )
|
960 |
$post_id = $post_id->ID;
|
961 |
$get_opts = $this->default_options( $location );
|
962 |
-
|
|
|
|
|
|
|
|
|
963 |
$field = "aiosp_$f";
|
964 |
$meta = get_post_meta( $post_id, '_aioseop_' . $f, true );
|
965 |
$get_opts[$field] = htmlspecialchars( stripslashes( $meta ) );
|
@@ -995,6 +1145,20 @@ class All_in_One_SEO_Pack extends All_in_One_SEO_Pack_Module {
|
|
995 |
$settings["{$prefix}nofollow"]['type'] = 'select';
|
996 |
$settings["{$prefix}nofollow"]['initial_options'] = Array( '' => __( 'Default - nofollow', 'all_in_one_seo_pack' ), 'off' => __( 'follow', 'all_in_one_seo_pack' ), 'on' => __( 'nofollow', 'all_in_one_seo_pack' ) );
|
997 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
998 |
}
|
999 |
|
1000 |
if ( !current_user_can( 'update_plugins' ) )
|
@@ -1014,6 +1178,9 @@ class All_in_One_SEO_Pack extends All_in_One_SEO_Pack_Module {
|
|
1014 |
} elseif ( !empty( $current["{$prefix}togglekeywords"] ) ) {
|
1015 |
unset( $settings["{$prefix}keywords"] );
|
1016 |
}
|
|
|
|
|
|
|
1017 |
}
|
1018 |
return $settings;
|
1019 |
}
|
@@ -1024,12 +1191,11 @@ class All_in_One_SEO_Pack extends All_in_One_SEO_Pack_Module {
|
|
1024 |
if ( !empty( $post ) ) {
|
1025 |
$prefix = $this->prefix;
|
1026 |
$post_type = get_post_type( $post );
|
1027 |
-
|
1028 |
-
if (
|
1029 |
-
|
1030 |
-
|
1031 |
-
|
1032 |
-
unset( $options["{$prefix}nofollow"] );
|
1033 |
}
|
1034 |
}
|
1035 |
if ( $location == null ) {
|
@@ -1040,8 +1206,6 @@ class All_in_One_SEO_Pack extends All_in_One_SEO_Pack_Module {
|
|
1040 |
$options["{$prefix}enablecpost"] = 0;
|
1041 |
if ( ( isset( $options["{$prefix}use_original_title"] ) ) && ( $options["{$prefix}use_original_title"] === '' ) )
|
1042 |
$options["{$prefix}use_original_title"] = 0;
|
1043 |
-
//if ( is_array( $options["{$prefix}google_author_location"] ) && in_array( 'all', $options["{$prefix}google_author_location"] ) && is_array( $this->default_options["google_author_location"]['initial_options'] ) )
|
1044 |
-
// $options["{$prefix}google_author_location"] = array_keys( $this->default_options["google_author_location"]['initial_options'] );
|
1045 |
}
|
1046 |
return $options;
|
1047 |
}
|
@@ -1053,12 +1217,20 @@ class All_in_One_SEO_Pack extends All_in_One_SEO_Pack_Module {
|
|
1053 |
?><div class="aioseop_metabox_text">
|
1054 |
<p><h2 style="display:inline;"><?php echo AIOSEOP_PLUGIN_NAME; ?></h2> by Michael Torbert of <a target="_blank" title="Semper Fi Web Design"
|
1055 |
href="http://semperfiwebdesign.com/">Semper Fi Web Design</a>.</p>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1056 |
<p>
|
1057 |
-
<a target="_blank" title="<?php _e('
|
1058 |
-
href="http://semperplugins.com/support/"><?php _e('Support Forum', 'all_in_one_seo_pack' ); ?></a>
|
1059 |
-
| <a target="_blank" title="<?php _e( 'All in One SEO Plugin Changelog', 'all_in_one_seo_pack' ); ?>"
|
1060 |
-
href="http://semperfiwebdesign.com/blog/all-in-one-seo-pack/all-in-one-seo-pack-release-history/"><?php _e( 'Changelog', 'all_in_one_seo_pack' ); ?></a>
|
1061 |
-
| <strong><a target="_blank" title="<?php _e('Pro Version', 'all_in_one_seo_pack' ); ?>"
|
1062 |
href="http://semperplugins.com/plugins/all-in-one-seo-pack-pro-version/?loc=side">
|
1063 |
<?php _e('UPGRADE TO PRO VERSION', 'all_in_one_seo_pack' ); ?></a></strong></p>
|
1064 |
</div>
|
@@ -1102,7 +1274,13 @@ class All_in_One_SEO_Pack extends All_in_One_SEO_Pack_Module {
|
|
1102 |
break;
|
1103 |
case "aioseop-support":
|
1104 |
?><div class="aioseop_metabox_text">
|
1105 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
1106 |
</div>
|
1107 |
<?php
|
1108 |
break;
|
@@ -1131,7 +1309,7 @@ class All_in_One_SEO_Pack extends All_in_One_SEO_Pack_Module {
|
|
1131 |
$post_type = '';
|
1132 |
if ( !empty( $post ) && !empty( $post->post_type ) )
|
1133 |
$post_type = $post->post_type;
|
1134 |
-
if( empty( $aioseop_options['aiosp_enablecpost'] ) ) {
|
1135 |
$wp_post_types = get_post_types( Array( '_builtin' => true ) ); // don't display meta if SEO isn't enabled on custom post types -- pdb
|
1136 |
if( is_singular() && !in_array( $post_type, $wp_post_types ) && !is_front_page() ) return false;
|
1137 |
} elseif ( !empty( $aioseop_options['aiosp_cpostadvanced'] ) ) {
|
@@ -1204,6 +1382,7 @@ class All_in_One_SEO_Pack extends All_in_One_SEO_Pack_Module {
|
|
1204 |
add_action( 'admin_menu', array( $this, 'admin_menu' ) );
|
1205 |
add_action( 'admin_head', array( $this, 'add_page_icon' ) );
|
1206 |
add_action( 'admin_init', 'aioseop_addmycolumns', 1 );
|
|
|
1207 |
} else {
|
1208 |
if ( $aioseop_options['aiosp_can'] == '1' || $aioseop_options['aiosp_can'] == 'on' )
|
1209 |
remove_action( 'wp_head', 'rel_canonical' );
|
@@ -1233,269 +1412,364 @@ class All_in_One_SEO_Pack extends All_in_One_SEO_Pack_Module {
|
|
1233 |
$is_posts_page = ( get_option( 'show_on_front' ) == 'page' && is_home() && $post->ID == get_option( 'page_for_posts' ) );
|
1234 |
return $is_posts_page;
|
1235 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1236 |
|
1237 |
function wp_head() {
|
1238 |
if ( !$this->is_page_included() ) return;
|
1239 |
$opts = $this->meta_opts;
|
1240 |
-
|
1241 |
static $aioseop_dup_counter = 0;
|
1242 |
$aioseop_dup_counter++;
|
1243 |
if ( $aioseop_dup_counter > 1 ) {
|
1244 |
echo "\n<!-- " . sprintf( __( "Debug Warning: All in One SEO Pack meta data was included again from %s filter. Called %s times!", 'all_in_one_seo_pack' ), current_filter(), $aioseop_dup_counter ) . " -->\n";
|
1245 |
return;
|
1246 |
}
|
1247 |
-
|
1248 |
if ( is_home() && !is_front_page() ) {
|
1249 |
$post = $this->get_blog_page();
|
1250 |
} else {
|
1251 |
$post = $this->get_queried_object();
|
1252 |
}
|
1253 |
-
|
1254 |
-
global $wp_query;
|
1255 |
-
global $aioseop_options;
|
1256 |
$meta_string = null;
|
1257 |
$description = '';
|
1258 |
-
|
1259 |
-
$
|
1260 |
-
if ( isset( $aioseop_options['aiosp_force_rewrites'] ) )
|
1261 |
-
$force_rewrites = $aioseop_options['aiosp_force_rewrites'];
|
1262 |
-
|
1263 |
-
if ( !empty( $aioseop_options['aiosp_rewrite_titles'] ) && $force_rewrites ) {
|
1264 |
-
// make the title rewrite as short as possible
|
1265 |
-
if (function_exists( 'ob_list_handlers' ) ) {
|
1266 |
-
$active_handlers = ob_list_handlers();
|
1267 |
-
} else {
|
1268 |
-
$active_handlers = array();
|
1269 |
-
}
|
1270 |
-
if (sizeof($active_handlers) > 0 &&
|
1271 |
-
$this->strtolower( $active_handlers[sizeof( $active_handlers ) - 1] ) ==
|
1272 |
-
$this->strtolower( 'All_in_One_SEO_Pack::output_callback_for_title' ) ) {
|
1273 |
-
ob_end_flush();
|
1274 |
-
} else {
|
1275 |
-
$this->log( "another plugin interfering?" );
|
1276 |
-
// if we get here there *could* be trouble with another plugin :(
|
1277 |
-
$this->ob_start_detected = true;
|
1278 |
-
if ( function_exists( 'ob_list_handlers' ) ) {
|
1279 |
-
foreach ( ob_list_handlers() as $handler ) {
|
1280 |
-
$this->log( "detected output handler $handler" );
|
1281 |
-
}
|
1282 |
-
}
|
1283 |
-
}
|
1284 |
-
}
|
1285 |
-
|
1286 |
echo "\n<!-- All in One SEO Pack $this->version by Michael Torbert of Semper Fi Web Design";
|
1287 |
if ( $this->ob_start_detected )
|
1288 |
echo "ob_start_detected ";
|
1289 |
echo "[$this->title_start,$this->title_end] ";
|
1290 |
echo "-->\n";
|
1291 |
-
$is_front_page = is_front_page();
|
1292 |
-
|
1293 |
-
$is_front_page_keywords = ( ( $is_front_page && $aioseop_options['aiosp_home_keywords'] && !$this->is_static_posts_page() ) || $this->is_static_front_page() );
|
1294 |
-
|
1295 |
$blog_page = $this->get_blog_page( $post );
|
1296 |
-
|
1297 |
-
if ( $
|
1298 |
-
|
1299 |
-
|
1300 |
-
|
1301 |
-
|
1302 |
-
|
1303 |
-
|
1304 |
-
|
1305 |
-
|
1306 |
-
|
1307 |
-
|
1308 |
-
if (
|
1309 |
-
$description = $this->internationalize( $description );
|
1310 |
-
} elseif ( is_author() && $this->show_page_description() )
|
1311 |
-
$description = $this->internationalize( get_the_author_meta( 'description' ) );
|
1312 |
-
else if ( $is_front_page )
|
1313 |
-
$description = trim( stripslashes( $this->internationalize( $aioseop_options['aiosp_home_description'] ) ) );
|
1314 |
-
else if ( is_single() || is_page() || is_attachment() || is_home() || $this->is_static_posts_page() )
|
1315 |
-
$description = $this->get_aioseop_description( $post );
|
1316 |
-
|
1317 |
-
if ( empty( $aioseop_options['aiosp_dont_truncate_descriptions'] ) ) {
|
1318 |
-
$description = $this->trim_excerpt_without_filters( $description );
|
1319 |
-
}
|
1320 |
-
|
1321 |
-
$description = apply_filters( 'aioseop_description', $description );
|
1322 |
-
|
1323 |
-
if ( isset($description) && ( $this->strlen($description) > $this->minimum_description_length ) && !( $is_front_page && is_paged() ) ) {
|
1324 |
// description format
|
1325 |
-
$
|
1326 |
-
if ( !isset( $description_format ) || empty( $description_format ) ) {
|
1327 |
-
$description_format = "%description%";
|
1328 |
-
}
|
1329 |
-
|
1330 |
-
$description = str_replace( '%description%', apply_filters( 'aioseop_description_override', $description ), $description_format );
|
1331 |
-
if ( strpos( $description, '%blog_title%' ) !== false ) $description = str_replace( '%blog_title%', get_bloginfo( 'name' ), $description );
|
1332 |
-
if ( strpos( $description, '%blog_description%' ) !== false ) $description = str_replace( '%blog_description%', get_bloginfo( 'description' ), $description );
|
1333 |
-
if ( strpos( $description, '%wp_title%' ) !== false ) $description = str_replace( '%wp_title%', $this->get_original_title(), $description );
|
1334 |
-
if ( strpos( $description, '%post_title%' ) !== false ) $description = str_replace( '%post_title%', $this->get_aioseop_title( $post ), $description );
|
1335 |
-
|
1336 |
-
$description = trim( wp_strip_all_tags( $description ) );
|
1337 |
-
$description = str_replace( '"', '"', $description );
|
1338 |
-
|
1339 |
-
// replace newlines on mac / windows?
|
1340 |
-
$description = str_replace( "\r\n", ' ', $description );
|
1341 |
-
|
1342 |
-
// maybe linux uses this alone
|
1343 |
-
$description = str_replace( "\n", ' ', $description );
|
1344 |
-
|
1345 |
-
if ( !isset( $meta_string) ) {
|
1346 |
-
$meta_string = '';
|
1347 |
-
}
|
1348 |
-
|
1349 |
-
if( $aioseop_options['aiosp_can'] && is_attachment() ) {
|
1350 |
-
$url = $this->aiosp_mrt_get_url( $wp_query );
|
1351 |
-
if ( $url ) {
|
1352 |
-
$matches = Array();
|
1353 |
-
preg_match_all( '/(\d+)/', $url, $matches );
|
1354 |
-
if ( is_array( $matches ) ){
|
1355 |
-
$uniqueDesc = join( '', $matches[0] );
|
1356 |
-
}
|
1357 |
-
}
|
1358 |
-
$description .= ' ' . $uniqueDesc;
|
1359 |
-
}
|
1360 |
-
$description = apply_filters( 'aioseop_description_full', $description );
|
1361 |
$desc_attr = '';
|
1362 |
if ( !empty( $aioseop_options['aiosp_schema_markup'] ) )
|
1363 |
$desc_attr = 'itemprop="description"';
|
1364 |
$desc_attr = apply_filters( 'aioseop_description_attributes', $desc_attr );
|
1365 |
$meta_string .= sprintf( "<meta name=\"description\" %s content=\"%s\" />\n", $desc_attr, $description );
|
1366 |
}
|
1367 |
-
|
1368 |
-
$
|
1369 |
-
|
1370 |
if ( isset( $aioseop_options['aiosp_togglekeywords'] ) )
|
1371 |
$togglekeywords = $aioseop_options['aiosp_togglekeywords'];
|
1372 |
-
|
1373 |
-
$
|
1374 |
-
|
1375 |
-
|
1376 |
-
|
1377 |
-
$keywords
|
1378 |
-
|
1379 |
-
|
1380 |
-
$key_attr = '
|
1381 |
-
|
1382 |
-
|
1383 |
-
|
1384 |
-
|
1385 |
-
$is_tag = is_tag();
|
1386 |
-
|
1387 |
-
$page = $this->get_page_number();
|
1388 |
-
|
1389 |
-
$robots_meta = '';
|
1390 |
-
|
1391 |
-
$aiosp_noindex = $aiosp_nofollow = $aiosp_noodp = $aiosp_noydir = '';
|
1392 |
-
$noindex = "index";
|
1393 |
-
$nofollow = "follow";
|
1394 |
-
if ( ( is_category() && !empty( $aioseop_options['aiosp_category_noindex'] ) ) || ( !is_category() && is_archive() && !is_tag() && !is_tax()
|
1395 |
-
&& ( ( is_date() && !empty( $aioseop_options['aiosp_archive_date_noindex'] ) ) || ( is_author() && !empty( $aioseop_options['aiosp_archive_author_noindex'] ) ) ) )
|
1396 |
-
|| ( is_tag() && !empty( $aioseop_options['aiosp_tags_noindex'] ) ) || ( is_search() && !empty( $aioseop_options['aiosp_search_noindex'] ) ) ) {
|
1397 |
-
$noindex = 'noindex';
|
1398 |
-
} elseif ( is_single() || is_page() || $this->is_static_posts_page() || is_attachment() || ( $page > 1 ) ) {
|
1399 |
-
$post_type = get_post_type();
|
1400 |
-
if ( !empty( $opts ) ) {
|
1401 |
-
$aiosp_noindex = htmlspecialchars( stripslashes( $opts['aiosp_noindex'] ) );
|
1402 |
-
$aiosp_nofollow = htmlspecialchars( stripslashes( $opts['aiosp_nofollow'] ) );
|
1403 |
-
$aiosp_noodp = htmlspecialchars( stripslashes( $opts['aiosp_noodp'] ) );
|
1404 |
-
$aiosp_noydir = htmlspecialchars( stripslashes( $opts['aiosp_noydir'] ) );
|
1405 |
-
}
|
1406 |
-
if ( $aiosp_noindex || $aiosp_nofollow || $aiosp_noodp || $aiosp_noydir || !empty( $aioseop_options['aiosp_cpostnoindex'] ) || !empty( $aioseop_options['aiosp_cpostnofollow'] ) || !empty( $aioseop_options['aiosp_paginated_noindex'] ) || !empty( $aioseop_options['aiosp_paginated_nofollow'] ) ) {
|
1407 |
-
if ( ( $aiosp_noindex == 'on' ) || ( ( !empty( $aioseop_options['aiosp_paginated_noindex'] ) ) && ( ( $page > 1 ) ) ) ||
|
1408 |
-
( ( $aiosp_noindex == '' ) && ( !empty( $aioseop_options['aiosp_cpostnoindex'] ) ) && ( in_array( $post_type, $aioseop_options['aiosp_cpostnoindex'] ) ) ) )
|
1409 |
-
$noindex = "no" . $noindex;
|
1410 |
-
if ( ( $aiosp_nofollow == 'on' ) || ( ( !empty( $aioseop_options['aiosp_paginated_nofollow'] ) ) && ( ( $page > 1 ) ) ) ||
|
1411 |
-
( ( $aiosp_nofollow == '' ) && ( !empty( $aioseop_options['aiosp_cpostnofollow'] ) ) && ( in_array( $post_type, $aioseop_options['aiosp_cpostnofollow'] ) ) ) )
|
1412 |
-
$nofollow = "no" . $nofollow;
|
1413 |
}
|
1414 |
}
|
1415 |
-
|
1416 |
-
|
1417 |
-
if ( $aiosp_noodp ) $nofollow .= ',noodp';
|
1418 |
-
if ( $aiosp_noydir ) $nofollow .= ',noydir';
|
1419 |
-
$robots_meta = $noindex . ',' . $nofollow;
|
1420 |
-
if ( $robots_meta == 'index,follow' ) $robots_meta = '';
|
1421 |
-
|
1422 |
-
$robots_meta = apply_filters( 'aioseop_robots_meta', $robots_meta );
|
1423 |
if ( !empty( $robots_meta ) )
|
1424 |
$meta_string .= '<meta name="robots" content="' . esc_attr( $robots_meta ) . '" />' . "\n";
|
1425 |
-
|
1426 |
-
if (
|
1427 |
foreach( Array( 'google' => 'google-site-verification', 'bing' => 'msvalidate.01', 'pinterest' => 'p:domain_verify' ) as $k => $v )
|
1428 |
if ( !empty( $aioseop_options["aiosp_{$k}_verify"] ) )
|
1429 |
$meta_string .= '<meta name="' . $v . '" content="' . trim( strip_tags( $aioseop_options["aiosp_{$k}_verify"] ) ) . '" />' . "\n";
|
1430 |
-
|
|
|
|
|
|
|
|
|
|
|
1431 |
foreach( Array( 'page_meta', 'post_meta', 'home_meta', 'front_meta' ) as $meta ) {
|
1432 |
if ( !empty( $aioseop_options["aiosp_{$meta}_tags" ] ) )
|
1433 |
$$meta = html_entity_decode( stripslashes( $aioseop_options["aiosp_{$meta}_tags" ] ), ENT_QUOTES );
|
1434 |
else
|
1435 |
$$meta = '';
|
1436 |
}
|
1437 |
-
|
1438 |
-
if ( is_page() && isset( $page_meta ) && !empty( $page_meta ) && ( !$is_front_page || empty( $front_meta ) ) ) {
|
1439 |
if ( isset( $meta_string ) ) $meta_string .= "\n";
|
1440 |
$meta_string .= $page_meta;
|
1441 |
}
|
1442 |
-
|
1443 |
if ( is_single() && isset( $post_meta ) && !empty( $post_meta ) ) {
|
1444 |
if ( isset( $meta_string ) ) $meta_string .= "\n";
|
1445 |
$meta_string .= $post_meta;
|
1446 |
}
|
1447 |
-
|
1448 |
-
$
|
1449 |
-
|
1450 |
-
if ( !empty( $post ) && isset( $post->post_author ) && empty( $aioseop_options['aiosp_google_disable_profile'] ) )
|
1451 |
-
$googleplus = get_the_author_meta( 'googleplus', $post->post_author );
|
1452 |
-
|
1453 |
-
if ( empty( $googleplus ) && !empty( $aioseop_options['aiosp_google_publisher'] ) )
|
1454 |
-
$googleplus = $aioseop_options['aiosp_google_publisher'];
|
1455 |
-
|
1456 |
-
if ( ( $is_front_page ) && ( $page < 2 ) ) {
|
1457 |
-
if ( !empty( $aioseop_options['aiosp_google_publisher'] ) )
|
1458 |
-
$publisher = $aioseop_options['aiosp_google_publisher'];
|
1459 |
-
|
1460 |
-
if ( !empty( $aioseop_options["aiosp_google_author_advanced"] ) ) {
|
1461 |
-
if ( empty( $aioseop_options["aiosp_google_enable_publisher"] ) ) {
|
1462 |
-
$publisher = '';
|
1463 |
-
} elseif ( !empty( $aioseop_options["aiosp_google_specify_publisher"] ) ) {
|
1464 |
-
$publisher = $aioseop_options["aiosp_google_specify_publisher"];
|
1465 |
-
}
|
1466 |
-
}
|
1467 |
-
}
|
1468 |
-
|
1469 |
-
$publisher = apply_filters( 'aioseop_google_publisher', $publisher );
|
1470 |
-
|
1471 |
if ( !empty( $publisher ) )
|
1472 |
-
$meta_string = '<link rel="publisher" href="' . esc_url( $publisher ) . '" />' . "\n" . $meta_string;
|
1473 |
-
|
1474 |
-
if ( is_singular() && ( !empty( $googleplus ) ) )
|
1475 |
-
$author = $googleplus;
|
1476 |
-
else if ( !empty( $aioseop_options['aiosp_google_publisher'] ) )
|
1477 |
-
$author = $aioseop_options['aiosp_google_publisher'];
|
1478 |
-
|
1479 |
-
if ( !empty( $aioseop_options['aiosp_google_author_advanced'] ) && isset( $aioseop_options['aiosp_google_author_location'] ) ) {
|
1480 |
-
if ( $is_front_page && !in_array( 'front', $aioseop_options['aiosp_google_author_location'] ) ) {
|
1481 |
-
$author = '';
|
1482 |
-
} else {
|
1483 |
-
if ( in_array( 'all', $aioseop_options['aiosp_google_author_location'] ) ) {
|
1484 |
-
if ( is_singular() && !is_singular( $aioseop_options['aiosp_google_author_location'] ) )
|
1485 |
-
$author = '';
|
1486 |
-
} else {
|
1487 |
-
if ( !is_singular( $aioseop_options['aiosp_google_author_location'] ) )
|
1488 |
-
$author = '';
|
1489 |
-
}
|
1490 |
-
}
|
1491 |
-
}
|
1492 |
-
|
1493 |
-
$author = apply_filters( 'aioseop_google_author', $author );
|
1494 |
-
|
1495 |
if ( !empty( $author ) )
|
1496 |
$meta_string = '<link rel="author" href="' . esc_url( $author ) . '" />' . "\n" . $meta_string;
|
1497 |
-
|
1498 |
-
if (
|
1499 |
if ( isset( $meta_string ) ) $meta_string .= "\n";
|
1500 |
$meta_string .= $front_meta;
|
1501 |
} else {
|
@@ -1504,71 +1778,21 @@ class All_in_One_SEO_Pack extends All_in_One_SEO_Pack_Module {
|
|
1504 |
$meta_string .= $home_meta;
|
1505 |
}
|
1506 |
}
|
1507 |
-
|
1508 |
-
$prev =
|
1509 |
-
|
1510 |
-
global $wp_query;
|
1511 |
-
$max_page = $wp_query->max_num_pages;
|
1512 |
-
if ( $page > 1 )
|
1513 |
-
$prev = get_previous_posts_page_link();
|
1514 |
-
if ( $page < $max_page ) {
|
1515 |
-
// $next = get_next_posts_page_link( $max_page );
|
1516 |
-
$paged = $GLOBALS['paged'];
|
1517 |
-
if ( !is_single() ) {
|
1518 |
-
if ( !$paged )
|
1519 |
-
$paged = 1;
|
1520 |
-
$nextpage = intval($paged) + 1;
|
1521 |
-
if ( !$max_page || $max_page >= $nextpage )
|
1522 |
-
$next = get_pagenum_link($nextpage);
|
1523 |
-
}
|
1524 |
-
}
|
1525 |
-
} else if ( is_page() || is_single() ) {
|
1526 |
-
$numpages = 1;
|
1527 |
-
$multipage = 0;
|
1528 |
-
$page = get_query_var('page');
|
1529 |
-
if ( ! $page )
|
1530 |
-
$page = 1;
|
1531 |
-
if ( is_single() || is_page() || is_feed() )
|
1532 |
-
$more = 1;
|
1533 |
-
$content = $post->post_content;
|
1534 |
-
if ( false !== strpos( $content, '<!--nextpage-->' ) ) {
|
1535 |
-
if ( $page > 1 )
|
1536 |
-
$more = 1;
|
1537 |
-
$content = str_replace( "\n<!--nextpage-->\n", '<!--nextpage-->', $content );
|
1538 |
-
$content = str_replace( "\n<!--nextpage-->", '<!--nextpage-->', $content );
|
1539 |
-
$content = str_replace( "<!--nextpage-->\n", '<!--nextpage-->', $content );
|
1540 |
-
// Ignore nextpage at the beginning of the content.
|
1541 |
-
if ( 0 === strpos( $content, '<!--nextpage-->' ) )
|
1542 |
-
$content = substr( $content, 15 );
|
1543 |
-
$pages = explode('<!--nextpage-->', $content);
|
1544 |
-
$numpages = count($pages);
|
1545 |
-
if ( $numpages > 1 )
|
1546 |
-
$multipage = 1;
|
1547 |
-
}
|
1548 |
-
if ( !empty( $page ) ) {
|
1549 |
-
if ( $page > 1 )
|
1550 |
-
$prev = _wp_link_page( $page - 1 );
|
1551 |
-
if ( $page + 1 <= $numpages )
|
1552 |
-
$next = _wp_link_page( $page + 1 );
|
1553 |
-
}
|
1554 |
-
if ( !empty( $prev ) ) {
|
1555 |
-
$prev = $this->substr( $prev, 9, -2 );
|
1556 |
-
}
|
1557 |
-
if ( !empty( $next ) ) {
|
1558 |
-
$next = $this->substr( $next, 9, -2 );
|
1559 |
-
}
|
1560 |
-
}
|
1561 |
-
|
1562 |
-
$prev = apply_filters( 'aioseop_prev_link', $prev );
|
1563 |
-
$next = apply_filters( 'aioseop_next_link', $next );
|
1564 |
-
|
1565 |
if ( !empty( $prev ) ) $meta_string .= "<link rel='prev' href='" . esc_url( $prev ) . "' />\n";
|
1566 |
if ( !empty( $next ) ) $meta_string .= "<link rel='next' href='" . esc_url( $next ) . "' />\n";
|
1567 |
-
|
1568 |
if ( $meta_string != null ) echo "$meta_string\n";
|
|
|
1569 |
$show_page = true;
|
1570 |
if ( !empty( $aioseop_options["aiosp_no_paged_canonical_links"] ) ) $show_page = false;
|
1571 |
-
|
|
|
|
|
|
|
|
|
|
|
1572 |
$url = apply_filters( 'aioseop_canonical_url', $url );
|
1573 |
if ( !empty( $url ) )
|
1574 |
echo '<link rel="canonical" href="'. esc_url( $url ) . '" />'."\n";
|
@@ -1753,6 +1977,7 @@ class All_in_One_SEO_Pack extends All_in_One_SEO_Pack_Module {
|
|
1753 |
function oauth_connect( $count = 0 ) {
|
1754 |
global $aiosp_activation;
|
1755 |
if ( !class_exists( 'OAuthConsumer' ) ) require_once( 'OAuth.php' );
|
|
|
1756 |
$callback_url = NULL;
|
1757 |
$consumer_key = "anonymous";
|
1758 |
$consumer_secret = "anonymous";
|
@@ -1786,47 +2011,66 @@ class All_in_One_SEO_Pack extends All_in_One_SEO_Pack_Module {
|
|
1786 |
if ( !$count ) {
|
1787 |
return $this->oauth_connect( 1 );
|
1788 |
}
|
1789 |
-
/*
|
1790 |
-
$req_token = new OAuthConsumer($this->token, $this->secret, 1);
|
1791 |
-
$req_req = $this->oauth_get_creds( $oauth_authorize, $req_token, $args );
|
1792 |
-
$url = $req_req->to_url();
|
1793 |
-
*/
|
1794 |
}
|
1795 |
return $url;
|
1796 |
}
|
1797 |
|
1798 |
function get_analytics_domain() {
|
1799 |
global $aioseop_options;
|
1800 |
-
|
1801 |
-
|
1802 |
-
|
1803 |
-
$domain = trim( $domain );
|
1804 |
-
$domain = $this->strtolower( $domain );
|
1805 |
-
if ( $this->strpos( $domain, "http://" ) === 0 ) $domain = $this->substr( $domain, 7 );
|
1806 |
-
elseif ( $this->strpos( $domain, "https://" ) === 0 ) $domain = $this->substr( $domain, 8 );
|
1807 |
-
$domain = untrailingslashit( $domain );
|
1808 |
-
}
|
1809 |
-
return $domain;
|
1810 |
}
|
1811 |
|
1812 |
function universal_analytics() {
|
1813 |
global $aioseop_options;
|
1814 |
$analytics = '';
|
1815 |
if ( !empty( $aioseop_options['aiosp_ga_use_universal_analytics'] ) ) {
|
1816 |
-
$allow_linker = '';
|
1817 |
-
|
|
|
1818 |
if ( !empty( $cookie_domain ) ) {
|
1819 |
$cookie_domain = esc_js( $cookie_domain );
|
1820 |
$cookie_domain = "'cookieDomain': '{$cookie_domain}'";
|
1821 |
}
|
1822 |
-
if (
|
|
|
|
|
|
|
1823 |
$allow_linker = "'allowLinker': true";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1824 |
}
|
1825 |
$extra_options = '';
|
1826 |
-
if (!empty( $aioseop_options['aiosp_ga_display_advertising'] ) ) {
|
1827 |
-
$extra_options
|
|
|
|
|
|
|
|
|
1828 |
}
|
1829 |
-
if ( !empty( $
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1830 |
if ( !empty( $extra_options ) ) $extra_options .= "\n\t\t\t";
|
1831 |
$extra_options .= "ga('set', 'anonymizeIp', true);";
|
1832 |
}
|
@@ -1846,7 +2090,7 @@ class All_in_One_SEO_Pack extends All_in_One_SEO_Pack_Module {
|
|
1846 |
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
|
1847 |
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
|
1848 |
|
1849 |
-
ga('create', '{$analytics_id}'{$js_options});
|
1850 |
{$extra_options}
|
1851 |
ga('send', 'pageview');
|
1852 |
</script>
|
@@ -1859,7 +2103,7 @@ EOF;
|
|
1859 |
function aiosp_google_analytics() {
|
1860 |
global $aioseop_options;
|
1861 |
$analytics = '';
|
1862 |
-
if ( !empty( $aioseop_options['aiosp_ga_exclude_users'] ) ) {
|
1863 |
if ( is_user_logged_in() ) {
|
1864 |
global $current_user;
|
1865 |
if ( empty( $current_user ) ) get_currentuserinfo();
|
@@ -1876,20 +2120,26 @@ function aiosp_google_analytics() {
|
|
1876 |
if ( empty( $analytics ) ) {
|
1877 |
?> <script type="text/javascript">
|
1878 |
var _gaq = _gaq || [];
|
1879 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
1880 |
echo $aioseop_options['aiosp_google_analytics_id'];
|
1881 |
?>']);
|
1882 |
-
<?php if ( !empty( $aioseop_options['aiosp_ga_anonymize_ip'] ) ) {
|
1883 |
?> _gaq.push(['_gat._anonymizeIp']);
|
1884 |
<?php
|
1885 |
}
|
1886 |
?>
|
1887 |
-
<?php if ( !empty( $aioseop_options['aiosp_ga_multi_domain'] ) ) {
|
1888 |
?> _gaq.push(['_setAllowLinker', true]);
|
1889 |
<?php
|
1890 |
}
|
1891 |
?>
|
1892 |
-
<?php if ( !empty( $aioseop_options['aiosp_ga_domain'] ) ) {
|
1893 |
$domain = $this->get_analytics_domain();
|
1894 |
?> _gaq.push(['_setDomainName', '<?php echo $domain; ?>']);
|
1895 |
<?php
|
@@ -1898,7 +2148,7 @@ function aiosp_google_analytics() {
|
|
1898 |
(function() {
|
1899 |
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
|
1900 |
<?php
|
1901 |
-
if (!empty( $aioseop_options['aiosp_ga_display_advertising'] ) ) {
|
1902 |
?> ga.src = ('https:' == document.location.protocol ? 'https://' : 'http://') + 'stats.g.doubleclick.net/dc.js';
|
1903 |
<?php
|
1904 |
} else {
|
@@ -1910,7 +2160,7 @@ function aiosp_google_analytics() {
|
|
1910 |
</script>
|
1911 |
<?php
|
1912 |
}
|
1913 |
-
if ( $aioseop_options['aiosp_ga_track_outbound_links'] ) { ?>
|
1914 |
<script type="text/javascript">
|
1915 |
function recordOutboundLink(link, category, action) {
|
1916 |
<?php if ( !empty( $aioseop_options['aiosp_ga_use_universal_analytics'] ) ) { ?>
|
@@ -1934,6 +2184,7 @@ function aiosp_google_analytics() {
|
|
1934 |
}
|
1935 |
return result;
|
1936 |
}
|
|
|
1937 |
function aiosp_addLoadEvent(func) {
|
1938 |
var oldonload = window.onload;
|
1939 |
if (typeof window.onload != 'function') {
|
@@ -1975,6 +2226,25 @@ function aiosp_google_analytics() {
|
|
1975 |
}
|
1976 |
echo apply_filters( 'aiosp_google_analytics', $analytics );
|
1977 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1978 |
|
1979 |
// Thank you, Yoast de Valk, for much of this code.
|
1980 |
|
@@ -2042,6 +2312,16 @@ function aiosp_google_analytics() {
|
|
2042 |
if ( empty( $link ) || !is_string( $link ) ) return false;
|
2043 |
if ( apply_filters( 'aioseop_canonical_url_pagination', $show_page ) )
|
2044 |
$link = $this->get_paged( $link );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2045 |
return $link;
|
2046 |
}
|
2047 |
|
@@ -2296,22 +2576,30 @@ function aiosp_google_analytics() {
|
|
2296 |
return $this->apply_tax_title_format( $name, $desc, $tax );
|
2297 |
}
|
2298 |
|
2299 |
-
function
|
2300 |
global $aioseop_options;
|
2301 |
-
$
|
2302 |
-
|
2303 |
-
|
|
|
2304 |
if( !empty( $aioseop_options['aiosp_enablecpost'] ) && !empty( $aioseop_options['aiosp_cpostadvanced'] ) && !empty( $aioseop_options['aiosp_cpostactive'] ) ) {
|
2305 |
$wp_post_types = $aioseop_options['aiosp_cpostactive'];
|
2306 |
-
if (
|
2307 |
-
$
|
2308 |
-
|
2309 |
-
|
|
|
|
|
|
|
2310 |
}
|
2311 |
}
|
2312 |
return $title_format;
|
2313 |
}
|
2314 |
|
|
|
|
|
|
|
|
|
2315 |
function apply_archive_title_format( $title, $category = '' ) {
|
2316 |
$title_format = $this->get_archive_title_format();
|
2317 |
$r_title = array( '%blog_title%', '%blog_description%', '%archive_title%' );
|
@@ -2319,22 +2607,6 @@ function aiosp_google_analytics() {
|
|
2319 |
$title = trim( str_replace( $r_title, $d_title, $title_format ) );
|
2320 |
return $title;
|
2321 |
}
|
2322 |
-
|
2323 |
-
function get_post_title_format() {
|
2324 |
-
global $aioseop_options;
|
2325 |
-
$title_format = '%post_title% | %blog_title%';
|
2326 |
-
if ( isset( $aioseop_options['aiosp_post_title_format'] ) )
|
2327 |
-
$title_format = $aioseop_options['aiosp_post_title_format'];
|
2328 |
-
if( !empty( $aioseop_options['aiosp_enablecpost'] ) && !empty( $aioseop_options['aiosp_cpostadvanced'] ) && !empty( $aioseop_options['aiosp_cpostactive'] ) ) {
|
2329 |
-
$wp_post_types = $aioseop_options['aiosp_cpostactive'];
|
2330 |
-
if ( is_singular( $wp_post_types ) && !empty( $aioseop_options["aiosp_cposttitles"] ) ) {
|
2331 |
-
$post_type = get_post_type();
|
2332 |
-
if ( !empty( $aioseop_options["aiosp_{$post_type}_title_format"] ) )
|
2333 |
-
$title_format = $aioseop_options["aiosp_{$post_type}_title_format"];
|
2334 |
-
}
|
2335 |
-
}
|
2336 |
-
return $title_format;
|
2337 |
-
}
|
2338 |
|
2339 |
function apply_post_title_format( $title, $category = '', $p = null ) {
|
2340 |
if ( $p === null ) {
|
@@ -2425,6 +2697,14 @@ function aiosp_google_analytics() {
|
|
2425 |
$title = apply_filters( 'single_post_title', $title );
|
2426 |
return $title;
|
2427 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2428 |
} else if ( is_single() ) {
|
2429 |
// we're not in the loop :(
|
2430 |
if ( $post === null ) return false;
|
@@ -2455,6 +2735,7 @@ function aiosp_google_analytics() {
|
|
2455 |
return $title;
|
2456 |
} else if ( is_tag() ) {
|
2457 |
global $utw;
|
|
|
2458 |
if ( $utw ) {
|
2459 |
$tags = $utw->GetCurrentTagSet();
|
2460 |
$tag = $tags[0]->tag;
|
@@ -2625,60 +2906,78 @@ function aiosp_google_analytics() {
|
|
2625 |
return trim( stripslashes( $text ) );
|
2626 |
}
|
2627 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2628 |
/**
|
2629 |
* @return comma-separated list of unique keywords
|
2630 |
*/
|
2631 |
function get_all_keywords() {
|
2632 |
global $posts;
|
2633 |
global $aioseop_options;
|
2634 |
-
|
2635 |
if ( is_404() ) return null;
|
2636 |
-
|
2637 |
// if we are on synthetic pages
|
2638 |
if ( !is_home() && !is_page() && !is_single() && !$this->is_static_front_page() && !$this->is_static_posts_page() && !is_archive() && !is_post_type_archive() )
|
2639 |
return null;
|
2640 |
-
|
2641 |
$keywords = array();
|
2642 |
-
|
2643 |
-
|
2644 |
-
|
2645 |
-
|
2646 |
-
|
2647 |
-
|
2648 |
-
|
2649 |
-
|
2650 |
-
|
2651 |
-
|
2652 |
-
|
2653 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2654 |
}
|
2655 |
-
$keywords_i = str_replace( '"', '', $keywords_i );
|
2656 |
-
if (isset( $keywords_i ) && !empty( $keywords_i ) ) {
|
2657 |
-
$traverse = explode( ',', $keywords_i );
|
2658 |
-
foreach ( $traverse as $keyword ) $keywords[] = $keyword;
|
2659 |
-
}
|
2660 |
-
|
2661 |
-
// WP 2.3 tags
|
2662 |
-
if ( !empty( $aioseop_options['aiosp_use_tags_as_keywords'] ) && function_exists( 'get_the_tags' ) ) {
|
2663 |
-
$tags = get_the_tags( $id );
|
2664 |
-
if ( $tags && is_array( $tags) )
|
2665 |
-
foreach ( $tags as $tag )
|
2666 |
-
$keywords[] = $this->internationalize( $tag->name );
|
2667 |
-
}
|
2668 |
-
// Ultimate Tag Warrior integration
|
2669 |
-
global $utw;
|
2670 |
-
if ( $utw ) {
|
2671 |
-
$tags = $utw->GetTagsForPost( $post );
|
2672 |
-
if ( is_array( $tags ) )
|
2673 |
-
foreach ( $tags as $tag ) {
|
2674 |
-
$tag = $tag->tag;
|
2675 |
-
$tag = str_replace( '_', ' ', $tag );
|
2676 |
-
$tag = str_replace( '-', ' ', $tag );
|
2677 |
-
$tag = stripslashes( $tag );
|
2678 |
-
$keywords[] = $tag;
|
2679 |
-
}
|
2680 |
-
}
|
2681 |
-
|
2682 |
// autometa
|
2683 |
$autometa = stripslashes( get_post_meta( $id, 'autometa', true ) );
|
2684 |
if ( isset( $autometa ) && !empty( $autometa ) ) {
|
@@ -2686,7 +2985,7 @@ function aiosp_google_analytics() {
|
|
2686 |
foreach ( $autometa_array as $e )
|
2687 |
$keywords[] = $e;
|
2688 |
}
|
2689 |
-
|
2690 |
if ( $aioseop_options['aiosp_use_categories'] && !is_page() ) {
|
2691 |
$categories = get_the_category( $id );
|
2692 |
foreach ( $categories as $category )
|
@@ -2698,25 +2997,6 @@ function aiosp_google_analytics() {
|
|
2698 |
return $this->get_unique_keywords($keywords);
|
2699 |
}
|
2700 |
|
2701 |
-
function get_meta_keywords() {
|
2702 |
-
global $posts;
|
2703 |
-
|
2704 |
-
$keywords = array();
|
2705 |
-
if (is_array( $posts) ) {
|
2706 |
-
foreach ( $posts as $post ) {
|
2707 |
-
if ( $post ) {
|
2708 |
-
// custom field keywords
|
2709 |
-
$keywords_i = null;
|
2710 |
-
$keywords_i = stripslashes( get_post_meta( $post->ID, "_aioseop_keywords", true ) );
|
2711 |
-
$keywords_i = str_replace( '"', '', $keywords_i );
|
2712 |
-
if ( isset( $keywords_i) && !empty( $keywords_i ) )
|
2713 |
-
$keywords[] = $keywords_i;
|
2714 |
-
}
|
2715 |
-
}
|
2716 |
-
}
|
2717 |
-
return $this->get_unique_keywords( $keywords );
|
2718 |
-
}
|
2719 |
-
|
2720 |
function get_unique_keywords($keywords) {
|
2721 |
$small_keywords = array();
|
2722 |
foreach ( $keywords as $word )
|
@@ -2739,22 +3019,30 @@ function aiosp_google_analytics() {
|
|
2739 |
if ( isset( $_POST[ 'nonce-aioseop-edit' ] ) ) $nonce = $_POST['nonce-aioseop-edit'];
|
2740 |
|
2741 |
if ( isset($awmp_edit) && !empty($awmp_edit) && wp_verify_nonce($nonce, 'edit-aioseop-nonce') ) {
|
2742 |
-
|
2743 |
-
|
|
|
|
|
|
|
|
|
2744 |
$field = "aiosp_$f";
|
2745 |
if ( isset( $_POST[$field] ) ) $$field = $_POST[$field];
|
2746 |
}
|
2747 |
|
2748 |
-
|
|
|
|
|
|
|
|
|
2749 |
delete_post_meta( $id, "_aioseop_{$f}" );
|
2750 |
|
2751 |
if ( $this->is_admin() ) {
|
2752 |
-
|
2753 |
delete_post_meta($id, '_aioseop_disable' );
|
2754 |
delete_post_meta($id, '_aioseop_disable_analytics' );
|
2755 |
}
|
2756 |
|
2757 |
-
foreach (
|
2758 |
$var = "aiosp_$f";
|
2759 |
$field = "_aioseop_$f";
|
2760 |
if ( isset( $$var ) && !empty( $$var ) )
|
@@ -2875,7 +3163,7 @@ function aiosp_google_analytics() {
|
|
2875 |
|
2876 |
$this->filter_pointers();
|
2877 |
|
2878 |
-
if ( $this->options['aiosp_enablecpost'] ) {
|
2879 |
if ( !empty( $this->options['aiosp_cpostadvanced'] ) ) {
|
2880 |
$this->locations['aiosp']['display'] = $this->options['aiosp_cpostactive'];
|
2881 |
} else {
|
@@ -2892,6 +3180,7 @@ function aiosp_google_analytics() {
|
|
2892 |
|
2893 |
add_meta_box('aioseop-list', __( "Join Our Mailing List", 'all_in_one_seo_pack' ), array( $this, 'display_extra_metaboxes'), 'aioseop_metaboxes', 'normal', 'core');
|
2894 |
add_meta_box('aioseop-about', "About <span style='float:right;'>Version <b>" . AIOSEOP_VERSION . "</b></span>", array( $this, 'display_extra_metaboxes'), 'aioseop_metaboxes', 'side', 'core');
|
|
|
2895 |
|
2896 |
add_action( 'aioseop_modules_add_menus', Array( $this, 'add_menu' ), 5 );
|
2897 |
do_action( 'aioseop_modules_add_menus', $file );
|
@@ -2971,15 +3260,14 @@ function aiosp_google_analytics() {
|
|
2971 |
global $wpdb;
|
2972 |
|
2973 |
if( !get_option( 'aioseop_options' ) ) {
|
2974 |
-
|
2975 |
-
|
2976 |
-
|
2977 |
-
|
2978 |
-
|
2979 |
-
|
2980 |
-
|
2981 |
}
|
2982 |
-
|
2983 |
?>
|
2984 |
<div class="aioseop_top">
|
2985 |
<div class="aioseop_top_sidebar aioseop_options_wrapper">
|
@@ -3009,6 +3297,9 @@ function aiosp_google_analytics() {
|
|
3009 |
});
|
3010 |
//]]>
|
3011 |
</script>
|
|
|
|
|
|
|
3012 |
<!-- Headway Themes-->
|
3013 |
<div class="aioseop_advert">
|
3014 |
<div>
|
@@ -3017,6 +3308,7 @@ function aiosp_google_analytics() {
|
|
3017 |
</div>
|
3018 |
<a href="http://semperfiwebdesign.com/headwayaio/" target="_blank"><img src="<?php echo AIOSEOP_PLUGIN_IMAGES_URL; ?>headwaybanner.png"></a>
|
3019 |
</div>
|
|
|
3020 |
</div>
|
3021 |
</div>
|
3022 |
<?php
|
58 |
$this->do_log = false;
|
59 |
|
60 |
$this->init();
|
61 |
+
|
|
|
|
|
|
|
62 |
$this->name = sprintf( __( '%s Plugin Options', 'all_in_one_seo_pack' ), AIOSEOP_PLUGIN_NAME );
|
63 |
$this->menu_name = __( 'General Settings', 'all_in_one_seo_pack' );
|
64 |
|
68 |
$this->file = __FILE__; // the current file
|
69 |
parent::__construct();
|
70 |
|
71 |
+
$this->help_text = Array(
|
72 |
"donate" => __( "All donations support continued development of this free software.", 'all_in_one_seo_pack'),
|
73 |
+
"can" => __( "This option will automatically generate Canonical URLs for your entire WordPress installation. This will help to prevent duplicate content penalties by <a href=\'http://googlewebmastercentral.blogspot.com/2009/02/specify-your-canonical.html\' target=\'_blank\'>Google</a>.", 'all_in_one_seo_pack'),
|
74 |
"no_paged_canonical_links"=> __( "Checking this option will set the Canonical URL for all paginated content to the first page.", 'all_in_one_seo_pack'),
|
75 |
+
"customize_canonical_links"=> __( "Checking this option will allow you to customize Canonical URLs for specific posts.", 'all_in_one_seo_pack'),
|
76 |
+
"can_set_protocol" => __( "Set protocol for canonical URLs.", 'all_in_one_seo_pack' ),
|
77 |
+
"use_original_title" => __( "Use wp_title to set the title; disable this option if you run into conflicts with the title being set by your theme or another plugin.", 'all_in_one_seo_pack' ),
|
78 |
+
"do_log" => __( "Check this and All in One SEO Pack will create a log of important events (all_in_one_seo_pack.log) in its plugin directory which might help debugging. Make sure this directory is writable.", 'all_in_one_seo_pack' ),
|
79 |
+
"home_title" => __( "As the name implies, this will be the Meta Title of your homepage. This is independent of any other option. If not set, the default Site Title (found in WordPress under Settings, General, Site Title) will be used.", 'all_in_one_seo_pack' ),
|
80 |
+
"home_description" => __( "This will be the Meta Description for your homepage. This is independent of any other option. The default is no Meta Description at all if this is not set.", 'all_in_one_seo_pack' ),
|
81 |
+
"home_keywords" => __( "Enter a comma separated list of your most important keywords for your site that will be written as Meta Keywords on your homepage. Don\'t stuff everything in here.", 'all_in_one_seo_pack' ),
|
82 |
+
"togglekeywords" => __( "This option allows you to toggle the use of Meta Keywords throughout the whole of the site.", 'all_in_one_seo_pack' ),
|
83 |
+
"use_categories" => __( "Check this if you want your categories for a given post used as the Meta Keywords for this post (in addition to any keywords you specify on the Edit Post screen).", 'all_in_one_seo_pack' ),
|
84 |
+
"use_tags_as_keywords" => __( "Check this if you want your tags for a given post used as the Meta Keywords for this post (in addition to any keywords you specify on the Edit Post screen).", 'all_in_one_seo_pack' ),
|
85 |
+
"dynamic_postspage_keywords"=> __( "Check this if you want your keywords on your Posts page (set in WordPress under Settings, Reading, Front Page Displays) to be dynamically generated from the keywords of the posts showing on that page. If unchecked, it will use the keywords set in the edit page screen for the posts page.", 'all_in_one_seo_pack'),
|
86 |
+
"rewrite_titles" => __( "Note that this is all about the title tag. This is what you see in your browser's window title bar. This is NOT visible on a page, only in the title bar and in the source code. If enabled, all page, post, category, search and archive page titles get rewritten. You can specify the format for most of them. For example: Using the default post title format below, Rewrite Titles will write all post titles as 'Post Title | Blog Name'. If you have manually defined a title using All in One SEO Pack, this will become the title of your post in the format string.", 'all_in_one_seo_pack' ),
|
87 |
+
"cap_titles" => __( "Check this and Search Page Titles and Tag Page Titles will have the first letter of each word capitalized.", 'all_in_one_seo_pack' ),
|
88 |
+
"cap_cats" => __( "Check this and Category Titles will have the first letter of each word capitalized.", 'all_in_one_seo_pack'),
|
89 |
"page_title_format" =>
|
90 |
+
__( "This controls the format of the title tag for Pages.<br />The following macros are supported:", 'all_in_one_seo_pack' )
|
91 |
. '<ul><li>' . __( '%blog_title% - Your blog title', 'all_in_one_seo_pack' ) . '</li><li>' .
|
92 |
__( '%blog_description% - Your blog description', 'all_in_one_seo_pack' ) . '</li><li>' .
|
93 |
__( '%page_title% - The original title of the page', 'all_in_one_seo_pack' ) . '</li><li>' .
|
99 |
__( "%page_author_lastname% - This page's author' last name (capitalized)", 'all_in_one_seo_pack' ) . '</li>' .
|
100 |
'</ul>',
|
101 |
"post_title_format" =>
|
102 |
+
__( "This controls the format of the title tag for Posts.<br />The following macros are supported:", 'all_in_one_seo_pack' )
|
103 |
. '<ul><li>' . __( '%blog_title% - Your blog title', 'all_in_one_seo_pack' ) . '</li><li>' .
|
104 |
__( '%blog_description% - Your blog description', 'all_in_one_seo_pack' ) . '</li><li>' .
|
105 |
__( '%post_title% - The original title of the post', 'all_in_one_seo_pack' ) . '</li><li>' .
|
111 |
__( "%post_author_lastname% - This post's author' last name (capitalized)", 'all_in_one_seo_pack' ) . '</li>' .
|
112 |
'</ul>',
|
113 |
"category_title_format" =>
|
114 |
+
__( "This controls the format of the title tag for Category Archives.<br />The following macros are supported:", 'all_in_one_seo_pack' ) .
|
115 |
'<ul><li>' . __( '%blog_title% - Your blog title', 'all_in_one_seo_pack' ) . '</li><li>' .
|
116 |
__( '%blog_description% - Your blog description', 'all_in_one_seo_pack' ) . '</li><li>' .
|
117 |
__( '%category_title% - The original title of the category', 'all_in_one_seo_pack' ) . '</li><li>' .
|
118 |
__( '%category_description% - The description of the category', 'all_in_one_seo_pack' ) . '</li></ul>',
|
119 |
"archive_title_format" =>
|
120 |
+
__( "This controls the format of the title tag for Custom Post Archives.<br />The following macros are supported:", 'all_in_one_seo_pack' ) .
|
121 |
'<ul><li>' . __( '%blog_title% - Your blog title', 'all_in_one_seo_pack' ) . '</li><li>' .
|
122 |
__( '%blog_description% - Your blog description', 'all_in_one_seo_pack' ) . '</li><li>' .
|
123 |
__( '%archive_title - The original archive title given by wordpress', 'all_in_one_seo_pack' ) . '</li></ul>',
|
124 |
+
"date_title_format" =>
|
125 |
+
__( "This controls the format of the title tag for Date Archives.<br />The following macros are supported:", 'all_in_one_seo_pack' ) .
|
126 |
'<ul><li>' . __( '%blog_title% - Your blog title', 'all_in_one_seo_pack' ) . '</li><li>' .
|
127 |
__( '%blog_description% - Your blog description', 'all_in_one_seo_pack' ) . '</li><li>' .
|
128 |
__( '%date% - The original archive title given by wordpress, e.g. "2007" or "2007 August"', 'all_in_one_seo_pack' ) . '</li><li>' .
|
130 |
__( '%month% - The original archive month given by wordpress, e.g. "August"', 'all_in_one_seo_pack' ) . '</li><li>' .
|
131 |
__( '%year% - The original archive year given by wordpress, e.g. "2007"', 'all_in_one_seo_pack' ) . '</li></ul>',
|
132 |
"author_title_format" =>
|
133 |
+
__( "This controls the format of the title tag for Author Archives.<br />The following macros are supported:", 'all_in_one_seo_pack' ) .
|
134 |
'<ul><li>' . __( '%blog_title% - Your blog title', 'all_in_one_seo_pack' ) . '</li><li>' .
|
135 |
__( '%blog_description% - Your blog description', 'all_in_one_seo_pack' ) . '</li><li>' .
|
136 |
__( '%author% - The original archive title given by wordpress, e.g. "Steve" or "John Smith"', 'all_in_one_seo_pack' ) . '</li></ul>',
|
137 |
"tag_title_format" =>
|
138 |
+
__( "This controls the format of the title tag for Tag Archives.<br />The following macros are supported:", 'all_in_one_seo_pack' ) .
|
139 |
'<ul><li>' . __( '%blog_title% - Your blog title', 'all_in_one_seo_pack' ) . '</li><li>' .
|
140 |
__( '%blog_description% - Your blog description', 'all_in_one_seo_pack' ) . '</li><li>' .
|
141 |
__( '%tag% - The name of the tag', 'all_in_one_seo_pack' ) . '</li></ul>',
|
142 |
"search_title_format" =>
|
143 |
+
__( "This controls the format of the title tag for the Search page.<br />The following macros are supported:", 'all_in_one_seo_pack' ) .
|
144 |
'<ul><li>' . __( '%blog_title% - Your blog title', 'all_in_one_seo_pack' ) . '</li><li>' .
|
145 |
__( '%blog_description% - Your blog description', 'all_in_one_seo_pack' ) . '</li><li>' .
|
146 |
__( '%search% - What was searched for', 'all_in_one_seo_pack' ) . '</li></ul>',
|
147 |
+
"description_format" => __( "This controls the format of Meta Descriptions.The following macros are supported:", 'all_in_one_seo_pack' ) .
|
148 |
'<ul><li>' . __( '%blog_title% - Your blog title', 'all_in_one_seo_pack' ) . '</li><li>' .
|
149 |
__( '%blog_description% - Your blog description', 'all_in_one_seo_pack' ) . '</li><li>' .
|
150 |
__( '%description% - The original description as determined by the plugin, e.g. the excerpt if one is set or an auto-generated one if that option is set', 'all_in_one_seo_pack' ) . '</li><li>' .
|
151 |
__( '%post_title% - The original title of the post', 'all_in_one_seo_pack' ) . '</li><li>' .
|
152 |
__( '%wp_title% - The original wordpress title, e.g. post_title for posts', 'all_in_one_seo_pack' ) . '</li></ul>',
|
153 |
+
"404_title_format" => __( "This controls the format of the title tag for the 404 page.<br />The following macros are supported:", 'all_in_one_seo_pack' ) .
|
154 |
'<ul><li>' . __( '%blog_title% - Your blog title', 'all_in_one_seo_pack' ) . '</li><li>' .
|
155 |
__( '%blog_description% - Your blog description', 'all_in_one_seo_pack' ) . '</li><li>' .
|
156 |
__( '%request_url% - The original URL path, like "/url-that-does-not-exist/"', 'all_in_one_seo_pack' ) . '</li><li>' .
|
157 |
__( '%request_words% - The URL path in human readable form, like "Url That Does Not Exist"', 'all_in_one_seo_pack' ) . '</li><li>' .
|
158 |
__( '%404_title% - Additional 404 title input"', 'all_in_one_seo_pack' ) . '</li></ul>',
|
159 |
+
"paged_format" => __( "This string gets appended/prepended to titles of paged index pages (like home or archive pages).", 'all_in_one_seo_pack' )
|
160 |
. __( 'The following macros are supported:', 'all_in_one_seo_pack' )
|
161 |
. '<ul><li>' . __( '%page% - The page number', 'all_in_one_seo_pack' ) . '</li></ul>',
|
162 |
+
"enablecpost" => __( "Check this if you want to use All in One SEO Pack with any Custom Post Types on this site.", 'all_in_one_seo_pack' ),
|
163 |
+
"cpostadvanced" => __( "This will show or hide the advanced options for SEO for Custom Post Types.", 'all_in_one_seo_pack' ),
|
164 |
+
"cpostactive" => __( "Use these checkboxes to select which Post Types you want to use All in One SEO Pack with.", 'all_in_one_seo_pack' ),
|
165 |
+
"cposttitles" => __( "This allows you to set the title tags for each Custom Post Type.", 'all_in_one_seo_pack' ),
|
166 |
+
"posttypecolumns" => __( "This lets you select which screens display the SEO Title, SEO Keywords and SEO Description columns.", 'all_in_one_seo_pack' ),
|
167 |
+
"admin_bar" => __( "Check this to add All in One SEO Pack to the Admin Bar for easy access to your SEO settings.", 'all_in_one_seo_pack' ),
|
168 |
+
"custom_menu_order" => __( "Check this to move the All in One SEO Pack menu item to the top of your WordPress Dashboard menu.", 'all_in_one_seo_pack' ),
|
169 |
"google_verify" => __( "Enter your verification code here to verify your site with Google Webmaster Tools.<br /><a href='http://semperplugins.com/documentation/google-webmaster-tools-verification/' target='_blank'>Click here for documentation on this setting</a>", 'all_in_one_seo_pack' ),
|
170 |
"bing_verify" => __( "Enter your verification code here to verify your site with Bing Webmaster Tools.<br /><a href='http://semperplugins.com/documentation/bing-webmaster-verification/' target='_blank'>Click here for documentation on this setting</a>", 'all_in_one_seo_pack' ),
|
171 |
"pinterest_verify" => __( "Enter your verification code here to verify your site with Pinterest.<br /><a href='http://semperplugins.com/documentation/pinterest-site-verification/' target='_blank'>Click here for documentation on this setting</a>", 'all_in_one_seo_pack' ),
|
172 |
+
"google_publisher" => __( "Enter your Google+ Profile URL here to add the rel=“author” tag to your site for Google authorship. It is recommended that the URL you enter here should be your personal Google+ profile. Use the Advanced Authorship Options below if you want greater control over the use of authorship.", 'all_in_one_seo_pack' ),
|
173 |
+
"google_disable_profile"=> __( "Check this to remove the Google Plus field from the user profile screen.", 'all_in_one_seo_pack' ),
|
174 |
+
"google_author_advanced"=> __( "Enable this to display advanced options for controlling Google Plus authorship information on your website.", 'all_in_one_seo_pack' ),
|
175 |
+
"google_author_location"=> __( "This option allows you to control which types of pages you want to display rel=\"author\" on for Google authorship. The options include the Front Page (the homepage of your site), Posts, Pages, and any Custom Post Types. The Everywhere Else option includes 404, search, categories, tags, custom taxonomies, date archives, author archives and any other page template.", 'all_in_one_seo_pack' ),
|
176 |
+
"google_enable_publisher"=> __( "This option allows you to control whether rel=\"publisher\" is displayed on the homepage of your site. Google recommends using this if the site is a business website.", 'all_in_one_seo_pack' ),
|
177 |
+
"google_specify_publisher"=> __( "The Google+ profile you enter here will appear on your homepage only as the rel=\"publisher\" tag. It is recommended that the URL you enter here should be the Google+ profile for your business.", 'all_in_one_seo_pack' ),
|
178 |
+
"google_sitelinks_search"=> __( "Add markup to display the Google Sitelinks Search Box next to your search results in Google.", 'all_in_one_seo_pack' ),
|
179 |
"google_connect" => __( "Press the connect button to connect with Google Analytics; or if already connected, press the disconnect button to disable and remove any stored analytics credentials.", 'all_in_one_seo_pack' ),
|
180 |
+
"google_analytics_id" => __( "Enter your Google Analytics ID here to track visitor behavior on your site using Google Analytics.", 'all_in_one_seo_pack' ),
|
181 |
+
"ga_use_universal_analytics" => __( "Use the new Universal Analytics tracking code for Google Analytics.", 'all_in_one_seo_pack' ),
|
182 |
+
"ga_advanced_options" => __( "Check to use advanced Google Analytics options.", 'all_in_one_seo_pack' ),
|
183 |
+
"ga_domain" => __( "Enter your domain name without the http:// to set your cookie domain.", 'all_in_one_seo_pack' ),
|
184 |
+
"ga_multi_domain" => __( "Use this option to enable tracking of multiple or additional domains.", 'all_in_one_seo_pack' ),
|
185 |
+
"ga_addl_domains" => __( "Add a list of additional domains to track here. Enter one domain name per line without the http://.", 'all_in_one_seo_pack' ),
|
186 |
+
"ga_anonymize_ip" => __( "This enables support for IP Anonymization in Google Analytics.", 'all_in_one_seo_pack' ),
|
187 |
+
"ga_display_advertising"=> __( "This enables support for the Display Advertiser Features in Google Analytics.", 'all_in_one_seo_pack' ),
|
188 |
"ga_exclude_users" => __( "Exclude logged-in users from Google Analytics tracking by role.", 'all_in_one_seo_pack' ),
|
189 |
+
"ga_track_outbound_links"=> __( "Check this if you want to track outbound links with Google Analytics.", 'all_in_one_seo_pack' ),
|
190 |
+
"ga_link_attribution"=> __( "This enables support for the Enhanced Link Attribution in Google Analytics.", 'all_in_one_seo_pack' ),
|
191 |
+
"ga_enhanced_ecommerce" => __( "This enables support for the Enhanced Ecommerce in Google Analytics.", 'all_in_one_seo_pack' ),
|
192 |
+
"cpostnoindex" => __( "Set the default NOINDEX setting for each Post Type.", 'all_in_one_seo_pack' ),
|
193 |
+
"cpostnofollow" => __( "Set the default NOFOLLOW setting for each Post Type.", 'all_in_one_seo_pack' ),
|
194 |
+
"category_noindex" => __( "Check this to ask search engines not to index Category Archives. Useful for avoiding duplicate content.", 'all_in_one_seo_pack' ),
|
195 |
+
"archive_date_noindex" => __( "Check this to ask search engines not to index Date Archives. Useful for avoiding duplicate content.", 'all_in_one_seo_pack' ),
|
196 |
+
"archive_author_noindex"=> __( "Check this to ask search engines not to index Author Archives. Useful for avoiding duplicate content.", 'all_in_one_seo_pack' ),
|
197 |
+
"tags_noindex" => __( "Check this to ask search engines not to index Tag Archives. Useful for avoiding duplicate content.", 'all_in_one_seo_pack' ),
|
198 |
+
"search_noindex" => __( "Check this to ask search engines not to index the Search page. Useful for avoiding duplicate content.", 'all_in_one_seo_pack' ),
|
199 |
+
"paginated_noindex" => __( "Check this to ask search engines not to index paginated pages/posts. Useful for avoiding duplicate content.", 'all_in_one_seo_pack' ),
|
200 |
+
"paginated_nofollow" => __( "Check this to ask search engines not to follow links from paginated pages/posts. Useful for avoiding duplicate content.", 'all_in_one_seo_pack' ),
|
201 |
'noodp' => __( 'Check this box to ask search engines not to use descriptions from the Open Directory Project for your entire site.', 'all_in_one_seo_pack' ),
|
202 |
+
'cpostnoodp' => __( "Set the default noodp setting for each Post Type.", 'all_in_one_seo_pack' ),
|
203 |
'noydir' => __( 'Check this box to ask Yahoo! not to use descriptions from the Yahoo! directory for your entire site.', 'all_in_one_seo_pack' ),
|
204 |
+
'cpostnoydir' => __( "Set the default noydir setting for each Post Type.", 'all_in_one_seo_pack' ),
|
205 |
+
"generate_descriptions" => __( "Check this and your Meta Descriptions will be auto-generated from your excerpt or content.", 'all_in_one_seo_pack' ),
|
206 |
+
"run_shortcodes" => __( "Check this and shortcodes will get executed for descriptions auto-generated from content.", 'all_in_one_seo_pack' ),
|
207 |
+
"hide_paginated_descriptions"=> __( "Check this and your Meta Descriptions will be removed from page 2 or later of paginated content.", 'all_in_one_seo_pack' ),
|
208 |
+
"dont_truncate_descriptions"=> __( "Check this to prevent your Description from being truncated regardless of its length.", 'all_in_one_seo_pack' ),
|
209 |
+
"schema_markup"=> __( "Check this to support Schema.org markup, i.e., itemprop on supported metadata.", 'all_in_one_seo_pack' ),
|
210 |
+
"unprotect_meta" => __( "Check this to unprotect internal postmeta fields for use with XMLRPC. If you don't know what that is, leave it unchecked.", 'all_in_one_seo_pack' ),
|
211 |
+
"ex_pages" => __( "Enter a comma separated list of pages here to be excluded by All in One SEO Pack. This is helpful when using plugins which generate their own non-WordPress dynamic pages. Ex: <em>/forum/, /contact/</em> For instance, if you want to exclude the virtual pages generated by a forum plugin, all you have to do is add forum or /forum or /forum/ or and any URL with the word \"forum\" in it, such as http://mysite.com/forum or http://mysite.com/forum/someforumpage here and it will be excluded from All in One SEO Pack.", 'all_in_one_seo_pack' ),
|
212 |
+
"post_meta_tags" => __( "What you enter here will be copied verbatim to the header of all Posts. You can enter whatever additional headers you want here, even references to stylesheets.", 'all_in_one_seo_pack' ),
|
213 |
+
"page_meta_tags" => __( "What you enter here will be copied verbatim to the header of all Pages. You can enter whatever additional headers you want here, even references to stylesheets.", 'all_in_one_seo_pack' ),
|
214 |
+
"front_meta_tags" => __( "What you enter here will be copied verbatim to the header of the front page if you have set a static page in Settings, Reading, Front Page Displays. You can enter whatever additional headers you want here, even references to stylesheets. This will fall back to using Additional Page Headers if you have them set and nothing is entered here.", 'all_in_one_seo_pack' ),
|
215 |
+
"home_meta_tags" => __( "What you enter here will be copied verbatim to the header of the home page if you have Front page displays your latest posts selected in Settings, Reading. It will also be copied verbatim to the header on the Posts page if you have one set in Settings, Reading. You can enter whatever additional headers you want here, even references to stylesheets.", 'all_in_one_seo_pack' ),
|
216 |
+
);
|
217 |
+
|
218 |
+
$this->help_anchors = Array(
|
219 |
+
'can' => '#canonical-urls',
|
220 |
+
'no_paged_canonical_links' => '#no-pagination-for-canonical-urls',
|
221 |
+
'customize_canonical_links' => '#enable-custom-canonical-urls',
|
222 |
+
'use_original_title' => '#use-original-title',
|
223 |
+
'schema_markup' => '#use-schema-markup',
|
224 |
+
'do_log' => '#log-important-events',
|
225 |
+
'home_title' => '#home-title',
|
226 |
+
'home_description' => '#home-description',
|
227 |
+
'home_keywords' => '#home-keywords',
|
228 |
+
'togglekeywords' => '#use-keywords',
|
229 |
+
'use_categories' => '#use-categories-for-meta-keywords',
|
230 |
+
'use_tags_as_keywords' => '#use-tags-for-meta-keywords',
|
231 |
+
'dynamic_postspage_keywords' => '#dynamically-generate-keywords-for-posts-page',
|
232 |
+
'rewrite_titles' => '#rewrite-titles',
|
233 |
+
'cap_titles' => '#capitalize-titles',
|
234 |
+
'page_title_format' => '#title-format-fields',
|
235 |
+
'post_title_format' => '#title-format-fields',
|
236 |
+
'category_title_format' => '#title-format-fields',
|
237 |
+
'archive_title_format' => '#title-format-fields',
|
238 |
+
'date_title_format' => '#title-format-fields',
|
239 |
+
'author_title_format' => '#title-format-fields',
|
240 |
+
'tag_title_format' => '#title-format-fields',
|
241 |
+
'search_title_format' => '#title-format-fields',
|
242 |
+
'404_title_format' => '#title-format-fields',
|
243 |
+
'enablecpost' => '#seo-for-custom-post-types',
|
244 |
+
'cpostadvanced' => '#enable-advanced-options',
|
245 |
+
'cpostactive' => '#seo-on-only-these-post-types',
|
246 |
+
'cposttitles' => '#custom-titles',
|
247 |
+
'posttypecolumns' => '#show-column-labels-for-custom-post-types',
|
248 |
+
'admin_bar' => '#display-menu-in-admin-bar',
|
249 |
+
'custom_menu_order' => '#display-menu-at-the-top',
|
250 |
+
'google_verify' => '',
|
251 |
+
'bing_verify' => '',
|
252 |
+
'pinterest_verify' => '',
|
253 |
+
'google_publisher' => '#google-plus-default-profile',
|
254 |
+
'google_disable_profile' => '#disable-google-plus-profile',
|
255 |
+
'google_author_advanced' => '#advanced-authorship-options',
|
256 |
+
'google_author_location' => '#display-google-authorship',
|
257 |
+
'google_enable_publisher' => '#display-publisher-meta-on-front-page',
|
258 |
+
'google_specify_publisher' => '#specify-publisher-url',
|
259 |
+
'google_analytics_id' => 'http://semperplugins.com/documentation/setting-up-google-analytics/',
|
260 |
+
'ga_use_universal_analytics' => '#use-universal-analytics',
|
261 |
+
'ga_domain' => '#tracking-domain',
|
262 |
+
'ga_multi_domain' => '#track-multiple-domains-additional-domains',
|
263 |
+
'ga_addl_domains' => '#track-multiple-domains-additional-domains',
|
264 |
+
'ga_anonymize_ip' => '#anonymize-ip-addresses',
|
265 |
+
'ga_display_advertising' => '#display-advertiser-tracking',
|
266 |
+
'ga_exclude_users' => '#exclude-users-from-tracking',
|
267 |
+
'ga_track_outbound_links' => '#track-outbound-links',
|
268 |
+
'ga_link_attribution' => '#enhanced-link-attribution',
|
269 |
+
'ga_enhanced_ecommerce' => '#enhanced-ecommerce',
|
270 |
+
'cpostnoindex' => '#use-noindex-for-paginated-pages-posts',
|
271 |
+
'cpostnofollow' => '#use-nofollow-for-paginated-pages-posts',
|
272 |
+
'noodp' => '#exclude-site-from-the-open-directory-project',
|
273 |
+
'noydir' => '#exclude-site-from-yahoo-directory',
|
274 |
+
'generate_descriptions' => '#autogenerate-descriptions',
|
275 |
+
'run_shortcodes' => '#run-shortcodes-in-autogenerated-descriptions',
|
276 |
+
'hide_paginated_descriptions' => '#remove-descriptions-for-paginated-pages',
|
277 |
+
'dont_truncate_descriptions' => '#never-shorten-long-descriptions',
|
278 |
+
'unprotect_meta' => '#unprotect-post-meta-fields',
|
279 |
+
'ex_pages' => '#exclude-pages',
|
280 |
+
'post_meta_tags' => '#additional-post-headers',
|
281 |
+
'page_meta_tags' => '#additional-page-headers',
|
282 |
+
'front_meta_tags' => '#additional-front-page-headers',
|
283 |
+
'home_meta_tags' => '#additional-blog-page-headers'
|
284 |
);
|
285 |
|
286 |
$meta_help_text = Array(
|
288 |
'title' => __( 'A custom title that shows up in the title tag for this page.', 'all_in_one_seo_pack' ),
|
289 |
'description' => __( 'The META description for this page. This will override any autogenerated descriptions.', 'all_in_one_seo_pack' ),
|
290 |
'keywords' => __( 'A comma separated list of your most important keywords for this page that will be written as META keywords.', 'all_in_one_seo_pack' ),
|
291 |
+
'custom_link' => __( "Override the canonical URLs for this post.", 'all_in_one_seo_pack'),
|
292 |
'noindex' => __( 'Check this box to ask search engines not to index this page.', 'all_in_one_seo_pack' ),
|
293 |
'nofollow' => __( 'Check this box to ask search engines not to follow links from this page.', 'all_in_one_seo_pack' ),
|
294 |
'noodp' => __( 'Check this box to ask search engines not to use descriptions from the Open Directory Project for this page.', 'all_in_one_seo_pack' ),
|
301 |
);
|
302 |
|
303 |
$this->default_options = array(
|
304 |
+
"donate" => Array(
|
305 |
+
'name' => __( 'I enjoy this plugin and have made a donation:', 'all_in_one_seo_pack' ) ),
|
306 |
"home_title"=> Array(
|
307 |
'name' => __( 'Home Title:', 'all_in_one_seo_pack' ),
|
308 |
'default' => null, 'type' => 'textarea', 'sanitize' => 'text' ),
|
323 |
"can"=> Array(
|
324 |
'name' => __( 'Canonical URLs:', 'all_in_one_seo_pack' ),
|
325 |
'default' => 1),
|
326 |
+
"no_paged_canonical_links"=> Array(
|
327 |
'name' => __( 'No Pagination for Canonical URLs:', 'all_in_one_seo_pack' ),
|
328 |
'default' => 0,
|
329 |
'condshow' => Array( "aiosp_can" => 'on' ) ),
|
330 |
+
"customize_canonical_links" => Array(
|
331 |
+
'name' => __( 'Enable Custom Canonical URLs:', 'all_in_one_seo_pack' ),
|
332 |
+
'default' => 0,
|
333 |
+
'condshow' => Array( "aiosp_can" => 'on' ) ),
|
334 |
+
"can_set_protocol" => Array(
|
335 |
+
'name' => __( 'Set Protocol For Canonical URLs:', 'all_in_one_seo_pack' ),
|
336 |
+
'type' => 'radio',
|
337 |
+
'default' => 'auto',
|
338 |
+
'initial_options' => Array( 'auto' => __( 'Auto', 'all_in_one_seo_pack' ),
|
339 |
+
'http' => __( 'HTTP', 'all_in_one_seo_pack' ),
|
340 |
+
'https' => __( 'HTTPS', 'all_in_one_seo_pack' ) ),
|
341 |
+
'condshow' => Array( "aiosp_can" => 'on' )
|
342 |
+
),
|
343 |
"rewrite_titles"=> Array(
|
344 |
'name' => __( 'Rewrite Titles:', 'all_in_one_seo_pack' ),
|
345 |
'default' => 1,
|
378 |
'name' => __( 'Category Title Format:', 'all_in_one_seo_pack' ),
|
379 |
'type' => 'text', 'default' => '%category_title% | %blog_title%',
|
380 |
'condshow' => Array( "aiosp_rewrite_titles" => 1 ) ),
|
381 |
+
"archive_title_format"=> Array(
|
382 |
'name' => __( 'Archive Title Format:', 'all_in_one_seo_pack' ),
|
383 |
'type' => 'text', 'default' => '%archive_title% | %blog_title%',
|
384 |
'condshow' => Array( "aiosp_rewrite_titles" => 1 ) ),
|
385 |
+
"date_title_format"=> Array(
|
386 |
'name' => __( 'Date Archive Title Format:', 'all_in_one_seo_pack' ),
|
387 |
'type' => 'text', 'default' => '%date% | %blog_title%',
|
388 |
'condshow' => Array( "aiosp_rewrite_titles" => 1 ) ),
|
440 |
'type' => 'multicheckbox', 'default' => array(),
|
441 |
'condshow' => Array( 'aiosp_enablecpost' => 'on', 'aiosp_cpostadvanced' => 'on' )
|
442 |
),
|
443 |
+
"cpostnoodp"=> Array(
|
444 |
+
'name' => __( 'Default to NOODP:', 'all_in_one_seo_pack' ),
|
445 |
+
'type' => 'multicheckbox', 'default' => array(),
|
446 |
+
'condshow' => Array( 'aiosp_enablecpost' => 'on', 'aiosp_cpostadvanced' => 'on' )
|
447 |
+
),
|
448 |
+
"cpostnoydir"=> Array(
|
449 |
+
'name' => __( 'Default to NOYDIR:', 'all_in_one_seo_pack' ),
|
450 |
+
'type' => 'multicheckbox', 'default' => array(),
|
451 |
+
'condshow' => Array( 'aiosp_enablecpost' => 'on', 'aiosp_cpostadvanced' => 'on' )
|
452 |
+
),
|
453 |
"cposttitles" => Array(
|
454 |
'name' => __( 'Custom titles:', 'all_in_one_seo_pack' ),
|
455 |
'type' => 'checkbox', 'default' => 0,
|
479 |
"google_disable_profile"=> Array(
|
480 |
'name' => __( 'Disable Google Plus Profile:', 'all_in_one_seo_pack' ), 'default' => 0, 'type' => 'checkbox'
|
481 |
),
|
482 |
+
"google_sitelinks_search" => Array(
|
483 |
+
'name' => __( 'Display Sitelinks Search Box:', 'all_in_one_seo_pack' )
|
484 |
+
),
|
485 |
"google_author_advanced" => Array(
|
486 |
'name' => __( 'Advanced Authorship Options:', 'all_in_one_seo_pack' ),
|
487 |
'default' => 0, 'type' => 'radio',
|
508 |
),
|
509 |
"google_analytics_id"=> Array(
|
510 |
'name' => __( 'Google Analytics ID:', 'all_in_one_seo_pack' ),
|
511 |
+
'default' => null, 'type' => 'text', 'placeholder' => 'UA-########-#' ),
|
512 |
"ga_use_universal_analytics" => Array(
|
513 |
'name' => __( 'Use Universal Analytics:', 'all_in_one_seo_pack' ),
|
514 |
'default' => 0,
|
515 |
'condshow' => Array( 'aiosp_google_analytics_id' => Array( 'lhs' => 'aiosp_google_analytics_id', 'op' => '!=', 'rhs' => '' ) ) ),
|
516 |
+
"ga_advanced_options"=> Array(
|
517 |
+
'name' => __( 'Advanced Analytics Options:', 'all_in_one_seo_pack' ),
|
518 |
+
'default' => 'on',
|
519 |
+
'type' => 'radio',
|
520 |
+
'initial_options' => Array( 'on' => __( 'Enabled', 'all_in_one_seo_pack' ),
|
521 |
+
0 => __( 'Disabled', 'all_in_one_seo_pack' ) ),
|
522 |
+
'condshow' => Array( 'aiosp_google_analytics_id' => Array( 'lhs' => 'aiosp_google_analytics_id', 'op' => '!=', 'rhs' => '' ) ) ),
|
523 |
"ga_domain"=> Array(
|
524 |
'name' => __( 'Tracking Domain:', 'all_in_one_seo_pack' ),
|
525 |
'type' => 'text',
|
526 |
+
'condshow' => Array( 'aiosp_google_analytics_id' => Array( 'lhs' => 'aiosp_google_analytics_id', 'op' => '!=', 'rhs' => '' ), 'aiosp_ga_advanced_options' => 'on') ),
|
527 |
"ga_multi_domain"=> Array(
|
528 |
'name' => __( 'Track Multiple Domains:', 'all_in_one_seo_pack' ),
|
529 |
'default' => 0,
|
530 |
+
'condshow' => Array( 'aiosp_google_analytics_id' => Array( 'lhs' => 'aiosp_google_analytics_id', 'op' => '!=', 'rhs' => '' ), 'aiosp_ga_advanced_options' => 'on' ) ),
|
531 |
+
"ga_addl_domains" => Array(
|
532 |
+
'name' => __( 'Additional Domains:', 'all_in_one_seo_pack' ),
|
533 |
+
'type' => 'textarea',
|
534 |
+
'condshow' => Array( 'aiosp_google_analytics_id' => Array( 'lhs' => 'aiosp_google_analytics_id', 'op' => '!=', 'rhs' => '' ), 'aiosp_ga_advanced_options' => 'on', 'aiosp_ga_multi_domain' => 'on' ) ),
|
535 |
"ga_anonymize_ip"=> Array(
|
536 |
'name' => __( 'Anonymize IP Addresses:', 'all_in_one_seo_pack' ),
|
537 |
'type' => 'checkbox',
|
538 |
+
'condshow' => Array( 'aiosp_google_analytics_id' => Array( 'lhs' => 'aiosp_google_analytics_id', 'op' => '!=', 'rhs' => '' ), 'aiosp_ga_advanced_options' => 'on' ) ),
|
539 |
"ga_display_advertising"=> Array(
|
540 |
+
'name' => __( 'Display Advertiser Tracking:', 'all_in_one_seo_pack' ),
|
541 |
'type' => 'checkbox',
|
542 |
+
'condshow' => Array( 'aiosp_google_analytics_id' => Array( 'lhs' => 'aiosp_google_analytics_id', 'op' => '!=', 'rhs' => '' ), 'aiosp_ga_advanced_options' => 'on' ) ),
|
543 |
"ga_exclude_users"=> Array(
|
544 |
'name' => __( 'Exclude Users From Tracking:', 'all_in_one_seo_pack' ),
|
545 |
'type' => 'multicheckbox',
|
546 |
+
'condshow' => Array( 'aiosp_google_analytics_id' => Array( 'lhs' => 'aiosp_google_analytics_id', 'op' => '!=', 'rhs' => '' ), 'aiosp_ga_advanced_options' => 'on' ) ),
|
547 |
"ga_track_outbound_links"=> Array(
|
548 |
'name' => __( 'Track Outbound Links:', 'all_in_one_seo_pack' ),
|
549 |
'default' => 0,
|
550 |
+
'condshow' => Array( 'aiosp_google_analytics_id' => Array( 'lhs' => 'aiosp_google_analytics_id', 'op' => '!=', 'rhs' => '' ), 'aiosp_ga_advanced_options' => 'on' ) ),
|
551 |
+
"ga_link_attribution"=> Array(
|
552 |
+
'name' => __( 'Enhanced Link Attribution:', 'all_in_one_seo_pack' ),
|
553 |
+
'default' => 0,
|
554 |
+
'condshow' => Array( 'aiosp_google_analytics_id' => Array( 'lhs' => 'aiosp_google_analytics_id', 'op' => '!=', 'rhs' => '' ), 'aiosp_ga_advanced_options' => 'on' ) ),
|
555 |
+
"ga_enhanced_ecommerce"=> Array(
|
556 |
+
'name' => __( 'Enhanced Ecommerce:', 'all_in_one_seo_pack' ),
|
557 |
+
'default' => 0,
|
558 |
+
'condshow' => Array( 'aiosp_google_analytics_id' => Array( 'lhs' => 'aiosp_google_analytics_id', 'op' => '!=', 'rhs' => '' ), 'aiosp_ga_use_universal_analytics' => 'on', 'aiosp_ga_advanced_options' => 'on' ) ),
|
559 |
"use_categories"=> Array(
|
560 |
'name' => __( 'Use Categories for META keywords:', 'all_in_one_seo_pack' ),
|
561 |
'default' => 0,
|
637 |
$this->locations = Array(
|
638 |
'default' => Array( 'name' => $this->name, 'prefix' => 'aiosp_', 'type' => 'settings', 'options' => null ),
|
639 |
'aiosp' => Array( 'name' => $this->plugin_name, 'type' => 'metabox', 'prefix' => '', 'help_link' => 'http://semperplugins.com/sections/postpage-settings/',
|
640 |
+
'options' => Array( 'edit', 'nonce-aioseop-edit', 'upgrade', 'snippet', 'title', 'description', 'keywords', 'custom_link', 'noindex', 'nofollow', 'noodp', 'noydir', 'titleatr', 'menulabel', 'sitemap_exclude', 'disable', 'disable_analytics' ),
|
641 |
'default_options' => Array(
|
642 |
'edit' => Array( 'type' => 'hidden', 'default' => 'aiosp_edit', 'prefix' => true, 'nowrap' => 1 ),
|
643 |
'nonce-aioseop-edit' => Array( 'type' => 'hidden', 'default' => null, 'prefix' => false, 'nowrap' => 1 ),
|
661 |
'title' => Array( 'name' => __( 'Title', 'all_in_one_seo_pack' ), 'type' => 'text', 'count' => true, 'size' => 60 ),
|
662 |
'description' => Array( 'name' => __( 'Description', 'all_in_one_seo_pack' ), 'type' => 'textarea', 'count' => true, 'cols' => 80, 'rows' => 2 ),
|
663 |
'keywords' => Array( 'name' => __( 'Keywords (comma separated)', 'all_in_one_seo_pack' ), 'type' => 'text' ),
|
664 |
+
'custom_link' => Array( 'name' => __( 'Custom Canonical URL', 'all_in_one_seo_pack' ), 'type' => 'text', 'size' => 60 ),
|
665 |
'noindex' => Array( 'name' => __( "Robots Meta NOINDEX", 'all_in_one_seo_pack' ), 'default' => '' ),
|
666 |
'nofollow' => Array( 'name' => __( "Robots Meta NOFOLLOW", 'all_in_one_seo_pack' ), 'default' => '' ),
|
667 |
'noodp' => Array( 'name' => __( "Robots Meta NOODP", 'all_in_one_seo_pack' ) ),
|
674 |
'display' => null )
|
675 |
);
|
676 |
|
|
|
|
|
|
|
|
|
677 |
if ( !empty( $meta_help_text ) )
|
678 |
foreach( $meta_help_text as $k => $v )
|
679 |
$this->locations['aiosp']['default_options'][$k]['help_text'] = $v;
|
718 |
'google' => Array(
|
719 |
'name' => __( 'Google Settings', 'all_in_one_seo_pack' ),
|
720 |
'help_link' => 'http://semperplugins.com/documentation/google-settings/',
|
721 |
+
'options' => Array( "google_publisher", "google_disable_profile", "google_sitelinks_search", "google_author_advanced", "google_author_location", "google_enable_publisher" , "google_specify_publisher",
|
722 |
+
"google_connect",
|
723 |
+
"google_analytics_id", "ga_use_universal_analytics", "ga_advanced_options", "ga_domain", "ga_multi_domain", "ga_addl_domains", "ga_anonymize_ip", "ga_display_advertising", "ga_exclude_users", "ga_track_outbound_links", "ga_link_attribution", "ga_enhanced_ecommerce" )
|
724 |
),
|
725 |
'noindex' => Array(
|
726 |
'name' => __( 'Noindex Settings', 'all_in_one_seo_pack' ),
|
727 |
'help_link' => 'http://semperplugins.com/documentation/noindex-settings/',
|
728 |
+
'options' => Array( 'cpostnoindex', 'cpostnofollow', 'cpostnoodp', 'cpostnoydir', 'category_noindex', 'archive_date_noindex', 'archive_author_noindex', 'tags_noindex', 'search_noindex', 'paginated_noindex', 'paginated_nofollow', 'noodp', 'noydir' )
|
729 |
),
|
730 |
'advanced' => Array(
|
731 |
'name' => __( 'Advanced Settings', 'all_in_one_seo_pack' ),
|
741 |
$this->layout['default']['options'] = array_diff( array_keys( $this->default_options ), $other_options );
|
742 |
|
743 |
if ( is_admin() ) {
|
744 |
+
$this->add_help_text_links();
|
745 |
add_action( "aioseop_global_settings_header", Array( $this, 'display_right_sidebar' ) );
|
746 |
add_action( "aioseop_global_settings_footer", Array( $this, 'display_settings_footer' ) );
|
747 |
add_action( "output_option", Array( $this, 'custom_output_option' ), 10, 2 );
|
748 |
}
|
749 |
}
|
750 |
|
751 |
+
function get_page_snippet_info() {
|
752 |
+
static $info = Array();
|
753 |
+
if ( !empty( $info ) )
|
754 |
+
return $info;
|
755 |
+
global $post, $aioseop_options, $wp_query;
|
756 |
+
$title = $url = $description = $term = '';
|
757 |
+
$p = $post; $w = $wp_query;
|
758 |
+
if ( !is_object( $post ) ) $post = $this->get_queried_object();
|
759 |
+
if ( empty( $this->meta_opts ) )
|
760 |
+
$this->meta_opts = $this->get_current_options( Array(), 'aiosp' );
|
761 |
+
if ( !is_object( $post ) && is_admin() && !empty( $_GET ) && !empty( $_GET['post_type'] ) && !empty( $_GET['taxonomy'] ) && !empty( $_GET['tag_ID'] ) ) {
|
762 |
+
$term = get_term_by( 'id', $_GET['tag_ID'], $_GET['taxonomy'] );
|
763 |
+
}
|
764 |
+
if ( is_object( $post ) ) {
|
765 |
+
$opts = $this->meta_opts;
|
766 |
+
$post_id = $p->ID;
|
767 |
+
if (! $post->post_modified_gmt != '' )
|
768 |
+
$wp_query = new WP_Query( array( 'p' => $post_id, 'post_type' => $post->post_type ) );
|
769 |
+
if ( $post->post_type == 'page' )
|
770 |
+
$wp_query->is_page = true;
|
771 |
+
elseif ( $post->post_type == 'attachment' )
|
772 |
+
$wp_query->is_attachment = true;
|
773 |
+
else
|
774 |
+
$wp_query->is_single = true;
|
775 |
+
if ( empty( $wp_query->is_front_page ) ) $wp_query->is_front_page = false;
|
776 |
+
if ( get_option( 'show_on_front' ) == 'page' ) {
|
777 |
+
if ( is_page() && $post->ID == get_option( 'page_on_front' ) )
|
778 |
+
$wp_query->is_front_page = true;
|
779 |
+
elseif ( $post->ID == get_option( 'page_for_posts' ) )
|
780 |
+
$wp_query->is_home = true;
|
781 |
+
}
|
782 |
+
$wp_query->queried_object = $post;
|
783 |
+
if ( !empty( $post ) && !$wp_query->is_home && !$wp_query->is_front_page ) {
|
784 |
+
$title = $this->internationalize( get_post_meta( $post->ID, "_aioseop_title", true ) );
|
785 |
+
if ( empty( $title ) ) $title = $post->post_title;
|
786 |
+
}
|
787 |
+
$title_format = '';
|
788 |
+
if ( empty( $title ) ) {
|
789 |
+
$title = $this->wp_title();
|
790 |
+
}
|
791 |
+
$description = $this->get_main_description( $post );
|
792 |
+
if ( empty( $title_format ) ) {
|
793 |
+
if ( is_page() )
|
794 |
+
$title_format = $aioseop_options['aiosp_page_title_format'];
|
795 |
+
elseif ( is_single() || is_attachment() )
|
796 |
+
$title_format = $this->get_post_title_format();
|
797 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
798 |
if ( empty( $title_format ) ) {
|
799 |
+
$title_format = '%post_title%';
|
800 |
+
}
|
801 |
+
} else if ( is_object( $term ) ) {
|
802 |
+
if ( $_GET['taxonomy'] == 'category' ) {
|
803 |
+
query_posts( Array( 'cat' => $_GET['tag_ID'] ) );
|
804 |
+
} else if ( $_GET['taxonomy'] == 'post_tag' ) {
|
805 |
+
query_posts( Array( 'tag' => $term->slug ) );
|
806 |
} else {
|
807 |
+
query_posts( Array( 'page' => '', $_GET['taxonomy'] => $term->slug, 'post_type' => $_GET['post_type'] ) );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
808 |
}
|
809 |
+
if ( empty( $this->meta_opts ) )
|
810 |
+
$this->meta_opts = $this->get_current_options( Array(), 'aiosp' );
|
811 |
+
$title = $this->get_tax_name( $_GET['taxonomy'] );
|
812 |
+
$title_format = $this->get_tax_title_format();
|
813 |
+
$opts = $this->meta_opts;
|
814 |
+
if ( !empty( $opts ) ) $description = $opts['aiosp_description'];
|
815 |
+
if ( empty( $description ) ) $description = term_description();
|
816 |
+
$description = $this->internationalize( $description );
|
817 |
+
}
|
818 |
+
|
819 |
+
$show_page = true;
|
820 |
+
if ( !empty( $aioseop_options["aiosp_no_paged_canonical_links"] ) ) $show_page = false;
|
821 |
+
if ( $aioseop_options['aiosp_can'] ) {
|
822 |
+
if ( !empty( $aioseop_options['aiosp_customize_canonical_links'] ) && !empty( $opts['aiosp_custom_link'] ) ) $url = $opts['aiosp_custom_link'];
|
823 |
+
if ( empty( $url ) )
|
824 |
+
$url = $this->aiosp_mrt_get_url( $wp_query, $show_page );
|
825 |
+
$url = apply_filters( 'aioseop_canonical_url', $url );
|
826 |
+
}
|
827 |
+
if ( !$url ) $url = get_permalink();
|
828 |
+
|
829 |
+
$title = $this->apply_cf_fields( $title );
|
830 |
+
$description = $this->apply_cf_fields( $description );
|
831 |
+
$description = apply_filters( 'aioseop_description', $description );
|
832 |
+
|
833 |
+
$keywords = $this->get_main_keywords();
|
834 |
+
$keywords = $this->apply_cf_fields( $keywords );
|
835 |
+
$keywords = apply_filters( 'aioseop_keywords', $keywords );
|
836 |
+
|
837 |
+
wp_reset_postdata();
|
838 |
+
$wp_query = $w; $post = $p;
|
839 |
+
$info = Array( 'title' => $title, 'description' => $description, 'keywords' => $keywords, 'url' => $url, 'title_format' => $title_format );
|
840 |
+
return $info;
|
841 |
+
}
|
842 |
+
|
843 |
+
/*** Use custom callback for outputting snippet ***/
|
844 |
+
function custom_output_option( $buf, $args ) {
|
845 |
+
if ( $args['name'] == 'aiosp_snippet' ) {
|
846 |
+
$args['options']['type'] = 'html';
|
847 |
+
$args['options']['nowrap'] = false;
|
848 |
+
$args['options']['save'] = false;
|
849 |
+
$info = $this->get_page_snippet_info();
|
850 |
+
extract( $info );
|
851 |
+
} else return '';
|
852 |
+
|
853 |
+
if ( $this->strlen( $title ) > 70 ) $title = $this->trim_excerpt_without_filters( $title, 70 ) . '...';
|
854 |
+
if ( $this->strlen( $description ) > 156 ) $description = $this->trim_excerpt_without_filters( $description, 156 ) . '...';
|
855 |
+
$extra_title_len = 0;
|
856 |
+
if ( empty( $title_format ) ) {
|
857 |
+
$title = '<span id="aioseop_snippet_title">' . esc_attr( wp_strip_all_tags( $title ) ) . '</span>';
|
858 |
+
} else {
|
859 |
+
if ( strpos( $title_format, '%blog_title%' ) !== false ) $title_format = str_replace( '%blog_title%', get_bloginfo( 'name' ), $title_format );
|
860 |
+
$title_format = $this->apply_cf_fields( $title_format );
|
861 |
+
$replace_title = '<span id="aioseop_snippet_title">' . esc_attr( wp_strip_all_tags( $title ) ) . '</span>';
|
862 |
+
if ( strpos( $title_format, '%post_title%' ) !== false ) $title_format = str_replace( '%post_title%', $replace_title, $title_format );
|
863 |
+
if ( strpos( $title_format, '%page_title%' ) !== false ) $title_format = str_replace( '%page_title%', $replace_title, $title_format );
|
864 |
+
if ( strpos( $title_format, '%category_title%' ) !== false ) $title_format = str_replace( '%category_title%', $replace_title, $title_format );
|
865 |
+
if ( strpos( $title_format, '%taxonomy_title%' ) !== false ) $title_format = str_replace( '%taxonomy_title%', $replace_title, $title_format );
|
866 |
+
if ( strpos( $title_format, '%taxonomy_description%' ) !== false ) $title_format = str_replace( '%taxonomy_description%', $description, $title_format );
|
867 |
|
868 |
+
$title_format = preg_replace( '/%([^%]*?)%/', '', $title_format );
|
869 |
+
$title = $title_format;
|
870 |
+
$extra_title_len = strlen( str_replace( $replace_title, '', $title_format ) );
|
|
|
871 |
}
|
872 |
+
|
873 |
+
$args['value'] = sprintf( $args['value'], $title, esc_url( $url ), esc_attr( wp_strip_all_tags( $description ) ) );
|
874 |
+
$extra_title_len = (int)$extra_title_len;
|
875 |
+
$args['value'] .= "<script>var aiosp_title_extra = {$extra_title_len};</script>";
|
876 |
+
$buf = $this->get_option_row( $args['name'], $args['options'], $args );
|
877 |
+
|
878 |
return $buf;
|
879 |
}
|
880 |
|
1003 |
$this->default_options["cpostactive"]['initial_options'] = $post_types;
|
1004 |
$this->default_options["cpostnoindex"]['initial_options'] = $post_types;
|
1005 |
$this->default_options["cpostnofollow"]['initial_options'] = $post_types;
|
1006 |
+
$this->default_options["cpostnoodp"]['initial_options'] = $post_types;
|
1007 |
+
$this->default_options["cpostnoydir"]['initial_options'] = $post_types;
|
1008 |
$this->default_options["google_author_location"]['initial_options'] = $post_types;
|
1009 |
$this->default_options['google_author_location' ]['initial_options'] = array_merge( Array( 'front' => __( 'Front Page', 'all_in_one_seo_pack' ) ), $post_types, Array( 'all' => __( 'Everywhere Else', 'all_in_one_seo_pack' ) ) );
|
1010 |
$this->default_options["google_author_location"]['default'] = array_keys( $this->default_options["google_author_location"]['initial_options'] );
|
1015 |
if ( !isset( $this->default_options[$field] ) ) {
|
1016 |
$this->default_options[$field] = Array (
|
1017 |
'name' => "$name " . __( 'Title Format:', 'all_in_one_seo_pack' ) . "<br />($p)",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1018 |
'type' => 'text',
|
1019 |
'default' => '%post_title% | %blog_title%',
|
1020 |
'condshow' => Array( 'aiosp_rewrite_titles' => 1, 'aiosp_enablecpost' => 'on', 'aiosp_cpostadvanced' => 'on', 'aiosp_cposttitles' => 'on', 'aiosp_cpostactive\[\]' => $p )
|
1021 |
);
|
1022 |
+
$this->help_text[$field] = __( 'The following macros are supported:', 'all_in_one_seo_pack' )
|
1023 |
+
. '<ul><li>' . __( '%blog_title% - Your blog title', 'all_in_one_seo_pack' ) . '</li><li>' .
|
1024 |
+
__( '%blog_description% - Your blog description', 'all_in_one_seo_pack' ) . '</li><li>' .
|
1025 |
+
__( '%post_title% - The original title of the post', 'all_in_one_seo_pack' ) . '</li><li>' .
|
1026 |
+
__( '%category_title% - The (main) category of the post', 'all_in_one_seo_pack' ) . '</li><li>' .
|
1027 |
+
__( '%category% - Alias for %category_title%', 'all_in_one_seo_pack' ) . '</li><li>' .
|
1028 |
+
__( "%post_author_login% - This post's author' login", 'all_in_one_seo_pack' ) . '</li><li>' .
|
1029 |
+
__( "%post_author_nicename% - This post's author' nicename", 'all_in_one_seo_pack' ) . '</li><li>' .
|
1030 |
+
__( "%post_author_firstname% - This post's author' first name (capitalized)", 'all_in_one_seo_pack' ) . '</li><li>' .
|
1031 |
+
__( "%post_author_lastname% - This post's author' last name (capitalized)", 'all_in_one_seo_pack' ) . '</li>' .
|
1032 |
+
'</ul>';
|
1033 |
+
$this->help_anchors[$field] = '#custom-titles';
|
1034 |
$this->layout['cpt']['options'][] = $field;
|
1035 |
}
|
1036 |
}
|
1043 |
$this->default_options["ga_exclude_users"]['initial_options'] = $role_names;
|
1044 |
|
1045 |
$this->setting_options();
|
1046 |
+
$this->add_help_text_links();
|
1047 |
add_filter( "{$this->prefix}display_options", Array( $this, 'filter_options' ), 10, 2 );
|
1048 |
parent::add_page_hooks();
|
1049 |
}
|
1105 |
if ( is_object( $post_id ) )
|
1106 |
$post_id = $post_id->ID;
|
1107 |
$get_opts = $this->default_options( $location );
|
1108 |
+
$optlist = Array( 'keywords', 'description', 'title', 'custom_link', 'sitemap_exclude', 'disable', 'disable_analytics', 'noindex', 'nofollow', 'noodp', 'noydir', 'titleatr', 'menulabel' );
|
1109 |
+
if ( !( !empty( $this->options['aiosp_can'] ) ) && ( !empty( $this->options['aiosp_customize_canonical_links'] ) ) ) {
|
1110 |
+
unset( $optlist["custom_link"] );
|
1111 |
+
}
|
1112 |
+
foreach ( $optlist as $f ) {
|
1113 |
$field = "aiosp_$f";
|
1114 |
$meta = get_post_meta( $post_id, '_aioseop_' . $f, true );
|
1115 |
$get_opts[$field] = htmlspecialchars( stripslashes( $meta ) );
|
1145 |
$settings["{$prefix}nofollow"]['type'] = 'select';
|
1146 |
$settings["{$prefix}nofollow"]['initial_options'] = Array( '' => __( 'Default - nofollow', 'all_in_one_seo_pack' ), 'off' => __( 'follow', 'all_in_one_seo_pack' ), 'on' => __( 'nofollow', 'all_in_one_seo_pack' ) );
|
1147 |
}
|
1148 |
+
if ( !empty( $this->options['aiosp_cpostnoodp'] ) && ( in_array( $post_type, $this->options['aiosp_cpostnoodp'] ) ) ) {
|
1149 |
+
$settings["{$prefix}noodp"]['type'] = 'select';
|
1150 |
+
$settings["{$prefix}noodp"]['initial_options'] = Array( '' => __( 'Default - noodp', 'all_in_one_seo_pack' ), 'off' => __( 'odp', 'all_in_one_seo_pack' ), 'on' => __( 'noodp', 'all_in_one_seo_pack' ) );
|
1151 |
+
}
|
1152 |
+
if ( !empty( $this->options['aiosp_cpostnoydir'] ) && ( in_array( $post_type, $this->options['aiosp_cpostnoydir'] ) ) ) {
|
1153 |
+
$settings["{$prefix}noydir"]['type'] = 'select';
|
1154 |
+
$settings["{$prefix}noydir"]['initial_options'] = Array( '' => __( 'Default - noydir', 'all_in_one_seo_pack' ), 'off' => __( 'ydir', 'all_in_one_seo_pack' ), 'on' => __( 'noydir', 'all_in_one_seo_pack' ) );
|
1155 |
+
}
|
1156 |
+
global $post;
|
1157 |
+
$info = $this->get_page_snippet_info();
|
1158 |
+
extract( $info );
|
1159 |
+
$settings["{$prefix}title"]['placeholder'] = $title;
|
1160 |
+
$settings["{$prefix}description"]['placeholder'] = $description;
|
1161 |
+
$settings["{$prefix}keywords"]['placeholder'] = $keywords;
|
1162 |
}
|
1163 |
|
1164 |
if ( !current_user_can( 'update_plugins' ) )
|
1178 |
} elseif ( !empty( $current["{$prefix}togglekeywords"] ) ) {
|
1179 |
unset( $settings["{$prefix}keywords"] );
|
1180 |
}
|
1181 |
+
if ( !( !empty( $this->options['aiosp_can'] ) ) && ( !empty( $this->options['aiosp_customize_canonical_links'] ) ) ) {
|
1182 |
+
unset( $settings["{$prefix}custom_link"] );
|
1183 |
+
}
|
1184 |
}
|
1185 |
return $settings;
|
1186 |
}
|
1191 |
if ( !empty( $post ) ) {
|
1192 |
$prefix = $this->prefix;
|
1193 |
$post_type = get_post_type( $post );
|
1194 |
+
foreach( Array( 'noindex', 'nofollow', 'noodp', 'noydir' ) as $no ) {
|
1195 |
+
if ( empty( $this->options['aiosp_cpost' . $no] ) || ( !in_array( $post_type, $this->options['aiosp_cpost' . $no] ) ) )
|
1196 |
+
if ( isset( $options["{$prefix}{$no}"] ) && ( $options["{$prefix}{$no}"] != 'on' ) )
|
1197 |
+
unset( $options["{$prefix}{$no}"] );
|
1198 |
+
}
|
|
|
1199 |
}
|
1200 |
}
|
1201 |
if ( $location == null ) {
|
1206 |
$options["{$prefix}enablecpost"] = 0;
|
1207 |
if ( ( isset( $options["{$prefix}use_original_title"] ) ) && ( $options["{$prefix}use_original_title"] === '' ) )
|
1208 |
$options["{$prefix}use_original_title"] = 0;
|
|
|
|
|
1209 |
}
|
1210 |
return $options;
|
1211 |
}
|
1217 |
?><div class="aioseop_metabox_text">
|
1218 |
<p><h2 style="display:inline;"><?php echo AIOSEOP_PLUGIN_NAME; ?></h2> by Michael Torbert of <a target="_blank" title="Semper Fi Web Design"
|
1219 |
href="http://semperfiwebdesign.com/">Semper Fi Web Design</a>.</p>
|
1220 |
+
<?php
|
1221 |
+
global $current_user;
|
1222 |
+
$user_id = $current_user->ID;
|
1223 |
+
$ignore = get_user_meta( $user_id, 'aioseop_ignore_notice' );
|
1224 |
+
if ( !empty( $ignore ) ) {
|
1225 |
+
$qa = Array();
|
1226 |
+
wp_parse_str( $_SERVER["QUERY_STRING"], $qa );
|
1227 |
+
$qa['aioseop_reset_notices'] = 1;
|
1228 |
+
$url = '?' . build_query( $qa );
|
1229 |
+
echo '<p><a href="' . $url . '">' . __( "Reset Dismissed Notices", 'all_in_one_seo_pack' ) . '</a></p>';
|
1230 |
+
}
|
1231 |
+
?>
|
1232 |
<p>
|
1233 |
+
<strong><a target="_blank" title="<?php _e('Pro Version', 'all_in_one_seo_pack' ); ?>"
|
|
|
|
|
|
|
|
|
1234 |
href="http://semperplugins.com/plugins/all-in-one-seo-pack-pro-version/?loc=side">
|
1235 |
<?php _e('UPGRADE TO PRO VERSION', 'all_in_one_seo_pack' ); ?></a></strong></p>
|
1236 |
</div>
|
1274 |
break;
|
1275 |
case "aioseop-support":
|
1276 |
?><div class="aioseop_metabox_text">
|
1277 |
+
<p><div class="aioseop_icon aioseop_file_icon"></div><a target="_blank" href="http://semperplugins.com/documentation/"><?php _e( 'Read the All in One SEO Pack user guide', 'all_in_one_seo_pack' ); ?></a></p>
|
1278 |
+
<p><div class="aioseop_icon aioseop_support_icon"></div><a target="_blank" title="<?php _e( 'All in One SEO Pro Plugin Support Forum', 'all_in_one_seo_pack' ); ?>"
|
1279 |
+
href="http://semperplugins.com/support/"><?php _e( 'Access our Premium Support Forums', 'all_in_one_seo_pack' ); ?></a></p>
|
1280 |
+
<p><div class="aioseop_icon aioseop_cog_icon"></div><a target="_blank" title="<?php _e( 'All in One SEO Pro Plugin Changelog', 'all_in_one_seo_pack' ); ?>"
|
1281 |
+
href="http://semperfiwebdesign.com/blog/all-in-one-seo-pack/all-in-one-seo-pack-release-history/"><?php _e( 'View the Changelog', 'all_in_one_seo_pack' ); ?></a></p>
|
1282 |
+
<p><div class="aioseop_icon aioseop_youtube_icon"></div><a target="_blank" href="http://semperplugins.com/doc-type/video/"><?php _e( 'Watch video tutorials', 'all_in_one_seo_pack' ); ?></a></p>
|
1283 |
+
<p><div class="aioseop_icon aioseop_book_icon"></div><a target="_blank" href="http://semperplugins.com/documentation/quick-start-guide/"><?php _e( 'Getting started? Read the Beginners Guide', 'all_in_one_seo_pack' ); ?></a></p>
|
1284 |
</div>
|
1285 |
<?php
|
1286 |
break;
|
1309 |
$post_type = '';
|
1310 |
if ( !empty( $post ) && !empty( $post->post_type ) )
|
1311 |
$post_type = $post->post_type;
|
1312 |
+
if ( empty( $aioseop_options['aiosp_enablecpost'] ) ) {
|
1313 |
$wp_post_types = get_post_types( Array( '_builtin' => true ) ); // don't display meta if SEO isn't enabled on custom post types -- pdb
|
1314 |
if( is_singular() && !in_array( $post_type, $wp_post_types ) && !is_front_page() ) return false;
|
1315 |
} elseif ( !empty( $aioseop_options['aiosp_cpostadvanced'] ) ) {
|
1382 |
add_action( 'admin_menu', array( $this, 'admin_menu' ) );
|
1383 |
add_action( 'admin_head', array( $this, 'add_page_icon' ) );
|
1384 |
add_action( 'admin_init', 'aioseop_addmycolumns', 1 );
|
1385 |
+
add_action( 'admin_init', 'aioseop_handle_ignore_notice' );
|
1386 |
} else {
|
1387 |
if ( $aioseop_options['aiosp_can'] == '1' || $aioseop_options['aiosp_can'] == 'on' )
|
1388 |
remove_action( 'wp_head', 'rel_canonical' );
|
1412 |
$is_posts_page = ( get_option( 'show_on_front' ) == 'page' && is_home() && $post->ID == get_option( 'page_for_posts' ) );
|
1413 |
return $is_posts_page;
|
1414 |
}
|
1415 |
+
|
1416 |
+
function check_rewrite_handler() {
|
1417 |
+
global $aioseop_options;
|
1418 |
+
|
1419 |
+
$force_rewrites = 1;
|
1420 |
+
if ( isset( $aioseop_options['aiosp_force_rewrites'] ) )
|
1421 |
+
$force_rewrites = $aioseop_options['aiosp_force_rewrites'];
|
1422 |
+
|
1423 |
+
if ( !empty( $aioseop_options['aiosp_rewrite_titles'] ) && $force_rewrites ) {
|
1424 |
+
// make the title rewrite as short as possible
|
1425 |
+
if (function_exists( 'ob_list_handlers' ) ) {
|
1426 |
+
$active_handlers = ob_list_handlers();
|
1427 |
+
} else {
|
1428 |
+
$active_handlers = array();
|
1429 |
+
}
|
1430 |
+
if (sizeof($active_handlers) > 0 &&
|
1431 |
+
$this->strtolower( $active_handlers[sizeof( $active_handlers ) - 1] ) ==
|
1432 |
+
$this->strtolower( 'All_in_One_SEO_Pack::output_callback_for_title' ) ) {
|
1433 |
+
ob_end_flush();
|
1434 |
+
} else {
|
1435 |
+
$this->log( "another plugin interfering?" );
|
1436 |
+
// if we get here there *could* be trouble with another plugin :(
|
1437 |
+
$this->ob_start_detected = true;
|
1438 |
+
if ( function_exists( 'ob_list_handlers' ) ) {
|
1439 |
+
foreach ( ob_list_handlers() as $handler ) {
|
1440 |
+
$this->log( "detected output handler $handler" );
|
1441 |
+
}
|
1442 |
+
}
|
1443 |
+
}
|
1444 |
+
}
|
1445 |
+
}
|
1446 |
+
|
1447 |
+
// handle prev / next links
|
1448 |
+
function get_prev_next_links( $post = null ) {
|
1449 |
+
$prev = $next = '';
|
1450 |
+
$page = $this->get_page_number();
|
1451 |
+
if ( is_home() || is_archive() || is_paged() ) {
|
1452 |
+
global $wp_query;
|
1453 |
+
$max_page = $wp_query->max_num_pages;
|
1454 |
+
if ( $page > 1 )
|
1455 |
+
$prev = get_previous_posts_page_link();
|
1456 |
+
if ( $page < $max_page ) {
|
1457 |
+
$paged = $GLOBALS['paged'];
|
1458 |
+
if ( !is_single() ) {
|
1459 |
+
if ( !$paged )
|
1460 |
+
$paged = 1;
|
1461 |
+
$nextpage = intval($paged) + 1;
|
1462 |
+
if ( !$max_page || $max_page >= $nextpage )
|
1463 |
+
$next = get_pagenum_link($nextpage);
|
1464 |
+
}
|
1465 |
+
}
|
1466 |
+
} else if ( is_page() || is_single() ) {
|
1467 |
+
$numpages = 1;
|
1468 |
+
$multipage = 0;
|
1469 |
+
$page = get_query_var('page');
|
1470 |
+
if ( ! $page )
|
1471 |
+
$page = 1;
|
1472 |
+
if ( is_single() || is_page() || is_feed() )
|
1473 |
+
$more = 1;
|
1474 |
+
$content = $post->post_content;
|
1475 |
+
if ( false !== strpos( $content, '<!--nextpage-->' ) ) {
|
1476 |
+
if ( $page > 1 )
|
1477 |
+
$more = 1;
|
1478 |
+
$content = str_replace( "\n<!--nextpage-->\n", '<!--nextpage-->', $content );
|
1479 |
+
$content = str_replace( "\n<!--nextpage-->", '<!--nextpage-->', $content );
|
1480 |
+
$content = str_replace( "<!--nextpage-->\n", '<!--nextpage-->', $content );
|
1481 |
+
// Ignore nextpage at the beginning of the content.
|
1482 |
+
if ( 0 === strpos( $content, '<!--nextpage-->' ) )
|
1483 |
+
$content = substr( $content, 15 );
|
1484 |
+
$pages = explode('<!--nextpage-->', $content);
|
1485 |
+
$numpages = count($pages);
|
1486 |
+
if ( $numpages > 1 )
|
1487 |
+
$multipage = 1;
|
1488 |
+
}
|
1489 |
+
if ( !empty( $page ) ) {
|
1490 |
+
if ( $page > 1 )
|
1491 |
+
$prev = _wp_link_page( $page - 1 );
|
1492 |
+
if ( $page + 1 <= $numpages )
|
1493 |
+
$next = _wp_link_page( $page + 1 );
|
1494 |
+
}
|
1495 |
+
if ( !empty( $prev ) ) {
|
1496 |
+
$prev = $this->substr( $prev, 9, -2 );
|
1497 |
+
}
|
1498 |
+
if ( !empty( $next ) ) {
|
1499 |
+
$next = $this->substr( $next, 9, -2 );
|
1500 |
+
}
|
1501 |
+
}
|
1502 |
+
return Array( 'prev' => $prev, 'next' => $next );
|
1503 |
+
}
|
1504 |
+
|
1505 |
+
function get_google_authorship( $post ) {
|
1506 |
+
global $aioseop_options;
|
1507 |
+
$page = $this->get_page_number();
|
1508 |
+
// handle authorship
|
1509 |
+
$googleplus = $publisher = $author = '';
|
1510 |
+
|
1511 |
+
if ( !empty( $post ) && isset( $post->post_author ) && empty( $aioseop_options['aiosp_google_disable_profile'] ) )
|
1512 |
+
$googleplus = get_the_author_meta( 'googleplus', $post->post_author );
|
1513 |
+
|
1514 |
+
if ( empty( $googleplus ) && !empty( $aioseop_options['aiosp_google_publisher'] ) )
|
1515 |
+
$googleplus = $aioseop_options['aiosp_google_publisher'];
|
1516 |
+
|
1517 |
+
if ( ( is_front_page() ) && ( $page < 2 ) ) {
|
1518 |
+
if ( !empty( $aioseop_options['aiosp_google_publisher'] ) )
|
1519 |
+
$publisher = $aioseop_options['aiosp_google_publisher'];
|
1520 |
+
|
1521 |
+
if ( !empty( $aioseop_options["aiosp_google_author_advanced"] ) ) {
|
1522 |
+
if ( empty( $aioseop_options["aiosp_google_enable_publisher"] ) ) {
|
1523 |
+
$publisher = '';
|
1524 |
+
} elseif ( !empty( $aioseop_options["aiosp_google_specify_publisher"] ) ) {
|
1525 |
+
$publisher = $aioseop_options["aiosp_google_specify_publisher"];
|
1526 |
+
}
|
1527 |
+
}
|
1528 |
+
}
|
1529 |
+
if ( is_singular() && ( !empty( $googleplus ) ) )
|
1530 |
+
$author = $googleplus;
|
1531 |
+
else if ( !empty( $aioseop_options['aiosp_google_publisher'] ) )
|
1532 |
+
$author = $aioseop_options['aiosp_google_publisher'];
|
1533 |
+
|
1534 |
+
if ( !empty( $aioseop_options['aiosp_google_author_advanced'] ) && isset( $aioseop_options['aiosp_google_author_location'] ) ) {
|
1535 |
+
if ( is_front_page() && !in_array( 'front', $aioseop_options['aiosp_google_author_location'] ) ) {
|
1536 |
+
$author = '';
|
1537 |
+
} else {
|
1538 |
+
if ( in_array( 'all', $aioseop_options['aiosp_google_author_location'] ) ) {
|
1539 |
+
if ( is_singular() && !is_singular( $aioseop_options['aiosp_google_author_location'] ) )
|
1540 |
+
$author = '';
|
1541 |
+
} else {
|
1542 |
+
if ( !is_singular( $aioseop_options['aiosp_google_author_location'] ) )
|
1543 |
+
$author = '';
|
1544 |
+
}
|
1545 |
+
}
|
1546 |
+
}
|
1547 |
+
|
1548 |
+
return Array( 'publisher' => $publisher, 'author' => $author );
|
1549 |
+
}
|
1550 |
+
|
1551 |
+
function get_robots_meta() {
|
1552 |
+
global $aioseop_options;
|
1553 |
+
$opts = $this->meta_opts;
|
1554 |
+
$page = $this->get_page_number();
|
1555 |
+
$robots_meta = '';
|
1556 |
+
|
1557 |
+
$aiosp_noindex = $aiosp_nofollow = $aiosp_noodp = $aiosp_noydir = '';
|
1558 |
+
$noindex = "index";
|
1559 |
+
$nofollow = "follow";
|
1560 |
+
if ( ( is_category() && !empty( $aioseop_options['aiosp_category_noindex'] ) ) || ( !is_category() && is_archive() && !is_tag() && !is_tax()
|
1561 |
+
&& ( ( is_date() && !empty( $aioseop_options['aiosp_archive_date_noindex'] ) ) || ( is_author() && !empty( $aioseop_options['aiosp_archive_author_noindex'] ) ) ) )
|
1562 |
+
|| ( is_tag() && !empty( $aioseop_options['aiosp_tags_noindex'] ) ) || ( is_search() && !empty( $aioseop_options['aiosp_search_noindex'] ) ) ) {
|
1563 |
+
$noindex = 'noindex';
|
1564 |
+
} elseif ( ( is_single() || is_page() || $this->is_static_posts_page() || is_attachment() || ( $page > 1 ) ) ) {
|
1565 |
+
$post_type = get_post_type();
|
1566 |
+
if ( !empty( $opts ) ) {
|
1567 |
+
$aiosp_noindex = htmlspecialchars( stripslashes( $opts['aiosp_noindex'] ) );
|
1568 |
+
$aiosp_nofollow = htmlspecialchars( stripslashes( $opts['aiosp_nofollow'] ) );
|
1569 |
+
$aiosp_noodp = htmlspecialchars( stripslashes( $opts['aiosp_noodp'] ) );
|
1570 |
+
$aiosp_noydir = htmlspecialchars( stripslashes( $opts['aiosp_noydir'] ) );
|
1571 |
+
}
|
1572 |
+
if ( $aiosp_noindex || $aiosp_nofollow || $aiosp_noodp || $aiosp_noydir || !empty( $aioseop_options['aiosp_cpostnoindex'] )
|
1573 |
+
|| !empty( $aioseop_options['aiosp_cpostnofollow'] ) || !empty( $aioseop_options['aiosp_cpostnoodp'] ) || !empty( $aioseop_options['aiosp_cpostnoydir'] )
|
1574 |
+
|| !empty( $aioseop_options['aiosp_paginated_noindex'] ) || !empty( $aioseop_options['aiosp_paginated_nofollow'] ) ) {
|
1575 |
+
if ( ( $aiosp_noindex == 'on' ) || ( ( !empty( $aioseop_options['aiosp_paginated_noindex'] ) ) && ( ( $page > 1 ) ) ) ||
|
1576 |
+
( ( $aiosp_noindex == '' ) && ( !empty( $aioseop_options['aiosp_cpostnoindex'] ) ) && ( in_array( $post_type, $aioseop_options['aiosp_cpostnoindex'] ) ) ) )
|
1577 |
+
$noindex = "no" . $noindex;
|
1578 |
+
if ( ( $aiosp_nofollow == 'on' ) || ( ( !empty( $aioseop_options['aiosp_paginated_nofollow'] ) ) && ( ( $page > 1 ) ) ) ||
|
1579 |
+
( ( $aiosp_nofollow == '' ) && ( !empty( $aioseop_options['aiosp_cpostnofollow'] ) ) && ( in_array( $post_type, $aioseop_options['aiosp_cpostnofollow'] ) ) ) )
|
1580 |
+
$nofollow = "no" . $nofollow;
|
1581 |
+
if ( ( $aiosp_noindex == 'on' ) || ( ( !empty( $aioseop_options['aiosp_paginated_noindex'] ) ) && ( ( $page > 1 ) ) ) ||
|
1582 |
+
( ( $aiosp_noindex == '' ) && ( !empty( $aioseop_options['aiosp_cpostnoindex'] ) ) && ( in_array( $post_type, $aioseop_options['aiosp_cpostnoindex'] ) ) ) )
|
1583 |
+
$noindex = "no" . $noindex;
|
1584 |
+
if ( ( !empty( $aioseop_options['aiosp_cpostnoodp'] ) && ( in_array( $post_type, $aioseop_options['aiosp_cpostnoodp'] ) ) ) )
|
1585 |
+
$aiosp_noodp = true;
|
1586 |
+
if ( ( !empty( $aioseop_options['aiosp_cpostnoydir'] ) && ( in_array( $post_type, $aioseop_options['aiosp_cpostnoydir'] ) ) ) )
|
1587 |
+
$aiosp_noydir = true;
|
1588 |
+
}
|
1589 |
+
}
|
1590 |
+
if ( !empty( $aioseop_options['aiosp_noodp'] ) && $aioseop_options['aiosp_noodp'] ) $aiosp_noodp = true;
|
1591 |
+
if ( !empty( $aioseop_options['aiosp_noydir'] ) && $aioseop_options['aiosp_noydir'] ) $aiosp_noydir = true;
|
1592 |
+
if ( $aiosp_noodp ) $nofollow .= ',noodp';
|
1593 |
+
if ( $aiosp_noydir ) $nofollow .= ',noydir';
|
1594 |
+
$robots_meta = $noindex . ',' . $nofollow;
|
1595 |
+
if ( $robots_meta == 'index,follow' ) $robots_meta = '';
|
1596 |
+
return $robots_meta;
|
1597 |
+
}
|
1598 |
+
|
1599 |
+
function get_main_description( $post = null ) {
|
1600 |
+
global $aioseop_options;
|
1601 |
+
$opts = $this->meta_opts;
|
1602 |
+
$description = '';
|
1603 |
+
if ( is_author() && $this->show_page_description() ) {
|
1604 |
+
$description = $this->internationalize( get_the_author_meta( 'description' ) );
|
1605 |
+
} else if ( is_front_page() ) {
|
1606 |
+
$description = trim( stripslashes( $this->internationalize( $aioseop_options['aiosp_home_description'] ) ) );
|
1607 |
+
} else if ( function_exists( 'woocommerce_get_page_id' ) && is_post_type_archive( 'product' ) && ( $post_id = woocommerce_get_page_id( 'shop' ) ) && ( $post = get_post( $post_id ) ) ) {
|
1608 |
+
$description = $this->get_post_description( $post );
|
1609 |
+
$description = $this->apply_cf_fields( $description );
|
1610 |
+
} else if ( is_single() || is_page() || is_attachment() || is_home() || $this->is_static_posts_page() ) {
|
1611 |
+
$description = $this->get_aioseop_description( $post );
|
1612 |
+
}
|
1613 |
+
if ( empty( $aioseop_options['aiosp_dont_truncate_descriptions'] ) ) {
|
1614 |
+
$description = $this->trim_excerpt_without_filters( $description );
|
1615 |
+
}
|
1616 |
+
return $description;
|
1617 |
+
}
|
1618 |
+
|
1619 |
+
function trim_description( $description ) {
|
1620 |
+
$description = trim( wp_strip_all_tags( $description ) );
|
1621 |
+
$description = str_replace( '"', '"', $description );
|
1622 |
+
$description = str_replace( "\r\n", ' ', $description );
|
1623 |
+
$description = str_replace( "\n", ' ', $description );
|
1624 |
+
return $description;
|
1625 |
+
}
|
1626 |
+
|
1627 |
+
function apply_description_format( $description, $post = null ) {
|
1628 |
+
global $aioseop_options, $wp_query;
|
1629 |
+
$description_format = $aioseop_options['aiosp_description_format'];
|
1630 |
+
if ( !isset( $description_format ) || empty( $description_format ) ) {
|
1631 |
+
$description_format = "%description%";
|
1632 |
+
}
|
1633 |
+
$description = str_replace( '%description%', apply_filters( 'aioseop_description_override', $description ), $description_format );
|
1634 |
+
if ( strpos( $description, '%blog_title%' ) !== false ) $description = str_replace( '%blog_title%', get_bloginfo( 'name' ), $description );
|
1635 |
+
if ( strpos( $description, '%blog_description%' ) !== false ) $description = str_replace( '%blog_description%', get_bloginfo( 'description' ), $description );
|
1636 |
+
if ( strpos( $description, '%wp_title%' ) !== false ) $description = str_replace( '%wp_title%', $this->get_original_title(), $description );
|
1637 |
+
if ( strpos( $description, '%post_title%' ) !== false ) $description = str_replace( '%post_title%', $this->get_aioseop_title( $post ), $description );
|
1638 |
+
if( $aioseop_options['aiosp_can'] && is_attachment() ) {
|
1639 |
+
$url = $this->aiosp_mrt_get_url( $wp_query );
|
1640 |
+
if ( $url ) {
|
1641 |
+
$matches = Array();
|
1642 |
+
preg_match_all( '/(\d+)/', $url, $matches );
|
1643 |
+
if ( is_array( $matches ) ){
|
1644 |
+
$uniqueDesc = join( '', $matches[0] );
|
1645 |
+
}
|
1646 |
+
}
|
1647 |
+
$description .= ' ' . $uniqueDesc;
|
1648 |
+
}
|
1649 |
+
return $description;
|
1650 |
+
}
|
1651 |
+
|
1652 |
+
function get_main_keywords() {
|
1653 |
+
global $aioseop_options;
|
1654 |
+
global $aioseop_keywords;
|
1655 |
+
global $post;
|
1656 |
+
$opts = $this->meta_opts;
|
1657 |
+
if ( ( ( is_front_page() && $aioseop_options['aiosp_home_keywords'] && !$this->is_static_posts_page() ) || $this->is_static_front_page() ) ) {
|
1658 |
+
$keywords = trim( $this->internationalize( $aioseop_options['aiosp_home_keywords'] ) );
|
1659 |
+
} elseif ( empty( $aioseop_options['aiosp_dynamic_postspage_keywords'] ) && ($this->is_static_posts_page() || is_archive() || is_post_type_archive() ) ) {
|
1660 |
+
$keywords = stripslashes( $this->internationalize( $opts["aiosp_keywords"] ) ); // and if option = use page set keywords instead of keywords from recent posts
|
1661 |
+
} elseif ( ( $blog_page = $this->get_blog_page( $post ) ) && empty( $aioseop_options['aiosp_dynamic_postspage_keywords'] ) ) {
|
1662 |
+
$keywords = stripslashes( $this->internationalize( get_post_meta( $blog_page->ID, "_aioseop_keywords", true ) ) );
|
1663 |
+
} else {
|
1664 |
+
$keywords = $this->get_all_keywords();
|
1665 |
+
}
|
1666 |
+
return $keywords;
|
1667 |
+
}
|
1668 |
|
1669 |
function wp_head() {
|
1670 |
if ( !$this->is_page_included() ) return;
|
1671 |
$opts = $this->meta_opts;
|
1672 |
+
global $wp_query, $aioseop_options, $posts;
|
1673 |
static $aioseop_dup_counter = 0;
|
1674 |
$aioseop_dup_counter++;
|
1675 |
if ( $aioseop_dup_counter > 1 ) {
|
1676 |
echo "\n<!-- " . sprintf( __( "Debug Warning: All in One SEO Pack meta data was included again from %s filter. Called %s times!", 'all_in_one_seo_pack' ), current_filter(), $aioseop_dup_counter ) . " -->\n";
|
1677 |
return;
|
1678 |
}
|
|
|
1679 |
if ( is_home() && !is_front_page() ) {
|
1680 |
$post = $this->get_blog_page();
|
1681 |
} else {
|
1682 |
$post = $this->get_queried_object();
|
1683 |
}
|
|
|
|
|
|
|
1684 |
$meta_string = null;
|
1685 |
$description = '';
|
1686 |
+
// logging - rewrite handler check for output buffering
|
1687 |
+
$this->check_rewrite_handler();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1688 |
echo "\n<!-- All in One SEO Pack $this->version by Michael Torbert of Semper Fi Web Design";
|
1689 |
if ( $this->ob_start_detected )
|
1690 |
echo "ob_start_detected ";
|
1691 |
echo "[$this->title_start,$this->title_end] ";
|
1692 |
echo "-->\n";
|
|
|
|
|
|
|
|
|
1693 |
$blog_page = $this->get_blog_page( $post );
|
1694 |
+
$save_posts = $posts;
|
1695 |
+
if ( function_exists( 'woocommerce_get_page_id' ) && is_post_type_archive( 'product' ) && ( $post_id = woocommerce_get_page_id( 'shop' ) ) && ( $post = get_post( $post_id ) ) ) {
|
1696 |
+
global $posts;
|
1697 |
+
$opts = $this->meta_opts = $this->get_current_options( Array(), 'aiosp', null, $post );
|
1698 |
+
$posts = Array();
|
1699 |
+
$posts[] = $post;
|
1700 |
+
}
|
1701 |
+
$posts = $save_posts;
|
1702 |
+
$description = apply_filters( 'aioseop_description', $this->get_main_description( $post ) ); // get the description
|
1703 |
+
// handle the description format
|
1704 |
+
if ( isset($description) && ( $this->strlen($description) > $this->minimum_description_length ) && !( is_front_page() && is_paged() ) ) {
|
1705 |
+
$description = $this->trim_description( $description );
|
1706 |
+
if ( !isset( $meta_string) ) $meta_string = '';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1707 |
// description format
|
1708 |
+
$description = apply_filters( 'aioseop_description_full', $this->apply_description_format( $description, $post ) );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1709 |
$desc_attr = '';
|
1710 |
if ( !empty( $aioseop_options['aiosp_schema_markup'] ) )
|
1711 |
$desc_attr = 'itemprop="description"';
|
1712 |
$desc_attr = apply_filters( 'aioseop_description_attributes', $desc_attr );
|
1713 |
$meta_string .= sprintf( "<meta name=\"description\" %s content=\"%s\" />\n", $desc_attr, $description );
|
1714 |
}
|
1715 |
+
// get the keywords
|
1716 |
+
$togglekeywords = 0;
|
|
|
1717 |
if ( isset( $aioseop_options['aiosp_togglekeywords'] ) )
|
1718 |
$togglekeywords = $aioseop_options['aiosp_togglekeywords'];
|
1719 |
+
if ( $togglekeywords == 0 && !( is_front_page() && is_paged() ) ) {
|
1720 |
+
$keywords = $this->get_main_keywords();
|
1721 |
+
$keywords = $this->apply_cf_fields( $keywords );
|
1722 |
+
$keywords = apply_filters( 'aioseop_keywords', $keywords );
|
1723 |
+
|
1724 |
+
if ( isset( $keywords ) && !empty( $keywords ) ) {
|
1725 |
+
if ( isset( $meta_string ) ) $meta_string .= "\n";
|
1726 |
+
$keywords = wp_filter_nohtml_kses( str_replace( '"', '', $keywords ) );
|
1727 |
+
$key_attr = '';
|
1728 |
+
if ( !empty( $aioseop_options['aiosp_schema_markup'] ) )
|
1729 |
+
$key_attr = 'itemprop="keywords"';
|
1730 |
+
$key_attr = apply_filters( 'aioseop_keywords_attributes', $key_attr );
|
1731 |
+
$meta_string .= sprintf( "<meta name=\"keywords\" %s content=\"%s\" />\n", $key_attr, $keywords );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1732 |
}
|
1733 |
}
|
1734 |
+
// handle noindex, nofollow - robots meta
|
1735 |
+
$robots_meta = apply_filters( 'aioseop_robots_meta', $this->get_robots_meta() );
|
|
|
|
|
|
|
|
|
|
|
|
|
1736 |
if ( !empty( $robots_meta ) )
|
1737 |
$meta_string .= '<meta name="robots" content="' . esc_attr( $robots_meta ) . '" />' . "\n";
|
1738 |
+
// handle site verification
|
1739 |
+
if ( is_front_page() ) {
|
1740 |
foreach( Array( 'google' => 'google-site-verification', 'bing' => 'msvalidate.01', 'pinterest' => 'p:domain_verify' ) as $k => $v )
|
1741 |
if ( !empty( $aioseop_options["aiosp_{$k}_verify"] ) )
|
1742 |
$meta_string .= '<meta name="' . $v . '" content="' . trim( strip_tags( $aioseop_options["aiosp_{$k}_verify"] ) ) . '" />' . "\n";
|
1743 |
+
|
1744 |
+
// sitelinks search
|
1745 |
+
if ( !empty( $aioseop_options["aiosp_google_sitelinks_search"] ) )
|
1746 |
+
$meta_string .= $this->sitelinks_search_box() . "\n";
|
1747 |
+
}
|
1748 |
+
// handle extra meta fields
|
1749 |
foreach( Array( 'page_meta', 'post_meta', 'home_meta', 'front_meta' ) as $meta ) {
|
1750 |
if ( !empty( $aioseop_options["aiosp_{$meta}_tags" ] ) )
|
1751 |
$$meta = html_entity_decode( stripslashes( $aioseop_options["aiosp_{$meta}_tags" ] ), ENT_QUOTES );
|
1752 |
else
|
1753 |
$$meta = '';
|
1754 |
}
|
1755 |
+
if ( is_page() && isset( $page_meta ) && !empty( $page_meta ) && ( !is_front_page() || empty( $front_meta ) ) ) {
|
|
|
1756 |
if ( isset( $meta_string ) ) $meta_string .= "\n";
|
1757 |
$meta_string .= $page_meta;
|
1758 |
}
|
|
|
1759 |
if ( is_single() && isset( $post_meta ) && !empty( $post_meta ) ) {
|
1760 |
if ( isset( $meta_string ) ) $meta_string .= "\n";
|
1761 |
$meta_string .= $post_meta;
|
1762 |
}
|
1763 |
+
// handle authorship
|
1764 |
+
$authorship = $this->get_google_authorship( $post );
|
1765 |
+
$publisher = apply_filters( 'aioseop_google_publisher', $authorship["publisher"] );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1766 |
if ( !empty( $publisher ) )
|
1767 |
+
$meta_string = '<link rel="publisher" href="' . esc_url( $publisher ) . '" />' . "\n" . $meta_string;
|
1768 |
+
$author = apply_filters( 'aioseop_google_author', $authorship["author"] );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1769 |
if ( !empty( $author ) )
|
1770 |
$meta_string = '<link rel="author" href="' . esc_url( $author ) . '" />' . "\n" . $meta_string;
|
1771 |
+
|
1772 |
+
if ( is_front_page() && !empty( $front_meta ) ) {
|
1773 |
if ( isset( $meta_string ) ) $meta_string .= "\n";
|
1774 |
$meta_string .= $front_meta;
|
1775 |
} else {
|
1778 |
$meta_string .= $home_meta;
|
1779 |
}
|
1780 |
}
|
1781 |
+
$prev_next = $this->get_prev_next_links( $post );
|
1782 |
+
$prev = apply_filters( 'aioseop_prev_link', $prev_next['prev'] );
|
1783 |
+
$next = apply_filters( 'aioseop_next_link', $prev_next['next'] );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1784 |
if ( !empty( $prev ) ) $meta_string .= "<link rel='prev' href='" . esc_url( $prev ) . "' />\n";
|
1785 |
if ( !empty( $next ) ) $meta_string .= "<link rel='next' href='" . esc_url( $next ) . "' />\n";
|
|
|
1786 |
if ( $meta_string != null ) echo "$meta_string\n";
|
1787 |
+
// handle canonical links
|
1788 |
$show_page = true;
|
1789 |
if ( !empty( $aioseop_options["aiosp_no_paged_canonical_links"] ) ) $show_page = false;
|
1790 |
+
|
1791 |
+
if ( $aioseop_options['aiosp_can'] ) {
|
1792 |
+
$url = '';
|
1793 |
+
if ( !empty( $aioseop_options['aiosp_customize_canonical_links'] ) && !empty( $opts['aiosp_custom_link'] ) ) $url = $opts['aiosp_custom_link'];
|
1794 |
+
if ( empty( $url ) )
|
1795 |
+
$url = $this->aiosp_mrt_get_url( $wp_query, $show_page );
|
1796 |
$url = apply_filters( 'aioseop_canonical_url', $url );
|
1797 |
if ( !empty( $url ) )
|
1798 |
echo '<link rel="canonical" href="'. esc_url( $url ) . '" />'."\n";
|
1977 |
function oauth_connect( $count = 0 ) {
|
1978 |
global $aiosp_activation;
|
1979 |
if ( !class_exists( 'OAuthConsumer' ) ) require_once( 'OAuth.php' );
|
1980 |
+
$url = '';
|
1981 |
$callback_url = NULL;
|
1982 |
$consumer_key = "anonymous";
|
1983 |
$consumer_secret = "anonymous";
|
2011 |
if ( !$count ) {
|
2012 |
return $this->oauth_connect( 1 );
|
2013 |
}
|
|
|
|
|
|
|
|
|
|
|
2014 |
}
|
2015 |
return $url;
|
2016 |
}
|
2017 |
|
2018 |
function get_analytics_domain() {
|
2019 |
global $aioseop_options;
|
2020 |
+
if ( !empty( $aioseop_options['aiosp_ga_domain'] ) )
|
2021 |
+
return $this->sanitize_domain( $aioseop_options['aiosp_ga_domain'] );
|
2022 |
+
return '';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023 |
}
|
2024 |
|
2025 |
function universal_analytics() {
|
2026 |
global $aioseop_options;
|
2027 |
$analytics = '';
|
2028 |
if ( !empty( $aioseop_options['aiosp_ga_use_universal_analytics'] ) ) {
|
2029 |
+
$allow_linker = $cookie_domain = $domain = $addl_domains = $domain_list = '';
|
2030 |
+
if ( !empty( $aioseop_options['aiosp_ga_advanced_options'] ) )
|
2031 |
+
$cookie_domain = $this->get_analytics_domain();
|
2032 |
if ( !empty( $cookie_domain ) ) {
|
2033 |
$cookie_domain = esc_js( $cookie_domain );
|
2034 |
$cookie_domain = "'cookieDomain': '{$cookie_domain}'";
|
2035 |
}
|
2036 |
+
if ( empty( $cookie_domain ) ) {
|
2037 |
+
$domain = ", 'auto'";
|
2038 |
+
}
|
2039 |
+
if ( !empty( $aioseop_options['aiosp_ga_advanced_options'] ) && !empty( $aioseop_options['aiosp_ga_multi_domain'] ) ) {
|
2040 |
$allow_linker = "'allowLinker': true";
|
2041 |
+
if ( !empty( $aioseop_options['aiosp_ga_addl_domains'] ) ) {
|
2042 |
+
$addl_domains = trim( $aioseop_options['aiosp_ga_addl_domains'] );
|
2043 |
+
$addl_domains = preg_split('/[\s,]+/', $addl_domains);
|
2044 |
+
if ( !empty( $addl_domains ) ) {
|
2045 |
+
foreach( $addl_domains as $d ) {
|
2046 |
+
$d = $this->sanitize_domain( $d );
|
2047 |
+
if ( !empty( $d ) ) {
|
2048 |
+
if ( !empty( $domain_list ) )
|
2049 |
+
$domain_list .= ", ";
|
2050 |
+
$domain_list .= "'" . $d . "'";
|
2051 |
+
}
|
2052 |
+
}
|
2053 |
+
}
|
2054 |
+
}
|
2055 |
}
|
2056 |
$extra_options = '';
|
2057 |
+
if ( !empty( $aioseop_options['aiosp_ga_advanced_options'] ) && !empty( $aioseop_options['aiosp_ga_display_advertising'] ) ) {
|
2058 |
+
$extra_options .= "ga('require', 'displayfeatures');";
|
2059 |
+
}
|
2060 |
+
if ( !empty( $aioseop_options['aiosp_ga_advanced_options'] ) && !empty( $aioseop_options['aiosp_ga_enhanced_ecommerce'] ) ) {
|
2061 |
+
if ( !empty( $extra_options ) ) $extra_options .= "\n\t\t\t";
|
2062 |
+
$extra_options .= "ga('require', 'ec');";
|
2063 |
}
|
2064 |
+
if ( !empty( $domain_list ) ) {
|
2065 |
+
if ( !empty( $extra_options ) ) $extra_options .= "\n\t\t\t";
|
2066 |
+
$extra_options .= "ga('require', 'linker');\n\t\t\tga('linker:autoLink', [{$domain_list}] );";
|
2067 |
+
}
|
2068 |
+
if ( !empty( $aioseop_options['aiosp_ga_advanced_options'] ) && !empty( $aioseop_options['aiosp_ga_link_attribution'] ) ) {
|
2069 |
+
if ( !empty( $extra_options ) ) $extra_options .= "\n\t\t\t";
|
2070 |
+
$extra_options .= "ga('require', 'linkid', 'linkid.js');";
|
2071 |
+
}
|
2072 |
+
|
2073 |
+
if ( !empty( $aioseop_options['aiosp_ga_advanced_options'] ) && !empty( $aioseop_options['aiosp_ga_anonymize_ip'] ) ) {
|
2074 |
if ( !empty( $extra_options ) ) $extra_options .= "\n\t\t\t";
|
2075 |
$extra_options .= "ga('set', 'anonymizeIp', true);";
|
2076 |
}
|
2090 |
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
|
2091 |
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
|
2092 |
|
2093 |
+
ga('create', '{$analytics_id}'{$domain}{$js_options});
|
2094 |
{$extra_options}
|
2095 |
ga('send', 'pageview');
|
2096 |
</script>
|
2103 |
function aiosp_google_analytics() {
|
2104 |
global $aioseop_options;
|
2105 |
$analytics = '';
|
2106 |
+
if ( !empty( $aioseop_options['aiosp_ga_advanced_options'] ) && !empty( $aioseop_options['aiosp_ga_exclude_users'] ) ) {
|
2107 |
if ( is_user_logged_in() ) {
|
2108 |
global $current_user;
|
2109 |
if ( empty( $current_user ) ) get_currentuserinfo();
|
2120 |
if ( empty( $analytics ) ) {
|
2121 |
?> <script type="text/javascript">
|
2122 |
var _gaq = _gaq || [];
|
2123 |
+
<?php if ( !empty( $aioseop_options['aiosp_ga_advanced_options'] ) && !empty( $aioseop_options['aiosp_ga_link_attribution'] ) ) {
|
2124 |
+
?> var pluginUrl =
|
2125 |
+
'//www.google-analytics.com/plugins/ga/inpage_linkid.js';
|
2126 |
+
_gaq.push(['_require', 'inpage_linkid', pluginUrl]);
|
2127 |
+
<?php
|
2128 |
+
}
|
2129 |
+
?> _gaq.push(['_setAccount', '<?php
|
2130 |
echo $aioseop_options['aiosp_google_analytics_id'];
|
2131 |
?>']);
|
2132 |
+
<?php if ( !empty( $aioseop_options['aiosp_ga_advanced_options'] ) && !empty( $aioseop_options['aiosp_ga_anonymize_ip'] ) ) {
|
2133 |
?> _gaq.push(['_gat._anonymizeIp']);
|
2134 |
<?php
|
2135 |
}
|
2136 |
?>
|
2137 |
+
<?php if ( !empty( $aioseop_options['aiosp_ga_advanced_options'] ) && !empty( $aioseop_options['aiosp_ga_multi_domain'] ) ) {
|
2138 |
?> _gaq.push(['_setAllowLinker', true]);
|
2139 |
<?php
|
2140 |
}
|
2141 |
?>
|
2142 |
+
<?php if ( !empty( $aioseop_options['aiosp_ga_advanced_options'] ) && !empty( $aioseop_options['aiosp_ga_domain'] ) ) {
|
2143 |
$domain = $this->get_analytics_domain();
|
2144 |
?> _gaq.push(['_setDomainName', '<?php echo $domain; ?>']);
|
2145 |
<?php
|
2148 |
(function() {
|
2149 |
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
|
2150 |
<?php
|
2151 |
+
if ( !empty( $aioseop_options['aiosp_ga_advanced_options'] ) && !empty( $aioseop_options['aiosp_ga_display_advertising'] ) ) {
|
2152 |
?> ga.src = ('https:' == document.location.protocol ? 'https://' : 'http://') + 'stats.g.doubleclick.net/dc.js';
|
2153 |
<?php
|
2154 |
} else {
|
2160 |
</script>
|
2161 |
<?php
|
2162 |
}
|
2163 |
+
if ( !empty( $aioseop_options['aiosp_ga_advanced_options'] ) && $aioseop_options['aiosp_ga_track_outbound_links'] ) { ?>
|
2164 |
<script type="text/javascript">
|
2165 |
function recordOutboundLink(link, category, action) {
|
2166 |
<?php if ( !empty( $aioseop_options['aiosp_ga_use_universal_analytics'] ) ) { ?>
|
2184 |
}
|
2185 |
return result;
|
2186 |
}
|
2187 |
+
|
2188 |
function aiosp_addLoadEvent(func) {
|
2189 |
var oldonload = window.onload;
|
2190 |
if (typeof window.onload != 'function') {
|
2226 |
}
|
2227 |
echo apply_filters( 'aiosp_google_analytics', $analytics );
|
2228 |
}
|
2229 |
+
|
2230 |
+
function sitelinks_search_box() {
|
2231 |
+
$home_url = get_home_url();
|
2232 |
+
$search_box=<<<EOF
|
2233 |
+
<script type="application/ld+json">
|
2234 |
+
{
|
2235 |
+
"@context": "http://schema.org",
|
2236 |
+
"@type": "WebSite",
|
2237 |
+
"url": "{$home_url}/",
|
2238 |
+
"potentialAction": {
|
2239 |
+
"@type": "SearchAction",
|
2240 |
+
"target": "{$home_url}/?s={search_term}",
|
2241 |
+
"query-input": "required name=search_term"
|
2242 |
+
}
|
2243 |
+
}
|
2244 |
+
</script>
|
2245 |
+
EOF;
|
2246 |
+
return apply_filters( 'aiosp_sitelinks_search_box', $search_box );
|
2247 |
+
}
|
2248 |
|
2249 |
// Thank you, Yoast de Valk, for much of this code.
|
2250 |
|
2312 |
if ( empty( $link ) || !is_string( $link ) ) return false;
|
2313 |
if ( apply_filters( 'aioseop_canonical_url_pagination', $show_page ) )
|
2314 |
$link = $this->get_paged( $link );
|
2315 |
+
if ( !empty( $link ) ) {
|
2316 |
+
global $aioseop_options;
|
2317 |
+
if ( !empty( $aioseop_options['aiosp_can_set_protocol'] ) && ( $aioseop_options['aiosp_can_set_protocol'] != 'auto' ) ) {
|
2318 |
+
if ( $aioseop_options['aiosp_can_set_protocol'] == 'http' ) {
|
2319 |
+
$link = preg_replace("/^https:/i", "http:", $link );
|
2320 |
+
} elseif ( $aioseop_options['aiosp_can_set_protocol'] == 'https' ) {
|
2321 |
+
$link = preg_replace("/^http:/i", "https:", $link );
|
2322 |
+
}
|
2323 |
+
}
|
2324 |
+
}
|
2325 |
return $link;
|
2326 |
}
|
2327 |
|
2576 |
return $this->apply_tax_title_format( $name, $desc, $tax );
|
2577 |
}
|
2578 |
|
2579 |
+
function get_post_title_format( $title_type = 'post' ) {
|
2580 |
global $aioseop_options;
|
2581 |
+
if ( ( $title_type != 'post' ) && ( $title_type != 'archive' ) ) return false;
|
2582 |
+
$title_format = "%{$title_type}_title% | %blog_title%";
|
2583 |
+
if ( isset( $aioseop_options["aiosp_{$title_type}_title_format"] ) )
|
2584 |
+
$title_format = $aioseop_options["aiosp_{$title_type}_title_format"];
|
2585 |
if( !empty( $aioseop_options['aiosp_enablecpost'] ) && !empty( $aioseop_options['aiosp_cpostadvanced'] ) && !empty( $aioseop_options['aiosp_cpostactive'] ) ) {
|
2586 |
$wp_post_types = $aioseop_options['aiosp_cpostactive'];
|
2587 |
+
if ( !empty( $aioseop_options["aiosp_cposttitles"] ) ) {
|
2588 |
+
if ( ( ( $title_type == 'archive' ) && is_post_type_archive( $wp_post_types ) && $prefix = "aiosp_{$title_type}_" ) ||
|
2589 |
+
( ( $title_type == 'post' ) && is_singular( $wp_post_types ) && $prefix = "aiosp_" ) ) {
|
2590 |
+
$post_type = get_post_type();
|
2591 |
+
if ( !empty( $aioseop_options["{$post_type}_title_format"] ) )
|
2592 |
+
$title_format = $aioseop_options["{$prefix}{$post_type}_title_format"];
|
2593 |
+
}
|
2594 |
}
|
2595 |
}
|
2596 |
return $title_format;
|
2597 |
}
|
2598 |
|
2599 |
+
function get_archive_title_format() {
|
2600 |
+
return get_post_title_format( "archive" );
|
2601 |
+
}
|
2602 |
+
|
2603 |
function apply_archive_title_format( $title, $category = '' ) {
|
2604 |
$title_format = $this->get_archive_title_format();
|
2605 |
$r_title = array( '%blog_title%', '%blog_description%', '%archive_title%' );
|
2607 |
$title = trim( str_replace( $r_title, $d_title, $title_format ) );
|
2608 |
return $title;
|
2609 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2610 |
|
2611 |
function apply_post_title_format( $title, $category = '', $p = null ) {
|
2612 |
if ( $p === null ) {
|
2697 |
$title = apply_filters( 'single_post_title', $title );
|
2698 |
return $title;
|
2699 |
}
|
2700 |
+
} else if ( function_exists( 'woocommerce_get_page_id' ) && is_post_type_archive( 'product' ) && ( $post_id = woocommerce_get_page_id( 'shop' ) ) && ( $post = get_post( $post_id ) ) ) {
|
2701 |
+
$title = $this->internationalize( get_post_meta( $post->ID, "_aioseop_title", true ) );
|
2702 |
+
if ( !$title ) $title = $this->internationalize( $post->post_title );
|
2703 |
+
if ( !$title ) $title = $this->internationalize( $this->get_original_title( '', false ) );
|
2704 |
+
$title = $this->apply_page_title_format( $title, $post );
|
2705 |
+
$title = $this->paged_title( $title );
|
2706 |
+
$title = apply_filters( 'aioseop_title_page', $title );
|
2707 |
+
return $title;
|
2708 |
} else if ( is_single() ) {
|
2709 |
// we're not in the loop :(
|
2710 |
if ( $post === null ) return false;
|
2735 |
return $title;
|
2736 |
} else if ( is_tag() ) {
|
2737 |
global $utw;
|
2738 |
+
$tag = $tag_description = '';
|
2739 |
if ( $utw ) {
|
2740 |
$tags = $utw->GetCurrentTagSet();
|
2741 |
$tag = $tags[0]->tag;
|
2906 |
return trim( stripslashes( $text ) );
|
2907 |
}
|
2908 |
|
2909 |
+
function keyword_string_to_list( $keywords ) {
|
2910 |
+
$traverse = Array();
|
2911 |
+
$keywords_i = str_replace( '"', '', $keywords );
|
2912 |
+
if (isset( $keywords_i ) && !empty( $keywords_i ) ) {
|
2913 |
+
$traverse = explode( ',', $keywords_i );
|
2914 |
+
}
|
2915 |
+
return $traverse;
|
2916 |
+
}
|
2917 |
+
|
2918 |
/**
|
2919 |
* @return comma-separated list of unique keywords
|
2920 |
*/
|
2921 |
function get_all_keywords() {
|
2922 |
global $posts;
|
2923 |
global $aioseop_options;
|
|
|
2924 |
if ( is_404() ) return null;
|
|
|
2925 |
// if we are on synthetic pages
|
2926 |
if ( !is_home() && !is_page() && !is_single() && !$this->is_static_front_page() && !$this->is_static_posts_page() && !is_archive() && !is_post_type_archive() )
|
2927 |
return null;
|
|
|
2928 |
$keywords = array();
|
2929 |
+
$opts = $this->meta_opts;
|
2930 |
+
if ( !empty( $opts["aiosp_keywords"] ) ) {
|
2931 |
+
$traverse = $this->keyword_string_to_list( $opts["aiosp_keywords"] );
|
2932 |
+
if ( !empty( $traverse ) )
|
2933 |
+
foreach ( $traverse as $keyword ) $keywords[] = $keyword;
|
2934 |
+
}
|
2935 |
+
if ( empty( $posts ) ) {
|
2936 |
+
global $post;
|
2937 |
+
$post_arr = Array( $post );
|
2938 |
+
} else {
|
2939 |
+
$post_arr = $posts;
|
2940 |
+
}
|
2941 |
+
if ( is_array( $post_arr ) ) {
|
2942 |
+
$postcount = count( $post_arr );
|
2943 |
+
foreach ( $post_arr as $p ) {
|
2944 |
+
if ( $p ) {
|
2945 |
+
$id = $p->ID;
|
2946 |
+
if ( $postcount > 1 && !empty( $aioseop_options['aiosp_dynamic_postspage_keywords'] ) ) {
|
2947 |
+
// custom field keywords
|
2948 |
+
$keywords_i = null;
|
2949 |
+
$keywords_i = stripslashes( $this->internationalize( get_post_meta( $id, "_aioseop_keywords", true ) ) );
|
2950 |
+
if ( is_attachment() ) {
|
2951 |
+
$id = $p->post_parent;
|
2952 |
+
if ( empty( $keywords_i ) )
|
2953 |
+
$keywords_i = stripslashes( $this->internationalize( get_post_meta( $id, "_aioseop_keywords", true ) ) );
|
2954 |
+
}
|
2955 |
+
|
2956 |
+
$traverse = $this->keyword_string_to_list( $keywords_i );
|
2957 |
+
if ( !empty( $traverse ) )
|
2958 |
+
foreach ( $traverse as $keyword ) $keywords[] = $keyword;
|
2959 |
+
}
|
2960 |
+
|
2961 |
+
if ( !empty( $aioseop_options['aiosp_use_tags_as_keywords'] ) ) {
|
2962 |
+
$tags = get_the_tags( $id );
|
2963 |
+
if ( $tags && is_array( $tags) )
|
2964 |
+
foreach ( $tags as $tag )
|
2965 |
+
$keywords[] = $this->internationalize( $tag->name );
|
2966 |
+
|
2967 |
+
// Ultimate Tag Warrior integration
|
2968 |
+
global $utw;
|
2969 |
+
if ( $utw ) {
|
2970 |
+
$tags = $utw->GetTagsForPost( $p );
|
2971 |
+
if ( is_array( $tags ) )
|
2972 |
+
foreach ( $tags as $tag ) {
|
2973 |
+
$tag = $tag->tag;
|
2974 |
+
$tag = str_replace( '_', ' ', $tag );
|
2975 |
+
$tag = str_replace( '-', ' ', $tag );
|
2976 |
+
$tag = stripslashes( $tag );
|
2977 |
+
$keywords[] = $tag;
|
2978 |
+
}
|
2979 |
+
}
|
2980 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2981 |
// autometa
|
2982 |
$autometa = stripslashes( get_post_meta( $id, 'autometa', true ) );
|
2983 |
if ( isset( $autometa ) && !empty( $autometa ) ) {
|
2985 |
foreach ( $autometa_array as $e )
|
2986 |
$keywords[] = $e;
|
2987 |
}
|
2988 |
+
|
2989 |
if ( $aioseop_options['aiosp_use_categories'] && !is_page() ) {
|
2990 |
$categories = get_the_category( $id );
|
2991 |
foreach ( $categories as $category )
|
2997 |
return $this->get_unique_keywords($keywords);
|
2998 |
}
|
2999 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3000 |
function get_unique_keywords($keywords) {
|
3001 |
$small_keywords = array();
|
3002 |
foreach ( $keywords as $word )
|
3019 |
if ( isset( $_POST[ 'nonce-aioseop-edit' ] ) ) $nonce = $_POST['nonce-aioseop-edit'];
|
3020 |
|
3021 |
if ( isset($awmp_edit) && !empty($awmp_edit) && wp_verify_nonce($nonce, 'edit-aioseop-nonce') ) {
|
3022 |
+
|
3023 |
+
$optlist = Array( 'keywords', 'description', 'title', 'custom_link', 'sitemap_exclude', 'disable', 'disable_analytics', 'noindex', 'nofollow', 'noodp', 'noydir', 'titleatr', 'menulabel' );
|
3024 |
+
if ( !( !empty( $this->options['aiosp_can'] ) ) && ( !empty( $this->options['aiosp_customize_canonical_links'] ) ) ) {
|
3025 |
+
unset( $optlist["custom_link"] );
|
3026 |
+
}
|
3027 |
+
foreach ( $optlist as $f ) {
|
3028 |
$field = "aiosp_$f";
|
3029 |
if ( isset( $_POST[$field] ) ) $$field = $_POST[$field];
|
3030 |
}
|
3031 |
|
3032 |
+
$optlist = Array( 'keywords', 'description', 'title', 'custom_link', 'noindex', 'nofollow', 'noodp', 'noydir', 'titleatr', 'menulabel' );
|
3033 |
+
if ( !( !empty( $this->options['aiosp_can'] ) ) && ( !empty( $this->options['aiosp_customize_canonical_links'] ) ) ) {
|
3034 |
+
unset( $optlist["custom_link"] );
|
3035 |
+
}
|
3036 |
+
foreach ( $optlist as $f )
|
3037 |
delete_post_meta( $id, "_aioseop_{$f}" );
|
3038 |
|
3039 |
if ( $this->is_admin() ) {
|
3040 |
+
delete_post_meta($id, '_aioseop_sitemap_exclude' );
|
3041 |
delete_post_meta($id, '_aioseop_disable' );
|
3042 |
delete_post_meta($id, '_aioseop_disable_analytics' );
|
3043 |
}
|
3044 |
|
3045 |
+
foreach ( $optlist as $f ) {
|
3046 |
$var = "aiosp_$f";
|
3047 |
$field = "_aioseop_$f";
|
3048 |
if ( isset( $$var ) && !empty( $$var ) )
|
3163 |
|
3164 |
$this->filter_pointers();
|
3165 |
|
3166 |
+
if ( !empty( $this->options['aiosp_enablecpost'] ) && $this->options['aiosp_enablecpost'] ) {
|
3167 |
if ( !empty( $this->options['aiosp_cpostadvanced'] ) ) {
|
3168 |
$this->locations['aiosp']['display'] = $this->options['aiosp_cpostactive'];
|
3169 |
} else {
|
3180 |
|
3181 |
add_meta_box('aioseop-list', __( "Join Our Mailing List", 'all_in_one_seo_pack' ), array( $this, 'display_extra_metaboxes'), 'aioseop_metaboxes', 'normal', 'core');
|
3182 |
add_meta_box('aioseop-about', "About <span style='float:right;'>Version <b>" . AIOSEOP_VERSION . "</b></span>", array( $this, 'display_extra_metaboxes'), 'aioseop_metaboxes', 'side', 'core');
|
3183 |
+
add_meta_box('aioseop-support', __( "Support", 'all_in_one_seo_pack' ) . " <span style='float:right;'>" . __( "Version", 'all_in_one_seo_pack' ) . " <b>" . AIOSEOP_VERSION . "</b></span>", array( $this, 'display_extra_metaboxes'), 'aioseop_metaboxes', 'side', 'core');
|
3184 |
|
3185 |
add_action( 'aioseop_modules_add_menus', Array( $this, 'add_menu' ), 5 );
|
3186 |
do_action( 'aioseop_modules_add_menus', $file );
|
3260 |
global $wpdb;
|
3261 |
|
3262 |
if( !get_option( 'aioseop_options' ) ) {
|
3263 |
+
$msg = "<div style='text-align:center;'><p><strong>Your database options need to be updated.</strong><em>(Back up your database before updating.)</em>
|
3264 |
+
<FORM action='' method='post' name='aioseop-migrate-options'>
|
3265 |
+
<input type='hidden' name='nonce-aioseop-migrate-options' value='" . wp_create_nonce( 'aioseop-migrate-nonce-options' ) . "' />
|
3266 |
+
<input type='submit' name='aioseop_migrate_options' class='button-primary' value='Update Database Options'>
|
3267 |
+
</FORM>
|
3268 |
+
</p></div>";
|
3269 |
+
aioseop_output_dismissable_notice( $msg, "", "error" );
|
3270 |
}
|
|
|
3271 |
?>
|
3272 |
<div class="aioseop_top">
|
3273 |
<div class="aioseop_top_sidebar aioseop_options_wrapper">
|
3297 |
});
|
3298 |
//]]>
|
3299 |
</script>
|
3300 |
+
<div class="aioseop_advert aioseop_nopad">
|
3301 |
+
<a href="https://wp.wincher.com/v1/link" target="_blank"><img src="<?php echo AIOSEOP_PLUGIN_IMAGES_URL; ?>wincherbanner.png"></a>
|
3302 |
+
</div>
|
3303 |
<!-- Headway Themes-->
|
3304 |
<div class="aioseop_advert">
|
3305 |
<div>
|
3308 |
</div>
|
3309 |
<a href="http://semperfiwebdesign.com/headwayaio/" target="_blank"><img src="<?php echo AIOSEOP_PLUGIN_IMAGES_URL; ?>headwaybanner.png"></a>
|
3310 |
</div>
|
3311 |
+
|
3312 |
</div>
|
3313 |
</div>
|
3314 |
<?php
|
aioseop_functions.php
CHANGED
@@ -14,17 +14,6 @@ if (!function_exists('aioseop_load_modules')) {
|
|
14 |
}
|
15 |
}
|
16 |
|
17 |
-
/**
|
18 |
-
* Check if we just got activated.
|
19 |
-
*/
|
20 |
-
if ( !function_exists( 'aioseop_activate' ) ) {
|
21 |
-
function aioseop_activate() {
|
22 |
-
global $aiosp_activation;
|
23 |
-
$aiosp_activation = true;
|
24 |
-
delete_transient( "aioseop_oauth_current" );
|
25 |
-
}
|
26 |
-
}
|
27 |
-
|
28 |
if ( !function_exists( 'aioseop_get_options' ) ) {
|
29 |
function aioseop_get_options() {
|
30 |
global $aioseop_options;
|
@@ -53,7 +42,7 @@ if ( !function_exists( 'aioseop_update_settings_check' ) ) {
|
|
53 |
$update_options = true;
|
54 |
}
|
55 |
if ( !empty( $aioseop_options['aiosp_archive_title_format'] ) && empty( $aioseop_options['aiosp_date_title_format'] ) ) {
|
56 |
-
$aioseop_options['aiosp_date_title_format'] = $aioseop_options['
|
57 |
unset( $aioseop_options['aiosp_archive_title_format'] );
|
58 |
$update_options = true;
|
59 |
}
|
@@ -204,6 +193,50 @@ if ( !function_exists( 'aioseop_admin_head' ) ) {
|
|
204 |
}
|
205 |
}
|
206 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
207 |
if ( !function_exists( 'aioseop_ajax_save_meta' ) ) {
|
208 |
function aioseop_ajax_save_meta() {
|
209 |
if ( !empty( $_POST['_inline_edit'] ) && ( $_POST['_inline_edit'] != 'undefined' ) )
|
14 |
}
|
15 |
}
|
16 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
17 |
if ( !function_exists( 'aioseop_get_options' ) ) {
|
18 |
function aioseop_get_options() {
|
19 |
global $aioseop_options;
|
42 |
$update_options = true;
|
43 |
}
|
44 |
if ( !empty( $aioseop_options['aiosp_archive_title_format'] ) && empty( $aioseop_options['aiosp_date_title_format'] ) ) {
|
45 |
+
$aioseop_options['aiosp_date_title_format'] = $aioseop_options['aiosp_archive_title_format'];
|
46 |
unset( $aioseop_options['aiosp_archive_title_format'] );
|
47 |
$update_options = true;
|
48 |
}
|
193 |
}
|
194 |
}
|
195 |
|
196 |
+
if ( !function_exists( 'aioseop_handle_ignore_notice' ) ) {
|
197 |
+
function aioseop_handle_ignore_notice() {
|
198 |
+
if ( !empty( $_GET ) ) {
|
199 |
+
global $current_user;
|
200 |
+
$user_id = $current_user->ID;
|
201 |
+
if ( !empty( $_GET["aioseop_reset_notices"] ) ) {
|
202 |
+
delete_user_meta( $user_id, 'aioseop_ignore_notice' );
|
203 |
+
}
|
204 |
+
if ( !empty($_GET['aioseop_ignore_notice'] ) ) {
|
205 |
+
add_user_meta( $user_id, 'aioseop_ignore_notice', $_GET['aioseop_ignore_notice'], false );
|
206 |
+
}
|
207 |
+
}
|
208 |
+
}
|
209 |
+
}
|
210 |
+
|
211 |
+
if ( !function_exists( 'aioseop_output_notice' ) ) {
|
212 |
+
function aioseop_output_notice( $message, $id = '', $class = "updated fade" ) {
|
213 |
+
if ( !empty( $class ) ) $class = ' class="' . esc_attr( $class ) . '"';
|
214 |
+
if ( !empty( $id ) ) $class .= ' id="' . esc_attr( $id ) . '"';
|
215 |
+
$dismiss = ' ';
|
216 |
+
echo "<div{$class}>" . wp_kses_post( $message ) . "</div>";
|
217 |
+
return true;
|
218 |
+
}
|
219 |
+
}
|
220 |
+
|
221 |
+
if ( !function_exists( 'aioseop_output_dismissable_notice' ) ) {
|
222 |
+
function aioseop_output_dismissable_notice( $message, $id = "", $class = "updated fade") {
|
223 |
+
global $current_user;
|
224 |
+
if ( !empty( $current_user ) ) {
|
225 |
+
$user_id = $current_user->ID;
|
226 |
+
$msgid = md5( $message );
|
227 |
+
$ignore = get_user_meta( $user_id, 'aioseop_ignore_notice' );
|
228 |
+
if ( !empty( $ignore ) && in_array( $msgid, $ignore ) ) return false;
|
229 |
+
global $wp;
|
230 |
+
$qa = Array();
|
231 |
+
wp_parse_str( $_SERVER["QUERY_STRING"], $qa );
|
232 |
+
$qa['aioseop_ignore_notice'] = $msgid;
|
233 |
+
$url = '?' . build_query( $qa );
|
234 |
+
$message .= ' <a class="alignright" href="' . $url . '">Dismiss</a>';
|
235 |
+
}
|
236 |
+
return aioseop_output_notice( $message, $id, $class );
|
237 |
+
}
|
238 |
+
}
|
239 |
+
|
240 |
if ( !function_exists( 'aioseop_ajax_save_meta' ) ) {
|
241 |
function aioseop_ajax_save_meta() {
|
242 |
if ( !empty( $_POST['_inline_edit'] ) && ( $_POST['_inline_edit'] != 'undefined' ) )
|
aioseop_module.css
CHANGED
@@ -37,6 +37,46 @@
|
|
37 |
font-size: 19px;
|
38 |
}
|
39 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
40 |
.aioseop_help_text_link.aioseop_meta_box_help:before {
|
41 |
font-size: 14px;
|
42 |
}
|
@@ -170,12 +210,17 @@ div.aioseop_tip_icon:before {
|
|
170 |
|
171 |
.aioseop_advert {
|
172 |
padding: 10px;
|
173 |
-
margin-bottom:
|
174 |
border: 1px solid #DDD;
|
175 |
height: 200px;
|
176 |
width: 423px;
|
177 |
}
|
178 |
|
|
|
|
|
|
|
|
|
|
|
179 |
.aioseop_adverts {
|
180 |
float: right;
|
181 |
}
|
37 |
font-size: 19px;
|
38 |
}
|
39 |
|
40 |
+
#aioseop-support .aioseop_metabox_text, #aioseop-support a {
|
41 |
+
font-size: 14px;
|
42 |
+
color: #000;
|
43 |
+
text-decoration: none;
|
44 |
+
}
|
45 |
+
|
46 |
+
.aioseop_icon {
|
47 |
+
display: inline-block;
|
48 |
+
width: 40px;
|
49 |
+
height: 40px;
|
50 |
+
background-repeat: no-repeat;
|
51 |
+
background-size: 100%;
|
52 |
+
vertical-align: middle;
|
53 |
+
margin: 10px;
|
54 |
+
}
|
55 |
+
|
56 |
+
.aioseop_book_icon {
|
57 |
+
background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABABAMAAABYR2ztAAAAKlBMVEUAAAAAn+cAneEAnuABnuEBnuEAnuEAn+QAn+QAneAAnuEAneAAnuAAneFPI9ocAAAADnRSTlMAII/P/wCQMADwANDvnyPbz6kAAAB9SURBVHgB7c+xCQMgEIVhZwiSSRzhkRBImsA5gVUmuBGcJbUDxlhY6T2wvh/sPvBd+HdJWCSj0N8bsEEiIIOAyEBhIDGAcwA4cDBy4MDBTeuqCR5abXCvBHy+6ybQrs2R0jsH/As+srEzC55qggi81AIZ+waQxkBmQK5tD34LnXJVZf9y5gAAAABJRU5ErkJggg==);
|
58 |
+
}
|
59 |
+
|
60 |
+
.aioseop_cog_icon {
|
61 |
+
background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAMAAACdt4HsAAAAeFBMVEUAAAAAn+MAnOIAn+cAneIAneEAn+MAnuEAneIAnuAAnuAAneEAn+cAn+QAn98AnuEAn98AneAAneEAneAAnOIAnuAAnuEAnuAAneEAn+EAnuEAnuAAneEAneAAneAAn+QAnuEAnuABnuEAneAAn+EAnuIAnuMBnuHeY3dlAAAAJ3RSTlMAQFAAYIAAkADP3wAgMACgEACfrwC/X++PbwAAcODwALDAANAATz8hP00ZAAACHklEQVR4Xq3XbWObIBAHcPAJJRjJVmtso4vL2vv+33AzJO2J/LuE9PfGFyR4HHiAgCQxyRMiYEtGTL5BBGzJiVEviIAtFTH6FRGowdBC/QsQqKGhhebeIdTkqe+LwFbkqew2SGyDftDKz12Q2AXYlhgeA46AD/G5oyD9zJO0zIEhvXd91L0mSPcmnZlek0nPhHu4mKu2ov+q2rZzOWE5kBRBFjNRzDRFqD6X8oGiHK5fo+0oSmcv06goknLfQk3RzHkaWwIGlUhrZaIGAto5iQn6uyw+yAFOpSgUTDEHJqqZc5DR2rgqw8lIa7mbRkkMLOOBoWZlWYrynwzGzx1C/3cdlEcvf7sgL5MTq8rGz22QNwjDP+cGBYBDOC6qcnLTNqQCeRbuYdEU4In47YjL84RSwEk+Tq8qT7xvhMc5eXsj78Buga866O4dQrXs4OEk3jaNTWC1Cfc43nSa0MQ0fCFFLWXL9saWFjQMgFOfEUR+zsl1KWeRBaWr3e7c01q3Lmld+FfiSVFQ/2ehp6B8IzaorGvJ8q8Jl/ViIkDv396tfX/bawKm81J+eGtLH91cX+xIUUZ7XYmPHTBmA0U4feMh6zqVwzTe8ubQvmBoUJeDphoIGtT5tVaq0Ttopvyom4M4xqz8YGXhiCLAnIKhg8N2iA30cLzrxmJH/H4cASejrjzcFHXpwrcukwIiRQZv2QICtjQP352/9fYuC+Qv593CTVvcgwkAAAAASUVORK5CYII=);
|
62 |
+
}
|
63 |
+
|
64 |
+
.aioseop_file_icon {
|
65 |
+
background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAMAAACdt4HsAAAAPFBMVEUAAAAAneAAn98AneIAneEAnuAAn+QAnuAAnuAAnuEAn+MAnuEAneAAnuEAn+EAneEAnOIAnuEAnuABnuG5yOaaAAAAE3RSTlMA0BBgn88wv++gQLCvX2+PUJDAyp/15gAAALdJREFUeF7t1z2ygzAMhVFJjm0C5Ff732uaMCSWCVzTJO/paz1zRsVtTM/OUT+Wx5PQchJ1Q2O/CETdVk51IOjWugAeYLvUAEU6rAO4oLhQB2bSvh+NAAKU2AgYQGIEDHgXbjhQCFcYKIQuoUApZBQwQg8CRhhAwArSBlCagNAI0LTqAQCq3fcC+jOA7e8DDuhK/wDwHfgOfAe+A98B2BcC3Aaw+XiCBdp3AtOcNAgs9FoACZ7ufwCe6pfMGb29UwAAAABJRU5ErkJggg==);
|
66 |
+
}
|
67 |
+
|
68 |
+
.aioseop_help_icon {
|
69 |
+
background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAMAAACdt4HsAAAAflBMVEUAAAAAn98AnuIAn+EAneAAnuAAnuAAn+QAn+QAneEAnuAAnuAAn+EAnuAAnuEAneAAn+cAneAAnuAAn98AnOIAnuEAneIAn+MAnuEAnuEAn+EAneIAneEAneEAnuEAn+MAneAAneEAnuMAnOIAn+cAneEBnuEAneAAnuMBnuEoGewkAAAAKXRSTlMAEE9/r7/fADCPzwBv718AIPDAAFCwYEAAoAAAn4CQAOAAPwAAcADQAFP96WQAAAMNSURBVHhelZcNc5swDIatBghpoCGEj9Jij2XLMv3/P7glkoNtZJo+d+0lhBOveSXZUjHgZZOkGf4nS5PNC5wiKPFqvnvFgNddvpVQy0tQZCiSFfCEAtiUGKXcwFcB3kpcpXx791HetypFn2NdH9EnrX67KPdL46g/tl3PeqHvWidM2fxyUM7n3fzgof8R0A9zjN3PGTV/HB+6teg66EeIUQqQIGOiSQMGmeRgUQfGPn/Ktyv0k9UQKrCxWzitAq3V6dvYIDG8f8mAROO6ULF/3ecTaHazcvIgjTw/PxfFeVFErCHd31C3fx2v39cKGy6qLKyA1tGr/v8BLWDyb3OLqiw+XGCiq8DFxIvypMKIHqMXvaeLmmyEkn1xSTCAjWcMS7gruFD+eo/QuEC7AYCy+nJXkC1/r5A4Gq2NrQCvjMnL7OZCLggY3KoAI5jMEvKt2hohBYK3wiveuwx8i3qn/uvVf0O2Hh5MnLwOZMTrXgGt4OCi7RuyXNg1F1oDqEZIQh2K6oUALalSWqgiIwUIM4VVqZZvdlkE7QQFFLRVNS3l5NLZarMkgkx6ebWiNPqzSu9nEkM2KDZhjbykh+19KKri3+LkIxLhVlE/E4CaAjsd4AYo9zJkR9huGF7CtPYSX9FyXG4XFHe2UQIt9fIGa6NNJBErX2r35O0wp7KEbZYSNpVtMYngSpbZYoI1G9YClFzOp+vKS6jviLFJ+fWgDralfZO5peW2xX8LKB9NdTtxsQuc7/wV0OTv/YRyiUuIugCls7FwizffsXHgzcRurjEjYgH8zdVKyODZJUDGAuxZubNnt5BIgMQ7YNyowy2c0XfCqyNX6HzE2Ve8A28+nmDDHaJyD9sNChpkxvCYRxgkEjitAkl40AzPjxm7KdNnSAzLgaNFZhcVATtkBmliGaTJSJ6mBnnkMWgpx+XAMZZoMbGZqXEHm6Q4sxA4F4k7DEkjD1PVGJCmGFDLQ5elO+Iqx7B/q88A0FKI+DSlBLMuE4pMF3h6+DZXDLia6PAtA41u67uUqW51E02uf46zvXx+HY4YAAAAAElFTkSuQmCC);
|
70 |
+
}
|
71 |
+
|
72 |
+
.aioseop_support_icon {
|
73 |
+
background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAMAAACdt4HsAAAAe1BMVEUAAAAAn98AnuIAn+EAneAAnuAAnuABnuEAn98An+QAneEAnuAAn+QAn+EAnuAAnuEAneAAnuEAneIAn+MAn+cAn+cAnuEAnuEAnOIAneEAneEAnOIAnuAAneEAn+MAneAAneEAneIAnuEAnuIAneAAnuAAneABnuEAnuPdwDkgAAAAKXRSTlMAEE9/r7/f/wAwj88Ab+9f0JBgQCAAALBQcAAAAJ8AAIAAoADgwPAAP4Dl7rAAAALsSURBVHgBtdcBc6I6EAfwRCH/KjUSTCW2eHK8kHff/xM+Dg5NlsTTOu830xmc0BhJdtllKXy1znKBgciz9Yq/JbC3mM22AFFsN+8x7H2B7wSixI4/sAK+lkiSa/63CfbXfy9VddAfA32oVHmdYn8MsaNP55jUhpOFmRqTXH/4mP/BSExOnxEnTKT58jDveouZaCIEZltvWna7POPm8GPhgJtzbIIMnvq4UMOTXWZsvjgjoD8IjcCZrkAh1H4SLUIq3EYDQjSEBGH8XdASVPUzUIGS2jsHORbyJpC8gzWDChGaPsL4ItnwxyUiuuPqnBdAkW9X/3SIkPxPMLWIkZJcL7XTNnKJb5J8XMEJ33YaVyCQYJUZ0tjGKIsE8XsXNuNUFpStvFMQGR4Xvhlyoppi51AjUAcZhdPRIVzr8UCzYzEfS91afxOJDle2Hc9IBaBoGMdg/raq/3s49/NPm/6TGQDl5Up3DoCN5G9uAbjOO6AlAMPa8Zd4JI0kP55k41EAWlaT+w0Ae4mytyAenQDUrCcZsCMr8igydADQM0ECrydf4zEA+uZGAygYBv96ivF4RG3GffNgsJiAfr439v9MUN7/CeXFgwGzrz1Eu9hG9eQ2Rg+SaKJE5CB1y6Ps7h1ld/FMR9mEm6vPEoCIBZMAIM/e8xoTQRjO+5y8fT0ZJvlc5PwJ57fymlDWMloBLKoHsb4mlPLCLnNKyxDIwpRGR72UtsEgUhoKrx7bR4Z3c1J9Tyft7ep3Wl9t04l/rFBefrFwh29y/N7L1TlynXy5JpbQHY3qS6Dslfnq4guYa+UXC4xBj4W+CSTvYFMEuOeLLKf9Ytssd5hw6TJv9FKhOeqeK3W7ZcNRP1Nsd7GOpXu83O/iLY8ij5CwmKlUz2TcIy2PIy2PT/eYZLRV5fsMk542XaHK3VrV/a+p7fu1uzWyjiZs9pPgrUOSa6ONJ8FPFlH2xB9uvlUJolTJ5juOm7buLQa2r1uvkSX+A/xd+1xZLxG0AAAAAElFTkSuQmCC);
|
74 |
+
}
|
75 |
+
|
76 |
+
.aioseop_youtube_icon {
|
77 |
+
background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAMAAACdt4HsAAAARVBMVEUAAAAAn+cAn+EAneAAnuABnuEAn+cAn98AneEAn98AnOIAnuAAnOIAneIAneIAnuEAnuEAneEAnuEBnuEAn+QAneAAneCXjc90AAAAF3RSTlMAIG+vz/8AEJ8AUO8AYACgAHCwADDw0E/SOHoAAAEBSURBVHgB7dbBjsIgGATgH+UvCAso3fL+j7rDYZMerGGZQ5NNv8TrREZLRy47F3O7Wx1m7zezAMjSOa9/5t2jkweEqBNi+ALBJ+mklHOWnINOC/0buKjTokMHRQnlKUYpRl5HBQ32KFXfW783HVDFHgWsrg0EWNEDK4z0+yEAEhuAIsgAFMEFQOECILEBKIIMQBFcABQuABIbgCLIABTBBUBhAzx5BEuWGM/9GT35V7bkwxTPfZw9eaVZ8lKN517rI8NHmr43cPyufXi5Rh1Q+dc7PTAWduI83abTNteHJjvz6KEJYeoU2+/UBVcm+tuNbTCv2nRYq2k/9ylXwL8I+AGj+lzlceKDYQAAAABJRU5ErkJggg==);
|
78 |
+
}
|
79 |
+
|
80 |
.aioseop_help_text_link.aioseop_meta_box_help:before {
|
81 |
font-size: 14px;
|
82 |
}
|
210 |
|
211 |
.aioseop_advert {
|
212 |
padding: 10px;
|
213 |
+
margin-bottom: 30px;
|
214 |
border: 1px solid #DDD;
|
215 |
height: 200px;
|
216 |
width: 423px;
|
217 |
}
|
218 |
|
219 |
+
.aioseop_nopad {
|
220 |
+
padding-left: 0px;
|
221 |
+
padding-top: 0px;
|
222 |
+
}
|
223 |
+
|
224 |
.aioseop_adverts {
|
225 |
float: right;
|
226 |
}
|
aioseop_module_class.php
CHANGED
@@ -16,6 +16,8 @@ if ( !class_exists( 'All_in_One_SEO_Pack_Module' ) ) {
|
|
16 |
protected $options;
|
17 |
protected $option_name;
|
18 |
protected $default_options;
|
|
|
|
|
19 |
protected $locations = null; // organize settings into settings pages with a menu items and/or metaboxes on post types edit screen; optional
|
20 |
protected $layout = null; // organize settings on a settings page into multiple, separate metaboxes; optional
|
21 |
protected $tabs = null; // organize layouts on a settings page into multiple, separate tabs; optional
|
@@ -299,15 +301,15 @@ if ( !class_exists( 'All_in_One_SEO_Pack_Module' ) ) {
|
|
299 |
if ( !empty( $matches ) ) {
|
300 |
if ( !empty( $matches[1] ) ) {
|
301 |
if ( function_exists( 'get_field' ) ) $result = get_field( $matches[1] );
|
302 |
-
|
303 |
-
|
304 |
-
|
305 |
-
|
306 |
-
|
307 |
-
|
308 |
-
|
309 |
-
|
310 |
-
|
311 |
}
|
312 |
|
313 |
/**
|
@@ -935,6 +937,45 @@ if ( !class_exists( 'All_in_One_SEO_Pack_Module' ) ) {
|
|
935 |
return current_user_can( 'level_8' );
|
936 |
}
|
937 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
938 |
/**
|
939 |
* Load scripts and styles for metaboxes.
|
940 |
*/
|
@@ -942,15 +983,22 @@ if ( !class_exists( 'All_in_One_SEO_Pack_Module' ) ) {
|
|
942 |
$screen = '';
|
943 |
if ( function_exists( 'get_current_screen' ) )
|
944 |
$screen = get_current_screen();
|
945 |
-
|
946 |
-
if ( ( $screen
|
|
|
|
|
|
|
|
|
947 |
if ( $screen->base == 'edit-tags' ) $this->form = 'edittag';
|
948 |
if ( $screen->base == 'toplevel_page_shopp-products' ) $this->form = 'product';
|
|
|
949 |
foreach( $this->locations as $k => $v ) {
|
950 |
if ( $v['type'] === 'metabox' ) {
|
951 |
if ( isset( $v['display'] ) && !empty( $v['display'] ) ) {
|
952 |
-
|
953 |
-
|
|
|
|
|
954 |
add_filter( 'aioseop_localize_script_data', Array( $this, 'localize_script_data' ) );
|
955 |
add_action( "admin_print_scripts", Array( $this, 'enqueue_scripts' ), 20 );
|
956 |
add_action( "admin_print_scripts", Array( $this, 'enqueue_styles' ), 20 );
|
@@ -1253,8 +1301,8 @@ if ( !class_exists( 'All_in_One_SEO_Pack_Module' ) ) {
|
|
1253 |
$onload = '';
|
1254 |
if ( !empty( $options['count'] ) ) {
|
1255 |
$n++;
|
1256 |
-
$attr .= " onKeyDown='countChars(document.{$this->form}.$name,document.{$this->form}.{$prefix}length$n)' onKeyUp='countChars(document.{$this->form}.$name,document.{$this->form}.{$prefix}length$n)'";
|
1257 |
-
$onload = "countChars(document.{$this->form}.$name,document.{$this->form}.{$prefix}length$n);";
|
1258 |
}
|
1259 |
if ( isset( $opts['id'] ) ) $attr .= " id=\"{$opts['id']}\" ";
|
1260 |
switch ( $options['type'] ) {
|
@@ -1364,11 +1412,11 @@ if ( !class_exists( 'All_in_One_SEO_Pack_Module' ) ) {
|
|
1364 |
if ( !empty( $arg_keys[$s] ) ) $args[$s] = $settings[$s];
|
1365 |
} else $args = $settings;
|
1366 |
foreach ( $args as $name => $opts ) {
|
1367 |
-
$attr_list = Array( 'class', 'style', 'readonly', 'disabled', 'size' );
|
1368 |
if ( $opts['type'] == 'textarea' ) $attr_list = array_merge( $attr_list, Array('rows', 'cols') );
|
1369 |
$attr = '';
|
1370 |
foreach ( $attr_list as $a )
|
1371 |
-
if ( isset( $opts[$a] ) ) $attr .=
|
1372 |
$opt = '';
|
1373 |
if ( isset( $current_options[$name] ) ) $opt = $current_options[$name];
|
1374 |
if ( $opts['label'] == 'none' && $opts['type'] == 'submit' && $opts['save'] == false ) $opt = $opts['name'];
|
@@ -1387,6 +1435,15 @@ if ( !class_exists( 'All_in_One_SEO_Pack_Module' ) ) {
|
|
1387 |
}
|
1388 |
if ( !$container ) echo "</div>";
|
1389 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1390 |
|
1391 |
/** Sanitize options */
|
1392 |
function sanitize_options( $location = null ) {
|
16 |
protected $options;
|
17 |
protected $option_name;
|
18 |
protected $default_options;
|
19 |
+
protected $help_text = Array();
|
20 |
+
protected $help_anchors = Array();
|
21 |
protected $locations = null; // organize settings into settings pages with a menu items and/or metaboxes on post types edit screen; optional
|
22 |
protected $layout = null; // organize settings on a settings page into multiple, separate metaboxes; optional
|
23 |
protected $tabs = null; // organize layouts on a settings page into multiple, separate tabs; optional
|
301 |
if ( !empty( $matches ) ) {
|
302 |
if ( !empty( $matches[1] ) ) {
|
303 |
if ( function_exists( 'get_field' ) ) $result = get_field( $matches[1] );
|
304 |
+
if ( empty( $result ) ) {
|
305 |
+
global $post;
|
306 |
+
if ( !empty( $post ) ) $result = get_post_meta( $post->ID, $matches[1], true );
|
307 |
+
}
|
308 |
+
if ( empty( $result ) ) $result = $matches[0];
|
309 |
+
} else $result = $matches[0];
|
310 |
+
}
|
311 |
+
$result = strip_tags( $result );
|
312 |
+
return $result;
|
313 |
}
|
314 |
|
315 |
/**
|
937 |
return current_user_can( 'level_8' );
|
938 |
}
|
939 |
|
940 |
+
function help_text_helper( &$default_options, $options, $help_link = '' ) {
|
941 |
+
foreach( $options as $o ) {
|
942 |
+
$ht = '';
|
943 |
+
if ( !empty( $this->help_text[$o] ) )
|
944 |
+
$ht = $this->help_text[$o];
|
945 |
+
elseif ( !empty( $default_options[$o]["help_text"] ) )
|
946 |
+
$ht = $default_options[$o]["help_text"];
|
947 |
+
if ( $ht ) {
|
948 |
+
$ha = '';
|
949 |
+
$hl = $help_link;
|
950 |
+
if ( strpos( $o, 'ga_' ) === 0 ) { // special case -- pdb
|
951 |
+
$hl = 'http://semperplugins.com/documentation/advanced-google-analytics-settings/';
|
952 |
+
}
|
953 |
+
if ( !empty( $this->help_anchors[$o] ) ) $ha = $this->help_anchors[$o];
|
954 |
+
if ( ( !empty( $ha ) && ( $pos = strrpos( $hl, '#' ) ) ) ) {
|
955 |
+
$hl = substr( $hl, 0, $pos );
|
956 |
+
}
|
957 |
+
if ( ( !empty( $ha ) && ( $ha[0] == 'h' ) ) ) $hl = '';
|
958 |
+
if ( !empty( $ha ) || !isset( $this->help_anchors[$o] ) )
|
959 |
+
$ht .= "<br /><a href='" . $hl . $ha . "' target='_blank'>" . __( "Click here for documentation on this setting", 'all_in_one_seo_pack' ) . "</a>";
|
960 |
+
$default_options[$o]['help_text'] = $ht;
|
961 |
+
}
|
962 |
+
}
|
963 |
+
}
|
964 |
+
|
965 |
+
function add_help_text_links() {
|
966 |
+
if ( !empty( $this->help_text ) ) {
|
967 |
+
foreach( $this->layout as $k => $v ) {
|
968 |
+
$this->help_text_helper( $this->default_options, $v['options'], $v['help_link'] );
|
969 |
+
}
|
970 |
+
if ( !empty( $this->locations ) )
|
971 |
+
foreach( $this->locations as $k => $v ) {
|
972 |
+
if ( !empty( $v['default_options'] ) && !empty( $v['options'] ) ) {
|
973 |
+
$this->help_text_helper( $this->locations[$k]['default_options'], $v['options'], $v['help_link'] );
|
974 |
+
}
|
975 |
+
}
|
976 |
+
}
|
977 |
+
}
|
978 |
+
|
979 |
/**
|
980 |
* Load scripts and styles for metaboxes.
|
981 |
*/
|
983 |
$screen = '';
|
984 |
if ( function_exists( 'get_current_screen' ) )
|
985 |
$screen = get_current_screen();
|
986 |
+
$bail = false;
|
987 |
+
if ( empty( $screen ) ) $bail = true;
|
988 |
+
if ( ( $screen->base != 'post' ) && ( $screen->base != 'edit-tags' ) && ( $screen->base != 'toplevel_page_shopp-products' ) ) $bail = true;
|
989 |
+
$prefix = $this->get_prefix();
|
990 |
+
$bail = apply_filters( $prefix . 'bail_on_enqueue', $bail, $screen );
|
991 |
+
if ( $bail ) return;
|
992 |
if ( $screen->base == 'edit-tags' ) $this->form = 'edittag';
|
993 |
if ( $screen->base == 'toplevel_page_shopp-products' ) $this->form = 'product';
|
994 |
+
$this->form = apply_filters( $prefix . 'set_form_on_enqueue', $this->form, $screen );
|
995 |
foreach( $this->locations as $k => $v ) {
|
996 |
if ( $v['type'] === 'metabox' ) {
|
997 |
if ( isset( $v['display'] ) && !empty( $v['display'] ) ) {
|
998 |
+
$enqueue_scripts = false;
|
999 |
+
$enqueue_scripts = ( ( ( $screen->base == 'toplevel_page_shopp-products' ) && in_array( 'shopp_product', $v['display'] ) ) ) || in_array( $screen->post_type, $v['display'] );
|
1000 |
+
$enqueue_scripts = apply_filters( $prefix . 'enqueue_metabox_scripts', $enqueue_scripts, $screen, $v );
|
1001 |
+
if ( $enqueue_scripts ) {
|
1002 |
add_filter( 'aioseop_localize_script_data', Array( $this, 'localize_script_data' ) );
|
1003 |
add_action( "admin_print_scripts", Array( $this, 'enqueue_scripts' ), 20 );
|
1004 |
add_action( "admin_print_scripts", Array( $this, 'enqueue_styles' ), 20 );
|
1301 |
$onload = '';
|
1302 |
if ( !empty( $options['count'] ) ) {
|
1303 |
$n++;
|
1304 |
+
$attr .= " onKeyDown='if (typeof countChars == \"function\") countChars(document.{$this->form}.$name,document.{$this->form}.{$prefix}length$n)' onKeyUp='if (typeof countChars == \"function\") countChars(document.{$this->form}.$name,document.{$this->form}.{$prefix}length$n)'";
|
1305 |
+
$onload = "if (typeof countChars == \"function\") countChars(document.{$this->form}.$name,document.{$this->form}.{$prefix}length$n);";
|
1306 |
}
|
1307 |
if ( isset( $opts['id'] ) ) $attr .= " id=\"{$opts['id']}\" ";
|
1308 |
switch ( $options['type'] ) {
|
1412 |
if ( !empty( $arg_keys[$s] ) ) $args[$s] = $settings[$s];
|
1413 |
} else $args = $settings;
|
1414 |
foreach ( $args as $name => $opts ) {
|
1415 |
+
$attr_list = Array( 'class', 'style', 'readonly', 'disabled', 'size', 'placeholder' );
|
1416 |
if ( $opts['type'] == 'textarea' ) $attr_list = array_merge( $attr_list, Array('rows', 'cols') );
|
1417 |
$attr = '';
|
1418 |
foreach ( $attr_list as $a )
|
1419 |
+
if ( isset( $opts[$a] ) ) $attr .= ' ' . $a . '="' . esc_attr( $opts[$a] ) . '" ';
|
1420 |
$opt = '';
|
1421 |
if ( isset( $current_options[$name] ) ) $opt = $current_options[$name];
|
1422 |
if ( $opts['label'] == 'none' && $opts['type'] == 'submit' && $opts['save'] == false ) $opt = $opts['name'];
|
1435 |
}
|
1436 |
if ( !$container ) echo "</div>";
|
1437 |
}
|
1438 |
+
|
1439 |
+
function sanitize_domain( $domain ) {
|
1440 |
+
$domain = trim( $domain );
|
1441 |
+
$domain = $this->strtolower( $domain );
|
1442 |
+
if ( $this->strpos( $domain, "http://" ) === 0 ) $domain = $this->substr( $domain, 7 );
|
1443 |
+
elseif ( $this->strpos( $domain, "https://" ) === 0 ) $domain = $this->substr( $domain, 8 );
|
1444 |
+
$domain = untrailingslashit( $domain );
|
1445 |
+
return $domain;
|
1446 |
+
}
|
1447 |
|
1448 |
/** Sanitize options */
|
1449 |
function sanitize_options( $location = null ) {
|
aioseop_opengraph.php
CHANGED
@@ -8,6 +8,7 @@
|
|
8 |
if ( !class_exists( 'All_in_One_SEO_Pack_Opengraph' ) ) {
|
9 |
class All_in_One_SEO_Pack_Opengraph extends All_in_One_SEO_Pack_Module {
|
10 |
var $fb_object_types;
|
|
|
11 |
|
12 |
function All_in_One_SEO_Pack_Opengraph( ) {
|
13 |
$this->name = __('Social Meta', 'all_in_one_seo_pack'); // Human-readable name of the plugin
|
@@ -71,45 +72,70 @@ if ( !class_exists( 'All_in_One_SEO_Pack_Opengraph' ) ) {
|
|
71 |
)
|
72 |
);
|
73 |
parent::__construct();
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
"
|
79 |
-
"
|
80 |
-
"
|
81 |
-
"
|
82 |
-
"
|
83 |
-
"
|
84 |
-
"
|
85 |
-
"
|
86 |
-
"
|
87 |
-
"
|
88 |
-
"
|
89 |
-
"
|
90 |
-
"
|
91 |
-
"
|
92 |
-
"
|
93 |
-
"
|
94 |
-
"
|
95 |
-
"
|
96 |
-
"
|
97 |
-
|
98 |
-
"defcard" => __( "Select the default type of Twitter card to display.<br /><a href='http://semperplugins.com/documentation/social-meta-module/' target='_blank'>Click here for documentation on this setting</a>", 'all_in_one_seo_pack' ),
|
99 |
-
"setcard" => __( "Select the default type of Twitter card to display.<br /><a href='http://semperplugins.com/documentation/social-meta-module/' target='_blank'>Click here for documentation on this setting</a>", 'all_in_one_seo_pack' ),
|
100 |
-
"twitter_site" => __( "Enter the Twitter username associated with your website here.<br /><a href='http://semperplugins.com/documentation/social-meta-module/' target='_blank'>Click here for documentation on this setting</a>", 'all_in_one_seo_pack' ),
|
101 |
-
"twitter_creator" => __( "Allows your authors to be identified by their Twitter usernames as content creators on the Twitter cards for their posts.<br /><a href='http://semperplugins.com/documentation/social-meta-module/' target='_blank'>Click here for documentation on this setting</a>", 'all_in_one_seo_pack' ),
|
102 |
-
"twitter_domain" => __( "Enter the name of your website here.<br /><a href='http://semperplugins.com/documentation/social-meta-module/' target='_blank'>Click here for documentation on this setting</a>", 'all_in_one_seo_pack' ),
|
103 |
-
"types" => __( "Select which Post Types you want to use All in One SEO Pack to set Open Graph meta values for.<br /><a href='http://semperplugins.com/documentation/social-meta-module/' target='_blank'>Click here for documentation on this setting</a>", 'all_in_one_seo_pack' ),
|
104 |
-
"title" => __( "This is the Open Graph title of this Page or Post.<br /><a href='http://semperplugins.com/documentation/social-meta-module/' target='_blank'>Click here for documentation on this setting</a>", 'all_in_one_seo_pack' ),
|
105 |
-
"desc" => __( "This is the Open Graph description of this Page or Post.<br /><a href='http://semperplugins.com/documentation/social-meta-module/' target='_blank'>Click here for documentation on this setting</a>", 'all_in_one_seo_pack' ),
|
106 |
-
"category" => __( "Select the Open Graph type that best describes the content of this Page or Post.<br /><a href='http://semperplugins.com/documentation/social-meta-module/' target='_blank'>Click here for documentation on this setting</a>", 'all_in_one_seo_pack' ),
|
107 |
-
"section" => __( "This Open Graph meta allows you to add a general section name that best describes this content.<br /><a href='http://semperplugins.com/documentation/social-meta-module/' target='_blank'>Click here for documentation on this setting</a>", 'all_in_one_seo_pack' ),
|
108 |
-
"tag" => __( "This Open Graph meta allows you to add a list of keywords that best describe this content.<br /><a href='http://semperplugins.com/documentation/social-meta-module/' target='_blank'>Click here for documentation on this setting</a>", 'all_in_one_seo_pack' ),
|
109 |
-
"facebook_publisher" => __( "Link articles to the Facebook page associated with your website.<br /><a href='http://semperplugins.com/documentation/social-meta-module/' target='_blank'>Click here for documentation on this setting</a>", 'all_in_one_seo_pack' ),
|
110 |
-
"facebook_author" => __( "Allows your authors to be identified by their Facebook pages as content authors on the Opengraph meta for their articles.<br /><a href='http://semperplugins.com/documentation/social-meta-module/' target='_blank'>Click here for documentation on this setting</a>", 'all_in_one_seo_pack' ),
|
111 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
112 |
);
|
|
|
113 |
$count_desc = __( " characters. Open Graph allows up to a maximum of %s chars for the %s.", 'all_in_one_seo_pack' );
|
114 |
$this->default_options = array(
|
115 |
'scan_header'=> Array( 'name' => __( 'Scan Header', 'all_in_one_seo_pack' ), 'type' => 'custom', 'save' => true ),
|
@@ -122,8 +148,9 @@ if ( !class_exists( 'All_in_One_SEO_Pack_Opengraph' ) ) {
|
|
122 |
'default' => '', 'type' => 'textarea', 'condshow' => Array( 'aiosp_opengraph_setmeta' => Array( 'lhs' => "aiosp_opengraph_setmeta", 'op' => '!=', 'rhs' => 'on' ) ) ),
|
123 |
'homeimage' => Array( 'name' => __( 'Home Image', 'all_in_one_seo_pack' ),
|
124 |
'type' => 'image' ),
|
|
|
|
|
125 |
'generate_descriptions' => Array( 'name' => __( 'Autogenerate OG Descriptions', 'all_in_one_seo_pack' ), 'default' => 1 ),
|
126 |
-
'disable_jetpack' => Array( 'name' => __( 'Disable Jetpack Tags', 'all_in_one_seo_pack' ), 'default' => 0 ),
|
127 |
'defimg' => Array( 'name' => __( 'Select OG:Image Source', 'all_in_one_seo_pack' ), 'type' => 'select', 'initial_options' => Array( '' => __( 'Default Image' ), 'featured' => __( 'Featured Image' ), 'attach' => __( 'First Attached Image' ), 'content' => __( 'First Image In Content' ), 'custom' => __( 'Image From Custom Field' ), 'author' => __( 'Post Author Image' ), 'auto' => __( 'First Available Image' ) ) ),
|
128 |
'fallback' => Array( 'name' => __( 'Use Default If No Image Found', 'all_in_one_seo_pack' ), 'type' => 'checkbox' ),
|
129 |
'dimg' => Array( 'name' => __( 'Default OG:Image', 'all_in_one_seo_pack' ), 'default' => AIOSEOP_PLUGIN_IMAGES_URL . 'default-user-image.png', 'type' => 'image' ),
|
@@ -174,10 +201,6 @@ if ( !class_exists( 'All_in_One_SEO_Pack_Opengraph' ) ) {
|
|
174 |
|
175 |
);
|
176 |
|
177 |
-
if ( !empty( $help_text ) )
|
178 |
-
foreach( $help_text as $k => $v )
|
179 |
-
$this->default_options[$k]['help_text'] = $v;
|
180 |
-
|
181 |
// load initial options / set defaults
|
182 |
$this->update_options( );
|
183 |
|
@@ -186,7 +209,7 @@ if ( !class_exists( 'All_in_One_SEO_Pack_Opengraph' ) ) {
|
|
186 |
|
187 |
$this->locations = array(
|
188 |
'opengraph' => Array( 'name' => $this->name, 'prefix' => 'aiosp_', 'type' => 'settings',
|
189 |
-
'options' => Array('scan_header', 'setmeta', 'key', 'sitename', 'hometitle', 'description', 'homeimage', '
|
190 |
'settings' => Array( 'name' => __('Social Settings', 'all_in_one_seo_pack'),
|
191 |
'type' => 'metabox', 'help_link' => 'http://semperplugins.com/documentation/social-meta-module/#pagepost_settings',
|
192 |
'options' => Array( 'title', 'desc', 'image', 'customimg', 'imagewidth', 'imageheight', 'video', 'videowidth', 'videoheight', 'category', 'section', 'tag', 'setcard' ),
|
@@ -203,7 +226,7 @@ if ( !class_exists( 'All_in_One_SEO_Pack_Opengraph' ) ) {
|
|
203 |
'home' => Array(
|
204 |
'name' => __( 'Home Page Settings', 'all_in_one_seo_pack' ),
|
205 |
'help_link' => 'http://semperplugins.com/documentation/social-meta-module/',
|
206 |
-
'options' => Array( 'setmeta', 'sitename', 'hometitle', 'description', 'homeimage' )
|
207 |
),
|
208 |
'image' => Array(
|
209 |
'name' => __( 'Image Settings', 'all_in_one_seo_pack' ),
|
@@ -234,8 +257,16 @@ if ( !class_exists( 'All_in_One_SEO_Pack_Opengraph' ) ) {
|
|
234 |
|
235 |
$this->layout['default']['options'] = array_diff( array_keys( $this->default_options ), $other_options );
|
236 |
|
237 |
-
|
|
|
|
|
|
|
|
|
|
|
238 |
if( !is_admin() || defined( 'DOING_AJAX' ) ){ $this->do_opengraph(); }
|
|
|
|
|
|
|
239 |
}
|
240 |
|
241 |
function settings_page_init() {
|
@@ -353,12 +384,38 @@ if ( !class_exists( 'All_in_One_SEO_Pack_Opengraph' ) ) {
|
|
353 |
}
|
354 |
|
355 |
function add_attributes( $output ) { // avoid having duplicate meta tags
|
356 |
-
|
357 |
-
|
358 |
-
|
359 |
-
|
360 |
-
|
361 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
362 |
foreach( $attributes as $attr ) {
|
363 |
if ( strpos( $output, $attr ) === false ) {
|
364 |
$output .= "\n\t$attr ";
|
@@ -374,8 +431,7 @@ if ( !class_exists( 'All_in_One_SEO_Pack_Opengraph' ) ) {
|
|
374 |
$dimg = $this->options['aiosp_opengraph_dimg'];
|
375 |
$current_post_type = get_post_type();
|
376 |
$title = $description = $image = $video = '';
|
377 |
-
$type =
|
378 |
-
|
379 |
$sitename = $this->options['aiosp_opengraph_sitename'];
|
380 |
|
381 |
if ( !empty( $aioseop_options['aiosp_hide_paginated_descriptions'] ) ) {
|
@@ -385,13 +441,13 @@ if ( !class_exists( 'All_in_One_SEO_Pack_Opengraph' ) ) {
|
|
385 |
$first_page = true;
|
386 |
}
|
387 |
$url = $aiosp->aiosp_mrt_get_url( $wp_query );
|
388 |
-
$url = apply_filters( 'aioseop_canonical_url', $url );
|
|
|
389 |
$setmeta = $this->options['aiosp_opengraph_setmeta'];
|
390 |
-
if (
|
391 |
$title = $this->options['aiosp_opengraph_hometitle'];
|
392 |
if ( $first_page )
|
393 |
$description = $this->options['aiosp_opengraph_description'];
|
394 |
-
$type = $this->options['aiosp_opengraph_categories'];
|
395 |
if ( !empty( $this->options['aiosp_opengraph_homeimage'] ) )
|
396 |
$thumbnail = $this->options['aiosp_opengraph_homeimage'];
|
397 |
else
|
@@ -412,15 +468,13 @@ if ( !class_exists( 'All_in_One_SEO_Pack_Opengraph' ) ) {
|
|
412 |
$description = $aiosp->trim_excerpt_without_filters( $aiosp->internationalize( preg_replace( '/\s+/', ' ', $post->post_content ) ), 1000 );
|
413 |
|
414 |
if ( empty($description) && $first_page ) $description = get_bloginfo('description');
|
415 |
-
|
|
|
|
|
416 |
} elseif ( is_singular( ) && $this->option_isset('types')
|
417 |
&& is_array( $this->options['aiosp_opengraph_types'] )
|
418 |
&& in_array( $current_post_type, $this->options['aiosp_opengraph_types'] ) ) {
|
419 |
-
|
420 |
-
$type = $metabox['aioseop_opengraph_settings_category'];
|
421 |
-
} elseif ( isset( $this->options["aiosp_opengraph_{$current_post_type}_fb_object_type"] ) ) {
|
422 |
-
$type = $this->options["aiosp_opengraph_{$current_post_type}_fb_object_type"];
|
423 |
-
}
|
424 |
if ( $type == 'article' && ( !empty( $metabox['aioseop_opengraph_settings_section'] ) ) ) {
|
425 |
$section = $metabox['aioseop_opengraph_settings_section'];
|
426 |
}
|
@@ -466,6 +520,13 @@ if ( !class_exists( 'All_in_One_SEO_Pack_Opengraph' ) ) {
|
|
466 |
if ( empty( $type ) ) $type = 'article';
|
467 |
} else return;
|
468 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
469 |
if ( !empty( $description ) )
|
470 |
$description = $aiosp->trim_excerpt_without_filters( $aiosp->internationalize( preg_replace( '/\s+/', ' ', $description ) ), 1000 );
|
471 |
|
@@ -513,6 +574,8 @@ if ( !class_exists( 'All_in_One_SEO_Pack_Opengraph' ) ) {
|
|
513 |
if ( ( empty( $thumbnail ) && !empty( $this->options['aiosp_opengraph_fallback'] ) ) )
|
514 |
$thumbnail = $this->options['aiosp_opengraph_dimg'];
|
515 |
|
|
|
|
|
516 |
$width = $height = '';
|
517 |
if ( !empty( $thumbnail ) ) {
|
518 |
if ( !empty( $metabox['aioseop_opengraph_settings_imagewidth'] ) )
|
@@ -628,7 +691,13 @@ if ( !class_exists( 'All_in_One_SEO_Pack_Opengraph' ) ) {
|
|
628 |
if ( empty( $$k ) ) $$k = '';
|
629 |
$filtered_value = $$k;
|
630 |
$filtered_value = apply_filters( $this->prefix . 'meta', $filtered_value, $t, $k );
|
631 |
-
if ( !empty( $filtered_value ) )
|
|
|
|
|
|
|
|
|
|
|
|
|
632 |
}
|
633 |
}
|
634 |
|
@@ -640,6 +709,23 @@ if ( !class_exists( 'All_in_One_SEO_Pack_Opengraph' ) ) {
|
|
640 |
add_action( 'aioseop_modules_wp_head', Array( $this, 'add_meta' ), 5 );
|
641 |
}
|
642 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
643 |
function debug_post_types( ) {
|
644 |
add_filter( $this->prefix . 'display_settings', Array( $this, 'filter_settings' ), 10, 3 );
|
645 |
add_filter( $this->prefix . 'override_options', Array( $this, 'override_options' ), 10, 3 );
|
@@ -652,19 +738,22 @@ if ( !class_exists( 'All_in_One_SEO_Pack_Opengraph' ) ) {
|
|
652 |
$field = $slug . '_fb_object_type';
|
653 |
$this->default_options[$field] = Array(
|
654 |
'name' => "$name " . __( 'Object Type', 'all_in_one_seo_pack' ) . "<br />($slug)",
|
655 |
-
'help_text' => __( 'Choose a default value that best describes the content of your post type.', 'all_in_one_seo_pack' ),
|
656 |
'type' => 'select',
|
657 |
'style' => '',
|
658 |
'initial_options' => $this->fb_object_types,
|
659 |
'default' => 'article',
|
660 |
'condshow' => Array( 'aiosp_opengraph_types\[\]' => $slug )
|
661 |
);
|
|
|
|
|
662 |
$this->locations['opengraph']['options'][] = $field;
|
663 |
$this->layout['facebook']['options'][] = $field;
|
664 |
}
|
665 |
$this->setting_options();
|
|
|
|
|
666 |
}
|
667 |
-
|
668 |
function get_all_images( $options = null, $p = null ) {
|
669 |
static $img = Array();
|
670 |
if ( !is_array( $options ) ) $options = Array();
|
8 |
if ( !class_exists( 'All_in_One_SEO_Pack_Opengraph' ) ) {
|
9 |
class All_in_One_SEO_Pack_Opengraph extends All_in_One_SEO_Pack_Module {
|
10 |
var $fb_object_types;
|
11 |
+
var $type;
|
12 |
|
13 |
function All_in_One_SEO_Pack_Opengraph( ) {
|
14 |
$this->name = __('Social Meta', 'all_in_one_seo_pack'); // Human-readable name of the plugin
|
72 |
)
|
73 |
);
|
74 |
parent::__construct();
|
75 |
+
|
76 |
+
$categories = Array( 'blog' => __( 'Blog', 'all_in_one_seo_pack' ), 'website' => __( 'Website', 'all_in_one_seo_pack' ), 'article' => __( 'Article', 'all_in_one_seo_pack' ) );
|
77 |
+
|
78 |
+
$this->help_text = Array(
|
79 |
+
"setmeta" => __( "Checking this box will use the Home Title and Home Description set in All in One SEO Pack, General Settings as the Open Graph title and description for your home page.", 'all_in_one_seo_pack' ),
|
80 |
+
"key" => __( "Your Profile Admin ID is your Facebook profile ID. You can find out your Facebook ID using the lookup tool here: https://graph.facebook.com/yourusername", 'all_in_one_seo_pack' ),
|
81 |
+
"sitename" => __( "The Site Name is the name that is used to identify your website.", 'all_in_one_seo_pack' ),
|
82 |
+
"hometitle" => __( "The Home Title is the Open Graph title for your home page.", 'all_in_one_seo_pack' ),
|
83 |
+
"description" => __( "The Home Description is the Open Graph description for your home page.", 'all_in_one_seo_pack' ),
|
84 |
+
"homeimage" => __( "The Home Image is the Open Graph image for your home page.", 'all_in_one_seo_pack' ),
|
85 |
+
"hometag" => __( "The Home Tag allows you to add a list of keywords that best describe your home page content.", 'all_in_one_seo_pack' ),
|
86 |
+
"generate_descriptions" => __( "Check this and your Open Graph descriptions will be auto-generated from your content.", 'all_in_one_seo_pack' ),
|
87 |
+
"defimg" => __( "This option lets you choose which image will be displayed by default for the Open Graph image. You may override this on individual posts.", 'all_in_one_seo_pack' ),
|
88 |
+
"fallback" => __( "This option lets you fall back to the default image if no image could be found above.", 'all_in_one_seo_pack' ),
|
89 |
+
"dimg" => __( "This option sets a default image that can be used for the Open Graph image. You can upload an image, select an image from your Media Library or paste the URL of an image here.", 'all_in_one_seo_pack' ),
|
90 |
+
"meta_key" => __( "Enter the name of a custom field (or multiple field names separated by commas) to use that field to specify the Open Graph image on Pages or Posts.", 'all_in_one_seo_pack' ),
|
91 |
+
"categories" => __( "Set the Open Graph type for your website as either a blog or a website.", 'all_in_one_seo_pack' ),
|
92 |
+
"image" => __( "This option lets you select the Open Graph image that will be used for this Page or Post, overriding the default settings.", 'all_in_one_seo_pack' ),
|
93 |
+
"customimg" => __( "This option lets you upload an image to use as the Open Graph image for this Page or Post.", 'all_in_one_seo_pack' ),
|
94 |
+
"imagewidth" => __( "Enter the width for your Open Graph image in pixels (i.e. 600).", 'all_in_one_seo_pack' ),
|
95 |
+
"imageheight" => __( "Enter the height for your Open Graph image in pixels (i.e. 600).", 'all_in_one_seo_pack' ),
|
96 |
+
"video" => __( "This option lets you specify a link to the Open Graph video used on this Page or Post.", 'all_in_one_seo_pack' ),
|
97 |
+
"videowidth" => __( "Enter the width for your Open Graph video in pixels (i.e. 600).", 'all_in_one_seo_pack' ),
|
98 |
+
"videoheight" => __( "Enter the height for your Open Graph video in pixels (i.e. 600).", 'all_in_one_seo_pack' ),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
99 |
|
100 |
+
"defcard" => __( "Select the default type of Twitter card to display.", 'all_in_one_seo_pack' ),
|
101 |
+
"setcard" => __( "Select the default type of Twitter card to display.", 'all_in_one_seo_pack' ),
|
102 |
+
"twitter_site" => __( "Enter the Twitter username associated with your website here.", 'all_in_one_seo_pack' ),
|
103 |
+
"twitter_creator" => __( "Allows your authors to be identified by their Twitter usernames as content creators on the Twitter cards for their posts.", 'all_in_one_seo_pack' ),
|
104 |
+
"twitter_domain" => __( "Enter the name of your website here.", 'all_in_one_seo_pack' ),
|
105 |
+
"types" => __( "Select which Post Types you want to use All in One SEO Pack to set Open Graph meta values for.", 'all_in_one_seo_pack' ),
|
106 |
+
"title" => __( "This is the Open Graph title of this Page or Post.", 'all_in_one_seo_pack' ),
|
107 |
+
"desc" => __( "This is the Open Graph description of this Page or Post.", 'all_in_one_seo_pack' ),
|
108 |
+
"category" => __( "Select the Open Graph type that best describes the content of this Page or Post.", 'all_in_one_seo_pack' ),
|
109 |
+
"section" => __( "This Open Graph meta allows you to add a general section name that best describes this content.", 'all_in_one_seo_pack' ),
|
110 |
+
"tag" => __( "This Open Graph meta allows you to add a list of keywords that best describe this content.", 'all_in_one_seo_pack' ),
|
111 |
+
"facebook_publisher" => __( "Link articles to the Facebook page associated with your website.", 'all_in_one_seo_pack' ),
|
112 |
+
"facebook_author" => __( "Allows your authors to be identified by their Facebook pages as content authors on the Opengraph meta for their articles.", 'all_in_one_seo_pack' ),
|
113 |
+
);
|
114 |
+
|
115 |
+
$this->help_anchors = Array(
|
116 |
+
'generate_descriptions' => '#auto-generate-og-descriptions',
|
117 |
+
'setmeta' => '#use-aioseo-title-and-description',
|
118 |
+
'sitename' => '#site-name',
|
119 |
+
'hometitle' => '#home-title-and-description',
|
120 |
+
'description' => '#home-title-and-description',
|
121 |
+
'homeimage' => '#home-image',
|
122 |
+
'defimg' => '#select-og-image-source',
|
123 |
+
'fallback' => '#use-default-if-no-image-found',
|
124 |
+
'dimg' => '#default-og-image',
|
125 |
+
'meta_key' => '#use-custom-field-for-image',
|
126 |
+
'key' => '#profile-admins-id',
|
127 |
+
'categories' => '#facebook-object-type',
|
128 |
+
'facebook_publisher' => '#show-facebook-publisher-on-articles',
|
129 |
+
'facebook_author' => '#show-facebook-author-on-articles',
|
130 |
+
'types' => '#enable-facebook-meta-for',
|
131 |
+
'defcard' => '#default-twitter-card',
|
132 |
+
'setcard' => '#default-twitter-card',
|
133 |
+
'twitter_site' => '#twitter-site',
|
134 |
+
'twitter_creator' => '#show-twitter-author',
|
135 |
+
'twitter_domain' => '#twitter-domain',
|
136 |
+
'scan_header' => '#scan-social-meta'
|
137 |
);
|
138 |
+
|
139 |
$count_desc = __( " characters. Open Graph allows up to a maximum of %s chars for the %s.", 'all_in_one_seo_pack' );
|
140 |
$this->default_options = array(
|
141 |
'scan_header'=> Array( 'name' => __( 'Scan Header', 'all_in_one_seo_pack' ), 'type' => 'custom', 'save' => true ),
|
148 |
'default' => '', 'type' => 'textarea', 'condshow' => Array( 'aiosp_opengraph_setmeta' => Array( 'lhs' => "aiosp_opengraph_setmeta", 'op' => '!=', 'rhs' => 'on' ) ) ),
|
149 |
'homeimage' => Array( 'name' => __( 'Home Image', 'all_in_one_seo_pack' ),
|
150 |
'type' => 'image' ),
|
151 |
+
'hometag' => Array('name' => __( 'Home Article Tags', 'all_in_one_seo_pack' ),
|
152 |
+
'type' => 'text', 'default' => '', 'condshow' => Array( 'aiosp_opengraph_categories' => 'article' ) ),
|
153 |
'generate_descriptions' => Array( 'name' => __( 'Autogenerate OG Descriptions', 'all_in_one_seo_pack' ), 'default' => 1 ),
|
|
|
154 |
'defimg' => Array( 'name' => __( 'Select OG:Image Source', 'all_in_one_seo_pack' ), 'type' => 'select', 'initial_options' => Array( '' => __( 'Default Image' ), 'featured' => __( 'Featured Image' ), 'attach' => __( 'First Attached Image' ), 'content' => __( 'First Image In Content' ), 'custom' => __( 'Image From Custom Field' ), 'author' => __( 'Post Author Image' ), 'auto' => __( 'First Available Image' ) ) ),
|
155 |
'fallback' => Array( 'name' => __( 'Use Default If No Image Found', 'all_in_one_seo_pack' ), 'type' => 'checkbox' ),
|
156 |
'dimg' => Array( 'name' => __( 'Default OG:Image', 'all_in_one_seo_pack' ), 'default' => AIOSEOP_PLUGIN_IMAGES_URL . 'default-user-image.png', 'type' => 'image' ),
|
201 |
|
202 |
);
|
203 |
|
|
|
|
|
|
|
|
|
204 |
// load initial options / set defaults
|
205 |
$this->update_options( );
|
206 |
|
209 |
|
210 |
$this->locations = array(
|
211 |
'opengraph' => Array( 'name' => $this->name, 'prefix' => 'aiosp_', 'type' => 'settings',
|
212 |
+
'options' => Array('scan_header', 'setmeta', 'key', 'sitename', 'hometitle', 'description', 'homeimage', 'hometag', 'generate_descriptions', 'defimg', 'fallback', 'dimg', 'meta_key', 'categories', 'defcard', 'twitter_site', 'twitter_creator', 'twitter_domain', 'types', 'facebook_publisher', 'facebook_author' ) ),
|
213 |
'settings' => Array( 'name' => __('Social Settings', 'all_in_one_seo_pack'),
|
214 |
'type' => 'metabox', 'help_link' => 'http://semperplugins.com/documentation/social-meta-module/#pagepost_settings',
|
215 |
'options' => Array( 'title', 'desc', 'image', 'customimg', 'imagewidth', 'imageheight', 'video', 'videowidth', 'videoheight', 'category', 'section', 'tag', 'setcard' ),
|
226 |
'home' => Array(
|
227 |
'name' => __( 'Home Page Settings', 'all_in_one_seo_pack' ),
|
228 |
'help_link' => 'http://semperplugins.com/documentation/social-meta-module/',
|
229 |
+
'options' => Array( 'setmeta', 'sitename', 'hometitle', 'description', 'homeimage', 'hometag' )
|
230 |
),
|
231 |
'image' => Array(
|
232 |
'name' => __( 'Image Settings', 'all_in_one_seo_pack' ),
|
257 |
|
258 |
$this->layout['default']['options'] = array_diff( array_keys( $this->default_options ), $other_options );
|
259 |
|
260 |
+
if ( is_admin() ) {
|
261 |
+
add_action( 'admin_init', Array( $this, 'debug_post_types' ), 5 );
|
262 |
+
} else {
|
263 |
+
add_action( 'wp', Array( $this, 'type_setup' ) );
|
264 |
+
}
|
265 |
+
|
266 |
if( !is_admin() || defined( 'DOING_AJAX' ) ){ $this->do_opengraph(); }
|
267 |
+
|
268 |
+
// Avoid having duplicate meta tags
|
269 |
+
add_filter( 'jetpack_enable_open_graph', '__return_false' );
|
270 |
}
|
271 |
|
272 |
function settings_page_init() {
|
384 |
}
|
385 |
|
386 |
function add_attributes( $output ) { // avoid having duplicate meta tags
|
387 |
+
$type = $this->type;
|
388 |
+
if ( empty( $type ) ) $type = 'website';
|
389 |
+
|
390 |
+
$schema_types = Array(
|
391 |
+
'album' => 'MusicAlbum',
|
392 |
+
'article' => 'Article',
|
393 |
+
'bar' => 'BarOrPub',
|
394 |
+
'blog' => 'Blog',
|
395 |
+
'book' => 'Book',
|
396 |
+
'cafe' => 'CafeOrCoffeeShop',
|
397 |
+
'city' => 'City',
|
398 |
+
'country' => 'Country',
|
399 |
+
'episode' => 'Episode',
|
400 |
+
'food' => 'FoodEvent',
|
401 |
+
'game' => 'Game',
|
402 |
+
'hotel' => 'Hotel',
|
403 |
+
'landmark' => 'LandmarksOrHistoricalBuildings',
|
404 |
+
'movie' => 'Movie',
|
405 |
+
'product' => 'Product',
|
406 |
+
'profile' => 'ProfilePage',
|
407 |
+
'restaurant' => 'Restaurant',
|
408 |
+
'school' => 'School',
|
409 |
+
'sport' => 'SportsEvent',
|
410 |
+
'website' => 'WebSite'
|
411 |
+
);
|
412 |
+
|
413 |
+
if ( !empty( $schema_types[$type] ) )
|
414 |
+
$type = $schema_types[$type];
|
415 |
+
else
|
416 |
+
$type = 'WebSite';
|
417 |
+
|
418 |
+
$attributes = apply_filters( $this->prefix . 'attributes', Array( 'itemscope', 'itemtype="http://schema.org/' . ucfirst( $type ) . '"', 'prefix="og: http://ogp.me/ns#"' ) );
|
419 |
foreach( $attributes as $attr ) {
|
420 |
if ( strpos( $output, $attr ) === false ) {
|
421 |
$output .= "\n\t$attr ";
|
431 |
$dimg = $this->options['aiosp_opengraph_dimg'];
|
432 |
$current_post_type = get_post_type();
|
433 |
$title = $description = $image = $video = '';
|
434 |
+
$type = $this->type;
|
|
|
435 |
$sitename = $this->options['aiosp_opengraph_sitename'];
|
436 |
|
437 |
if ( !empty( $aioseop_options['aiosp_hide_paginated_descriptions'] ) ) {
|
441 |
$first_page = true;
|
442 |
}
|
443 |
$url = $aiosp->aiosp_mrt_get_url( $wp_query );
|
444 |
+
$url = apply_filters( 'aioseop_canonical_url', $url );
|
445 |
+
|
446 |
$setmeta = $this->options['aiosp_opengraph_setmeta'];
|
447 |
+
if ( is_front_page() ) {
|
448 |
$title = $this->options['aiosp_opengraph_hometitle'];
|
449 |
if ( $first_page )
|
450 |
$description = $this->options['aiosp_opengraph_description'];
|
|
|
451 |
if ( !empty( $this->options['aiosp_opengraph_homeimage'] ) )
|
452 |
$thumbnail = $this->options['aiosp_opengraph_homeimage'];
|
453 |
else
|
468 |
$description = $aiosp->trim_excerpt_without_filters( $aiosp->internationalize( preg_replace( '/\s+/', ' ', $post->post_content ) ), 1000 );
|
469 |
|
470 |
if ( empty($description) && $first_page ) $description = get_bloginfo('description');
|
471 |
+
if ( $type == 'article' && ( !empty( $this->options['aiosp_opengraph_hometag'] ) ) ) {
|
472 |
+
$tag = $this->options['aiosp_opengraph_hometag'];
|
473 |
+
}
|
474 |
} elseif ( is_singular( ) && $this->option_isset('types')
|
475 |
&& is_array( $this->options['aiosp_opengraph_types'] )
|
476 |
&& in_array( $current_post_type, $this->options['aiosp_opengraph_types'] ) ) {
|
477 |
+
|
|
|
|
|
|
|
|
|
478 |
if ( $type == 'article' && ( !empty( $metabox['aioseop_opengraph_settings_section'] ) ) ) {
|
479 |
$section = $metabox['aioseop_opengraph_settings_section'];
|
480 |
}
|
520 |
if ( empty( $type ) ) $type = 'article';
|
521 |
} else return;
|
522 |
|
523 |
+
if ( $type == 'article' && ( !empty( $tag ) ) ) {
|
524 |
+
$tag = explode( ',', $tag );
|
525 |
+
foreach( $tag as $k => $v ) {
|
526 |
+
$tag[$k] = trim( $v );
|
527 |
+
}
|
528 |
+
}
|
529 |
+
|
530 |
if ( !empty( $description ) )
|
531 |
$description = $aiosp->trim_excerpt_without_filters( $aiosp->internationalize( preg_replace( '/\s+/', ' ', $description ) ), 1000 );
|
532 |
|
574 |
if ( ( empty( $thumbnail ) && !empty( $this->options['aiosp_opengraph_fallback'] ) ) )
|
575 |
$thumbnail = $this->options['aiosp_opengraph_dimg'];
|
576 |
|
577 |
+
if ( !empty( $thumbnail ) ) $thumbnail = esc_url( $thumbnail );
|
578 |
+
|
579 |
$width = $height = '';
|
580 |
if ( !empty( $thumbnail ) ) {
|
581 |
if ( !empty( $metabox['aioseop_opengraph_settings_imagewidth'] ) )
|
691 |
if ( empty( $$k ) ) $$k = '';
|
692 |
$filtered_value = $$k;
|
693 |
$filtered_value = apply_filters( $this->prefix . 'meta', $filtered_value, $t, $k );
|
694 |
+
if ( !empty( $filtered_value ) ) {
|
695 |
+
if ( !is_array( $filtered_value ) )
|
696 |
+
$filtered_value = Array( $filtered_value );
|
697 |
+
foreach( $filtered_value as $f ) {
|
698 |
+
echo '<meta ' . $tags[$t]['name'] . '="' . $v . '" ' . $tags[$t]['value'] . '="' . $f . '" />' . "\n";
|
699 |
+
}
|
700 |
+
}
|
701 |
}
|
702 |
}
|
703 |
|
709 |
add_action( 'aioseop_modules_wp_head', Array( $this, 'add_meta' ), 5 );
|
710 |
}
|
711 |
|
712 |
+
function type_setup() {
|
713 |
+
global $aiosp;
|
714 |
+
$this->type = '';
|
715 |
+
if ( is_front_page() ) {
|
716 |
+
if ( !empty( $this->options ) && !empty( $this->options['aiosp_opengraph_categories'] ) )
|
717 |
+
$this->type = $this->options['aiosp_opengraph_categories'];
|
718 |
+
} elseif ( is_singular() && $this->option_isset('types') ) {
|
719 |
+
$metabox = $this->get_current_options( Array(), 'settings' );
|
720 |
+
$current_post_type = get_post_type();
|
721 |
+
if ( !empty( $metabox['aioseop_opengraph_settings_category'] ) ) {
|
722 |
+
$this->type = $metabox['aioseop_opengraph_settings_category'];
|
723 |
+
} elseif ( isset( $this->options["aiosp_opengraph_{$current_post_type}_fb_object_type"] ) ) {
|
724 |
+
$this->type = $this->options["aiosp_opengraph_{$current_post_type}_fb_object_type"];
|
725 |
+
}
|
726 |
+
}
|
727 |
+
}
|
728 |
+
|
729 |
function debug_post_types( ) {
|
730 |
add_filter( $this->prefix . 'display_settings', Array( $this, 'filter_settings' ), 10, 3 );
|
731 |
add_filter( $this->prefix . 'override_options', Array( $this, 'override_options' ), 10, 3 );
|
738 |
$field = $slug . '_fb_object_type';
|
739 |
$this->default_options[$field] = Array(
|
740 |
'name' => "$name " . __( 'Object Type', 'all_in_one_seo_pack' ) . "<br />($slug)",
|
|
|
741 |
'type' => 'select',
|
742 |
'style' => '',
|
743 |
'initial_options' => $this->fb_object_types,
|
744 |
'default' => 'article',
|
745 |
'condshow' => Array( 'aiosp_opengraph_types\[\]' => $slug )
|
746 |
);
|
747 |
+
$this->help_text[$field] = __( 'Choose a default value that best describes the content of your post type.', 'all_in_one_seo_pack' );
|
748 |
+
$this->help_anchors[$field] = '#content-object-types';
|
749 |
$this->locations['opengraph']['options'][] = $field;
|
750 |
$this->layout['facebook']['options'][] = $field;
|
751 |
}
|
752 |
$this->setting_options();
|
753 |
+
$this->add_help_text_links();
|
754 |
+
|
755 |
}
|
756 |
+
|
757 |
function get_all_images( $options = null, $p = null ) {
|
758 |
static $img = Array();
|
759 |
if ( !is_array( $options ) ) $options = Array();
|
aioseop_performance.php
CHANGED
@@ -16,10 +16,10 @@ if ( !class_exists( 'All_in_One_SEO_Pack_Performance' ) ) {
|
|
16 |
$this->file = __FILE__; // the current file
|
17 |
parent::__construct();
|
18 |
|
19 |
-
$help_text = Array(
|
20 |
-
"memory_limit" => __( "This setting allows you to raise your PHP memory limit to a reasonable value. Note: WordPress core and other WordPress plugins may also change the value of the memory limit
|
21 |
-
"execution_time" => __( "This setting allows you to raise your PHP execution time to a reasonable value
|
22 |
-
"force_rewrites" => __( "Use output buffering to ensure that the title gets rewritten. Enable this option if you run into issues with the title tag being set by your theme or another plugin
|
23 |
);
|
24 |
|
25 |
$this->default_options = array(
|
@@ -30,6 +30,12 @@ if ( !class_exists( 'All_in_One_SEO_Pack_Performance' ) ) {
|
|
30 |
'default' => '', 'type' => 'select',
|
31 |
'initial_options' => Array( '' => __( "Use the system default", 'all_in_one_seo_pack' ), 30 => '30s', 60 => '1m', 120 => '2m', 300 => '5m', 0 => __( 'No limit', 'all_in_one_seo_pack' ) ) )
|
32 |
);
|
|
|
|
|
|
|
|
|
|
|
|
|
33 |
|
34 |
global $aiosp, $aioseop_options;
|
35 |
if ( aioseop_option_isset( 'aiosp_rewrite_titles' ) && $aioseop_options['aiosp_rewrite_titles'] ) {
|
@@ -61,9 +67,7 @@ if ( !class_exists( 'All_in_One_SEO_Pack_Performance' ) ) {
|
|
61 |
|
62 |
$this->default_options = array_merge( $this->default_options, $system_status );
|
63 |
|
64 |
-
|
65 |
-
foreach( $help_text as $k => $v )
|
66 |
-
$this->default_options[$k]['help_text'] = $v;
|
67 |
|
68 |
add_filter( $this->prefix . 'display_options', Array( $this, 'display_options_filter' ), 10, 2 );
|
69 |
add_filter( $this->prefix . 'update_options', Array( $this, 'update_options_filter' ), 10, 2 );
|
16 |
$this->file = __FILE__; // the current file
|
17 |
parent::__construct();
|
18 |
|
19 |
+
$this->help_text = Array(
|
20 |
+
"memory_limit" => __( "This setting allows you to raise your PHP memory limit to a reasonable value. Note: WordPress core and other WordPress plugins may also change the value of the memory limit.", 'all_in_one_seo_pack' ),
|
21 |
+
"execution_time" => __( "This setting allows you to raise your PHP execution time to a reasonable value.", 'all_in_one_seo_pack' ),
|
22 |
+
"force_rewrites" => __( "Use output buffering to ensure that the title gets rewritten. Enable this option if you run into issues with the title tag being set by your theme or another plugin.", 'all_in_one_seo_pack' )
|
23 |
);
|
24 |
|
25 |
$this->default_options = array(
|
30 |
'default' => '', 'type' => 'select',
|
31 |
'initial_options' => Array( '' => __( "Use the system default", 'all_in_one_seo_pack' ), 30 => '30s', 60 => '1m', 120 => '2m', 300 => '5m', 0 => __( 'No limit', 'all_in_one_seo_pack' ) ) )
|
32 |
);
|
33 |
+
|
34 |
+
$this->help_anchors = Array(
|
35 |
+
'memory_limit' => '#raise-memory-limit',
|
36 |
+
'execution_time' => '#raise-execution-time',
|
37 |
+
'force_rewrites' => '#force-rewrites'
|
38 |
+
);
|
39 |
|
40 |
global $aiosp, $aioseop_options;
|
41 |
if ( aioseop_option_isset( 'aiosp_rewrite_titles' ) && $aioseop_options['aiosp_rewrite_titles'] ) {
|
67 |
|
68 |
$this->default_options = array_merge( $this->default_options, $system_status );
|
69 |
|
70 |
+
$this->add_help_text_links();
|
|
|
|
|
71 |
|
72 |
add_filter( $this->prefix . 'display_options', Array( $this, 'display_options_filter' ), 10, 2 );
|
73 |
add_filter( $this->prefix . 'update_options', Array( $this, 'update_options_filter' ), 10, 2 );
|
aioseop_sitemap.php
CHANGED
@@ -30,27 +30,48 @@ if ( !class_exists( 'All_in_One_SEO_Pack_Sitemap' ) ) {
|
|
30 |
parent::__construct();
|
31 |
$this->comment_string = __( "Sitemap %s generated by All in One SEO Pack %s by Michael Torbert of Semper Fi Web Design on %s", 'all_in_one_seo_pack' );
|
32 |
|
33 |
-
$help_text = Array(
|
34 |
-
"filename" => __( "Specifies the name of your sitemap file. This will default to 'sitemap'
|
35 |
-
"google" => __( "Notify Google when you update your sitemap settings
|
36 |
-
"bing" => __("Notify Bing when you update your sitemap settings
|
37 |
-
"indexes" => __( "Organize sitemap entries into distinct files in your sitemap. Enable this only if your sitemap contains over 50,000 URLs or the file is over 5MB in size
|
38 |
-
"paginate" => __( "Split long sitemaps into separate files
|
39 |
-
"max_posts" => __( "Allows you to specify the maximum number of posts in a sitemap (up to 50,000)
|
40 |
-
"posttypes" => __( "Select which Post Types appear in your sitemap
|
41 |
-
"taxonomies" => __( "Select which taxonomy archives appear in your sitemap
|
42 |
-
"archive" => __( "Include Date Archives in your sitemap
|
43 |
-
"author" => __( "Include Author Archives in your sitemap
|
44 |
-
"gzipped" => __( "Create a compressed sitemap file in .xml.gz format
|
45 |
-
"robots" => __( "Places a link to your Sitemap.xml into your virtual Robots.txt file
|
46 |
-
"rewrite" => __( "Places a link to the sitemap file in your virtual Robots.txt file which WordPress creates
|
47 |
-
"
|
|
|
48 |
"addl_url" => __( 'URL to the page.', 'all_in_one_seo_pack' ),
|
49 |
"addl_prio" => __( 'The priority of the page.', 'all_in_one_seo_pack' ),
|
50 |
-
"addl_freq" => __( 'The frequency of the page.', 'all_in_one_seo_pack' ),
|
51 |
"addl_mod" => __( 'Last modified date of the page.', 'all_in_one_seo_pack' ),
|
52 |
-
"excl_categories" => __( "Entries from these categories will be excluded from the sitemap
|
53 |
-
"excl_pages" => __( "Use page slugs or page IDs, seperated by commas, to exclude pages from the sitemap
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
54 |
);
|
55 |
|
56 |
$this->default_options = array(
|
@@ -72,7 +93,9 @@ if ( !class_exists( 'All_in_One_SEO_Pack_Sitemap' ) ) {
|
|
72 |
'author' => Array( 'name' => __( 'Include Author Pages', 'all_in_one_seo_pack' ) ),
|
73 |
'gzipped' => Array( 'name' => __( 'Create Compressed Sitemap', 'all_in_one_seo_pack' ), 'default' => 'On' ),
|
74 |
'robots' => Array( 'name' => __( 'Link From Virtual Robots.txt', 'all_in_one_seo_pack' ), 'default' => 'On' ),
|
75 |
-
'rewrite' => Array( 'name' => __( 'Dynamically Generate Sitemap', 'all_in_one_seo_pack' ), 'default' => 'On' )
|
|
|
|
|
76 |
);
|
77 |
|
78 |
$status_options = Array(
|
@@ -145,33 +168,31 @@ if ( !class_exists( 'All_in_One_SEO_Pack_Sitemap' ) ) {
|
|
145 |
|
146 |
$this->layout['addl_pages'] = Array(
|
147 |
'name' => __( 'Additional Pages', 'all_in_one_seo_pack' ),
|
148 |
-
'help_link' => 'http://semperplugins.com/documentation/xml-sitemaps-module/#
|
149 |
'options' => array_keys( $addl_options )
|
150 |
);
|
151 |
|
152 |
$this->layout['excl_pages'] = Array(
|
153 |
'name' => __( 'Excluded Items', 'all_in_one_seo_pack' ),
|
154 |
-
'help_link' => 'http://semperplugins.com/documentation/xml-sitemaps-module/#
|
155 |
'options' => array_keys( $excl_options )
|
156 |
);
|
157 |
|
158 |
$this->layout['priorities'] = Array(
|
159 |
'name' => __( 'Priorities', 'all_in_one_seo_pack' ),
|
160 |
-
'help_link' => 'http://semperplugins.com/documentation/xml-sitemaps-module/#
|
161 |
'options' => array_keys( $prio_options )
|
162 |
);
|
163 |
|
164 |
$this->layout['frequencies'] = Array(
|
165 |
'name' => __( 'Frequencies', 'all_in_one_seo_pack' ),
|
166 |
-
'help_link' => 'http://semperplugins.com/documentation/xml-sitemaps-module/#
|
167 |
'options' => array_keys( $freq_options )
|
168 |
);
|
169 |
|
170 |
$this->default_options = array_merge( $status_options, $this->default_options, $addl_options, $excl_options, $prio_options, $freq_options );
|
171 |
|
172 |
-
|
173 |
-
foreach( $help_text as $k => $v )
|
174 |
-
$this->default_options[$k]['help_text'] = $v;
|
175 |
|
176 |
add_action( 'init', Array( $this, 'load_sitemap_options' ) );
|
177 |
add_action( $this->prefix . 'settings_update', Array( $this, 'do_sitemaps' ) );
|
@@ -689,6 +710,9 @@ if ( !class_exists( 'All_in_One_SEO_Pack_Sitemap' ) ) {
|
|
689 |
$gzipped = false;
|
690 |
header( "Content-Type: text/xml; charset=$blog_charset", true );
|
691 |
}
|
|
|
|
|
|
|
692 |
if ( $gzipped ) ob_start();
|
693 |
$this->do_rewrite_sitemap( $sitemap_type, $page );
|
694 |
if ( $gzipped ) echo gzencode( ob_get_clean() );
|
@@ -727,8 +751,8 @@ if ( !class_exists( 'All_in_One_SEO_Pack_Sitemap' ) ) {
|
|
727 |
/** Output sitemaps dynamically based on rewrite rules. **/
|
728 |
function do_rewrite_sitemap( $sitemap_type, $page = 0 ) {
|
729 |
$this->add_post_types();
|
730 |
-
$comment = __( "dynamically", 'all_in_one_seo_pack' );
|
731 |
-
|
732 |
}
|
733 |
|
734 |
/** Build a url to the sitemap. **/
|
@@ -926,7 +950,7 @@ if ( !class_exists( 'All_in_One_SEO_Pack_Sitemap' ) ) {
|
|
926 |
if ( empty( $comment ) )
|
927 |
$comment = __( "file '%s' statically", 'all_in_one_seo_pack' );
|
928 |
$sitemap_data = $this->get_sitemap_data( $sitemap_type, $page );
|
929 |
-
if ( $sitemap_type == 'root' ) {
|
930 |
return $this->build_sitemap_index( $sitemap_data, sprintf( $comment, $filename ) );
|
931 |
} else {
|
932 |
return $this->build_sitemap( $sitemap_data, sprintf( $comment, $filename ) );
|
@@ -1078,7 +1102,7 @@ if ( !class_exists( 'All_in_One_SEO_Pack_Sitemap' ) ) {
|
|
1078 |
if ( !empty( $current_host ) && ( $current_host != $plugin_url['host'] ) )
|
1079 |
$plugin_url['host'] = $current_host;
|
1080 |
|
1081 |
-
unset( $plugin_url['scheme'] );
|
1082 |
$plugin_path = $this->unparse_url( $plugin_url );
|
1083 |
|
1084 |
$xml_header = '<?xml-stylesheet type="text/xsl" href="' . $plugin_path . 'sitemap.xsl"?>' . "\r\n"
|
@@ -1087,7 +1111,7 @@ if ( !class_exists( 'All_in_One_SEO_Pack_Sitemap' ) ) {
|
|
1087 |
if ( !empty( $namespaces ) ) {
|
1088 |
$ns = Array();
|
1089 |
foreach( $namespaces as $k => $v ) {
|
1090 |
-
$ns[] = esc_attr( $k ) . '=' . '"' . esc_url( $v ) . '"';
|
1091 |
}
|
1092 |
$xml_header .= join( "\r\n\t", $ns );
|
1093 |
}
|
30 |
parent::__construct();
|
31 |
$this->comment_string = __( "Sitemap %s generated by All in One SEO Pack %s by Michael Torbert of Semper Fi Web Design on %s", 'all_in_one_seo_pack' );
|
32 |
|
33 |
+
$this->help_text = Array(
|
34 |
+
"filename" => __( "Specifies the name of your sitemap file. This will default to 'sitemap'.", 'all_in_one_seo_pack' ),
|
35 |
+
"google" => __( "Notify Google when you update your sitemap settings.", 'all_in_one_seo_pack' ),
|
36 |
+
"bing" => __("Notify Bing when you update your sitemap settings.", 'all_in_one_seo_pack' ),
|
37 |
+
"indexes" => __( "Organize sitemap entries into distinct files in your sitemap. Enable this only if your sitemap contains over 50,000 URLs or the file is over 5MB in size.", 'all_in_one_seo_pack' ),
|
38 |
+
"paginate" => __( "Split long sitemaps into separate files.", 'all_in_one_seo_pack' ),
|
39 |
+
"max_posts" => __( "Allows you to specify the maximum number of posts in a sitemap (up to 50,000).", 'all_in_one_seo_pack' ),
|
40 |
+
"posttypes" => __( "Select which Post Types appear in your sitemap.", 'all_in_one_seo_pack' ),
|
41 |
+
"taxonomies" => __( "Select which taxonomy archives appear in your sitemap", 'all_in_one_seo_pack' ),
|
42 |
+
"archive" => __( "Include Date Archives in your sitemap.", 'all_in_one_seo_pack' ),
|
43 |
+
"author" => __( "Include Author Archives in your sitemap.", 'all_in_one_seo_pack' ),
|
44 |
+
"gzipped" => __( "Create a compressed sitemap file in .xml.gz format.", 'all_in_one_seo_pack' ),
|
45 |
+
"robots" => __( "Places a link to your Sitemap.xml into your virtual Robots.txt file.", 'all_in_one_seo_pack' ),
|
46 |
+
"rewrite" => __( "Places a link to the sitemap file in your virtual Robots.txt file which WordPress creates.", 'all_in_one_seo_pack' ),
|
47 |
+
"noindex" => __( "Tells search engines not to index the sitemap file itself.", 'all_in_one_seo_pack' ),
|
48 |
+
"debug" => __( "Use rewrites to generate your sitemap on the fly. NOTE: This is required for WordPress Multisite.", 'all_in_one_seo_pack'),
|
49 |
"addl_url" => __( 'URL to the page.', 'all_in_one_seo_pack' ),
|
50 |
"addl_prio" => __( 'The priority of the page.', 'all_in_one_seo_pack' ),
|
51 |
+
"addl_freq" => __( 'The frequency of the page.', 'all_in_one_seo_pack' ),
|
52 |
"addl_mod" => __( 'Last modified date of the page.', 'all_in_one_seo_pack' ),
|
53 |
+
"excl_categories" => __( "Entries from these categories will be excluded from the sitemap.", 'all_in_one_seo_pack' ),
|
54 |
+
"excl_pages" => __( "Use page slugs or page IDs, seperated by commas, to exclude pages from the sitemap.", 'all_in_one_seo_pack' )
|
55 |
+
);
|
56 |
+
|
57 |
+
$this->help_anchors = Array(
|
58 |
+
'filename' => '#filename-prefix',
|
59 |
+
'google' => '#notify-google-bing',
|
60 |
+
'bing' => '#notify-google-bing',
|
61 |
+
'indexes' => '#enable-sitemap-indexes',
|
62 |
+
'posttypes' => '#post-types-and-taxonomies',
|
63 |
+
'taxonomies' => '#post-types-and-taxonomies',
|
64 |
+
'archive' => '#include-archive-pages',
|
65 |
+
'author' => '#include-archive-pages',
|
66 |
+
'gzipped' => '#create-compressed-sitemap',
|
67 |
+
'robots' => '#link-from-virtual-robots',
|
68 |
+
'rewrite' => '#dynamically-generate-sitemap',
|
69 |
+
'addl_url' => '#additional-pages',
|
70 |
+
'addl_prio' => '#additional-pages',
|
71 |
+
'addl_freq' => '#additional-pages',
|
72 |
+
'addl_mod' => '#additional-pages',
|
73 |
+
'excl_categories' => '#excluded-items',
|
74 |
+
'excl_pages' => '#excluded-items',
|
75 |
);
|
76 |
|
77 |
$this->default_options = array(
|
93 |
'author' => Array( 'name' => __( 'Include Author Pages', 'all_in_one_seo_pack' ) ),
|
94 |
'gzipped' => Array( 'name' => __( 'Create Compressed Sitemap', 'all_in_one_seo_pack' ), 'default' => 'On' ),
|
95 |
'robots' => Array( 'name' => __( 'Link From Virtual Robots.txt', 'all_in_one_seo_pack' ), 'default' => 'On' ),
|
96 |
+
'rewrite' => Array( 'name' => __( 'Dynamically Generate Sitemap', 'all_in_one_seo_pack' ), 'default' => 'On' ),
|
97 |
+
'noindex' => Array( 'name' => __( 'Noindex Sitemap file', 'all_in_one_seo_pack' ),
|
98 |
+
'condshow' => Array( "{$this->prefix}rewrite" => 'on' ) )
|
99 |
);
|
100 |
|
101 |
$status_options = Array(
|
168 |
|
169 |
$this->layout['addl_pages'] = Array(
|
170 |
'name' => __( 'Additional Pages', 'all_in_one_seo_pack' ),
|
171 |
+
'help_link' => 'http://semperplugins.com/documentation/xml-sitemaps-module/#additional-pages',
|
172 |
'options' => array_keys( $addl_options )
|
173 |
);
|
174 |
|
175 |
$this->layout['excl_pages'] = Array(
|
176 |
'name' => __( 'Excluded Items', 'all_in_one_seo_pack' ),
|
177 |
+
'help_link' => 'http://semperplugins.com/documentation/xml-sitemaps-module/#excluded-items',
|
178 |
'options' => array_keys( $excl_options )
|
179 |
);
|
180 |
|
181 |
$this->layout['priorities'] = Array(
|
182 |
'name' => __( 'Priorities', 'all_in_one_seo_pack' ),
|
183 |
+
'help_link' => 'http://semperplugins.com/documentation/xml-sitemaps-module/#priorities-and-frequencies',
|
184 |
'options' => array_keys( $prio_options )
|
185 |
);
|
186 |
|
187 |
$this->layout['frequencies'] = Array(
|
188 |
'name' => __( 'Frequencies', 'all_in_one_seo_pack' ),
|
189 |
+
'help_link' => 'http://semperplugins.com/documentation/xml-sitemaps-module/#priorities-and-frequencies',
|
190 |
'options' => array_keys( $freq_options )
|
191 |
);
|
192 |
|
193 |
$this->default_options = array_merge( $status_options, $this->default_options, $addl_options, $excl_options, $prio_options, $freq_options );
|
194 |
|
195 |
+
$this->add_help_text_links();
|
|
|
|
|
196 |
|
197 |
add_action( 'init', Array( $this, 'load_sitemap_options' ) );
|
198 |
add_action( $this->prefix . 'settings_update', Array( $this, 'do_sitemaps' ) );
|
710 |
$gzipped = false;
|
711 |
header( "Content-Type: text/xml; charset=$blog_charset", true );
|
712 |
}
|
713 |
+
if ( $this->options["{$this->prefix}noindex"] ) {
|
714 |
+
header( "X-Robots-Tag: noindex", true );
|
715 |
+
}
|
716 |
if ( $gzipped ) ob_start();
|
717 |
$this->do_rewrite_sitemap( $sitemap_type, $page );
|
718 |
if ( $gzipped ) echo gzencode( ob_get_clean() );
|
751 |
/** Output sitemaps dynamically based on rewrite rules. **/
|
752 |
function do_rewrite_sitemap( $sitemap_type, $page = 0 ) {
|
753 |
$this->add_post_types();
|
754 |
+
$comment = __( "dynamically", 'all_in_one_seo_pack' );
|
755 |
+
echo $this->do_build_sitemap( $sitemap_type, $page, '', $comment );
|
756 |
}
|
757 |
|
758 |
/** Build a url to the sitemap. **/
|
950 |
if ( empty( $comment ) )
|
951 |
$comment = __( "file '%s' statically", 'all_in_one_seo_pack' );
|
952 |
$sitemap_data = $this->get_sitemap_data( $sitemap_type, $page );
|
953 |
+
if ( ( $sitemap_type == 'root' ) && !empty( $this->options["{$this->prefix}indexes"] ) ) {
|
954 |
return $this->build_sitemap_index( $sitemap_data, sprintf( $comment, $filename ) );
|
955 |
} else {
|
956 |
return $this->build_sitemap( $sitemap_data, sprintf( $comment, $filename ) );
|
1102 |
if ( !empty( $current_host ) && ( $current_host != $plugin_url['host'] ) )
|
1103 |
$plugin_url['host'] = $current_host;
|
1104 |
|
1105 |
+
//unset( $plugin_url['scheme'] );
|
1106 |
$plugin_path = $this->unparse_url( $plugin_url );
|
1107 |
|
1108 |
$xml_header = '<?xml-stylesheet type="text/xsl" href="' . $plugin_path . 'sitemap.xsl"?>' . "\r\n"
|
1111 |
if ( !empty( $namespaces ) ) {
|
1112 |
$ns = Array();
|
1113 |
foreach( $namespaces as $k => $v ) {
|
1114 |
+
$ns[] = esc_attr( $k ) . '=' . '"' . esc_url( $v, Array( 'http', 'https' ) ) . '"';
|
1115 |
}
|
1116 |
$xml_header .= join( "\r\n\t", $ns );
|
1117 |
}
|
all_in_one_seo_pack.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
Plugin Name: All In One SEO Pack
|
4 |
Plugin URI: http://semperfiwebdesign.com
|
5 |
Description: Out-of-the-box SEO for your WordPress blog. <a href="admin.php?page=all-in-one-seo-pack/aioseop_class.php">Options configuration panel</a> | <a href="http://semperplugins.com/plugins/all-in-one-seo-pack-pro-version/?loc=plugins" target="_blank">Upgrade to Pro Version</a> | <a href="https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=mrtorbert%40gmail%2ecom&item_name=All%20In%20One%20SEO%20Pack&item_number=Support%20Open%20Source&no_shipping=0&no_note=1&tax=0¤cy_code=USD&lc=US&bn=PP%2dDonationsBF&charset=UTF%2d8">Donate</a> | <a href="http://semperplugins.com/support/" >Support</a> | <a href="https://www.amazon.com/wishlist/1NFQ133FNCOOA/ref=wl_web" target="_blank" title="Amazon Wish List">Amazon Wishlist</a>
|
6 |
-
Version: 2.2.
|
7 |
Author: Michael Torbert
|
8 |
Author URI: http://michaeltorbert.com
|
9 |
*/
|
@@ -30,11 +30,16 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
30 |
|
31 |
/**
|
32 |
* @package All-in-One-SEO-Pack
|
33 |
-
* @version 2.2.
|
34 |
*/
|
35 |
|
|
|
|
|
|
|
|
|
|
|
36 |
if ( ! defined( 'AIOSEOP_VERSION' ) )
|
37 |
-
define( 'AIOSEOP_VERSION', '2.2.
|
38 |
|
39 |
if ( ! defined( 'AIOSEOP_PLUGIN_DIR' ) ) {
|
40 |
define( 'AIOSEOP_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
|
@@ -125,19 +130,48 @@ if ( class_exists( 'All_in_One_SEO_Pack' ) ) {
|
|
125 |
return;
|
126 |
}
|
127 |
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
|
|
|
|
|
|
|
|
|
|
133 |
|
134 |
register_activation_hook( __FILE__, 'aioseop_activate' );
|
135 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
136 |
add_action( 'init', 'aioseop_load_modules', 1 );
|
137 |
//add_action( 'after_setup_theme', 'aioseop_load_modules' );
|
138 |
|
139 |
-
add_action( 'init', array( $aiosp, 'add_hooks' ) );
|
140 |
-
|
141 |
if ( is_admin() ) {
|
142 |
add_action( 'wp_ajax_aioseop_ajax_save_meta', 'aioseop_ajax_save_meta' );
|
143 |
add_action( 'wp_ajax_aioseop_ajax_save_url', 'aioseop_ajax_save_url' );
|
@@ -146,9 +180,6 @@ if ( is_admin() ) {
|
|
146 |
add_action( 'wp_ajax_aioseop_ajax_save_settings', 'aioseop_ajax_save_settings');
|
147 |
add_action( 'wp_ajax_aioseop_ajax_get_menu_links', 'aioseop_ajax_get_menu_links');
|
148 |
}
|
149 |
-
|
150 |
-
if ( aioseop_option_isset( 'aiosp_unprotect_meta' ) )
|
151 |
-
add_filter( 'is_protected_meta', 'aioseop_unprotect_meta', 10, 3 );
|
152 |
|
153 |
if ( !function_exists( 'aioseop_scan_post_header' ) ) {
|
154 |
function aioseop_scan_post_header() {
|
@@ -158,14 +189,4 @@ if ( !function_exists( 'aioseop_scan_post_header' ) ) {
|
|
158 |
query_posts('post_type=post&posts_per_page=1');
|
159 |
if (have_posts()) the_post();
|
160 |
}
|
161 |
-
}
|
162 |
-
|
163 |
-
if ( defined( 'DOING_AJAX' ) && !empty( $_POST ) && !empty( $_POST['action'] ) && ( $_POST['action'] === 'aioseop_ajax_scan_header' ) ) {
|
164 |
-
remove_action( 'init', array( $aiosp, 'add_hooks' ) );
|
165 |
-
add_action('admin_init', 'aioseop_scan_post_header' );
|
166 |
-
add_action('shutdown', 'aioseop_ajax_scan_header' ); // if the action doesn't run -- pdb
|
167 |
-
include_once(ABSPATH . 'wp-admin/includes/screen.php');
|
168 |
-
global $current_screen;
|
169 |
-
if ( class_exists( 'WP_Screen' ) )
|
170 |
-
$current_screen = WP_Screen::get( 'front' );
|
171 |
}
|
3 |
Plugin Name: All In One SEO Pack
|
4 |
Plugin URI: http://semperfiwebdesign.com
|
5 |
Description: Out-of-the-box SEO for your WordPress blog. <a href="admin.php?page=all-in-one-seo-pack/aioseop_class.php">Options configuration panel</a> | <a href="http://semperplugins.com/plugins/all-in-one-seo-pack-pro-version/?loc=plugins" target="_blank">Upgrade to Pro Version</a> | <a href="https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=mrtorbert%40gmail%2ecom&item_name=All%20In%20One%20SEO%20Pack&item_number=Support%20Open%20Source&no_shipping=0&no_note=1&tax=0¤cy_code=USD&lc=US&bn=PP%2dDonationsBF&charset=UTF%2d8">Donate</a> | <a href="http://semperplugins.com/support/" >Support</a> | <a href="https://www.amazon.com/wishlist/1NFQ133FNCOOA/ref=wl_web" target="_blank" title="Amazon Wish List">Amazon Wishlist</a>
|
6 |
+
Version: 2.2.4
|
7 |
Author: Michael Torbert
|
8 |
Author URI: http://michaeltorbert.com
|
9 |
*/
|
30 |
|
31 |
/**
|
32 |
* @package All-in-One-SEO-Pack
|
33 |
+
* @version 2.2.4
|
34 |
*/
|
35 |
|
36 |
+
global $aioseop_plugin_name;
|
37 |
+
$aioseop_plugin_name = __( 'All in One SEO Pack', 'all_in_one_seo_pack' );
|
38 |
+
if ( ! defined( 'AIOSEOP_PLUGIN_NAME' ) )
|
39 |
+
define( 'AIOSEOP_PLUGIN_NAME', $aioseop_plugin_name );
|
40 |
+
|
41 |
if ( ! defined( 'AIOSEOP_VERSION' ) )
|
42 |
+
define( 'AIOSEOP_VERSION', '2.2.4' );
|
43 |
|
44 |
if ( ! defined( 'AIOSEOP_PLUGIN_DIR' ) ) {
|
45 |
define( 'AIOSEOP_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
|
130 |
return;
|
131 |
}
|
132 |
|
133 |
+
/**
|
134 |
+
* Check if we just got activated.
|
135 |
+
*/
|
136 |
+
if ( !function_exists( 'aioseop_activate' ) ) {
|
137 |
+
function aioseop_activate() {
|
138 |
+
global $aiosp_activation;
|
139 |
+
$aiosp_activation = true;
|
140 |
+
delete_transient( "aioseop_oauth_current" );
|
141 |
+
}
|
142 |
+
}
|
143 |
|
144 |
register_activation_hook( __FILE__, 'aioseop_activate' );
|
145 |
|
146 |
+
add_action( 'plugins_loaded', 'aioseop_init_class' );
|
147 |
+
|
148 |
+
if ( !function_exists( 'aioseop_init_class' ) ) {
|
149 |
+
function aioseop_init_class() {
|
150 |
+
global $aiosp;
|
151 |
+
require_once( AIOSEOP_PLUGIN_DIR . 'aioseop_functions.php' );
|
152 |
+
require_once( AIOSEOP_PLUGIN_DIR . 'aioseop_class.php' );
|
153 |
+
$aiosp = new All_in_One_SEO_Pack();
|
154 |
+
|
155 |
+
if ( aioseop_option_isset( 'aiosp_unprotect_meta' ) )
|
156 |
+
add_filter( 'is_protected_meta', 'aioseop_unprotect_meta', 10, 3 );
|
157 |
+
|
158 |
+
add_action( 'init', array( $aiosp, 'add_hooks' ) );
|
159 |
+
|
160 |
+
if ( defined( 'DOING_AJAX' ) && !empty( $_POST ) && !empty( $_POST['action'] ) && ( $_POST['action'] === 'aioseop_ajax_scan_header' ) ) {
|
161 |
+
remove_action( 'init', array( $aiosp, 'add_hooks' ) );
|
162 |
+
add_action('admin_init', 'aioseop_scan_post_header' );
|
163 |
+
add_action('shutdown', 'aioseop_ajax_scan_header' ); // if the action doesn't run -- pdb
|
164 |
+
include_once(ABSPATH . 'wp-admin/includes/screen.php');
|
165 |
+
global $current_screen;
|
166 |
+
if ( class_exists( 'WP_Screen' ) )
|
167 |
+
$current_screen = WP_Screen::get( 'front' );
|
168 |
+
}
|
169 |
+
}
|
170 |
+
}
|
171 |
+
|
172 |
add_action( 'init', 'aioseop_load_modules', 1 );
|
173 |
//add_action( 'after_setup_theme', 'aioseop_load_modules' );
|
174 |
|
|
|
|
|
175 |
if ( is_admin() ) {
|
176 |
add_action( 'wp_ajax_aioseop_ajax_save_meta', 'aioseop_ajax_save_meta' );
|
177 |
add_action( 'wp_ajax_aioseop_ajax_save_url', 'aioseop_ajax_save_url' );
|
180 |
add_action( 'wp_ajax_aioseop_ajax_save_settings', 'aioseop_ajax_save_settings');
|
181 |
add_action( 'wp_ajax_aioseop_ajax_get_menu_links', 'aioseop_ajax_get_menu_links');
|
182 |
}
|
|
|
|
|
|
|
183 |
|
184 |
if ( !function_exists( 'aioseop_scan_post_header' ) ) {
|
185 |
function aioseop_scan_post_header() {
|
189 |
query_posts('post_type=post&posts_per_page=1');
|
190 |
if (have_posts()) the_post();
|
191 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
192 |
}
|
images/wincherbanner.png
ADDED
Binary file
|
readme.txt
CHANGED
@@ -3,7 +3,7 @@ Contributors: hallsofmontezuma
|
|
3 |
Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=mrtorbert%40gmail%2ecom&item_name=All%20In%20One%20SEO%20Pack&item_number=Support%20Open%20Source&no_shipping=0&no_note=1&tax=0¤cy_code=USD&lc=US&bn=PP%2dDonationsBF&charset=UTF%2d8
|
4 |
Tags: all in one, all in one seo, all in one seo pack, seo, search engine optimization, google
|
5 |
Requires at least: 3.3
|
6 |
-
Tested up to: 4.
|
7 |
Stable tag: trunk
|
8 |
|
9 |
All in One SEO Pack is a WordPress SEO plugin to automatically optimize your WordPress blog for Search Engines such as Google.
|
3 |
Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=mrtorbert%40gmail%2ecom&item_name=All%20In%20One%20SEO%20Pack&item_number=Support%20Open%20Source&no_shipping=0&no_note=1&tax=0¤cy_code=USD&lc=US&bn=PP%2dDonationsBF&charset=UTF%2d8
|
4 |
Tags: all in one, all in one seo, all in one seo pack, seo, search engine optimization, google
|
5 |
Requires at least: 3.3
|
6 |
+
Tested up to: 4.1
|
7 |
Stable tag: trunk
|
8 |
|
9 |
All in One SEO Pack is a WordPress SEO plugin to automatically optimize your WordPress blog for Search Engines such as Google.
|