All in One SEO Pack - Version 2.3.9.1

Version Description

Download this release

Release Info

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

Code changes from version 2.3.9.2 to 2.3.9.1

Files changed (44) hide show
  1. admin/aioseop_module_class.php +6 -12
  2. admin/display/credits-content.php +0 -107
  3. admin/display/welcome-content.php +0 -39
  4. admin/display/welcome.php +0 -98
  5. aioseop_class.php +284 -16
  6. all_in_one_seo_pack.php +471 -494
  7. css/modules/aioseop_module.css +16 -30
  8. css/welcome.css +0 -129
  9. i18n/all-in-one-seo-pack-ar.mo +0 -0
  10. i18n/all-in-one-seo-pack-ary.mo +0 -0
  11. i18n/all-in-one-seo-pack-bg_BG.mo +0 -0
  12. i18n/all-in-one-seo-pack-ca.mo +0 -0
  13. i18n/all-in-one-seo-pack-de_DE.mo +0 -0
  14. i18n/all-in-one-seo-pack-en_AU.mo +0 -0
  15. i18n/all-in-one-seo-pack-en_CA.mo +0 -0
  16. i18n/all-in-one-seo-pack-en_GB.mo +0 -0
  17. i18n/all-in-one-seo-pack-en_NZ.mo +0 -0
  18. i18n/all-in-one-seo-pack-fa_IR.mo +0 -0
  19. i18n/all-in-one-seo-pack-fi.mo +0 -0
  20. i18n/all-in-one-seo-pack-hi_IN.mo +0 -0
  21. i18n/all-in-one-seo-pack-hr.mo +0 -0
  22. i18n/all-in-one-seo-pack-hu_HU.mo +0 -0
  23. i18n/all-in-one-seo-pack-it_IT.mo +0 -0
  24. i18n/all-in-one-seo-pack-ko_KR.mo +0 -0
  25. i18n/all-in-one-seo-pack-nb_NO.mo +0 -0
  26. i18n/all-in-one-seo-pack-nl_NL.mo +0 -0
  27. i18n/all-in-one-seo-pack-nn_NO.mo +0 -0
  28. i18n/all-in-one-seo-pack-pl_PL.mo +0 -0
  29. i18n/all-in-one-seo-pack-pt_PT.mo +0 -0
  30. i18n/all-in-one-seo-pack-ro_RO.mo +0 -0
  31. i18n/all-in-one-seo-pack-ru_RU.mo +0 -0
  32. i18n/all-in-one-seo-pack-sl_SL.mo +0 -0
  33. i18n/all-in-one-seo-pack-sq.mo +0 -0
  34. i18n/all-in-one-seo-pack-tr_TR.mo +0 -0
  35. i18n/all-in-one-seo-pack-vi.mo +0 -0
  36. i18n/all-in-one-seo-pack-zh_CN.mo +0 -0
  37. inc/aioseop_functions.php +52 -1
  38. inc/aioseop_updates_class.php +0 -16
  39. inc/extlib/JSON.php +804 -0
  40. js/welcome.js +0 -32
  41. modules/aioseop_feature_manager.php +1 -1
  42. modules/aioseop_performance.php +6 -0
  43. public/google-analytics.php +0 -266
  44. readme.txt +2 -3
admin/aioseop_module_class.php CHANGED
@@ -533,6 +533,7 @@ if ( ! class_exists( 'All_in_One_SEO_Pack_Module' ) ) {
533
  'Python-urllib',
534
  'QueryN Metasearch',
535
  'RepoMonkey',
 
536
  'SemrushBot',
537
  'SISTRIX',
538
  'sitecheck.Internetseer.com',
@@ -1306,8 +1307,7 @@ if ( ! class_exists( 'All_in_One_SEO_Pack_Module' ) ) {
1306
  return false;
1307
  }
1308
 
1309
- $size = apply_filters( 'post_thumbnail_size', 'large' ); // Check if someone is using built-in WP filter.
1310
- $size = apply_filters( 'aioseop_thumbnail_size', $size );
1311
  $image = wp_get_attachment_image_src( $post_thumbnail_id, $size );
1312
 
1313
  return $image[0];
@@ -1331,9 +1331,7 @@ if ( ! class_exists( 'All_in_One_SEO_Pack_Module' ) ) {
1331
  ) );
1332
 
1333
  if ( empty( $attachments ) && 'attachment' == get_post_type( $post->ID ) ) {
1334
- $size = 'large';
1335
- $size = apply_filters( 'aioseop_attachment_size', $size );
1336
- $image = wp_get_attachment_image_src( $post->ID, $size );
1337
  }
1338
 
1339
  /* If no attachments or image is found, return false. */
@@ -1347,9 +1345,7 @@ if ( ! class_exists( 'All_in_One_SEO_Pack_Module' ) ) {
1347
  /* Loop through each attachment. Once the $order_of_image (default is '1') is reached, break the loop. */
1348
  foreach ( $attachments as $id => $attachment ) {
1349
  if ( ++ $i == 1 ) {
1350
- $size = 'large';
1351
- $size = apply_filters( 'aioseop_attachment_size', $size );
1352
- $image = wp_get_attachment_image_src( $id, $size );
1353
  $alt = trim( strip_tags( get_post_field( 'post_excerpt', $id ) ) );
1354
  break;
1355
  }
@@ -1446,10 +1442,8 @@ if ( ! class_exists( 'All_in_One_SEO_Pack_Module' ) ) {
1446
  if ( empty( $screen ) ) {
1447
  $bail = true;
1448
  }
1449
- if( $bail != true ){
1450
- if ( ( $screen->base != 'post' ) && ( $screen->base != 'term' ) && ( $screen->base != 'edit-tags' ) && ( $screen->base != 'toplevel_page_shopp-products' ) ) {
1451
- $bail = true;
1452
- }
1453
  }
1454
  $prefix = $this->get_prefix();
1455
  $bail = apply_filters( $prefix . 'bail_on_enqueue', $bail, $screen );
533
  'Python-urllib',
534
  'QueryN Metasearch',
535
  'RepoMonkey',
536
+ 'RMA',
537
  'SemrushBot',
538
  'SISTRIX',
539
  'sitecheck.Internetseer.com',
1307
  return false;
1308
  }
1309
 
1310
+ $size = apply_filters( 'post_thumbnail_size', 'large' );
 
1311
  $image = wp_get_attachment_image_src( $post_thumbnail_id, $size );
1312
 
1313
  return $image[0];
1331
  ) );
1332
 
1333
  if ( empty( $attachments ) && 'attachment' == get_post_type( $post->ID ) ) {
1334
+ $image = wp_get_attachment_image_src( $post->ID, 'large' );
 
 
1335
  }
1336
 
1337
  /* If no attachments or image is found, return false. */
1345
  /* Loop through each attachment. Once the $order_of_image (default is '1') is reached, break the loop. */
