Version Description
Download this release
Release Info
Developer | hallsofmontezuma |
Plugin | All in One SEO Pack |
Version | 2.3.10 |
Comparing to | |
See all releases |
Code changes from version 2.3.9 to 2.3.10
- admin/aioseop_module_class.php +23 -6
- admin/aioseop_module_manager.php +1 -1
- admin/display/credits-content.php +107 -0
- admin/display/dashboard_widget.php +91 -0
- admin/display/general-metaboxes.php +9 -9
- admin/display/postedit.php +3 -0
- admin/display/welcome-content.php +37 -0
- admin/display/welcome.php +112 -0
- aioseop_class.php +60 -363
- all_in_one_seo_pack.php +499 -471
- css/modules/aioseop_module.css +39 -27
- css/welcome.css +129 -0
- i18n/all-in-one-seo-pack-ar.mo +0 -0
- i18n/all-in-one-seo-pack-ary.mo +0 -0
- i18n/all-in-one-seo-pack-bg_BG.mo +0 -0
- i18n/all-in-one-seo-pack-ca.mo +0 -0
- i18n/all-in-one-seo-pack-de_DE.mo +0 -0
- i18n/all-in-one-seo-pack-en_AU.mo +0 -0
- i18n/all-in-one-seo-pack-en_CA.mo +0 -0
- i18n/all-in-one-seo-pack-en_GB.mo +0 -0
- i18n/all-in-one-seo-pack-en_NZ.mo +0 -0
- i18n/all-in-one-seo-pack-fa_IR.mo +0 -0
- i18n/all-in-one-seo-pack-fi.mo +0 -0
- i18n/all-in-one-seo-pack-hi_IN.mo +0 -0
- i18n/all-in-one-seo-pack-hr.mo +0 -0
- i18n/all-in-one-seo-pack-hu_HU.mo +0 -0
- i18n/all-in-one-seo-pack-it_IT.mo +0 -0
- i18n/all-in-one-seo-pack-ko_KR.mo +0 -0
- i18n/all-in-one-seo-pack-nb_NO.mo +0 -0
- i18n/all-in-one-seo-pack-nl_NL.mo +0 -0
- i18n/all-in-one-seo-pack-nn_NO.mo +0 -0
- i18n/all-in-one-seo-pack-pl_PL.mo +0 -0
- i18n/all-in-one-seo-pack-pt_PT.mo +0 -0
- i18n/all-in-one-seo-pack-ro_RO.mo +0 -0
- i18n/all-in-one-seo-pack-ru_RU.mo +0 -0
- i18n/all-in-one-seo-pack-sl_SL.mo +0 -0
- i18n/all-in-one-seo-pack-sq.mo +0 -0
- i18n/all-in-one-seo-pack-tr_TR.mo +0 -0
- i18n/all-in-one-seo-pack-vi.mo +0 -0
- i18n/all-in-one-seo-pack-zh_CN.mo +0 -0
- images/headwaybanner.png +0 -0
- inc/aioseop_functions.php +19 -77
- inc/aioseop_updates_class.php +16 -0
- inc/aiosp_calc_desc.php +3 -0
- inc/aiosp_calc_title.php +3 -0
- inc/aiosp_common.php +7 -0
- inc/extlib/JSON.php +0 -804
- inc/translations.php +4 -0
- js/welcome.js +32 -0
- modules/aioseop_feature_manager.php +1 -1
- modules/aioseop_importer_exporter.php +1 -4
- modules/aioseop_opengraph.php +2 -2
- modules/aioseop_performance.php +0 -6
- modules/aioseop_sitemap.php +39 -58
- public/google-analytics.php +266 -0
- readme.txt +7 -5
admin/aioseop_module_class.php
CHANGED
@@ -130,6 +130,7 @@ if ( ! class_exists( 'All_in_One_SEO_Pack_Module' ) ) {
|
|
130 |
|
131 |
/**
|
132 |
* Convenience function to see if an option is set.
|
|
|
133 |
*/
|
134 |
function option_isset( $option, $location = null ) {
|
135 |
$prefix = $this->get_prefix( $location );
|
@@ -235,6 +236,7 @@ if ( ! class_exists( 'All_in_One_SEO_Pack_Module' ) ) {
|
|
235 |
|
236 |
/**
|
237 |
* Wrapper for strpos() - uses mb_strpos() if possible.
|
|
|
238 |
*/
|
239 |
function strpos( $haystack, $needle, $offset = 0 ) {
|
240 |
if ( function_exists( 'mb_strpos' ) ) {
|
@@ -246,6 +248,7 @@ if ( ! class_exists( 'All_in_One_SEO_Pack_Module' ) ) {
|
|
246 |
|
247 |
/**
|
248 |
* Wrapper for strrpos() - uses mb_strrpos() if possible.
|
|
|
249 |
*/
|
250 |
function strrpos( $haystack, $needle, $offset = 0 ) {
|
251 |
if ( function_exists( 'mb_strrpos' ) ) {
|
@@ -287,6 +290,9 @@ if ( ! class_exists( 'All_in_One_SEO_Pack_Module' ) ) {
|
|
287 |
}
|
288 |
}
|
289 |
|
|
|
|
|
|
|
290 |
function domnode_to_array( $node ) {
|
291 |
switch ( $node->nodeType ) {
|
292 |
case XML_CDATA_SECTION_NODE:
|
@@ -533,7 +539,6 @@ if ( ! class_exists( 'All_in_One_SEO_Pack_Module' ) ) {
|
|
533 |
'Python-urllib',
|
534 |
'QueryN Metasearch',
|
535 |
'RepoMonkey',
|
536 |
-
'RMA',
|
537 |
'SemrushBot',
|
538 |
'SISTRIX',
|
539 |
'sitecheck.Internetseer.com',
|
@@ -930,6 +935,7 @@ if ( ! class_exists( 'All_in_One_SEO_Pack_Module' ) ) {
|
|
930 |
|
931 |
/**
|
932 |
* See if a file exists using WP Filesystem.
|
|
|
933 |
*/
|
934 |
function file_exists( $filename ) {
|
935 |
$wpfs = $this->get_filesystem_object();
|
@@ -1004,6 +1010,7 @@ if ( ! class_exists( 'All_in_One_SEO_Pack_Module' ) ) {
|
|
1004 |
|
1005 |
/**
|
1006 |
* Save a file through WP Filesystem.
|
|
|
1007 |
*/
|
1008 |
function save_file( $filename, $contents ) {
|
1009 |
$failed_str = __( sprintf( "Failed to write file %s!\n", $filename ), 'all-in-one-seo-pack' );
|
@@ -1027,6 +1034,7 @@ if ( ! class_exists( 'All_in_One_SEO_Pack_Module' ) ) {
|
|
1027 |
|
1028 |
/**
|
1029 |
* Delete a file through WP Filesystem.
|
|
|
1030 |
*/
|
1031 |
function delete_file( $filename ) {
|
1032 |
$wpfs = $this->get_filesystem_object();
|
@@ -1047,6 +1055,8 @@ if ( ! class_exists( 'All_in_One_SEO_Pack_Module' ) ) {
|
|
1047 |
|
1048 |
/**
|
1049 |
* Rename a file through WP Filesystem.
|
|
|
|
|
1050 |
*/
|
1051 |
function rename_file( $filename, $newname ) {
|
1052 |
$wpfs = $this->get_filesystem_object();
|
@@ -1307,7 +1317,8 @@ if ( ! class_exists( 'All_in_One_SEO_Pack_Module' ) ) {
|
|
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,7 +1342,9 @@ if ( ! class_exists( 'All_in_One_SEO_Pack_Module' ) ) {
|
|
1331 |
) );
|
1332 |
|
1333 |
if ( empty( $attachments ) && 'attachment' == get_post_type( $post->ID ) ) {
|
1334 |
-
$
|
|
|
|
|
1335 |
}
|
1336 |
|
1337 |
/* If no attachments or image is found, return false. */
|
@@ -1345,7 +1358,9 @@ if ( ! class_exists( 'All_in_One_SEO_Pack_Module' ) ) {
|
|
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 |
-
$
|
|
|
|
|
1349 |
$alt = trim( strip_tags( get_post_field( 'post_excerpt', $id ) ) );
|
1350 |
break;
|
1351 |
}
|
@@ -1442,8 +1457,10 @@ if ( ! class_exists( 'All_in_One_SEO_Pack_Module' ) ) {
|
|
1442 |
if ( empty( $screen ) ) {
|
1443 |
$bail = true;
|
1444 |
}
|
1445 |
-
if
|
1446 |
-
$
|
|
|
|
|
1447 |
}
|
1448 |
$prefix = $this->get_prefix();
|
1449 |
$bail = apply_filters( $prefix . 'bail_on_enqueue', $bail, $screen );
|
130 |
|
131 |
/**
|
132 |
* Convenience function to see if an option is set.
|
133 |
+
* @param string $option
|
134 |
*/
|
135 |
function option_isset( $option, $location = null ) {
|
136 |
$prefix = $this->get_prefix( $location );
|
236 |
|
237 |
/**
|
238 |
* Wrapper for strpos() - uses mb_strpos() if possible.
|
239 |
+
* @param string $needle
|
240 |
*/
|
241 |
function strpos( $haystack, $needle, $offset = 0 ) {
|
242 |
if ( function_exists( 'mb_strpos' ) ) {
|
248 |
|
249 |
/**
|
250 |
* Wrapper for strrpos() - uses mb_strrpos() if possible.
|
251 |
+
* @param string $needle
|
252 |
*/
|
253 |
function strrpos( $haystack, $needle, $offset = 0 ) {
|
254 |
if ( function_exists( 'mb_strrpos' ) ) {
|
290 |
}
|
291 |
}
|
292 |
|
293 |
+
/**
|
294 |
+
* @param DOMElement $node
|
295 |
+
*/
|
296 |
function domnode_to_array( $node ) {
|
297 |
switch ( $node->nodeType ) {
|
298 |
case XML_CDATA_SECTION_NODE:
|
539 |
'Python-urllib',
|
540 |
'QueryN Metasearch',
|
541 |
'RepoMonkey',
|
|
|
542 |
'SemrushBot',
|
543 |
'SISTRIX',
|
544 |
'sitecheck.Internetseer.com',
|
935 |
|
936 |
/**
|
937 |
* See if a file exists using WP Filesystem.
|
938 |
+
* @param string $filename
|
939 |
*/
|
940 |
function file_exists( $filename ) {
|
941 |
$wpfs = $this->get_filesystem_object();
|
1010 |
|
1011 |
/**
|
1012 |
* Save a file through WP Filesystem.
|
1013 |
+
* @param string $filename
|
1014 |
*/
|
1015 |
function save_file( $filename, $contents ) {
|
1016 |
$failed_str = __( sprintf( "Failed to write file %s!\n", $filename ), 'all-in-one-seo-pack' );
|
1034 |
|
1035 |
/**
|
1036 |
* Delete a file through WP Filesystem.
|
1037 |
+
* @param string $filename
|
1038 |
*/
|
1039 |
function delete_file( $filename ) {
|
1040 |
$wpfs = $this->get_filesystem_object();
|
1055 |
|
1056 |
/**
|
1057 |
* Rename a file through WP Filesystem.
|
1058 |
+
* @param string $filename
|
1059 |
+
* @param string $newname
|
1060 |
*/
|
1061 |
function rename_file( $filename, $newname ) {
|
1062 |
$wpfs = $this->get_filesystem_object();
|
1317 |
return false;
|
1318 |
}
|
1319 |
|
1320 |
+
$size = apply_filters( 'post_thumbnail_size', 'large' ); // Check if someone is using built-in WP filter.
|
1321 |
+
$size = apply_filters( 'aioseop_thumbnail_size', $size );
|
1322 |
$image = wp_get_attachment_image_src( $post_thumbnail_id, $size );
|
1323 |
|
1324 |
return $image[0];
|
1342 |
) );
|
1343 |
|
1344 |
if ( empty( $attachments ) && 'attachment' == get_post_type( $post->ID ) ) {
|
1345 |
+
$size = 'large';
|
1346 |
+
$size = apply_filters( 'aioseop_attachment_size', $size );
|
1347 |
+
$image = wp_get_attachment_image_src( $post->ID, $size );
|
1348 |
}
|
1349 |
|
1350 |
/* If no attachments or image is found, return false. */
|
1358 |
/* Loop through each attachment. Once the $order_of_image (default is '1') is reached, break the loop. */
|
1359 |
foreach ( $attachments as $id => $attachment ) {
|
1360 |
if ( ++ $i == 1 ) {
|
1361 |
+
$size = 'large';
|
1362 |
+
$size = apply_filters( 'aioseop_attachment_size', $size );
|
1363 |
+
$image = wp_get_attachment_image_src( $id, $size );
|
1364 |
$alt = trim( strip_tags( get_post_field( 'post_excerpt', $id ) ) );
|
1365 |
break;
|
1366 |
}
|
1457 |
if ( empty( $screen ) ) {
|
1458 |
$bail = true;
|
1459 |
}
|
1460 |
+
if( $bail != true ){
|
1461 |
+
if ( ( $screen->base != 'post' ) && ( $screen->base != 'term' ) && ( $screen->base != 'edit-tags' ) && ( $screen->base != 'toplevel_page_shopp-products' ) ) {
|
1462 |
+
$bail = true;
|
1463 |
+
}
|
1464 |
}
|
1465 |
$prefix = $this->get_prefix();
|
1466 |
$bail = apply_filters( $prefix . 'bail_on_enqueue', $bail, $screen );
|
admin/aioseop_module_manager.php
CHANGED
@@ -120,7 +120,7 @@ if ( ! class_exists( 'All_in_One_SEO_Pack_Module_Manager' ) ) {
|
|
120 |
$module_class = new $classname( $args );
|
121 |
$GLOBALS[ $ref ] = $module_class;
|
122 |
$this->modules[ $mod ] = $module_class;
|
123 |
-
if ( is_user_logged_in() &&
|
124 |
add_action( 'admin_bar_menu', array(
|
125 |
$module_class,
|
126 |
'add_admin_bar_submenu',
|
120 |
$module_class = new $classname( $args );
|
121 |
$GLOBALS[ $ref ] = $module_class;
|
122 |
$this->modules[ $mod ] = $module_class;
|
123 |
+
if ( is_user_logged_in() && is_admin_bar_showing() && current_user_can( 'aiosp_manage_seo' ) ) {
|
124 |
add_action( 'admin_bar_menu', array(
|
125 |
$module_class,
|
126 |
'add_admin_bar_submenu',
|
admin/display/credits-content.php
ADDED
@@ -0,0 +1,107 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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( _e( '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', 'all-in-one-seo-pack' ); ?></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', 'all-in-one-seo-pack' ); ?></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', 'all-in-one-seo-pack' ); ?></span>
|
35 |
+
</li>
|
36 |
+
</ul>
|
37 |
+
|
38 |
+
<h3 class="wp-people-group">🌟<?php _e( 'Recent Rockstar Contributors', 'all-in-one-seo-pack' ); ?>🌟</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( _e( 'Translation 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/dashboard_widget.php
ADDED
@@ -0,0 +1,91 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
if ( ! class_exists( 'aioseop_dashboard_widget' ) ) {
|
4 |
+
|
5 |
+
/**
|
6 |
+
* Class aioseop_dashboard_widget
|
7 |
+
*
|
8 |
+
* @since 2.3.10
|
9 |
+
*/
|
10 |
+
class aioseop_dashboard_widget {
|
11 |
+
|
12 |
+
function __construct() {
|
13 |
+
add_action( "wp_dashboard_setup", array( $this, 'aioseop_add_dashboard_widget' ) );
|
14 |
+
}
|
15 |
+
|
16 |
+
/**
|
17 |
+
* @since 2.3.10
|
18 |
+
*/
|
19 |
+
function aioseop_add_dashboard_widget() {
|
20 |
+
if ( current_user_can( 'install_plugins' ) ) {
|
21 |
+
wp_add_dashboard_widget( "semperplugins-rss-feed", __( 'SEO News', 'all-in-one-seo-pack' ), array(
|
22 |
+
$this,
|
23 |
+
'aioseop_display_rss_dashboard_widget',
|
24 |
+
) );
|
25 |
+
}
|
26 |
+
|
27 |
+
}
|
28 |
+
|
29 |
+
/**
|
30 |
+
* @since 2.3.10
|
31 |
+
*/
|
32 |
+
function aioseop_display_rss_dashboard_widget() {
|
33 |
+
|
34 |
+
include_once( ABSPATH . WPINC . "/feed.php" );
|
35 |
+
|
36 |
+
if ( false === ( $rss_items = get_transient( 'aioseop_feed' ) ) ) {
|
37 |
+
|
38 |
+
$rss = fetch_feed( "https://www.semperplugins.com/feed/" );
|
39 |
+
$rss_items = $rss->get_items( 0, 7 );
|
40 |
+
|
41 |
+
$cached = array();
|
42 |
+
foreach ( $rss_items as $item ) {
|
43 |
+
$cached[] = array(
|
44 |
+
'url' => $item->get_permalink(),
|
45 |
+
'title' => $item->get_title(),
|
46 |
+
'date' => $item->get_date( "M jS Y" ),
|
47 |
+
'content' => substr( strip_tags( $item->get_content() ), 0, 128 ) . "...",
|
48 |
+
);
|
49 |
+
}
|
50 |
+
$rss_items = $cached;
|
51 |
+
|
52 |
+
set_transient( 'aioseop_feed', $cached, 12 * HOUR_IN_SECONDS );
|
53 |
+
|
54 |
+
}
|
55 |
+
|
56 |
+
?>
|
57 |
+
|
58 |
+
<ul>
|
59 |
+
<?php
|
60 |
+
if ( false === $rss_items ) {
|
61 |
+
echo "<li>No items</li>";
|
62 |
+
|
63 |
+
return;
|
64 |
+
}
|
65 |
+
|
66 |
+
foreach ( $rss_items as $item ) {
|
67 |
+
?>
|
68 |
+
<li>
|
69 |
+
<a target="_blank" href="<?php echo esc_url( $item['url'] ); ?>">
|
70 |
+
<?php echo esc_html( $item['title'] ); ?>
|
71 |
+
</a>
|
72 |
+
<span class="aioseop-rss-date"><?php echo $item['date']; ?></span>
|
73 |
+
<div class="aioseop_news">
|
74 |
+
<?php echo strip_tags( $item['content'] ) . "..."; ?>
|
75 |
+
</div>
|
76 |
+
</li>
|
77 |
+
<?php
|
78 |
+
}
|
79 |
+
|
80 |
+
?>
|
81 |
+
</ul>
|
82 |
+
|
83 |
+
<?php
|
84 |
+
|
85 |
+
}
|
86 |
+
}
|
87 |
+
|
88 |
+
new aioseop_dashboard_widget();
|
89 |
+
}
|
90 |
+
|
91 |
+
|
admin/display/general-metaboxes.php
CHANGED
@@ -26,7 +26,7 @@ class aiosp_metaboxes {
|
|
26 |
<div class="aioseop_metabox_text">
|
27 |
<p><h2
|
28 |
style="display:inline;"><?php echo AIOSEOP_PLUGIN_NAME; ?></h2><?php sprintf( __( 'by %s of %s.', 'all-in-one-seo-pack' ), 'Michael Torbert', '<a target="_blank" title="Semper Fi Web Design"
|
29 |
-
href="
|
30 |
<?php
|
31 |
global $current_user;
|
32 |
$user_id = $current_user->ID;
|
@@ -58,7 +58,7 @@ class aiosp_metaboxes {
|
|
58 |
target="_blank"><strong>donate</strong></a> button or send me a gift from my <a
|
59 |
href="https://www.amazon.com/wishlist/1NFQ133FNCOOA/ref=wl_web" target="_blank">
|
60 |
<strong>Amazon wishlist</strong></a>. Also, don't forget to follow me on <a
|
61 |
-
href="
|
62 |
target="_blank"><strong>Twitter</strong></a>.
|
63 |
</p>
|
64 |
</div>
|
@@ -114,7 +114,7 @@ class aiosp_metaboxes {
|
|
114 |
?>
|
115 |
<div class="aioseop_metabox_text">
|
116 |
<form
|
117 |
-
action="
|
118 |
method="post" id="mc-embedded-subscribe-form" name="mc-embedded-subscribe-form" class="validate"
|
119 |
target="_blank">
|
120 |
<h2><?php _e( 'Join our mailing list for tips, tricks, and WordPress secrets.', 'all-in-one-seo-pack' ); ?></h2>
|
@@ -135,28 +135,28 @@ class aiosp_metaboxes {
|
|
135 |
<p>
|
136 |
<div class="aioseop_icon aioseop_file_icon"></div>
|
137 |
<a target="_blank"
|
138 |
-
href="
|
139 |
<p>
|
140 |
<div class="aioseop_icon aioseop_support_icon"></div>
|
141 |
<a target="_blank"
|
142 |
title="<?php _e( 'All in One SEO Pro Plugin Support Forum', 'all-in-one-seo-pack' ); ?>"
|
143 |
-
href="
|
144 |
<p>
|
145 |
<div class="aioseop_icon aioseop_cog_icon"></div>
|
146 |
<a target="_blank" title="<?php _e( 'All in One SEO Pro Plugin Changelog', 'all-in-one-seo-pack' ); ?>"
|
147 |
href="<?php if ( AIOSEOPPRO ) {
|
148 |
-
echo '
|
149 |
} else {
|
150 |
-
echo '
|
151 |
} ?>"><?php _e( 'View the Changelog', 'all-in-one-seo-pack' ); ?></a></p>
|
152 |
<p>
|
153 |
<div class="aioseop_icon aioseop_youtube_icon"></div>
|
154 |
<a target="_blank"
|
155 |
-
href="
|
156 |
<p>
|
157 |
<div class="aioseop_icon aioseop_book_icon"></div>
|
158 |
<a target="_blank"
|
159 |
-
href="
|
160 |
</div>
|
161 |
<?php
|
162 |
break;
|
26 |
<div class="aioseop_metabox_text">
|
27 |
<p><h2
|
28 |
style="display:inline;"><?php echo AIOSEOP_PLUGIN_NAME; ?></h2><?php sprintf( __( 'by %s of %s.', 'all-in-one-seo-pack' ), 'Michael Torbert', '<a target="_blank" title="Semper Fi Web Design"
|
29 |
+
href="https://semperfiwebdesign.com/">Semper Fi Web Design</a>' ); ?>.</p>
|
30 |
<?php
|
31 |
global $current_user;
|
32 |
$user_id = $current_user->ID;
|
58 |
target="_blank"><strong>donate</strong></a> button or send me a gift from my <a
|
59 |
href="https://www.amazon.com/wishlist/1NFQ133FNCOOA/ref=wl_web" target="_blank">
|
60 |
<strong>Amazon wishlist</strong></a>. Also, don't forget to follow me on <a
|
61 |
+
href="https://twitter.com/michaeltorbert/"
|
62 |
target="_blank"><strong>Twitter</strong></a>.
|
63 |
</p>
|
64 |
</div>
|
114 |
?>
|
115 |
<div class="aioseop_metabox_text">
|
116 |
<form
|
117 |
+
action="https://semperfiwebdesign.us1.list-manage.com/subscribe/post?u=794674d3d54fdd912f961ef14&id=af0a96d3d9"
|
118 |
method="post" id="mc-embedded-subscribe-form" name="mc-embedded-subscribe-form" class="validate"
|
119 |
target="_blank">
|
120 |
<h2><?php _e( 'Join our mailing list for tips, tricks, and WordPress secrets.', 'all-in-one-seo-pack' ); ?></h2>
|
135 |
<p>
|
136 |
<div class="aioseop_icon aioseop_file_icon"></div>
|
137 |
<a target="_blank"
|
138 |
+
href="https://semperplugins.com/documentation/"><?php _e( 'Read the All in One SEO Pack user guide', 'all-in-one-seo-pack' ); ?></a></p>
|
139 |
<p>
|
140 |
<div class="aioseop_icon aioseop_support_icon"></div>
|
141 |
<a target="_blank"
|
142 |
title="<?php _e( 'All in One SEO Pro Plugin Support Forum', 'all-in-one-seo-pack' ); ?>"
|
143 |
+
href="https://semperplugins.com/support/"><?php _e( 'Access our Premium Support Forums', 'all-in-one-seo-pack' ); ?></a></p>
|
144 |
<p>
|
145 |
<div class="aioseop_icon aioseop_cog_icon"></div>
|
146 |
<a target="_blank" title="<?php _e( 'All in One SEO Pro Plugin Changelog', 'all-in-one-seo-pack' ); ?>"
|
147 |
href="<?php if ( AIOSEOPPRO ) {
|
148 |
+
echo 'https://semperplugins.com/documentation/all-in-one-seo-pack-pro-changelog/';
|
149 |
} else {
|
150 |
+
echo 'https://semperfiwebdesign.com/blog/all-in-one-seo-pack/all-in-one-seo-pack-release-history/';
|
151 |
} ?>"><?php _e( 'View the Changelog', 'all-in-one-seo-pack' ); ?></a></p>
|
152 |
<p>
|
153 |
<div class="aioseop_icon aioseop_youtube_icon"></div>
|
154 |
<a target="_blank"
|
155 |
+
href="https://semperplugins.com/doc-type/video/"><?php _e( 'Watch video tutorials', 'all-in-one-seo-pack' ); ?></a></p>
|
156 |
<p>
|
157 |
<div class="aioseop_icon aioseop_book_icon"></div>
|
158 |
<a target="_blank"
|
159 |
+
href="https://semperplugins.com/documentation/quick-start-guide/"><?php _e( 'Getting started? Read the Beginners Guide', 'all-in-one-seo-pack' ); ?></a></p>
|
160 |
</div>
|
161 |
<?php
|
162 |
break;
|
admin/display/postedit.php
CHANGED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
// We will eventually put stuff here.
|
admin/display/welcome-content.php
ADDED
@@ -0,0 +1,37 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 many 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 |
+
</div>
|
12 |
+
|
13 |
+
<div class="welcome-panel-column">
|
14 |
+
<h3><?php echo esc_html( __( 'Get Started', 'all-in-one-seo-pack' ) ); ?></h3>
|
15 |
+
<ul>
|
16 |
+
<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>
|
17 |
+
<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>
|
18 |
+
<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>
|
19 |
+
<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>
|
20 |
+
<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>
|
21 |
+
<li><a href="https://semperplugins.com/documentation/submitting-an-xml-sitemap-to-google/" target="_blank"><?php echo __( 'Submit an XML Sitemap to Google', 'all-in-one-seo-pack' ); ?></a></li>
|
22 |
+
<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>
|
23 |
+
</ul>
|
24 |
+
</div>
|
25 |
+
|
26 |
+
<div class="welcome-panel-column">
|
27 |
+
<h3><?php echo esc_html( __( 'Did You Know?', 'all-in-one-seo-pack' ) ); ?></h3>
|
28 |
+
<ul>
|
29 |
+
<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>
|
30 |
+
<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>
|
31 |
+
<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>
|
32 |
+
</ul>
|
33 |
+
</div>
|
34 |
+
</div>
|
35 |
+
</div>
|
36 |
+
<p><a href="/wp-admin/admin.php?page=all-in-one-seo-pack%2Faioseop_class.php"><?php _e( 'Continue to the General Settings', 'all-in-one-seo-pack' ); ?></a> »</p>
|
37 |
+
</div>
|
admin/display/welcome.php
ADDED
@@ -0,0 +1,112 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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( $activate = FALSE ) {
|
44 |
+
|
45 |
+
if ( AIOSEOPPRO ) {
|
46 |
+
return;
|
47 |
+
}
|
48 |
+
|
49 |
+
if ( ! is_admin() ) {
|
50 |
+
return;
|
51 |
+
}
|
52 |
+
|
53 |
+
// Bail if activating from network, or bulk
|
54 |
+
if ( is_network_admin() || isset( $_GET['activate-multi'] ) ) {
|
55 |
+
return;
|
56 |
+
}
|
57 |
+
|
58 |
+
if ( ! current_user_can( 'manage_options' ) ) {
|
59 |
+
return;
|
60 |
+
}
|
61 |
+
$seen = 0;
|
62 |
+
$seen = get_user_meta( get_current_user_id(), 'aioseop_seen_about_page', true);
|
63 |
+
if( get_user_meta( get_current_user_id(), 'aioseop_seen_about_page', true) === AIOSEOP_VERSION && $activate !== TRUE ){
|
64 |
+
return;
|
65 |
+
}
|
66 |
+
|
67 |
+
update_user_meta( get_current_user_id(), 'aioseop_seen_about_page', AIOSEOP_VERSION);
|
68 |
+
|
69 |
+
aiosp_common::clear_wpe_cache();
|
70 |
+
|
71 |
+
wp_safe_redirect( add_query_arg( array( 'page' => 'aioseop-about' ), admin_url( 'index.php' ) ) );
|
72 |
+
exit;
|
73 |
+
}
|
74 |
+
|
75 |
+
function about_screen() {
|
76 |
+
aiosp_common::clear_wpe_cache();
|
77 |
+
$version = AIOSEOP_VERSION;
|
78 |
+
|
79 |
+
?>
|
80 |
+
|
81 |
+
<div class="wrap about-wrap">
|
82 |
+
<h1><?php printf( esc_html__( 'Welcome to All in One SEO Pack %s', 'all-in-one-seo-pack' ), $version ); ?></h1>
|
83 |
+
<div
|
84 |
+
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>
|
85 |
+
|
86 |
+
<h2 class="nav-tab-wrapper">
|
87 |
+
<a class="nav-tab nav-tab-active" id="aioseop-about"
|
88 |
+
href="<?php echo esc_url( admin_url( add_query_arg( array( 'page' => 'aioseop-about' ), 'index.php' ) ) ); ?>">
|
89 |
+
<?php esc_html_e( 'What’s New', 'all-in-one-seo-pack' ); ?>
|
90 |
+
</a>
|
91 |
+
<a class="nav-tab" id="aioseop-credits"
|
92 |
+
href="<?php echo esc_url( admin_url( add_query_arg( array( 'page' => 'aioseop-credits' ), 'index.php' ) ) ); ?>">
|
93 |
+
<?php esc_html_e( 'Credits', 'all-in-one-seo-pack' ); ?>
|
94 |
+
</a>
|
95 |
+
</h2>
|
96 |
+
|
97 |
+
|
98 |
+
<div id='sections'>
|
99 |
+
<section><?php include_once( AIOSEOP_PLUGIN_DIR . 'admin/display/welcome-content.php' ); ?></section>
|
100 |
+
<section><?php include_once( AIOSEOP_PLUGIN_DIR . 'admin/display/credits-content.php' ); ?></section>
|
101 |
+
</div>
|
102 |
+
|
103 |
+
</div>
|
104 |
+
|
105 |
+
|
106 |
+
<?php
|
107 |
+
|
108 |
+
}
|
109 |
+
|
110 |
+
}
|
111 |
+
|
112 |
+
}
|
aioseop_class.php
CHANGED
@@ -94,7 +94,6 @@ class All_in_One_SEO_Pack extends All_in_One_SEO_Pack_Module {
|
|
94 |
'dynamic_postspage_keywords' => __( 'Check this if you want your keywords on your Posts page (set in WordPress under Settings, Reading, Front Page Displays) and your archive pages to be dynamically generated from the keywords of the posts showing on that page. If unchecked, it will use the keywords set in the edit page screen for the posts page.', 'all-in-one-seo-pack' ),
|
95 |
'rewrite_titles' => __( "Note that this is all about the title tag. This is what you see in your browser's window title bar. This is NOT visible on a page, only in the title bar and in the source code. If enabled, all page, post, category, search and archive page titles get rewritten. You can specify the format for most of them. For example: Using the default post title format below, Rewrite Titles will write all post titles as 'Post Title | Blog Name'. If you have manually defined a title using All in One SEO Pack, this will become the title of your post in the format string.", 'all-in-one-seo-pack' ),
|
96 |
'cap_titles' => __( 'Check this and Search Page Titles and Tag Page Titles will have the first letter of each word capitalized.', 'all-in-one-seo-pack' ),
|
97 |
-
'cap_cats' => __( 'Check this and Category Titles will have the first letter of each word capitalized.', 'all-in-one-seo-pack' ),
|
98 |
'home_page_title_format' =>
|
99 |
__( 'This controls the format of the title tag for your Home Page.<br />The following macros are supported:', 'all-in-one-seo-pack' )
|
100 |
. '<ul><li>' . __( '%blog_title% - Your blog title', 'all-in-one-seo-pack' ) . '</li><li>' .
|
@@ -178,9 +177,6 @@ class All_in_One_SEO_Pack extends All_in_One_SEO_Pack_Module {
|
|
178 |
'cpostactive' => __( 'Use these checkboxes to select which Post Types you want to use All in One SEO Pack with.', 'all-in-one-seo-pack' ),
|
179 |
'taxactive' => __( 'Use these checkboxes to select which Taxonomies you want to use All in One SEO Pack with.', 'all-in-one-seo-pack' ),
|
180 |
'cposttitles' => __( 'This allows you to set the title tags for each Custom Post Type.', 'all-in-one-seo-pack' ),
|
181 |
-
'posttypecolumns' => __( 'This lets you select which screens display the SEO Title, SEO Keywords and SEO Description columns.', 'all-in-one-seo-pack' ),
|
182 |
-
'admin_bar' => __( 'Check this to add All in One SEO Pack to the Admin Bar for easy access to your SEO settings.', 'all-in-one-seo-pack' ),
|
183 |
-
'custom_menu_order' => __( 'Check this to move the All in One SEO Pack menu item to the top of your WordPress Dashboard menu.', 'all-in-one-seo-pack' ),
|
184 |
'google_verify' => __( "Enter your verification code here to verify your site with Google Webmaster Tools.<br /><a href='http://semperplugins.com/documentation/google-webmaster-tools-verification/' target='_blank'>Click here for documentation on this setting</a>", 'all-in-one-seo-pack' ),
|
185 |
'bing_verify' => __( "Enter your verification code here to verify your site with Bing Webmaster Tools.<br /><a href='http://semperplugins.com/documentation/bing-webmaster-verification/' target='_blank'>Click here for documentation on this setting</a>", 'all-in-one-seo-pack' ),
|
186 |
'pinterest_verify' => __( "Enter your verification code here to verify your site with Pinterest.<br /><a href='http://semperplugins.com/documentation/pinterest-site-verification/' target='_blank'>Click here for documentation on this setting</a>", 'all-in-one-seo-pack' ),
|
@@ -194,7 +190,6 @@ 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_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' ),
|
@@ -255,7 +250,6 @@ class All_in_One_SEO_Pack extends All_in_One_SEO_Pack_Module {
|
|
255 |
'dynamic_postspage_keywords' => '#dynamically-generate-keywords-for-posts-page',
|
256 |
'rewrite_titles' => '#rewrite-titles',
|
257 |
'cap_titles' => '#capitalize-titles',
|
258 |
-
'cap_cats' => '#capitalize-titles',
|
259 |
'home_page_title_format' => '#title-format-fields',
|
260 |
'page_title_format' => '#title-format-fields',
|
261 |
'post_title_format' => '#title-format-fields',
|
@@ -273,9 +267,6 @@ class All_in_One_SEO_Pack extends All_in_One_SEO_Pack_Module {
|
|
273 |
'cpostactive' => '#seo-on-only-these-post-types',
|
274 |
'taxactive' => '#seo-on-only-these-taxonomies',
|
275 |
'cposttitles' => '#custom-titles',
|
276 |
-
'posttypecolumns' => '#show-column-labels-for-custom-post-types',
|
277 |
-
'admin_bar' => '#display-menu-in-admin-bar',
|
278 |
-
'custom_menu_order' => '#display-menu-at-the-top',
|
279 |
'google_verify' => '',
|
280 |
'bing_verify' => '',
|
281 |
'pinterest_verify' => '',
|
@@ -288,7 +279,6 @@ class All_in_One_SEO_Pack extends All_in_One_SEO_Pack_Module {
|
|
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',
|
@@ -355,7 +345,7 @@ class All_in_One_SEO_Pack extends All_in_One_SEO_Pack_Module {
|
|
355 |
'home_title' => array(
|
356 |
'name' => __( 'Home Title:', 'all-in-one-seo-pack' ),
|
357 |
'default' => null,
|
358 |
-
'type' => '
|
359 |
'sanitize' => 'text',
|
360 |
'count' => true,
|
361 |
'rows' => 1,
|
@@ -454,10 +444,6 @@ class All_in_One_SEO_Pack extends All_in_One_SEO_Pack_Module {
|
|
454 |
'name' => __( 'Capitalize Tag and Search Titles:', 'all-in-one-seo-pack' ),
|
455 |
'default' => 1,
|
456 |
),
|
457 |
-
'cap_cats' => array(
|
458 |
-
'name' => __( 'Capitalize Category Titles:', 'all-in-one-seo-pack' ),
|
459 |
-
'default' => 1,
|
460 |
-
),
|
461 |
'home_page_title_format' => array(
|
462 |
'name' => __( 'Home Page Title Format:', 'all-in-one-seo-pack' ),
|
463 |
'type' => 'text',
|
@@ -592,20 +578,6 @@ class All_in_One_SEO_Pack extends All_in_One_SEO_Pack_Module {
|
|
592 |
'aiosp_cpostadvanced' => 'on',
|
593 |
),
|
594 |
),
|
595 |
-
'posttypecolumns' => array(
|
596 |
-
'name' => __( 'Show Column Labels for Custom Post Types:', 'all-in-one-seo-pack' ),
|
597 |
-
'type' => 'multicheckbox',
|
598 |
-
'default' => array( 'post', 'page' ),
|
599 |
-
'condshow' => array( 'aiosp_enablecpost' => 'on' ),
|
600 |
-
),
|
601 |
-
'admin_bar' => array(
|
602 |
-
'name' => __( 'Display Menu In Admin Bar:', 'all-in-one-seo-pack' ),
|
603 |
-
'default' => 'on',
|
604 |
-
),
|
605 |
-
'custom_menu_order' => array(
|
606 |
-
'name' => __( 'Display Menu At The Top:', 'all-in-one-seo-pack' ),
|
607 |
-
'default' => 'on',
|
608 |
-
),
|
609 |
'google_verify' => array(
|
610 |
'name' => __( 'Google Webmaster Tools:', 'all-in-one-seo-pack' ),
|
611 |
'default' => '',
|
@@ -681,17 +653,6 @@ class All_in_One_SEO_Pack extends All_in_One_SEO_Pack_Module {
|
|
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,7 +775,6 @@ class All_in_One_SEO_Pack extends All_in_One_SEO_Pack_Module {
|
|
814 |
'op' => '!=',
|
815 |
'rhs' => '',
|
816 |
),
|
817 |
-
'aiosp_ga_use_universal_analytics' => 'on',
|
818 |
'aiosp_ga_advanced_options' => 'on',
|
819 |
),
|
820 |
),
|
@@ -885,7 +845,7 @@ class All_in_One_SEO_Pack extends All_in_One_SEO_Pack_Module {
|
|
885 |
),
|
886 |
'generate_descriptions' => array(
|
887 |
'name' => __( 'Autogenerate Descriptions:', 'all-in-one-seo-pack' ),
|
888 |
-
'default' =>
|
889 |
),
|
890 |
'run_shortcodes' => array(
|
891 |
'name' => __( 'Run Shortcodes In Autogenerated Descriptions:', 'all-in-one-seo-pack' ),
|
@@ -1099,7 +1059,6 @@ class All_in_One_SEO_Pack extends All_in_One_SEO_Pack_Module {
|
|
1099 |
'rewrite_titles',
|
1100 |
'force_rewrites',
|
1101 |
'cap_titles',
|
1102 |
-
'cap_cats',
|
1103 |
'home_page_title_format',
|
1104 |
'page_title_format',
|
1105 |
'post_title_format',
|
@@ -1119,11 +1078,6 @@ class All_in_One_SEO_Pack extends All_in_One_SEO_Pack_Module {
|
|
1119 |
'help_link' => 'http://semperplugins.com/documentation/custom-post-type-settings/',
|
1120 |
'options' => array( 'enablecpost', 'cpostadvanced', 'taxactive', 'cpostactive', 'cposttitles' ),
|
1121 |
),
|
1122 |
-
'display' => array(
|
1123 |
-
'name' => __( 'Display Settings', 'all-in-one-seo-pack' ),
|
1124 |
-
'help_link' => 'http://semperplugins.com/documentation/display-settings/',
|
1125 |
-
'options' => array( 'posttypecolumns', 'admin_bar', 'custom_menu_order' ),
|
1126 |
-
),
|
1127 |
'webmaster' => array(
|
1128 |
'name' => __( 'Webmaster Verification', 'all-in-one-seo-pack' ),
|
1129 |
'help_link' => 'http://semperplugins.com/sections/webmaster-verification/',
|
@@ -1144,7 +1098,6 @@ class All_in_One_SEO_Pack extends All_in_One_SEO_Pack_Module {
|
|
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',
|
@@ -1180,7 +1133,7 @@ class All_in_One_SEO_Pack extends All_in_One_SEO_Pack_Module {
|
|
1180 |
),
|
1181 |
'advanced' => array(
|
1182 |
'name' => __( 'Advanced Settings', 'all-in-one-seo-pack' ),
|
1183 |
-
'help_link' => '
|
1184 |
'options' => array(
|
1185 |
'generate_descriptions',
|
1186 |
'skip_excerpt',
|
@@ -1399,9 +1352,13 @@ class All_in_One_SEO_Pack extends All_in_One_SEO_Pack_Module {
|
|
1399 |
$title = $this->wp_title();
|
1400 |
}
|
1401 |
$description = $this->get_main_description( $post );
|
|
|
|
|
|
|
1402 |
if ( empty( $title_format ) ) {
|
1403 |
if ( is_page() ) {
|
1404 |
$title_format = $aioseop_options['aiosp_page_title_format'];
|
|
|
1405 |
} elseif ( is_single() || is_attachment() ) {
|
1406 |
$title_format = $this->get_post_title_format( 'post', $post );
|
1407 |
}
|
@@ -1440,7 +1397,10 @@ class All_in_One_SEO_Pack extends All_in_One_SEO_Pack_Module {
|
|
1440 |
}
|
1441 |
$description = $this->internationalize( $description );
|
1442 |
}
|
1443 |
-
|
|
|
|
|
|
|
1444 |
$show_page = true;
|
1445 |
if ( ! empty( $aioseop_options['aiosp_no_paged_canonical_links'] ) ) {
|
1446 |
$show_page = false;
|
@@ -2361,8 +2321,14 @@ class All_in_One_SEO_Pack extends All_in_One_SEO_Pack_Module {
|
|
2361 |
// Handle prev / next links.
|
2362 |
|
2363 |
/**
|
|
|
|
|
|
|
2364 |
* @param $tax
|
2365 |
*
|
|
|
|
|
|
|
2366 |
* @return mixed|void
|
2367 |
*/
|
2368 |
function get_tax_name( $tax ) {
|
@@ -2378,9 +2344,25 @@ class All_in_One_SEO_Pack extends All_in_One_SEO_Pack_Module {
|
|
2378 |
if ( empty( $name ) ) {
|
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 |
-
|
2383 |
-
|
|
|
2384 |
|
2385 |
return $this->internationalize( $name );
|
2386 |
}
|
@@ -3169,7 +3151,7 @@ class All_in_One_SEO_Pack extends All_in_One_SEO_Pack_Module {
|
|
3169 |
$taxes[ $t ] = $t;
|
3170 |
}
|
3171 |
}
|
3172 |
-
|
3173 |
$this->default_options['cpostactive']['initial_options'] = $all_post_types;
|
3174 |
$this->default_options['cpostnoindex']['initial_options'] = $post_types;
|
3175 |
$this->default_options['cpostnofollow']['initial_options'] = $post_types;
|
@@ -3648,7 +3630,7 @@ class All_in_One_SEO_Pack extends All_in_One_SEO_Pack_Module {
|
|
3648 |
|
3649 |
aioseop_update_settings_check();
|
3650 |
add_filter( 'user_contactmethods', 'aioseop_add_contactmethods' );
|
3651 |
-
if ( is_user_logged_in() &&
|
3652 |
add_action( 'admin_bar_menu', array( $this, 'admin_bar_menu' ), 1000 );
|
3653 |
}
|
3654 |
|
@@ -3804,7 +3786,7 @@ class All_in_One_SEO_Pack extends All_in_One_SEO_Pack_Module {
|
|
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 = '
|
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,247 +4327,7 @@ EOF;
|
|
4345 |
}
|
4346 |
|
4347 |
function aiosp_google_analytics() {
|
4348 |
-
|
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 |
/**
|
@@ -4721,17 +4463,14 @@ EOF;
|
|
4721 |
}
|
4722 |
|
4723 |
function admin_bar_menu() {
|
4724 |
-
global $wp_admin_bar, $aioseop_admin_menu, $aioseop_options, $post;
|
4725 |
|
4726 |
-
|
4727 |
-
|
4728 |
-
|
4729 |
-
}
|
4730 |
-
if ( isset( $_POST['aiosp_use_original_title'] ) && ! isset( $_POST['aiosp_admin_bar'] ) ) {
|
4731 |
-
$toggle = 'off';
|
4732 |
}
|
4733 |
|
4734 |
-
|
|
|
4735 |
$menu_slug = plugin_basename( __FILE__ );
|
4736 |
|
4737 |
$url = '';
|
@@ -4761,18 +4500,21 @@ EOF;
|
|
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 |
-
|
4769 |
-
'
|
4770 |
-
|
4771 |
-
|
4772 |
-
|
4773 |
-
|
|
|
|
|
|
|
4774 |
}
|
4775 |
-
}
|
4776 |
}
|
4777 |
|
4778 |
/**
|
@@ -4879,11 +4621,7 @@ EOF;
|
|
4879 |
|
4880 |
$this->locations['aiosp']['default_options']['nonce-aioseop-edit']['default'] = wp_create_nonce( 'edit-aioseop-nonce' );
|
4881 |
|
4882 |
-
$custom_menu_order = false;
|
4883 |
global $aioseop_options;
|
4884 |
-
if ( ! isset( $aioseop_options['custom_menu_order'] ) ) {
|
4885 |
-
$custom_menu_order = true;
|
4886 |
-
}
|
4887 |
|
4888 |
$this->update_options();
|
4889 |
|
@@ -4901,28 +4639,17 @@ EOF;
|
|
4901 |
if ( isset( $_POST['aiosp_donate'] ) ) {
|
4902 |
$donated = $_POST['aiosp_donate'];
|
4903 |
}
|
4904 |
-
if ( isset( $_POST['Submit'] ) ) {
|
4905 |
-
if ( isset( $_POST['aiosp_custom_menu_order'] ) ) {
|
4906 |
-
$custom_menu_order = $_POST['aiosp_custom_menu_order'];
|
4907 |
-
} else {
|
4908 |
-
$custom_menu_order = false;
|
4909 |
-
}
|
4910 |
-
} else if ( isset( $_POST['Submit_Default'] ) || isset( $_POST['Submit_All_Default'] ) ) {
|
4911 |
-
$custom_menu_order = true;
|
4912 |
-
}
|
4913 |
} else {
|
4914 |
if ( isset( $this->options['aiosp_donate'] ) ) {
|
4915 |
$donated = $this->options['aiosp_donate'];
|
4916 |
}
|
4917 |
-
if ( isset( $this->options['aiosp_custom_menu_order'] ) ) {
|
4918 |
-
$custom_menu_order = $this->options['aiosp_custom_menu_order'];
|
4919 |
-
}
|
4920 |
}
|
4921 |
|
4922 |
-
if (
|
4923 |
-
|
4924 |
-
|
4925 |
-
|
|
|
4926 |
|
4927 |
if ( $donated ) {
|
4928 |
// Thank you for your donation.
|
@@ -5111,42 +4838,12 @@ EOF;
|
|
5111 |
</script>
|
5112 |
<?php if ( ! AIOSEOPPRO ) { ?>
|
5113 |
<div class="aioseop_advert aioseop_nopad_all">
|
5114 |
-
<?php $adid = mt_rand( 21,
|
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>
|
5141 |
-
<h3>Drag and Drop WordPress Design</h3>
|
5142 |
-
<p><a href="http://semperfiwebdesign.com/headwayaio/" target="_blank">Headway Themes</a>
|
5143 |
-
allows you to easily create your own stunning website designs! Stop using premade themes
|
5144 |
-
start making your own design with Headway's easy to use Drag and Drop interface. All in
|
5145 |
-
One SEO Pack users have an exclusive discount by using coupon code
|
5146 |
-
<strong>SEMPERFI30</strong> at checkout.</p>
|
5147 |
-
</div>
|
5148 |
-
<a href="http://semperfiwebdesign.com/headwayaio/" target="_blank"><img
|
5149 |
-
src="<?php echo AIOSEOP_PLUGIN_IMAGES_URL; ?>headwaybanner.png"></a>
|
5150 |
</div>
|
5151 |
<?php } ?>
|
5152 |
</div>
|
94 |
'dynamic_postspage_keywords' => __( 'Check this if you want your keywords on your Posts page (set in WordPress under Settings, Reading, Front Page Displays) and your archive pages to be dynamically generated from the keywords of the posts showing on that page. If unchecked, it will use the keywords set in the edit page screen for the posts page.', 'all-in-one-seo-pack' ),
|
95 |
'rewrite_titles' => __( "Note that this is all about the title tag. This is what you see in your browser's window title bar. This is NOT visible on a page, only in the title bar and in the source code. If enabled, all page, post, category, search and archive page titles get rewritten. You can specify the format for most of them. For example: Using the default post title format below, Rewrite Titles will write all post titles as 'Post Title | Blog Name'. If you have manually defined a title using All in One SEO Pack, this will become the title of your post in the format string.", 'all-in-one-seo-pack' ),
|
96 |
'cap_titles' => __( 'Check this and Search Page Titles and Tag Page Titles will have the first letter of each word capitalized.', 'all-in-one-seo-pack' ),
|
|
|
97 |
'home_page_title_format' =>
|
98 |
__( 'This controls the format of the title tag for your Home Page.<br />The following macros are supported:', 'all-in-one-seo-pack' )
|
99 |
. '<ul><li>' . __( '%blog_title% - Your blog title', 'all-in-one-seo-pack' ) . '</li><li>' .
|
177 |
'cpostactive' => __( 'Use these checkboxes to select which Post Types you want to use All in One SEO Pack with.', 'all-in-one-seo-pack' ),
|
178 |
'taxactive' => __( 'Use these checkboxes to select which Taxonomies you want to use All in One SEO Pack with.', 'all-in-one-seo-pack' ),
|
179 |
'cposttitles' => __( 'This allows you to set the title tags for each Custom Post Type.', 'all-in-one-seo-pack' ),
|
|
|
|
|
|
|
180 |
'google_verify' => __( "Enter your verification code here to verify your site with Google Webmaster Tools.<br /><a href='http://semperplugins.com/documentation/google-webmaster-tools-verification/' target='_blank'>Click here for documentation on this setting</a>", 'all-in-one-seo-pack' ),
|
181 |
'bing_verify' => __( "Enter your verification code here to verify your site with Bing Webmaster Tools.<br /><a href='http://semperplugins.com/documentation/bing-webmaster-verification/' target='_blank'>Click here for documentation on this setting</a>", 'all-in-one-seo-pack' ),
|
182 |
'pinterest_verify' => __( "Enter your verification code here to verify your site with Pinterest.<br /><a href='http://semperplugins.com/documentation/pinterest-site-verification/' target='_blank'>Click here for documentation on this setting</a>", 'all-in-one-seo-pack' ),
|
190 |
'google_set_site_name' => __( 'Add markup to tell Google the preferred name for your website.', 'all-in-one-seo-pack' ),
|
191 |
'google_connect' => __( 'Press the connect button to connect with Google Analytics; or if already connected, press the disconnect button to disable and remove any stored analytics credentials.', 'all-in-one-seo-pack' ),
|
192 |
'google_analytics_id' => __( 'Enter your Google Analytics ID here to track visitor behavior on your site using Google Analytics.', 'all-in-one-seo-pack' ),
|
|
|
193 |
'ga_advanced_options' => __( 'Check to use advanced Google Analytics options.', 'all-in-one-seo-pack' ),
|
194 |
'ga_domain' => __( 'Enter your domain name without the http:// to set your cookie domain.', 'all-in-one-seo-pack' ),
|
195 |
'ga_multi_domain' => __( 'Use this option to enable tracking of multiple or additional domains.', 'all-in-one-seo-pack' ),
|
250 |
'dynamic_postspage_keywords' => '#dynamically-generate-keywords-for-posts-page',
|
251 |
'rewrite_titles' => '#rewrite-titles',
|
252 |
'cap_titles' => '#capitalize-titles',
|
|
|
253 |
'home_page_title_format' => '#title-format-fields',
|
254 |
'page_title_format' => '#title-format-fields',
|
255 |
'post_title_format' => '#title-format-fields',
|
267 |
'cpostactive' => '#seo-on-only-these-post-types',
|
268 |
'taxactive' => '#seo-on-only-these-taxonomies',
|
269 |
'cposttitles' => '#custom-titles',
|
|
|
|
|
|
|
270 |
'google_verify' => '',
|
271 |
'bing_verify' => '',
|
272 |
'pinterest_verify' => '',
|
279 |
'google_enable_publisher' => '#display-publisher-meta-on-front-page',
|
280 |
'google_specify_publisher' => '#specify-publisher-url',
|
281 |
'google_analytics_id' => 'http://semperplugins.com/documentation/setting-up-google-analytics/',
|
|
|
282 |
'ga_domain' => '#tracking-domain',
|
283 |
'ga_multi_domain' => '#track-multiple-domains-additional-domains',
|
284 |
'ga_addl_domains' => '#track-multiple-domains-additional-domains',
|
345 |
'home_title' => array(
|
346 |
'name' => __( 'Home Title:', 'all-in-one-seo-pack' ),
|
347 |
'default' => null,
|
348 |
+
'type' => 'text',
|
349 |
'sanitize' => 'text',
|
350 |
'count' => true,
|
351 |
'rows' => 1,
|
444 |
'name' => __( 'Capitalize Tag and Search Titles:', 'all-in-one-seo-pack' ),
|
445 |
'default' => 1,
|
446 |
),
|
|
|
|
|
|
|
|
|
447 |
'home_page_title_format' => array(
|
448 |
'name' => __( 'Home Page Title Format:', 'all-in-one-seo-pack' ),
|
449 |
'type' => 'text',
|
578 |
'aiosp_cpostadvanced' => 'on',
|
579 |
),
|
580 |
),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
581 |
'google_verify' => array(
|
582 |
'name' => __( 'Google Webmaster Tools:', 'all-in-one-seo-pack' ),
|
583 |
'default' => '',
|
653 |
'type' => 'text',
|
654 |
'placeholder' => 'UA-########-#',
|
655 |
),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
656 |
'ga_advanced_options' => array(
|
657 |
'name' => __( 'Advanced Analytics Options:', 'all-in-one-seo-pack' ),
|
658 |
'default' => 'on',
|
775 |
'op' => '!=',
|
776 |
'rhs' => '',
|
777 |
),
|
|
|
778 |
'aiosp_ga_advanced_options' => 'on',
|
779 |
),
|
780 |
),
|
845 |
),
|
846 |
'generate_descriptions' => array(
|
847 |
'name' => __( 'Autogenerate Descriptions:', 'all-in-one-seo-pack' ),
|
848 |
+
'default' => 0,
|
849 |
),
|
850 |
'run_shortcodes' => array(
|
851 |
'name' => __( 'Run Shortcodes In Autogenerated Descriptions:', 'all-in-one-seo-pack' ),
|
1059 |
'rewrite_titles',
|
1060 |
'force_rewrites',
|
1061 |
'cap_titles',
|
|
|
1062 |
'home_page_title_format',
|
1063 |
'page_title_format',
|
1064 |
'post_title_format',
|
1078 |
'help_link' => 'http://semperplugins.com/documentation/custom-post-type-settings/',
|
1079 |
'options' => array( 'enablecpost', 'cpostadvanced', 'taxactive', 'cpostactive', 'cposttitles' ),
|
1080 |
),
|
|
|
|
|
|
|
|
|
|
|
1081 |
'webmaster' => array(
|
1082 |
'name' => __( 'Webmaster Verification', 'all-in-one-seo-pack' ),
|
1083 |
'help_link' => 'http://semperplugins.com/sections/webmaster-verification/',
|
1098 |
'google_specify_publisher',
|
1099 |
// "google_connect",
|
1100 |
'google_analytics_id',
|
|
|
1101 |
'ga_advanced_options',
|
1102 |
'ga_domain',
|
1103 |
'ga_multi_domain',
|
1133 |
),
|
1134 |
'advanced' => array(
|
1135 |
'name' => __( 'Advanced Settings', 'all-in-one-seo-pack' ),
|
1136 |
+
'help_link' => 'https://semperplugins.com/documentation/all-in-one-seo-pack-advanced-settings/',
|
1137 |
'options' => array(
|
1138 |
'generate_descriptions',
|
1139 |
'skip_excerpt',
|
1352 |
$title = $this->wp_title();
|
1353 |
}
|
1354 |
$description = $this->get_main_description( $post );
|
1355 |
+
|
1356 |
+
// All this needs to be in it's own function (class really)
|
1357 |
+
|
1358 |
if ( empty( $title_format ) ) {
|
1359 |
if ( is_page() ) {
|
1360 |
$title_format = $aioseop_options['aiosp_page_title_format'];
|
1361 |
+
|
1362 |
} elseif ( is_single() || is_attachment() ) {
|
1363 |
$title_format = $this->get_post_title_format( 'post', $post );
|
1364 |
}
|
1397 |
}
|
1398 |
$description = $this->internationalize( $description );
|
1399 |
}
|
1400 |
+
if($this->is_front_page == true ){
|
1401 |
+
//$title_format = $aioseop_options['aiosp_home_page_title_format'];
|
1402 |
+
$title_format = ''; // Not sure why this needs to be this way, but we should extract all this out to figure out what's going on.
|
1403 |
+
}
|
1404 |
$show_page = true;
|
1405 |
if ( ! empty( $aioseop_options['aiosp_no_paged_canonical_links'] ) ) {
|
1406 |
$show_page = false;
|
2321 |
// Handle prev / next links.
|
2322 |
|
2323 |
/**
|
2324 |
+
*
|
2325 |
+
* Gets taxonomy name.
|
2326 |
+
*
|
2327 |
* @param $tax
|
2328 |
*
|
2329 |
+
* As of 2.3.10, we've removed the option for capitalize categories. We still respect the option,
|
2330 |
+
* and the default (true) or a legacy option in the db can be overridden with the new filter hook aioseop_capitalize_categories
|
2331 |
+
*
|
2332 |
* @return mixed|void
|
2333 |
*/
|
2334 |
function get_tax_name( $tax ) {
|
2344 |
if ( empty( $name ) ) {
|
2345 |
$name = single_term_title( '', false );
|
2346 |
}
|
2347 |
+
|
2348 |
+
$cap_cats = true; // Default to uppercase category/taxonomy titles.
|
2349 |
+
if ( isset( $aioseop_options['aiosp_cap_cats'] ) && ! empty( $aioseop_options['aiosp_cap_cats'] ) ) {
|
2350 |
+
// Legacy option is checked.
|
2351 |
+
$cap_cats = true;
|
2352 |
+
|
2353 |
+
}
|
2354 |
+
|
2355 |
+
if ( isset( $aioseop_options['aiosp_cap_cats'] ) && empty( $aioseop_options['aiosp_cap_cats'] ) ) {
|
2356 |
+
// Legacy option is unchecked.
|
2357 |
+
$cap_cats = false;
|
2358 |
+
}
|
2359 |
+
|
2360 |
+
$cap_cats = apply_filters( 'aioseop_capitalize_categories', $cap_cats ); // This will override any legacy settings.
|
2361 |
+
|
2362 |
// 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?
|
2363 |
+
if ( ( $tax == 'category' ) && $cap_cats == true ) {
|
2364 |
+
$name = $this->ucwords( $name );
|
2365 |
+
}
|
2366 |
|
2367 |
return $this->internationalize( $name );
|
2368 |
}
|
3151 |
$taxes[ $t ] = $t;
|
3152 |
}
|
3153 |
}
|
3154 |
+
|
3155 |
$this->default_options['cpostactive']['initial_options'] = $all_post_types;
|
3156 |
$this->default_options['cpostnoindex']['initial_options'] = $post_types;
|
3157 |
$this->default_options['cpostnofollow']['initial_options'] = $post_types;
|
3630 |
|
3631 |
aioseop_update_settings_check();
|
3632 |
add_filter( 'user_contactmethods', 'aioseop_add_contactmethods' );
|
3633 |
+
if ( is_user_logged_in() && is_admin_bar_showing() && current_user_can( 'aiosp_manage_seo' ) ) {
|
3634 |
add_action( 'admin_bar_menu', array( $this, 'admin_bar_menu' ), 1000 );
|
3635 |
}
|
3636 |
|
3786 |
$description = apply_filters( 'aioseop_description_full', $this->apply_description_format( $description, $post ) );
|
3787 |
$desc_attr = '';
|
3788 |
if ( ! empty( $aioseop_options['aiosp_schema_markup'] ) ) {
|
3789 |
+
$desc_attr = '';
|
3790 |
}
|
3791 |
$desc_attr = apply_filters( 'aioseop_description_attributes', $desc_attr );
|
3792 |
$meta_string .= sprintf( "<meta name=\"description\" %s content=\"%s\" />\n", $desc_attr, $description );
|
4327 |
}
|
4328 |
|
4329 |
function aiosp_google_analytics() {
|
4330 |
+
new aioseop_google_analytics;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4331 |
}
|
4332 |
|
4333 |
/**
|
4463 |
}
|
4464 |
|
4465 |
function admin_bar_menu() {
|
|
|
4466 |
|
4467 |
+
if( apply_filters( 'aioseo_show_in_admin_bar', true) === false ){
|
4468 |
+
// API filter hook to disable showing SEO in admin bar.
|
4469 |
+
return;
|
|
|
|
|
|
|
4470 |
}
|
4471 |
|
4472 |
+
global $wp_admin_bar, $aioseop_admin_menu, $post;
|
4473 |
+
|
4474 |
$menu_slug = plugin_basename( __FILE__ );
|
4475 |
|
4476 |
$url = '';
|
4500 |
|
4501 |
$aioseop_admin_menu = 1;
|
4502 |
if ( ! is_admin() && ! empty( $post ) ) {
|
4503 |
+
|
4504 |
$blog_page = aiosp_common::get_blog_page( $post );
|
4505 |
if ( ! empty( $blog_page ) ) {
|
4506 |
$post = $blog_page;
|
4507 |
}
|
4508 |
+
if( ! is_home() || ( ! is_front_page() && ! is_home() ) ) {
|
4509 |
+
// Don't show if we're on the home page and the home page is the latest posts.
|
4510 |
+
$wp_admin_bar->add_menu( array(
|
4511 |
+
'id' => 'aiosp_edit_' . $post->ID,
|
4512 |
+
'parent' => AIOSEOP_PLUGIN_DIRNAME,
|
4513 |
+
'title' => __( 'Edit SEO', 'all-in-one-seo-pack' ),
|
4514 |
+
'href' => get_edit_post_link( $post->ID ) . '#aiosp',
|
4515 |
+
) );
|
4516 |
+
}
|
4517 |
}
|
|
|
4518 |
}
|
4519 |
|
4520 |
/**
|
4621 |
|
4622 |
$this->locations['aiosp']['default_options']['nonce-aioseop-edit']['default'] = wp_create_nonce( 'edit-aioseop-nonce' );
|
4623 |
|
|
|
4624 |
global $aioseop_options;
|
|
|
|
|
|
|
4625 |
|
4626 |
$this->update_options();
|
4627 |
|
4639 |
if ( isset( $_POST['aiosp_donate'] ) ) {
|
4640 |
$donated = $_POST['aiosp_donate'];
|
4641 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4642 |
} else {
|
4643 |
if ( isset( $this->options['aiosp_donate'] ) ) {
|
4644 |
$donated = $this->options['aiosp_donate'];
|
4645 |
}
|
|
|
|
|
|
|
4646 |
}
|
4647 |
|
4648 |
+
if( apply_filters( 'aioseo_custom_menu_order', true) !== false ){
|
4649 |
+
// API filter hook to disable showing SEO at the top of the menu.
|
4650 |
+
add_filter( 'custom_menu_order', '__return_true' );
|
4651 |
+
add_filter( 'menu_order', array( $this, 'set_menu_order' ), 11 );
|
4652 |
+
}
|
4653 |
|
4654 |
if ( $donated ) {
|
4655 |
// Thank you for your donation.
|
4838 |
</script>
|
4839 |
<?php if ( ! AIOSEOPPRO ) { ?>
|
4840 |
<div class="aioseop_advert aioseop_nopad_all">
|
4841 |
+
<?php $adid = mt_rand( 21, 22 ); ?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4842 |
<a href="https://www.wincher.com/?referer=all-in-one-seo-pack&adreferer=banner<?php echo $adid; ?>"
|
4843 |
target="_blank">
|
4844 |
<div class=wincherad id=wincher<?php echo $adid; ?>>
|
4845 |
</div>
|
4846 |
</a>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4847 |
</div>
|
4848 |
<?php } ?>
|
4849 |
</div>
|
all_in_one_seo_pack.php
CHANGED
@@ -1,471 +1,499 @@
|
|
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.
|
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.
|
35 |
-
*/
|
36 |
-
|
37 |
-
if ( ! defined( 'AIOSEOPPRO' ) ) {
|
38 |
-
define( 'AIOSEOPPRO', false );
|
39 |
-
}
|
40 |
-
if ( ! defined( 'AIOSEOP_VERSION' ) ) {
|
41 |
-
define( 'AIOSEOP_VERSION', '2.3.
|
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( '
|
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 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
*
|
140 |
-
*
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
$
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
@
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
$aioseop_mem_limit
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
if ( !
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
$
|
194 |
-
|
195 |
-
'
|
196 |
-
'
|
197 |
-
'
|
198 |
-
'
|
199 |
-
'
|
200 |
-
'
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
|
208 |
-
|
209 |
-
|
210 |
-
.
|
211 |
-
|
212 |
-
|
213 |
-
|
214 |
-
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
|
222 |
-
|
223 |
-
|
224 |
-
|
225 |
-
|
226 |
-
|
227 |
-
|
228 |
-
|
229 |
-
|
230 |
-
|
231 |
-
|
232 |
-
|
233 |
-
|
234 |
-
|
235 |
-
$aioseop_update_checker->
|
236 |
-
|
237 |
-
|
238 |
-
|
239 |
-
|
240 |
-
|
241 |
-
|
242 |
-
|
243 |
-
|
244 |
-
|
245 |
-
|
246 |
-
|
247 |
-
|
248 |
-
|
249 |
-
|
250 |
-
|
251 |
-
|
252 |
-
|
253 |
-
|
254 |
-
|
255 |
-
|
256 |
-
}
|
257 |
-
|
258 |
-
|
259 |
-
|
260 |
-
if (
|
261 |
-
|
262 |
-
|
263 |
-
|
264 |
-
|
265 |
-
|
266 |
-
|
267 |
-
|
268 |
-
|
269 |
-
|
270 |
-
|
271 |
-
|
272 |
-
|
273 |
-
|
274 |
-
|
275 |
-
|
276 |
-
|
277 |
-
|
278 |
-
|
279 |
-
|
280 |
-
|
281 |
-
|
282 |
-
|
283 |
-
|
284 |
-
|
285 |
-
|
286 |
-
|
287 |
-
|
288 |
-
|
289 |
-
|
290 |
-
|
291 |
-
|
292 |
-
|
293 |
-
|
294 |
-
|
295 |
-
|
296 |
-
|
297 |
-
|
298 |
-
|
299 |
-
|
300 |
-
|
301 |
-
|
302 |
-
|
303 |
-
|
304 |
-
|
305 |
-
|
306 |
-
|
307 |
-
|
308 |
-
|
309 |
-
|
310 |
-
|
311 |
-
|
312 |
-
|
313 |
-
|
314 |
-
|
315 |
-
|
316 |
-
|
317 |
-
|
318 |
-
|
319 |
-
|
320 |
-
|
321 |
-
|
322 |
-
|
323 |
-
|
324 |
-
|
325 |
-
|
326 |
-
|
327 |
-
|
328 |
-
|
329 |
-
|
330 |
-
|
331 |
-
|
332 |
-
|
333 |
-
|
334 |
-
|
335 |
-
|
336 |
-
|
337 |
-
|
338 |
-
|
339 |
-
|
340 |
-
|
341 |
-
|
342 |
-
|
343 |
-
|
344 |
-
|
345 |
-
|
346 |
-
|
347 |
-
|
348 |
-
|
349 |
-
|
350 |
-
|
351 |
-
|
352 |
-
|
353 |
-
|
354 |
-
|
355 |
-
|
356 |
-
|
357 |
-
|
358 |
-
|
359 |
-
|
360 |
-
|
361 |
-
|
362 |
-
|
363 |
-
|
364 |
-
|
365 |
-
|
366 |
-
|
367 |
-
|
368 |
-
|
369 |
-
|
370 |
-
|
371 |
-
|
372 |
-
|
373 |
-
|
374 |
-
|
375 |
-
|
376 |
-
|
377 |
-
|
378 |
-
|
379 |
-
|
380 |
-
|
381 |
-
|
382 |
-
|
383 |
-
require_once( AIOSEOP_PLUGIN_DIR . 'inc/
|
384 |
-
require_once( AIOSEOP_PLUGIN_DIR . '
|
385 |
-
require_once( AIOSEOP_PLUGIN_DIR . 'inc/
|
386 |
-
require_once( AIOSEOP_PLUGIN_DIR . '
|
387 |
-
|
388 |
-
|
389 |
-
|
390 |
-
|
391 |
-
|
392 |
-
|
393 |
-
|
394 |
-
|
395 |
-
|
396 |
-
|
397 |
-
|
398 |
-
|
399 |
-
|
400 |
-
|
401 |
-
|
402 |
-
|
403 |
-
|
404 |
-
|
405 |
-
|
406 |
-
|
407 |
-
|
408 |
-
|
409 |
-
|
410 |
-
|
411 |
-
|
412 |
-
add_action( '
|
413 |
-
|
414 |
-
|
415 |
-
|
416 |
-
|
417 |
-
|
418 |
-
|
419 |
-
|
420 |
-
|
421 |
-
|
422 |
-
add_action( '
|
423 |
-
|
424 |
-
|
425 |
-
|
426 |
-
|
427 |
-
|
428 |
-
|
429 |
-
|
430 |
-
|
431 |
-
|
432 |
-
|
433 |
-
|
434 |
-
|
435 |
-
|
436 |
-
|
437 |
-
|
438 |
-
|
439 |
-
|
440 |
-
|
441 |
-
|
442 |
-
|
443 |
-
|
444 |
-
|
445 |
-
|
446 |
-
|
447 |
-
|
448 |
-
|
449 |
-
|
450 |
-
|
451 |
-
|
452 |
-
|
453 |
-
|
454 |
-
|
455 |
-
|
456 |
-
|
457 |
-
|
458 |
-
|
459 |
-
|
460 |
-
|
461 |
-
|
462 |
-
|
463 |
-
|
464 |
-
|
465 |
-
|
466 |
-
|
467 |
-
|
468 |
-
|
469 |
-
|
470 |
-
|
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.10
|
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.10
|
35 |
+
*/
|
36 |
+
|
37 |
+
if ( ! defined( 'AIOSEOPPRO' ) ) {
|
38 |
+
define( 'AIOSEOPPRO', false );
|
39 |
+
}
|
40 |
+
if ( ! defined( 'AIOSEOP_VERSION' ) ) {
|
41 |
+
define( 'AIOSEOP_VERSION', '2.3.10' );
|
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_head', '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 |
+
if ( ! defined( 'AIOSEOP_PLUGIN_DIR' ) ) {
|
81 |
+
define( 'AIOSEOP_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
|
82 |
+
} elseif ( AIOSEOP_PLUGIN_DIR !== plugin_dir_path( __FILE__ ) ) {
|
83 |
+
|
84 |
+
/*
|
85 |
+
This is not a great message.
|
86 |
+
add_action( 'admin_notices', create_function( '', 'echo "' . "<div class='error'>" . sprintf(
|
87 |
+
__( "%s detected a conflict; please deactivate the plugin located in %s.", 'all-in-one-seo-pack' ),
|
88 |
+
$aioseop_plugin_name, AIOSEOP_PLUGIN_DIR ) . "</div>" . '";' ) );
|
89 |
+
*/
|
90 |
+
|
91 |
+
return;
|
92 |
+
}
|
93 |
+
|
94 |
+
if ( ! defined( 'AIOSEOP_PLUGIN_BASENAME' ) ) {
|
95 |
+
define( 'AIOSEOP_PLUGIN_BASENAME', plugin_basename( __FILE__ ) );
|
96 |
+
}
|
97 |
+
if ( ! defined( 'AIOSEOP_PLUGIN_DIRNAME' ) ) {
|
98 |
+
define( 'AIOSEOP_PLUGIN_DIRNAME', dirname( AIOSEOP_PLUGIN_BASENAME ) );
|
99 |
+
}
|
100 |
+
if ( ! defined( 'AIOSEOP_PLUGIN_URL' ) ) {
|
101 |
+
define( 'AIOSEOP_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
|
102 |
+
}
|
103 |
+
if ( ! defined( 'AIOSEOP_PLUGIN_IMAGES_URL' ) ) {
|
104 |
+
define( 'AIOSEOP_PLUGIN_IMAGES_URL', AIOSEOP_PLUGIN_URL . 'images/' );
|
105 |
+
}
|
106 |
+
if ( ! defined( 'AIOSEOP_BASELINE_MEM_LIMIT' ) ) {
|
107 |
+
define( 'AIOSEOP_BASELINE_MEM_LIMIT', 268435456 );
|
108 |
+
} // 256MB
|
109 |
+
if ( ! defined( 'WP_CONTENT_URL' ) ) {
|
110 |
+
define( 'WP_CONTENT_URL', site_url() . '/wp-content' );
|
111 |
+
}
|
112 |
+
if ( ! defined( 'WP_ADMIN_URL' ) ) {
|
113 |
+
define( 'WP_ADMIN_URL', site_url() . '/wp-admin' );
|
114 |
+
}
|
115 |
+
if ( ! defined( 'WP_CONTENT_DIR' ) ) {
|
116 |
+
define( 'WP_CONTENT_DIR', ABSPATH . 'wp-content' );
|
117 |
+
}
|
118 |
+
if ( ! defined( 'WP_PLUGIN_URL' ) ) {
|
119 |
+
define( 'WP_PLUGIN_URL', WP_CONTENT_URL . '/plugins' );
|
120 |
+
}
|
121 |
+
if ( ! defined( 'WP_PLUGIN_DIR' ) ) {
|
122 |
+
define( 'WP_PLUGIN_DIR', WP_CONTENT_DIR . '/plugins' );
|
123 |
+
}
|
124 |
+
|
125 |
+
global $aiosp, $aioseop_options, $aioseop_modules, $aioseop_module_list, $aiosp_activation, $aioseop_mem_limit, $aioseop_get_pages_start, $aioseop_admin_menu;
|
126 |
+
$aioseop_get_pages_start = $aioseop_admin_menu = 0;
|
127 |
+
|
128 |
+
if ( AIOSEOPPRO ) {
|
129 |
+
global $aioseop_update_checker;
|
130 |
+
}
|
131 |
+
|
132 |
+
$aioseop_options = get_option( 'aioseop_options' );
|
133 |
+
|
134 |
+
$aioseop_mem_limit = @ini_get( 'memory_limit' );
|
135 |
+
|
136 |
+
if ( ! function_exists( 'aioseop_convert_bytestring' ) ) {
|
137 |
+
/**
|
138 |
+
* @param $byte_string
|
139 |
+
*
|
140 |
+
* @return int
|
141 |
+
*/
|
142 |
+
function aioseop_convert_bytestring( $byte_string ) {
|
143 |
+
$num = 0;
|
144 |
+
preg_match( '/^\s*([0-9.]+)\s*([KMGTPE])B?\s*$/i', $byte_string, $matches );
|
145 |
+
if ( ! empty( $matches ) ) {
|
146 |
+
$num = (float) $matches[1];
|
147 |
+
switch ( strtoupper( $matches[2] ) ) {
|
148 |
+
case 'E':
|
149 |
+
$num *= 1024;
|
150 |
+
case 'P':
|
151 |
+
$num *= 1024;
|
152 |
+
case 'T':
|
153 |
+
$num *= 1024;
|
154 |
+
case 'G':
|
155 |
+
$num *= 1024;
|
156 |
+
case 'M':
|
157 |
+
$num *= 1024;
|
158 |
+
case 'K':
|
159 |
+
$num *= 1024;
|
160 |
+
}
|
161 |
+
}
|
162 |
+
|
163 |
+
return intval( $num );
|
164 |
+
}
|
165 |
+
}
|
166 |
+
|
167 |
+
if ( is_array( $aioseop_options ) && isset( $aioseop_options['modules'] ) && isset( $aioseop_options['modules']['aiosp_performance_options'] ) ) {
|
168 |
+
$perf_opts = $aioseop_options['modules']['aiosp_performance_options'];
|
169 |
+
if ( isset( $perf_opts['aiosp_performance_memory_limit'] ) ) {
|
170 |
+
$aioseop_mem_limit = $perf_opts['aiosp_performance_memory_limit'];
|
171 |
+
}
|
172 |
+
if ( isset( $perf_opts['aiosp_performance_execution_time'] ) && ( '' !== $perf_opts['aiosp_performance_execution_time'] ) ) {
|
173 |
+
@ini_set( 'max_execution_time', (int) $perf_opts['aiosp_performance_execution_time'] );
|
174 |
+
@set_time_limit( (int) $perf_opts['aiosp_performance_execution_time'] );
|
175 |
+
}
|
176 |
+
} else {
|
177 |
+
$aioseop_mem_limit = aioseop_convert_bytestring( $aioseop_mem_limit );
|
178 |
+
if ( ( $aioseop_mem_limit > 0 ) && ( $aioseop_mem_limit < AIOSEOP_BASELINE_MEM_LIMIT ) ) {
|
179 |
+
$aioseop_mem_limit = AIOSEOP_BASELINE_MEM_LIMIT;
|
180 |
+
}
|
181 |
+
}
|
182 |
+
|
183 |
+
if ( ! empty( $aioseop_mem_limit ) ) {
|
184 |
+
if ( ! is_int( $aioseop_mem_limit ) ) {
|
185 |
+
$aioseop_mem_limit = aioseop_convert_bytestring( $aioseop_mem_limit );
|
186 |
+
}
|
187 |
+
if ( ( $aioseop_mem_limit > 0 ) && ( $aioseop_mem_limit <= AIOSEOP_BASELINE_MEM_LIMIT ) ) {
|
188 |
+
@ini_set( 'memory_limit', $aioseop_mem_limit );
|
189 |
+
}
|
190 |
+
}
|
191 |
+
|
192 |
+
$aiosp_activation = false;
|
193 |
+
$aioseop_module_list = array(
|
194 |
+
'sitemap',
|
195 |
+
'opengraph',
|
196 |
+
'robots',
|
197 |
+
'file_editor',
|
198 |
+
'importer_exporter',
|
199 |
+
'bad_robots',
|
200 |
+
'performance',
|
201 |
+
); // list all available modules here
|
202 |
+
|
203 |
+
if ( AIOSEOPPRO ) {
|
204 |
+
$aioseop_module_list[] = 'video_sitemap';
|
205 |
+
}
|
206 |
+
|
207 |
+
if ( class_exists( 'All_in_One_SEO_Pack' ) ) {
|
208 |
+
add_action( 'admin_notices', create_function( '', 'echo "<div class=\'error\'>The All In One SEO Pack class is already defined";'
|
209 |
+
. "if ( class_exists( 'ReflectionClass' ) ) { \$r = new ReflectionClass( 'All_in_One_SEO_Pack' ); echo ' in ' . \$r->getFileName(); } "
|
210 |
+
. ' echo ", preventing All In One SEO Pack from loading.</div>";' ) );
|
211 |
+
|
212 |
+
return;
|
213 |
+
}
|
214 |
+
|
215 |
+
if ( AIOSEOPPRO ) {
|
216 |
+
|
217 |
+
require( AIOSEOP_PLUGIN_DIR . 'pro/sfwd_update_checker.php' );
|
218 |
+
$aiosp_update_url = 'http://semperplugins.com/upgrade_plugins.php';
|
219 |
+
if( defined( 'AIOSEOP_UPDATE_URL' ) ) {
|
220 |
+
$aiosp_update_url = AIOSEOP_UPDATE_URL;
|
221 |
+
}
|
222 |
+
$aioseop_update_checker = new SFWD_Update_Checker(
|
223 |
+
$aiosp_update_url,
|
224 |
+
__FILE__,
|
225 |
+
'aioseop'
|
226 |
+
);
|
227 |
+
|
228 |
+
$aioseop_update_checker->plugin_name = AIOSEOP_PLUGIN_NAME;
|
229 |
+
$aioseop_update_checker->plugin_basename = AIOSEOP_PLUGIN_BASENAME;
|
230 |
+
if ( ! empty( $aioseop_options['aiosp_license_key'] ) ) {
|
231 |
+
$aioseop_update_checker->license_key = $aioseop_options['aiosp_license_key'];
|
232 |
+
} else {
|
233 |
+
$aioseop_update_checker->license_key = '';
|
234 |
+
}
|
235 |
+
$aioseop_update_checker->options_page = 'all-in-one-seo-pack-pro/aioseop_class.php';
|
236 |
+
$aioseop_update_checker->renewal_page = 'http://semperplugins.com/all-in-one-seo-pack-pro-support-updates-renewal/';
|
237 |
+
|
238 |
+
$aioseop_update_checker->addQueryArgFilter( array( $aioseop_update_checker, 'add_secret_key' ) );
|
239 |
+
}
|
240 |
+
|
241 |
+
|
242 |
+
if ( ! function_exists( 'aioseop_activate' ) ) {
|
243 |
+
|
244 |
+
function aioseop_activate() {
|
245 |
+
|
246 |
+
//Check if we just got activated.
|
247 |
+
global $aiosp_activation;
|
248 |
+
if ( AIOSEOPPRO ) {
|
249 |
+
global $aioseop_update_checker;
|
250 |
+
}
|
251 |
+
$aiosp_activation = true;
|
252 |
+
|
253 |
+
// These checks might be duplicated in the function being called.
|
254 |
+
if( ! is_network_admin() || !isset( $_GET['activate-multi'] ) ) {
|
255 |
+
set_transient( '_aioseop_activation_redirect', true, 30 ); // Sets 30 second transient for welcome screen redirect on activation.
|
256 |
+
}
|
257 |
+
|
258 |
+
delete_user_meta( get_current_user_id(), 'aioseop_yst_detected_notice_dismissed' );
|
259 |
+
|
260 |
+
if ( AIOSEOPPRO ) {
|
261 |
+
$aioseop_update_checker->checkForUpdates();
|
262 |
+
}
|
263 |
+
}
|
264 |
+
}
|
265 |
+
|
266 |
+
add_action( 'plugins_loaded', 'aioseop_init_class' );
|
267 |
+
|
268 |
+
if ( ! function_exists( 'aiosp_plugin_row_meta' ) ) {
|
269 |
+
|
270 |
+
add_filter( 'plugin_row_meta', 'aiosp_plugin_row_meta', 10, 2 );
|
271 |
+
|
272 |
+
/**
|
273 |
+
* @param $actions
|
274 |
+
* @param $plugin_file
|
275 |
+
*
|
276 |
+
* @return array
|
277 |
+
*/
|
278 |
+
function aiosp_plugin_row_meta( $actions, $plugin_file ) {
|
279 |
+
|
280 |
+
if ( ! AIOSEOPPRO ) {
|
281 |
+
|
282 |
+
$action_links = array(
|
283 |
+
'donatelink' => array(
|
284 |
+
'label' => __( 'Donate', 'all-in-one-seo-pack' ),
|
285 |
+
'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¤cy_code=USD&lc=US&bn=PP%2dDonationsBF&charset=UTF%2d8',
|
286 |
+
),
|
287 |
+
'amazon' => array(
|
288 |
+
'label' => __( 'Amazon Wishlist', 'all-in-one-seo-pack' ),
|
289 |
+
'url' => 'https://www.amazon.com/wishlist/1NFQ133FNCOOA/ref=wl_web',
|
290 |
+
),
|
291 |
+
|
292 |
+
);
|
293 |
+
|
294 |
+
} else {
|
295 |
+
$action_links = '';
|
296 |
+
}
|
297 |
+
|
298 |
+
return aiosp_action_links( $actions, $plugin_file, $action_links, 'after' );
|
299 |
+
}
|
300 |
+
}
|
301 |
+
|
302 |
+
if ( ! function_exists( 'aiosp_add_action_links' ) ) {
|
303 |
+
|
304 |
+
|
305 |
+
add_filter( 'plugin_action_links_' . plugin_basename( __FILE__ ), 'aiosp_add_action_links', 10, 2 );
|
306 |
+
|
307 |
+
/**
|
308 |
+
* @param $actions
|
309 |
+
* @param $plugin_file
|
310 |
+
*
|
311 |
+
* @return array
|
312 |
+
*/
|
313 |
+
function aiosp_add_action_links( $actions, $plugin_file ) {
|
314 |
+
|
315 |
+
$aioseop_plugin_dirname = AIOSEOP_PLUGIN_DIRNAME;
|
316 |
+
$action_links = array();
|
317 |
+
$action_links = array(
|
318 |
+
'settings' => array(
|
319 |
+
'label' => __( 'SEO Settings', 'all-in-one-seo-pack' ),
|
320 |
+
'url' => get_admin_url( null, "admin.php?page=$aioseop_plugin_dirname/aioseop_class.php" ),
|
321 |
+
),
|
322 |
+
|
323 |
+
'forum' => array(
|
324 |
+
'label' => __( 'Support Forum', 'all-in-one-seo-pack' ),
|
325 |
+
'url' => 'http://semperplugins.com/support/',
|
326 |
+
),
|
327 |
+
|
328 |
+
'docs' => array(
|
329 |
+
'label' => __( 'Documentation', 'all-in-one-seo-pack' ),
|
330 |
+
'url' => 'http://semperplugins.com/documentation/',
|
331 |
+
),
|
332 |
+
|
333 |
+
);
|
334 |
+
|
335 |
+
unset( $actions['edit'] );
|
336 |
+
|
337 |
+
if ( ! AIOSEOPPRO ) {
|
338 |
+
$action_links['proupgrade'] =
|
339 |
+
array(
|
340 |
+
'label' => __( 'Upgrade to Pro', 'all-in-one-seo-pack' ),
|
341 |
+
'url' => 'http://semperplugins.com/plugins/all-in-one-seo-pack-pro-version/?loc=plugins',
|
342 |
+
|
343 |
+
);
|
344 |
+
}
|
345 |
+
|
346 |
+
return aiosp_action_links( $actions, $plugin_file, $action_links, 'before' );
|
347 |
+
}
|
348 |
+
}
|
349 |
+
|
350 |
+
if ( ! function_exists( 'aiosp_action_links' ) ) {
|
351 |
+
|
352 |
+
/**
|
353 |
+
* @param $actions
|
354 |
+
* @param $plugin_file
|
355 |
+
* @param array $action_links
|
356 |
+
* @param string $position
|
357 |
+
*
|
358 |
+
* @return array
|
359 |
+
*/
|
360 |
+
function aiosp_action_links( $actions, $plugin_file, $action_links = array(), $position = 'after' ) {
|
361 |
+
static $plugin;
|
362 |
+
if ( ! isset( $plugin ) ) {
|
363 |
+
$plugin = plugin_basename( __FILE__ );
|
364 |
+
}
|
365 |
+
if ( $plugin === $plugin_file && ! empty( $action_links ) ) {
|
366 |
+
foreach ( $action_links as $key => $value ) {
|
367 |
+
$link = array( $key => '<a href="' . $value['url'] . '">' . $value['label'] . '</a>' );
|
368 |
+
if ( 'after' === $position ) {
|
369 |
+
$actions = array_merge( $actions, $link );
|
370 |
+
} else {
|
371 |
+
$actions = array_merge( $link, $actions );
|
372 |
+
}
|
373 |
+
}//foreach
|
374 |
+
}// if
|
375 |
+
return $actions;
|
376 |
+
}
|
377 |
+
}
|
378 |
+
|
379 |
+
if ( ! function_exists( 'aioseop_init_class' ) ) {
|
380 |
+
function aioseop_init_class() {
|
381 |
+
global $aiosp;
|
382 |
+
load_plugin_textdomain( 'all-in-one-seo-pack', false, dirname( plugin_basename( __FILE__ ) ) . '/i18n/' );
|
383 |
+
require_once( AIOSEOP_PLUGIN_DIR . 'inc/aioseop_functions.php' );
|
384 |
+
require_once( AIOSEOP_PLUGIN_DIR . 'aioseop_class.php' );
|
385 |
+
require_once( AIOSEOP_PLUGIN_DIR . 'inc/aioseop_updates_class.php' );
|
386 |
+
require_once( AIOSEOP_PLUGIN_DIR . 'inc/commonstrings.php' );
|
387 |
+
require_once( AIOSEOP_PLUGIN_DIR . 'admin/display/postedit.php' );
|
388 |
+
require_once( AIOSEOP_PLUGIN_DIR . 'admin/display/general-metaboxes.php' );
|
389 |
+
require_once( AIOSEOP_PLUGIN_DIR . 'inc/aiosp_common.php' );
|
390 |
+
require_once( AIOSEOP_PLUGIN_DIR . 'admin/meta_import.php' );
|
391 |
+
require_once( AIOSEOP_PLUGIN_DIR . 'inc/translations.php' );
|
392 |
+
require_once( AIOSEOP_PLUGIN_DIR . 'public/opengraph.php' );
|
393 |
+
require_once( AIOSEOP_PLUGIN_DIR . 'inc/compatability/compat-init.php');
|
394 |
+
require_once( AIOSEOP_PLUGIN_DIR . 'public/front.php' );
|
395 |
+
require_once( AIOSEOP_PLUGIN_DIR . 'public/google-analytics.php' );
|
396 |
+
require_once( AIOSEOP_PLUGIN_DIR . 'admin/display/welcome.php' );
|
397 |
+
require_once( AIOSEOP_PLUGIN_DIR . 'admin/display/dashboard_widget.php' );
|
398 |
+
|
399 |
+
$aioseop_welcome = new aioseop_welcome(); // TODO move this to updates file.
|
400 |
+
|
401 |
+
if ( AIOSEOPPRO ) {
|
402 |
+
require_once( AIOSEOP_PLUGIN_DIR . 'pro/class-aio-pro-init.php' ); // Loads pro files and other pro init stuff.
|
403 |
+
}
|
404 |
+
aiosp_seometa_import(); // call importer functions... this should be moved somewhere better
|
405 |
+
|
406 |
+
$aiosp = new All_in_One_SEO_Pack();
|
407 |
+
|
408 |
+
$aioseop_updates = new AIOSEOP_Updates();
|
409 |
+
|
410 |
+
if ( AIOSEOPPRO ) {
|
411 |
+
$aioseop_pro_updates = new AIOSEOP_Pro_Updates();
|
412 |
+
add_action( 'admin_init', array( $aioseop_pro_updates, 'version_updates' ), 12 );
|
413 |
+
}
|
414 |
+
|
415 |
+
add_action( 'admin_init', 'aioseop_welcome' );
|
416 |
+
|
417 |
+
if ( aioseop_option_isset( 'aiosp_unprotect_meta' ) ) {
|
418 |
+
add_filter( 'is_protected_meta', 'aioseop_unprotect_meta', 10, 3 );
|
419 |
+
}
|
420 |
+
|
421 |
+
add_action( 'init', array( $aiosp, 'add_hooks' ) );
|
422 |
+
add_action( 'admin_init', array( $aioseop_updates, 'version_updates' ), 11 );
|
423 |
+
|
424 |
+
if ( defined( 'DOING_AJAX' ) && ! empty( $_POST ) && ! empty( $_POST['action'] ) && 'aioseop_ajax_scan_header' === $_POST['action'] ) {
|
425 |
+
remove_action( 'init', array( $aiosp, 'add_hooks' ) );
|
426 |
+
add_action( 'admin_init', 'aioseop_scan_post_header' );
|
427 |
+
add_action( 'shutdown', 'aioseop_ajax_scan_header' ); // if the action doesn't run -- pdb
|
428 |
+
include_once( ABSPATH . 'wp-admin/includes/screen.php' );
|
429 |
+
global $current_screen;
|
430 |
+
if ( class_exists( 'WP_Screen' ) ) {
|
431 |
+
$current_screen = WP_Screen::get( 'front' );
|
432 |
+
}
|
433 |
+
}
|
434 |
+
}
|
435 |
+
}
|
436 |
+
|
437 |
+
|
438 |
+
|
439 |
+
if ( ! function_exists( 'aioseop_welcome' ) ){
|
440 |
+
function aioseop_welcome(){
|
441 |
+
if( get_transient( '_aioseop_activation_redirect') ){
|
442 |
+
$aioseop_welcome = new aioseop_welcome();
|
443 |
+
delete_transient( '_aioseop_activation_redirect' );
|
444 |
+
$aioseop_welcome->init( TRUE );
|
445 |
+
}
|
446 |
+
|
447 |
+
}
|
448 |
+
}
|
449 |
+
|
450 |
+
add_action( 'init', 'aioseop_load_modules', 1 );
|
451 |
+
//add_action( 'after_setup_theme', 'aioseop_load_modules' );
|
452 |
+
|
453 |
+
if ( is_admin() ) {
|
454 |
+
add_action( 'wp_ajax_aioseop_ajax_save_meta', 'aioseop_ajax_save_meta' );
|
455 |
+
add_action( 'wp_ajax_aioseop_ajax_save_url', 'aioseop_ajax_save_url' );
|
456 |
+
add_action( 'wp_ajax_aioseop_ajax_delete_url', 'aioseop_ajax_delete_url' );
|
457 |
+
add_action( 'wp_ajax_aioseop_ajax_scan_header', 'aioseop_ajax_scan_header' );
|
458 |
+
if ( AIOSEOPPRO ) {
|
459 |
+
add_action( 'wp_ajax_aioseop_ajax_facebook_debug', 'aioseop_ajax_facebook_debug' );
|
460 |
+
}
|
461 |
+
add_action( 'wp_ajax_aioseop_ajax_save_settings', 'aioseop_ajax_save_settings' );
|
462 |
+
add_action( 'wp_ajax_aioseop_ajax_get_menu_links', 'aioseop_ajax_get_menu_links' );
|
463 |
+
add_action( 'wp_ajax_aioseo_dismiss_yst_notice', 'aioseop_update_yst_detected_notice' );
|
464 |
+
add_action( 'wp_ajax_aioseo_dismiss_visibility_notice', 'aioseop_update_user_visibilitynotice' );
|
465 |
+
add_action( 'wp_ajax_aioseo_dismiss_woo_upgrade_notice', 'aioseop_woo_upgrade_notice_dismissed' );
|
466 |
+
if ( AIOSEOPPRO ) {
|
467 |
+
add_action( 'wp_ajax_aioseop_ajax_update_oembed', 'aioseop_ajax_update_oembed' );
|
468 |
+
}
|
469 |
+
}
|
470 |
+
|
471 |
+
if ( ! function_exists( 'aioseop_scan_post_header' ) ) {
|
472 |
+
function aioseop_scan_post_header() {
|
473 |
+
require_once( ABSPATH . WPINC . '/default-filters.php' );
|
474 |
+
global $wp_query;
|
475 |
+
$wp_query->query_vars['paged'] = 0;
|
476 |
+
query_posts( 'post_type=post&posts_per_page=1' );
|
477 |
+
if ( have_posts() ) {
|
478 |
+
the_post();
|
479 |
+
}
|
480 |
+
}
|
481 |
+
}
|
482 |
+
|
483 |
+
require_once( AIOSEOP_PLUGIN_DIR . 'aioseop-init.php' );
|
484 |
+
|
485 |
+
if ( ! function_exists( 'aioseop_install' ) ) {
|
486 |
+
register_activation_hook( __FILE__, 'aioseop_install' );
|
487 |
+
|
488 |
+
function aioseop_install() {
|
489 |
+
aioseop_activate();
|
490 |
+
}
|
491 |
+
}
|
492 |
+
|
493 |
+
if ( ! function_exists( 'disable_all_in_one_free' ) ) {
|
494 |
+
function disable_all_in_one_free() {
|
495 |
+
if ( AIOSEOPPRO && is_plugin_active( 'all-in-one-seo-pack/all_in_one_seo_pack.php' ) ) {
|
496 |
+
deactivate_plugins( 'all-in-one-seo-pack/all_in_one_seo_pack.php' );
|
497 |
+
}
|
498 |
+
}
|
499 |
+
}
|
css/modules/aioseop_module.css
CHANGED
@@ -151,7 +151,7 @@ div.aioseop_tip_icon:before {
|
|
151 |
}
|
152 |
|
153 |
.aioseop_option_div {
|
154 |
-
max-height:
|
155 |
min-height: 43px;
|
156 |
width: 95%;
|
157 |
overflow-y: auto;
|
@@ -252,12 +252,6 @@ div.aioseop_tip_icon:before {
|
|
252 |
width: 423px;
|
253 |
}
|
254 |
|
255 |
-
.headwaythemes {
|
256 |
-
background-color: #FFFFFF;
|
257 |
-
padding-bottom: 110px;
|
258 |
-
height: 125px;
|
259 |
-
}
|
260 |
-
|
261 |
.aioseop_nopad {
|
262 |
padding-left: 0;
|
263 |
padding-top: 0;
|
@@ -440,6 +434,10 @@ body.all-in-one-seo_page_all-in-one-seo-pack-pro-aioseop_feature_manager .aioseo
|
|
440 |
margin-bottom: 0;
|
441 |
}
|
442 |
|
|
|
|
|
|
|
|
|
443 |
.aioseop_right_sidebar {
|
444 |
float: right;
|
445 |
margin-top: 35px;
|
@@ -501,7 +499,7 @@ div.aioseop_feature {
|
|
501 |
-moz-transition-duration: .4s;
|
502 |
}
|
503 |
|
504 |
-
.aioseop_feature
|
505 |
float: right;
|
506 |
margin-right: -7px;
|
507 |
background: none repeat scroll 0 0 #D23D46;
|
@@ -510,27 +508,41 @@ div.aioseop_feature {
|
|
510 |
position: relative;
|
511 |
}
|
512 |
|
513 |
-
.aioseop_feature
|
514 |
border-color: #D23D46 #D23D46 #D23D46 transparent;
|
515 |
-
|
516 |
-
|
517 |
-
|
518 |
-
|
519 |
-
|
520 |
-
|
521 |
}
|
522 |
|
523 |
-
.aioseop_feature
|
524 |
border-color: #892026 transparent transparent;
|
525 |
-
|
526 |
-
|
527 |
-
|
528 |
-
|
529 |
-
|
530 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
531 |
}
|
532 |
|
533 |
-
#aioseop_coming_soon
|
|
|
|
|
|
|
|
|
|
|
534 |
display: none;
|
535 |
}
|
536 |
|
@@ -1190,16 +1202,16 @@ div.aioseop_notice a.aioseop_dismiss_link {
|
|
1190 |
}
|
1191 |
|
1192 |
/* Fix for Chrome */
|
1193 |
-
@media screen and (-webkit-min-device-pixel-ratio:0) {
|
1194 |
-
|
1195 |
.aioseop_header_tabs li a.aioseop_header_tab {
|
1196 |
padding-bottom: 0;
|
1197 |
}
|
1198 |
}
|
1199 |
|
1200 |
/* Fix for Safari */
|
1201 |
-
_:-webkit-full-screen:not(:root:root), .aioseop_header_tabs li a.aioseop_header_tab {
|
1202 |
-
padding-bottom: 2px;
|
1203 |
}
|
1204 |
|
1205 |
.aioseop_header_tabs li:first-child a.aioseop_header_tab {
|
151 |
}
|
152 |
|
153 |
.aioseop_option_div {
|
154 |
+
max-height: 360px;
|
155 |
min-height: 43px;
|
156 |
width: 95%;
|
157 |
overflow-y: auto;
|
252 |
width: 423px;
|
253 |
}
|
254 |
|
|
|
|
|
|
|
|
|
|
|
|
|
255 |
.aioseop_nopad {
|
256 |
padding-left: 0;
|
257 |
padding-top: 0;
|
434 |
margin-bottom: 0;
|
435 |
}
|
436 |
|
437 |
+
.aioseop_top #aioseop-list.postbox.closed {
|
438 |
+
overflow: hidden;
|
439 |
+
}
|
440 |
+
|
441 |
.aioseop_right_sidebar {
|
442 |
float: right;
|
443 |
margin-top: 35px;
|
499 |
-moz-transition-duration: .4s;
|
500 |
}
|
501 |
|
502 |
+
.aioseop_feature .flag {
|
503 |
float: right;
|
504 |
margin-right: -7px;
|
505 |
background: none repeat scroll 0 0 #D23D46;
|
508 |
position: relative;
|
509 |
}
|
510 |
|
511 |
+
.aioseop_feature .flag:before {
|
512 |
border-color: #D23D46 #D23D46 #D23D46 transparent;
|
513 |
+
border-style: solid;
|
514 |
+
border-width: 14px 4px 15px 10px;
|
515 |
+
content: "";
|
516 |
+
left: -14px;
|
517 |
+
position: absolute;
|
518 |
+
top: 0;
|
519 |
}
|
520 |
|
521 |
+
.aioseop_feature .flag:after {
|
522 |
border-color: #892026 transparent transparent;
|
523 |
+
border-style: solid;
|
524 |
+
border-width: 6px 6px 6px 0;
|
525 |
+
bottom: -12px;
|
526 |
+
content: "";
|
527 |
+
position: absolute;
|
528 |
+
right: 0;
|
529 |
+
}
|
530 |
+
|
531 |
+
.aioseop_feature .flag.pro {
|
532 |
+
display: none;
|
533 |
+
}
|
534 |
+
|
535 |
+
#aioseop_coming_soon .free.flag,
|
536 |
+
.all-in-one-seo_page_all-in-one-seo-pack-pro-modules-aioseop_feature_manager .aioseop_feature .free.flag {
|
537 |
+
display: none;
|
538 |
}
|
539 |
|
540 |
+
#aioseop_coming_soon .flag.pro {
|
541 |
+
display: block;
|
542 |
+
margin-top: -30px;
|
543 |
+
}
|
544 |
+
|
545 |
+
.all-in-one-seo_page_all-in-one-seo-pack-pro-modules-aioseop_feature_manager #aioseop_coming_soon .flag.pro {
|
546 |
display: none;
|
547 |
}
|
548 |
|
1202 |
}
|
1203 |
|
1204 |
/* Fix for Chrome */
|
1205 |
+
@media screen and (-webkit-min-device-pixel-ratio:0) {
|
1206 |
+
|
1207 |
.aioseop_header_tabs li a.aioseop_header_tab {
|
1208 |
padding-bottom: 0;
|
1209 |
}
|
1210 |
}
|
1211 |
|
1212 |
/* Fix for Safari */
|
1213 |
+
_:-webkit-full-screen:not(:root:root), .aioseop_header_tabs li a.aioseop_header_tab {
|
1214 |
+
padding-bottom: 2px;
|
1215 |
}
|
1216 |
|
1217 |
.aioseop_header_tabs li:first-child a.aioseop_header_tab {
|
css/welcome.css
ADDED
@@ -0,0 +1,129 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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
|
images/headwaybanner.png
DELETED
Binary file
|
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 |
|
@@ -95,23 +95,6 @@ if ( ! function_exists( 'aioseop_mrt_mkarry' ) ) {
|
|
95 |
}
|
96 |
}
|
97 |
|
98 |
-
if ( ! function_exists( 'aioseop_activate_pl' ) ) {
|
99 |
-
/**
|
100 |
-
* @TODO see if this still gets used.
|
101 |
-
*/
|
102 |
-
function aioseop_activate_pl() {
|
103 |
-
if ( $aioseop_options = get_option( 'aioseop_options' ) ) {
|
104 |
-
$aioseop_options['aiosp_enabled'] = '0';
|
105 |
-
|
106 |
-
if ( empty( $aioseop_options['aiosp_posttypecolumns'] ) ) {
|
107 |
-
$aioseop_options['aiosp_posttypecolumns'] = array( 'post', 'page' );
|
108 |
-
}
|
109 |
-
|
110 |
-
update_option( 'aioseop_options', $aioseop_options );
|
111 |
-
}
|
112 |
-
}
|
113 |
-
}
|
114 |
-
|
115 |
if ( ! function_exists( 'aioseop_get_version' ) ) {
|
116 |
/**
|
117 |
* Returns the version.
|
@@ -144,14 +127,10 @@ if ( ! function_exists( 'aioseop_addmycolumns' ) ) {
|
|
144 |
/**
|
145 |
* Adds posttype columns.
|
146 |
*
|
147 |
-
* @TODO We should see if this is still being used, and move it either way.
|
148 |
*/
|
149 |
function aioseop_addmycolumns() {
|
150 |
-
global $
|
151 |
-
|
152 |
-
if ( ! empty( $aioseop_options ) && ! empty( $aioseop_options['aiosp_posttypecolumns'] ) ) {
|
153 |
-
$aiosp_posttypecolumns = $aioseop_options['aiosp_posttypecolumns'];
|
154 |
-
}
|
155 |
if ( ! empty( $pagenow ) && ( $pagenow === 'upload.php' ) ) {
|
156 |
$post_type = 'attachment';
|
157 |
} elseif ( ! isset( $_REQUEST['post_type'] ) ) {
|
@@ -160,7 +139,6 @@ if ( ! function_exists( 'aioseop_addmycolumns' ) ) {
|
|
160 |
$post_type = $_REQUEST['post_type'];
|
161 |
}
|
162 |
|
163 |
-
if ( is_array( $aiosp_posttypecolumns ) && in_array( $post_type, $aiosp_posttypecolumns ) ) {
|
164 |
add_action( 'admin_head', 'aioseop_admin_head' );
|
165 |
if ( $post_type === 'page' ) {
|
166 |
add_filter( 'manage_pages_columns', 'aioseop_mrt_pcolumns' );
|
@@ -176,7 +154,6 @@ if ( ! function_exists( 'aioseop_addmycolumns' ) ) {
|
|
176 |
} else {
|
177 |
add_action( 'manage_posts_custom_column', 'aioseop_mrt_pccolumn', 10, 2 );
|
178 |
}
|
179 |
-
}
|
180 |
}
|
181 |
}
|
182 |
|
@@ -974,57 +951,6 @@ if ( ! function_exists( 'aioseop_array_insert_after' ) ) {
|
|
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.
|
@@ -1042,6 +968,22 @@ if ( ! function_exists( 'fnmatch' ) ) {
|
|
1042 |
}
|
1043 |
}
|
1044 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1045 |
if ( ! function_exists( 'parse_ini_string' ) ) {
|
1046 |
/**
|
1047 |
* Parse_ini_string() doesn't exist 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 |
|
95 |
}
|
96 |
}
|
97 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
98 |
if ( ! function_exists( 'aioseop_get_version' ) ) {
|
99 |
/**
|
100 |
* Returns the version.
|
127 |
/**
|
128 |
* Adds posttype columns.
|
129 |
*
|
|
|
130 |
*/
|
131 |
function aioseop_addmycolumns() {
|
132 |
+
global $pagenow;
|
133 |
+
|
|
|
|
|
|
|
134 |
if ( ! empty( $pagenow ) && ( $pagenow === 'upload.php' ) ) {
|
135 |
$post_type = 'attachment';
|
136 |
} elseif ( ! isset( $_REQUEST['post_type'] ) ) {
|
139 |
$post_type = $_REQUEST['post_type'];
|
140 |
}
|
141 |
|
|
|
142 |
add_action( 'admin_head', 'aioseop_admin_head' );
|
143 |
if ( $post_type === 'page' ) {
|
144 |
add_filter( 'manage_pages_columns', 'aioseop_mrt_pcolumns' );
|
154 |
} else {
|
155 |
add_action( 'manage_posts_custom_column', 'aioseop_mrt_pccolumn', 10, 2 );
|
156 |
}
|
|
|
157 |
}
|
158 |
}
|
159 |
|
951 |
}
|
952 |
}
|
953 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
954 |
if ( ! function_exists( 'fnmatch' ) ) {
|
955 |
/**
|
956 |
* Support for fnmatch() doesn't exist on Windows pre PHP 5.3.
|
968 |
}
|
969 |
}
|
970 |
|
971 |
+
if ( ! function_exists('aiosp_log')) {
|
972 |
+
function aiosp_log ( $log ) {
|
973 |
+
|
974 |
+
global $aioseop_options;
|
975 |
+
|
976 |
+
if ( ! empty( $aioseop_options ) && isset( $aioseop_options['aiosp_do_log'] ) && $aioseop_options['aiosp_do_log'] ) {
|
977 |
+
|
978 |
+
if ( is_array( $log ) || is_object( $log ) ) {
|
979 |
+
error_log( print_r( $log, true ) );
|
980 |
+
} else {
|
981 |
+
error_log( $log );
|
982 |
+
}
|
983 |
+
}
|
984 |
+
}
|
985 |
+
}
|
986 |
+
|
987 |
if ( ! function_exists( 'parse_ini_string' ) ) {
|
988 |
/**
|
989 |
* Parse_ini_string() doesn't exist pre PHP 5.3.
|
inc/aioseop_updates_class.php
CHANGED
@@ -16,6 +16,7 @@ class AIOSEOP_Updates {
|
|
16 |
*
|
17 |
*/
|
18 |
function __construct() {
|
|
|
19 |
}
|
20 |
|
21 |
/**
|
@@ -54,6 +55,12 @@ class AIOSEOP_Updates {
|
|
54 |
$aioseop_options['last_active_version'] = AIOSEOP_VERSION;
|
55 |
$aiosp->update_class_option( $aioseop_options );
|
56 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
57 |
}
|
58 |
|
59 |
/**
|
@@ -63,6 +70,15 @@ class AIOSEOP_Updates {
|
|
63 |
$this->do_feature_updates();
|
64 |
}
|
65 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
66 |
/**
|
67 |
* Updates version.
|
68 |
*
|
16 |
*
|
17 |
*/
|
18 |
function __construct() {
|
19 |
+
|
20 |
}
|
21 |
|
22 |
/**
|
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 |
$this->do_feature_updates();
|
71 |
}
|
72 |
|
73 |
+
function aioseop_welcome(){
|
74 |
+
if ( get_transient( '_aioseop_activation_redirect' ) ) {
|
75 |
+
delete_transient( '_aioseop_activation_redirect' );
|
76 |
+
$aioseop_welcome = new aioseop_welcome();
|
77 |
+
$aioseop_welcome->init( TRUE );
|
78 |
+
}
|
79 |
+
|
80 |
+
}
|
81 |
+
|
82 |
/**
|
83 |
* Updates version.
|
84 |
*
|
inc/aiosp_calc_desc.php
CHANGED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
// We will eventually put stuff here.
|
inc/aiosp_calc_title.php
CHANGED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
// We will eventually put stuff here.
|
inc/aiosp_common.php
CHANGED
@@ -16,6 +16,13 @@ class aiosp_common {
|
|
16 |
//construct
|
17 |
}
|
18 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
19 |
|
20 |
/**
|
21 |
* @param null $p
|
16 |
//construct
|
17 |
}
|
18 |
|
19 |
+
static function clear_wpe_cache(){
|
20 |
+
if( class_exists( 'WpeCommon') ){
|
21 |
+
WpeCommon::purge_memcached();
|
22 |
+
WpeCommon::clear_maxcdn_cache();
|
23 |
+
WpeCommon::purge_varnish_cache();
|
24 |
+
}
|
25 |
+
}
|
26 |
|
27 |
/**
|
28 |
* @param null $p
|
inc/extlib/JSON.php
DELETED
@@ -1,804 +0,0 @@
|
|
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 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
inc/translations.php
CHANGED
@@ -42,6 +42,10 @@ if ( ! class_exists( 'AIOSEOP_Translations' ) ) :
|
|
42 |
|
43 |
$this->current_locale = get_locale();
|
44 |
|
|
|
|
|
|
|
|
|
45 |
$this->init();
|
46 |
|
47 |
}
|
42 |
|
43 |
$this->current_locale = get_locale();
|
44 |
|
45 |
+
if( $this->current_locale === 'en_US'){
|
46 |
+
return;
|
47 |
+
}
|
48 |
+
|
49 |
$this->init();
|
50 |
|
51 |
}
|
js/welcome.js
ADDED
@@ -0,0 +1,32 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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
|
189 |
}
|
190 |
}
|
191 |
}
|
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 |
}
|
modules/aioseop_importer_exporter.php
CHANGED
@@ -522,10 +522,7 @@ if ( ! class_exists( 'All_in_One_SEO_Pack_Importer_Exporter' ) ) {
|
|
522 |
// Sends File to browser
|
523 |
$strlength = strlen( $buf );
|
524 |
header( 'Content-type: application/ini' );
|
525 |
-
header(
|
526 |
-
"Content-Disposition:
|
527 |
-
attachment; filename=$settings_file"
|
528 |
-
);
|
529 |
header( 'Content-Length: ' . $strlength );
|
530 |
echo $buf;
|
531 |
die();
|
522 |
// Sends File to browser
|
523 |
$strlength = strlen( $buf );
|
524 |
header( 'Content-type: application/ini' );
|
525 |
+
header( "Content-Disposition: attachment; filename=$settings_file" );
|
|
|
|
|
|
|
526 |
header( 'Content-Length: ' . $strlength );
|
527 |
echo $buf;
|
528 |
die();
|
modules/aioseop_opengraph.php
CHANGED
@@ -82,8 +82,8 @@ if ( ! class_exists( 'All_in_One_SEO_Pack_Opengraph' ) ) {
|
|
82 |
|
83 |
$this->help_text = Array(
|
84 |
"setmeta" => __( "Checking this box will use the Home Title and Home Description set in All in One SEO Pack, General Settings as the Open Graph title and description for your home page.", 'all-in-one-seo-pack' ),
|
85 |
-
"key" => __( "Enter your Facebook Admin ID here.
|
86 |
-
"appid" => __( "Enter your Facebook App ID here. Information about how to get your Facebook App ID can be found at https://developers.facebook.com/docs/
|
87 |
"title_shortcodes" => __( "Run shortcodes that appear in social title meta tags.", 'all-in-one-seo-pack' ),
|
88 |
"description_shortcodes" => __( "Run shortcodes that appear in social description meta tags.", 'all-in-one-seo-pack' ),
|
89 |
"sitename" => __( "The Site Name is the name that is used to identify your website.", 'all-in-one-seo-pack' ),
|
82 |
|
83 |
$this->help_text = Array(
|
84 |
"setmeta" => __( "Checking this box will use the Home Title and Home Description set in All in One SEO Pack, General Settings as the Open Graph title and description for your home page.", 'all-in-one-seo-pack' ),
|
85 |
+
"key" => __( "Enter your Facebook Admin ID here. You can look up your Facebook ID using this tool http://findmyfbid.com/", 'all-in-one-seo-pack' ),
|
86 |
+
"appid" => __( "Enter your Facebook App ID here. Information about how to get your Facebook App ID can be found at https://developers.facebook.com/docs/apps/register", 'all-in-one-seo-pack' ),
|
87 |
"title_shortcodes" => __( "Run shortcodes that appear in social title meta tags.", 'all-in-one-seo-pack' ),
|
88 |
"description_shortcodes" => __( "Run shortcodes that appear in social description meta tags.", 'all-in-one-seo-pack' ),
|
89 |
"sitename" => __( "The Site Name is the name that is used to identify your website.", 'all-in-one-seo-pack' ),
|
modules/aioseop_performance.php
CHANGED
@@ -169,11 +169,6 @@ 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( '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,7 +239,6 @@ if ( ! class_exists( 'All_in_One_SEO_Pack_Performance' ) ) {
|
|
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,
|
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 |
__( '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,
|
modules/aioseop_sitemap.php
CHANGED
@@ -39,8 +39,6 @@ if ( ! class_exists( 'All_in_One_SEO_Pack_Sitemap' ) ) {
|
|
39 |
|
40 |
$this->help_text = array(
|
41 |
'filename' => __( "Specifies the name of your sitemap file. This will default to 'sitemap'.", 'all-in-one-seo-pack' ),
|
42 |
-
'google' => __( 'Notify Google when you update your sitemap settings.', 'all-in-one-seo-pack' ),
|
43 |
-
'bing' => __( 'Notify Bing when you update your sitemap settings.', 'all-in-one-seo-pack' ),
|
44 |
'daily_cron' => __( 'Notify search engines based on the selected schedule, and also update static sitemap daily if in use. (this uses WP-Cron, so make sure this is working properly on your server as well)', 'all-in-one-seo-pack' ),
|
45 |
'indexes' => __( 'Organize sitemap entries into distinct files in your sitemap. Enable this only if your sitemap contains over 50,000 URLs or the file is over 5MB in size.', 'all-in-one-seo-pack' ),
|
46 |
'paginate' => __( 'Split long sitemaps into separate files.', 'all-in-one-seo-pack' ),
|
@@ -52,7 +50,6 @@ if ( ! class_exists( 'All_in_One_SEO_Pack_Sitemap' ) ) {
|
|
52 |
'gzipped' => __( 'Create a compressed sitemap file in .xml.gz format.', 'all-in-one-seo-pack' ),
|
53 |
'robots' => __( 'Places a link to your Sitemap.xml into your virtual Robots.txt file.', 'all-in-one-seo-pack' ),
|
54 |
'rewrite' => __( 'Dynamically creates the XML sitemap instead of using a static file.', 'all-in-one-seo-pack' ),
|
55 |
-
'debug' => __( 'Use rewrites to generate your sitemap on the fly. NOTE: This is required for WordPress Multisite.', 'all-in-one-seo-pack' ),
|
56 |
'addl_url' => __( 'URL to the page.', 'all-in-one-seo-pack' ),
|
57 |
'addl_prio' => __( 'The priority of the page.', 'all-in-one-seo-pack' ),
|
58 |
'addl_freq' => __( 'The frequency of the page.', 'all-in-one-seo-pack' ),
|
@@ -63,8 +60,6 @@ if ( ! class_exists( 'All_in_One_SEO_Pack_Sitemap' ) ) {
|
|
63 |
|
64 |
$this->help_anchors = array(
|
65 |
'filename' => '#filename-prefix',
|
66 |
-
'google' => '#notify-google-bing',
|
67 |
-
'bing' => '#notify-google-bing',
|
68 |
'daily_cron' => '#schedule-updates',
|
69 |
'indexes' => '#enable-sitemap-indexes',
|
70 |
'paginate' => '#enable-sitemap-indexes',
|
@@ -91,8 +86,6 @@ if ( ! class_exists( 'All_in_One_SEO_Pack_Sitemap' ) ) {
|
|
91 |
'type' => 'text',
|
92 |
'sanitize' => 'filename',
|
93 |
),
|
94 |
-
'google' => array( 'name' => __( 'Notify Google', 'all-in-one-seo-pack' ) ),
|
95 |
-
'bing' => array( 'name' => __( 'Notify Bing', 'all-in-one-seo-pack' ) ),
|
96 |
'daily_cron' => array(
|
97 |
'name' => __( 'Schedule Updates', 'all-in-one-seo-pack' ),
|
98 |
'type' => 'select',
|
@@ -143,17 +136,6 @@ if ( ! class_exists( 'All_in_One_SEO_Pack_Sitemap' ) ) {
|
|
143 |
|
144 |
$status_options = array(
|
145 |
'link' => array( 'default' => '', 'type' => 'html', 'label' => 'none', 'save' => false ),
|
146 |
-
'debug' => array(
|
147 |
-
'name' => __( 'Debug Log', 'all-in-one-seo-pack' ),
|
148 |
-
'default' => '',
|
149 |
-
'type' => 'html',
|
150 |
-
'disabled' => 'disabled',
|
151 |
-
'save' => false,
|
152 |
-
'label' => 'none',
|
153 |
-
'rows' => 5,
|
154 |
-
'cols' => 120,
|
155 |
-
'style' => 'min-width:950px',
|
156 |
-
),
|
157 |
);
|
158 |
|
159 |
$this->layout = array(
|
@@ -630,18 +612,21 @@ if ( ! class_exists( 'All_in_One_SEO_Pack_Sitemap' ) ) {
|
|
630 |
$options[ $this->prefix . 'max_posts' ] = 50000;
|
631 |
}
|
632 |
$url = trailingslashit( get_home_url() ) . $options[ $this->prefix . 'filename' ] . '.xml';
|
633 |
-
$options[ $this->prefix . 'link' ] = sprintf( __( 'Please review your settings below and click %s to build your sitemap; then, %s.',
|
634 |
-
'all-in-one-seo-pack' ), sprintf( '<a href="#" onclick="document.dofollow.elements[\'Submit\'][0].click();">%s</a>',
|
635 |
-
__( 'Update Sitemap', 'all-in-one-seo-pack' ) ), '<a href="' . esc_url( $url ) . '" target="_blank">' .
|
636 |
-
__( 'view your sitemap', 'all-in-one-seo-pack' ) . '</a>' );
|
637 |
-
if ( $this->option_isset( 'rewrite' ) ) {
|
638 |
|
639 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
640 |
$rule = $this->get_rewrite_url( $url );
|
641 |
$rules = $this->get_rewrite_rules();
|
642 |
-
if ( in_array( $rule, $rules ) ) {
|
643 |
-
$options[ $this->prefix . 'link' ] .= '<p>' . __( 'Dynamic sitemap generation appears to be using the correct rewrite rules.', 'all-in-one-seo-pack' ) . '</p>';
|
644 |
-
} else {
|
645 |
$options[ $this->prefix . 'link' ] .= '<p>' . __( 'Dynamic sitemap generation does not appear to be using the correct rewrite rules; please disable any other sitemap plugins or functionality on your site and reset your permalinks.', 'all-in-one-seo-pack' ) . '</p>';
|
646 |
}
|
647 |
}
|
@@ -654,11 +639,6 @@ if ( ! class_exists( 'All_in_One_SEO_Pack_Sitemap' ) ) {
|
|
654 |
}
|
655 |
$options[ $this->prefix . 'link' ] .= '<p class="aioseop_error_notice">' . sprintf( __( 'Warning: your privacy settings are configured to ask search engines to not index your site; you can change this under %s for your blog.', 'all-in-one-seo-pack' ), $privacy_link );
|
656 |
}
|
657 |
-
if ( $this->option_isset( 'debug' ) ) {
|
658 |
-
$debug_msg = esc_html( $options["{$this->prefix}debug"] );
|
659 |
-
$options["{$this->prefix}debug"] = '<pre>' . $debug_msg . '</pre>';
|
660 |
-
}
|
661 |
-
|
662 |
return $options;
|
663 |
}
|
664 |
|
@@ -922,11 +902,13 @@ if ( ! class_exists( 'All_in_One_SEO_Pack_Sitemap' ) ) {
|
|
922 |
/**
|
923 |
* Get problem files.
|
924 |
*
|
925 |
-
* Get the list of potentially conflicting sitemap files.
|
926 |
*
|
927 |
* @param $files
|
928 |
* @param $msg
|
929 |
*
|
|
|
|
|
930 |
* @return array
|
931 |
*/
|
932 |
function get_problem_files( $files, &$msg ) {
|
@@ -976,6 +958,9 @@ if ( ! class_exists( 'All_in_One_SEO_Pack_Sitemap' ) ) {
|
|
976 |
$msg .= '<p>' . sprintf( __( 'Potential conflict with unknown file %s.', 'all-in-one-seo-pack' ), $f ) . "</p>\n";
|
977 |
$problem_files[] = $f;
|
978 |
}
|
|
|
|
|
|
|
979 |
}
|
980 |
}
|
981 |
}
|
@@ -1015,21 +1000,12 @@ if ( ! class_exists( 'All_in_One_SEO_Pack_Sitemap' ) ) {
|
|
1015 |
/**
|
1016 |
* Updates debug log messages.
|
1017 |
*
|
|
|
|
|
1018 |
* @param $msg
|
1019 |
*/
|
1020 |
function debug_message( $msg ) {
|
1021 |
-
|
1022 |
-
$this->options["{$this->prefix}debug"] = '';
|
1023 |
-
}
|
1024 |
-
$this->options["{$this->prefix}debug"] = date( 'Y-m-d H:i:s' ) . " {$msg}\n" . $this->options["{$this->prefix}debug"];
|
1025 |
-
if ( $this->strlen( $this->options["{$this->prefix}debug"] ) > 2048 ) {
|
1026 |
-
$end = $this->strrpos( $this->options["{$this->prefix}debug"], "\n" );
|
1027 |
-
if ( false === $end ) {
|
1028 |
-
$end = 2048;
|
1029 |
-
}
|
1030 |
-
$this->options["{$this->prefix}debug"] = $this->substr( $this->options["{$this->prefix}debug"], 0, $end );
|
1031 |
-
}
|
1032 |
-
$this->update_class_option( $this->options );
|
1033 |
}
|
1034 |
|
1035 |
/**
|
@@ -1282,27 +1258,34 @@ if ( ! class_exists( 'All_in_One_SEO_Pack_Sitemap' ) ) {
|
|
1282 |
* Notify search engines, do logging.
|
1283 |
*/
|
1284 |
function do_notify() {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1285 |
$notify_url = array(
|
1286 |
'google' => 'http://www.google.com/webmasters/sitemaps/ping?sitemap=',
|
1287 |
'bing' => 'http://www.bing.com/webmaster/ping.aspx?siteMap=',
|
1288 |
);
|
1289 |
|
|
|
|
|
1290 |
$url = $this->get_sitemap_url();
|
1291 |
if ( ! empty( $url ) ) {
|
1292 |
foreach ( $notify_url as $k => $v ) {
|
1293 |
-
|
1294 |
-
|
1295 |
-
if (
|
1296 |
-
|
1297 |
-
$this->debug_message( sprintf( __( 'Successfully notified %s about changes to your sitemap at %s.', 'all-in-one-seo-pack' ), $k, $url ) );
|
1298 |
-
} else {
|
1299 |
-
$this->debug_message( sprintf( __( 'Failed to notify %s about changes to your sitemap at %s, error code %s.', 'all-in-one-seo-pack' ), $k, $url, $response['response']['code'] ) );
|
1300 |
-
}
|
1301 |
-
} else {
|
1302 |
-
$this->debug_message( sprintf( __( 'Failed to notify %s about changes to your sitemap at %s, unable to access via wp_remote_get().', 'all-in-one-seo-pack' ), $k, $url ) );
|
1303 |
}
|
1304 |
} else {
|
1305 |
-
$this->debug_message( sprintf( __( '
|
1306 |
}
|
1307 |
}
|
1308 |
}
|
@@ -1351,8 +1334,6 @@ if ( ! class_exists( 'All_in_One_SEO_Pack_Sitemap' ) ) {
|
|
1351 |
$this->do_notify();
|
1352 |
if ( ! empty( $message ) && is_string( $message ) ) {
|
1353 |
$this->debug_message( $message );
|
1354 |
-
} else {
|
1355 |
-
$this->debug_message( __( 'Updated sitemap settings.', 'all-in-one-seo-pack' ) );
|
1356 |
}
|
1357 |
}
|
1358 |
|
39 |
|
40 |
$this->help_text = array(
|
41 |
'filename' => __( "Specifies the name of your sitemap file. This will default to 'sitemap'.", 'all-in-one-seo-pack' ),
|
|
|
|
|
42 |
'daily_cron' => __( 'Notify search engines based on the selected schedule, and also update static sitemap daily if in use. (this uses WP-Cron, so make sure this is working properly on your server as well)', 'all-in-one-seo-pack' ),
|
43 |
'indexes' => __( 'Organize sitemap entries into distinct files in your sitemap. Enable this only if your sitemap contains over 50,000 URLs or the file is over 5MB in size.', 'all-in-one-seo-pack' ),
|
44 |
'paginate' => __( 'Split long sitemaps into separate files.', 'all-in-one-seo-pack' ),
|
50 |
'gzipped' => __( 'Create a compressed sitemap file in .xml.gz format.', 'all-in-one-seo-pack' ),
|
51 |
'robots' => __( 'Places a link to your Sitemap.xml into your virtual Robots.txt file.', 'all-in-one-seo-pack' ),
|
52 |
'rewrite' => __( 'Dynamically creates the XML sitemap instead of using a static file.', 'all-in-one-seo-pack' ),
|
|
|
53 |
'addl_url' => __( 'URL to the page.', 'all-in-one-seo-pack' ),
|
54 |
'addl_prio' => __( 'The priority of the page.', 'all-in-one-seo-pack' ),
|
55 |
'addl_freq' => __( 'The frequency of the page.', 'all-in-one-seo-pack' ),
|
60 |
|
61 |
$this->help_anchors = array(
|
62 |
'filename' => '#filename-prefix',
|
|
|
|
|
63 |
'daily_cron' => '#schedule-updates',
|
64 |
'indexes' => '#enable-sitemap-indexes',
|
65 |
'paginate' => '#enable-sitemap-indexes',
|
86 |
'type' => 'text',
|
87 |
'sanitize' => 'filename',
|
88 |
),
|
|
|
|
|
89 |
'daily_cron' => array(
|
90 |
'name' => __( 'Schedule Updates', 'all-in-one-seo-pack' ),
|
91 |
'type' => 'select',
|
136 |
|
137 |
$status_options = array(
|
138 |
'link' => array( 'default' => '', 'type' => 'html', 'label' => 'none', 'save' => false ),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
139 |
);
|
140 |
|
141 |
$this->layout = array(
|
612 |
$options[ $this->prefix . 'max_posts' ] = 50000;
|
613 |
}
|
614 |
$url = trailingslashit( get_home_url() ) . $options[ $this->prefix . 'filename' ] . '.xml';
|
|
|
|
|
|
|
|
|
|
|
615 |
|
616 |
+
$options[ $this->prefix . 'link' ] = sprintf( __( 'Click here to %s.', 'all-in-one-seo-pack' ), '<a href="' . esc_url( $url ) . '" target="_blank">' . __( 'view your sitemap', 'all-in-one-seo-pack' ) . '</a>' );
|
617 |
+
$options[ $this->prefix . 'link' ] .= __( ' Your sitemap has been created', 'all-in-one-seo-pack' );
|
618 |
+
if ( '0' !== get_option( 'blog_public' ) ){
|
619 |
+
$options[ $this->prefix . 'link' ] .= __( ' and changes are automatically submitted to search engines' );
|
620 |
+
}
|
621 |
+
$options[ $this->prefix . 'link' ] .= '.';
|
622 |
+
|
623 |
+
|
624 |
+
|
625 |
+
|
626 |
+
if ( $this->option_isset( 'rewrite' ) ) {
|
627 |
$rule = $this->get_rewrite_url( $url );
|
628 |
$rules = $this->get_rewrite_rules();
|
629 |
+
if ( ! in_array( $rule, $rules ) ) {
|
|
|
|
|
630 |
$options[ $this->prefix . 'link' ] .= '<p>' . __( 'Dynamic sitemap generation does not appear to be using the correct rewrite rules; please disable any other sitemap plugins or functionality on your site and reset your permalinks.', 'all-in-one-seo-pack' ) . '</p>';
|
631 |
}
|
632 |
}
|
639 |
}
|
640 |
$options[ $this->prefix . 'link' ] .= '<p class="aioseop_error_notice">' . sprintf( __( 'Warning: your privacy settings are configured to ask search engines to not index your site; you can change this under %s for your blog.', 'all-in-one-seo-pack' ), $privacy_link );
|
641 |
}
|
|
|
|
|
|
|
|
|
|
|
642 |
return $options;
|
643 |
}
|
644 |
|
902 |
/**
|
903 |
* Get problem files.
|
904 |
*
|
905 |
+
* Get the list of potentially conflicting sitemap files, identify whether they came from us, are blank, or are of unknown origin.
|
906 |
*
|
907 |
* @param $files
|
908 |
* @param $msg
|
909 |
*
|
910 |
+
* In 2.3.10 we added the ability to see empty sitemap files as well.
|
911 |
+
*
|
912 |
* @return array
|
913 |
*/
|
914 |
function get_problem_files( $files, &$msg ) {
|
958 |
$msg .= '<p>' . sprintf( __( 'Potential conflict with unknown file %s.', 'all-in-one-seo-pack' ), $f ) . "</p>\n";
|
959 |
$problem_files[] = $f;
|
960 |
}
|
961 |
+
} else {
|
962 |
+
$msg .= '<p>' . sprintf( __( 'Potential conflict with empty file %s.', 'all-in-one-seo-pack' ), $f ) . "</p>\n";
|
963 |
+
$problem_files[] = $f;
|
964 |
}
|
965 |
}
|
966 |
}
|
1000 |
/**
|
1001 |
* Updates debug log messages.
|
1002 |
*
|
1003 |
+
* Deprecated as of 2.3.10 in favor of WP debug log. We should eventually remove this.
|
1004 |
+
*
|
1005 |
* @param $msg
|
1006 |
*/
|
1007 |
function debug_message( $msg ) {
|
1008 |
+
aiosp_log( $msg );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1009 |
}
|
1010 |
|
1011 |
/**
|
1258 |
* Notify search engines, do logging.
|
1259 |
*/
|
1260 |
function do_notify() {
|
1261 |
+
|
1262 |
+
if ( '0' === get_option( 'blog_public' ) ) {
|
1263 |
+
// Don't ping search engines if blog is set to not public.
|
1264 |
+
return;
|
1265 |
+
}
|
1266 |
+
|
1267 |
+
if ( apply_filters( 'aioseo_sitemap_ping', true ) === false ) {
|
1268 |
+
// API filter hook to disable sending sitemaps to search engines.
|
1269 |
+
return;
|
1270 |
+
}
|
1271 |
+
|
1272 |
$notify_url = array(
|
1273 |
'google' => 'http://www.google.com/webmasters/sitemaps/ping?sitemap=',
|
1274 |
'bing' => 'http://www.bing.com/webmaster/ping.aspx?siteMap=',
|
1275 |
);
|
1276 |
|
1277 |
+
$notify_url = apply_filters( 'aioseo_sitemap_ping_urls', $notify_url );
|
1278 |
+
|
1279 |
$url = $this->get_sitemap_url();
|
1280 |
if ( ! empty( $url ) ) {
|
1281 |
foreach ( $notify_url as $k => $v ) {
|
1282 |
+
$response = wp_remote_get( $notify_url[ $k ] . urlencode( $url ) );
|
1283 |
+
if ( is_array( $response ) && ! empty( $response['response'] ) && ! empty( $response['response']['code'] ) ) {
|
1284 |
+
if ( 200 != $response['response']['code'] ) {
|
1285 |
+
$this->debug_message( sprintf( __( 'Failed to notify %s about changes to your sitemap at %s, error code %s.', 'all-in-one-seo-pack' ), $k, $url, $response['response']['code'] ) );
|
|
|
|
|
|
|
|
|
|
|
|
|
1286 |
}
|
1287 |
} else {
|
1288 |
+
$this->debug_message( sprintf( __( 'Failed to notify %s about changes to your sitemap at %s, unable to access via wp_remote_get().', 'all-in-one-seo-pack' ), $k, $url ) );
|
1289 |
}
|
1290 |
}
|
1291 |
}
|
1334 |
$this->do_notify();
|
1335 |
if ( ! empty( $message ) && is_string( $message ) ) {
|
1336 |
$this->debug_message( $message );
|
|
|
|
|
1337 |
}
|
1338 |
}
|
1339 |
|
public/google-analytics.php
ADDED
@@ -0,0 +1,266 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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,13 +2,13 @@
|
|
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¤cy_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:
|
6 |
-
Tested up to: 4.
|
7 |
-
Stable tag: 2.3.
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
11 |
-
|
12 |
|
13 |
== Description ==
|
14 |
|
@@ -18,12 +18,13 @@ The most downloaded plugin for WordPress (almost 30 million downloads). Use All
|
|
18 |
|
19 |
[Premium Support](http://semperplugins.com/support/?loc=readme_ps)
|
20 |
|
21 |
-
First created in 2007, see why AIOSEO is the most downloaded
|
22 |
|
23 |
* XML Sitemap support - submit your sitemap to Google and Bing and improve your SEO
|
24 |
* Google Analytics support
|
25 |
* Support for SEO on Custom Post Types
|
26 |
* Advanced Canonical URLs
|
|
|
27 |
* Automatically notifies search engines like Google and Bing about changes to your site
|
28 |
* Built-in API so other plugins/themes can access and extend functionality
|
29 |
* ONLY free plugin to provide SEO Integration for e-Commerce sites, including WooCommerce
|
@@ -37,6 +38,7 @@ 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 |
|
41 |
Follow me on Twitter to keep up with the latest updates [Michael
|
42 |
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¤cy_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.10
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
11 |
+
One of the most downloaded plugins for WordPress (over 30 million downloads since 2007). Use All in One SEO Pack to automatically optimize your site for Search Engines.
|
12 |
|
13 |
== Description ==
|
14 |
|
18 |
|
19 |
[Premium Support](http://semperplugins.com/support/?loc=readme_ps)
|
20 |
|
21 |
+
First created in 2007, see why AIOSEO is one of the all time most downloaded plugins for WordPress.
|
22 |
|
23 |
* XML Sitemap support - submit your sitemap to Google and Bing and improve your SEO
|
24 |
* Google Analytics support
|
25 |
* Support for SEO on Custom Post Types
|
26 |
* Advanced Canonical URLs
|
27 |
+
* Redirect attachment pages to parent post
|
28 |
* Automatically notifies search engines like Google and Bing about changes to your site
|
29 |
* Built-in API so other plugins/themes can access and extend functionality
|
30 |
* ONLY free plugin to provide SEO Integration for e-Commerce sites, including WooCommerce
|
38 |
* You can override any title and set any META description and any META keywords you want.
|
39 |
* Compatibility with many other plugins
|
40 |
* Translated into 57 languages
|
41 |
+
* PHP 7 100% Compatible
|
42 |
|
43 |
Follow me on Twitter to keep up with the latest updates [Michael
|
44 |
Torbert](http://twitter.com/michaeltorbert/)
|