All in One SEO Pack - Version 2.2.7

Version Description

Download this release

Release Info

Developer pbaylies
Plugin Icon 128x128 All in One SEO Pack
Version 2.2.7
Comparing to
See all releases

Code changes from version 2.2.6.2 to 2.2.7

aioseop_bad_robots.php ADDED
@@ -0,0 +1,145 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @package All-in-One-SEO-Pack
4
+ */
5
+ /**
6
+ * The Bad Robots class.
7
+ */
8
+ if ( !class_exists( 'All_in_One_SEO_Pack_Bad_Robots' ) ) {
9
+ class All_in_One_SEO_Pack_Bad_Robots extends All_in_One_SEO_Pack_Module {
10
+ function __construct( ) {
11
+ $this->name = __('Bad Bot Blocker', 'all_in_one_seo_pack'); // Human-readable name of the plugin
12
+ $this->prefix = 'aiosp_bad_robots_'; // option prefix
13
+ $this->file = __FILE__; // the current file
14
+ parent::__construct();
15
+
16
+ $help_text = Array(
17
+ 'block_bots' => __( 'Block requests from user agents that are known to misbehave.', 'all_in_one_seo_pack' ),
18
+ 'block_refer' => __( 'Block referral spam.', 'all_in_one_seo_pack' ),
19
+ 'track_blocks'=> __( 'Log and show recent requests from blocked bots.', 'all_in_one_seo_pack' ),
20
+ 'htaccess_rules'=>__( 'Block bad robots via Apaache .htaccess rules. Warning: this will change your web server configuration, make sure you are able to edit this file manually as well.', 'all_in_one_seo_pack' ),
21
+ 'edit_blocks' => __( 'Check this to edit the list of disallowed user agents for blocking bad bots.', 'all_in_one_seo_pack' ),
22
+ 'blocklist' => __( 'This is the list of disallowed user agents used for blocking bad bots.', 'all_in_one_seo_pack' ),
23
+ 'referlist' => __( 'This is the list of disallowed referers used for blocking bad bots.', 'all_in_one_seo_pack' ),
24
+ 'blocked_log' => __( 'Shows log of most recent requests from blocked bots. Note: this will not track any bots that were already blocked at the web server / .htaccess level.', 'all_in_one_seo_pack' ),
25
+ );
26
+
27
+ $this->default_options = array(
28
+ 'block_bots' => Array( 'name' => __( 'Block Bad Bots', 'all_in_one_seo_pack' ) ),
29
+ 'block_refer' => Array( 'name' => __( 'Block Referral Spam', 'all_in_one_seo_pack' ) ),
30
+ 'track_blocks' => Array( 'name' => __( 'Track Blocked Bots', 'all_in_one_seo_pack' ) ),
31
+ 'htaccess_rules' => Array( 'name' => __( 'Add rules to .htaccess', 'all_in_one_seo_pack' ) ),
32
+ 'edit_blocks' => Array( 'name' => __( 'Edit Blocklists', 'all_in_one_seo_pack' ) ),
33
+ 'blocklist' => Array( 'name' => __( 'User Agent Blocklist', 'all_in_one_seo_pack' ), 'type' => 'textarea', 'rows' => 5, 'cols' => 120, 'condshow' => Array( "{$this->prefix}edit_blocks" => 'on' ), 'default' => join( "\n", $this->default_bad_bots() ) ),
34
+ 'referlist' => Array( 'name' => __( 'Referer Blocklist', 'all_in_one_seo_pack' ), 'type' => 'textarea', 'rows' => 5, 'cols' => 120, 'condshow' => Array( "{$this->prefix}edit_blocks" => 'on', "{$this->prefix}block_refer" => 'on', ), 'default' => join( "\n", $this->default_bad_referers() ) ),
35
+ 'blocked_log' => Array( 'name' => __( 'Log Of Blocked Bots', 'all_in_one_seo_pack' ), 'default' => __( 'No requests yet.', 'all_in_one_seo_pack' ), 'type' => 'html', 'disabled' => 'disabled', 'save' => false, 'label' => 'top', 'rows' => 5, 'cols' => 120, 'style' => 'min-width:950px', 'condshow' => Array( "{$this->prefix}track_blocks" => 'on' ) )
36
+ );
37
+ $is_apache = false;
38
+ if ( ( !empty($_SERVER['SERVER_SOFTWARE'] ) && stristr( $_SERVER['SERVER_SOFTWARE'], 'Apache' ) !== false ) ) {
39
+ $is_apache = true;
40
+ add_action( $this->prefix . 'settings_update', Array( $this, 'generate_htaccess_blocklist' ), 10 );
41
+ } else {
42
+ unset( $this->default_options["htaccess_rules"] );
43
+ unset( $help_text["htaccess_rules"] );
44
+ }
45
+
46
+ if ( !empty( $help_text ) )
47
+ foreach( $help_text as $k => $v )
48
+ $this->default_options[$k]['help_text'] = $v;
49
+
50
+ add_filter( $this->prefix . 'display_options', Array( $this, 'filter_display_options' ) );
51
+
52
+ // load initial options / set defaults
53
+ $this->update_options( );
54
+
55
+ if ( $this->option_isset( 'edit_blocks' ) ) {
56
+ add_filter( $this->prefix . 'badbotlist', Array( $this, 'filter_bad_botlist' ) );
57
+ if ( $this->option_isset( 'block_refer' ) ) {
58
+ add_filter( $this->prefix . 'badreferlist', Array( $this, 'filter_bad_referlist' ) );
59
+ }
60
+ }
61
+
62
+ if ( $this->option_isset( 'block_bots' ) ) {
63
+ if ( !$this->allow_bot() ) {
64
+ status_header( 503 );
65
+ $ip = $_SERVER['REMOTE_ADDR'];
66
+ $user_agent = $_SERVER['HTTP_USER_AGENT'];
67
+ $this->blocked_message( sprintf( __( "Blocked bot with IP %s -- matched user agent %s found in blocklist.", 'all_in_one_seo_pack' ), $ip, $user_agent ) );
68
+ exit();
69
+ } elseif ( $this->option_isset( 'block_refer' ) && $this->is_bad_referer() ) {
70
+ status_header( 503 );
71
+ $ip = $_SERVER['REMOTE_ADDR'];
72
+ $referer = $_SERVER['HTTP_REFERER'];
73
+ $this->blocked_message( sprintf( __( "Blocked bot with IP %s -- matched referer %s found in blocklist.", 'all_in_one_seo_pack' ), $ip, $referer ) );
74
+ }
75
+ }
76
+ }
77
+
78
+ function generate_htaccess_blocklist() {
79
+ if ( !$this->option_isset( 'htaccess_rules' ) ) return;
80
+ if ( function_exists( 'apache_get_modules' ) ) {
81
+ $modules = apache_get_modules();
82
+ foreach( Array( 'mod_authz_host', 'mod_setenvif' ) as $m ) {
83
+ if ( !in_array( $m, $modules ) ) {
84
+ aioseop_output_notice( sprintf( __( "Apache module %s is required!", 'all_in_one_seo_pack' ), $m ), "", "error" );
85
+ }
86
+ }
87
+ }
88
+ $botlist = $this->default_bad_bots();
89
+ $botlist = apply_filters( $this->prefix . "badbotlist", $botlist );
90
+ if ( !empty( $botlist ) ) {
91
+ $regex = $this->quote_list_for_regex( $botlist, '"' );
92
+ $htaccess = Array();
93
+ $htaccess[] = 'SetEnvIfNoCase User-Agent "' . $regex . '" bad_bot';
94
+ if ( $this->option_isset( 'edit_blocks' ) && $this->option_isset( 'block_refer' ) && $this->option_isset( 'referlist' ) ) {
95
+ $referlist = $this->default_bad_referers();
96
+ $referlist = apply_filters( $this->prefix . "badreferlist", $botlist );
97
+ if ( !empty( $referlist ) ) {
98
+ $regex = $this->quote_list_for_regex( $referlist, '"' );
99
+ $htaccess[] = 'SetEnvIfNoCase Referer "' . $regex . '" bad_bot';
100
+ }
101
+ }
102
+ $htaccess[] = 'Deny from env=bad_bot';
103
+ if ( insert_with_markers( get_home_path() . '.htaccess', $this->name, $htaccess ) ) {
104
+ aioseop_output_notice( __( "Updated .htaccess rules.", 'all_in_one_seo_pack' ) );
105
+ } else {
106
+ aioseop_output_notice( __( "Failed to update .htaccess rules!", 'all_in_one_seo_pack' ), "", "error" );
107
+ }
108
+ } else {
109
+ aioseop_output_notice( __( "No rules to update!", 'all_in_one_seo_pack' ), "", "error" );
110
+ }
111
+ }
112
+
113
+ function filter_bad_referlist( $referlist ) {
114
+ if ( $this->option_isset( 'edit_blocks' ) && $this->option_isset( 'block_refer' ) && $this->option_isset( 'referlist' ) ) {
115
+ $referlist = explode( "\n", $this->options["{$this->prefix}referlist"] );
116
+ }
117
+ return $referlist;
118
+ }
119
+
120
+ function filter_bad_botlist( $botlist ) {
121
+ if ( $this->option_isset( 'edit_blocks' ) && $this->option_isset( 'blocklist' ) ) {
122
+ $botlist = explode( "\n", $this->options["{$this->prefix}blocklist"] );
123
+ }
124
+ return $botlist;
125
+ }
126
+
127
+ /** Updates blocked log messages. **/
128
+ function blocked_message( $msg ) {
129
+ if ( empty( $this->options["{$this->prefix}blocked_log"] ) ) $this->options["{$this->prefix}blocked_log"] = '';
130
+ $this->options["{$this->prefix}blocked_log"] = date( 'Y-m-d H:i:s' ) . " {$msg}\n" . $this->options["{$this->prefix}blocked_log"];
131
+ if ( $this->strlen( $this->options["{$this->prefix}blocked_log"] ) > 4096 ) {
132
+ $end = $this->strrpos( $this->options["{$this->prefix}blocked_log"], "\n" );
133
+ if ( $end === false ) $end = 4096;
134
+ $this->options["{$this->prefix}blocked_log"] = $this->substr( $this->options["{$this->prefix}blocked_log"], 0, $end );
135
+ }
136
+ $this->update_class_option( $this->options );
137
+ }
138
+
139
+ /** Add in options for status display on settings page, sitemap rewriting on multisite. **/
140
+ function filter_display_options( $options ) {
141
+ if ( $this->option_isset( 'blocked_log' ) ) $options["{$this->prefix}blocked_log"] = '<pre>' . $options["{$this->prefix}blocked_log"] . '</pre>';
142
+ return $options;
143
+ }
144
+ }
145
+ }
aioseop_class.php CHANGED
@@ -49,7 +49,7 @@ class All_in_One_SEO_Pack extends All_in_One_SEO_Pack_Module {
49
  var $meta_opts = false;
50
  var $is_front_page = null;
51
 
52
- function All_in_One_SEO_Pack() {
53
  global $aioseop_options;
54
  $this->log_file = dirname( __FILE__ ) . '/all_in_one_seo_pack.log';
55
 
@@ -67,6 +67,7 @@ class All_in_One_SEO_Pack extends All_in_One_SEO_Pack_Module {
67
  $this->option_name = 'aioseop_options';
68
  $this->store_option = true;
69
  $this->file = __FILE__; // the current file
 
70
  parent::__construct();
71
 
72
  $this->help_text = Array(
@@ -186,6 +187,7 @@ class All_in_One_SEO_Pack extends All_in_One_SEO_Pack_Module {
186
  "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' ),
187
  "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' ),
188
  "google_sitelinks_search"=> __( "Add markup to display the Google Sitelinks Search Box next to your search results in Google.", 'all_in_one_seo_pack' ),
 
189
  "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' ),
190
  "google_analytics_id" => __( "Enter your Google Analytics ID here to track visitor behavior on your site using Google Analytics.", 'all_in_one_seo_pack' ),
191
  "ga_use_universal_analytics" => __( "Use the new Universal Analytics tracking code for Google Analytics.", 'all_in_one_seo_pack' ),
@@ -207,6 +209,7 @@ class All_in_One_SEO_Pack extends All_in_One_SEO_Pack_Module {
207
  "tags_noindex" => __( "Check this to ask search engines not to index Tag Archives. Useful for avoiding duplicate content.", 'all_in_one_seo_pack' ),
208
  "search_noindex" => __( "Check this to ask search engines not to index the Search page. Useful for avoiding duplicate content.", 'all_in_one_seo_pack' ),
209
  "404_noindex" => __( "Check this to ask search engines not to index the 404 page.", 'all_in_one_seo_pack' ),
 
210
  "paginated_noindex" => __( "Check this to ask search engines not to index paginated pages/posts. Useful for avoiding duplicate content.", 'all_in_one_seo_pack' ),
211
  "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' ),
212
  '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' ),
@@ -243,6 +246,7 @@ class All_in_One_SEO_Pack extends All_in_One_SEO_Pack_Module {
243
  'dynamic_postspage_keywords' => '#dynamically-generate-keywords-for-posts-page',
244
  'rewrite_titles' => '#rewrite-titles',
245
  'cap_titles' => '#capitalize-titles',
 
246
  'page_title_format' => '#title-format-fields',
247
  'post_title_format' => '#title-format-fields',
248
  'category_title_format' => '#title-format-fields',
@@ -509,6 +513,15 @@ class All_in_One_SEO_Pack extends All_in_One_SEO_Pack_Module {
509
  "google_sitelinks_search" => Array(
510
  'name' => __( 'Display Sitelinks Search Box:', 'all_in_one_seo_pack' )
511
  ),
 
 
 
 
 
 
 
 
 
512
  "google_author_advanced" => Array(
513
  'name' => __( 'Advanced Authorship Options:', 'all_in_one_seo_pack' ),
514
  'default' => 0, 'type' => 'radio',
@@ -531,8 +544,7 @@ class All_in_One_SEO_Pack extends All_in_One_SEO_Pack_Module {
531
  'name' => __( 'Specify Publisher URL:', 'all_in_one_seo_pack' ), 'type' => 'text',
532
  'condshow' => Array( 'aiosp_google_author_advanced' => 'on', 'aiosp_google_enable_publisher' => 'on' )
533
  ),
534
- "google_connect"=>Array( 'name' => __( 'Connect With Google Analytics', 'all_in_one_seo_pack' ),
535
- ),
536
  "google_analytics_id"=> Array(
537
  'name' => __( 'Google Analytics ID:', 'all_in_one_seo_pack' ),
538
  'default' => null, 'type' => 'text', 'placeholder' => 'UA-########-#' ),
@@ -613,6 +625,11 @@ class All_in_One_SEO_Pack extends All_in_One_SEO_Pack_Module {
613
  "404_noindex"=> Array(
614
  'name' => __( 'Use noindex for the 404 page:', 'all_in_one_seo_pack' ),
615
  'default' => 0),
 
 
 
 
 
616
  "paginated_noindex" => Array(
617
  'name' => __( 'Use noindex for paginated pages/posts:', 'all_in_one_seo_pack' ),
618
  'default' => 0),
@@ -752,14 +769,14 @@ class All_in_One_SEO_Pack extends All_in_One_SEO_Pack_Module {
752
  'google' => Array(
753
  'name' => __( 'Google Settings', 'all_in_one_seo_pack' ),
754
  'help_link' => 'http://semperplugins.com/documentation/google-settings/',
755
- 'options' => Array( "google_publisher", "google_disable_profile", "google_sitelinks_search", "google_author_advanced", "google_author_location", "google_enable_publisher" , "google_specify_publisher",
756
- "google_connect",
757
  "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" )
758
  ),
759
  'noindex' => Array(
760
  'name' => __( 'Noindex Settings', 'all_in_one_seo_pack' ),
761
  'help_link' => 'http://semperplugins.com/documentation/noindex-settings/',
762
- 'options' => Array( 'cpostnoindex', 'cpostnofollow', 'cpostnoodp', 'cpostnoydir', 'category_noindex', 'archive_date_noindex', 'archive_author_noindex', 'tags_noindex', 'search_noindex', '404_noindex', 'paginated_noindex', 'paginated_nofollow', 'noodp', 'noydir' )
763
  ),
764
  'advanced' => Array(
765
  'name' => __( 'Advanced Settings', 'all_in_one_seo_pack' ),
@@ -1032,7 +1049,7 @@ class All_in_One_SEO_Pack extends All_in_One_SEO_Pack_Module {
1032
  }
1033
 
1034
  function add_page_hooks() {
1035
- $this->oauth_init();
1036
  $post_objs = get_post_types( '', 'objects' );
1037
  $pt = array_keys( $post_objs );
1038
  $rempost = array( 'revision', 'nav_menu_item' );
@@ -1044,6 +1061,16 @@ class All_in_One_SEO_Pack extends All_in_One_SEO_Pack_Module {
1044
  else
1045
  $post_types[$p] = $p;
1046
  }
 
 
 
 
 
 
 
 
 
 
1047
  $this->default_options["posttypecolumns"]['initial_options'] = $post_types;
1048
  $this->default_options["cpostactive"]['initial_options'] = $post_types;
1049
  $this->default_options["cpostnoindex"]['initial_options'] = $post_types;
@@ -1067,7 +1094,12 @@ class All_in_One_SEO_Pack extends All_in_One_SEO_Pack_Module {
1067
  $this->help_text[$field] = __( 'The following macros are supported:', 'all_in_one_seo_pack' )
1068
  . '<ul><li>' . __( '%blog_title% - Your blog title', 'all_in_one_seo_pack' ) . '</li><li>' .
1069
  __( '%blog_description% - Your blog description', 'all_in_one_seo_pack' ) . '</li><li>' .
1070
- __( '%post_title% - The original title of the post', 'all_in_one_seo_pack' ) . '</li><li>' .
 
 
 
 
 
1071
  __( "%post_author_login% - This post's author' login", 'all_in_one_seo_pack' ) . '</li><li>' .
1072
  __( "%post_author_nicename% - This post's author' nicename", 'all_in_one_seo_pack' ) . '</li><li>' .
1073
  __( "%post_author_firstname% - This post's author' first name (capitalized)", 'all_in_one_seo_pack' ) . '</li><li>' .
@@ -1085,6 +1117,11 @@ class All_in_One_SEO_Pack extends All_in_One_SEO_Pack_Module {
1085
  ksort( $role_names );
1086
  $this->default_options["ga_exclude_users"]['initial_options'] = $role_names;
1087
 
 
 
 
 
 
1088
  $this->setting_options();
1089
  $this->add_help_text_links();
1090
  add_filter( "{$this->prefix}display_options", Array( $this, 'filter_options' ), 10, 2 );
@@ -1258,8 +1295,8 @@ class All_in_One_SEO_Pack extends All_in_One_SEO_Pack_Module {
1258
  switch ( $meta['id'] ) {
1259
  case "aioseop-about":
1260
  ?><div class="aioseop_metabox_text">
1261
- <p><h2 style="display:inline;"><?php echo AIOSEOP_PLUGIN_NAME; ?></h2> by Michael Torbert of <a target="_blank" title="Semper Fi Web Design"
1262
- href="http://semperfiwebdesign.com/">Semper Fi Web Design</a>.</p>
1263
  <?php
1264
  global $current_user;
1265
  $user_id = $current_user->ID;
@@ -1478,6 +1515,11 @@ class All_in_One_SEO_Pack extends All_in_One_SEO_Pack_Module {
1478
  $this->log( "another plugin interfering?" );
1479
  // if we get here there *could* be trouble with another plugin :(
1480
  $this->ob_start_detected = true;
 
 
 
 
 
1481
  if ( function_exists( 'ob_list_handlers' ) ) {
1482
  foreach ( ob_list_handlers() as $handler ) {
1483
  $this->log( "detected output handler $handler" );
@@ -1596,8 +1638,11 @@ class All_in_One_SEO_Pack extends All_in_One_SEO_Pack_Module {
1596
  global $aioseop_options;
1597
  $opts = $this->meta_opts;
1598
  $page = $this->get_page_number();
1599
- $robots_meta = '';
1600
-
 
 
 
1601
  $aiosp_noindex = $aiosp_nofollow = $aiosp_noodp = $aiosp_noydir = '';
1602
  $noindex = "index";
1603
  $nofollow = "follow";
@@ -1605,7 +1650,8 @@ class All_in_One_SEO_Pack extends All_in_One_SEO_Pack_Module {
1605
  && ( ( is_date() && !empty( $aioseop_options['aiosp_archive_date_noindex'] ) ) || ( is_author() && !empty( $aioseop_options['aiosp_archive_author_noindex'] ) ) ) )
1606
  || ( is_tag() && !empty( $aioseop_options['aiosp_tags_noindex'] ) )
1607
  || ( is_search() && !empty( $aioseop_options['aiosp_search_noindex'] ) )
1608
- || ( is_404() && !empty( $aioseop_options['aiosp_404_noindex'] ) ) ) {
 
1609
  $noindex = 'noindex';
1610
  } elseif ( ( is_single() || is_page() || $this->is_static_posts_page() || is_attachment() || ( $page > 1 ) ) ) {
1611
  $post_type = get_post_type();
@@ -1795,7 +1841,7 @@ class All_in_One_SEO_Pack extends All_in_One_SEO_Pack_Module {
1795
  $meta_string .= '<meta name="' . $v . '" content="' . trim( strip_tags( $aioseop_options["aiosp_{$k}_verify"] ) ) . '" />' . "\n";
1796
 
1797
  // sitelinks search
1798
- if ( !empty( $aioseop_options["aiosp_google_sitelinks_search"] ) )
1799
  $meta_string .= $this->sitelinks_search_box() . "\n";
1800
  }
1801
  // handle extra meta fields
@@ -2281,18 +2327,41 @@ function aiosp_google_analytics() {
2281
  }
2282
 
2283
  function sitelinks_search_box() {
2284
- $home_url = get_home_url();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2285
  $search_box=<<<EOF
2286
  <script type="application/ld+json">
2287
  {
2288
  "@context": "http://schema.org",
2289
  "@type": "WebSite",
2290
  "url": "{$home_url}/",
2291
- "potentialAction": {
2292
- "@type": "SearchAction",
2293
- "target": "{$home_url}/?s={search_term}",
2294
- "query-input": "required name=search_term"
2295
- }
2296
  }
2297
  </script>
2298
  EOF;
@@ -2417,9 +2486,9 @@ EOF;
2417
  function get_post_description( $post ) {
2418
  global $aioseop_options;
2419
  $description = '';
2420
- if ( !$this->show_page_description() )
2421
- return '';
2422
-
2423
  $description = trim( stripslashes( $this->internationalize( get_post_meta( $post->ID, "_aioseop_description", true ) ) ) );
2424
  if ( !empty( $post ) && post_password_required( $post ) ) {
2425
  return $description;
@@ -2680,45 +2749,58 @@ EOF;
2680
  return $title;
2681
  }
2682
 
2683
- function apply_post_title_format( $title, $category = '', $p = null ) {
2684
- if ( $p === null ) {
2685
- global $post;
2686
- } else {
2687
- $post = $p;
2688
- }
2689
- $title_format = $this->get_post_title_format( 'post', $p );
2690
  if ( !empty( $post ) )
2691
  $authordata = get_userdata( $post->post_author );
2692
  else
2693
  $authordata = new WP_User();
2694
- $r_title = array( '%blog_title%', '%blog_description%', '%post_title%', '%category%', '%category_title%', '%post_author_login%', '%post_author_nicename%', '%post_author_firstname%', '%post_author_lastname%' );
2695
- $d_title = array( $this->internationalize( get_bloginfo('name') ), $this->internationalize( get_bloginfo( 'description' ) ), $title, $category, $category, $authordata->user_login, $authordata->user_nicename, $this->ucwords( $authordata->first_name ), $this->ucwords( $authordata->last_name ) );
2696
- $title = trim( str_replace( $r_title, $d_title, $title_format ) );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2697
  return $title;
2698
  }
2699
 
 
 
 
 
 
 
 
 
 
 
2700
  function apply_page_title_format( $title, $p = null, $title_format = '' ) {
2701
  global $aioseop_options;
2702
  if ( $p === null ) {
2703
- global $post;
2704
  } else {
2705
  $post = $p;
2706
  }
2707
  if ( empty( $title_format ) )
2708
  $title_format = $aioseop_options['aiosp_page_title_format'];
2709
- if ( !empty( $post ) )
2710
- $authordata = get_userdata( $post->post_author );
2711
- else
2712
- $authordata = new WP_User();
2713
- $new_title = str_replace( '%blog_title%', $this->internationalize( get_bloginfo( 'name' ) ), $title_format );
2714
- if ( strpos( $new_title, '%blog_description%' ) !== false ) $new_title = str_replace( '%blog_description%', $this->internationalize( get_bloginfo( 'description' ) ), $new_title );
2715
- if ( strpos( $new_title, '%page_title%' ) !== false ) $new_title = str_replace( '%page_title%', $title, $new_title );
2716
- if ( strpos( $new_title, '%page_author_login%' ) !== false ) $new_title = str_replace( '%page_author_login%', $authordata->user_login, $new_title );
2717
- if ( strpos( $new_title, '%page_author_nicename%' ) !== false ) $new_title = str_replace( '%page_author_nicename%', $authordata->user_nicename, $new_title );
2718
- if ( strpos( $new_title, '%page_author_firstname%' ) !== false ) $new_title = str_replace( '%page_author_firstname%', $this->ucwords($authordata->first_name ), $new_title );
2719
- if ( strpos( $new_title, '%page_author_lastname%' ) !== false ) $new_title = str_replace( '%page_author_lastname%', $this->ucwords($authordata->last_name ), $new_title );
2720
- $title = trim( $new_title );
2721
- return $title;
2722
  }
2723
 
2724
  /*** Gets the title that will be used by AIOSEOP for title rewrites or returns false. ***/
@@ -3037,6 +3119,15 @@ EOF;
3037
  return $keywords;
3038
  }
3039
 
 
 
 
 
 
 
 
 
 
3040
  /**
3041
  * @return comma-separated list of unique keywords
3042
  */
@@ -3403,7 +3494,11 @@ EOF;
3403
  //]]>
3404
  </script>
3405
  <div class="aioseop_advert aioseop_nopad">
3406
- <a href="https://wp.wincher.com/v1/link" target="_blank"><img src="<?php echo AIOSEOP_PLUGIN_IMAGES_URL; ?>wincherbanner.png"></a>
 
 
 
 
3407
  </div>
3408
  <!-- Headway Themes-->
3409
  <div class="aioseop_advert">
49
  var $meta_opts = false;
50
  var $is_front_page = null;
51
 
52
+ function __construct() {
53
  global $aioseop_options;
54
  $this->log_file = dirname( __FILE__ ) . '/all_in_one_seo_pack.log';
55
 
67
  $this->option_name = 'aioseop_options';
68
  $this->store_option = true;
69
  $this->file = __FILE__; // the current file
70
+ $blog_name = esc_attr( get_bloginfo( 'name' ) );
71
  parent::__construct();
72
 
73
  $this->help_text = Array(
187
  "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' ),
188
  "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' ),
189
  "google_sitelinks_search"=> __( "Add markup to display the Google Sitelinks Search Box next to your search results in Google.", 'all_in_one_seo_pack' ),
190
+ "google_set_site_name" => __( "Add markup to tell Google the preferred name for your website.", 'all_in_one_seo_pack' ),
191
  "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' ),
192
  "google_analytics_id" => __( "Enter your Google Analytics ID here to track visitor behavior on your site using Google Analytics.", 'all_in_one_seo_pack' ),
193
  "ga_use_universal_analytics" => __( "Use the new Universal Analytics tracking code for Google Analytics.", 'all_in_one_seo_pack' ),
209
  "tags_noindex" => __( "Check this to ask search engines not to index Tag Archives. Useful for avoiding duplicate content.", 'all_in_one_seo_pack' ),
210
  "search_noindex" => __( "Check this to ask search engines not to index the Search page. Useful for avoiding duplicate content.", 'all_in_one_seo_pack' ),
211
  "404_noindex" => __( "Check this to ask search engines not to index the 404 page.", 'all_in_one_seo_pack' ),
212
+ "tax_noindex" => __( "Check this to ask search engines not to index custom Taxonomy archive pages. Useful for avoiding duplicate content.", 'all_in_one_seo_pack' ),
213
  "paginated_noindex" => __( "Check this to ask search engines not to index paginated pages/posts. Useful for avoiding duplicate content.", 'all_in_one_seo_pack' ),
214
  "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' ),
215
  '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' ),
246
  'dynamic_postspage_keywords' => '#dynamically-generate-keywords-for-posts-page',
247
  'rewrite_titles' => '#rewrite-titles',
248
  'cap_titles' => '#capitalize-titles',
249
+ 'home_page_title_format' => '#title-format-fields',
250
  'page_title_format' => '#title-format-fields',
251
  'post_title_format' => '#title-format-fields',
252
  'category_title_format' => '#title-format-fields',
513
  "google_sitelinks_search" => Array(
514
  'name' => __( 'Display Sitelinks Search Box:', 'all_in_one_seo_pack' )
515
  ),
516
+ "google_set_site_name" => Array(
517
+ 'name' => __( 'Set Preferred Site Name:', 'all_in_one_seo_pack' )
518
+ ),
519
+ "google_specify_site_name" => Array(
520
+ 'name' => __( 'Specify A Preferred Name:', 'all_in_one_seo_pack' ),
521
+ 'type' => 'text',
522
+ 'placeholder' => $blog_name,
523
+ 'condshow' => Array( 'aiosp_google_set_site_name' => 'on' )
524
+ ),
525
  "google_author_advanced" => Array(
526
  'name' => __( 'Advanced Authorship Options:', 'all_in_one_seo_pack' ),
527
  'default' => 0, 'type' => 'radio',
544
  'name' => __( 'Specify Publisher URL:', 'all_in_one_seo_pack' ), 'type' => 'text',
545
  'condshow' => Array( 'aiosp_google_author_advanced' => 'on', 'aiosp_google_enable_publisher' => 'on' )
546
  ),
547
+ // "google_connect"=>Array( 'name' => __( 'Connect With Google Analytics', 'all_in_one_seo_pack' ), ),
 
548
  "google_analytics_id"=> Array(
549
  'name' => __( 'Google Analytics ID:', 'all_in_one_seo_pack' ),
550
  'default' => null, 'type' => 'text', 'placeholder' => 'UA-########-#' ),
625
  "404_noindex"=> Array(
626
  'name' => __( 'Use noindex for the 404 page:', 'all_in_one_seo_pack' ),
627
  'default' => 0),
628
+ "tax_noindex"=> Array(
629
+ 'name' => __( 'Use noindex for Taxonomy Archives:', 'all_in_one_seo_pack' ),
630
+ 'type' => 'multicheckbox', 'default' => array(),
631
+ 'condshow' => Array( 'aiosp_enablecpost' => 'on', 'aiosp_cpostadvanced' => 'on' )
632
+ ),
633
  "paginated_noindex" => Array(
634
  'name' => __( 'Use noindex for paginated pages/posts:', 'all_in_one_seo_pack' ),
635
  'default' => 0),
769
  'google' => Array(
770
  'name' => __( 'Google Settings', 'all_in_one_seo_pack' ),
771
  'help_link' => 'http://semperplugins.com/documentation/google-settings/',
772
+ 'options' => Array( "google_publisher", "google_disable_profile", "google_sitelinks_search", "google_set_site_name", "google_specify_site_name", "google_author_advanced", "google_author_location", "google_enable_publisher" , "google_specify_publisher",
773
+ // "google_connect",
774
  "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" )
775
  ),
776
  'noindex' => Array(
777
  'name' => __( 'Noindex Settings', 'all_in_one_seo_pack' ),
778
  'help_link' => 'http://semperplugins.com/documentation/noindex-settings/',
779
+ 'options' => Array( 'cpostnoindex', 'cpostnofollow', 'cpostnoodp', 'cpostnoydir', 'category_noindex', 'archive_date_noindex', 'archive_author_noindex', 'tags_noindex', 'search_noindex', '404_noindex', 'tax_noindex', 'paginated_noindex', 'paginated_nofollow', 'noodp', 'noydir' )
780
  ),
781
  'advanced' => Array(
782
  'name' => __( 'Advanced Settings', 'all_in_one_seo_pack' ),
1049
  }
1050
 
1051
  function add_page_hooks() {
1052
+ // $this->oauth_init();
1053
  $post_objs = get_post_types( '', 'objects' );
1054
  $pt = array_keys( $post_objs );
1055
  $rempost = array( 'revision', 'nav_menu_item' );
1061
  else
1062
  $post_types[$p] = $p;
1063
  }
1064
+ $taxes = get_taxonomies( '', 'objects' );
1065
+ $tx = array_keys( $taxes );
1066
+ $remtax = array( 'nav_menu', 'link_category', 'post_format' );
1067
+ $tx = array_diff( $tx, $remtax );
1068
+ $tax_types = Array();
1069
+ foreach( $tx as $t )
1070
+ if ( !empty( $taxes[$t]->label ) )
1071
+ $tax_types[$t] = $taxes[$t]->label;
1072
+ else
1073
+ $taxes[$t] = $t;
1074
  $this->default_options["posttypecolumns"]['initial_options'] = $post_types;
1075
  $this->default_options["cpostactive"]['initial_options'] = $post_types;
1076
  $this->default_options["cpostnoindex"]['initial_options'] = $post_types;
1094
  $this->help_text[$field] = __( 'The following macros are supported:', 'all_in_one_seo_pack' )
1095
  . '<ul><li>' . __( '%blog_title% - Your blog title', 'all_in_one_seo_pack' ) . '</li><li>' .
1096
  __( '%blog_description% - Your blog description', 'all_in_one_seo_pack' ) . '</li><li>' .
1097
+ __( '%post_title% - The original title of the post.', 'all_in_one_seo_pack' ) . '</li><li>';
1098
+ $taxes = get_object_taxonomies( $p, 'objects' );
1099
+ if ( !empty( $taxes ) )
1100
+ foreach( $taxes as $n => $t )
1101
+ $this->help_text[$field] .= sprintf( __( "%%tax_%s%% - This post's associated %s taxnomy title", 'all_in_one_seo_pack' ), $n, $t->label ) . '</li><li>';
1102
+ $this->help_text[$field] .=
1103
  __( "%post_author_login% - This post's author' login", 'all_in_one_seo_pack' ) . '</li><li>' .
1104
  __( "%post_author_nicename% - This post's author' nicename", 'all_in_one_seo_pack' ) . '</li><li>' .
1105
  __( "%post_author_firstname% - This post's author' first name (capitalized)", 'all_in_one_seo_pack' ) . '</li><li>' .
1117
  ksort( $role_names );
1118
  $this->default_options["ga_exclude_users"]['initial_options'] = $role_names;
1119
 
1120
+ unset( $tax_types['category'] );
1121
+ unset( $tax_types['post_tag'] );
1122
+ $this->default_options["tax_noindex"]['initial_options'] = $tax_types;
1123
+ if ( empty( $tax_types ) )
1124
+ unset( $this->default_options["tax_noindex"] );
1125
  $this->setting_options();
1126
  $this->add_help_text_links();
1127
  add_filter( "{$this->prefix}display_options", Array( $this, 'filter_options' ), 10, 2 );
1295
  switch ( $meta['id'] ) {
1296
  case "aioseop-about":
1297
  ?><div class="aioseop_metabox_text">
1298
+ <p><h2 style="display:inline;"><?php echo AIOSEOP_PLUGIN_NAME; ?></h2><?php sprintf( __( "by %s of %s.", 'all_in_one_seo_pack' ), 'Michael Torbert', '<a target="_blank" title="Semper Fi Web Design"
1299
+ href="http://semperfiwebdesign.com/">Semper Fi Web Design</a>' ); ?>.</p>
1300
  <?php
1301
  global $current_user;
1302
  $user_id = $current_user->ID;
1515
  $this->log( "another plugin interfering?" );
1516
  // if we get here there *could* be trouble with another plugin :(
1517
  $this->ob_start_detected = true;
1518
+ if ( $this->option_isset( "rewrite_titles" ) ) { // try alternate method -- pdb
1519
+ $aioseop_options['aiosp_rewrite_titles'] = 0;
1520
+ $force_rewrites = 0;
1521
+ add_filter( 'wp_title', array( $this, 'wp_title' ), 20 );
1522
+ }
1523
  if ( function_exists( 'ob_list_handlers' ) ) {
1524
  foreach ( ob_list_handlers() as $handler ) {
1525
  $this->log( "detected output handler $handler" );
1638
  global $aioseop_options;
1639
  $opts = $this->meta_opts;
1640
  $page = $this->get_page_number();
1641
+ $robots_meta = $tax_noindex = '';
1642
+ if ( isset( $aioseop_options['aiosp_tax_noindex'] ) ) $tax_noindex = $aioseop_options['aiosp_tax_noindex'];
1643
+
1644
+ if ( empty( $tax_noindex ) || !is_array( $tax_noindex) ) $tax_noindex = Array();
1645
+
1646
  $aiosp_noindex = $aiosp_nofollow = $aiosp_noodp = $aiosp_noydir = '';
1647
  $noindex = "index";
1648
  $nofollow = "follow";
1650
  && ( ( is_date() && !empty( $aioseop_options['aiosp_archive_date_noindex'] ) ) || ( is_author() && !empty( $aioseop_options['aiosp_archive_author_noindex'] ) ) ) )
1651
  || ( is_tag() && !empty( $aioseop_options['aiosp_tags_noindex'] ) )
1652
  || ( is_search() && !empty( $aioseop_options['aiosp_search_noindex'] ) )
1653
+ || ( is_404() && !empty( $aioseop_options['aiosp_404_noindex'] ) )
1654
+ || ( is_tax() && in_array( get_query_var( 'taxonomy' ), $tax_noindex ) ) ) {
1655
  $noindex = 'noindex';
1656
  } elseif ( ( is_single() || is_page() || $this->is_static_posts_page() || is_attachment() || ( $page > 1 ) ) ) {
1657
  $post_type = get_post_type();
1841
  $meta_string .= '<meta name="' . $v . '" content="' . trim( strip_tags( $aioseop_options["aiosp_{$k}_verify"] ) ) . '" />' . "\n";
1842
 
1843
  // sitelinks search
1844
+ if ( !empty( $aioseop_options["aiosp_google_sitelinks_search"] ) || !empty( $aioseop_options["aiosp_google_set_site_name"] ) )
1845
  $meta_string .= $this->sitelinks_search_box() . "\n";
1846
  }
1847
  // handle extra meta fields
2327
  }
2328
 
2329
  function sitelinks_search_box() {
2330
+ global $aioseop_options;
2331
+ $home_url = esc_url( get_home_url() );
2332
+ $name_block = $search_block = '';
2333
+ if ( !empty( $aioseop_options["aiosp_google_set_site_name"] ) ) {
2334
+ if ( !empty( $aioseop_options["aiosp_google_specify_site_name"] ) ) {
2335
+ $blog_name = $aioseop_options["aiosp_google_specify_site_name"];
2336
+ } else {
2337
+ $blog_name = get_bloginfo( 'name' );
2338
+ }
2339
+ $blog_name = esc_attr( $blog_name );
2340
+ $name_block=<<<EOF
2341
+ "name": "{$blog_name}",
2342
+ EOF;
2343
+ }
2344
+
2345
+ if ( !empty( $aioseop_options["aiosp_google_sitelinks_search"] ) ) {
2346
+ $search_block=<<<EOF
2347
+ "potentialAction": {
2348
+ "@type": "SearchAction",
2349
+ "target": "{$home_url}/?s={search_term}",
2350
+ "query-input": "required name=search_term"
2351
+ }
2352
+ EOF;
2353
+ }
2354
+
2355
  $search_box=<<<EOF
2356
  <script type="application/ld+json">
2357
  {
2358
  "@context": "http://schema.org",
2359
  "@type": "WebSite",
2360
  "url": "{$home_url}/",
2361
+ EOF;
2362
+ if ( !empty( $name_block ) ) $search_box .= $name_block;
2363
+ if ( !empty( $search_block ) ) $search_box .= $search_block;
2364
+ $search_box.=<<<EOF
 
2365
  }
2366
  </script>
2367
  EOF;
2486
  function get_post_description( $post ) {
2487
  global $aioseop_options;
2488
  $description = '';
2489
+ if ( !$this->show_page_description() ) {
2490
+ return '';
2491
+ }
2492
  $description = trim( stripslashes( $this->internationalize( get_post_meta( $post->ID, "_aioseop_description", true ) ) ) );
2493
  if ( !empty( $post ) && post_password_required( $post ) ) {
2494
  return $description;
2749
  return $title;
2750
  }
2751
 
2752
+ function title_placeholder_helper( $title, $post, $type = 'post', $title_format = '', $category = '' ) {
 
 
 
 
 
 
2753
  if ( !empty( $post ) )
2754
  $authordata = get_userdata( $post->post_author );
2755
  else
2756
  $authordata = new WP_User();
2757
+ $new_title = str_replace( "%blog_title%", $this->internationalize( get_bloginfo( 'name' ) ), $title_format );
2758
+ if ( strpos( $new_title, "%blog_description%" ) !== false ) $new_title = str_replace( "%blog_description%", $this->internationalize( get_bloginfo( 'description' ) ), $new_title );
2759
+ if ( strpos( $new_title, "%{$type}_title%" ) !== false ) $new_title = str_replace( "%{$type}_title%", $title, $new_title );
2760
+ if ( $type == 'post' ) {
2761
+ if ( strpos( $new_title, "%category%" ) !== false ) $new_title = str_replace( "%category%", $category, $new_title );
2762
+ if ( strpos( $new_title, "%category_title%" ) !== false ) $new_title = str_replace( "%category_title%", $category, $new_title );
2763
+ if ( strpos( $new_title, "%tax_" ) && !empty( $post ) ) {
2764
+ $taxes = get_object_taxonomies( $post, 'objects' );
2765
+ if ( !empty( $taxes ) )
2766
+ foreach( $taxes as $t )
2767
+ if ( strpos( $new_title, "%tax_{$t->name}%" ) ) {
2768
+ $terms = $this->get_all_terms( $post->ID, $t->name );
2769
+ $term = '';
2770
+ if ( count( $terms ) > 0 )
2771
+ $term = $terms[0];
2772
+ $new_title = str_replace( "%tax_{$t->name}%", $term, $new_title );
2773
+ }
2774
+ }
2775
+ }
2776
+ if ( strpos( $new_title, "%{$type}_author_login%" ) !== false ) $new_title = str_replace( "%{$type}_author_login%", $authordata->user_login, $new_title );
2777
+ if ( strpos( $new_title, "%{$type}_author_nicename%" ) !== false ) $new_title = str_replace( "%{$type}_author_nicename%", $authordata->user_nicename, $new_title );
2778
+ if ( strpos( $new_title, "%{$type}_author_firstname%" ) !== false ) $new_title = str_replace( "%{$type}_author_firstname%", $this->ucwords($authordata->first_name ), $new_title );
2779
+ if ( strpos( $new_title, "%{$type}_author_lastname%" ) !== false ) $new_title = str_replace( "%{$type}_author_lastname%", $this->ucwords($authordata->last_name ), $new_title );
2780
+ $title = trim( $new_title );
2781
  return $title;
2782
  }
2783
 
2784
+ function apply_post_title_format( $title, $category = '', $p = null ) {
2785
+ if ( $p === null ) {
2786
+ global $post;
2787
+ } else {
2788
+ $post = $p;
2789
+ }
2790
+ $title_format = $this->get_post_title_format( 'post', $post );
2791
+ return $this->title_placeholder_helper( $title, $post, 'post', $title_format, $category );
2792
+ }
2793
+
2794
  function apply_page_title_format( $title, $p = null, $title_format = '' ) {
2795
  global $aioseop_options;
2796
  if ( $p === null ) {
2797
+ global $post;
2798
  } else {
2799
  $post = $p;
2800
  }
2801
  if ( empty( $title_format ) )
2802
  $title_format = $aioseop_options['aiosp_page_title_format'];
2803
+ return $this->title_placeholder_helper( $title, $post, 'page', $title_format );
 
 
 
 
 
 
 
 
 
 
 
 
2804
  }
2805
 
2806
  /*** Gets the title that will be used by AIOSEOP for title rewrites or returns false. ***/
3119
  return $keywords;
3120
  }
3121
 
3122
+ function get_all_terms( $id, $taxnomy ) {
3123
+ $keywords = Array();
3124
+ $terms = get_the_terms( $id, $taxnomy );
3125
+ if ( !empty( $terms ) )
3126
+ foreach ( $terms as $term )
3127
+ $keywords[] = $this->internationalize( $term->name );
3128
+ return $keywords;
3129
+ }
3130
+
3131
  /**
3132
  * @return comma-separated list of unique keywords
3133
  */
3494
  //]]>
3495
  </script>
3496
  <div class="aioseop_advert aioseop_nopad">
3497
+ <a href="https://secure1.inmotionhosting.com/cgi-bin/gby/clickthru.cgi?id=internalsemperfi&page=3000" target="_blank"><img src="<?php echo AIOSEOP_PLUGIN_IMAGES_URL; ?>inmotion.gif"></a>
3498
+ </div>
3499
+ <div class="aioseop_advert aioseop_nopad_all">
3500
+ <?php $adid = mt_rand( 1, 4 ); ?>
3501
+ <a href="https://www.wincher.com/?referer=all-in-one-seo-pack&adreferer=banner<?php echo $adid; ?>" target="_blank"><div class=wincherad id=wincher<?php echo $adid; ?>></div></a>
3502
  </div>
3503
  <!-- Headway Themes-->
3504
  <div class="aioseop_advert">
aioseop_feature_manager.php CHANGED
@@ -10,7 +10,7 @@ if ( !class_exists( 'All_in_One_SEO_Pack_Feature_Manager' ) ) {
10
 
11
  protected $module_info = Array( );
12
 
13
- function All_in_One_SEO_Pack_Feature_Manager( $mod ) {
14
  $this->name = __('Feature Manager', 'all_in_one_seo_pack'); // Human-readable name of the plugin
15
  $this->prefix = 'aiosp_feature_manager_'; // option prefix
16
  $this->file = __FILE__; // the current file
@@ -24,6 +24,8 @@ if ( !class_exists( 'All_in_One_SEO_Pack_Feature_Manager' ) ) {
24
  'description' => __( 'Generate and validate your robots.txt file to guide search engines through your site.', 'all_in_one_seo_pack' ) ),
25
  'file_editor' => Array( 'name' => __( 'File Editor', 'all_in_one_seo_pack' ),
26
  'description' => __( 'Edit your robots.txt file and your .htaccess file to fine-tune your site.', 'all_in_one_seo_pack' ) ),
 
 
27
  'performance' => Array( 'name' => __( 'Performance', 'all_in_one_seo_pack' ),
28
  'description' => __( 'Optimize performance related to SEO and check your system status.', 'all_in_one_seo_pack' ),
29
  'default' => 'on' ),
@@ -71,8 +73,10 @@ if ( !class_exists( 'All_in_One_SEO_Pack_Feature_Manager' ) ) {
71
  );
72
  // load initial options / set defaults
73
  $this->update_options( );
74
- add_filter( $this->prefix . 'output_option', Array( $this, 'display_option_div' ), 10, 2 );
75
- add_filter( $this->prefix . 'submit_options', Array( $this, 'filter_submit' ) );
 
 
76
  }
77
 
78
  function menu_order() {
10
 
11
  protected $module_info = Array( );
12
 
13
+ function __construct( $mod ) {
14
  $this->name = __('Feature Manager', 'all_in_one_seo_pack'); // Human-readable name of the plugin
15
  $this->prefix = 'aiosp_feature_manager_'; // option prefix
16
  $this->file = __FILE__; // the current file
24
  'description' => __( 'Generate and validate your robots.txt file to guide search engines through your site.', 'all_in_one_seo_pack' ) ),
25
  'file_editor' => Array( 'name' => __( 'File Editor', 'all_in_one_seo_pack' ),
26
  'description' => __( 'Edit your robots.txt file and your .htaccess file to fine-tune your site.', 'all_in_one_seo_pack' ) ),
27
+ 'bad_robots'=> Array( 'name' => __( 'Bad Bot Blocker', 'all_in_one_seo_pack' ),
28
+ 'description' => __( 'Stop badly behaving bots from slowing down your website.', 'all_in_one_seo_pack' ) ),
29
  'performance' => Array( 'name' => __( 'Performance', 'all_in_one_seo_pack' ),
30
  'description' => __( 'Optimize performance related to SEO and check your system status.', 'all_in_one_seo_pack' ),
31
  'default' => 'on' ),
73
  );
74
  // load initial options / set defaults
75
  $this->update_options( );
76
+ if ( is_admin() ) {
77
+ add_filter( $this->prefix . 'output_option', Array( $this, 'display_option_div' ), 10, 2 );
78
+ add_filter( $this->prefix . 'submit_options', Array( $this, 'filter_submit' ) );
79
+ }
80
  }
81
 
82
  function menu_order() {
aioseop_functions.php CHANGED
@@ -189,6 +189,11 @@ if ( !function_exists( 'aioseop_admin_head' ) ) {
189
  td.seokeywords.column-seokeywords {
190
  overflow: visible;
191
  }
 
 
 
 
 
192
  </style>
193
  <?php wp_print_scripts( Array( 'sack' ) );
194
  ?><script type="text/javascript">
@@ -284,12 +289,14 @@ if ( !function_exists( 'aioseop_ajax_save_meta' ) ) {
284
 
285
  if ( !function_exists( 'aioseop_ajax_init' ) ) {
286
  function aioseop_ajax_init() {
287
- if ( !empty( $_POST ) && !empty( $_POST['settings'] ) && !empty( $_POST['nonce-aioseop']) && !empty( $_POST['options'] ) ) {
288
  $_POST = stripslashes_deep( $_POST );
289
  $settings = esc_attr( $_POST['settings'] );
290
  if ( ! defined( 'AIOSEOP_AJAX_MSG_TMPL' ) )
291
  define( 'AIOSEOP_AJAX_MSG_TMPL', "jQuery('div#aiosp_$settings').fadeOut('fast', function(){jQuery('div#aiosp_$settings').html('%s').fadeIn('fast');});" );
292
- if ( !wp_verify_nonce($_POST['nonce-aioseop'], 'aioseop-nonce') ) die( sprintf( AIOSEOP_AJAX_MSG_TMPL, __( "Unauthorized access; try reloading the page.", 'all_in_one_seo_pack' ) ) );
 
 
293
  } else {
294
  die(0);
295
  }
189
  td.seokeywords.column-seokeywords {
190
  overflow: visible;
191
  }
192
+ @media screen and (max-width: 782px) {
193
+ body.wp-admin th.column-seotitle, th.column-seodesc, th.column-seokeywords, td.seotitle.column-seotitle, td.seodesc.column-seodesc, td.seokeywords.column-seokeywords {
194
+ display: none;
195
+ }
196
+ }
197
  </style>
198
  <?php wp_print_scripts( Array( 'sack' ) );
199
  ?><script type="text/javascript">
289
 
290
  if ( !function_exists( 'aioseop_ajax_init' ) ) {
291
  function aioseop_ajax_init() {
292
+ if ( !empty( $_POST ) && !empty( $_POST['settings'] ) && (!empty( $_POST['nonce-aioseop'])||(!empty( $_POST['nonce-aioseop-edit']))) && !empty( $_POST['options'] ) ) {
293
  $_POST = stripslashes_deep( $_POST );
294
  $settings = esc_attr( $_POST['settings'] );
295
  if ( ! defined( 'AIOSEOP_AJAX_MSG_TMPL' ) )
296
  define( 'AIOSEOP_AJAX_MSG_TMPL', "jQuery('div#aiosp_$settings').fadeOut('fast', function(){jQuery('div#aiosp_$settings').html('%s').fadeIn('fast');});" );
297
+
298
+ if ( !wp_verify_nonce($_POST['nonce-aioseop'], 'aioseop-nonce') )
299
+ die( sprintf( AIOSEOP_AJAX_MSG_TMPL, __( "Unauthorized access; try reloading the page.", 'all_in_one_seo_pack' ) ) );
300
  } else {
301
  die(0);
302
  }
aioseop_module.css CHANGED
@@ -221,9 +221,38 @@ div.aioseop_tip_icon:before {
221
  padding-top: 0px;
222
  }
223
 
 
 
 
 
 
 
 
 
224
  .aioseop_adverts {
225
  float: right;
226
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
227
  .aioseop_content {
228
  min-width: 760px;
229
  clear: left;
@@ -460,10 +489,10 @@ div.aioseop_feature#aioseop_opengraph .aioseop_featured_image {
460
  div.aioseop_feature#aioseop_opengraph .aioseop_featured_image.active {
461
  background-image: url(images/SocialMeta-Color-Standard.png);
462
  }
463
- div.aioseop_feature#aioseop_robots .aioseop_featured_image {
464
  background-image: url(images/Robots-BW-Standard.png);
465
  }
466
- div.aioseop_feature#aioseop_robots .aioseop_featured_image.active {
467
  background-image: url(images/Robots-Color-Standard.png);
468
  }
469
  div.aioseop_feature#aioseop_file_editor .aioseop_featured_image {
@@ -701,6 +730,17 @@ table.aioseop_table td {
701
  border-right: 1px solid #dfdfdf;
702
  border-bottom: 1px solid #dfdfdf;
703
  }
 
 
 
 
 
 
 
 
 
 
 
704
  #aiosp_sitemap_addl_pages_metabox table.aioseop_table td {
705
  width: 25%;
706
  padding-left: 5%;
@@ -873,8 +913,8 @@ div.aioseop_notice a.aioseop_dismiss_link {
873
  .aioseop_tabs {
874
  padding-top: 6px;
875
  }
876
- .aioseop_tabs.hide {
877
- display: block;
878
  }
879
  .aioseop_header_tabs li {
880
  display: inline;
221
  padding-top: 0px;
222
  }
223
 
224
+ .aioseop_nopad_all {
225
+ padding: 0px;
226
+ height: 220px;
227
+ width: 445px;
228
+ margin-bottom: 20px;
229
+ border: none;
230
+ }
231
+
232
  .aioseop_adverts {
233
  float: right;
234
  }
235
+
236
+ .wincherad {
237
+ width: 100%;
238
+ height: 100%;
239
+ background-size: 100%;
240
+ background-repeat: no-repeat;
241
+ margin-bottom: 0px;
242
+ border: none;
243
+ }
244
+ #wincher1 {
245
+ background-image: url(images/wincher1.png);
246
+ }
247
+ #wincher2 {
248
+ background-image: url(images/wincher2.jpg);
249
+ }
250
+ #wincher3 {
251
+ background-image: url(images/wincher3.png);
252
+ }
253
+ #wincher4 {
254
+ background-image: url(images/wincher4.png);
255
+ }
256
  .aioseop_content {
257
  min-width: 760px;
258
  clear: left;
489
  div.aioseop_feature#aioseop_opengraph .aioseop_featured_image.active {
490
  background-image: url(images/SocialMeta-Color-Standard.png);
491
  }
492
+ div.aioseop_feature#aioseop_robots .aioseop_featured_image, div.aioseop_feature#aioseop_bad_robots .aioseop_featured_image {
493
  background-image: url(images/Robots-BW-Standard.png);
494
  }
495
+ div.aioseop_feature#aioseop_robots .aioseop_featured_image.active, div.aioseop_feature#aioseop_bad_robots .aioseop_featured_image.active {
496
  background-image: url(images/Robots-Color-Standard.png);
497
  }
498
  div.aioseop_feature#aioseop_file_editor .aioseop_featured_image {
730
  border-right: 1px solid #dfdfdf;
731
  border-bottom: 1px solid #dfdfdf;
732
  }
733
+ #aioseop_opengraph_settings_facebook_debug_result li.aioseop_opengraph_settings_facebook_debug_item {
734
+ display: inline-block;
735
+ width: 30%;
736
+ vertical-align: top;
737
+ }
738
+ #aioseop_opengraph_settings_facebook_debug_result li.aioseop_opengraph_settings_facebook_debug_item:nth-child(even) {
739
+ font-weight: bold;
740
+ }
741
+ #aioseop_opengraph_settings_facebook_debug_result li.aioseop_opengraph_settings_facebook_debug_item:nth-child(odd) {
742
+ width: 70%;
743
+ }
744
  #aiosp_sitemap_addl_pages_metabox table.aioseop_table td {
745
  width: 25%;
746
  padding-left: 5%;
913
  .aioseop_tabs {
914
  padding-top: 6px;
915
  }
916
+ .aioseop_tabs.hide, .aioseop_header_tabs.hide {
917
+ display: block !important;
918
  }
919
  .aioseop_header_tabs li {
920
  display: inline;
aioseop_module_class.php CHANGED
@@ -337,6 +337,258 @@ if ( !class_exists( 'All_in_One_SEO_Pack_Module' ) ) {
337
  return in_array( AIOSEOP_PLUGIN_BASENAME, (array) get_blog_option( $bid, 'active_plugins', array() ) );
338
  }
339
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
340
  /**
341
  * Displays tabs for tabbed locations on a settings page.
342
  */
337
  return in_array( AIOSEOP_PLUGIN_BASENAME, (array) get_blog_option( $bid, 'active_plugins', array() ) );
338
  }
339
 
340
+ function quote_list_for_regex( $list, $quote = '/' ) {
341
+ $regex = '';
342
+ $cont = 0;
343
+ foreach( $list as $l ) {
344
+ if ( $cont ) {
345
+ $regex .= '|';
346
+ }
347
+ $cont = 1;
348
+ $regex .= preg_quote( trim( $l ), $quote );
349
+ }
350
+ return $regex;
351
+ }
352
+
353
+ // original code thanks to Sean M. Brown -- http://smbrown.wordpress.com/2009/04/29/verify-googlebot-forward-reverse-dns/
354
+ function is_good_bot() {
355
+ $botlist = Array(
356
+ "Yahoo! Slurp" => "crawl.yahoo.net",
357
+ "googlebot" => ".googlebot.com",
358
+ "msnbot" => "search.msn.com"
359
+ );
360
+ $botlist = apply_filters( $this->prefix . "botlist", $botlist );
361
+ if ( !empty( $botlist ) ) {
362
+ $ua = $_SERVER['HTTP_USER_AGENT'];
363
+ $uas = $this->quote_list_for_regex( $botlist );
364
+ if ( preg_match( '/' . $uas . '/i', $ua ) ) {
365
+ $ip = $_SERVER['REMOTE_ADDR'];
366
+ $hostname = gethostbyaddr( $ip );
367
+ $ip_by_hostname = gethostbyname( $hostname );
368
+ if ( $ip_by_hostname == $ip ) {
369
+ $hosts = array_values( $botlist );
370
+ foreach( $hosts as $k => $h )
371
+ $hosts[$k] = preg_quote( $h ) . '$';
372
+ $hosts = join( '|', $hosts );
373
+ if ( preg_match( '/' . $hosts . '/i', $hostname ) )
374
+ return true;
375
+ }
376
+ }
377
+ return false;
378
+ }
379
+ }
380
+
381
+ function default_bad_bots() {
382
+ $botlist = Array(
383
+ "Abonti",
384
+ "aggregator",
385
+ "AhrefsBot",
386
+ "asterias",
387
+ "BDCbot",
388
+ "BLEXBot",
389
+ "BuiltBotTough",
390
+ "Bullseye",
391
+ "BunnySlippers",
392
+ "ca-crawler",
393
+ "CCBot",
394
+ "Cegbfeieh",
395
+ "CheeseBot",
396
+ "CherryPicker",
397
+ "CopyRightCheck",
398
+ "cosmos",
399
+ "Crescent",
400
+ "discobot",
401
+ "DittoSpyder",
402
+ "DOC",
403
+ "DotBot",
404
+ "Download Ninja",
405
+ "EasouSpider",
406
+ "EmailCollector",
407
+ "EmailSiphon",
408
+ "EmailWolf",
409
+ "EroCrawler",
410
+ "Exabot",
411
+ "ExtractorPro",
412
+ "Fasterfox",
413
+ "FeedBooster",
414
+ "Foobot",
415
+ "Genieo",
416
+ "grub-client",
417
+ "Harvest",
418
+ "hloader",
419
+ "httplib",
420
+ "HTTrack",
421
+ "humanlinks",
422
+ "ieautodiscovery",
423
+ "InfoNaviRobot",
424
+ "IstellaBot",
425
+ "Java/1.",
426
+ "JennyBot",
427
+ "k2spider",
428
+ "Kenjin Spider",
429
+ "Keyword Density/0.9",
430
+ "larbin",
431
+ "LexiBot",
432
+ "libWeb",
433
+ "libwww",
434
+ "LinkextractorPro",
435
+ "linko",
436
+ "LinkScan/8.1a Unix",
437
+ "LinkWalker",
438
+ "LNSpiderguy",
439
+ "lwp-trivial",
440
+ "magpie",
441
+ "Mata Hari",
442
+ 'MaxPointCrawler',
443
+ 'MegaIndex',
444
+ "Microsoft URL Control",
445
+ "MIIxpc",
446
+ "Mippin",
447
+ "Missigua Locator",
448
+ "Mister PiX",
449
+ "MJ12bot",
450
+ "moget",
451
+ "MSIECrawler",
452
+ "NetAnts",
453
+ "NICErsPRO",
454
+ "Niki-Bot",
455
+ "NPBot",
456
+ "Nutch",
457
+ "Offline Explorer",
458
+ "Openfind",
459
+ 'panscient.com',
460
+ "PHP/5.{",
461
+ "ProPowerBot/2.14",
462
+ "ProWebWalker",
463
+ "Python-urllib",
464
+ "QueryN Metasearch",
465
+ "RepoMonkey",
466
+ "RMA",
467
+ 'SemrushBot',
468
+ "SeznamBot",
469
+ "SISTRIX",
470
+ "sitecheck.Internetseer.com",
471
+ "SiteSnagger",
472
+ "SnapPreviewBot",
473
+ "Sogou",
474
+ "SpankBot",
475
+ "spanner",
476
+ "spbot",
477
+ "Spinn3r",
478
+ "suzuran",
479
+ "Szukacz/1.4",
480
+ "Teleport",
481
+ "Telesoft",
482
+ "The Intraformant",
483
+ "TheNomad",
484
+ "TightTwatBot",
485
+ "Titan",
486
+ "toCrawl/UrlDispatcher",
487
+ "True_Robot",
488
+ "turingos",
489
+ "TurnitinBot",
490
+ "UbiCrawler",
491
+ "UnisterBot",
492
+ "URLy Warning",
493
+ "VCI",
494
+ "WBSearchBot",
495
+ "Web Downloader/6.9",
496
+ "Web Image Collector",
497
+ "WebAuto",
498
+ "WebBandit",
499
+ "WebCopier",
500
+ "WebEnhancer",
501
+ "WebmasterWorldForumBot",
502
+ "WebReaper",
503
+ "WebSauger",
504
+ "Website Quester",
505
+ "Webster Pro",
506
+ "WebStripper",
507
+ "WebZip",
508
+ "Wotbox",
509
+ "wsr-agent",
510
+ "WWW-Collector-E",
511
+ "Xenu",
512
+ "yandex",
513
+ "Zao",
514
+ "Zeus",
515
+ "ZyBORG",
516
+ 'coccoc',
517
+ 'Incutio',
518
+ 'lmspider',
519
+ 'memoryBot',
520
+ 'SemrushBot',
521
+ 'serf',
522
+ 'Unknown',
523
+ 'uptime files'
524
+ );
525
+ return $botlist;
526
+ }
527
+
528
+ function is_bad_bot() {
529
+ $botlist = $this->default_bad_bots();
530
+ $botlist = apply_filters( $this->prefix . "badbotlist", $botlist );
531
+ if ( !empty( $botlist ) ) {
532
+ $ua = $_SERVER['HTTP_USER_AGENT'];
533
+ $uas = $this->quote_list_for_regex( $botlist );
534
+ if ( preg_match( '/' . $uas . '/i', $ua ) ) {
535
+ return true;
536
+ }
537
+ }
538
+ return false;
539
+ }
540
+
541
+ function default_bad_referers() {
542
+ $referlist = Array(
543
+ 'semalt.com',
544
+ 'kambasoft.com',
545
+ 'savetubevideo.com',
546
+ 'buttons-for-website.com',
547
+ 'sharebutton.net',
548
+ 'soundfrost.org',
549
+ 'srecorder.com',
550
+ 'softomix.com',
551
+ 'softomix.net',
552
+ 'myprintscreen.com',
553
+ 'joinandplay.me',
554
+ 'fbfreegifts.com',
555
+ 'openmediasoft.com',
556
+ 'zazagames.org',
557
+ 'extener.org',
558
+ 'openfrost.com',
559
+ 'openfrost.net',
560
+ 'googlsucks.com',
561
+ 'best-seo-offer.com',
562
+ 'buttons-for-your-website.com',
563
+ 'www.Get-Free-Traffic-Now.com',
564
+ 'best-seo-solution.com',
565
+ 'buy-cheap-online.info',
566
+ 'site3.free-share-buttons.com',
567
+ 'webmaster-traffic.com'
568
+ );
569
+ return $referlist;
570
+ }
571
+
572
+ function is_bad_referer() {
573
+ $referlist = $this->default_bad_referers();
574
+ $referlist = apply_filters( $this->prefix . "badreferlist", $botlist );
575
+ if ( !empty( $referlist ) ) {
576
+ $ref = $_SERVER['HTTP_REFERER'];
577
+ $regex = $this->quote_list_for_regex( $referlist );
578
+ if ( preg_match( '/' . $regex . '/i', $ref ) ) {
579
+ return true;
580
+ }
581
+ }
582
+ return false;
583
+ }
584
+
585
+ function allow_bot() {
586
+ $allow_bot = true;
587
+ if ( ( !$this->is_good_bot() ) && ( $this->is_bad_bot() ) && !is_user_logged_in() )
588
+ $allow_bot = false;
589
+ return apply_filters( $this->prefix . "allow_bot", $allow_bot );
590
+ }
591
+
592
  /**
593
  * Displays tabs for tabbed locations on a settings page.
594
  */
aioseop_module_manager.php CHANGED
@@ -13,7 +13,7 @@ if ( !class_exists( 'All_in_One_SEO_Pack_Module_Manager' ) ) {
13
  protected $settings_reset_all = false;
14
  protected $module_settings_update = false;
15
  // initialize module list
16
- function All_in_One_SEO_Pack_Module_Manager( $mod ) {
17
  $this->modules['feature_manager'] = null;
18
  foreach ( $mod as $m ) $this->modules[$m] = null;
19
  $reset = false;
13
  protected $settings_reset_all = false;
14
  protected $module_settings_update = false;
15
  // initialize module list
16
+ function __construct( $mod ) {
17
  $this->modules['feature_manager'] = null;
18
  foreach ( $mod as $m ) $this->modules[$m] = null;
19
  $reset = false;
aioseop_opengraph.php CHANGED
@@ -89,13 +89,15 @@ if ( !class_exists( 'All_in_One_SEO_Pack_Opengraph' ) ) {
89
  "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' ),
90
  "fallback" => __( "This option lets you fall back to the default image if no image could be found above.", 'all_in_one_seo_pack' ),
91
  "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' ),
 
 
92
  "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' ),
93
  "categories" => __( "Set the Open Graph type for your website as either a blog or a website.", 'all_in_one_seo_pack' ),
94
  "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' ),
95
  "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' ),
96
  "imagewidth" => __( "Enter the width for your Open Graph image in pixels (i.e. 600).", 'all_in_one_seo_pack' ),
97
  "imageheight" => __( "Enter the height for your Open Graph image in pixels (i.e. 600).", 'all_in_one_seo_pack' ),
98
- "video" => __( "This option lets you specify a link to the Open Graph video used on this Page or Post.", 'all_in_one_seo_pack' ),
99
  "videowidth" => __( "Enter the width for your Open Graph video in pixels (i.e. 600).", 'all_in_one_seo_pack' ),
100
  "videoheight" => __( "Enter the height for your Open Graph video in pixels (i.e. 600).", 'all_in_one_seo_pack' ),
101
  "defcard" => __( "Select the default type of Twitter card to display.", 'all_in_one_seo_pack' ),
@@ -111,10 +113,14 @@ if ( !class_exists( 'All_in_One_SEO_Pack_Opengraph' ) ) {
111
  "title" => __( "This is the Open Graph title of this Page or Post.", 'all_in_one_seo_pack' ),
112
  "desc" => __( "This is the Open Graph description of this Page or Post.", 'all_in_one_seo_pack' ),
113
  "category" => __( "Select the Open Graph type that best describes the content of this Page or Post.", 'all_in_one_seo_pack' ),
 
114
  "section" => __( "This Open Graph meta allows you to add a general section name that best describes this content.", 'all_in_one_seo_pack' ),
115
  "tag" => __( "This Open Graph meta allows you to add a list of keywords that best describe this content.", 'all_in_one_seo_pack' ),
116
  "facebook_publisher" => __( "Link articles to the Facebook page associated with your website.", 'all_in_one_seo_pack' ),
117
  "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' ),
 
 
 
118
  );
119
 
120
  $this->help_anchors = Array(
@@ -161,6 +167,10 @@ if ( !class_exists( 'All_in_One_SEO_Pack_Opengraph' ) ) {
161
  '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' ) ) ),
162
  'fallback' => Array( 'name' => __( 'Use Default If No Image Found', 'all_in_one_seo_pack' ), 'type' => 'checkbox' ),
163
  'dimg' => Array( 'name' => __( 'Default OG:Image', 'all_in_one_seo_pack' ), 'default' => AIOSEOP_PLUGIN_IMAGES_URL . 'default-user-image.png', 'type' => 'image' ),
 
 
 
 
164
  'meta_key' => Array( 'name' => __( 'Use Custom Field For Image', 'all_in_one_seo_pack' ), 'type' => 'text', 'default' => '' ),
165
  'categories' => Array( 'name' => __( 'Facebook Object Type', 'all_in_one_seo_pack'),
166
  'type' => 'radio', 'initial_options' => $categories, 'default' => 'blog' ),
@@ -203,12 +213,32 @@ if ( !class_exists( 'All_in_One_SEO_Pack_Opengraph' ) ) {
203
  'initial_options' => $this->fb_object_types,
204
  'default' => ''
205
  ),
206
- 'section' => Array( 'name' => __( 'Article Section', 'all_in_one_seo_pack' ),
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
207
  'type' => 'text', 'default' => '', 'condshow' => Array( 'aioseop_opengraph_settings_category' => 'article' ) ),
208
  'tag' => Array( 'name' => __( 'Article Tags', 'all_in_one_seo_pack' ),
209
  'type' => 'text', 'default' => '', 'condshow' => Array( 'aioseop_opengraph_settings_category' => 'article' ) ),
210
  'facebook_publisher'=>Array('name' => __( 'Show Facebook Publisher on Articles', 'all_in_one_seo_pack' ), 'type' => 'text', 'default' => '' ),
211
- 'facebook_author'=>Array( 'name' => __( 'Show Facebook Author on Articles', 'all_in_one_seo_pack' ) ),
 
 
 
 
212
  );
213
 
214
  // load initial options / set defaults
@@ -220,11 +250,11 @@ if ( !class_exists( 'All_in_One_SEO_Pack_Opengraph' ) ) {
220
  $this->locations = array(
221
  'opengraph' => Array( 'name' => $this->name, 'prefix' => 'aiosp_', 'type' => 'settings',
222
  'options' => Array('scan_header', 'setmeta', 'key', 'sitename', 'title_shortcodes', 'description_shortcodes', 'hometitle', 'description', 'homeimage', 'hometag', 'generate_descriptions', 'defimg',
223
- 'fallback', 'dimg', 'meta_key', 'categories', 'defcard', 'twitter_site', 'twitter_creator', 'twitter_domain', 'gen_tags', 'gen_keywords', 'gen_categories',
224
  'gen_post_tags', 'types', 'facebook_publisher', 'facebook_author' ) ),
225
  'settings' => Array( 'name' => __('Social Settings', 'all_in_one_seo_pack'),
226
  'type' => 'metabox', 'help_link' => 'http://semperplugins.com/documentation/social-meta-module/#pagepost_settings',
227
- 'options' => Array( 'title', 'desc', 'image', 'customimg', 'imagewidth', 'imageheight', 'video', 'videowidth', 'videoheight', 'category', 'section', 'tag', 'setcard' ),
228
  'display' => $display, 'prefix' => 'aioseop_opengraph_'
229
  )
230
  );
@@ -243,8 +273,13 @@ if ( !class_exists( 'All_in_One_SEO_Pack_Opengraph' ) ) {
243
  'image' => Array(
244
  'name' => __( 'Image Settings', 'all_in_one_seo_pack' ),
245
  'help_link' => 'http://semperplugins.com/documentation/social-meta-module/',
246
- 'options' => Array( 'defimg', 'fallback', 'dimg', 'meta_key' )
247
- ),
 
 
 
 
 
248
  'facebook' => Array(
249
  'name' => __( 'Facebook Settings', 'all_in_one_seo_pack' ),
250
  'help_link' => 'http://semperplugins.com/documentation/social-meta-module/',
@@ -269,7 +304,7 @@ if ( !class_exists( 'All_in_One_SEO_Pack_Opengraph' ) ) {
269
  $this->layout['default']['options'] = array_diff( array_keys( $this->default_options ), $other_options );
270
 
271
  if ( is_admin() ) {
272
- add_action( 'admin_init', Array( $this, 'debug_post_types' ), 5 );
273
  } else {
274
  add_action( 'wp', Array( $this, 'type_setup' ) );
275
  }
@@ -387,10 +422,10 @@ if ( !class_exists( 'All_in_One_SEO_Pack_Opengraph' ) ) {
387
  $args['options']['type'] = 'submit';
388
  $args['attr'] = " class='button-primary' ";
389
  $args['value'] = $args['options']['default'] = __( 'Scan Now', 'all_in_one_seo_pack' );
 
 
 
390
  }
391
- $buf .= __( 'Scan your site for duplicate social meta tags.', 'all_in_one_seo_pack' );
392
- $buf .= '<br /><br />' . $this->get_option_html( $args );
393
- $buf .= '</div></div></div>';
394
  return $buf;
395
  }
396
 
@@ -455,6 +490,7 @@ if ( !class_exists( 'All_in_One_SEO_Pack_Opengraph' ) ) {
455
  $url = apply_filters( 'aioseop_canonical_url', $url );
456
 
457
  $setmeta = $this->options['aiosp_opengraph_setmeta'];
 
458
  if ( is_front_page() ) {
459
  $title = $this->options['aiosp_opengraph_hometitle'];
460
  if ( $first_page )
@@ -466,7 +502,7 @@ if ( !class_exists( 'All_in_One_SEO_Pack_Opengraph' ) ) {
466
 
467
  /* If Use AIOSEO Title and Desc Selected */
468
  if( $setmeta ) {
469
- $title = $aiosp->get_aioseop_title( $post );
470
  if ( $first_page )
471
  $description = $aiosp->get_aioseop_description( $post );
472
  }
@@ -482,6 +518,17 @@ if ( !class_exists( 'All_in_One_SEO_Pack_Opengraph' ) ) {
482
  if ( $type == 'article' && ( !empty( $this->options['aiosp_opengraph_hometag'] ) ) ) {
483
  $tag = $this->options['aiosp_opengraph_hometag'];
484
  }
 
 
 
 
 
 
 
 
 
 
 
485
  } elseif ( is_singular( ) && $this->option_isset('types')
486
  && is_array( $this->options['aiosp_opengraph_types'] )
487
  && in_array( $current_post_type, $this->options['aiosp_opengraph_types'] ) ) {
@@ -521,7 +568,7 @@ if ( !class_exists( 'All_in_One_SEO_Pack_Opengraph' ) ) {
521
  /* Add AIOSEO variables if Site Title and Desc from AIOSEOP not selected */
522
  global $aiosp;
523
  if( empty( $title ) )
524
- $title = $aiosp->get_aioseop_title( $post );
525
  if ( empty( $description ) )
526
  $description = trim( strip_tags( get_post_meta( $post->ID, "_aioseop_description", true ) ) );
527
 
@@ -618,6 +665,10 @@ if ( !class_exists( 'All_in_One_SEO_Pack_Opengraph' ) ) {
618
  $width = $metabox['aioseop_opengraph_settings_imagewidth'];
619
  if ( !empty( $metabox['aioseop_opengraph_settings_imageheight'] ) )
620
  $height = $metabox['aioseop_opengraph_settings_imageheight'];
 
 
 
 
621
  }
622
 
623
  if ( !empty( $video ) ) {
@@ -735,6 +786,32 @@ if ( !class_exists( 'All_in_One_SEO_Pack_Opengraph' ) ) {
735
  }
736
  }
737
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
738
  }
739
 
740
  function do_opengraph( ) {
89
  "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' ),
90
  "fallback" => __( "This option lets you fall back to the default image if no image could be found above.", 'all_in_one_seo_pack' ),
91
  "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' ),
92
+ "dimgwidth" => __( "This option lets you set a default width for your images, where unspecified.", "all_in_one_seo_pack" ),
93
+ "dimgheight" => __( "This option lets you set a default height for your images, where unspecified.", "all_in_one_seo_pack" ),
94
  "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' ),
95
  "categories" => __( "Set the Open Graph type for your website as either a blog or a website.", 'all_in_one_seo_pack' ),
96
  "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' ),
97
  "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' ),
98
  "imagewidth" => __( "Enter the width for your Open Graph image in pixels (i.e. 600).", 'all_in_one_seo_pack' ),
99
  "imageheight" => __( "Enter the height for your Open Graph image in pixels (i.e. 600).", 'all_in_one_seo_pack' ),
100
+ "video" => __( "This option lets you specify a link to the Open Graph video used on this Page or Post.", 'all_in_one_seo_pack' ),
101
  "videowidth" => __( "Enter the width for your Open Graph video in pixels (i.e. 600).", 'all_in_one_seo_pack' ),
102
  "videoheight" => __( "Enter the height for your Open Graph video in pixels (i.e. 600).", 'all_in_one_seo_pack' ),
103
  "defcard" => __( "Select the default type of Twitter card to display.", 'all_in_one_seo_pack' ),
113
  "title" => __( "This is the Open Graph title of this Page or Post.", 'all_in_one_seo_pack' ),
114
  "desc" => __( "This is the Open Graph description of this Page or Post.", 'all_in_one_seo_pack' ),
115
  "category" => __( "Select the Open Graph type that best describes the content of this Page or Post.", 'all_in_one_seo_pack' ),
116
+ "facebook_debug" => __( "Press this button to have Facebook re-fetch and debug this page.", 'all_in_one_seo_pack' ),
117
  "section" => __( "This Open Graph meta allows you to add a general section name that best describes this content.", 'all_in_one_seo_pack' ),
118
  "tag" => __( "This Open Graph meta allows you to add a list of keywords that best describe this content.", 'all_in_one_seo_pack' ),
119
  "facebook_publisher" => __( "Link articles to the Facebook page associated with your website.", 'all_in_one_seo_pack' ),
120
  "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' ),
121
+ "person_or_org" => __( "Are the social profile links for your website for a person or an organization?", 'all_in_one_seo_pack' ),
122
+ "profile_links" => __( "Add URLs for your website's social profiles here (Facebook, Twitter, Google+, Instagram, LinkedIn), one per line.", 'all_in_one_seo_pack' ),
123
+ "social_name" => __( "Add the name of the person or organization who owns these profiles.", 'all_in_one_seo_pack' )
124
  );
125
 
126
  $this->help_anchors = Array(
167
  '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' ) ) ),
168
  'fallback' => Array( 'name' => __( 'Use Default If No Image Found', 'all_in_one_seo_pack' ), 'type' => 'checkbox' ),
169
  'dimg' => Array( 'name' => __( 'Default OG:Image', 'all_in_one_seo_pack' ), 'default' => AIOSEOP_PLUGIN_IMAGES_URL . 'default-user-image.png', 'type' => 'image' ),
170
+ 'dimgwidth' => Array( 'name' => __( 'Default Image Width', 'all_in_one_seo_pack' ),
171
+ 'type' => 'text', 'default' => '' ),
172
+ 'dimgheight' => Array( 'name' => __( 'Default Image Height', 'all_in_one_seo_pack' ),
173
+ 'type' => 'text', 'default' => '' ),
174
  'meta_key' => Array( 'name' => __( 'Use Custom Field For Image', 'all_in_one_seo_pack' ), 'type' => 'text', 'default' => '' ),
175
  'categories' => Array( 'name' => __( 'Facebook Object Type', 'all_in_one_seo_pack'),
176
  'type' => 'radio', 'initial_options' => $categories, 'default' => 'blog' ),
213
  'initial_options' => $this->fb_object_types,
214
  'default' => ''
215
  ),
216
+ 'facebook_debug'=> Array( 'name' => __( 'Facebook Debug', 'all_in_one_seo_pack' ), 'type' => 'html', 'save' => false,
217
+ 'default' =>
218
+ '<script>
219
+ jQuery(document).ready(function() {
220
+ var snippet = jQuery("#aioseop_snippet_link");
221
+ if ( !snippet ) {
222
+ jQuery( "#aioseop_opengraph_settings_facebook_debug_wrapper").hide();
223
+ } else {
224
+ snippet = snippet.html();
225
+ jQuery("#aioseop_opengraph_settings_facebook_debug").attr( "href", "https://developers.facebook.com/tools/debug/og/object?q=" + snippet );
226
+ }
227
+ });
228
+ </script>
229
+ <a name="aioseop_opengraph_settings_facebook_debug" id="aioseop_opengraph_settings_facebook_debug" class="button-primary" href="" target=_blank>' . __( 'Debug This Post', 'all_in_one_seo_pack' )
230
+ . '</a>' ),
231
+
232
+ 'section' => Array( 'name' => __( 'Article Section', 'all_in_one_seo_pack' ),
233
  'type' => 'text', 'default' => '', 'condshow' => Array( 'aioseop_opengraph_settings_category' => 'article' ) ),
234
  'tag' => Array( 'name' => __( 'Article Tags', 'all_in_one_seo_pack' ),
235
  'type' => 'text', 'default' => '', 'condshow' => Array( 'aioseop_opengraph_settings_category' => 'article' ) ),
236
  'facebook_publisher'=>Array('name' => __( 'Show Facebook Publisher on Articles', 'all_in_one_seo_pack' ), 'type' => 'text', 'default' => '' ),
237
+ 'facebook_author' =>Array('name' => __( 'Show Facebook Author on Articles', 'all_in_one_seo_pack' ) ),
238
+ 'profile_links' =>Array('name' => __( 'Social Profile Links', 'all_in_one_seo_pack' ), 'type' => 'textarea', 'cols' => 60, 'rows' => 5 ),
239
+ 'person_or_org' =>Array('name' => __( 'Person or Organization?', 'all_in_one_seo_pack' ),
240
+ 'type' => 'radio', 'initial_options' => Array( 'person' => __( 'Person', 'all_in_one_seo_pack' ), 'org' => __( 'Organization', 'all_in_one_seo_pack' ) ) ),
241
+ 'social_name' =>Array('name' => __( "Associated Name", 'all_in_one_seo_pack' ), 'type' => 'text', 'default' => "" ),
242
  );
243
 
244
  // load initial options / set defaults
250
  $this->locations = array(
251
  'opengraph' => Array( 'name' => $this->name, 'prefix' => 'aiosp_', 'type' => 'settings',
252
  'options' => Array('scan_header', 'setmeta', 'key', 'sitename', 'title_shortcodes', 'description_shortcodes', 'hometitle', 'description', 'homeimage', 'hometag', 'generate_descriptions', 'defimg',
253
+ 'fallback', 'dimg', 'dimgwidth', 'dimgheight', 'meta_key', 'categories', 'defcard', 'profile_links', 'person_or_org', 'social_name', 'twitter_site', 'twitter_creator', 'twitter_domain', 'gen_tags', 'gen_keywords', 'gen_categories',
254
  'gen_post_tags', 'types', 'facebook_publisher', 'facebook_author' ) ),
255
  'settings' => Array( 'name' => __('Social Settings', 'all_in_one_seo_pack'),
256
  'type' => 'metabox', 'help_link' => 'http://semperplugins.com/documentation/social-meta-module/#pagepost_settings',
257
+ 'options' => Array( 'title', 'desc', 'image', 'customimg', 'imagewidth', 'imageheight', 'video', 'videowidth', 'videoheight', 'category', 'facebook_debug', 'section', 'tag', 'setcard' ),
258
  'display' => $display, 'prefix' => 'aioseop_opengraph_'
259
  )
260
  );
273
  'image' => Array(
274
  'name' => __( 'Image Settings', 'all_in_one_seo_pack' ),
275
  'help_link' => 'http://semperplugins.com/documentation/social-meta-module/',
276
+ 'options' => Array( 'defimg', 'fallback', 'dimg', 'dimgwidth', 'dimgheight', 'meta_key' )
277
+ ),
278
+ 'links' => Array(
279
+ 'name' => __( 'Social Profile Links', 'all_in_one_seo_pack' ),
280
+ 'help_link' => 'http://semperplugins.com/documentation/social-meta-module/',
281
+ 'options' => Array( 'profile_links', 'person_or_org', 'social_name' )
282
+ ),
283
  'facebook' => Array(
284
  'name' => __( 'Facebook Settings', 'all_in_one_seo_pack' ),
285
  'help_link' => 'http://semperplugins.com/documentation/social-meta-module/',
304
  $this->layout['default']['options'] = array_diff( array_keys( $this->default_options ), $other_options );
305
 
306
  if ( is_admin() ) {
307
+ add_action( 'admin_init', Array( $this, 'debug_post_types' ), 5 );
308
  } else {
309
  add_action( 'wp', Array( $this, 'type_setup' ) );
310
  }
422
  $args['options']['type'] = 'submit';
423
  $args['attr'] = " class='button-primary' ";
424
  $args['value'] = $args['options']['default'] = __( 'Scan Now', 'all_in_one_seo_pack' );
425
+ $buf .= __( 'Scan your site for duplicate social meta tags.', 'all_in_one_seo_pack' );
426
+ $buf .= '<br /><br />' . $this->get_option_html( $args );
427
+ $buf .= '</div></div></div>';
428
  }
 
 
 
429
  return $buf;
430
  }
431
 
490
  $url = apply_filters( 'aioseop_canonical_url', $url );
491
 
492
  $setmeta = $this->options['aiosp_opengraph_setmeta'];
493
+ $social_links = '';
494
  if ( is_front_page() ) {
495
  $title = $this->options['aiosp_opengraph_hometitle'];
496
  if ( $first_page )
502
 
503
  /* If Use AIOSEO Title and Desc Selected */
504
  if( $setmeta ) {
505
+ $title = $aiosp->wp_title();
506
  if ( $first_page )
507
  $description = $aiosp->get_aioseop_description( $post );
508
  }
518
  if ( $type == 'article' && ( !empty( $this->options['aiosp_opengraph_hometag'] ) ) ) {
519
  $tag = $this->options['aiosp_opengraph_hometag'];
520
  }
521
+ if ( !empty( $this->options['aiosp_opengraph_profile_links'] ) ) {
522
+ $social_links = $this->options['aiosp_opengraph_profile_links'];
523
+ if ( !empty( $this->options['aiosp_opengraph_social_name'] ) ) {
524
+ $social_name = $this->options['aiosp_opengraph_social_name'];
525
+ }
526
+ if ( $this->options['aiosp_opengraph_person_or_org'] == 'person' ) {
527
+ $social_type = "Person";
528
+ } else {
529
+ $social_type = "Organization";
530
+ }
531
+ }
532
  } elseif ( is_singular( ) && $this->option_isset('types')
533
  && is_array( $this->options['aiosp_opengraph_types'] )
534
  && in_array( $current_post_type, $this->options['aiosp_opengraph_types'] ) ) {
568
  /* Add AIOSEO variables if Site Title and Desc from AIOSEOP not selected */
569
  global $aiosp;
570
  if( empty( $title ) )
571
+ $title = $aiosp->wp_title();
572
  if ( empty( $description ) )
573
  $description = trim( strip_tags( get_post_meta( $post->ID, "_aioseop_description", true ) ) );
574
 
665
  $width = $metabox['aioseop_opengraph_settings_imagewidth'];
666
  if ( !empty( $metabox['aioseop_opengraph_settings_imageheight'] ) )
667
  $height = $metabox['aioseop_opengraph_settings_imageheight'];
668
+ if ( empty( $width ) && !empty( $this->options['aiosp_opengraph_dimgwidth'] ) )
669
+ $width = $this->options['aiosp_opengraph_dimgwidth'];
670
+ if ( empty( $height ) && !empty( $this->options['aiosp_opengraph_dimgheight'] ) )
671
+ $height = $this->options['aiosp_opengraph_dimgheight'];
672
  }
673
 
674
  if ( !empty( $video ) ) {
786
  }
787
  }
788
  }
789
+ if ( !empty( $social_links ) ) {
790
+ $home_url = esc_url( get_home_url() );
791
+ $social_links = explode( "\n", $social_links );
792
+ foreach( $social_links as $k => $v ) {
793
+ $v = trim( $v );
794
+ if ( empty( $v ) ) {
795
+ unset( $social_links[$k] );
796
+ } else {
797
+ $v = esc_url( $v );
798
+ $social_links[$k] = $v;
799
+ }
800
+ }
801
+ $social_links = join( '","', $social_links );
802
+ $social_link_schema =<<<END
803
+ <script type="application/ld+json">
804
+ { "@context" : "http://schema.org",
805
+ "@type" : "{$social_type}",
806
+ "name" : "{$social_name}",
807
+ "url" : "{$home_url}",
808
+ "sameAs" : ["{$social_links}"]
809
+ }
810
+ </script>
811
+
812
+ END;
813
+ }
814
+ echo apply_filters( 'aiosp_opengraph_social_link_schema', $social_link_schema );
815
  }
816
 
817
  function do_opengraph( ) {
aioseop_robots.php CHANGED
@@ -8,7 +8,7 @@
8
  if ( !class_exists( 'All_in_One_SEO_Pack_Robots' ) ) {
9
  class All_in_One_SEO_Pack_Robots extends All_in_One_SEO_Pack_Module {
10
 
11
- function All_in_One_SEO_Pack_Robots( ) {
12
  $this->name = __('Robots.txt', 'all_in_one_seo_pack'); // Human-readable name of the plugin
13
  $this->prefix = 'aiosp_robots_'; // option prefix
14
  $this->file = __FILE__; // the current file
8
  if ( !class_exists( 'All_in_One_SEO_Pack_Robots' ) ) {
9
  class All_in_One_SEO_Pack_Robots extends All_in_One_SEO_Pack_Module {
10
 
11
+ function __construct( ) {
12
  $this->name = __('Robots.txt', 'all_in_one_seo_pack'); // Human-readable name of the plugin
13
  $this->prefix = 'aiosp_robots_'; // option prefix
14
  $this->file = __FILE__; // the current file
aioseop_sitemap.php CHANGED
@@ -19,7 +19,7 @@ if ( !class_exists( 'All_in_One_SEO_Pack_Sitemap' ) ) {
19
  var $freq_sel;
20
  var $extra_sitemaps;
21
 
22
- function All_in_One_SEO_Pack_Sitemap( ) {
23
  if ( get_class( $this ) === 'All_in_One_SEO_Pack_Sitemap' ) { // Set this up only when instantiated as this class
24
  $this->name = __( 'XML Sitemap', 'all_in_one_seo_pack' ); // Human-readable name of the plugin
25
  $this->prefix = 'aiosp_sitemap_'; // option prefix
@@ -34,6 +34,7 @@ if ( !class_exists( 'All_in_One_SEO_Pack_Sitemap' ) ) {
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' ),
@@ -79,6 +80,7 @@ if ( !class_exists( 'All_in_One_SEO_Pack_Sitemap' ) ) {
79
  'default' => 'sitemap', 'type' => 'text', 'sanitize' => 'filename' ),
80
  'google' => Array( 'name' => __( 'Notify Google', 'all_in_one_seo_pack') ),
81
  'bing' => Array( 'name' => __( 'Notify Bing', 'all_in_one_seo_pack') ),
 
82
  'indexes' => Array( 'name' => __( 'Enable Sitemap Indexes', 'all_in_one_seo_pack' ) ),
83
  'paginate' => Array( 'name' => __( 'Paginate Sitemap Indexes', 'all_in_one_seo_pack' ),
84
  'condshow' => Array( "{$this->prefix}indexes" => 'on' ) ),
@@ -95,7 +97,7 @@ if ( !class_exists( 'All_in_One_SEO_Pack_Sitemap' ) ) {
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(
@@ -193,13 +195,27 @@ if ( !class_exists( 'All_in_One_SEO_Pack_Sitemap' ) ) {
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' ) );
199
  add_filter( $this->prefix . 'display_settings', Array( $this, 'update_post_data' ) );
200
  add_filter( $this->prefix . 'display_options', Array( $this, 'filter_display_options' ) );
201
  add_filter( $this->prefix . 'update_options', Array( $this, 'filter_options' ) );
202
  add_filter( $this->prefix . 'output_option', Array( $this, 'display_custom_options' ), 10, 2 );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
203
  }
204
 
205
  /** Initialize options, after constructor **/
@@ -218,6 +234,13 @@ if ( !class_exists( 'All_in_One_SEO_Pack_Sitemap' ) ) {
218
 
219
  if ( $this->option_isset( 'robots' ) )
220
  add_action( 'do_robots', Array( $this, 'do_robots' ), 100 );
 
 
 
 
 
 
 
221
  }
222
 
223
  /** Custom settings - displays boxes for add pages to sitemap option. **/
@@ -244,33 +267,6 @@ if ( !class_exists( 'All_in_One_SEO_Pack_Sitemap' ) ) {
244
  return $buf;
245
  }
246
 
247
- // original code thanks to Sean M. Brown -- http://smbrown.wordpress.com/2009/04/29/verify-googlebot-forward-reverse-dns/
248
- function is_good_bot() {
249
- $botlist = Array(
250
- "Yahoo! Slurp" => "crawl.yahoo.net",
251
- "googlebot" => ".googlebot.com",
252
- "msnbot" => "search.msn.com"
253
- );
254
- $botlist = apply_filters( $this->prefix . "botlist", $botlist );
255
- if ( !empty( $botlist ) )
256
- $ua = $_SERVER['HTTP_USER_AGENT'];
257
- $uas = join( '|', array_map( 'preg_quote', array_keys( $botlist ) ) );
258
- if ( preg_match( '/' . $uas . '/i', $ua ) ) {
259
- $ip = $_SERVER['REMOTE_ADDR'];
260
- $hostname = gethostbyaddr( $ip );
261
- $ip_by_hostname = gethostbyname( $hostname );
262
- if ( $ip_by_hostname == $ip ) {
263
- $hosts = array_values( $botlist );
264
- foreach( $hosts as $k => $h )
265
- $hosts[$k] = preg_quote( $h ) . '$';
266
- $hosts = join( '|', $hosts );
267
- if ( preg_match( '/' . $hosts . '/i', $hostname ) )
268
- return true;
269
- }
270
- }
271
- return false;
272
- }
273
-
274
  /** Add post type details for settings once post types have been registered. **/
275
  function add_post_types() {
276
  $post_type_titles = $this->get_post_type_titles( Array( 'public' => true ) );
@@ -794,7 +790,7 @@ if ( !class_exists( 'All_in_One_SEO_Pack_Sitemap' ) ) {
794
  }
795
 
796
  /** Build static sitemaps on submit if rewrite rules are not in use, do logging. **/
797
- function do_sitemaps() {
798
  if ( !empty( $this->options["{$this->prefix}indexes"] ) && !empty( $this->options["{$this->prefix}paginate"] ) ) {
799
  $this->paginate = true;
800
  if ( ( $this->options["{$this->prefix}max_posts"] ) && ( $this->options["{$this->prefix}max_posts"] > 0 ) && ( $this->options["{$this->prefix}max_posts"] < 50000 ) )
@@ -819,7 +815,11 @@ if ( !class_exists( 'All_in_One_SEO_Pack_Sitemap' ) ) {
819
  delete_transient( "{$this->prefix}rules_flushed" );
820
  }
821
  $this->do_notify();
822
- $this->debug_message( __( 'Updated sitemap settings.', 'all_in_one_seo_pack' ) );
 
 
 
 
823
  }
824
 
825
  function add_xml_mime_type( $mime ) {
19
  var $freq_sel;
20
  var $extra_sitemaps;
21
 
22
+ function __construct( ) {
23
  if ( get_class( $this ) === 'All_in_One_SEO_Pack_Sitemap' ) { // Set this up only when instantiated as this class
24
  $this->name = __( 'XML Sitemap', 'all_in_one_seo_pack' ); // Human-readable name of the plugin
25
  $this->prefix = 'aiosp_sitemap_'; // option prefix
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
+ "daily_cron" => __( "Notify search engines daily, and also update static sitemap daily if in use. (this uses WP-Cron, so make sure this is working properly on your server as well)", 'all_in_one_seo_pack' ),
38
  "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' ),
39
  "paginate" => __( "Split long sitemaps into separate files.", 'all_in_one_seo_pack' ),
40
  "max_posts" => __( "Allows you to specify the maximum number of posts in a sitemap (up to 50,000).", 'all_in_one_seo_pack' ),
80
  'default' => 'sitemap', 'type' => 'text', 'sanitize' => 'filename' ),
81
  'google' => Array( 'name' => __( 'Notify Google', 'all_in_one_seo_pack') ),
82
  'bing' => Array( 'name' => __( 'Notify Bing', 'all_in_one_seo_pack') ),
83
+ 'daily_cron'=> Array( 'name' => __( 'Schedule Daily Updates', 'all_in_one_seo_pack' ) ),
84
  'indexes' => Array( 'name' => __( 'Enable Sitemap Indexes', 'all_in_one_seo_pack' ) ),
85
  'paginate' => Array( 'name' => __( 'Paginate Sitemap Indexes', 'all_in_one_seo_pack' ),
86
  'condshow' => Array( "{$this->prefix}indexes" => 'on' ) ),
97
  'robots' => Array( 'name' => __( 'Link From Virtual Robots.txt', 'all_in_one_seo_pack' ), 'default' => 'On' ),
98
  'rewrite' => Array( 'name' => __( 'Dynamically Generate Sitemap', 'all_in_one_seo_pack' ), 'default' => 'On' ),
99
  'noindex' => Array( 'name' => __( 'Noindex Sitemap file', 'all_in_one_seo_pack' ),
100
+ 'condshow' => Array( "{$this->prefix}rewrite" => true ) )
101
  );
102
 
103
  $status_options = Array(
195
  $this->default_options = array_merge( $status_options, $this->default_options, $addl_options, $excl_options, $prio_options, $freq_options );
196
 
197
  $this->add_help_text_links();
198
+
199
  add_action( 'init', Array( $this, 'load_sitemap_options' ) );
200
  add_action( $this->prefix . 'settings_update', Array( $this, 'do_sitemaps' ) );
201
  add_filter( $this->prefix . 'display_settings', Array( $this, 'update_post_data' ) );
202
  add_filter( $this->prefix . 'display_options', Array( $this, 'filter_display_options' ) );
203
  add_filter( $this->prefix . 'update_options', Array( $this, 'filter_options' ) );
204
  add_filter( $this->prefix . 'output_option', Array( $this, 'display_custom_options' ), 10, 2 );
205
+ add_action( $this->prefix . 'daily_update_cron', Array( $this, 'daily_update' ) );
206
+ }
207
+
208
+ function cron_update() {
209
+ if ( !wp_next_scheduled( $this->prefix . 'daily_update_cron' ) )
210
+ wp_schedule_event( time(), 'daily', $this->prefix . 'daily_update_cron' );
211
+ }
212
+
213
+ function daily_update() {
214
+ $last_run = get_option( $this->prefix . 'cron_last_run' );
215
+ if ( empty( $last_run ) || ( time() - $last_run > 23.5 * 60 * 60 ) ) // sanity check
216
+ $this->do_sitemaps( __( "Daily scheduled sitemap check has finished.", 'all_in_one_seo_pack' ) );
217
+ $last_run = time();
218
+ update_option( $this->prefix . 'cron_last_run', $last_run );
219
  }
220
 
221
  /** Initialize options, after constructor **/
234
 
235
  if ( $this->option_isset( 'robots' ) )
236
  add_action( 'do_robots', Array( $this, 'do_robots' ), 100 );
237
+
238
+ if ( isset( $this->options[$this->prefix . 'daily_cron'] ) && $this->options[$this->prefix . 'daily_cron'] ) {
239
+ add_action( 'wp', Array( $this, 'cron_update' ) );
240
+ } else {
241
+ if ( $time = wp_next_scheduled( $this->prefix . 'daily_update_cron' ) )
242
+ wp_unschedule_event( $time, $this->prefix . 'daily_update_cron' );
243
+ }
244
  }
245
 
246
  /** Custom settings - displays boxes for add pages to sitemap option. **/
267
  return $buf;
268
  }
269
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
270
  /** Add post type details for settings once post types have been registered. **/
271
  function add_post_types() {
272
  $post_type_titles = $this->get_post_type_titles( Array( 'public' => true ) );
790
  }
791
 
792
  /** Build static sitemaps on submit if rewrite rules are not in use, do logging. **/
793
+ function do_sitemaps( $message = '' ) {
794
  if ( !empty( $this->options["{$this->prefix}indexes"] ) && !empty( $this->options["{$this->prefix}paginate"] ) ) {
795
  $this->paginate = true;
796
  if ( ( $this->options["{$this->prefix}max_posts"] ) && ( $this->options["{$this->prefix}max_posts"] > 0 ) && ( $this->options["{$this->prefix}max_posts"] < 50000 ) )
815
  delete_transient( "{$this->prefix}rules_flushed" );
816
  }
817
  $this->do_notify();
818
+ if ( !empty( $message ) && is_string( $message ) ) {
819
+ $this->debug_message( $message );
820
+ } else {
821
+ $this->debug_message( __( 'Updated sitemap settings.', 'all_in_one_seo_pack' ) );
822
+ }
823
  }
824
 
825
  function add_xml_mime_type( $mime ) {
all_in_one_seo_pack-ro_RO.mo ADDED
Binary file
all_in_one_seo_pack-ru_RU.mo CHANGED
Binary file
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&currency_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.6.2
7
  Author: Michael Torbert
8
  Author URI: http://michaeltorbert.com
9
  */
@@ -30,7 +30,7 @@ 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.6.2
34
  */
35
 
36
  if ( ! defined( 'ABSPATH' ) ) return;
@@ -41,7 +41,7 @@ if ( ! defined( 'AIOSEOP_PLUGIN_NAME' ) )
41
  define( 'AIOSEOP_PLUGIN_NAME', $aioseop_plugin_name );
42
 
43
  if ( ! defined( 'AIOSEOP_VERSION' ) )
44
- define( 'AIOSEOP_VERSION', '2.2.6.2' );
45
 
46
  if ( ! defined( 'AIOSEOP_PLUGIN_DIR' ) ) {
47
  define( 'AIOSEOP_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
@@ -126,7 +126,7 @@ if ( !empty( $aioseop_mem_limit ) ) {
126
  }
127
 
128
  $aiosp_activation = false;
129
- $aioseop_module_list = Array( 'sitemap', 'opengraph', 'robots', 'file_editor', 'importer_exporter', 'performance' ); // list all available modules here
130
 
131
  if ( class_exists( 'All_in_One_SEO_Pack' ) ) {
132
  add_action( 'admin_notices', create_function( '', 'echo "<div class=\'error\'>The All In One SEO Pack class is already defined";'
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&currency_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
7
  Author: Michael Torbert
8
  Author URI: http://michaeltorbert.com
9
  */
30
 
31
  /**
32
  * @package All-in-One-SEO-Pack
33
+ * @version 2.2.7
34
  */
35
 
36
  if ( ! defined( 'ABSPATH' ) ) return;
41
  define( 'AIOSEOP_PLUGIN_NAME', $aioseop_plugin_name );
42
 
43
  if ( ! defined( 'AIOSEOP_VERSION' ) )
44
+ define( 'AIOSEOP_VERSION', '2.2.7' );
45
 
46
  if ( ! defined( 'AIOSEOP_PLUGIN_DIR' ) ) {
47
  define( 'AIOSEOP_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
126
  }
127
 
128
  $aiosp_activation = false;
129
+ $aioseop_module_list = Array( 'sitemap', 'opengraph', 'robots', 'file_editor', 'importer_exporter', 'bad_robots', 'performance' ); // list all available modules here
130
 
131
  if ( class_exists( 'All_in_One_SEO_Pack' ) ) {
132
  add_action( 'admin_notices', create_function( '', 'echo "<div class=\'error\'>The All In One SEO Pack class is already defined";'
images/inmotion.gif ADDED
Binary file
images/wincher1.png ADDED
Binary file
images/wincher2.jpg ADDED
Binary file
images/wincher3.png ADDED
Binary file
images/wincher4.png ADDED
Binary file
images/wincherbanner.png DELETED
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&currency_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.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.
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&currency_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.2.2
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.