1346
  foreach ( $attachments as $id => $attachment ) {
1347
  if ( ++ $i == 1 ) {
1348
+ $image = wp_get_attachment_image_src( $id, 'large' );
 
 
1349
  $alt = trim( strip_tags( get_post_field( 'post_excerpt', $id ) ) );
1350
  break;
1351
  }
1442
  if ( empty( $screen ) ) {
1443
  $bail = true;
1444
  }
1445
+ if ( ( $screen->base != 'post' ) && ( $screen->base != 'term' ) && ( $screen->base != 'edit-tags' ) && ( $screen->base != 'toplevel_page_shopp-products' ) ) {
1446
+ $bail = true;
 
 
1447
  }
1448
  $prefix = $this->get_prefix();
1449
  $bail = apply_filters( $prefix . 'bail_on_enqueue', $bail, $screen );
admin/display/credits-content.php DELETED
@@ -1,107 +0,0 @@
1
- <div class="wrap credits-wrap">
2
-
3
- <p class="about-description"><?php _e( 'All in One SEO Pack is created by a worldwide network of friendly folks like these.', 'all-in-one-seo-pack' ); ?></p>
4
-
5
- <h3 class="wp-people-group"><?php _e( 'Project Leaders', 'all-in-one-seo-pack' ); ?></h3>
6
- <ul class="wp-people-group " id="wp-people-group-project-leaders">
7
- <li class="wp-person" id="wp-person-michaeltorbert">
8
- <a class="web" href="https://profiles.wordpress.org/hallsofmontezuma" target="_blank"><img alt="" class="gravatar" src="https://s.gravatar.com/avatar/f41419cf5cfdbb071a8d591ac9976bf3?s=60">
9
- Michael Torbert</a>
10
- <span class="title"><?php _e( 'Project Lead', 'all-in-one-seo-pack' ); ?></span>
11
- </li>
12
- <li class="wp-person" id="wp-person-stevemortiboy">
13
- <a class="web" target="_blank" href="https://profiles.wordpress.org/wpsmort"><img alt="" class="gravatar" src="https://www.gravatar.com/avatar/40e33d813c16a63500675d851b0cbf3a?s=60">
14
- Steve Mortiboy</a>
15
- <span class="title"><?php _e( 'Project Manager', 'all-in-one-seo-pack' ); ?></span>
16
- </li>
17
- </ul>
18
-
19
- <h3 class="wp-people-group"><?php printf( esc_html__( 'Core Team', 'all-in-one-seo-pack' ) ); ?></h3>
20
- <ul class="wp-people-group " id="wp-people-group-contributors">
21
- <li class="wp-person" id="wp-person-arnaudbroes">
22
- <a class="web" target="_blank" href="https://profiles.wordpress.org/arnaudbroes"><img alt="" class="gravatar" src="https://www.gravatar.com/avatar/0ce0d554c2b0bd61d326e15c8dcde756?s=60">
23
- Arnaud Broes</a>
24
- <span class="title"><?php _e( 'Development Team', 'buddypress' ); ?></span>
25
- </li>
26
- <li class="wp-person" id="wp-person-yuqianliu">
27
- <a class="web" target="_blank" href="https://profiles.wordpress.org/yuqianl"><img alt="" class="gravatar" src="https://www.gravatar.com/avatar/8f971bea2b6c483fd1099e558013a7d0?s=60">
28
- Yuqian Liu</a>
29
- <span class="title"><?php _e( 'Development Team', 'buddypress' ); ?></span>
30
- </li>
31
- <li class="wp-person" id="wp-person-aaronbrodney">
32
- <a class="web" target="_blank" href="https://github.com/theycalledmetaz"><img alt="" class="gravatar" src="https://avatars3.githubusercontent.com/u/8225725?v=3&s=60">
33
- Aaron Brodney</a>
34
- <span class="title"><?php _e( 'Development Team', 'buddypress' ); ?></span>
35
- </li>
36
- </ul>
37
-
38
- <h3 class="wp-people-group">&#x1f31f;<?php _e( 'Recent Rockstar Contributors', 'all-in-one-seo-pack' ); ?>&#x1f31f;</h3>
39
- <ul class="wp-people-group " id="wp-people-group-rockstars">
40
- <li><?php printf( __('Want to see your name and picture here as a community developer? Open a new issue on Github to report a bug or request a feature or find an issue and submit code!')); ?>
41
- <a href="https://github.com/semperfiwebdesign/all-in-one-seo-pack" target="_blank">Click here to go to Github</a>
42
- </li>
43
- <li class="wp-person" id="wp-person-dougalcampbell">
44
- <a class="web" target="_blank" href="https://profiles.wordpress.org/dougal/"><img alt="" class="gravatar" src="https://www.gravatar.com/avatar/81717a172b6918071fbea1a52483294b?s=60">
45
- Dougal Campbell</a>
46
- </li>
47
- <li class="wp-person" id="wp-person-alejandromostajo">
48
- <a class="web" target="_blank" href="https://github.com/amostajo"><img alt="" class="gravatar" src="https://avatars1.githubusercontent.com/u/1645908?s=60">
49
- Alejandro Mostajo</a>
50
- </li>
51
- <li class="wp-person" id="joelrd">
52
- <a class="web" target="_blank" href="https://github.com/joelrd"><img alt="" class="gravatar" src="https://avatars0.githubusercontent.com/u/16063717?s=60">
53
- Joelrd</a>
54
- </li>
55
- <li class="wp-person" id="carlalexander">
56
- <a class="web" target="_blank" href="https://profiles.wordpress.org/carlalexander/"><img alt="" class="gravatar" src="https://secure.gravatar.com/avatar/5a4758faa5ba6c1322bdfb0f6ebcf56c?s=60">
57
- Carl Alexander</a>
58
- </li>
59
- </ul>
60
-
61
- <h3 class="wp-people-group dashicons-before dashicons-translation"><?php printf( esc_html__( 'Translators Contributors and Translation Editors', 'all-in-one-seo-pack' ), '1.2' ); ?></h3>
62
- <p class="wp-credits-list">
63
- <a href="https://profiles.wordpress.org/pierrelannoy/" target="_blank">Pierre Lannoy</a>,
64
- <a href="https://profiles.wordpress.org/sonjanyc/" target="_blank">Sonja Leix</a>,
65
- <a href="https://profiles.wordpress.org/dev-ide/" target="_blank">Adil El hallaoui</a>,
66
- <a href="https://profiles.wordpress.org/simonie/" target="_blank">simonie</a>,
67
- <a href="https://profiles.wordpress.org/lenasterg/" target="_blank">lenasterg</a>,
68
- <a href="https://profiles.wordpress.org/arnaudbroes/" target="_blank">Arnaud Broes</a>,
69
- <a href="https://profiles.wordpress.org/pixolin/" target="_blank">Bego Mario Garde</a>,
70
- <a href="https://profiles.wordpress.org/wp-yogi/" target="_blank">wp-yogi</a>,
71
- <a href="https://profiles.wordpress.org/wpsmort/" target="_blank">Steve Mortiboy</a>,
72
- <a href="https://profiles.wordpress.org/webaware/" target="_blank">webaware</a>,
73
- <a href="https://profiles.wordpress.org/escribirelmundo/" target="_blank">escribirelmundo</a>,
74
- <a href="https://profiles.wordpress.org/casiepa/" target="_blank">Pascal Casier</a>,
75
- <a href="https://profiles.wordpress.org/nurron/" target="_blank">Nurron Shodiqin</a>,
76
- <a href="https://profiles.wordpress.org/aprmndr/" target="_blank">Alyssa Primandaru</a>,
77
- <a href="https://profiles.wordpress.org/facestoro/" target="_blank">facestoro</a>,
78
- <a href="https://profiles.wordpress.org/yuqianl/" target="_blank">Dawa Torbert</a>,
79
- <a href="https://profiles.wordpress.org/hallsofmontezuma/" target="_blank">Michael Torbert</a>,
80
- <a href="https://profiles.wordpress.org/istvanzseller/" target="_blank">Istvan Zseller</a>,
81
- <a href="https://profiles.wordpress.org/paaljoachim" target="_blank">Paal Joachim Romdahl</a>,
82
- <a href="https://profiles.wordpress.org/almaz/" target="_blank">Almaz Mannanov</a>,
83
- <a href="https://profiles.wordpress.org/vide13 /" target="_blank">vide13</a>,
84
- <a href="https://profiles.wordpress.org/yuraz/" target="_blank">Jurica Zuanovic</a>,
85
- <a href="https://profiles.wordpress.org/arhipaiva/" target="_blank">arhipaiva</a>,
86
- <a href="https://profiles.wordpress.org/maximanikin/" target="_blank">Maxim Anikin</a>,
87
- <a href="https://profiles.wordpress.org/petya/" target="_blank">Petya Raykovska</a>,
88
- <a href="https://profiles.wordpress.org/hathanh0809/" target="_blank">hathanh0809</a>,
89
- <a href="https://profiles.wordpress.org/cedric3131/" target="_blank">Cédric Valmary</a>,
90
- <a href="https://profiles.wordpress.org/smitka/" target="_blank">Vladimir Smitka</a>,
91
- <a href="https://profiles.wordpress.org/brewtal/" target="_blank">Paul P.</a>,
92
- <a href="https://profiles.wordpress.org/wpaleks/" target="_blank">Aleksander Savkovic</a>,
93
- <a href="https://profiles.wordpress.org/diogosanches/" target="_blank">Diogo Sanches</a>,
94
- <a href="https://profiles.wordpress.org/klemenfajs/" target="_blank">Klemen Fajs</a>,
95
- <a href="https://profiles.wordpress.org/adriancastellanos/" target="_blank">Adrian Castellanos</a>,
96
- <a href="https://profiles.wordpress.org/exilhamburger/" target="_blank">exilhamburger</a>,
97
- <a href="https://profiles.wordpress.org/garyj/" target="_blank">Gary Jones</a>,
98
- <a href="https://profiles.wordpress.org/fernandot/" target="_blank">Fernando Tellado</a>,
99
- <a href="https://profiles.wordpress.org/hiwhatsup/" target="_blank">Carlos Zuniga</a>,
100
- <a href="https://profiles.wordpress.org/fxbenard/" target="_blank">François Bernard</a>,
101
- <a href="https://profiles.wordpress.org/jack0falltrades/" target="_blank">jack0falltrades</a>,
102
- <a href="https://profiles.wordpress.org/dancaragea/" target="_blank">Dan Caragea</a>,
103
- <a href="https://profiles.wordpress.org/kyla81975/" target="_blank">kyla81975</a>,
104
- <a href="https://profiles.wordpress.org/arildknudsen1/" target="_blank">Arild Knudsen</a>.
105
- </p>
106
-
107
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
admin/display/welcome-content.php DELETED
@@ -1,39 +0,0 @@
1
- <div id="welcome-panel" class="">
2
- <div class="welcome-panel-content">
3
- <div class="welcome-panel-column-container">
4
- <div class="welcome-panel-column">
5
- <h3><?php echo esc_html( __( 'Support All in One SEO Pack', 'all-in-one-seo-pack' ) ); ?></h3>
6
- <p class="message"><?php echo esc_html( __( "There are may ways you can help support All in One SEO Pack.", 'all-in-one-seo-pack' ) ); ?></p>
7
- <p class="message aioseop-message"><?php echo esc_html( __( "Upgrade to All in One SEO Pack Pro to access priority support and premium features.", 'all-in-one-seo-pack' ) ); ?></p>
8
- <p class="call-to-action"><a href="https://semperplugins.com/all-in-one-seo-pack-pro-version/?loc=aio_welcome" target="_blank" class="button button-primary button-orange"><?php echo __('Upgrade','all-in-one-seo-pack'); ?></a></p>
9
- <p class="message aioseop-message"><?php echo esc_html( __( "Help translate All in One SEO Pack into your language.", 'all-in-one-seo-pack' ) ); ?></p>
10
- <p class="call-to-action"><a href="https://translate.wordpress.org/projects/wp-plugins/all-in-one-seo-pack" class="button button-primary" target="_blank"><?php echo __('Translate','all-in-one-seo-pack'); ?></a></p>
11
- <p class="message aioseop-message"><?php echo esc_html( __( "Become a beta tester and help test new features.", 'all-in-one-seo-pack' ) ); ?></p>
12
- <p class="call-to-action"><a href="https://semperplugins.com/contact/" class="button button-primary" target="_blank"><?php echo __('Register','all-in-one-seo-pack'); ?></a></p>
13
- </div>
14
-
15
- <div class="welcome-panel-column">
16
- <h3><?php echo esc_html( __( 'Get Started', 'all-in-one-seo-pack' ) ); ?></h3>
17
- <ul>
18
- <li><a href="https://semperplugins.com/documentation/quick-start-guide/" target="_blank"><?php echo __( 'Beginners Guide for All in One SEO Pack', 'all-in-one-seo-pack' ); ?></a></li>
19
- <li><a href="https://semperplugins.com/documentation/beginners-guide-to-xml-sitemaps/" target="_blank"><?php echo __( 'Beginners Guide for XML Sitemap module', 'all-in-one-seo-pack' ); ?></a></li>
20
- <li><a href="https://semperplugins.com/documentation/beginners-guide-to-social-meta/" target="_blank"><?php echo __( 'Beginners Guide for Social Meta module', 'all-in-one-seo-pack' ); ?></a></li>
21
- <li><a href="https://semperplugins.com/documentation/top-tips-for-good-on-page-seo/" target="_blank"><?php echo __( 'Tips for good on-page SEO', 'all-in-one-seo-pack' ); ?></a></li>
22
- <li><a href="https://semperplugins.com/documentation/quality-guidelines-for-seo-titles-and-descriptions/" target="_blank"><?php echo __( 'Quality guidelines for SEO titles and descriptions', 'all-in-one-seo-pack' ); ?></a></li>
23
- <li><a href="https://semperplugins.com/documentation/quality-guidelines-for-seo-titles-and-descriptions/" target="_blank"><?php echo __( 'Submit an XML Sitemap to Google', 'all-in-one-seo-pack' ); ?></a></li>
24
- <li><a href="https://semperplugins.com/documentation/setting-up-google-analytics/" target="_blank"><?php echo __( 'Set up Google Analytics', 'all-in-one-seo-pack' ); ?></a></li>
25
- </ul>
26
- </div>
27
-
28
- <div class="welcome-panel-column">
29
- <h3><?php echo esc_html( __( 'Did You Know?', 'all-in-one-seo-pack' ) ); ?></h3>
30
- <ul>
31
- <li><a href="https://semperplugins.com/documentation/" target="_blank"><?php echo __( 'We have complete documentation on every setting and feature', 'all-in-one-seo-pack' ); ?></a></li>
32
- <li><a href="https://semperplugins.com/videos/" target="_blank"><?php echo __( 'You can get access to video tutorials about SEO with the Pro version', 'all-in-one-seo-pack' ); ?></a></li>
33
- <li><a href="https://semperplugins.com/all-in-one-seo-pack-pro-version/?loc=aio_welcome" target="_blank"><?php echo __( 'You can control SEO on categories, tags and custom taxonomies with the Pro version', 'all-in-one-seo-pack' ); ?></a></li>
34
- </ul>
35
- </div>
36
- </div>
37
- </div>
38
- <p><a href="/wp-admin/admin.php?page=all-in-one-seo-pack%2Faioseop_class.php">Continue to the General Settings</a> &raquo;</p>
39
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
admin/display/welcome.php DELETED
@@ -1,98 +0,0 @@
1
- <?php
2
-
3
- if ( ! class_exists( 'aioseop_welcome' ) ) {
4
-
5
- class aioseop_welcome {
6
- function __construct() {
7
-
8
- if ( AIOSEOPPRO ) {
9
- return;
10
- }
11
-
12
- add_action( 'admin_menu', array( $this, 'add_menus' ) );
13
- add_action( 'admin_head', array( $this, 'remove_pages' ) );
14
- add_action( 'admin_enqueue_scripts', array( $this, 'welcome_screen_assets' ) );
15
-
16
- }
17
-
18
- function welcome_screen_assets( $hook ) {
19
-
20
- if ( 'dashboard_page_aioseop-about' == $hook ) {
21
-
22
- wp_enqueue_style( 'aioseop_welcome_css', AIOSEOP_PLUGIN_URL . '/css/welcome.css' );
23
- wp_enqueue_script( 'aioseop_welcome_js', AIOSEOP_PLUGIN_URL . '/js/welcome.js', array( 'jquery' ), AIOSEOP_VERSION, true );
24
- }
25
- }
26
-
27
- function remove_pages() {
28
- remove_submenu_page( 'index.php', 'aioseop-about' );
29
- remove_submenu_page( 'index.php', 'aioseop-credits' );
30
- }
31
-
32
- function add_menus() {
33
- add_dashboard_page(
34
- __( 'Welcome to All in One SEO Pack', 'all-in-one-seo-pack' ),
35
- __( 'Welcome to All in One SEO Pack', 'all-in-one-seo-pack' ),
36
- 'manage_options',
37
- 'aioseop-about',
38
- array( $this, 'about_screen' )
39
- );
40
-
41
- }
42
-
43
- function init() {
44
-
45
- if ( AIOSEOPPRO ) {
46
- return;
47
- }
48
-
49
- if ( ! is_admin() ) {
50
- return;
51
- }
52
-
53
- if ( ! current_user_can( 'manage_options' ) ) {
54
- return;
55
- }
56
-
57
- wp_safe_redirect( add_query_arg( array( 'page' => 'aioseop-about' ), admin_url( 'index.php' ) ) );
58
- exit;
59
- }
60
-
61
- function about_screen() {
62
-
63
- $version = AIOSEOP_VERSION;
64
-
65
- ?>
66
-
67
- <div class="wrap about-wrap">
68
- <h1><?php printf( esc_html__( 'Welcome to All in One SEO Pack %s', 'all-in-one-seo-pack' ), $version ); ?></h1>
69
- <div
70
- class="about-text"><?php printf( esc_html__( 'All in One SEO Pack %s contains new features, bug fixes, increased security, and tons of under the hood performance improvements.', 'all-in-one-seo-pack' ), $version ); ?></div>
71
-
72
- <h2 class="nav-tab-wrapper">
73
- <a class="nav-tab nav-tab-active" id="aioseop-about"
74
- href="<?php echo esc_url( admin_url( add_query_arg( array( 'page' => 'aioseop-about' ), 'index.php' ) ) ); ?>">
75
- <?php esc_html_e( 'What&#8217;s New', 'all-in-one-seo-pack' ); ?>
76
- </a>
77
- <a class="nav-tab" id="aioseop-credits"
78
- href="<?php echo esc_url( admin_url( add_query_arg( array( 'page' => 'aioseop-credits' ), 'index.php' ) ) ); ?>">
79
- <?php esc_html_e( 'Credits', 'all-in-one-seo-pack' ); ?>
80
- </a>
81
- </h2>
82
-
83
-
84
- <div id='sections'>
85
- <section><?php include_once( AIOSEOP_PLUGIN_DIR . 'admin/display/welcome-content.php' ); ?></section>
86
- <section><?php include_once( AIOSEOP_PLUGIN_DIR . 'admin/display/credits-content.php' ); ?></section>
87
- </div>
88
-
89
- </div>
90
-
91
-
92
- <?php
93
-
94
- }
95
-
96
- }
97
-
98
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
aioseop_class.php CHANGED
@@ -194,6 +194,7 @@ class All_in_One_SEO_Pack extends All_in_One_SEO_Pack_Module {
194
  'google_set_site_name' => __( 'Add markup to tell Google the preferred name for your website.', 'all-in-one-seo-pack' ),
195
  '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' ),
196
  'google_analytics_id' => __( 'Enter your Google Analytics ID here to track visitor behavior on your site using Google Analytics.', 'all-in-one-seo-pack' ),
 
197
  'ga_advanced_options' => __( 'Check to use advanced Google Analytics options.', 'all-in-one-seo-pack' ),
198
  'ga_domain' => __( 'Enter your domain name without the http:// to set your cookie domain.', 'all-in-one-seo-pack' ),
199
  'ga_multi_domain' => __( 'Use this option to enable tracking of multiple or additional domains.', 'all-in-one-seo-pack' ),
@@ -287,6 +288,7 @@ class All_in_One_SEO_Pack extends All_in_One_SEO_Pack_Module {
287
  'google_enable_publisher' => '#display-publisher-meta-on-front-page',
288
  'google_specify_publisher' => '#specify-publisher-url',
289
  'google_analytics_id' => 'http://semperplugins.com/documentation/setting-up-google-analytics/',
 
290
  'ga_domain' => '#tracking-domain',
291
  'ga_multi_domain' => '#track-multiple-domains-additional-domains',
292
  'ga_addl_domains' => '#track-multiple-domains-additional-domains',
@@ -679,6 +681,17 @@ class All_in_One_SEO_Pack extends All_in_One_SEO_Pack_Module {
679
  'type' => 'text',
680
  'placeholder' => 'UA-########-#',
681
  ),
 
 
 
 
 
 
 
 
 
 
 
682
  'ga_advanced_options' => array(
683
  'name' => __( 'Advanced Analytics Options:', 'all-in-one-seo-pack' ),
684
  'default' => 'on',
@@ -801,6 +814,7 @@ class All_in_One_SEO_Pack extends All_in_One_SEO_Pack_Module {
801
  'op' => '!=',
802
  'rhs' => '',
803
  ),
 
804
  'aiosp_ga_advanced_options' => 'on',
805
  ),
806
  ),
@@ -1130,6 +1144,7 @@ class All_in_One_SEO_Pack extends All_in_One_SEO_Pack_Module {
1130
  'google_specify_publisher',
1131
  // "google_connect",
1132
  'google_analytics_id',
 
1133
  'ga_advanced_options',
1134
  'ga_domain',
1135
  'ga_multi_domain',
@@ -2364,9 +2379,8 @@ class All_in_One_SEO_Pack extends All_in_One_SEO_Pack_Module {
2364
  $name = single_term_title( '', false );
2365
  }
2366
  // Apparently we're already ucwordsing this elsewhere, and doing it a second time messes it up... why aren't we just doing this at the end?
2367
- if ( ( $tax == 'category' ) && ( !empty( $aioseop_options['aiosp_cap_cats'] ) ) ){
2368
- $name = $this->ucwords( $name );
2369
- }
2370
 
2371
  return $this->internationalize( $name );
2372
  }
@@ -3790,7 +3804,7 @@ class All_in_One_SEO_Pack extends All_in_One_SEO_Pack_Module {
3790
  $description = apply_filters( 'aioseop_description_full', $this->apply_description_format( $description, $post ) );
3791
  $desc_attr = '';
3792
  if ( ! empty( $aioseop_options['aiosp_schema_markup'] ) ) {
3793
- $desc_attr = '';
3794
  }
3795
  $desc_attr = apply_filters( 'aioseop_description_attributes', $desc_attr );
3796
  $meta_string .= sprintf( "<meta name=\"description\" %s content=\"%s\" />\n", $desc_attr, $description );
@@ -4331,7 +4345,247 @@ EOF;
4331
  }
4332
 
4333
  function aiosp_google_analytics() {
4334
- new aioseop_google_analytics;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4335
  }
4336
 
4337
  /**
@@ -4507,20 +4761,16 @@ EOF;
4507
 
4508
  $aioseop_admin_menu = 1;
4509
  if ( ! is_admin() && ! empty( $post ) ) {
4510
-
4511
  $blog_page = aiosp_common::get_blog_page( $post );
4512
  if ( ! empty( $blog_page ) ) {
4513
  $post = $blog_page;
4514
  }
4515
- if( ! is_home() || ( ! is_front_page() && ! is_home() ) ) {
4516
- // Don't show if we're on the home page and the home page is the latest posts.
4517
- $wp_admin_bar->add_menu( array(
4518
- 'id' => 'aiosp_edit_' . $post->ID,
4519
- 'parent' => AIOSEOP_PLUGIN_DIRNAME,
4520
- 'title' => __( 'Edit SEO', 'all-in-one-seo-pack' ),
4521
- 'href' => get_edit_post_link( $post->ID ) . '#aiosp',
4522
- ) );
4523
- }
4524
  }
4525
  }
4526
  }
@@ -4861,12 +5111,30 @@ EOF;
4861
  </script>
4862
  <?php if ( ! AIOSEOPPRO ) { ?>
4863
  <div class="aioseop_advert aioseop_nopad_all">
4864
- <?php $adid = mt_rand( 21, 22 ); ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4865
  <a href="https://www.wincher.com/?referer=all-in-one-seo-pack&adreferer=banner<?php echo $adid; ?>"
4866
  target="_blank">
4867
  <div class=wincherad id=wincher<?php echo $adid; ?>>
4868
  </div>
4869
  </a>
 
4870
  </div>
4871
  <div class="aioseop_advert headwaythemes">
4872
  <div>
194
  'google_set_site_name' => __( 'Add markup to tell Google the preferred name for your website.', 'all-in-one-seo-pack' ),
195
  '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' ),
196
  'google_analytics_id' => __( 'Enter your Google Analytics ID here to track visitor behavior on your site using Google Analytics.', 'all-in-one-seo-pack' ),
197
+ 'ga_use_universal_analytics' => __( 'Use the new Universal Analytics tracking code for Google Analytics.', 'all-in-one-seo-pack' ),
198
  'ga_advanced_options' => __( 'Check to use advanced Google Analytics options.', 'all-in-one-seo-pack' ),
199
  'ga_domain' => __( 'Enter your domain name without the http:// to set your cookie domain.', 'all-in-one-seo-pack' ),
200
  'ga_multi_domain' => __( 'Use this option to enable tracking of multiple or additional domains.', 'all-in-one-seo-pack' ),
288
  'google_enable_publisher' => '#display-publisher-meta-on-front-page',
289
  'google_specify_publisher' => '#specify-publisher-url',
290
  'google_analytics_id' => 'http://semperplugins.com/documentation/setting-up-google-analytics/',
291
+ 'ga_use_universal_analytics' => '#use-universal-analytics',
292
  'ga_domain' => '#tracking-domain',
293
  'ga_multi_domain' => '#track-multiple-domains-additional-domains',
294
  'ga_addl_domains' => '#track-multiple-domains-additional-domains',
681
  'type' => 'text',
682
  'placeholder' => 'UA-########-#',
683
  ),
684
+ 'ga_use_universal_analytics' => array(
685
+ 'name' => __( 'Use Universal Analytics:', 'all-in-one-seo-pack' ),
686
+ 'default' => 0,
687
+ 'condshow' => array(
688
+ 'aiosp_google_analytics_id' => array(
689
+ 'lhs' => 'aiosp_google_analytics_id',
690
+ 'op' => '!=',
691
+ 'rhs' => '',
692
+ ),
693
+ ),
694
+ ),
695
  'ga_advanced_options' => array(
696
  'name' => __( 'Advanced Analytics Options:', 'all-in-one-seo-pack' ),
697
  'default' => 'on',
814
  'op' => '!=',
815
  'rhs' => '',
816
  ),
817
+ 'aiosp_ga_use_universal_analytics' => 'on',
818
  'aiosp_ga_advanced_options' => 'on',
819
  ),
820
  ),
1144
  'google_specify_publisher',
1145
  // "google_connect",
1146
  'google_analytics_id',
1147
+ 'ga_use_universal_analytics',
1148
  'ga_advanced_options',
1149
  'ga_domain',
1150
  'ga_multi_domain',
2379
  $name = single_term_title( '', false );
2380
  }
2381
  // Apparently we're already ucwordsing this elsewhere, and doing it a second time messes it up... why aren't we just doing this at the end?
2382
+ // if ( ( $tax == 'category' ) && ( !empty( $aioseop_options['aiosp_cap_cats'] ) ) )
2383
+ // $name = $this->ucwords( $name );
 
2384
 
2385
  return $this->internationalize( $name );
2386
  }
3804
  $description = apply_filters( 'aioseop_description_full', $this->apply_description_format( $description, $post ) );
3805
  $desc_attr = '';
3806
  if ( ! empty( $aioseop_options['aiosp_schema_markup'] ) ) {
3807
+ $desc_attr = 'itemprop="description"';
3808
  }
3809
  $desc_attr = apply_filters( 'aioseop_description_attributes', $desc_attr );
3810
  $meta_string .= sprintf( "<meta name=\"description\" %s content=\"%s\" />\n", $desc_attr, $description );
4345
  }
4346
 
4347
  function aiosp_google_analytics() {
4348
+ global $aioseop_options;
4349
+ $analytics = '';
4350
+ if ( ! empty( $aioseop_options['aiosp_ga_advanced_options'] ) && ! empty( $aioseop_options['aiosp_ga_exclude_users'] ) ) {
4351
+ if ( is_user_logged_in() ) {
4352
+ global $current_user;
4353
+ if ( empty( $current_user ) ) {
4354
+ wp_get_current_user();
4355
+ }
4356
+ if ( ! empty( $current_user ) ) {
4357
+ $intersect = array_intersect( $aioseop_options['aiosp_ga_exclude_users'], $current_user->roles );
4358
+ if ( ! empty( $intersect ) ) {
4359
+ return;
4360
+ }
4361
+ }
4362
+ }
4363
+ }
4364
+ if ( ! empty( $aioseop_options['aiosp_google_analytics_id'] ) ) {
4365
+ ob_start();
4366
+ $analytics = $this->universal_analytics();
4367
+ echo $analytics;
4368
+ if ( empty( $analytics ) ) {
4369
+ ?>
4370
+ <script type="text/javascript">
4371
+ var _gaq = _gaq || [];
4372
+ <?php if ( ! empty( $aioseop_options['aiosp_ga_advanced_options'] ) && ! empty( $aioseop_options['aiosp_ga_link_attribution'] ) ) {
4373
+ ?> var pluginUrl =
4374
+ '//www.google-analytics.com/plugins/ga/inpage_linkid.js';
4375
+ _gaq.push(['_require', 'inpage_linkid', pluginUrl]);
4376
+ <?php
4377
+ }
4378
+ ?> _gaq.push(['_setAccount', '<?php
4379
+ echo $aioseop_options['aiosp_google_analytics_id'];
4380
+ ?>']);
4381
+ <?php if ( ! empty( $aioseop_options['aiosp_ga_advanced_options'] ) && ! empty( $aioseop_options['aiosp_ga_anonymize_ip'] ) ) {
4382
+ ?> _gaq.push(['_gat._anonymizeIp']);
4383
+ <?php
4384
+ }
4385
+ ?>
4386
+ <?php if ( ! empty( $aioseop_options['aiosp_ga_advanced_options'] ) && ! empty( $aioseop_options['aiosp_ga_multi_domain'] ) ) {
4387
+ ?> _gaq.push(['_setAllowLinker', true]);
4388
+ <?php
4389
+ }
4390
+ ?>
4391
+ <?php if ( ! empty( $aioseop_options['aiosp_ga_advanced_options'] ) && ! empty( $aioseop_options['aiosp_ga_domain'] ) ) {
4392
+ $domain = $this->get_analytics_domain();
4393
+ ?> _gaq.push(['_setDomainName', '<?php echo $domain; ?>']);
4394
+ <?php
4395
+ }
4396
+ ?> _gaq.push(['_trackPageview']);
4397
+ (function () {
4398
+ var ga = document.createElement('script');
4399
+ ga.type = 'text/javascript';
4400
+ ga.async = true;
4401
+ <?php
4402
+ if ( ! empty( $aioseop_options['aiosp_ga_advanced_options'] ) && ! empty( $aioseop_options['aiosp_ga_display_advertising'] ) ) {
4403
+ ?> ga.src = ('https:' == document.location.protocol ? 'https://' : 'http://') + 'stats.g.doubleclick.net/dc.js';
4404
+ <?php
4405
+ } else {
4406
+ ?> ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
4407
+ <?php
4408
+ }
4409
+ ?> var s = document.getElementsByTagName('script')[0];
4410
+ s.parentNode.insertBefore(ga, s);
4411
+ })();
4412
+ </script>
4413
+ <?php
4414
+ }
4415
+ if ( ! empty( $aioseop_options['aiosp_ga_advanced_options'] ) && $aioseop_options['aiosp_ga_track_outbound_links'] ) { ?>
4416
+ <script type="text/javascript">
4417
+ function recordOutboundLink(link, category, action) {
4418
+ <?php if ( ! empty( $aioseop_options['aiosp_ga_use_universal_analytics'] ) ) { ?>
4419
+ ga('send', 'event', category, action);
4420
+ <?php }
4421
+ if ( empty( $aioseop_options['aiosp_ga_use_universal_analytics'] ) ) { ?>
4422
+ _gat._getTrackerByName()._trackEvent(category, action);
4423
+ <?php } ?>
4424
+ if (link.target == '_blank') return true;
4425
+ setTimeout('document.location = "' + link.href + '"', 100);
4426
+ return false;
4427
+ }
4428
+ /* use regular Javascript for this */
4429
+ function getAttr(ele, attr) {
4430
+ var result = (ele.getAttribute && ele.getAttribute(attr)) || null;
4431
+ if (!result) {
4432
+ var attrs = ele.attributes;
4433
+ var length = attrs.length;
4434
+ for (var i = 0; i < length; i++)
4435
+ if (attr[i].nodeName === attr) result = attr[i].nodeValue;
4436
+ }
4437
+ return result;
4438
+ }
4439
+
4440
+ function aiosp_addLoadEvent(func) {
4441
+ var oldonload = window.onload;
4442
+ if (typeof window.onload != 'function') {
4443
+ window.onload = func;
4444
+ } else {
4445
+ window.onload = function () {
4446
+ if (oldonload) {
4447
+ oldonload();
4448
+ }
4449
+ func();
4450
+ }
4451
+ }
4452
+ }
4453
+
4454
+ function aiosp_addEvent(element, evnt, funct) {
4455
+ if (element.attachEvent)
4456
+ return element.attachEvent('on' + evnt, funct);
4457
+ else
4458
+ return element.addEventListener(evnt, funct, false);
4459
+ }
4460
+
4461
+ aiosp_addLoadEvent(function () {
4462
+ var links = document.getElementsByTagName('a');
4463
+ for (var x = 0; x < links.length; x++) {
4464
+ if (typeof links[x] == 'undefined') continue;
4465
+ aiosp_addEvent(links[x], 'onclick', function () {
4466
+ var mydomain = new RegExp(document.domain, 'i');
4467
+ href = getAttr(this, 'href');
4468
+ if (href && href.toLowerCase().indexOf('http') === 0 && !mydomain.test(href)) {
4469
+ recordOutboundLink(this, 'Outbound Links', href);
4470
+ }
4471
+ });
4472
+ }
4473
+ });
4474
+ </script>
4475
+ <?php
4476
+ }
4477
+ $analytics = ob_get_clean();
4478
+ }
4479
+ echo apply_filters( 'aiosp_google_analytics', $analytics );
4480
+ do_action( 'after_aiosp_google_analytics' );
4481
+ }
4482
+
4483
+ /**
4484
+ * @return string
4485
+ */
4486
+ function universal_analytics() {
4487
+ global $aioseop_options;
4488
+ $analytics = '';
4489
+ if ( ! empty( $aioseop_options['aiosp_ga_use_universal_analytics'] ) ) {
4490
+ $allow_linker = $cookie_domain = $domain = $addl_domains = $domain_list = '';
4491
+ if ( ! empty( $aioseop_options['aiosp_ga_advanced_options'] ) ) {
4492
+ $cookie_domain = $this->get_analytics_domain();
4493
+ }
4494
+ if ( ! empty( $cookie_domain ) ) {
4495
+ $cookie_domain = esc_js( $cookie_domain );
4496
+ $cookie_domain = "'cookieDomain': '{$cookie_domain}'";
4497
+ }
4498
+ if ( empty( $cookie_domain ) ) {
4499
+ $domain = ", 'auto'";
4500
+ }
4501
+ if ( ! empty( $aioseop_options['aiosp_ga_advanced_options'] ) && ! empty( $aioseop_options['aiosp_ga_multi_domain'] ) ) {
4502
+ $allow_linker = "'allowLinker': true";
4503
+ if ( ! empty( $aioseop_options['aiosp_ga_addl_domains'] ) ) {
4504
+ $addl_domains = trim( $aioseop_options['aiosp_ga_addl_domains'] );
4505
+ $addl_domains = preg_split( '/[\s,]+/', $addl_domains );
4506
+ if ( ! empty( $addl_domains ) ) {
4507
+ foreach ( $addl_domains as $d ) {
4508
+ $d = $this->sanitize_domain( $d );
4509
+ if ( ! empty( $d ) ) {
4510
+ if ( ! empty( $domain_list ) ) {
4511
+ $domain_list .= ', ';
4512
+ }
4513
+ $domain_list .= "'" . $d . "'";
4514
+ }
4515
+ }
4516
+ }
4517
+ }
4518
+ }
4519
+ $extra_options = '';
4520
+ if ( ! empty( $aioseop_options['aiosp_ga_advanced_options'] ) && ! empty( $aioseop_options['aiosp_ga_display_advertising'] ) ) {
4521
+ $extra_options .= "ga('require', 'displayfeatures');";
4522
+ }
4523
+ if ( ! empty( $aioseop_options['aiosp_ga_advanced_options'] ) && ! empty( $aioseop_options['aiosp_ga_enhanced_ecommerce'] ) ) {
4524
+ if ( ! empty( $extra_options ) ) {
4525
+ $extra_options .= "\n\t\t\t";
4526
+ }
4527
+ $extra_options .= "ga('require', 'ec');";
4528
+ }
4529
+ if ( ! empty( $domain_list ) ) {
4530
+ if ( ! empty( $extra_options ) ) {
4531
+ $extra_options .= "\n\t\t\t";
4532
+ }
4533
+ $extra_options .= "ga('require', 'linker');\n\t\t\tga('linker:autoLink', [{$domain_list}] );";
4534
+ }
4535
+ if ( ! empty( $aioseop_options['aiosp_ga_advanced_options'] ) && ! empty( $aioseop_options['aiosp_ga_link_attribution'] ) ) {
4536
+ if ( ! empty( $extra_options ) ) {
4537
+ $extra_options .= "\n\t\t\t";
4538
+ }
4539
+ $extra_options .= "ga('require', 'linkid', 'linkid.js');";
4540
+ }
4541
+
4542
+ if ( ! empty( $aioseop_options['aiosp_ga_advanced_options'] ) && ! empty( $aioseop_options['aiosp_ga_anonymize_ip'] ) ) {
4543
+ if ( ! empty( $extra_options ) ) {
4544
+ $extra_options .= "\n\t\t\t";
4545
+ }
4546
+ $extra_options .= "ga('set', 'anonymizeIp', true);";
4547
+ }
4548
+ $js_options = array();
4549
+ foreach ( array( 'cookie_domain', 'allow_linker' ) as $opts ) {
4550
+ if ( ! empty( $$opts ) ) {
4551
+ $js_options[] = $$opts;
4552
+ }
4553
+ }
4554
+ if ( ! empty( $js_options ) ) {
4555
+ $js_options = join( ',', $js_options );
4556
+ $js_options = ', { ' . $js_options . ' } ';
4557
+ } else {
4558
+ $js_options = '';
4559
+ }
4560
+ $analytics_id = esc_js( $aioseop_options['aiosp_google_analytics_id'] );
4561
+ $analytics = <<<EOF
4562
+ <script>
4563
+ (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
4564
+ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
4565
+ m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
4566
+ })(window,document,'script','//www.google-analytics.com/analytics.js','ga');
4567
+
4568
+ ga('create', '{$analytics_id}'{$domain}{$js_options});
4569
+ {$extra_options}
4570
+ ga('send', 'pageview');
4571
+ </script>
4572
+
4573
+ EOF;
4574
+ }
4575
+
4576
+ return $analytics;
4577
+ }
4578
+
4579
+ /**
4580
+ * @return mixed|string
4581
+ */
4582
+ function get_analytics_domain() {
4583
+ global $aioseop_options;
4584
+ if ( ! empty( $aioseop_options['aiosp_ga_domain'] ) ) {
4585
+ return $this->sanitize_domain( $aioseop_options['aiosp_ga_domain'] );
4586
+ }
4587
+
4588
+ return '';
4589
  }
4590
 
4591
  /**
4761
 
4762
  $aioseop_admin_menu = 1;
4763
  if ( ! is_admin() && ! empty( $post ) ) {
 
4764
  $blog_page = aiosp_common::get_blog_page( $post );
4765
  if ( ! empty( $blog_page ) ) {
4766
  $post = $blog_page;
4767
  }
4768
+ $wp_admin_bar->add_menu( array(
4769
+ 'id' => 'aiosp_edit_' . $post->ID,
4770
+ 'parent' => AIOSEOP_PLUGIN_DIRNAME,
4771
+ 'title' => __( 'Edit SEO', 'all-in-one-seo-pack' ),
4772
+ 'href' => get_edit_post_link( $post->ID ) . '#aiosp',
4773
+ ) );
 
 
 
4774
  }
4775
  }
4776
  }
5111
  </script>
5112
  <?php if ( ! AIOSEOPPRO ) { ?>
5113
  <div class="aioseop_advert aioseop_nopad_all">
5114
+ <?php $adid = mt_rand( 21, 23 );
5115
+
5116
+ if ( $adid == 23 ) { ?>
5117
+ <div
5118
+ style="height: 220px; background-image: url('https://www.wincher.com/Content/Images/plugin/wp/banner30.jpg')">
5119
+ <form style="position: relative; top: 170px; left: 40px;"
5120
+ action="https://www.wincher.com/FastReg" method="post" target="_blank">
5121
+ <input type="hidden" name="adreferer" value="banner<?php echo $adid; ?>"/>
5122
+ <input type="hidden" name="referer" value="all-in-one-seo-pack"/>
5123
+ <input type="text" name="email" placeholder="Email"
5124
+ style="padding-left: 7px; height: 30px; width: 290px; border: solid 1px #DDD;"/>
5125
+ <input type="submit" name="sub" value="Sign up!"
5126
+ style="height: 30px; width: 90px; background-color: #42DA76; color: #FFF; font-weight: bold; border:none; margin-left:5px;"/>
5127
+ </form>
5128
+ </div>
5129
+ <?
5130
+ } else {
5131
+ ?>
5132
  <a href="https://www.wincher.com/?referer=all-in-one-seo-pack&adreferer=banner<?php echo $adid; ?>"
5133
  target="_blank">
5134
  <div class=wincherad id=wincher<?php echo $adid; ?>>
5135
  </div>
5136
  </a>
5137
+ <?php } ?>
5138
  </div>
5139
  <div class="aioseop_advert headwaythemes">
5140
  <div>
all_in_one_seo_pack.php CHANGED
@@ -1,494 +1,471 @@
1
- <?php
2
- /*
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. Features like XML Sitemaps, SEO for custom post types, SEO for blogs or business sites, SEO for ecommerce sites, and much more. Almost 30 million downloads since 2007.
6
- Version: 2.3.9.2
7
- Author: Michael Torbert
8
- Author URI: http://michaeltorbert.com
9
- Text Domain: all-in-one-seo-pack
10
- Domain Path: /i18n/
11
- */
12
-
13
- /*
14
- Copyright (C) 2007-2016 Michael Torbert, https://semperfiwebdesign.com
15
-
16
- This program is free software; you can redistribute it and/or modify
17
- it under the terms of the GNU General Public License as published by
18
- the Free Software Foundation; version 2 of the License.
19
-
20
- This program is distributed in the hope that it will be useful,
21
- but WITHOUT ANY WARRANTY; without even the implied warranty of
22
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23
- GNU General Public License for more details.
24
-
25
- You should have received a copy of the GNU General Public License
26
- along with this program. If not, see <http://www.gnu.org/licenses/>.
27
- */
28
-
29
- /**
30
- * All in One SEO Pack.
31
- * The original WordPress SEO plugin.
32
- *
33
- * @package All-in-One-SEO-Pack
34
- * @version 2.3.9.2
35
- */
36
-
37
- if ( ! defined( 'AIOSEOPPRO' ) ) {
38
- define( 'AIOSEOPPRO', false );
39
- }
40
- if ( ! defined( 'AIOSEOP_VERSION' ) ) {
41
- define( 'AIOSEOP_VERSION', '2.3.9.2' );
42
- }
43
- global $aioseop_plugin_name;
44
- $aioseop_plugin_name = 'All in One SEO Pack';
45
-
46
- /*
47
- * DO NOT EDIT BELOW THIS LINE.
48
- */
49
-
50
- if ( ! defined( 'ABSPATH' ) ) {
51
- return;
52
- }
53
-
54
- if ( AIOSEOPPRO ) {
55
-
56
- add_action( 'admin_init', 'disable_all_in_one_free', 1 );
57
-
58
- }
59
-
60
- if ( ! function_exists( 'aiosp_add_cap' ) ) {
61
-
62
- function aiosp_add_cap() {
63
- /*
64
- TODO we should put this into an install script. We just need to make sure it runs soon enough and we need to make
65
- sure people updating from previous versions have access to it.
66
- */
67
-
68
- $role = get_role( 'administrator' );
69
- if ( is_object( $role ) ) {
70
- $role->add_cap( 'aiosp_manage_seo' );
71
- }
72
- }
73
- }
74
- add_action( 'plugins_loaded', 'aiosp_add_cap' );
75
-
76
- if ( ! defined( 'AIOSEOP_PLUGIN_NAME' ) ) {
77
- define( 'AIOSEOP_PLUGIN_NAME', $aioseop_plugin_name );
78
- }
79
-
80
- // Do we need this? register_activation_hook(__FILE__,'aioseop_activate_pl');.
81
- if ( ! defined( 'AIOSEOP_PLUGIN_DIR' ) ) {
82
- define( 'AIOSEOP_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
83
- } elseif ( AIOSEOP_PLUGIN_DIR !== plugin_dir_path( __FILE__ ) ) {
84
-
85
- /*
86
- This is not a great message.
87
- add_action( 'admin_notices', create_function( '', 'echo "' . "<div class='error'>" . sprintf(
88
- __( "%s detected a conflict; please deactivate the plugin located in %s.", 'all-in-one-seo-pack' ),
89
- $aioseop_plugin_name, AIOSEOP_PLUGIN_DIR ) . "</div>" . '";' ) );
90
- */
91
-
92
- return;
93
- }
94
-
95
- if ( ! defined( 'AIOSEOP_PLUGIN_BASENAME' ) ) {
96
- define( 'AIOSEOP_PLUGIN_BASENAME', plugin_basename( __FILE__ ) );
97
- }
98
- if ( ! defined( 'AIOSEOP_PLUGIN_DIRNAME' ) ) {
99
- define( 'AIOSEOP_PLUGIN_DIRNAME', dirname( AIOSEOP_PLUGIN_BASENAME ) );
100
- }
101
- if ( ! defined( 'AIOSEOP_PLUGIN_URL' ) ) {
102
- define( 'AIOSEOP_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
103
- }
104
- if ( ! defined( 'AIOSEOP_PLUGIN_IMAGES_URL' ) ) {
105
- define( 'AIOSEOP_PLUGIN_IMAGES_URL', AIOSEOP_PLUGIN_URL . 'images/' );
106
- }
107
- if ( ! defined( 'AIOSEOP_BASELINE_MEM_LIMIT' ) ) {
108
- define( 'AIOSEOP_BASELINE_MEM_LIMIT', 268435456 );
109
- } // 256MB
110
- if ( ! defined( 'WP_CONTENT_URL' ) ) {
111
- define( 'WP_CONTENT_URL', site_url() . '/wp-content' );
112
- }
113
- if ( ! defined( 'WP_ADMIN_URL' ) ) {
114
- define( 'WP_ADMIN_URL', site_url() . '/wp-admin' );
115
- }
116
- if ( ! defined( 'WP_CONTENT_DIR' ) ) {
117
- define( 'WP_CONTENT_DIR', ABSPATH . 'wp-content' );
118
- }
119
- if ( ! defined( 'WP_PLUGIN_URL' ) ) {
120
- define( 'WP_PLUGIN_URL', WP_CONTENT_URL . '/plugins' );
121
- }
122
- if ( ! defined( 'WP_PLUGIN_DIR' ) ) {
123
- define( 'WP_PLUGIN_DIR', WP_CONTENT_DIR . '/plugins' );
124
- }
125
-
126
- global $aiosp, $aioseop_options, $aioseop_modules, $aioseop_module_list, $aiosp_activation, $aioseop_mem_limit, $aioseop_get_pages_start, $aioseop_admin_menu;
127
- $aioseop_get_pages_start = $aioseop_admin_menu = 0;
128
-
129
- if ( AIOSEOPPRO ) {
130
- global $aioseop_update_checker;
131
- }
132
-
133
- $aioseop_options = get_option( 'aioseop_options' );
134
-
135
- $aioseop_mem_limit = @ini_get( 'memory_limit' );
136
-
137
- if ( ! function_exists( 'aioseop_convert_bytestring' ) ) {
138
- /**
139
- * @param $byte_string
140
- *
141
- * @return int
142
- */
143
- function aioseop_convert_bytestring( $byte_string ) {
144
- $num = 0;
145
- preg_match( '/^\s*([0-9.]+)\s*([KMGTPE])B?\s*$/i', $byte_string, $matches );
146
- if ( ! empty( $matches ) ) {
147
- $num = (float) $matches[1];
148
- switch ( strtoupper( $matches[2] ) ) {
149
- case 'E':
150
- $num *= 1024;
151
- case 'P':
152
- $num *= 1024;
153
- case 'T':
154
- $num *= 1024;
155
- case 'G':
156
- $num *= 1024;
157
- case 'M':
158
- $num *= 1024;
159
- case 'K':
160
- $num *= 1024;
161
- }
162
- }
163
-
164
- return intval( $num );
165
- }
166
- }
167
-
168
- if ( is_array( $aioseop_options ) && isset( $aioseop_options['modules'] ) && isset( $aioseop_options['modules']['aiosp_performance_options'] ) ) {
169
- $perf_opts = $aioseop_options['modules']['aiosp_performance_options'];
170
- if ( isset( $perf_opts['aiosp_performance_memory_limit'] ) ) {
171
- $aioseop_mem_limit = $perf_opts['aiosp_performance_memory_limit'];
172
- }
173
- if ( isset( $perf_opts['aiosp_performance_execution_time'] ) && ( '' !== $perf_opts['aiosp_performance_execution_time'] ) ) {
174
- @ini_set( 'max_execution_time', (int) $perf_opts['aiosp_performance_execution_time'] );
175
- @set_time_limit( (int) $perf_opts['aiosp_performance_execution_time'] );
176
- }
177
- } else {
178
- $aioseop_mem_limit = aioseop_convert_bytestring( $aioseop_mem_limit );
179
- if ( ( $aioseop_mem_limit > 0 ) && ( $aioseop_mem_limit < AIOSEOP_BASELINE_MEM_LIMIT ) ) {
180
- $aioseop_mem_limit = AIOSEOP_BASELINE_MEM_LIMIT;
181
- }
182
- }
183
-
184
- if ( ! empty( $aioseop_mem_limit ) ) {
185
- if ( ! is_int( $aioseop_mem_limit ) ) {
186
- $aioseop_mem_limit = aioseop_convert_bytestring( $aioseop_mem_limit );
187
- }
188
- if ( ( $aioseop_mem_limit > 0 ) && ( $aioseop_mem_limit <= AIOSEOP_BASELINE_MEM_LIMIT ) ) {
189
- @ini_set( 'memory_limit', $aioseop_mem_limit );
190
- }
191
- }
192
-
193
- $aiosp_activation = false;
194
- $aioseop_module_list = array(
195
- 'sitemap',
196
- 'opengraph',
197
- 'robots',
198
- 'file_editor',
199
- 'importer_exporter',
200
- 'bad_robots',
201
- 'performance',
202
- ); // list all available modules here
203
-
204
- if ( AIOSEOPPRO ) {
205
- $aioseop_module_list[] = 'video_sitemap';
206
- }
207
-
208
- if ( class_exists( 'All_in_One_SEO_Pack' ) ) {
209
- add_action( 'admin_notices', create_function( '', 'echo "<div class=\'error\'>The All In One SEO Pack class is already defined";'
210
- . "if ( class_exists( 'ReflectionClass' ) ) { \$r = new ReflectionClass( 'All_in_One_SEO_Pack' ); echo ' in ' . \$r->getFileName(); } "
211
- . ' echo ", preventing All In One SEO Pack from loading.</div>";' ) );
212
-
213
- return;
214
- }
215
-
216
- if ( AIOSEOPPRO ) {
217
-
218
- require( AIOSEOP_PLUGIN_DIR . 'pro/sfwd_update_checker.php' );
219
- $aioseop_update_checker = new SFWD_Update_Checker(
220
- 'http://semperplugins.com/upgrade_plugins.php',
221
- __FILE__,
222
- 'aioseop'
223
- );
224
-
225
- $aioseop_update_checker->plugin_name = AIOSEOP_PLUGIN_NAME;
226
- $aioseop_update_checker->plugin_basename = AIOSEOP_PLUGIN_BASENAME;
227
- if ( ! empty( $aioseop_options['aiosp_license_key'] ) ) {
228
- $aioseop_update_checker->license_key = $aioseop_options['aiosp_license_key'];
229
- } else {
230
- $aioseop_update_checker->license_key = '';
231
- }
232
- $aioseop_update_checker->options_page = 'all-in-one-seo-pack-pro/aioseop_class.php';
233
- $aioseop_update_checker->renewal_page = 'http://semperplugins.com/all-in-one-seo-pack-pro-support-updates-renewal/';
234
-
235
- $aioseop_update_checker->addQueryArgFilter( array( $aioseop_update_checker, 'add_secret_key' ) );
236
- }
237
-
238
-
239
- if ( ! function_exists( 'aioseop_activate' ) ) {
240
-
241
- function aioseop_activate() {
242
-
243
- //Check if we just got activated.
244
- global $aiosp_activation;
245
- if ( AIOSEOPPRO ) {
246
- global $aioseop_update_checker;
247
- }
248
- $aiosp_activation = true;
249
-
250
- if( ! is_network_admin() || !isset( $_GET['activate-multi'] ) ) {
251
- set_transient( '_aioseop_activation_redirect', true, 30 ); // Sets 30 second transient for welcome screen redirect on activation.
252
- }
253
-
254
- delete_user_meta( get_current_user_id(), 'aioseop_yst_detected_notice_dismissed' );
255
-
256
- if ( AIOSEOPPRO ) {
257
- $aioseop_update_checker->checkForUpdates();
258
- }
259
- }
260
- }
261
-
262
- add_action( 'plugins_loaded', 'aioseop_init_class' );
263
-
264
- if ( ! function_exists( 'aiosp_plugin_row_meta' ) ) {
265
-
266
- add_filter( 'plugin_row_meta', 'aiosp_plugin_row_meta', 10, 2 );
267
-
268
- /**
269
- * @param $actions
270
- * @param $plugin_file
271
- *
272
- * @return array
273
- */
274
- function aiosp_plugin_row_meta( $actions, $plugin_file ) {
275
-
276
- if ( ! AIOSEOPPRO ) {
277
-
278
- $action_links = array(
279
- 'donatelink' => array(
280
- 'label' => __( 'Donate', 'all-in-one-seo-pack' ),
281
- 'url' => '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',
282
- ),
283
- 'amazon' => array(
284
- 'label' => __( 'Amazon Wishlist', 'all-in-one-seo-pack' ),
285
- 'url' => 'https://www.amazon.com/wishlist/1NFQ133FNCOOA/ref=wl_web',
286
- ),
287
-
288
- );
289
-
290
- } else {
291
- $action_links = '';
292
- }
293
-
294
- return aiosp_action_links( $actions, $plugin_file, $action_links, 'after' );
295
- }
296
- }
297
-
298
- if ( ! function_exists( 'aiosp_add_action_links' ) ) {
299
-
300
-
301
- add_filter( 'plugin_action_links_' . plugin_basename( __FILE__ ), 'aiosp_add_action_links', 10, 2 );
302
-
303
- /**
304
- * @param $actions
305
- * @param $plugin_file
306
- *
307
- * @return array
308
- */
309
- function aiosp_add_action_links( $actions, $plugin_file ) {
310
-
311
- $aioseop_plugin_dirname = AIOSEOP_PLUGIN_DIRNAME;
312
- $action_links = array();
313
- $action_links = array(
314
- 'settings' => array(
315
- 'label' => __( 'SEO Settings', 'all-in-one-seo-pack' ),
316
- 'url' => get_admin_url( null, "admin.php?page=$aioseop_plugin_dirname/aioseop_class.php" ),
317
- ),
318
-
319
- 'forum' => array(
320
- 'label' => __( 'Support Forum', 'all-in-one-seo-pack' ),
321
- 'url' => 'http://semperplugins.com/support/',
322
- ),
323
-
324
- 'docs' => array(
325
- 'label' => __( 'Documentation', 'all-in-one-seo-pack' ),
326
- 'url' => 'http://semperplugins.com/documentation/',
327
- ),
328
-
329
- );
330
-
331
- unset( $actions['edit'] );
332
-
333
- if ( ! AIOSEOPPRO ) {
334
- $action_links['proupgrade'] =
335
- array(
336
- 'label' => __( 'Upgrade to Pro', 'all-in-one-seo-pack' ),
337
- 'url' => 'http://semperplugins.com/plugins/all-in-one-seo-pack-pro-version/?loc=plugins',
338
-
339
- );
340
- }
341
-
342
- return aiosp_action_links( $actions, $plugin_file, $action_links, 'before' );
343
- }
344
- }
345
-
346
- if ( ! function_exists( 'aiosp_action_links' ) ) {
347
-
348
- /**
349
- * @param $actions
350
- * @param $plugin_file
351
- * @param array $action_links
352
- * @param string $position
353
- *
354
- * @return array
355
- */
356
- function aiosp_action_links( $actions, $plugin_file, $action_links = array(), $position = 'after' ) {
357
- static $plugin;
358
- if ( ! isset( $plugin ) ) {
359
- $plugin = plugin_basename( __FILE__ );
360
- }
361
- if ( $plugin === $plugin_file && ! empty( $action_links ) ) {
362
- foreach ( $action_links as $key => $value ) {
363
- $link = array( $key => '<a href="' . $value['url'] . '">' . $value['label'] . '</a>' );
364
- if ( 'after' === $position ) {
365
- $actions = array_merge( $actions, $link );
366
- } else {
367
- $actions = array_merge( $link, $actions );
368
- }
369
- }//foreach
370
- }// if
371
- return $actions;
372
- }
373
- }
374
-
375
- if ( ! function_exists( 'aioseop_init_class' ) ) {
376
- function aioseop_init_class() {
377
- global $aiosp;
378
- load_plugin_textdomain( 'all-in-one-seo-pack', false, dirname( plugin_basename( __FILE__ ) ) . '/i18n/' );
379
- require_once( AIOSEOP_PLUGIN_DIR . 'inc/aioseop_functions.php' );
380
- require_once( AIOSEOP_PLUGIN_DIR . 'aioseop_class.php' );
381
- require_once( AIOSEOP_PLUGIN_DIR . 'inc/aioseop_updates_class.php' );
382
- require_once( AIOSEOP_PLUGIN_DIR . 'inc/commonstrings.php' );
383
- require_once( AIOSEOP_PLUGIN_DIR . 'admin/display/postedit.php' );
384
- require_once( AIOSEOP_PLUGIN_DIR . 'admin/display/general-metaboxes.php' );
385
- require_once( AIOSEOP_PLUGIN_DIR . 'inc/aiosp_common.php' );
386
- require_once( AIOSEOP_PLUGIN_DIR . 'admin/meta_import.php' );
387
- require_once( AIOSEOP_PLUGIN_DIR . 'inc/translations.php' );
388
- require_once( AIOSEOP_PLUGIN_DIR . 'public/opengraph.php' );
389
- require_once( AIOSEOP_PLUGIN_DIR . 'inc/compatability/compat-init.php');
390
- require_once( AIOSEOP_PLUGIN_DIR . 'public/front.php' );
391
- require_once( AIOSEOP_PLUGIN_DIR . 'public/google-analytics.php' );
392
- require_once( AIOSEOP_PLUGIN_DIR . 'admin/display/welcome.php' );
393
-
394
- $aioseop_welcome = new aioseop_welcome(); // TODO move this to updates file.
395
-
396
- if ( AIOSEOPPRO ) {
397
- require_once( AIOSEOP_PLUGIN_DIR . 'pro/class-aio-pro-init.php' ); // Loads pro files and other pro init stuff.
398
- }
399
- aiosp_seometa_import(); // call importer functions... this should be moved somewhere better
400
-
401
- $aiosp = new All_in_One_SEO_Pack();
402
-
403
- $aioseop_updates = new AIOSEOP_Updates();
404
-
405
- if ( AIOSEOPPRO ) {
406
- $aioseop_pro_updates = new AIOSEOP_Pro_Updates();
407
- add_action( 'admin_init', array( $aioseop_pro_updates, 'version_updates' ), 12 );
408
- }
409
-
410
- add_action( 'admin_init', 'aioseop_welcome' );
411
-
412
- if ( aioseop_option_isset( 'aiosp_unprotect_meta' ) ) {
413
- add_filter( 'is_protected_meta', 'aioseop_unprotect_meta', 10, 3 );
414
- }
415
-
416
- add_action( 'init', array( $aiosp, 'add_hooks' ) );
417
- add_action( 'admin_init', array( $aioseop_updates, 'version_updates' ), 11 );
418
-
419
- if ( defined( 'DOING_AJAX' ) && ! empty( $_POST ) && ! empty( $_POST['action'] ) && 'aioseop_ajax_scan_header' === $_POST['action'] ) {
420
- remove_action( 'init', array( $aiosp, 'add_hooks' ) );
421
- add_action( 'admin_init', 'aioseop_scan_post_header' );
422
- add_action( 'shutdown', 'aioseop_ajax_scan_header' ); // if the action doesn't run -- pdb
423
- include_once( ABSPATH . 'wp-admin/includes/screen.php' );
424
- global $current_screen;
425
- if ( class_exists( 'WP_Screen' ) ) {
426
- $current_screen = WP_Screen::get( 'front' );
427
- }
428
- }
429
- }
430
- }
431
-
432
-
433
-
434
- if ( ! function_exists( 'aioseop_welcome' ) ){
435
- function aioseop_welcome(){
436
- if( get_transient( '_aioseop_activation_redirect') ){
437
- $aioseop_welcome = new aioseop_welcome();
438
- delete_transient( '_aioseop_activation_redirect' );
439
- $aioseop_welcome->init();
440
- }
441
-
442
- }
443
- }
444
-
445
- add_action( 'init', 'aioseop_load_modules', 1 );
446
- //add_action( 'after_setup_theme', 'aioseop_load_modules' );
447
-
448
- if ( is_admin() ) {
449
- add_action( 'wp_ajax_aioseop_ajax_save_meta', 'aioseop_ajax_save_meta' );
450
- add_action( 'wp_ajax_aioseop_ajax_save_url', 'aioseop_ajax_save_url' );
451
- add_action( 'wp_ajax_aioseop_ajax_delete_url', 'aioseop_ajax_delete_url' );
452
- add_action( 'wp_ajax_aioseop_ajax_scan_header', 'aioseop_ajax_scan_header' );
453
- if ( AIOSEOPPRO ) {
454
- add_action( 'wp_ajax_aioseop_ajax_facebook_debug', 'aioseop_ajax_facebook_debug' );
455
- }
456
- add_action( 'wp_ajax_aioseop_ajax_save_settings', 'aioseop_ajax_save_settings' );
457
- add_action( 'wp_ajax_aioseop_ajax_get_menu_links', 'aioseop_ajax_get_menu_links' );
458
- add_action( 'wp_ajax_aioseo_dismiss_yst_notice', 'aioseop_update_yst_detected_notice' );
459
- add_action( 'wp_ajax_aioseo_dismiss_visibility_notice', 'aioseop_update_user_visibilitynotice' );
460
- add_action( 'wp_ajax_aioseo_dismiss_woo_upgrade_notice', 'aioseop_woo_upgrade_notice_dismissed' );
461
- if ( AIOSEOPPRO ) {
462
- add_action( 'wp_ajax_aioseop_ajax_update_oembed', 'aioseop_ajax_update_oembed' );
463
- }
464
- }
465
-
466
- if ( ! function_exists( 'aioseop_scan_post_header' ) ) {
467
- function aioseop_scan_post_header() {
468
- require_once( ABSPATH . WPINC . '/default-filters.php' );
469
- global $wp_query;
470
- $wp_query->query_vars['paged'] = 0;
471
- query_posts( 'post_type=post&posts_per_page=1' );
472
- if ( have_posts() ) {
473
- the_post();
474
- }
475
- }
476
- }
477
-
478
- require_once( AIOSEOP_PLUGIN_DIR . 'aioseop-init.php' );
479
-
480
- if ( ! function_exists( 'aioseop_install' ) ) {
481
- register_activation_hook( __FILE__, 'aioseop_install' );
482
-
483
- function aioseop_install() {
484
- aioseop_activate();
485
- }
486
- }
487
-
488
- if ( ! function_exists( 'disable_all_in_one_free' ) ) {
489
- function disable_all_in_one_free() {
490
- if ( AIOSEOPPRO && is_plugin_active( 'all-in-one-seo-pack/all_in_one_seo_pack.php' ) ) {
491
- deactivate_plugins( 'all-in-one-seo-pack/all_in_one_seo_pack.php' );
492
- }
493
- }
494
- }
1
+ <?php
2
+ /*
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. Features like XML Sitemaps, SEO for custom post types, SEO for blogs or business sites, SEO for ecommerce sites, and much more. Almost 30 million downloads since 2007.
6
+ Version: 2.3.9.1
7
+ Author: Michael Torbert
8
+ Author URI: http://michaeltorbert.com
9
+ Text Domain: all-in-one-seo-pack
10
+ Domain Path: /i18n/
11
+ */
12
+
13
+ /*
14
+ Copyright (C) 2007-2016 Michael Torbert, https://semperfiwebdesign.com
15
+
16
+ This program is free software; you can redistribute it and/or modify
17
+ it under the terms of the GNU General Public License as published by
18
+ the Free Software Foundation; version 2 of the License.
19
+
20
+ This program is distributed in the hope that it will be useful,
21
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
22
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23
+ GNU General Public License for more details.
24
+
25
+ You should have received a copy of the GNU General Public License
26
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
27
+ */
28
+
29
+ /**
30
+ * All in One SEO Pack.
31
+ * The original WordPress SEO plugin.
32
+ *
33
+ * @package All-in-One-SEO-Pack
34
+ * @version 2.3.9.1
35
+ */
36
+
37
+ if ( ! defined( 'AIOSEOPPRO' ) ) {
38
+ define( 'AIOSEOPPRO', false );
39
+ }
40
+ if ( ! defined( 'AIOSEOP_VERSION' ) ) {
41
+ define( 'AIOSEOP_VERSION', '2.3.9.1' );
42
+ }
43
+ global $aioseop_plugin_name;
44
+ $aioseop_plugin_name = 'All in One SEO Pack';
45
+
46
+ /*
47
+ * DO NOT EDIT BELOW THIS LINE.
48
+ */
49
+
50
+ if ( ! defined( 'ABSPATH' ) ) {
51
+ return;
52
+ }
53
+
54
+ if ( AIOSEOPPRO ) {
55
+
56
+ add_action( 'admin_init', 'disable_all_in_one_free', 1 );
57
+
58
+ }
59
+
60
+ if ( ! function_exists( 'aiosp_add_cap' ) ) {
61
+
62
+ function aiosp_add_cap() {
63
+ /*
64
+ TODO we should put this into an install script. We just need to make sure it runs soon enough and we need to make
65
+ sure people updating from previous versions have access to it.
66
+ */
67
+
68
+ $role = get_role( 'administrator' );
69
+ if ( is_object( $role ) ) {
70
+ $role->add_cap( 'aiosp_manage_seo' );
71
+ }
72
+ }
73
+ }
74
+ add_action( 'plugins_loaded', 'aiosp_add_cap' );
75
+
76
+ if ( ! defined( 'AIOSEOP_PLUGIN_NAME' ) ) {
77
+ define( 'AIOSEOP_PLUGIN_NAME', $aioseop_plugin_name );
78
+ }
79
+
80
+ // Do we need this? register_activation_hook(__FILE__,'aioseop_activate_pl');.
81
+ if ( ! defined( 'AIOSEOP_PLUGIN_DIR' ) ) {
82
+ define( 'AIOSEOP_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
83
+ } elseif ( AIOSEOP_PLUGIN_DIR !== plugin_dir_path( __FILE__ ) ) {
84
+
85
+ /*
86
+ This is not a great message.
87
+ add_action( 'admin_notices', create_function( '', 'echo "' . "<div class='error'>" . sprintf(
88
+ __( "%s detected a conflict; please deactivate the plugin located in %s.", 'all-in-one-seo-pack' ),
89
+ $aioseop_plugin_name, AIOSEOP_PLUGIN_DIR ) . "</div>" . '";' ) );
90
+ */
91
+
92
+ return;
93
+ }
94
+
95
+ if ( ! defined( 'AIOSEOP_PLUGIN_BASENAME' ) ) {
96
+ define( 'AIOSEOP_PLUGIN_BASENAME', plugin_basename( __FILE__ ) );
97
+ }
98
+ if ( ! defined( 'AIOSEOP_PLUGIN_DIRNAME' ) ) {
99
+ define( 'AIOSEOP_PLUGIN_DIRNAME', dirname( AIOSEOP_PLUGIN_BASENAME ) );
100
+ }
101
+ if ( ! defined( 'AIOSEOP_PLUGIN_URL' ) ) {
102
+ define( 'AIOSEOP_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
103
+ }
104
+ if ( ! defined( 'AIOSEOP_PLUGIN_IMAGES_URL' ) ) {
105
+ define( 'AIOSEOP_PLUGIN_IMAGES_URL', AIOSEOP_PLUGIN_URL . 'images/' );
106
+ }
107
+ if ( ! defined( 'AIOSEOP_BASELINE_MEM_LIMIT' ) ) {
108
+ define( 'AIOSEOP_BASELINE_MEM_LIMIT', 268435456 );
109
+ } // 256MB
110
+ if ( ! defined( 'WP_CONTENT_URL' ) ) {
111
+ define( 'WP_CONTENT_URL', site_url() . '/wp-content' );
112
+ }
113
+ if ( ! defined( 'WP_ADMIN_URL' ) ) {
114
+ define( 'WP_ADMIN_URL', site_url() . '/wp-admin' );
115
+ }
116
+ if ( ! defined( 'WP_CONTENT_DIR' ) ) {
117
+ define( 'WP_CONTENT_DIR', ABSPATH . 'wp-content' );
118
+ }
119
+ if ( ! defined( 'WP_PLUGIN_URL' ) ) {
120
+ define( 'WP_PLUGIN_URL', WP_CONTENT_URL . '/plugins' );
121
+ }
122
+ if ( ! defined( 'WP_PLUGIN_DIR' ) ) {
123
+ define( 'WP_PLUGIN_DIR', WP_CONTENT_DIR . '/plugins' );
124
+ }
125
+
126
+ global $aiosp, $aioseop_options, $aioseop_modules, $aioseop_module_list, $aiosp_activation, $aioseop_mem_limit, $aioseop_get_pages_start, $aioseop_admin_menu;
127
+ $aioseop_get_pages_start = $aioseop_admin_menu = 0;
128
+
129
+ if ( AIOSEOPPRO ) {
130
+ global $aioseop_update_checker;
131
+ }
132
+
133
+ $aioseop_options = get_option( 'aioseop_options' );
134
+
135
+ $aioseop_mem_limit = @ini_get( 'memory_limit' );
136
+
137
+ if ( ! function_exists( 'aioseop_convert_bytestring' ) ) {
138
+ /**
139
+ * @param $byte_string
140
+ *
141
+ * @return int
142
+ */
143
+ function aioseop_convert_bytestring( $byte_string ) {
144
+ $num = 0;
145
+ preg_match( '/^\s*([0-9.]+)\s*([KMGTPE])B?\s*$/i', $byte_string, $matches );
146
+ if ( ! empty( $matches ) ) {
147
+ $num = (float) $matches[1];
148
+ switch ( strtoupper( $matches[2] ) ) {
149
+ case 'E':
150
+ $num *= 1024;
151
+ case 'P':
152
+ $num *= 1024;
153
+ case 'T':
154
+ $num *= 1024;
155
+ case 'G':
156
+ $num *= 1024;
157
+ case 'M':
158
+ $num *= 1024;
159
+ case 'K':
160
+ $num *= 1024;
161
+ }
162
+ }
163
+
164
+ return intval( $num );
165
+ }
166
+ }
167
+
168
+ if ( is_array( $aioseop_options ) && isset( $aioseop_options['modules'] ) && isset( $aioseop_options['modules']['aiosp_performance_options'] ) ) {
169
+ $perf_opts = $aioseop_options['modules']['aiosp_performance_options'];
170
+ if ( isset( $perf_opts['aiosp_performance_memory_limit'] ) ) {
171
+ $aioseop_mem_limit = $perf_opts['aiosp_performance_memory_limit'];
172
+ }
173
+ if ( isset( $perf_opts['aiosp_performance_execution_time'] ) && ( '' !== $perf_opts['aiosp_performance_execution_time'] ) ) {
174
+ @ini_set( 'max_execution_time', (int) $perf_opts['aiosp_performance_execution_time'] );
175
+ @set_time_limit( (int) $perf_opts['aiosp_performance_execution_time'] );
176
+ }
177
+ } else {
178
+ $aioseop_mem_limit = aioseop_convert_bytestring( $aioseop_mem_limit );
179
+ if ( ( $aioseop_mem_limit > 0 ) && ( $aioseop_mem_limit < AIOSEOP_BASELINE_MEM_LIMIT ) ) {
180
+ $aioseop_mem_limit = AIOSEOP_BASELINE_MEM_LIMIT;
181
+ }
182
+ }
183
+
184
+ if ( ! empty( $aioseop_mem_limit ) ) {
185
+ if ( ! is_int( $aioseop_mem_limit ) ) {
186
+ $aioseop_mem_limit = aioseop_convert_bytestring( $aioseop_mem_limit );
187
+ }
188
+ if ( ( $aioseop_mem_limit > 0 ) && ( $aioseop_mem_limit <= AIOSEOP_BASELINE_MEM_LIMIT ) ) {
189
+ @ini_set( 'memory_limit', $aioseop_mem_limit );
190
+ }
191
+ }
192
+
193
+ $aiosp_activation = false;
194
+ $aioseop_module_list = array(
195
+ 'sitemap',
196
+ 'opengraph',
197
+ 'robots',
198
+ 'file_editor',
199
+ 'importer_exporter',
200
+ 'bad_robots',
201
+ 'performance',
202
+ ); // list all available modules here
203
+
204
+ if ( AIOSEOPPRO ) {
205
+ $aioseop_module_list[] = 'video_sitemap';
206
+ }
207
+
208
+ if ( class_exists( 'All_in_One_SEO_Pack' ) ) {
209
+ add_action( 'admin_notices', create_function( '', 'echo "<div class=\'error\'>The All In One SEO Pack class is already defined";'
210
+ . "if ( class_exists( 'ReflectionClass' ) ) { \$r = new ReflectionClass( 'All_in_One_SEO_Pack' ); echo ' in ' . \$r->getFileName(); } "
211
+ . ' echo ", preventing All In One SEO Pack from loading.</div>";' ) );
212
+
213
+ return;
214
+ }
215
+
216
+ if ( AIOSEOPPRO ) {
217
+
218
+ require( AIOSEOP_PLUGIN_DIR . 'pro/sfwd_update_checker.php' );
219
+ $aioseop_update_checker = new SFWD_Update_Checker(
220
+ 'http://semperplugins.com/upgrade_plugins.php',
221
+ __FILE__,
222
+ 'aioseop'
223
+ );
224
+
225
+ $aioseop_update_checker->plugin_name = AIOSEOP_PLUGIN_NAME;
226
+ $aioseop_update_checker->plugin_basename = AIOSEOP_PLUGIN_BASENAME;
227
+ if ( ! empty( $aioseop_options['aiosp_license_key'] ) ) {
228
+ $aioseop_update_checker->license_key = $aioseop_options['aiosp_license_key'];
229
+ } else {
230
+ $aioseop_update_checker->license_key = '';
231
+ }
232
+ $aioseop_update_checker->options_page = 'all-in-one-seo-pack-pro/aioseop_class.php';
233
+ $aioseop_update_checker->renewal_page = 'http://semperplugins.com/all-in-one-seo-pack-pro-support-updates-renewal/';
234
+
235
+ $aioseop_update_checker->addQueryArgFilter( array( $aioseop_update_checker, 'add_secret_key' ) );
236
+ }
237
+
238
+
239
+ if ( ! function_exists( 'aioseop_activate' ) ) {
240
+
241
+ function aioseop_activate() {
242
+
243
+ //Check if we just got activated.
244
+ global $aiosp_activation;
245
+ if ( AIOSEOPPRO ) {
246
+ global $aioseop_update_checker;
247
+ }
248
+ $aiosp_activation = true;
249
+
250
+ delete_user_meta( get_current_user_id(), 'aioseop_yst_detected_notice_dismissed' );
251
+
252
+ if ( AIOSEOPPRO ) {
253
+ $aioseop_update_checker->checkForUpdates();
254
+ }
255
+ }
256
+ }
257
+
258
+ add_action( 'plugins_loaded', 'aioseop_init_class' );
259
+
260
+ if ( ! function_exists( 'aiosp_plugin_row_meta' ) ) {
261
+
262
+ add_filter( 'plugin_row_meta', 'aiosp_plugin_row_meta', 10, 2 );
263
+
264
+ /**
265
+ * @param $actions
266
+ * @param $plugin_file
267
+ *
268
+ * @return array
269
+ */
270
+ function aiosp_plugin_row_meta( $actions, $plugin_file ) {
271
+
272
+ if ( ! AIOSEOPPRO ) {
273
+
274
+ $action_links = array(
275
+ 'donatelink' => array(
276
+ 'label' => __( 'Donate', 'all-in-one-seo-pack' ),
277
+ 'url' => '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',
278
+ ),
279
+ 'amazon' => array(
280
+ 'label' => __( 'Amazon Wishlist', 'all-in-one-seo-pack' ),
281
+ 'url' => 'https://www.amazon.com/wishlist/1NFQ133FNCOOA/ref=wl_web',
282
+ ),
283
+
284
+ );
285
+
286
+ } else {
287
+ $action_links = '';
288
+ }
289
+
290
+ return aiosp_action_links( $actions, $plugin_file, $action_links, 'after' );
291
+ }
292
+ }
293
+
294
+ if ( ! function_exists( 'aiosp_add_action_links' ) ) {
295
+
296
+
297
+ add_filter( 'plugin_action_links_' . plugin_basename( __FILE__ ), 'aiosp_add_action_links', 10, 2 );
298
+
299
+ /**
300
+ * @param $actions
301
+ * @param $plugin_file
302
+ *
303
+ * @return array
304
+ */
305
+ function aiosp_add_action_links( $actions, $plugin_file ) {
306
+
307
+ $aioseop_plugin_dirname = AIOSEOP_PLUGIN_DIRNAME;
308
+ $action_links = array();
309
+ $action_links = array(
310
+ 'settings' => array(
311
+ 'label' => __( 'SEO Settings', 'all-in-one-seo-pack' ),
312
+ 'url' => get_admin_url( null, "admin.php?page=$aioseop_plugin_dirname/aioseop_class.php" ),
313
+ ),
314
+
315
+ 'forum' => array(
316
+ 'label' => __( 'Support Forum', 'all-in-one-seo-pack' ),
317
+ 'url' => 'http://semperplugins.com/support/',
318
+ ),
319
+
320
+ 'docs' => array(
321
+ 'label' => __( 'Documentation', 'all-in-one-seo-pack' ),
322
+ 'url' => 'http://semperplugins.com/documentation/',
323
+ ),
324
+
325
+ );
326
+
327
+ unset( $actions['edit'] );
328
+
329
+ if ( ! AIOSEOPPRO ) {
330
+ $action_links['proupgrade'] =
331
+ array(
332
+ 'label' => __( 'Upgrade to Pro', 'all-in-one-seo-pack' ),
333
+ 'url' => 'http://semperplugins.com/plugins/all-in-one-seo-pack-pro-version/?loc=plugins',
334
+
335
+ );
336
+ }
337
+
338
+ return aiosp_action_links( $actions, $plugin_file, $action_links, 'before' );
339
+ }
340
+ }
341
+
342
+ if ( ! function_exists( 'aiosp_action_links' ) ) {
343
+
344
+ /**
345
+ * @param $actions
346
+ * @param $plugin_file
347
+ * @param array $action_links
348
+ * @param string $position
349
+ *
350
+ * @return array
351
+ */
352
+ function aiosp_action_links( $actions, $plugin_file, $action_links = array(), $position = 'after' ) {
353
+ static $plugin;
354
+ if ( ! isset( $plugin ) ) {
355
+ $plugin = plugin_basename( __FILE__ );
356
+ }
357
+ if ( $plugin === $plugin_file && ! empty( $action_links ) ) {
358
+ foreach ( $action_links as $key => $value ) {
359
+ $link = array( $key => '<a href="' . $value['url'] . '">' . $value['label'] . '</a>' );
360
+ if ( 'after' === $position ) {
361
+ $actions = array_merge( $actions, $link );
362
+ } else {
363
+ $actions = array_merge( $link, $actions );
364
+ }
365
+ }//foreach
366
+ }// if
367
+ return $actions;
368
+ }
369
+ }
370
+
371
+ if ( ! function_exists( 'aioseop_init_class' ) ) {
372
+ function aioseop_init_class() {
373
+ global $aiosp;
374
+ load_plugin_textdomain( 'all-in-one-seo-pack', false, dirname( plugin_basename( __FILE__ ) ) . '/i18n/' );
375
+ require_once( AIOSEOP_PLUGIN_DIR . 'inc/aioseop_functions.php' );
376
+ require_once( AIOSEOP_PLUGIN_DIR . 'aioseop_class.php' );
377
+ require_once( AIOSEOP_PLUGIN_DIR . 'inc/aioseop_updates_class.php' );
378
+ require_once( AIOSEOP_PLUGIN_DIR . 'inc/commonstrings.php' );
379
+ require_once( AIOSEOP_PLUGIN_DIR . 'admin/display/postedit.php' );
380
+ require_once( AIOSEOP_PLUGIN_DIR . 'admin/display/general-metaboxes.php' );
381
+ require_once( AIOSEOP_PLUGIN_DIR . 'inc/aiosp_common.php' );
382
+ require_once( AIOSEOP_PLUGIN_DIR . 'admin/meta_import.php' );
383
+ require_once( AIOSEOP_PLUGIN_DIR . 'inc/translations.php' );
384
+ require_once( AIOSEOP_PLUGIN_DIR . 'public/opengraph.php' );
385
+ require_once( AIOSEOP_PLUGIN_DIR . 'inc/compatability/compat-init.php');
386
+ require_once( AIOSEOP_PLUGIN_DIR . 'public/front.php' );
387
+
388
+ if ( AIOSEOPPRO ) {
389
+ require_once( AIOSEOP_PLUGIN_DIR . 'pro/class-aio-pro-init.php' ); // Loads pro files and other pro init stuff.
390
+ }
391
+ aiosp_seometa_import(); // call importer functions... this should be moved somewhere better
392
+
393
+ $aiosp = new All_in_One_SEO_Pack();
394
+
395
+ $aioseop_updates = new AIOSEOP_Updates();
396
+
397
+ if ( AIOSEOPPRO ) {
398
+ $aioseop_pro_updates = new AIOSEOP_Pro_Updates();
399
+ add_action( 'admin_init', array( $aioseop_pro_updates, 'version_updates' ), 12 );
400
+ }
401
+
402
+ if ( aioseop_option_isset( 'aiosp_unprotect_meta' ) ) {
403
+ add_filter( 'is_protected_meta', 'aioseop_unprotect_meta', 10, 3 );
404
+ }
405
+
406
+ add_action( 'init', array( $aiosp, 'add_hooks' ) );
407
+ add_action( 'admin_init', array( $aioseop_updates, 'version_updates' ), 11 );
408
+
409
+ if ( defined( 'DOING_AJAX' ) && ! empty( $_POST ) && ! empty( $_POST['action'] ) && 'aioseop_ajax_scan_header' === $_POST['action'] ) {
410
+ remove_action( 'init', array( $aiosp, 'add_hooks' ) );
411
+ add_action( 'admin_init', 'aioseop_scan_post_header' );
412
+ add_action( 'shutdown', 'aioseop_ajax_scan_header' ); // if the action doesn't run -- pdb
413
+ include_once( ABSPATH . 'wp-admin/includes/screen.php' );
414
+ global $current_screen;
415
+ if ( class_exists( 'WP_Screen' ) ) {
416
+ $current_screen = WP_Screen::get( 'front' );
417
+ }
418
+ }
419
+ }
420
+ }
421
+
422
+ add_action( 'init', 'aioseop_load_modules', 1 );
423
+ //add_action( 'after_setup_theme', 'aioseop_load_modules' );
424
+
425
+ if ( is_admin() ) {
426
+ add_action( 'wp_ajax_aioseop_ajax_save_meta', 'aioseop_ajax_save_meta' );
427
+ add_action( 'wp_ajax_aioseop_ajax_save_url', 'aioseop_ajax_save_url' );
428
+ add_action( 'wp_ajax_aioseop_ajax_delete_url', 'aioseop_ajax_delete_url' );
429
+ add_action( 'wp_ajax_aioseop_ajax_scan_header', 'aioseop_ajax_scan_header' );
430
+ if ( AIOSEOPPRO ) {
431
+ add_action( 'wp_ajax_aioseop_ajax_facebook_debug', 'aioseop_ajax_facebook_debug' );
432
+ }
433
+ add_action( 'wp_ajax_aioseop_ajax_save_settings', 'aioseop_ajax_save_settings' );
434
+ add_action( 'wp_ajax_aioseop_ajax_get_menu_links', 'aioseop_ajax_get_menu_links' );
435
+ add_action( 'wp_ajax_aioseo_dismiss_yst_notice', 'aioseop_update_yst_detected_notice' );
436
+ add_action( 'wp_ajax_aioseo_dismiss_visibility_notice', 'aioseop_update_user_visibilitynotice' );
437
+ add_action( 'wp_ajax_aioseo_dismiss_woo_upgrade_notice', 'aioseop_woo_upgrade_notice_dismissed' );
438
+ if ( AIOSEOPPRO ) {
439
+ add_action( 'wp_ajax_aioseop_ajax_update_oembed', 'aioseop_ajax_update_oembed' );
440
+ }
441
+ }
442
+
443
+ if ( ! function_exists( 'aioseop_scan_post_header' ) ) {
444
+ function aioseop_scan_post_header() {
445
+ require_once( ABSPATH . WPINC . '/default-filters.php' );
446
+ global $wp_query;
447
+ $wp_query->query_vars['paged'] = 0;
448
+ query_posts( 'post_type=post&posts_per_page=1' );
449
+ if ( have_posts() ) {
450
+ the_post();
451
+ }
452
+ }
453
+ }
454
+
455
+ require_once( AIOSEOP_PLUGIN_DIR . 'aioseop-init.php' );
456
+
457
+ if ( ! function_exists( 'aioseop_install' ) ) {
458
+ register_activation_hook( __FILE__, 'aioseop_install' );
459
+
460
+ function aioseop_install() {
461
+ aioseop_activate();
462
+ }
463
+ }
464
+
465
+ if ( ! function_exists( 'disable_all_in_one_free' ) ) {
466
+ function disable_all_in_one_free() {
467
+ if ( AIOSEOPPRO && is_plugin_active( 'all-in-one-seo-pack/all_in_one_seo_pack.php' ) ) {
468
+ deactivate_plugins( 'all-in-one-seo-pack/all_in_one_seo_pack.php' );
469
+ }
470
+ }
471
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
css/modules/aioseop_module.css CHANGED
@@ -501,7 +501,7 @@ div.aioseop_feature {
501
  -moz-transition-duration: .4s;
502
  }
503
 
504
- .aioseop_feature .flag {
505
  float: right;
506
  margin-right: -7px;
507
  background: none repeat scroll 0 0 #D23D46;
@@ -510,41 +510,27 @@ div.aioseop_feature {
510
  position: relative;
511
  }
512
 
513
- .aioseop_feature .flag:before {
514
  border-color: #D23D46 #D23D46 #D23D46 transparent;
515
- border-style: solid;
516
- border-width: 14px 4px 15px 10px;
517
- content: "";
518
- left: -14px;
519
- position: absolute;
520
- top: 0;
521
  }
522
 
523
- .aioseop_feature .flag:after {
524
  border-color: #892026 transparent transparent;
525
- border-style: solid;
526
- border-width: 6px 6px 6px 0;
527
- bottom: -12px;
528
- content: "";
529
- position: absolute;
530
- right: 0;
531
  }
532
 
533
- .aioseop_feature .flag.pro {
534
- display: none;
535
- }
536
-
537
- #aioseop_coming_soon .free.flag,
538
- .all-in-one-seo_page_all-in-one-seo-pack-pro-modules-aioseop_feature_manager .aioseop_feature .free.flag {
539
- display: none;
540
- }
541
-
542
- #aioseop_coming_soon .flag.pro {
543
- display: block;
544
- margin-top: -30px;
545
- }
546
-
547
- .all-in-one-seo_page_all-in-one-seo-pack-pro-modules-aioseop_feature_manager #aioseop_coming_soon .flag.pro {
548
  display: none;
549
  }
550
 
501
  -moz-transition-duration: .4s;
502
  }
503
 
504
+ .aioseop_feature #free-flag {
505
  float: right;
506
  margin-right: -7px;
507
  background: none repeat scroll 0 0 #D23D46;
510
  position: relative;
511
  }
512
 
513
+ .aioseop_feature #free-flag:before {
514
  border-color: #D23D46 #D23D46 #D23D46 transparent;
515
+ border-style: solid;
516
+ border-width: 14px 4px 15px 10px;
517
+ content: "";
518
+ left: -14px;
519
+ position: absolute;
520
+ top: 0;
521
  }
522
 
523
+ .aioseop_feature #free-flag:after {
524
  border-color: #892026 transparent transparent;
525
+ border-style: solid;
526
+ border-width: 6px 6px 6px 0;
527
+ bottom: -12px;
528
+ content: "";
529
+ position: absolute;
530
+ right: 0;
531
  }
532
 
533
+ #aioseop_coming_soon #free-flag {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
534
  display: none;
535
  }
536
 
css/welcome.css DELETED
@@ -1,129 +0,0 @@
1
- h2.nav-tab-wrapper {
2
- margin:22px 0 0 0;
3
- }
4
-
5
- #sections {
6
- padding:22px;
7
- background: #fff;
8
- border:1px solid #ccc;
9
- border-top:0px;
10
- }
11
-
12
- section {
13
- display:none;
14
- }
15
-
16
- section:first-child {
17
- display:block;
18
- }
19
-
20
-
21
- .no-js h2.nav-tab-wrapper {
22
- display:none;
23
- }
24
-
25
- .no-js #sections {
26
- border-top:1px solid #ccc;
27
- margin-top:22px;
28
- }
29
-
30
- .no-js section {
31
- border-top: 1px dashed #aaa;
32
- margin-top:22px;
33
- padding-top:22px;
34
- }
35
-
36
- .no-js section:first-child {
37
- margin:0px;
38
- padding:0px;
39
- border:0px;
40
- }
41
-
42
- .nav-tab-active {
43
- background-color:white;
44
- }
45
-
46
-
47
-
48
- /* Welcome Panel */
49
-
50
- .welcome-panel-close {
51
- display: none;
52
- }
53
- .welcome-panel-close {
54
- z-index: 2;
55
- }
56
- .welcome-panel .welcome-widgets-menus:before,
57
- .welcome-panel .welcome-comments:before,
58
- .welcome-panel .welcome-learn-more:before{
59
- content: '';
60
- }
61
- .welcome-panel .welcome-widgets-menus {
62
- background: url(/path/to/icon) 0 50% no-repeat;
63
- }
64
- .welcome-panel .welcome-comments {
65
- background: url(/path/to/icon) 0 50% no-repeat;
66
- }
67
- .welcome-panel .welcome-learn-more {
68
- background: url(/path/to/icon) 0 50% no-repeat;
69
- }
70
-
71
-
72
- /*
73
- * Welcome Panel
74
- */
75
- #welcome-panel > p {
76
- margin-left: 15px;
77
- }
78
-
79
- .welcome-panel-column {
80
- width: 30%;
81
- margin-right: 3%;
82
- display: inline-block;
83
- vertical-align: top;
84
- }
85
-
86
- .welcome-panel-column:last-child {
87
- margin-right: 0;
88
- }
89
-
90
- .welcome-panel-column p.aioseop-message {
91
- width: 70%;
92
- display: inline-block;
93
- vertical-align: top;
94
- }
95
-
96
- .welcome-panel-column p.call-to-action {
97
- display: inline-block;
98
- width: 25%;
99
- vertical-align: top;
100
- margin-left: 3%;
101
- margin-top: 13px;
102
- }
103
-
104
- .welcome-panel-column p.call-to-action .button-orange {
105
- background: #d54e21;
106
- border-color: #d54e21;
107
- -webkit-box-shadow: 0 1px 0 #d54e21;
108
- box-shadow: 0 1px 0 #d54e21;
109
- color: #fff;
110
- text-decoration: none;
111
- text-shadow: 0 -1px 1px #d54e21,1px 0 1px #d54e21,0 1px 1px #d54e21,-1px 0 1px #d54e21;
112
- }
113
-
114
- .welcome-panel-column ul {
115
- margin-left: 20px;
116
- }
117
-
118
- .welcome-panel-column ul li {
119
- margin-bottom: 12px;
120
- list-style-type: square;
121
- }
122
-
123
- @media screen and (max-width: 850px) {
124
- .welcome-panel-column {
125
- width: 100%;
126
- margin-right: 0;
127
- display: block;
128
- }
129
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
i18n/all-in-one-seo-pack-ar.mo CHANGED
File without changes
i18n/all-in-one-seo-pack-ary.mo CHANGED
File without changes
i18n/all-in-one-seo-pack-bg_BG.mo CHANGED
File without changes
i18n/all-in-one-seo-pack-ca.mo CHANGED
File without changes
i18n/all-in-one-seo-pack-de_DE.mo CHANGED
File without changes
i18n/all-in-one-seo-pack-en_AU.mo CHANGED
File without changes
i18n/all-in-one-seo-pack-en_CA.mo CHANGED
File without changes
i18n/all-in-one-seo-pack-en_GB.mo CHANGED
File without changes
i18n/all-in-one-seo-pack-en_NZ.mo CHANGED
File without changes
i18n/all-in-one-seo-pack-fa_IR.mo CHANGED
File without changes
i18n/all-in-one-seo-pack-fi.mo CHANGED
File without changes
i18n/all-in-one-seo-pack-hi_IN.mo CHANGED
File without changes
i18n/all-in-one-seo-pack-hr.mo CHANGED
File without changes
i18n/all-in-one-seo-pack-hu_HU.mo CHANGED
File without changes
i18n/all-in-one-seo-pack-it_IT.mo CHANGED
File without changes
i18n/all-in-one-seo-pack-ko_KR.mo CHANGED
File without changes
i18n/all-in-one-seo-pack-nb_NO.mo CHANGED
File without changes
i18n/all-in-one-seo-pack-nl_NL.mo CHANGED
File without changes
i18n/all-in-one-seo-pack-nn_NO.mo CHANGED
File without changes
i18n/all-in-one-seo-pack-pl_PL.mo CHANGED
File without changes
i18n/all-in-one-seo-pack-pt_PT.mo CHANGED
File without changes
i18n/all-in-one-seo-pack-ro_RO.mo CHANGED
File without changes
i18n/all-in-one-seo-pack-ru_RU.mo CHANGED
File without changes
i18n/all-in-one-seo-pack-sl_SL.mo CHANGED
File without changes
i18n/all-in-one-seo-pack-sq.mo CHANGED
File without changes
i18n/all-in-one-seo-pack-tr_TR.mo CHANGED
File without changes
i18n/all-in-one-seo-pack-vi.mo CHANGED
File without changes
i18n/all-in-one-seo-pack-zh_CN.mo CHANGED
File without changes
inc/aioseop_functions.php CHANGED
@@ -3,7 +3,7 @@
3
  * General functions file.
4
  *
5
  * We'll eventually move these to a better place, and figure out ones not being used anymore.
6
- *
7
  * @package All-in-One-SEO-Pack
8
  */
9
 
@@ -974,6 +974,57 @@ if ( ! function_exists( 'aioseop_array_insert_after' ) ) {
974
  }
975
  }
976
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
977
  if ( ! function_exists( 'fnmatch' ) ) {
978
  /**
979
  * Support for fnmatch() doesn't exist on Windows pre PHP 5.3.
3
  * General functions file.
4
  *
5
  * We'll eventually move these to a better place, and figure out ones not being used anymore.
6
+ *
7
  * @package All-in-One-SEO-Pack
8
  */
9
 
974
  }
975
  }
976
 
977
+ if ( ! function_exists( 'aioseop_load_json_services' ) ) {
978
+ /**
979
+ * JSON support for PHP < 5.2.
980
+ *
981
+ * @TODO Do we really need to support < PHP 5.2 with the following functions??
982
+ * @return null|Services_JSON
983
+ */
984
+ function aioseop_load_json_services() {
985
+ static $services_json = null;
986
+ if ( $services_json ) {
987
+ return $services_json;
988
+ }
989
+ if ( ! class_exists( 'Services_JSON' ) ) {
990
+ require_once( 'inc/extlib/JSON.php' );
991
+ }
992
+ if ( ! $services_json ) {
993
+ $services_json = new Services_JSON();
994
+ }
995
+
996
+ return $services_json;
997
+ }
998
+ }
999
+
1000
+ if ( ! function_exists( 'json_encode' ) ) {
1001
+
1002
+ /**
1003
+ * @param $arg
1004
+ *
1005
+ * @return mixed
1006
+ */
1007
+ function json_encode( $arg ) {
1008
+ $services_json = aioseop_load_json_services();
1009
+
1010
+ return $services_json->encode( $arg );
1011
+ }
1012
+ }
1013
+
1014
+ if ( ! function_exists( 'json_decode' ) ) {
1015
+
1016
+ /**
1017
+ * @param $arg
1018
+ *
1019
+ * @return mixed
1020
+ */
1021
+ function json_decode( $arg ) {
1022
+ $services_json = aioseop_load_json_services();
1023
+
1024
+ return $services_json->decode( $arg );
1025
+ }
1026
+ }
1027
+
1028
  if ( ! function_exists( 'fnmatch' ) ) {
1029
  /**
1030
  * Support for fnmatch() doesn't exist on Windows pre PHP 5.3.
inc/aioseop_updates_class.php CHANGED
@@ -16,7 +16,6 @@ class AIOSEOP_Updates {
16
  *
17
  */
18
  function __construct() {
19
-
20
  }
21
 
22
  /**
@@ -55,12 +54,6 @@ class AIOSEOP_Updates {
55
  $aioseop_options['last_active_version'] = AIOSEOP_VERSION;
56
  $aiosp->update_class_option( $aioseop_options );
57
  }
58
-
59
- if( ! is_network_admin() || !isset( $_GET['activate-multi'] ) ) {
60
- set_transient( '_aioseop_activation_redirect', true, 30 ); // Sets 30 second transient for welcome screen redirect on activation.
61
- }
62
- add_action( 'admin_init', array( $this, 'aioseop_welcome' ) );
63
-
64
  }
65
 
66
  /**
@@ -70,15 +63,6 @@ class AIOSEOP_Updates {
70
  $this->do_feature_updates();
71
  }
72
 
73
- function aioseop_welcome(){
74
- if ( get_transient( '_aioseop_activation_redirect' ) ) {
75
- $aioseop_welcome = new aioseop_welcome();
76
- delete_transient( '_aioseop_activation_redirect' );
77
- $aioseop_welcome->init();
78
- }
79
-
80
- }
81
-
82
  /**
83
  * Updates version.
84
  *
16
  *
17
  */
18
  function __construct() {
 
19
  }
20
 
21
  /**
54
  $aioseop_options['last_active_version'] = AIOSEOP_VERSION;
55
  $aiosp->update_class_option( $aioseop_options );
56
  }
 
 
 
 
 
 
57
  }
58
 
59
  /**
63
  $this->do_feature_updates();
64
  }
65
 
 
 
 
 
 
 
 
 
 
66
  /**
67
  * Updates version.
68
  *
inc/extlib/JSON.php ADDED
@@ -0,0 +1,804 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
3
+
4
+ /**
5
+ * Converts to and from JSON format.
6
+ *
7
+ * JSON (JavaScript Object Notation) is a lightweight data-interchange
8
+ * format. It is easy for humans to read and write. It is easy for machines
9
+ * to parse and generate. It is based on a subset of the JavaScript
10
+ * Programming Language, Standard ECMA-262 3rd Edition - December 1999.
11
+ * This feature can also be found in Python. JSON is a text format that is
12
+ * completely language independent but uses conventions that are familiar
13
+ * to programmers of the C-family of languages, including C, C++, C#, Java,
14
+ * JavaScript, Perl, TCL, and many others. These properties make JSON an
15
+ * ideal data-interchange language.
16
+ *
17
+ * This package provides a simple encoder and decoder for JSON notation. It
18
+ * is intended for use with client-side Javascript applications that make
19
+ * use of HTTPRequest to perform server communication functions - data can
20
+ * be encoded into JSON notation for use in a client-side javascript, or
21
+ * decoded from incoming Javascript requests. JSON format is native to
22
+ * Javascript, and can be directly eval()'ed with no further parsing
23
+ * overhead
24
+ *
25
+ * All strings should be in ASCII or UTF-8 format!
26
+ *
27
+ * LICENSE: Redistribution and use in source and binary forms, with or
28
+ * without modification, are permitted provided that the following
29
+ * conditions are met: Redistributions of source code must retain the
30
+ * above copyright notice, this list of conditions and the following
31
+ * disclaimer. Redistributions in binary form must reproduce the above
32
+ * copyright notice, this list of conditions and the following disclaimer
33
+ * in the documentation and/or other materials provided with the
34
+ * distribution.
35
+ *
36
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
37
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
38
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
39
+ * NO EVENT SHALL CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
40
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
41
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
42
+ * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
43
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
44
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
45
+ * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
46
+ * DAMAGE.
47
+ *
48
+ * @category
49
+ * @package Services_JSON
50
+ * @author Michal Migurski <mike-json@teczno.com>
51
+ * @author Matt Knapp <mdknapp[at]gmail[dot]com>
52
+ * @author Brett Stimmerman <brettstimmerman[at]gmail[dot]com>
53
+ * @copyright 2005 Michal Migurski
54
+ * @version CVS: $Id: JSON.php,v 1.31 2006/06/28 05:54:17 migurski Exp $
55
+ * @license http://www.opensource.org/licenses/bsd-license.php
56
+ * @link http://pear.php.net/pepr/pepr-proposal-show.php?id=198
57
+ */
58
+
59
+ /**
60
+ * Marker constant for Services_JSON::decode(), used to flag stack state
61
+ */
62
+ define('SERVICES_JSON_SLICE', 1);
63
+
64
+ /**
65
+ * Marker constant for Services_JSON::decode(), used to flag stack state
66
+ */
67
+ define('SERVICES_JSON_IN_STR', 2);
68
+
69
+ /**
70
+ * Marker constant for Services_JSON::decode(), used to flag stack state
71
+ */
72
+ define('SERVICES_JSON_IN_ARR', 3);
73
+
74
+ /**
75
+ * Marker constant for Services_JSON::decode(), used to flag stack state
76
+ */
77
+ define('SERVICES_JSON_IN_OBJ', 4);
78
+
79
+ /**
80
+ * Marker constant for Services_JSON::decode(), used to flag stack state
81
+ */
82
+ define('SERVICES_JSON_IN_CMT', 5);
83
+
84
+ /**
85
+ * Behavior switch for Services_JSON::decode()
86
+ */
87
+ define('SERVICES_JSON_LOOSE_TYPE', 16);
88
+
89
+ /**
90
+ * Behavior switch for Services_JSON::decode()
91
+ */
92
+ define('SERVICES_JSON_SUPPRESS_ERRORS', 32);
93
+
94
+ /**
95
+ * Converts to and from JSON format.
96
+ *
97
+ * Brief example of use:
98
+ *
99
+ * <code>
100
+ * // create a new instance of Services_JSON
101
+ * $json = new Services_JSON();
102
+ *
103
+ * // convert a complexe value to JSON notation, and send it to the browser
104
+ * $value = array('foo', 'bar', array(1, 2, 'baz'), array(3, array(4)));
105
+ * $output = $json->encode($value);
106
+ *
107
+ * print($output);
108
+ * // prints: ["foo","bar",[1,2,"baz"],[3,[4]]]
109
+ *
110
+ * // accept incoming POST data, assumed to be in JSON notation
111
+ * $input = file_get_contents('php://input', 1000000);
112
+ * $value = $json->decode($input);
113
+ * </code>
114
+ */
115
+ class Services_JSON
116
+ {
117
+ /**
118
+ * constructs a new JSON instance
119
+ *
120
+ * @param int $use object behavior flags; combine with boolean-OR
121
+ *
122
+ * possible values:
123
+ * - SERVICES_JSON_LOOSE_TYPE: loose typing.
124
+ * "{...}" syntax creates associative arrays
125
+ * instead of objects in decode().
126
+ * - SERVICES_JSON_SUPPRESS_ERRORS: error suppression.
127
+ * Values which can't be encoded (e.g. resources)
128
+ * appear as NULL instead of throwing errors.
129
+ * By default, a deeply-nested resource will
130
+ * bubble up with an error, so all return values
131
+ * from encode() should be checked with isError()
132
+ */
133
+ function Services_JSON($use = 0)
134
+ {
135
+ $this->use = $use;
136
+ }
137
+
138
+ /**
139
+ * convert a string from one UTF-16 char to one UTF-8 char
140
+ *
141
+ * Normally should be handled by mb_convert_encoding, but
142
+ * provides a slower PHP-only method for installations
143
+ * that lack the multibye string extension.
144
+ *
145
+ * @param string $utf16 UTF-16 character
146
+ * @return string UTF-8 character
147
+ * @access private
148
+ */
149
+ function utf162utf8($utf16)
150
+ {
151
+ // oh please oh please oh please oh please oh please
152
+ if(function_exists('mb_convert_encoding')) {
153
+ return mb_convert_encoding($utf16, 'UTF-8', 'UTF-16');
154
+ }
155
+
156
+ $bytes = (ord($utf16{0}) << 8) | ord($utf16{1});
157
+
158
+ switch(true) {
159
+ case ((0x7F & $bytes) == $bytes):
160
+ // this case should never be reached, because we are in ASCII range
161
+ // see: http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
162
+ return chr(0x7F & $bytes);
163
+
164
+ case (0x07FF & $bytes) == $bytes:
165
+ // return a 2-byte UTF-8 character
166
+ // see: http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
167
+ return chr(0xC0 | (($bytes >> 6) & 0x1F))
168
+ . chr(0x80 | ($bytes & 0x3F));
169
+
170
+ case (0xFFFF & $bytes) == $bytes:
171
+ // return a 3-byte UTF-8 character
172
+ // see: http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
173
+ return chr(0xE0 | (($bytes >> 12) & 0x0F))
174
+ . chr(0x80 | (($bytes >> 6) & 0x3F))
175
+ . chr(0x80 | ($bytes & 0x3F));
176
+ }
177
+
178
+ // ignoring UTF-32 for now, sorry
179
+ return '';
180
+ }
181
+
182
+ /**
183
+ * convert a string from one UTF-8 char to one UTF-16 char
184
+ *
185
+ * Normally should be handled by mb_convert_encoding, but
186
+ * provides a slower PHP-only method for installations
187
+ * that lack the multibye string extension.
188
+ *
189
+ * @param string $utf8 UTF-8 character
190
+ * @return string UTF-16 character
191
+ * @access private
192
+ */
193
+ function utf82utf16($utf8)
194
+ {
195
+ // oh please oh please oh please oh please oh please
196
+ if(function_exists('mb_convert_encoding')) {
197
+ return mb_convert_encoding($utf8, 'UTF-16', 'UTF-8');
198
+ }
199
+
200
+ switch(strlen($utf8)) {
201
+ case 1:
202
+ // this case should never be reached, because we are in ASCII range
203
+ // see: http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
204
+ return $utf8;
205
+
206
+ case 2:
207
+ // return a UTF-16 character from a 2-byte UTF-8 char
208
+ // see: http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
209
+ return chr(0x07 & (ord($utf8{0}) >> 2))
210
+ . chr((0xC0 & (ord($utf8{0}) << 6))
211
+ | (0x3F & ord($utf8{1})));
212
+
213
+ case 3:
214
+ // return a UTF-16 character from a 3-byte UTF-8 char
215
+ // see: http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
216
+ return chr((0xF0 & (ord($utf8{0}) << 4))
217
+ | (0x0F & (ord($utf8{1}) >> 2)))
218
+ . chr((0xC0 & (ord($utf8{1}) << 6))
219
+ | (0x7F & ord($utf8{2})));
220
+ }
221
+
222
+ // ignoring UTF-32 for now, sorry
223
+ return '';
224
+ }
225
+
226
+ /**
227
+ * encodes an arbitrary variable into JSON format
228
+ *
229
+ * @param mixed $var any number, boolean, string, array, or object to be encoded.
230
+ * see argument 1 to Services_JSON() above for array-parsing behavior.
231
+ * if var is a strng, note that encode() always expects it
232
+ * to be in ASCII or UTF-8 format!
233
+ *
234
+ * @return mixed JSON string representation of input var or an error if a problem occurs
235
+ * @access public
236
+ */
237
+ function encode($var)
238
+ {
239
+ switch (gettype($var)) {
240
+ case 'boolean':
241
+ return $var ? 'true' : 'false';
242
+
243
+ case 'NULL':
244
+ return 'null';
245
+
246
+ case 'integer':
247
+ return (int) $var;
248
+
249
+ case 'double':
250
+ case 'float':
251
+ return (float) $var;
252
+
253
+ case 'string':
254
+ // STRINGS ARE EXPECTED TO BE IN ASCII OR UTF-8 FORMAT
255
+ $ascii = '';
256
+ $strlen_var = strlen($var);
257
+
258
+ /*
259
+ * Iterate over every character in the string,
260
+ * escaping with a slash or encoding to UTF-8 where necessary
261
+ */
262
+ for ($c = 0; $c < $strlen_var; ++$c) {
263
+
264
+ $ord_var_c = ord($var{$c});
265
+
266
+ switch (true) {
267
+ case $ord_var_c == 0x08:
268
+ $ascii .= '\b';
269
+ break;
270
+ case $ord_var_c == 0x09:
271
+ $ascii .= '\t';
272
+ break;
273
+ case $ord_var_c == 0x0A:
274
+ $ascii .= '\n';
275
+ break;
276
+ case $ord_var_c == 0x0C:
277
+ $ascii .= '\f';
278
+ break;
279
+ case $ord_var_c == 0x0D:
280
+ $ascii .= '\r';
281
+ break;
282
+
283
+ case $ord_var_c == 0x22:
284
+ case $ord_var_c == 0x2F:
285
+ case $ord_var_c == 0x5C:
286
+ // double quote, slash, slosh
287
+ $ascii .= '\\'.$var{$c};
288
+ break;
289
+
290
+ case (($ord_var_c >= 0x20) && ($ord_var_c <= 0x7F)):
291
+ // characters U-00000000 - U-0000007F (same as ASCII)
292
+ $ascii .= $var{$c};
293
+ break;
294
+
295
+ case (($ord_var_c & 0xE0) == 0xC0):
296
+ // characters U-00000080 - U-000007FF, mask 110XXXXX
297
+ // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
298
+ $char = pack('C*', $ord_var_c, ord($var{$c + 1}));
299
+ $c += 1;
300
+ $utf16 = $this->utf82utf16($char);
301
+ $ascii .= sprintf('\u%04s', bin2hex($utf16));
302
+ break;
303
+
304
+ case (($ord_var_c & 0xF0) == 0xE0):
305
+ // characters U-00000800 - U-0000FFFF, mask 1110XXXX
306
+ // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
307
+ $char = pack('C*', $ord_var_c,
308
+ ord($var{$c + 1}),
309
+ ord($var{$c + 2}));
310
+ $c += 2;
311
+ $utf16 = $this->utf82utf16($char);
312
+ $ascii .= sprintf('\u%04s', bin2hex($utf16));
313
+ break;
314
+
315
+ case (($ord_var_c & 0xF8) == 0xF0):
316
+ // characters U-00010000 - U-001FFFFF, mask 11110XXX
317
+ // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
318
+ $char = pack('C*', $ord_var_c,
319
+ ord($var{$c + 1}),
320
+ ord($var{$c + 2}),
321
+ ord($var{$c + 3}));
322
+ $c += 3;
323
+ $utf16 = $this->utf82utf16($char);
324
+ $ascii .= sprintf('\u%04s', bin2hex($utf16));
325
+ break;
326
+
327
+ case (($ord_var_c & 0xFC) == 0xF8):
328
+ // characters U-00200000 - U-03FFFFFF, mask 111110XX
329
+ // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
330
+ $char = pack('C*', $ord_var_c,
331
+ ord($var{$c + 1}),
332
+ ord($var{$c + 2}),
333
+ ord($var{$c + 3}),
334
+ ord($var{$c + 4}));
335
+ $c += 4;
336
+ $utf16 = $this->utf82utf16($char);
337
+ $ascii .= sprintf('\u%04s', bin2hex($utf16));
338
+ break;
339
+
340
+ case (($ord_var_c & 0xFE) == 0xFC):
341
+ // characters U-04000000 - U-7FFFFFFF, mask 1111110X
342
+ // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
343
+ $char = pack('C*', $ord_var_c,
344
+ ord($var{$c + 1}),
345
+ ord($var{$c + 2}),
346
+ ord($var{$c + 3}),
347
+ ord($var{$c + 4}),
348
+ ord($var{$c + 5}));
349
+ $c += 5;
350
+ $utf16 = $this->utf82utf16($char);
351
+ $ascii .= sprintf('\u%04s', bin2hex($utf16));
352
+ break;
353
+ }
354
+ }
355
+
356
+ return '"'.$ascii.'"';
357
+
358
+ case 'array':
359
+ /*
360
+ * As per JSON spec if any array key is not an integer
361
+ * we must treat the the whole array as an object. We
362
+ * also try to catch a sparsely populated associative
363
+ * array with numeric keys here because some JS engines
364
+ * will create an array with empty indexes up to
365
+ * max_index which can cause memory issues and because
366
+ * the keys, which may be relevant, will be remapped
367
+ * otherwise.
368
+ *
369
+ * As per the ECMA and JSON specification an object may
370
+ * have any string as a property. Unfortunately due to
371
+ * a hole in the ECMA specification if the key is a
372
+ * ECMA reserved word or starts with a digit the
373
+ * parameter is only accessible using ECMAScript's
374
+ * bracket notation.
375
+ */
376
+
377
+ // treat as a JSON object
378
+ if (is_array($var) && count($var) && (array_keys($var) !== range(0, sizeof($var) - 1))) {
379
+ $properties = array_map(array($this, 'name_value'),
380
+ array_keys($var),
381
+ array_values($var));
382
+
383
+ foreach($properties as $property) {
384
+ if(Services_JSON::isError($property)) {
385
+ return $property;
386
+ }
387
+ }
388
+
389
+ return '{' . join(',', $properties) . '}';
390
+ }
391
+
392
+ // treat it like a regular array
393
+ $elements = array_map(array($this, 'encode'), $var);
394
+
395
+ foreach($elements as $element) {
396
+ if(Services_JSON::isError($element)) {
397
+ return $element;
398
+ }
399
+ }
400
+
401
+ return '[' . join(',', $elements) . ']';
402
+
403
+ case 'object':
404
+ $vars = get_object_vars($var);
405
+
406
+ $properties = array_map(array($this, 'name_value'),
407
+ array_keys($vars),
408
+ array_values($vars));
409
+
410
+ foreach($properties as $property) {
411
+ if(Services_JSON::isError($property)) {
412
+ return $property;
413
+ }
414
+ }
415
+
416
+ return '{' . join(',', $properties) . '}';
417
+
418
+ default:
419
+ return ($this->use & SERVICES_JSON_SUPPRESS_ERRORS)
420
+ ? 'null'
421
+ : new Services_JSON_Error(gettype($var)." can not be encoded as JSON string");
422
+ }
423
+ }
424
+
425
+ /**
426
+ * array-walking function for use in generating JSON-formatted name-value pairs
427
+ *
428
+ * @param string $name name of key to use
429
+ * @param mixed $value reference to an array element to be encoded
430
+ *
431
+ * @return string JSON-formatted name-value pair, like '"name":value'
432
+ * @access private
433
+ */
434
+ function name_value($name, $value)
435
+ {
436
+ $encoded_value = $this->encode($value);
437
+
438
+ if(Services_JSON::isError($encoded_value)) {
439
+ return $encoded_value;
440
+ }
441
+
442
+ return $this->encode(strval($name)) . ':' . $encoded_value;
443
+ }
444
+
445
+ /**
446
+ * reduce a string by removing leading and trailing comments and whitespace
447
+ *
448
+ * @param $str string string value to strip of comments and whitespace
449
+ *
450
+ * @return string string value stripped of comments and whitespace
451
+ * @access private
452
+ */
453
+ function reduce_string($str)
454
+ {
455
+ $str = preg_replace(array(
456
+
457
+ // eliminate single line comments in '// ...' form
458
+ '#^\s*//(.+)$#m',
459
+
460
+ // eliminate multi-line comments in '/* ... */' form, at start of string
461
+ '#^\s*/\*(.+)\*/#Us',
462
+
463
+ // eliminate multi-line comments in '/* ... */' form, at end of string
464
+ '#/\*(.+)\*/\s*$#Us'
465
+
466
+ ), '', $str);
467
+
468
+ // eliminate extraneous space
469
+ return trim($str);
470
+ }
471
+
472
+ /**
473
+ * decodes a JSON string into appropriate variable
474
+ *
475
+ * @param string $str JSON-formatted string
476
+ *
477
+ * @return mixed number, boolean, string, array, or object
478
+ * corresponding to given JSON input string.
479
+ * See argument 1 to Services_JSON() above for object-output behavior.
480
+ * Note that decode() always returns strings
481
+ * in ASCII or UTF-8 format!
482
+ * @access public
483
+ */
484
+ function decode($str)
485
+ {
486
+ $str = $this->reduce_string($str);
487
+
488
+ switch (strtolower($str)) {
489
+ case 'true':
490
+ return true;
491
+
492
+ case 'false':
493
+ return false;
494
+
495
+ case 'null':
496
+ return null;
497
+
498
+ default:
499
+ $m = array();
500
+
501
+ if (is_numeric($str)) {
502
+ // Lookie-loo, it's a number
503
+
504
+ // This would work on its own, but I'm trying to be
505
+ // good about returning integers where appropriate:
506
+ // return (float)$str;
507
+
508
+ // Return float or int, as appropriate
509
+ return ((float)$str == (integer)$str)
510
+ ? (integer)$str
511
+ : (float)$str;
512
+
513
+ } elseif (preg_match('/^("|\').*(\1)$/s', $str, $m) && $m[1] == $m[2]) {
514
+ // STRINGS RETURNED IN UTF-8 FORMAT
515
+ $delim = substr($str, 0, 1);
516
+ $chrs = substr($str, 1, -1);
517
+ $utf8 = '';
518
+ $strlen_chrs = strlen($chrs);
519
+
520
+ for ($c = 0; $c < $strlen_chrs; ++$c) {
521
+
522
+ $substr_chrs_c_2 = substr($chrs, $c, 2);
523
+ $ord_chrs_c = ord($chrs{$c});
524
+
525
+ switch (true) {
526
+ case $substr_chrs_c_2 == '\b':
527
+ $utf8 .= chr(0x08);
528
+ ++$c;
529
+ break;
530
+ case $substr_chrs_c_2 == '\t':
531
+ $utf8 .= chr(0x09);
532
+ ++$c;
533
+ break;
534
+ case $substr_chrs_c_2 == '\n':
535
+ $utf8 .= chr(0x0A);
536
+ ++$c;
537
+ break;
538
+ case $substr_chrs_c_2 == '\f':
539
+ $utf8 .= chr(0x0C);
540
+ ++$c;
541
+ break;
542
+ case $substr_chrs_c_2 == '\r':
543
+ $utf8 .= chr(0x0D);
544
+ ++$c;
545
+ break;
546
+
547
+ case $substr_chrs_c_2 == '\\"':
548
+ case $substr_chrs_c_2 == '\\\'':
549
+ case $substr_chrs_c_2 == '\\\\':
550
+ case $substr_chrs_c_2 == '\\/':
551
+ if (($delim == '"' && $substr_chrs_c_2 != '\\\'') ||
552
+ ($delim == "'" && $substr_chrs_c_2 != '\\"')) {
553
+ $utf8 .= $chrs{++$c};
554
+ }
555
+ break;
556
+
557
+ case preg_match('/\\\u[0-9A-F]{4}/i', substr($chrs, $c, 6)):
558
+ // single, escaped unicode character
559
+ $utf16 = chr(hexdec(substr($chrs, ($c + 2), 2)))
560
+ . chr(hexdec(substr($chrs, ($c + 4), 2)));
561
+ $utf8 .= $this->utf162utf8($utf16);
562
+ $c += 5;
563
+ break;
564
+
565
+ case ($ord_chrs_c >= 0x20) && ($ord_chrs_c <= 0x7F):
566
+ $utf8 .= $chrs{$c};
567
+ break;
568
+
569
+ case ($ord_chrs_c & 0xE0) == 0xC0:
570
+ // characters U-00000080 - U-000007FF, mask 110XXXXX
571
+ //see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
572
+ $utf8 .= substr($chrs, $c, 2);
573
+ ++$c;
574
+ break;
575
+
576
+ case ($ord_chrs_c & 0xF0) == 0xE0:
577
+ // characters U-00000800 - U-0000FFFF, mask 1110XXXX
578
+ // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
579
+ $utf8 .= substr($chrs, $c, 3);
580
+ $c += 2;
581
+ break;
582
+
583
+ case ($ord_chrs_c & 0xF8) == 0xF0:
584
+ // characters U-00010000 - U-001FFFFF, mask 11110XXX
585
+ // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
586
+ $utf8 .= substr($chrs, $c, 4);
587
+ $c += 3;
588
+ break;
589
+
590
+ case ($ord_chrs_c & 0xFC) == 0xF8:
591
+ // characters U-00200000 - U-03FFFFFF, mask 111110XX
592
+ // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
593
+ $utf8 .= substr($chrs, $c, 5);
594
+ $c += 4;
595
+ break;
596
+
597
+ case ($ord_chrs_c & 0xFE) == 0xFC:
598
+ // characters U-04000000 - U-7FFFFFFF, mask 1111110X
599
+ // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
600
+ $utf8 .= substr($chrs, $c, 6);
601
+ $c += 5;
602
+ break;
603
+
604
+ }
605
+
606
+ }
607
+
608
+ return $utf8;
609
+
610
+ } elseif (preg_match('/^\[.*\]$/s', $str) || preg_match('/^\{.*\}$/s', $str)) {
611
+ // array, or object notation
612
+
613
+ if ($str{0} == '[') {
614
+ $stk = array(SERVICES_JSON_IN_ARR);
615
+ $arr = array();
616
+ } else {
617
+ if ($this->use & SERVICES_JSON_LOOSE_TYPE) {
618
+ $stk = array(SERVICES_JSON_IN_OBJ);
619
+ $obj = array();
620
+ } else {
621
+ $stk = array(SERVICES_JSON_IN_OBJ);
622
+ $obj = new stdClass();
623
+ }
624
+ }
625
+
626
+ array_push($stk, array('what' => SERVICES_JSON_SLICE,
627
+ 'where' => 0,
628
+ 'delim' => false));
629
+
630
+ $chrs = substr($str, 1, -1);
631
+ $chrs = $this->reduce_string($chrs);
632
+
633
+ if ($chrs == '') {
634
+ if (reset($stk) == SERVICES_JSON_IN_ARR) {
635
+ return $arr;
636
+
637
+ } else {
638
+ return $obj;
639
+
640
+ }
641
+ }
642
+
643
+ //print("\nparsing {$chrs}\n");
644
+
645
+ $strlen_chrs = strlen($chrs);
646
+
647
+ for ($c = 0; $c <= $strlen_chrs; ++$c) {
648
+
649
+ $top = end($stk);
650
+ $substr_chrs_c_2 = substr($chrs, $c, 2);
651
+
652
+ if (($c == $strlen_chrs) || (($chrs{$c} == ',') && ($top['what'] == SERVICES_JSON_SLICE))) {
653
+ // found a comma that is not inside a string, array, etc.,
654
+ // OR we've reached the end of the character list
655
+ $slice = substr($chrs, $top['where'], ($c - $top['where']));
656
+ array_push($stk, array('what' => SERVICES_JSON_SLICE, 'where' => ($c + 1), 'delim' => false));
657
+ //print("Found split at {$c}: ".substr($chrs, $top['where'], (1 + $c - $top['where']))."\n");
658
+
659
+ if (reset($stk) == SERVICES_JSON_IN_ARR) {
660
+ // we are in an array, so just push an element onto the stack
661
+ array_push($arr, $this->decode($slice));
662
+
663
+ } elseif (reset($stk) == SERVICES_JSON_IN_OBJ) {
664
+ // we are in an object, so figure
665
+ // out the property name and set an
666
+ // element in an associative array,
667
+ // for now
668
+ $parts = array();
669
+
670
+ if (preg_match('/^\s*(["\'].*[^\\\]["\'])\s*:\s*(\S.*),?$/Uis', $slice, $parts)) {
671
+ // "name":value pair
672
+ $key = $this->decode($parts[1]);
673
+ $val = $this->decode($parts[2]);
674
+
675
+ if ($this->use & SERVICES_JSON_LOOSE_TYPE) {
676
+ $obj[$key] = $val;
677
+ } else {
678
+ $obj->$key = $val;
679
+ }
680
+ } elseif (preg_match('/^\s*(\w+)\s*:\s*(\S.*),?$/Uis', $slice, $parts)) {
681
+ // name:value pair, where name is unquoted
682
+ $key = $parts[1];
683
+ $val = $this->decode($parts[2]);
684
+
685
+ if ($this->use & SERVICES_JSON_LOOSE_TYPE) {
686
+ $obj[$key] = $val;
687
+ } else {
688
+ $obj->$key = $val;
689
+ }
690
+ }
691
+
692
+ }
693
+
694
+ } elseif ((($chrs{$c} == '"') || ($chrs{$c} == "'")) && ($top['what'] != SERVICES_JSON_IN_STR)) {
695
+ // found a quote, and we are not inside a string
696
+ array_push($stk, array('what' => SERVICES_JSON_IN_STR, 'where' => $c, 'delim' => $chrs{$c}));
697
+ //print("Found start of string at {$c}\n");
698
+
699
+ } elseif (($chrs{$c} == $top['delim']) &&
700
+ ($top['what'] == SERVICES_JSON_IN_STR) &&
701
+ ((strlen(substr($chrs, 0, $c)) - strlen(rtrim(substr($chrs, 0, $c), '\\'))) % 2 != 1)) {
702
+ // found a quote, we're in a string, and it's not escaped
703
+ // we know that it's not escaped becase there is _not_ an
704
+ // odd number of backslashes at the end of the string so far
705
+ array_pop($stk);
706
+ //print("Found end of string at {$c}: ".substr($chrs, $top['where'], (1 + 1 + $c - $top['where']))."\n");
707
+
708
+ } elseif (($chrs{$c} == '[') &&
709
+ in_array($top['what'], array(SERVICES_JSON_SLICE, SERVICES_JSON_IN_ARR, SERVICES_JSON_IN_OBJ))) {
710
+ // found a left-bracket, and we are in an array, object, or slice
711
+ array_push($stk, array('what' => SERVICES_JSON_IN_ARR, 'where' => $c, 'delim' => false));
712
+ //print("Found start of array at {$c}\n");
713
+
714
+ } elseif (($chrs{$c} == ']') && ($top['what'] == SERVICES_JSON_IN_ARR)) {
715
+ // found a right-bracket, and we're in an array
716
+ array_pop($stk);
717
+ //print("Found end of array at {$c}: ".substr($chrs, $top['where'], (1 + $c - $top['where']))."\n");
718
+
719
+ } elseif (($chrs{$c} == '{') &&
720
+ in_array($top['what'], array(SERVICES_JSON_SLICE, SERVICES_JSON_IN_ARR, SERVICES_JSON_IN_OBJ))) {
721
+ // found a left-brace, and we are in an array, object, or slice
722
+ array_push($stk, array('what' => SERVICES_JSON_IN_OBJ, 'where' => $c, 'delim' => false));
723
+ //print("Found start of object at {$c}\n");
724
+
725
+ } elseif (($chrs{$c} == '}') && ($top['what'] == SERVICES_JSON_IN_OBJ)) {
726
+ // found a right-brace, and we're in an object
727
+ array_pop($stk);
728
+ //print("Found end of object at {$c}: ".substr($chrs, $top['where'], (1 + $c - $top['where']))."\n");
729
+
730
+ } elseif (($substr_chrs_c_2 == '/*') &&
731
+ in_array($top['what'], array(SERVICES_JSON_SLICE, SERVICES_JSON_IN_ARR, SERVICES_JSON_IN_OBJ))) {
732
+ // found a comment start, and we are in an array, object, or slice
733
+ array_push($stk, array('what' => SERVICES_JSON_IN_CMT, 'where' => $c, 'delim' => false));
734
+ $c++;
735
+ //print("Found start of comment at {$c}\n");
736
+
737
+ } elseif (($substr_chrs_c_2 == '*/') && ($top['what'] == SERVICES_JSON_IN_CMT)) {
738
+ // found a comment end, and we're in one now
739
+ array_pop($stk);
740
+ $c++;
741
+
742
+ for ($i = $top['where']; $i <= $c; ++$i)
743
+ $chrs = substr_replace($chrs, ' ', $i, 1);
744
+
745
+ //print("Found end of comment at {$c}: ".substr($chrs, $top['where'], (1 + $c - $top['where']))."\n");
746
+
747
+ }
748
+
749
+ }
750
+
751
+ if (reset($stk) == SERVICES_JSON_IN_ARR) {
752
+ return $arr;
753
+
754
+ } elseif (reset($stk) == SERVICES_JSON_IN_OBJ) {
755
+ return $obj;
756
+
757
+ }
758
+
759
+ }
760
+ }
761
+ }
762
+
763
+ /**
764
+ * @todo Ultimately, this should just call PEAR::isError()
765
+ */
766
+ function isError($data, $code = null)
767
+ {
768
+ if (class_exists('pear')) {
769
+ return PEAR::isError($data, $code);
770
+ } elseif (is_object($data) && (get_class($data) == 'services_json_error' ||
771
+ is_subclass_of($data, 'services_json_error'))) {
772
+ return true;
773
+ }
774
+
775
+ return false;
776
+ }
777
+ }
778
+
779
+ if (class_exists('PEAR_Error')) {
780
+
781
+ class Services_JSON_Error extends PEAR_Error
782
+ {
783
+ function Services_JSON_Error($message = 'unknown error', $code = null,
784
+ $mode = null, $options = null, $userinfo = null)
785
+ {
786
+ parent::PEAR_Error($message, $code, $mode, $options, $userinfo);
787
+ }
788
+ }
789
+
790
+ } else {
791
+
792
+ /**
793
+ * @todo Ultimately, this class shall be descended from PEAR_Error
794
+ */
795
+ class Services_JSON_Error
796
+ {
797
+ function Services_JSON_Error($message = 'unknown error', $code = null,
798
+ $mode = null, $options = null, $userinfo = null)
799
+ {
800
+
801
+ }
802
+ }
803
+
804
+ }
js/welcome.js DELETED
@@ -1,32 +0,0 @@
1
- (function($) {
2
-
3
- $(document).on( 'click', '.nav-tab-wrapper a', function() {
4
- $('section').hide();
5
- $('section').eq($(this).index()).show();
6
-
7
-
8
- //alert($('section'));
9
- if($(this).attr('className') == 'nav-tab-active') {
10
- // $(this).removeClass('nav-tab-active');
11
- // $(this).addClass('nav-tab-active');
12
- }else{
13
- // $(this).addClass('nav-tab-active');
14
- // $(this).removeClass('nav-tab-active');
15
- }
16
- // $(this).addClass('nav-tab-active');
17
- // $(this).eq($(this).index()).removeClass('nav-tab-active');
18
- //$(this).removeClass('nav-tab-active');
19
- return false;
20
- })
21
-
22
- $("a.nav-tab").click(function() {
23
-
24
- $("a.nav-tab").removeClass('nav-tab-active');
25
- $(this).addClass('nav-tab-active');
26
-
27
- });
28
-
29
-
30
-
31
-
32
- })( jQuery );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
modules/aioseop_feature_manager.php CHANGED
@@ -185,7 +185,7 @@ if ( ! class_exists( 'All_in_One_SEO_Pack_Feature_Manager' ) ) {
185
  $args['attr'] .= " id='{$args['options']['id']}'";
186
  }
187
 
188
- return $buf . "<div {$args['attr']}><label for='{$args['name']}'><div class='free flag'>FREE</div><div class='pro flag'>PRO</div>{$name}{$img}{$desc}{$checkbox}</label></div>";
189
  }
190
  }
191
  }
185
  $args['attr'] .= " id='{$args['options']['id']}'";
186
  }
187
 
188
+ return $buf . "<div {$args['attr']}><label for='{$args['name']}'><div id='free-flag'>FREE</div>{$name}{$img}{$desc}{$checkbox}</label></div>";
189
  }
190
  }
191
  }
modules/aioseop_performance.php CHANGED
@@ -169,6 +169,11 @@ if ( ! class_exists( 'All_in_One_SEO_Pack_Performance' ) ) {
169
  if ( empty( $sql_mode ) ) {
170
  $sql_mode = __( 'Not set', 'all-in-one-seo-pack' );
171
  }
 
 
 
 
 
172
  if ( ini_get( 'allow_url_fopen' ) ) {
173
  $allow_url_fopen = __( 'On', 'all-in-one-seo-pack' );
174
  } else {
@@ -239,6 +244,7 @@ if ( ! class_exists( 'All_in_One_SEO_Pack_Performance' ) ) {
239
  __( 'MYSQL Version', 'all-in-one-seo-pack' ) => $sqlversion,
240
  __( 'SQL Mode', 'all-in-one-seo-pack' ) => $sql_mode,
241
  __( 'PHP Version', 'all-in-one-seo-pack' ) => PHP_VERSION,
 
242
  __( 'PHP Allow URL fopen', 'all-in-one-seo-pack' ) => $allow_url_fopen,
243
  __( 'PHP Memory Limit', 'all-in-one-seo-pack' ) => $memory_limit,
244
  __( 'PHP Max Upload Size', 'all-in-one-seo-pack' ) => $upload_max,
169
  if ( empty( $sql_mode ) ) {
170
  $sql_mode = __( 'Not set', 'all-in-one-seo-pack' );
171
  }
172
+ if ( ini_get( 'safe_mode' ) ) {
173
+ $safe_mode = __( 'On', 'all-in-one-seo-pack' );
174
+ } else {
175
+ $safe_mode = __( 'Off', 'all-in-one-seo-pack' );
176
+ }
177
  if ( ini_get( 'allow_url_fopen' ) ) {
178
  $allow_url_fopen = __( 'On', 'all-in-one-seo-pack' );
179
  } else {
244
  __( 'MYSQL Version', 'all-in-one-seo-pack' ) => $sqlversion,
245
  __( 'SQL Mode', 'all-in-one-seo-pack' ) => $sql_mode,
246
  __( 'PHP Version', 'all-in-one-seo-pack' ) => PHP_VERSION,
247
+ __( 'PHP Safe Mode', 'all-in-one-seo-pack' ) => $safe_mode,
248
  __( 'PHP Allow URL fopen', 'all-in-one-seo-pack' ) => $allow_url_fopen,
249
  __( 'PHP Memory Limit', 'all-in-one-seo-pack' ) => $memory_limit,
250
  __( 'PHP Max Upload Size', 'all-in-one-seo-pack' ) => $upload_max,
public/google-analytics.php DELETED
@@ -1,266 +0,0 @@
1
- <?php
2
-
3
- if ( ! class_exists( 'aioseop_google_analytics' ) ) {
4
-
5
- require_once( AIOSEOP_PLUGIN_DIR . 'admin/aioseop_module_class.php' ); // Include the module base class.
6
-
7
- class aioseop_google_analytics extends All_in_One_SEO_Pack_Module {
8
- // TODO Rather than extending the module base class, we should find a better way for the shared functions like moving them to our common functions class.
9
-
10
- private $aiosp_ga_use_universal_analytics = true;
11
-
12
- function __construct() {
13
-
14
- $this->filter_universal();
15
-
16
- $this->google_analytics();
17
-
18
- }
19
-
20
- function filter_universal() {
21
- $aiosp_ga_use_universal_analytics = $this->aiosp_ga_use_universal_analytics;
22
- $this->aiosp_ga_use_universal_analytics = apply_filters( 'aiosp_universal_analytics', $aiosp_ga_use_universal_analytics );
23
- }
24
-
25
- function google_analytics() {
26
- global $aioseop_options;
27
- $analytics = '';
28
- if ( ! empty( $aioseop_options['aiosp_ga_advanced_options'] ) && ! empty( $aioseop_options['aiosp_ga_exclude_users'] ) && is_user_logged_in() ) {
29
- global $current_user;
30
- if ( empty( $current_user ) ) {
31
- wp_get_current_user();
32
- }
33
- if ( ! empty( $current_user ) ) {
34
- $intersect = array_intersect( $aioseop_options['aiosp_ga_exclude_users'], $current_user->roles );
35
- if ( ! empty( $intersect ) ) {
36
- return;
37
- }
38
- }
39
- }
40
- if ( ! empty( $aioseop_options['aiosp_google_analytics_id'] ) ) {
41
- ob_start();
42
- $analytics = $this->universal_analytics();
43
- echo $analytics;
44
- if ( empty( $analytics ) ) {
45
- ?>
46
- <script type="text/javascript">
47
- var _gaq = _gaq || [];
48
- <?php if ( ! empty( $aioseop_options['aiosp_ga_advanced_options'] ) && ! empty( $aioseop_options['aiosp_ga_link_attribution'] ) ) {
49
- ?> var pluginUrl =
50
- '//www.google-analytics.com/plugins/ga/inpage_linkid.js';
51
- _gaq.push(['_require', 'inpage_linkid', pluginUrl]);
52
- <?php
53
- }
54
- ?> _gaq.push(['_setAccount', '<?php
55
- echo $aioseop_options['aiosp_google_analytics_id'];
56
- ?>']);
57
- <?php if ( ! empty( $aioseop_options['aiosp_ga_advanced_options'] ) && ! empty( $aioseop_options['aiosp_ga_anonymize_ip'] ) ) {
58
- ?> _gaq.push(['_gat._anonymizeIp']);
59
- <?php
60
- }
61
- ?>
62
- <?php if ( ! empty( $aioseop_options['aiosp_ga_advanced_options'] ) && ! empty( $aioseop_options['aiosp_ga_multi_domain'] ) ) {
63
- ?> _gaq.push(['_setAllowLinker', true]);
64
- <?php
65
- }
66
- ?>
67
- <?php if ( ! empty( $aioseop_options['aiosp_ga_advanced_options'] ) && ! empty( $aioseop_options['aiosp_ga_domain'] ) ) {
68
- $domain = $this->get_analytics_domain();
69
- ?> _gaq.push(['_setDomainName', '<?php echo $domain; ?>']);
70
- <?php
71
- }
72
- ?> _gaq.push(['_trackPageview']);
73
- (function () {
74
- var ga = document.createElement('script');
75
- ga.type = 'text/javascript';
76
- ga.async = true;
77
- <?php
78
- if ( ! empty( $aioseop_options['aiosp_ga_advanced_options'] ) && ! empty( $aioseop_options['aiosp_ga_display_advertising'] ) ) {
79
- ?> ga.src = ('https:' == document.location.protocol ? 'https://' : 'http://') + 'stats.g.doubleclick.net/dc.js';
80
- <?php
81
- } else {
82
- ?> ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
83
- <?php
84
- }
85
- ?> var s = document.getElementsByTagName('script')[0];
86
- s.parentNode.insertBefore(ga, s);
87
- })();
88
- </script>
89
- <?php
90
- }
91
- if ( ! empty( $aioseop_options['aiosp_ga_advanced_options'] ) && $aioseop_options['aiosp_ga_track_outbound_links'] ) { ?>
92
- <script type="text/javascript">
93
- function recordOutboundLink(link, category, action) {
94
- <?php if ( $this->aiosp_ga_use_universal_analytics ) { ?>
95
- ga('send', 'event', category, action);
96
- <?php }
97
- if ( ! $this->aiosp_ga_use_universal_analytics ) { ?>
98
- _gat._getTrackerByName()._trackEvent(category, action);
99
- <?php } ?>
100
- if (link.target == '_blank') return true;
101
- setTimeout('document.location = "' + link.href + '"', 100);
102
- return false;
103
- }
104
- /* use regular Javascript for this */
105
- function getAttr(ele, attr) {
106
- var result = (ele.getAttribute && ele.getAttribute(attr)) || null;
107
- if (!result) {
108
- var attrs = ele.attributes;
109
- var length = attrs.length;
110
- for (var i = 0; i < length; i++)
111
- if (attr[i].nodeName === attr) result = attr[i].nodeValue;
112
- }
113
- return result;
114
- }
115
-
116
- function aiosp_addLoadEvent(func) {
117
- var oldonload = window.onload;
118
- if (typeof window.onload != 'function') {
119
- window.onload = func;
120
- } else {
121
- window.onload = function () {
122
- if (oldonload) {
123
- oldonload();
124
- }
125
- func();
126
- }
127
- }
128
- }
129
-
130
- function aiosp_addEvent(element, evnt, funct) {
131
- if (element.attachEvent)
132
- return element.attachEvent('on' + evnt, funct);
133
- else
134
- return element.addEventListener(evnt, funct, false);
135
- }
136
-
137
- aiosp_addLoadEvent(function () {
138
- var links = document.getElementsByTagName('a');
139
- for (var x = 0; x < links.length; x++) {
140
- if (typeof links[x] == 'undefined') continue;
141
- aiosp_addEvent(links[x], 'onclick', function () {
142
- var mydomain = new RegExp(document.domain, 'i');
143
- href = getAttr(this, 'href');
144
- if (href && href.toLowerCase().indexOf('http') === 0 && !mydomain.test(href)) {
145
- recordOutboundLink(this, 'Outbound Links', href);
146
- }
147
- });
148
- }
149
- });
150
- </script>
151
- <?php
152
- }
153
- $analytics = ob_get_clean();
154
- }
155
- echo apply_filters( 'aiosp_google_analytics', $analytics );
156
- do_action( 'after_aiosp_google_analytics' );
157
-
158
- }
159
-
160
- function universal_analytics() {
161
- global $aioseop_options;
162
- $analytics = '';
163
- if ( $this->aiosp_ga_use_universal_analytics ) {
164
- $allow_linker = $cookie_domain = $domain = $addl_domains = $domain_list = '';
165
- if ( ! empty( $aioseop_options['aiosp_ga_advanced_options'] ) ) {
166
- $cookie_domain = $this->get_analytics_domain();
167
- }
168
- if ( ! empty( $cookie_domain ) ) {
169
- $cookie_domain = esc_js( $cookie_domain );
170
- $cookie_domain = "'cookieDomain': '{$cookie_domain}'";
171
- }
172
- if ( empty( $cookie_domain ) ) {
173
- $domain = ", 'auto'";
174
- }
175
- if ( ! empty( $aioseop_options['aiosp_ga_advanced_options'] ) && ! empty( $aioseop_options['aiosp_ga_multi_domain'] ) ) {
176
- $allow_linker = "'allowLinker': true";
177
- if ( ! empty( $aioseop_options['aiosp_ga_addl_domains'] ) ) {
178
- $addl_domains = trim( $aioseop_options['aiosp_ga_addl_domains'] );
179
- $addl_domains = preg_split( '/[\s,]+/', $addl_domains );
180
- if ( ! empty( $addl_domains ) ) {
181
- foreach ( $addl_domains as $d ) {
182
- $d = $this->sanitize_domain( $d );
183
- if ( ! empty( $d ) ) {
184
- if ( ! empty( $domain_list ) ) {
185
- $domain_list .= ', ';
186
- }
187
- $domain_list .= "'" . $d . "'";
188
- }
189
- }
190
- }
191
- }
192
- }
193
- $extra_options = '';
194
- if ( ! empty( $aioseop_options['aiosp_ga_advanced_options'] ) && ! empty( $aioseop_options['aiosp_ga_display_advertising'] ) ) {
195
- $extra_options .= "ga('require', 'displayfeatures');";
196
- }
197
- if ( ! empty( $aioseop_options['aiosp_ga_advanced_options'] ) && ! empty( $aioseop_options['aiosp_ga_enhanced_ecommerce'] ) ) {
198
- if ( ! empty( $extra_options ) ) {
199
- $extra_options .= "\n\t\t\t";
200
- }
201
- $extra_options .= "ga('require', 'ec');";
202
- }
203
- if ( ! empty( $domain_list ) ) {
204
- if ( ! empty( $extra_options ) ) {
205
- $extra_options .= "\n\t\t\t";
206
- }
207
- $extra_options .= "ga('require', 'linker');\n\t\t\tga('linker:autoLink', [{$domain_list}] );";
208
- }
209
- if ( ! empty( $aioseop_options['aiosp_ga_advanced_options'] ) && ! empty( $aioseop_options['aiosp_ga_link_attribution'] ) ) {
210
- if ( ! empty( $extra_options ) ) {
211
- $extra_options .= "\n\t\t\t";
212
- }
213
- $extra_options .= "ga('require', 'linkid', 'linkid.js');";
214
- }
215
-
216
- if ( ! empty( $aioseop_options['aiosp_ga_advanced_options'] ) && ! empty( $aioseop_options['aiosp_ga_anonymize_ip'] ) ) {
217
- if ( ! empty( $extra_options ) ) {
218
- $extra_options .= "\n\t\t\t";
219
- }
220
- $extra_options .= "ga('set', 'anonymizeIp', true);";
221
- }
222
- $js_options = array();
223
- foreach ( array( 'cookie_domain', 'allow_linker' ) as $opts ) {
224
- if ( ! empty( $$opts ) ) {
225
- $js_options[] = $$opts;
226
- }
227
- }
228
- if ( ! empty( $js_options ) ) {
229
- $js_options = implode( ',', $js_options );
230
- $js_options = ', { ' . $js_options . ' } ';
231
- } else {
232
- $js_options = '';
233
- }
234
- $analytics_id = esc_js( $aioseop_options['aiosp_google_analytics_id'] );
235
- $analytics = <<<EOF
236
- <script>
237
- (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
238
- (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
239
- m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
240
- })(window,document,'script','//www.google-analytics.com/analytics.js','ga');
241
-
242
- ga('create', '{$analytics_id}'{$domain}{$js_options});
243
- {$extra_options}
244
- ga('send', 'pageview');
245
- </script>
246
-
247
- EOF;
248
- }
249
-
250
- return $analytics;
251
- }
252
-
253
- /**
254
- * @return mixed|string
255
- */
256
- function get_analytics_domain() {
257
- global $aioseop_options;
258
- if ( ! empty( $aioseop_options['aiosp_ga_domain'] ) ) {
259
- return $this->sanitize_domain( $aioseop_options['aiosp_ga_domain'] );
260
- }
261
-
262
- return '';
263
- }
264
-
265
- }
266
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
readme.txt CHANGED
@@ -2,9 +2,9 @@
2
  Contributors: hallsofmontezuma, wpsmort, dougal, pbaylies, arnaudbroes
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: seo, all in one seo, google, twitter, page, image seo, social, search engine optimization, sitemap, WordPress SEO, meta, meta description, xml sitemap, google sitemap, sitemaps, robots meta, yahoo, bing, news sitemaps, multisite, canonical, nofollow, noindex, keywords, description, webmaster tools, google webmaster tools, google analytics
5
- Requires at least: 4.0
6
  Tested up to: 4.6
7
- Stable tag: 2.3.9.2
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -37,7 +37,6 @@ First created in 2007, see why AIOSEO is the most downloaded plugin for WordPres
37
  * You can override any title and set any META description and any META keywords you want.
38
  * Compatibility with many other plugins
39
  * Translated into 57 languages
40
- * PHP 7 100% Compatible
41
 
42
  Follow me on Twitter to keep up with the latest updates [Michael
43
  Torbert](http://twitter.com/michaeltorbert/)
2
  Contributors: hallsofmontezuma, wpsmort, dougal, pbaylies, arnaudbroes
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: seo, all in one seo, google, twitter, page, image seo, social, search engine optimization, sitemap, WordPress SEO, meta, meta description, xml sitemap, google sitemap, sitemaps, robots meta, yahoo, bing, news sitemaps, multisite, canonical, nofollow, noindex, keywords, description, webmaster tools, google webmaster tools, google analytics
5
+ Requires at least: 3.4
6
  Tested up to: 4.6
7
+ Stable tag: 2.3.9.1
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
37
  * You can override any title and set any META description and any META keywords you want.
38
  * Compatibility with many other plugins
39
  * Translated into 57 languages
 
40
 
41
  Follow me on Twitter to keep up with the latest updates [Michael
42
  Torbert](http://twitter.com/michaeltorbert/)