diff --git a/wp-content/plugins/all-in-one-seo-pack/CONTRIBUTING.md b/wp-content/plugins/all-in-one-seo-pack/CONTRIBUTING.md
deleted file mode 100755
index 76c13c9419..0000000000
--- a/wp-content/plugins/all-in-one-seo-pack/CONTRIBUTING.md
+++ /dev/null
@@ -1,154 +0,0 @@
-# Contributing to All in One SEO Pack
-
-So you'd like to contribute to an open source project? You're awesome!
-
-- [Reporting bugs](#reporting-bugs)
-- [Feature ideas](#feature-ideas)
-- [Contributing code](#contributing-code)
-- [Translating](#translating)
-
-
-## Reporting bugs
-
-1. Support issues (white screen of death, plugin/theme conflict, post meta or titles not showing up, etc.) should go to the [**support forums**](http://semperplugins.com/support/). Make sure you're reporting a true AIOSEOP issue here. First do some [basic debugging](http://semperplugins.com/faqs/how-to-troubleshoot-issues-with-our-plugins/).
-2. [**Search** the issues](https://github.com/semperfiwebdesign/all-in-one-seo-pack/issues) first.
-3. [Open a new issue](https://github.com/semperfiwebdesign/all-in-one-seo-pack/issues/new).
-
-What makes the issue really helpful:
-
-- You articulate the problem clearly and provide **steps to reproduce** the problem.
-- **Screenshots or GIFs** are appreciated.
-
-
-## Feature ideas
-
-Ideas are great. All in One SEO Pack needs them. There are so many difficult problems still to solve, and so many opportunities to make the project better. :bulb: :bulb: :bulb:
-
-[Submit a new feature request](https://github.com/semperfiwebdesign/all-in-one-seo-pack/issues/new) and start a discussion.
-
-
-## Contributing code
-
-Generally:
-
-1. Open a new issue / pick an existing one
-2. Fork the repo, create a branch, commit to it
-3. Push the branch, open a pull request
-4. The core team will review it and work with you if necessary
-5. Someone from the core team will merge the PR
-6. :tada:
-
-Smaller changes like updating README's etc. don't need to use the full workflow, a direct PR or sometimes even a commit into `master` is fine. However, most code changes undergo the suggested workflow which is described in more detail [below](#development-workflow).
-
-The following discusses some of the important details if you want to contribute.
-
-### Core values
-
-- **We care about user / dev experience**. Everything that is outward-facing, be it a user interface, developer API or a file format, must be carefully designed for usability and usefulness. We invest our energy to save it for the others.
-- **We care about code quality**. Bad code is a liability, not an asset. We value tests, review each other's code and try to make it good and clean.
-- **We try to be pragmatic**. While we care about quality, the main thing for All in One SEO Pack and its users is to move forward. We're always looking for the right balance.
-
-
-### Our development process
-
-**Major versions** (2.0, 2.1 etc.) are released every few months. Each major version has a [corresponding milestone](https://github.com/semperfiwebdesign/all-in-one-seo-pack/milestones/) and issues are assigned to it by the core team. Issues not assigned to any milestone are in a backlog – we want to do them one day but there's no immediate plans yet.
-
-**Issues** are the most important tool to plan and manage almost everything around VersionPress:
-
-- We create them for new features, bugs, improvements or even larger things like planning documents. **We strongly prefer issues over wiki** or other documents as they are actionable and time-framed.
-- [This set of **labels**](https://github.com/semperfiwebdesign/all-in-one-seo-pack/wiki/Issues#labels) is used to categorize issues.
-- Issues go through **four states**: 'open', 'in progress', 'in review' and 'closed'. There's an [**overv.io board**](https://overv.io/workspace/JanVoracek/cautious-tarsier/) board to visualize that. Also, overv.io helps us set priorities – tickets higher up will be worked on first.
-
-Regarding **branches**, the current release being worked on is **`development`**. It is hence inherently unsafe, even though we do our best to keep it in a good shape. **`Master`** is typically relatively stable.
-
-
-### Development workflow
-
-For small / "safe" changes like updating a README or other Markdown files, quick pull request or even commit into `master` is acceptable. However, for most new code, we use the [GitHub flow](https://guides.github.com/introduction/flow/):
-
-![GitHub Flow](https://guides.github.com/activities/hello-world/branching.png)
-
-Here are the details:
-
-
-1. When you start working on an issue, **move it to the 'in progress' state** (either visually on the [overv.io board](https://overv.io/workspace/JanVoracek/cautious-tarsier/) or by assigning the `in progress` label to the issue) and **create a new feature branch** for it. Name it `-`, e.g., `123-row-filtering`.
-
- - **Every feature branch should branch off of master**, not another feature branch, even if it depends on it. For dependent feature branches, simply merge between them. This is mainly because when you're going to open a PR for it, you will need to select the target branch (GitHub doesn't let you to change this later) and `master` is the only sensible choice there.
-
-2. **Commit to this branch**. We appreciate good commits, here are some tips:
-
- - **Keep commits small and focused**. There are many articles on version control best practices, e.g., [this one](http://www.git-tower.com/learn/git/ebook/command-line/appendix/best-practices) is good. To sum it up, commit small logical changes, prefer smaller commits over large ones and keep project in a workable state at all times.
- - **Write good commit messages**. We don't have strict rules like [this](http://chris.beams.io/posts/git-commit/), e.g., we don't enforce short subject lines. The main thing for us is that the commit messages are *useful*. Do they make it clear what happened in a commit? Do they reference related commits, if applicable? Good.
- - We most commonly use past tense ("Added tests") or present tense describing the new situation ("IniSerializer now has tests") but we're not religious about it.
- - **Link to an issue from the commit message**. Most of the commit messages look like this:
-
- ```
- [#123] Implemented xyz
- ```
-
- It means that the commit belongs to issue `#123`. It makes looking up issues from commits easier.
-
-
-3. When ready, push the branch, **open a pull request** for it and **move the issue to the 'in review' state** (again, either visually in [overv.io](https://overv.io/workspace/JanVoracek/cautious-tarsier/) or by removing the `in progress` label and adding the `in review` one). You can open a PR early to gather feedback, no worries, you can always add commits to it later. The branch can be push-forced if necessary, it is a "sandbox" to make it great.
-
- This is an example of a good pull request: [versionpress/versionpress#744](https://github.com/versionpress/versionpress/pull/744). The body usually contains something like:
-
- Resolves #123.
-
- Some notes on the implementation here if it's not obvious from the code
- or the list of commits.
-
- Reviewers:
-
- - [ ] @JanVoracek
- - [ ] @borekb
-
- It will be pre-filled for you automatically via GitHub templates, just with a different reviewer (`@versionpress/core-devs` will be there by default, someone from the core team will update it to the actual list of people).
-
-4. **Core team reviews the PR**. Expect feedback – it is uncommon to receive none – and be open to it. The team will happily work with you to make the code contribution great.
-
- All checkboxes checked means that the PR is OK to merge.
-
- > This is an important nuance because the checkbox can have two meanings: "PR is OK to merge" or "I am done with the review (regardless of whether I still see issues with the code or not)". The former is useful for the one who will eventually perform the merge, the latter is more convenient for a reviewer. We use the first meaning which means that I, as a reviewer, will only check the checkbox after I reported some issues with the code **and they have been fixed**.
-
-5. Someone from the core team **merges the pull request**, issue is closed and the branch can be deleted.
-
-A couple of notes:
-
-- As noted above, small / safe changes don't need to undergo this whole process. For example, Markdown files can be **committed directly into `master`** if the changes don't need to be reviewed.
-- We used to use **rebasing** in the past – you can still see that in commits before April 2015 – but left it in favor of merging which is much more natural on GitHub. Plus, rebases [have their own issues](http://geekblog.oneandoneis2.org/index.php/2013/04/30/please-stay-away-from-rebase).
-- **Issues vs. pull requests**: most of the new improvements and features start as issues as they are quick to create and don't require a Git branch. Then there's usually a single PR against the issue (sometimes more but that's relatively rare). However, issues and pull requests are almost the same thing on GitHub and it's not a problem to start something (possibly simpler) directly as a PR.
-
-
-### Style guides
-
-All in Code should follow the [WordPress Coding Standards](https://make.wordpress.org/core/handbook/best-practices/coding-standards/) and [WordPress Documentation Standards](https://make.wordpress.org/core/handbook/best-practices/inline-documentation-standards/).
-
-#### PHP style guide
-
-[WordPress PHP Coding Standards](https://make.wordpress.org/core/handbook/best-practices/coding-standards/php/)
-
-[WordPress PHP Documentation Standards](https://make.wordpress.org/core/handbook/best-practices/inline-documentation-standards/php/)
-
-There are tools out there for apps like Netbeans and PHPStorm to apply WordPress Coding Standards.
-
-
-#### JavaScript style guide
-
-[WordPress Javascript Coding Standards](https://make.wordpress.org/core/handbook/best-practices/coding-standards/javascript/)
-
-[WordPress Javascript Documentation](https://make.wordpress.org/core/handbook/best-practices/inline-documentation-standards/javascript/)
-
-
-
-## Translating
-
-We would love your help translating the project into your language. [Translations](https://translate.wordpress.org/projects/wp-plugins/all-in-one-seo-pack)
-
-
-*more instructions coming soon
-
-
----
-
-Other ideas of how to contribute? [Tell us](http://semperplugins.com/contact).
diff --git a/wp-content/plugins/all-in-one-seo-pack/admin/aioseop_module_class.php b/wp-content/plugins/all-in-one-seo-pack/admin/aioseop_module_class.php
index c10ca5bbdf..9f1cd0f7d9 100644
--- a/wp-content/plugins/all-in-one-seo-pack/admin/aioseop_module_class.php
+++ b/wp-content/plugins/all-in-one-seo-pack/admin/aioseop_module_class.php
@@ -5,7 +5,7 @@
/**
* The module base class; handles settings, options, menus, metaboxes, etc.
*/
-if ( !class_exists( 'All_in_One_SEO_Pack_Module' ) ) {
+if ( ! class_exists( 'All_in_One_SEO_Pack_Module' ) ) {
abstract class All_in_One_SEO_Pack_Module {
public static $instance = null;
protected $plugin_name;
@@ -16,59 +16,65 @@ abstract class All_in_One_SEO_Pack_Module {
protected $options;
protected $option_name;
protected $default_options;
- protected $help_text = Array();
- protected $help_anchors = Array();
- protected $locations = null; // organize settings into settings pages with a menu items and/or metaboxes on post types edit screen; optional
- protected $layout = null; // organize settings on a settings page into multiple, separate metaboxes; optional
- protected $tabs = null; // organize layouts on a settings page into multiple, separate tabs; optional
- protected $current_tab = null; // the current tab
- protected $pagehook = null; // the current page hook
+ protected $help_text = array();
+ protected $help_anchors = array();
+ protected $locations = null; // organize settings into settings pages with a menu items and/or metaboxes on post types edit screen; optional
+ protected $layout = null; // organize settings on a settings page into multiple, separate metaboxes; optional
+ protected $tabs = null; // organize layouts on a settings page into multiple, separate tabs; optional
+ protected $current_tab = null; // the current tab
+ protected $pagehook = null; // the current page hook
protected $store_option = false;
protected $parent_option = 'aioseop_options';
- protected $post_metaboxes = Array();
+ protected $post_metaboxes = array();
protected $tabbed_metaboxes = true;
protected $credentials = false; // used for WP Filesystem
- protected $script_data = null; // used for passing data to JavaScript
+ protected $script_data = null; // used for passing data to JavaScript
protected $plugin_path = null;
- protected $pointers = Array();
+ protected $pointers = array();
protected $form = 'dofollow';
-
+
/**
* Handles calls to display_settings_page_{$location}, does error checking.
*/
function __call( $name, $arguments ) {
- if ( $this->strpos( $name, "display_settings_page_" ) === 0 )
+ if ( $this->strpos( $name, 'display_settings_page_' ) === 0 ) {
return $this->display_settings_page( $this->substr( $name, 22 ) );
+ }
$error = __( sprintf( "Method %s doesn't exist", $name ), 'all-in-one-seo-pack' );
- if ( class_exists( 'BadMethodCallException' ) )
+ if ( class_exists( 'BadMethodCallException' ) ) {
throw new BadMethodCallException( $error );
+ }
throw new Exception( $error );
}
-
+
function __construct() {
- if ( empty( $this->file ) ) $this->file = __FILE__;
+ if ( empty( $this->file ) ) {
+ $this->file = __FILE__;
+ }
$this->plugin_name = AIOSEOP_PLUGIN_NAME;
- $this->plugin_path = Array();
+ $this->plugin_path = array();
// $this->plugin_path['dir'] = plugin_dir_path( $this->file );
- $this->plugin_path['basename'] = plugin_basename( $this->file );
- $this->plugin_path['dirname'] = dirname( $this->plugin_path['basename'] );
- $this->plugin_path['url'] = plugin_dir_url( $this->file );
- $this->plugin_path['images_url'] = $this->plugin_path['url'] . 'images';
+ $this->plugin_path['basename'] = plugin_basename( $this->file );
+ $this->plugin_path['dirname'] = dirname( $this->plugin_path['basename'] );
+ $this->plugin_path['url'] = plugin_dir_url( $this->file );
+ $this->plugin_path['images_url'] = $this->plugin_path['url'] . 'images';
$this->script_data['plugin_path'] = $this->plugin_path;
}
/**
* Get options for module, stored individually or together.
*/
- function get_class_option( ) {
+ function get_class_option() {
$option_name = $this->get_option_name();
if ( $this->store_option || $option_name == $this->parent_option ) {
return get_option( $option_name );
} else {
$option = get_option( $this->parent_option );
- if ( isset( $option['modules'] ) && isset( $option['modules'][$option_name] ) )
- return $option['modules'][$option_name];
+ if ( isset( $option['modules'] ) && isset( $option['modules'][ $option_name ] ) ) {
+ return $option['modules'][ $option_name ];
+ }
}
+
return false;
}
@@ -76,18 +82,22 @@ function get_class_option( ) {
* Update options for module, stored individually or together.
*/
function update_class_option( $option_data, $option_name = false ) {
- if ( $option_name == false )
+ if ( $option_name == false ) {
$option_name = $this->get_option_name();
+ }
if ( $this->store_option || $option_name == $this->parent_option ) {
return update_option( $option_name, $option_data );
} else {
$option = get_option( $this->parent_option );
- if ( !isset( $option['modules'] ) ) $option['modules'] = Array();
- $option['modules'][$option_name] = $option_data;
+ if ( ! isset( $option['modules'] ) ) {
+ $option['modules'] = array();
+ }
+ $option['modules'][ $option_name ] = $option_data;
+
return update_option( $this->parent_option, $option );
}
}
-
+
/**
* Delete options for module, stored individually or together.
*/
@@ -97,11 +107,13 @@ function delete_class_option( $delete = false ) {
delete_option( $option_name );
} else {
$option = get_option( $this->parent_option );
- if ( isset( $option['modules'] ) && isset( $option['modules'][$option_name] ) ) {
- unset( $option['modules'][$option_name] );
+ if ( isset( $option['modules'] ) && isset( $option['modules'][ $option_name ] ) ) {
+ unset( $option['modules'][ $option_name ] );
+
return update_option( $this->parent_option, $option );
}
}
+
return false;
}
@@ -109,8 +121,10 @@ function delete_class_option( $delete = false ) {
* Get the option name with prefix.
*/
function get_option_name() {
- if ( !isset( $this->option_name ) || empty( $this->option_name ) )
+ if ( ! isset( $this->option_name ) || empty( $this->option_name ) ) {
$this->option_name = $this->prefix . 'options';
+ }
+
return $this->option_name;
}
@@ -119,50 +133,60 @@ function get_option_name() {
*/
function option_isset( $option, $location = null ) {
$prefix = $this->get_prefix( $location );
- $opt = $prefix . $option;
- return ( ( isset( $this->options[$opt] ) ) && $this->options[$opt] );
+ $opt = $prefix . $option;
+
+ return ( isset( $this->options[ $opt ] ) && $this->options[ $opt ] );
}
-
+
/*** Case conversion; handle non UTF-8 encodings and fallback ***/
function convert_case( $str, $mode = 'upper' ) {
static $charset = null;
- if ( $charset == null ) $charset = get_bloginfo( 'charset' );
- $str = (string)$str;
+ if ( $charset == null ) {
+ $charset = get_bloginfo( 'charset' );
+ }
+ $str = (string) $str;
if ( $mode == 'title' ) {
- if ( function_exists( 'mb_convert_case' ) )
+ if ( function_exists( 'mb_convert_case' ) ) {
return mb_convert_case( $str, MB_CASE_TITLE, $charset );
- else
+ } else {
return ucwords( $str );
+ }
}
-
+
if ( $charset == 'UTF-8' ) {
global $UTF8_TABLES;
include_once( AIOSEOP_PLUGIN_DIR . 'inc/aioseop_UTF8.php' );
if ( is_array( $UTF8_TABLES ) ) {
- if ( $mode == 'upper' ) return strtr( $str, $UTF8_TABLES['strtoupper'] );
- if ( $mode == 'lower' ) return strtr( $str, $UTF8_TABLES['strtolower'] );
+ if ( $mode == 'upper' ) {
+ return strtr( $str, $UTF8_TABLES['strtoupper'] );
+ }
+ if ( $mode == 'lower' ) {
+ return strtr( $str, $UTF8_TABLES['strtolower'] );
+ }
}
}
-
+
if ( $mode == 'upper' ) {
- if ( function_exists( 'mb_strtoupper' ) )
+ if ( function_exists( 'mb_strtoupper' ) ) {
return mb_strtoupper( $str, $charset );
- else
+ } else {
return strtoupper( $str );
+ }
}
if ( $mode == 'lower' ) {
- if ( function_exists( 'mb_strtolower' ) )
+ if ( function_exists( 'mb_strtolower' ) ) {
return mb_strtolower( $str, $charset );
- else
+ } else {
return strtolower( $str );
+ }
}
-
+
return $str;
}
- /**
+ /**
* Convert a string to lower case
* Compatible with mb_strtolower(), an UTF-8 friendly replacement for strtolower()
*/
@@ -170,7 +194,7 @@ function strtolower( $str ) {
return $this->convert_case( $str, 'lower' );
}
- /**
+ /**
* Convert a string to upper case
* Compatible with mb_strtoupper(), an UTF-8 friendly replacement for strtoupper()
*/
@@ -178,20 +202,22 @@ function strtoupper( $str ) {
return $this->convert_case( $str, 'upper' );
}
- /**
+ /**
* Convert a string to title case
* Compatible with mb_convert_case(), an UTF-8 friendly replacement for ucwords()
*/
function ucwords( $str ) {
return $this->convert_case( $str, 'title' );
}
-
+
/**
* Wrapper for strlen() - uses mb_strlen() if possible.
- */
+ */
function strlen( $string ) {
- if ( function_exists( 'mb_strlen' ) )
+ if ( function_exists( 'mb_strlen' ) ) {
return mb_strlen( $string );
+ }
+
return strlen( $string );
}
@@ -200,118 +226,146 @@ function strlen( $string ) {
*/
function substr( $string, $start = 0, $length = 2147483647 ) {
$args = func_get_args();
- if ( function_exists( 'mb_substr' ) )
+ if ( function_exists( 'mb_substr' ) ) {
return call_user_func_array( 'mb_substr', $args );
+ }
+
return call_user_func_array( 'substr', $args );
}
-
+
/**
* Wrapper for strpos() - uses mb_strpos() if possible.
*/
function strpos( $haystack, $needle, $offset = 0 ) {
- if ( function_exists( 'mb_strpos' ) )
+ if ( function_exists( 'mb_strpos' ) ) {
return mb_strpos( $haystack, $needle, $offset );
+ }
+
return strpos( $haystack, $needle, $offset );
}
-
+
/**
* Wrapper for strrpos() - uses mb_strrpos() if possible.
*/
function strrpos( $haystack, $needle, $offset = 0 ) {
- if ( function_exists( 'mb_strrpos' ) )
+ if ( function_exists( 'mb_strrpos' ) ) {
return mb_strrpos( $haystack, $needle, $offset );
+ }
+
return strrpos( $haystack, $needle, $offset );
}
/**
- * convert xml string to php array - useful to get a serializable value
- *
- * @param string $xmlstr
- * @return array
- *
- * @author Adrien aka Gaarf & contributors
- * @see http://gaarf.info/2009/08/13/xml-string-to-php-array/
- */
+ * convert xml string to php array - useful to get a serializable value
+ *
+ * @param string $xmlstr
+ *
+ * @return array
+ *
+ * @author Adrien aka Gaarf & contributors
+ * @see http://gaarf.info/2009/08/13/xml-string-to-php-array/
+ */
function html_string_to_array( $xmlstr ) {
- if ( !class_exists( 'DOMDocument' ) ) {
- return Array();
- } else {
- $doc = new DOMDocument();
- $doc->loadHTML( $xmlstr );
- return $this->domnode_to_array( $doc->documentElement );
- }
+ if ( ! class_exists( 'DOMDocument' ) ) {
+ return array();
+ } else {
+ $doc = new DOMDocument();
+ $doc->loadHTML( $xmlstr );
+
+ return $this->domnode_to_array( $doc->documentElement );
+ }
}
function xml_string_to_array( $xmlstr ) {
- if ( !class_exists( 'DOMDocument' ) ) {
- return Array();
- } else {
- $doc = new DOMDocument();
- $doc->loadXML( $xmlstr );
- return $this->domnode_to_array( $doc->documentElement );
- }
+ if ( ! class_exists( 'DOMDocument' ) ) {
+ return array();
+ } else {
+ $doc = new DOMDocument();
+ $doc->loadXML( $xmlstr );
+
+ return $this->domnode_to_array( $doc->documentElement );
+ }
}
function domnode_to_array( $node ) {
- switch ( $node->nodeType ) {
- case XML_CDATA_SECTION_NODE:
- case XML_TEXT_NODE:
- return trim( $node->textContent );
- break;
- case XML_ELEMENT_NODE:
- $output = array();
- for ($i=0, $m=$node->childNodes->length; $i<$m; $i++) {
- $child = $node->childNodes->item($i);
- $v = $this->domnode_to_array($child);
- if(isset($child->tagName)) {
- $t = $child->tagName;
- if(!isset($output[$t]))
- $output[$t] = array();
- if ( is_array($output) )
- $output[$t][] = $v;
- }
- elseif($v || $v === '0')
- $output = (string) $v;
- }
- if($node->attributes->length && !is_array($output)) //Has attributes but isn't an array
- $output = array('@content'=>$output); //Change output into an array.
- if(is_array($output)) {
- if($node->attributes->length) {
- $a = array();
- foreach($node->attributes as $attrName => $attrNode)
- $a[$attrName] = (string) $attrNode->value;
- $output['@attributes'] = $a;
- }
- foreach ($output as $t => $v)
- if(is_array($v) && count($v)==1 && $t!='@attributes')
- $output[$t] = $v[0];
- }
- }
- if ( empty( $output ) ) return '';
- return $output;
- }
-
+ switch ( $node->nodeType ) {
+ case XML_CDATA_SECTION_NODE:
+ case XML_TEXT_NODE:
+ return trim( $node->textContent );
+ break;
+ case XML_ELEMENT_NODE:
+ $output = array();
+ for ( $i = 0, $m = $node->childNodes->length; $i < $m; $i ++ ) {
+ $child = $node->childNodes->item( $i );
+ $v = $this->domnode_to_array( $child );
+ if ( isset( $child->tagName ) ) {
+ $t = $child->tagName;
+ if ( ! isset( $output[ $t ] ) ) {
+ $output[ $t ] = array();
+ }
+ if ( is_array( $output ) ) {
+ $output[ $t ][] = $v;
+ }
+ } elseif ( $v || $v === '0' ) {
+ $output = (string) $v;
+ }
+ }
+ if ( $node->attributes->length && ! is_array( $output ) ) //Has attributes but isn't an array
+ {
+ $output = array( '@content' => $output );
+ } //Change output into an array.
+ if ( is_array( $output ) ) {
+ if ( $node->attributes->length ) {
+ $a = array();
+ foreach ( $node->attributes as $attrName => $attrNode ) {
+ $a[ $attrName ] = (string) $attrNode->value;
+ }
+ $output['@attributes'] = $a;
+ }
+ foreach ( $output as $t => $v ) {
+ if ( is_array( $v ) && count( $v ) == 1 && $t != '@attributes' ) {
+ $output[ $t ] = $v[0];
+ }
+ }
+ }
+ }
+ if ( empty( $output ) ) {
+ return '';
+ }
+
+ return $output;
+ }
+
/*** adds support for using %cf_(name of field)% for using custom fields / Advanced Custom Fields in titles / descriptions etc. ***/
function apply_cf_fields( $format ) {
- return preg_replace_callback( '/%cf_([^%]*?)%/', Array( $this, 'cf_field_replace' ), $format );
+ return preg_replace_callback( '/%cf_([^%]*?)%/', array( $this, 'cf_field_replace' ), $format );
}
function cf_field_replace( $matches ) {
$result = '';
- if ( !empty( $matches ) ) {
- if ( !empty( $matches[1] ) ) {
- if ( function_exists( 'get_field' ) ) $result = get_field( $matches[1] );
+ if ( ! empty( $matches ) ) {
+ if ( ! empty( $matches[1] ) ) {
+ if ( function_exists( 'get_field' ) ) {
+ $result = get_field( $matches[1] );
+ }
if ( empty( $result ) ) {
global $post;
- if ( !empty( $post ) ) $result = get_post_meta( $post->ID, $matches[1], true );
+ if ( ! empty( $post ) ) {
+ $result = get_post_meta( $post->ID, $matches[1], true );
+ }
+ }
+ if ( empty( $result ) ) {
+ $result = $matches[0];
}
- if ( empty( $result ) ) $result = $matches[0];
- } else $result = $matches[0];
+ } else {
+ $result = $matches[0];
+ }
}
$result = strip_tags( $result );
+
return $result;
}
-
+
/**
* Returns child blogs of parent in a multisite.
*/
@@ -319,198 +373,215 @@ function get_child_blogs() {
global $wpdb, $blog_id;
$site_id = $wpdb->siteid;
if ( is_multisite() ) {
- if ( $site_id != $blog_id ) return false;
+ if ( $site_id != $blog_id ) {
+ return false;
+ }
+
return $wpdb->get_col( "SELECT blog_id FROM {$wpdb->blogs} WHERE site_id = {$blog_id} AND site_id != blog_id" );
}
+
return false;
}
-
+
/**
* Checks if the plugin is active on a given blog by blogid on a multisite.
*/
function is_aioseop_active_on_blog( $bid = false ) {
global $blog_id;
- if ( empty( $bid ) || ( $bid == $blog_id ) || !is_multisite() ) return true;
- if ( ! function_exists( 'is_plugin_active_for_network' ) )
- require_once( ABSPATH . '/wp-admin/includes/plugin.php' );
- if ( is_plugin_active_for_network( AIOSEOP_PLUGIN_BASENAME ) ) return true;
+ if ( empty( $bid ) || ( $bid == $blog_id ) || ! is_multisite() ) {
+ return true;
+ }
+ if ( ! function_exists( 'is_plugin_active_for_network' ) ) {
+ require_once( ABSPATH . '/wp-admin/includes/plugin.php' );
+ }
+ if ( is_plugin_active_for_network( AIOSEOP_PLUGIN_BASENAME ) ) {
+ return true;
+ }
+
return in_array( AIOSEOP_PLUGIN_BASENAME, (array) get_blog_option( $bid, 'active_plugins', array() ) );
}
-
+
function quote_list_for_regex( $list, $quote = '/' ) {
$regex = '';
- $cont = 0;
- foreach( $list as $l ) {
- if ( $cont ) {
- $regex .= '|';
- }
- $cont = 1;
- $regex .= preg_quote( trim( $l ), $quote );
+ $cont = 0;
+ foreach ( $list as $l ) {
+ if ( $cont ) {
+ $regex .= '|';
+ }
+ $cont = 1;
+ $regex .= preg_quote( trim( $l ), $quote );
}
+
return $regex;
}
-
+
// original code thanks to Sean M. Brown -- http://smbrown.wordpress.com/2009/04/29/verify-googlebot-forward-reverse-dns/
function is_good_bot() {
- $botlist = Array(
- "Yahoo! Slurp" => "crawl.yahoo.net",
- "googlebot" => ".googlebot.com",
- "msnbot" => "search.msn.com"
+ $botlist = array(
+ 'Yahoo! Slurp' => 'crawl.yahoo.net',
+ 'googlebot' => '.googlebot.com',
+ 'msnbot' => 'search.msn.com'
);
- $botlist = apply_filters( $this->prefix . "botlist", $botlist );
- if ( !empty( $botlist ) ) {
- $ua = $_SERVER['HTTP_USER_AGENT'];
+ $botlist = apply_filters( $this->prefix . 'botlist', $botlist );
+ if ( ! empty( $botlist ) ) {
+ if( ! isset( $_SERVER['HTTP_USER_AGENT'] ) ) {
+ return false;
+ }
+ $ua = $_SERVER['HTTP_USER_AGENT'];
$uas = $this->quote_list_for_regex( $botlist );
- if ( preg_match( '/' . $uas . '/i', $ua ) ) {
- $ip = $_SERVER['REMOTE_ADDR'];
- $hostname = gethostbyaddr( $ip );
+ if ( preg_match( '/' . $uas . '/i', $ua ) ) {
+ $ip = $_SERVER['REMOTE_ADDR'];
+ $hostname = gethostbyaddr( $ip );
$ip_by_hostname = gethostbyname( $hostname );
- if ( $ip_by_hostname == $ip ) {
+ if ( $ip_by_hostname == $ip ) {
$hosts = array_values( $botlist );
- foreach( $hosts as $k => $h )
- $hosts[$k] = preg_quote( $h ) . '$';
+ foreach ( $hosts as $k => $h ) {
+ $hosts[ $k ] = preg_quote( $h ) . '$';
+ }
$hosts = join( '|', $hosts );
- if ( preg_match( '/' . $hosts . '/i', $hostname ) )
+ if ( preg_match( '/' . $hosts . '/i', $hostname ) ) {
return true;
+ }
}
}
+
return false;
}
}
-
+
function default_bad_bots() {
- $botlist = Array(
- "Abonti",
- "aggregator",
- "AhrefsBot",
- "asterias",
- "BDCbot",
- "BLEXBot",
- "BuiltBotTough",
- "Bullseye",
- "BunnySlippers",
- "ca-crawler",
- "CCBot",
- "Cegbfeieh",
- "CheeseBot",
- "CherryPicker",
- "CopyRightCheck",
- "cosmos",
- "Crescent",
- "discobot",
- "DittoSpyder",
- "DotBot",
- "Download Ninja",
- "EasouSpider",
- "EmailCollector",
- "EmailSiphon",
- "EmailWolf",
- "EroCrawler",
- "Exabot",
- "ExtractorPro",
- "Fasterfox",
- "FeedBooster",
- "Foobot",
- "Genieo",
- "grub-client",
- "Harvest",
- "hloader",
- "httplib",
- "HTTrack",
- "humanlinks",
- "ieautodiscovery",
- "InfoNaviRobot",
- "IstellaBot",
- "Java/1.",
- "JennyBot",
- "k2spider",
- "Kenjin Spider",
- "Keyword Density/0.9",
- "larbin",
- "LexiBot",
- "libWeb",
- "libwww",
- "LinkextractorPro",
- "linko",
- "LinkScan/8.1a Unix",
- "LinkWalker",
- "LNSpiderguy",
- "lwp-trivial",
- "magpie",
- "Mata Hari",
+ $botlist = array(
+ 'Abonti',
+ 'aggregator',
+ 'AhrefsBot',
+ 'asterias',
+ 'BDCbot',
+ 'BLEXBot',
+ 'BuiltBotTough',
+ 'Bullseye',
+ 'BunnySlippers',
+ 'ca-crawler',
+ 'CCBot',
+ 'Cegbfeieh',
+ 'CheeseBot',
+ 'CherryPicker',
+ 'CopyRightCheck',
+ 'cosmos',
+ 'Crescent',
+ 'discobot',
+ 'DittoSpyder',
+ 'DotBot',
+ 'Download Ninja',
+ 'EasouSpider',
+ 'EmailCollector',
+ 'EmailSiphon',
+ 'EmailWolf',
+ 'EroCrawler',
+ 'Exabot',
+ 'ExtractorPro',
+ 'Fasterfox',
+ 'FeedBooster',
+ 'Foobot',
+ 'Genieo',
+ 'grub-client',
+ 'Harvest',
+ 'hloader',
+ 'httplib',
+ 'HTTrack',
+ 'humanlinks',
+ 'ieautodiscovery',
+ 'InfoNaviRobot',
+ 'IstellaBot',
+ 'Java/1.',
+ 'JennyBot',
+ 'k2spider',
+ 'Kenjin Spider',
+ 'Keyword Density/0.9',
+ 'larbin',
+ 'LexiBot',
+ 'libWeb',
+ 'libwww',
+ 'LinkextractorPro',
+ 'linko',
+ 'LinkScan/8.1a Unix',
+ 'LinkWalker',
+ 'LNSpiderguy',
+ 'lwp-trivial',
+ 'magpie',
+ 'Mata Hari',
'MaxPointCrawler',
'MegaIndex',
- "Microsoft URL Control",
- "MIIxpc",
- "Mippin",
- "Missigua Locator",
- "Mister PiX",
- "MJ12bot",
- "moget",
- "MSIECrawler",
- "NetAnts",
- "NICErsPRO",
- "Niki-Bot",
- "NPBot",
- "Nutch",
- "Offline Explorer",
- "Openfind",
+ 'Microsoft URL Control',
+ 'MIIxpc',
+ 'Mippin',
+ 'Missigua Locator',
+ 'Mister PiX',
+ 'MJ12bot',
+ 'moget',
+ 'MSIECrawler',
+ 'NetAnts',
+ 'NICErsPRO',
+ 'Niki-Bot',
+ 'NPBot',
+ 'Nutch',
+ 'Offline Explorer',
+ 'Openfind',
'panscient.com',
- "PHP/5.{",
- "ProPowerBot/2.14",
- "ProWebWalker",
- "Python-urllib",
- "QueryN Metasearch",
- "RepoMonkey",
- "RMA",
+ 'PHP/5.{',
+ 'ProPowerBot/2.14',
+ 'ProWebWalker',
+ 'Python-urllib',
+ 'QueryN Metasearch',
+ 'RepoMonkey',
+ 'RMA',
'SemrushBot',
- "SeznamBot",
- "SISTRIX",
- "sitecheck.Internetseer.com",
- "SiteSnagger",
- "SnapPreviewBot",
- "Sogou",
- "SpankBot",
- "spanner",
- "spbot",
- "Spinn3r",
- "suzuran",
- "Szukacz/1.4",
- "Teleport",
- "Telesoft",
- "The Intraformant",
- "TheNomad",
- "TightTwatBot",
- "Titan",
- "toCrawl/UrlDispatcher",
- "True_Robot",
- "turingos",
- "TurnitinBot",
- "UbiCrawler",
- "UnisterBot",
- "URLy Warning",
- "VCI",
- "WBSearchBot",
- "Web Downloader/6.9",
- "Web Image Collector",
- "WebAuto",
- "WebBandit",
- "WebCopier",
- "WebEnhancer",
- "WebmasterWorldForumBot",
- "WebReaper",
- "WebSauger",
- "Website Quester",
- "Webster Pro",
- "WebStripper",
- "WebZip",
- "Wotbox",
- "wsr-agent",
- "WWW-Collector-E",
- "Xenu",
- "Zao",
- "Zeus",
- "ZyBORG",
+ 'SeznamBot',
+ 'SISTRIX',
+ 'sitecheck.Internetseer.com',
+ 'SiteSnagger',
+ 'SnapPreviewBot',
+ 'Sogou',
+ 'SpankBot',
+ 'spanner',
+ 'spbot',
+ 'Spinn3r',
+ 'suzuran',
+ 'Szukacz/1.4',
+ 'Teleport',
+ 'Telesoft',
+ 'The Intraformant',
+ 'TheNomad',
+ 'TightTwatBot',
+ 'Titan',
+ 'toCrawl/UrlDispatcher',
+ 'True_Robot',
+ 'turingos',
+ 'TurnitinBot',
+ 'UbiCrawler',
+ 'UnisterBot',
+ 'URLy Warning',
+ 'VCI',
+ 'WBSearchBot',
+ 'Web Downloader/6.9',
+ 'Web Image Collector',
+ 'WebAuto',
+ 'WebBandit',
+ 'WebCopier',
+ 'WebEnhancer',
+ 'WebmasterWorldForumBot',
+ 'WebReaper',
+ 'WebSauger',
+ 'Website Quester',
+ 'Webster Pro',
+ 'WebStripper',
+ 'WebZip',
+ 'Wotbox',
+ 'wsr-agent',
+ 'WWW-Collector-E',
+ 'Xenu',
+ 'Zao',
+ 'Zeus',
+ 'ZyBORG',
'coccoc',
'Incutio',
'lmspider',
@@ -520,24 +591,29 @@ function default_bad_bots() {
'Unknown',
'uptime files'
);
+
return $botlist;
}
-
+
function is_bad_bot() {
$botlist = $this->default_bad_bots();
- $botlist = apply_filters( $this->prefix . "badbotlist", $botlist );
- if ( !empty( $botlist ) ) {
- $ua = $_SERVER['HTTP_USER_AGENT'];
+ $botlist = apply_filters( $this->prefix . 'badbotlist', $botlist );
+ if ( ! empty( $botlist ) ) {
+ if( ! isset( $_SERVER['HTTP_USER_AGENT'] ) ) {
+ return false;
+ }
+ $ua = $_SERVER['HTTP_USER_AGENT'];
$uas = $this->quote_list_for_regex( $botlist );
- if ( preg_match( '/' . $uas . '/i', $ua ) ) {
+ if ( preg_match( '/' . $uas . '/i', $ua ) ) {
return true;
}
}
+
return false;
}
-
+
function default_bad_referers() {
- $referlist = Array(
+ $referlist = array(
'semalt.com',
'kambasoft.com',
'savetubevideo.com',
@@ -564,247 +640,304 @@ function default_bad_referers() {
'site3.free-share-buttons.com',
'webmaster-traffic.com'
);
+
return $referlist;
}
function is_bad_referer() {
$referlist = $this->default_bad_referers();
- $referlist = apply_filters( $this->prefix . "badreferlist", $referlist );
+ $referlist = apply_filters( $this->prefix . 'badreferlist', $referlist );
- if ( !empty( $referlist ) && !empty( $_SERVER ) && !empty( $_SERVER['HTTP_REFERER'] ) ) {
- $ref = $_SERVER['HTTP_REFERER'];
+ if ( ! empty( $referlist ) && ! empty( $_SERVER ) && ! empty( $_SERVER['HTTP_REFERER'] ) ) {
+ $ref = $_SERVER['HTTP_REFERER'];
$regex = $this->quote_list_for_regex( $referlist );
- if ( preg_match( '/' . $regex . '/i', $ref ) ) {
+ if ( preg_match( '/' . $regex . '/i', $ref ) ) {
return true;
}
}
+
return false;
}
-
+
function allow_bot() {
$allow_bot = true;
- if ( ( !$this->is_good_bot() ) && ( $this->is_bad_bot() ) && !is_user_logged_in() )
+ if ( ( ! $this->is_good_bot() ) && $this->is_bad_bot() && ! is_user_logged_in() ) {
$allow_bot = false;
- return apply_filters( $this->prefix . "allow_bot", $allow_bot );
+ }
+
+ return apply_filters( $this->prefix . 'allow_bot', $allow_bot );
}
/**
* Displays tabs for tabbed locations on a settings page.
*/
function display_tabs( $location ) {
- if ( ( $location != null ) && isset( $locations[$location]['tabs'] ) )
+ if ( ( $location != null ) && isset( $locations[ $location ]['tabs'] ) ) {
$tabs = $locations['location']['tabs'];
- else
+ } else {
$tabs = $this->tabs;
- if ( !empty( $tabs ) ) {
- ?>
- $v ) {
- ?>
- active" href="">
-
+ }
+ if ( ! empty( $tabs ) ) {
+ ?>
+
label ) )
- $post_types[$p] = $post_objs[$p]->label;
- else
- $post_types[$p] = $p;
+ $pt = array_keys( $post_objs );
+ $post_types = array();
+ foreach ( $pt as $p ) {
+ if ( ! empty( $post_objs[ $p ]->label ) ) {
+ $post_types[ $p ] = $post_objs[ $p ]->label;
+ } else {
+ $post_types[ $p ] = $p;
+ }
+ }
+
return $post_types;
}
function get_term_labels( $post_objs ) {
- $post_types = Array();
- foreach ( $post_objs as $p )
- if ( !empty( $p->name ) )
- $post_types[$p->term_id] = $p->name;
+ $post_types = array();
+ foreach ( $post_objs as $p ) {
+ if ( ! empty( $p->name ) ) {
+ $post_types[ $p->term_id ] = $p->name;
+ }
+ }
+
return $post_types;
}
-
- function get_post_type_titles( $args = Array() ) {
+
+ function get_post_type_titles( $args = array() ) {
return $this->get_object_labels( get_post_types( $args, 'objects' ) );
}
- function get_taxonomy_titles( $args = Array() ) {
+ function get_taxonomy_titles( $args = array() ) {
return $this->get_object_labels( get_taxonomies( $args, 'objects' ) );
}
-
- function get_category_titles( $args = Array() ) {
+
+ function get_category_titles( $args = array() ) {
return $this->get_term_labels( get_categories( $args ) );
}
-
+
/**
* Helper function for exporting settings on post data.
*/
- function post_data_export( $prefix = '_aioseop', $query = Array( 'posts_per_page' => -1 ) ) {
- $buf = '';
+ function post_data_export( $prefix = '_aioseop', $query = array( 'posts_per_page' => - 1 ) ) {
+ $buf = '';
$posts_query = new WP_Query( $query );
- while ($posts_query->have_posts() ) {
+ while ( $posts_query->have_posts() ) {
$posts_query->the_post();
global $post;
- $guid = $post->guid; $type = $post->post_type; $title = $post->post_title; $date = $post->post_date;
- $data = '';
+ $guid = $post->guid;
+ $type = $post->post_type;
+ $title = $post->post_title;
+ $date = $post->post_date;
+ $data = '';
$post_custom_fields = get_post_custom( $post->ID );
- $has_data = null;
+ $has_data = null;
- if( is_array( $post_custom_fields ) ) {
- foreach( $post_custom_fields as $field_name => $field ){
- if( ( $this->strpos( $field_name, $prefix ) === 0 ) && ( $field[0] ) ) {
+ if ( is_array( $post_custom_fields ) ) {
+ foreach ( $post_custom_fields as $field_name => $field ) {
+ if ( ( $this->strpos( $field_name, $prefix ) === 0 ) && $field[0] ) {
$has_data = true;
$data .= $field_name . " = '" . $field[0] . "'\n";
- }
+ }
}
}
- if ( !empty( $data ) ) $has_data = true;
+ if ( ! empty( $data ) ) {
+ $has_data = true;
+ }
- if( $has_data != null ){
+ if ( $has_data != null ) {
$post_info = "\n[post_data]\n\n";
$post_info .= "post_title = '" . $title . "'\n";
$post_info .= "post_guid = '" . $guid . "'\n";
$post_info .= "post_date = '" . $date . "'\n";
$post_info .= "post_type = '" . $type . "'\n";
- if ( $data ) $buf .= $post_info . $data . "\n";
+ if ( $data ) {
+ $buf .= $post_info . $data . "\n";
+ }
}
}
wp_reset_postdata();
+
return $buf;
}
-
+
/**
* Handles exporting settings data for a module.
*/
function settings_export( $buf ) {
- global $aiosp;
- $post_types = null;
- $has_data = null;
+ global $aiosp;
+ $post_types = null;
+ $has_data = null;
$general_settings = null;
$exporter_choices = '';
- if ( !empty( $_REQUEST[ 'aiosp_importer_exporter_export_choices' ] ) )
- $exporter_choices = $_REQUEST[ 'aiosp_importer_exporter_export_choices' ];
- if ( !empty( $exporter_choices ) && is_array( $exporter_choices ) ) {
- foreach( $exporter_choices as $ex ) {
- if ( $ex == 1 ) $general_settings = true;
- if ( $ex == 2 ) {
- if ( isset( $_REQUEST[ 'aiosp_importer_exporter_export_post_types' ] ) )
- $post_types = $_REQUEST[ 'aiosp_importer_exporter_export_post_types' ];
+ if ( ! empty( $_REQUEST['aiosp_importer_exporter_export_choices'] ) ) {
+ $exporter_choices = $_REQUEST['aiosp_importer_exporter_export_choices'];
+ }
+ if ( ! empty( $exporter_choices ) && is_array( $exporter_choices ) ) {
+ foreach ( $exporter_choices as $ex ) {
+ if ( $ex == 1 ) {
+ $general_settings = true;
+ }
+ if ( $ex == 2 && isset( $_REQUEST['aiosp_importer_exporter_export_post_types'] ) ) {
+ $post_types = $_REQUEST['aiosp_importer_exporter_export_post_types'];
}
}
}
- if ( ( $post_types != null ) && ( $this === $aiosp ) )
- $buf .= $this->post_data_export( '_aioseop', Array( 'posts_per_page' => -1, 'post_type' => $post_types ) );
+ if ( ( $post_types != null ) && ( $this === $aiosp ) ) {
+ $buf .= $this->post_data_export( '_aioseop', array(
+ 'posts_per_page' => - 1,
+ 'post_type' => $post_types
+ ) );
+ }
/* Add all active settings to settings file */
- $name = $this->get_option_name();
+ $name = $this->get_option_name();
$options = $this->get_class_option();
- if( !empty( $options ) && $general_settings != null ) {
+ if ( ! empty( $options ) && $general_settings != null ) {
$buf .= "\n[$name]\n\n";
foreach ( $options as $key => $value ) {
- if ( ( $name == $this->parent_option ) && ( $key == 'modules' ) ) continue; // don't re-export all module settings -- pdb
- if ( is_array($value) )
- $value = "'" . str_replace( Array( "'", "\n", "\r" ), Array( "\'", '\n', '\r' ), trim( serialize( $value ) ) ) . "'";
- else
- $value = str_replace( Array( "\n", "\r" ), Array( '\n', '\r' ), trim( var_export($value, true) ) );
+ if ( ( $name == $this->parent_option ) && ( $key == 'modules' ) ) {
+ continue;
+ } // don't re-export all module settings -- pdb
+ if ( is_array( $value ) ) {
+ $value = "'" . str_replace( array( "'", "\n", "\r" ), array(
+ "\'",
+ '\n',
+ '\r'
+ ), trim( serialize( $value ) ) ) . "'";
+ } else {
+ $value = str_replace( array( "\n", "\r" ), array(
+ '\n',
+ '\r'
+ ), trim( var_export( $value, true ) ) );
+ }
$buf .= "$key = $value\n";
}
}
+
return $buf;
}
-
+
/**
* Order for adding the menus for the aioseop_modules_add_menus hook.
*/
function menu_order() {
return 10;
}
-
+
/**
* Print a basic error message.
*/
function output_error( $error ) {
echo "$error
";
- return FALSE;
+
+ return false;
}
-
+
/***
* Backwards compatibility - see http://php.net/manual/en/function.str-getcsv.php
*/
- function str_getcsv( $input, $delimiter = ",", $enclosure = '"', $escape = "\\" ) {
- $fp = fopen( "php://memory", 'r+' );
+ function str_getcsv( $input, $delimiter = ',', $enclosure = '"', $escape = "\\" ) {
+ $fp = fopen( 'php://memory', 'r+' );
fputs( $fp, $input );
rewind( $fp );
$data = fgetcsv( $fp, null, $delimiter, $enclosure ); // $escape only got added in 5.3.0
fclose( $fp );
+
return $data;
}
-
+
/***
* Helper function to convert csv in key/value pair format to an associative array.
*/
function csv_to_array( $csv ) {
- $args = Array();
- if ( !function_exists( 'str_getcsv' ) )
+ $args = array();
+ if ( ! function_exists( 'str_getcsv' ) ) {
$v = $this->str_getcsv( $csv );
- else
+ } else {
$v = str_getcsv( $csv );
+ }
$size = count( $v );
- if ( is_array( $v ) && isset( $v[0] ) && $size >= 2 )
- for( $i = 0; $i < $size; $i += 2 )
+ if ( is_array( $v ) && isset( $v[0] ) && $size >= 2 ) {
+ for ( $i = 0; $i < $size; $i += 2 ) {
$args[ $v[ $i ] ] = $v[ $i + 1 ];
+ }
+ }
+
return $args;
}
/** Allow modules to use WP Filesystem if available and desired, fall back to PHP filesystem access otherwise. */
function use_wp_filesystem( $method = '', $form_fields = false, $url = '', $error = false ) {
- if ( empty( $method ) )
+ if ( empty( $method ) ) {
$this->credentials = request_filesystem_credentials( $url );
- else
+ } else {
$this->credentials = request_filesystem_credentials( $url, $method, $error, false, $form_fields );
+ }
+
return $this->credentials;
}
-
+
/**
* Wrapper function to get filesystem object.
*/
- function get_filesystem_object( ) {
+ function get_filesystem_object() {
$cred = get_transient( 'aioseop_fs_credentials' );
- if ( !empty( $cred ) ) $this->credentials = $cred;
-
- if ( function_exists( 'WP_Filesystem' ) && ( WP_Filesystem( $this->credentials ) ) ) {
+ if ( ! empty( $cred ) ) {
+ $this->credentials = $cred;
+ }
+
+ if ( function_exists( 'WP_Filesystem' ) && WP_Filesystem( $this->credentials ) ) {
global $wp_filesystem;
+
return $wp_filesystem;
} else {
require_once( ABSPATH . 'wp-admin/includes/template.php' );
require_once( ABSPATH . 'wp-admin/includes/screen.php' );
require_once( ABSPATH . 'wp-admin/includes/file.php' );
- if ( !WP_Filesystem( $this->credentials ) )
+ if ( ! WP_Filesystem( $this->credentials ) ) {
$this->use_wp_filesystem();
+ }
- if ( !empty( $this->credentials ) )
+ if ( ! empty( $this->credentials ) ) {
set_transient( 'aioseop_fs_credentials', $this->credentials, 10800 );
+ }
global $wp_filesystem;
- if ( is_object( $wp_filesystem ) )
+ if ( is_object( $wp_filesystem ) ) {
return $wp_filesystem;
+ }
}
+
return false;
}
-
+
/**
* See if a file exists using WP Filesystem.
*/
function file_exists( $filename ) {
$wpfs = $this->get_filesystem_object();
- if ( is_object( $wpfs ) )
+ if ( is_object( $wpfs ) ) {
return $wpfs->exists( $filename );
+ }
+
return $wpfs;
}
@@ -813,11 +946,13 @@ function file_exists( $filename ) {
*/
function is_file( $filename ) {
$wpfs = $this->get_filesystem_object();
- if ( is_object( $wpfs ) )
+ if ( is_object( $wpfs ) ) {
return $wpfs->is_file( $filename );
+ }
+
return $wpfs;
}
-
+
/**
* List files in a directory using WP Filesystem.
*/
@@ -825,52 +960,72 @@ function scandir( $path ) {
$wpfs = $this->get_filesystem_object();
if ( is_object( $wpfs ) ) {
$dirlist = $wpfs->dirlist( $path );
- if ( empty( $dirlist ) ) return $dirlist;
+ if ( empty( $dirlist ) ) {
+ return $dirlist;
+ }
+
return array_keys( $dirlist );
}
- return $wpfs;
+
+ return $wpfs;
}
-
+
/**
* Load a file through WP Filesystem; implement basic support for offset and maxlen.
*/
- function load_file( $filename, $use_include_path = false, $context = null, $offset = -1, $maxlen = -1 ) {
+ function load_file( $filename, $use_include_path = false, $context = null, $offset = - 1, $maxlen = - 1 ) {
$wpfs = $this->get_filesystem_object();
if ( is_object( $wpfs ) ) {
- if ( !$wpfs->exists( $filename ) ) return false;
+ if ( ! $wpfs->exists( $filename ) ) {
+ return false;
+ }
if ( ( $offset > 0 ) || ( $maxlen >= 0 ) ) {
- if ( $maxlen === 0 ) return '';
- if ( $offset < 0 ) $offset = 0;
+ if ( $maxlen === 0 ) {
+ return '';
+ }
+ if ( $offset < 0 ) {
+ $offset = 0;
+ }
$file = $wpfs->get_contents( $filename );
- if ( !is_string( $file ) || empty( $file ) ) return $file;
- if ( $maxlen < 0 )
+ if ( ! is_string( $file ) || empty( $file ) ) {
+ return $file;
+ }
+ if ( $maxlen < 0 ) {
return $this->substr( $file, $offset );
- else
+ } else {
return $this->substr( $file, $offset, $maxlen );
+ }
} else {
return $wpfs->get_contents( $filename );
}
}
+
return false;
}
-
+
/**
* Save a file through WP Filesystem.
*/
function save_file( $filename, $contents ) {
- $failed_str = __( sprintf( "Failed to write file %s!\n", $filename ), 'all-in-one-seo-pack' );
+ $failed_str = __( sprintf( "Failed to write file %s!\n", $filename ), 'all-in-one-seo-pack' );
$readonly_str = __( sprintf( "File %s isn't writable!\n", $filename ), 'all-in-one-seo-pack' );
- $wpfs = $this->get_filesystem_object();
+ $wpfs = $this->get_filesystem_object();
if ( is_object( $wpfs ) ) {
$file_exists = $wpfs->exists( $filename );
- if ( !$file_exists || $wpfs->is_writable( $filename ) ) {
- if ( $wpfs->put_contents( $filename, $contents ) === FALSE) return $this->output_error( $failed_str );
- } else return $this->output_error( $readonly_str );
+ if ( ! $file_exists || $wpfs->is_writable( $filename ) ) {
+ if ( $wpfs->put_contents( $filename, $contents ) === false ) {
+ return $this->output_error( $failed_str );
+ }
+ } else {
+ return $this->output_error( $readonly_str );
+ }
+
return true;
}
+
return false;
}
-
+
/**
* Delete a file through WP Filesystem.
*/
@@ -878,35 +1033,42 @@ function delete_file( $filename ) {
$wpfs = $this->get_filesystem_object();
if ( is_object( $wpfs ) ) {
if ( $wpfs->exists( $filename ) ) {
- if ( $wpfs->delete( $filename ) === FALSE)
+ if ( $wpfs->delete( $filename ) === false ) {
$this->output_error( __( sprintf( "Failed to delete file %s!\n", $filename ), 'all-in-one-seo-pack' ) );
- else
+ } else {
return true;
- } else $this->output_error( __( sprintf( "File %s doesn't exist!\n", $filename ), 'all-in-one-seo-pack' ) );
+ }
+ } else {
+ $this->output_error( __( sprintf( "File %s doesn't exist!\n", $filename ), 'all-in-one-seo-pack' ) );
+ }
}
+
return false;
}
-
+
/**
* Rename a file through WP Filesystem.
*/
function rename_file( $filename, $newname ) {
$wpfs = $this->get_filesystem_object();
if ( is_object( $wpfs ) ) {
- $file_exists = $wpfs->exists( $filename );
+ $file_exists = $wpfs->exists( $filename );
$newfile_exists = $wpfs->exists( $newname );
- if ( $file_exists && !$newfile_exists ) {
- if ( $wpfs->move( $filename, $newname ) === FALSE)
+ if ( $file_exists && ! $newfile_exists ) {
+ if ( $wpfs->move( $filename, $newname ) === false ) {
$this->output_error( __( sprintf( "Failed to rename file %s!\n", $filename ), 'all-in-one-seo-pack' ) );
- else
+ } else {
return true;
+ }
} else {
- if ( !$file_exists )
+ if ( ! $file_exists ) {
$this->output_error( __( sprintf( "File %s doesn't exist!\n", $filename ), 'all-in-one-seo-pack' ) );
- elseif ( $newfile_exists )
+ } elseif ( $newfile_exists ) {
$this->output_error( __( sprintf( "File %s already exists!\n", $newname ), 'all-in-one-seo-pack' ) );
+ }
}
}
+
return false;
}
@@ -915,28 +1077,31 @@ function rename_file( $filename, $newname ) {
*/
function load_files( $options, $opts, $prefix ) {
foreach ( $opts as $opt => $file ) {
- $opt = $prefix . $opt;
- $file = ABSPATH . $file;
+ $opt = $prefix . $opt;
+ $file = ABSPATH . $file;
$contents = $this->load_file( $file );
- if ( $contents !== false ) $options[$opt] = $contents;
+ if ( $contents !== false ) {
+ $options[ $opt ] = $contents;
+ }
}
+
return $options;
}
-
+
/**
* Save multiple files.
*/
function save_files( $opts, $prefix ) {
foreach ( $opts as $opt => $file ) {
$opt = $prefix . $opt;
- if ( isset($_POST[$opt] ) ) {
- $output = stripslashes_deep( $_POST[$opt] );
- $file = ABSPATH . $file;
+ if ( isset( $_POST[ $opt ] ) ) {
+ $output = stripslashes_deep( $_POST[ $opt ] );
+ $file = ABSPATH . $file;
$this->save_file( $file, $output );
}
}
}
-
+
/**
* Delete multiple files.
*/
@@ -946,9 +1111,9 @@ function delete_files( $opts ) {
$this->delete_file( $file );
}
}
-
+
function get_all_images_by_type( $options = null, $p = null ) {
- $img = Array();
+ $img = array();
if ( empty( $img ) ) {
$size = apply_filters( 'post_thumbnail_size', 'large' );
@@ -962,123 +1127,146 @@ function get_all_images_by_type( $options = null, $p = null ) {
$count = 1;
- if ( !empty( $post ) ) {
- if ( !is_object( $post ) ) $post = get_post( $post );
- if ( is_object( $post ) && function_exists('get_post_thumbnail_id' ) ) {
- if ( $post->post_type == 'attachment' )
+ if ( ! empty( $post ) ) {
+ if ( ! is_object( $post ) ) {
+ $post = get_post( $post );
+ }
+ if ( is_object( $post ) && function_exists( 'get_post_thumbnail_id' ) ) {
+ if ( $post->post_type == 'attachment' ) {
$post_thumbnail_id = $post->ID;
- else
+ } else {
$post_thumbnail_id = get_post_thumbnail_id( $post->ID );
- if ( !empty( $post_thumbnail_id ) ) {
+ }
+ if ( ! empty( $post_thumbnail_id ) ) {
$image = wp_get_attachment_image_src( $post_thumbnail_id, $size );
if ( is_array( $image ) ) {
- $img[] = Array( 'type' => 'featured', 'id' => $post_thumbnail_id, 'link' => $image[0] );
+ $img[] = array( 'type' => 'featured', 'id' => $post_thumbnail_id, 'link' => $image[0] );
}
}
}
$post_id = $post->ID;
- $p = $post; $w = $wp_query;
+ $p = $post;
+ $w = $wp_query;
$meta_key = '';
- if ( is_array( $options ) ) {
- if ( isset( $options['meta_key'] ) ) {
+ if ( is_array( $options ) && isset( $options['meta_key'] ) ) {
$meta_key = $options['meta_key'];
- }
}
- if ( !empty( $meta_key ) && !empty( $post ) ) {
+ if ( ! empty( $meta_key ) && ! empty( $post ) ) {
$meta_key = explode( ',', $meta_key );
- $image = $this->get_the_image_by_meta_key( Array( 'post_id' => $post->ID, 'meta_key' => $meta_key ) );
- if ( !empty( $image ) ) {
- $img[] = Array( 'type' => 'meta_key', 'id' => $meta_key, 'link' => $image );
+ $image = $this->get_the_image_by_meta_key( array(
+ 'post_id' => $post->ID,
+ 'meta_key' => $meta_key
+ ) );
+ if ( ! empty( $image ) ) {
+ $img[] = array( 'type' => 'meta_key', 'id' => $meta_key, 'link' => $image );
}
}
- if (! $post->post_modified_gmt != '' )
+ if ( ! $post->post_modified_gmt != '' ) {
$wp_query = new WP_Query( array( 'p' => $post_id, 'post_type' => $post->post_type ) );
- if ( $post->post_type == 'page' )
+ }
+ if ( $post->post_type == 'page' ) {
$wp_query->is_page = true;
- elseif ( $post->post_type == 'attachment' )
+ } elseif ( $post->post_type == 'attachment' ) {
$wp_query->is_attachment = true;
- else
+ } else {
$wp_query->is_single = true;
- if ( get_option( 'show_on_front' ) == 'page' ) {
- if ( $post->ID == get_option( 'page_for_posts' ) )
+ }
+ if ( get_option( 'show_on_front' ) == 'page' && $post->ID == get_option( 'page_for_posts' ) ) {
$wp_query->is_home = true;
}
- $args['options']['type'] = 'html';
+ $args['options']['type'] = 'html';
$args['options']['nowrap'] = false;
- $args['options']['save'] = false;
- $wp_query->queried_object = $post;
-
- $attachments = get_children( Array( 'post_parent' => $post->ID,
- 'post_status' => 'inherit',
- 'post_type' => 'attachment',
- 'post_mime_type' => 'image',
- 'order' => 'ASC',
- 'orderby' => 'menu_order ID' ) );
- if ( !empty( $attachments ) )
- foreach( $attachments as $id => $attachment ) {
+ $args['options']['save'] = false;
+ $wp_query->queried_object = $post;
+
+ $attachments = get_children( array(
+ 'post_parent' => $post->ID,
+ 'post_status' => 'inherit',
+ 'post_type' => 'attachment',
+ 'post_mime_type' => 'image',
+ 'order' => 'ASC',
+ 'orderby' => 'menu_order ID'
+ ) );
+ if ( ! empty( $attachments ) ) {
+ foreach ( $attachments as $id => $attachment ) {
$image = wp_get_attachment_image_src( $id, $size );
if ( is_array( $image ) ) {
- $img[] = Array( 'type' => 'attachment', 'id' => $id, 'link' => $image[0] );
+ $img[] = array( 'type' => 'attachment', 'id' => $id, 'link' => $image[0] );
}
}
- $matches = Array();
+ }
+ $matches = array();
preg_match_all( '||i', get_post_field( 'post_content', $post->ID ), $matches );
- if ( isset( $matches ) && !empty( $matches[1] ) && !empty( $matches[1][0] ) )
- foreach( $matches[1] as $i => $m ) {
- $img[] = Array( 'type' => 'post_content', 'id' => 'post' . $count++, 'link' => $m );
+ if ( isset( $matches ) && ! empty( $matches[1] ) && ! empty( $matches[1][0] ) ) {
+ foreach ( $matches[1] as $i => $m ) {
+ $img[] = array( 'type' => 'post_content', 'id' => 'post' . $count ++, 'link' => $m );
}
+ }
wp_reset_postdata();
- $wp_query = $w; $post = $p;
+ $wp_query = $w;
+ $post = $p;
}
}
+
return $img;
}
-
+
function get_all_images( $options = null, $p = null ) {
- $img = $this->get_all_images_by_type( $options, $p );
- $legacy = Array();
- foreach( $img as $k => $v ) {
+ $img = $this->get_all_images_by_type( $options, $p );
+ $legacy = array();
+ foreach ( $img as $k => $v ) {
if ( $v['type'] == 'featured' ) {
- $legacy[$v['link']] = 1;
- } else {
- $legacy[$v['link']] = $v['id'];
+ $legacy[ $v['link'] ] = 1;
+ } else {
+ $legacy[ $v['link'] ] = $v['id'];
}
}
+
return $legacy;
}
/*** Thanks to Justin Tadlock for the original get-the-image code - http://themehybrid.com/plugins/get-the-image ***/
function get_the_image( $options = null, $p = null ) {
-
+
if ( $p === null ) {
global $post;
} else {
$post = $p;
}
-
+
$meta_key = '';
- if ( is_array( $options ) ) {
- if ( isset( $options['meta_key'] ) ) {
+ if ( is_array( $options ) && isset( $options['meta_key'] ) ) {
$meta_key = $options['meta_key'];
- }
}
- if ( !empty( $meta_key ) && !empty( $post ) ) {
+ if ( ! empty( $meta_key ) && ! empty( $post ) ) {
$meta_key = explode( ',', $meta_key );
- $image = $this->get_the_image_by_meta_key( Array( 'post_id' => $post->ID, 'meta_key' => $meta_key ) );
+ $image = $this->get_the_image_by_meta_key( array(
+ 'post_id' => $post->ID,
+ 'meta_key' => $meta_key
+ ) );
+ }
+ if ( empty( $image ) ) {
+ $image = $this->get_the_image_by_post_thumbnail( $post );
+ }
+ if ( empty( $image ) ) {
+ $image = $this->get_the_image_by_attachment( $post );
+ }
+ if ( empty( $image ) ) {
+ $image = $this->get_the_image_by_scan( $post );
}
- if ( empty( $image ) ) $image = $this->get_the_image_by_post_thumbnail( $post );
- if ( empty( $image ) ) $image = $this->get_the_image_by_attachment( $post );
- if ( empty( $image ) ) $image = $this->get_the_image_by_scan( $post );
- if ( empty( $image ) ) $image = $this->get_the_image_by_default( $post );
+ if ( empty( $image ) ) {
+ $image = $this->get_the_image_by_default( $post );
+ }
+
return $image;
}
-
+
function get_the_image_by_default( $p = null ) {
return '';
}
@@ -1086,17 +1274,20 @@ function get_the_image_by_default( $p = null ) {
function get_the_image_by_meta_key( $args = array() ) {
/* If $meta_key is not an array. */
- if ( !is_array( $args['meta_key'] ) )
+ if ( ! is_array( $args['meta_key'] ) ) {
$args['meta_key'] = array( $args['meta_key'] );
+ }
/* Loop through each of the given meta keys. */
foreach ( $args['meta_key'] as $meta_key ) {
/* Get the image URL by the current meta key in the loop. */
$image = get_post_meta( $args['post_id'], $meta_key, true );
/* If a custom key value has been given for one of the keys, return the image URL. */
- if ( !empty( $image ) )
+ if ( ! empty( $image ) ) {
return $image;
+ }
}
+
return false;
}
@@ -1107,58 +1298,62 @@ function get_the_image_by_post_thumbnail( $p = null ) {
} else {
$post = $p;
}
-
+
$post_thumbnail_id = null;
- if ( function_exists('get_post_thumbnail_id' ) ) {
- $post_thumbnail_id = get_post_thumbnail_id( $post->ID );
+ if ( function_exists( 'get_post_thumbnail_id' ) ) {
+ $post_thumbnail_id = get_post_thumbnail_id( $post->ID );
}
- if ( empty( $post_thumbnail_id ) )
+ if ( empty( $post_thumbnail_id ) ) {
return false;
+ }
- $size = apply_filters( 'post_thumbnail_size', 'large' );
- $image = wp_get_attachment_image_src( $post_thumbnail_id, $size );
- return $image[0];
+ $size = apply_filters( 'post_thumbnail_size', 'large' );
+ $image = wp_get_attachment_image_src( $post_thumbnail_id, $size );
+
+ return $image[0];
}
function get_the_image_by_attachment( $p = null ) {
-
+
if ( $p === null ) {
global $post;
} else {
$post = $p;
}
- $attachments = get_children( Array( 'post_parent' => $post->ID,
- 'post_status' => 'inherit',
- 'post_type' => 'attachment',
- 'post_mime_type' => 'image',
- 'order' => 'ASC',
- 'orderby' => 'menu_order ID' ) );
+ $attachments = get_children( array(
+ 'post_parent' => $post->ID,
+ 'post_status' => 'inherit',
+ 'post_type' => 'attachment',
+ 'post_mime_type' => 'image',
+ 'order' => 'ASC',
+ 'orderby' => 'menu_order ID'
+ ) );
- if ( empty( $attachments ) ) {
- if ( 'attachment' == get_post_type( $post->ID ) ) {
+ if ( empty( $attachments ) && 'attachment' == get_post_type( $post->ID ) ) {
$image = wp_get_attachment_image_src( $post->ID, 'large' );
- }
}
/* If no attachments or image is found, return false. */
- if ( empty( $attachments ) && empty( $image ) )
+ if ( empty( $attachments ) && empty( $image ) ) {
return false;
+ }
/* Set the default iterator to 0. */
$i = 0;
/* Loop through each attachment. Once the $order_of_image (default is '1') is reached, break the loop. */
foreach ( $attachments as $id => $attachment ) {
- if ( ++$i == 1 ) {
+ if ( ++ $i == 1 ) {
$image = wp_get_attachment_image_src( $id, 'large' );
- $alt = trim( strip_tags( get_post_field( 'post_excerpt', $id ) ) );
+ $alt = trim( strip_tags( get_post_field( 'post_excerpt', $id ) ) );
break;
}
}
/* Return the image URL. */
+
return $image[0];
}
@@ -1170,113 +1365,132 @@ function get_the_image_by_scan( $p = null ) {
} else {
$post = $p;
}
-
+
/* Search the post's content for the tag and get its URL. */
preg_match_all( '||i', get_post_field( 'post_content', $post->ID ), $matches );
/* If there is a match for the image, return its URL. */
- if ( isset( $matches ) && !empty( $matches[1][0] ) )
+ if ( isset( $matches ) && ! empty( $matches[1][0] ) ) {
return $matches[1][0];
+ }
return false;
}
-
+
/** crude approximization of whether current user is an admin */
function is_admin() {
return current_user_can( 'level_8' );
}
-
+
function help_text_helper( &$default_options, $options, $help_link = '' ) {
- foreach( $options as $o ) {
+ foreach ( $options as $o ) {
$ht = '';
- if ( !empty( $this->help_text[$o] ) )
- $ht = $this->help_text[$o];
- elseif ( !empty( $default_options[$o]["help_text"] ) )
- $ht = $default_options[$o]["help_text"];
- if ( $ht && !is_array( $ht ) ) {
+ if ( ! empty( $this->help_text[ $o ] ) ) {
+ $ht = $this->help_text[ $o ];
+ } elseif ( ! empty( $default_options[ $o ]['help_text'] ) ) {
+ $ht = $default_options[ $o ]['help_text'];
+ }
+ if ( $ht && ! is_array( $ht ) ) {
$ha = '';
$hl = $help_link;
if ( strpos( $o, 'ga_' ) === 0 ) { // special case -- pdb
$hl = 'http://semperplugins.com/documentation/advanced-google-analytics-settings/';
}
- if ( !empty( $this->help_anchors[$o] ) ) $ha = $this->help_anchors[$o];
- if ( ( !empty( $ha ) && ( $pos = strrpos( $hl, '#' ) ) ) ) {
+ if ( ! empty( $this->help_anchors[ $o ] ) ) {
+ $ha = $this->help_anchors[ $o ];
+ }
+ if ( ! empty( $ha ) && ( $pos = strrpos( $hl, '#' ) ) ) {
$hl = substr( $hl, 0, $pos );
}
- if ( ( !empty( $ha ) && ( $ha[0] == 'h' ) ) ) $hl = '';
- if ( !empty( $ha ) || !isset( $this->help_anchors[$o] ) ) {
- $ht .= "" . __( "Click here for documentation on this setting", 'all-in-one-seo-pack' ) . " ";
+ if ( ! empty( $ha ) && ( $ha[0] == 'h' ) ) {
+ $hl = '';
}
- $default_options[$o]['help_text'] = $ht;
+ if ( ! empty( $ha ) || ! isset( $this->help_anchors[ $o ] ) ) {
+ $ht .= "" . __( 'Click here for documentation on this setting', 'all-in-one-seo-pack' ) . ' ';
+ }
+ $default_options[ $o ]['help_text'] = $ht;
}
}
}
-
+
function add_help_text_links() {
- if ( !empty( $this->help_text ) ) {
- foreach( $this->layout as $k => $v ) {
+ if ( ! empty( $this->help_text ) ) {
+ foreach ( $this->layout as $k => $v ) {
$this->help_text_helper( $this->default_options, $v['options'], $v['help_link'] );
}
- if ( !empty( $this->locations ) )
- foreach( $this->locations as $k => $v ) {
- if ( !empty( $v['default_options'] ) && !empty( $v['options'] ) ) {
- $this->help_text_helper( $this->locations[$k]['default_options'], $v['options'], $v['help_link'] );
+ if ( ! empty( $this->locations ) ) {
+ foreach ( $this->locations as $k => $v ) {
+ if ( ! empty( $v['default_options'] ) && ! empty( $v['options'] ) ) {
+ $this->help_text_helper( $this->locations[ $k ]['default_options'], $v['options'], $v['help_link'] );
}
}
+ }
}
}
-
+
/**
* Load scripts and styles for metaboxes.
- *
+ *
* edit-tags exists only for pre 4.5 support... remove when we drop 4.5 support.
* Also, that check and others should be pulled out into their own functions
*/
- function enqueue_metabox_scripts( ) {
+ function enqueue_metabox_scripts() {
$screen = '';
- if ( function_exists( 'get_current_screen' ) )
+ if ( function_exists( 'get_current_screen' ) ) {
$screen = get_current_screen();
+ }
$bail = false;
- if ( empty( $screen ) ) $bail = true;
- if ( ( $screen->base != 'post' ) && ( $screen->base != 'term' ) && ( $screen->base != 'edit-tags' ) && ( $screen->base != 'toplevel_page_shopp-products' ) ) $bail = true;
+ if ( empty( $screen ) ) {
+ $bail = true;
+ }
+ if ( ( $screen->base != 'post' ) && ( $screen->base != 'term' ) && ( $screen->base != 'edit-tags' ) && ( $screen->base != 'toplevel_page_shopp-products' ) ) {
+ $bail = true;
+ }
$prefix = $this->get_prefix();
- $bail = apply_filters( $prefix . 'bail_on_enqueue', $bail, $screen );
- if ( $bail ) return;
+ $bail = apply_filters( $prefix . 'bail_on_enqueue', $bail, $screen );
+ if ( $bail ) {
+ return;
+ }
$this->form = 'post';
- if ( $screen->base == 'term' || $screen->base == 'edit-tags' ) $this->form = 'edittag';
- if ( $screen->base == 'toplevel_page_shopp-products' ) $this->form = 'product';
+ if ( $screen->base == 'term' || $screen->base == 'edit-tags' ) {
+ $this->form = 'edittag';
+ }
+ if ( $screen->base == 'toplevel_page_shopp-products' ) {
+ $this->form = 'product';
+ }
$this->form = apply_filters( $prefix . 'set_form_on_enqueue', $this->form, $screen );
- foreach( $this->locations as $k => $v ) {
- if ( $v['type'] === 'metabox' ) {
- if ( isset( $v['display'] ) && !empty( $v['display'] ) ) {
+ foreach ( $this->locations as $k => $v ) {
+ if ( $v['type'] === 'metabox' && isset( $v['display'] ) && ! empty( $v['display'] ) ) {
$enqueue_scripts = false;
$enqueue_scripts = ( ( ( $screen->base == 'toplevel_page_shopp-products' ) && in_array( 'shopp_product', $v['display'] ) ) ) || in_array( $screen->post_type, $v['display'] );
$enqueue_scripts = apply_filters( $prefix . 'enqueue_metabox_scripts', $enqueue_scripts, $screen, $v );
if ( $enqueue_scripts ) {
- add_filter( 'aioseop_localize_script_data', Array( $this, 'localize_script_data' ) );
- add_action( "admin_print_scripts", Array( $this, 'enqueue_scripts' ), 20 );
- add_action( "admin_print_scripts", Array( $this, 'enqueue_styles' ), 20 );
- }
+ add_filter( 'aioseop_localize_script_data', array( $this, 'localize_script_data' ) );
+ add_action( 'admin_print_scripts', array( $this, 'enqueue_scripts' ), 20 );
+ add_action( 'admin_print_scripts', array( $this, 'enqueue_styles' ), 20 );
}
}
}
}
-
+
/**
* Load styles for module.
*/
- function enqueue_styles( ) {
+ function enqueue_styles() {
wp_enqueue_style( 'thickbox' );
- if ( !empty( $this->pointers ) ) wp_enqueue_style( 'wp-pointer' );
- wp_enqueue_style( 'aioseop-module-style', AIOSEOP_PLUGIN_URL . 'css/modules/aioseop_module.css' );
- if ( function_exists( 'is_rtl' ) && is_rtl() )
- wp_enqueue_style( 'aioseop-module-style-rtl', AIOSEOP_PLUGIN_URL . 'css/modules/aioseop_module-rtl.css', array('aioseop-module-style') );
+ if ( ! empty( $this->pointers ) ) {
+ wp_enqueue_style( 'wp-pointer' );
+ }
+ wp_enqueue_style( 'aioseop-module-style', AIOSEOP_PLUGIN_URL . 'css/modules/aioseop_module.css' );
+ if ( function_exists( 'is_rtl' ) && is_rtl() ) {
+ wp_enqueue_style( 'aioseop-module-style-rtl', AIOSEOP_PLUGIN_URL . 'css/modules/aioseop_module-rtl.css', array( 'aioseop-module-style' ) );
+ }
}
-
+
/**
* Load scripts for module, can pass data to module script.
*/
- function enqueue_scripts( ) {
+ function enqueue_scripts() {
wp_enqueue_script( 'sack' );
wp_enqueue_script( 'jquery' );
wp_enqueue_script( 'media-upload' );
@@ -1284,198 +1498,267 @@ function enqueue_scripts( ) {
wp_enqueue_script( 'common' );
wp_enqueue_script( 'wp-lists' );
wp_enqueue_script( 'postbox' );
- if ( !empty( $this->pointers ) ) {
+ if ( ! empty( $this->pointers ) ) {
wp_enqueue_script( 'wp-pointer', false, array( 'jquery' ) );
}
- wp_enqueue_script( 'aioseop-module-script', AIOSEOP_PLUGIN_URL . 'js/modules/aioseop_module.js', Array(), AIOSEOP_VERSION );
- if ( !empty( $this->script_data ) ) {
+ wp_enqueue_script( 'aioseop-module-script', AIOSEOP_PLUGIN_URL . 'js/modules/aioseop_module.js', array(), AIOSEOP_VERSION );
+ if ( ! empty( $this->script_data ) ) {
aioseop_localize_script_data();
}
}
-
+
function localize_script_data( $data ) {
- if ( !is_array( $data ) ) {
- $data = Array( 0 => $data );
+ if ( ! is_array( $data ) ) {
+ $data = array( 0 => $data );
}
- if ( empty( $this->script_data ) ) $this->script_data = Array();
- if ( !empty( $this->pointers ) )
+ if ( empty( $this->script_data ) ) {
+ $this->script_data = array();
+ }
+ if ( ! empty( $this->pointers ) ) {
$this->script_data['pointers'] = $this->pointers;
- if ( empty( $data[0]['condshow'] ) ) $data[0]['condshow'] = Array();
- if ( empty( $this->script_data['condshow'] ) ) $this->script_data['condshow'] = Array();
- $condshow = $this->script_data['condshow'];
+ }
+ if ( empty( $data[0]['condshow'] ) ) {
+ $data[0]['condshow'] = array();
+ }
+ if ( empty( $this->script_data['condshow'] ) ) {
+ $this->script_data['condshow'] = array();
+ }
+ $condshow = $this->script_data['condshow'];
$data[0]['condshow'] = array_merge( $data[0]['condshow'], $condshow );
unset( $this->script_data['condshow'] );
- $data[0] = array_merge( $this->script_data, $data[0] );
+ $data[0] = array_merge( $this->script_data, $data[0] );
$this->script_data['condshow'] = $condshow;
+
return $data;
}
-
+
/**
* Override this to run code at the beginning of the settings page.
*/
function settings_page_init() {
-
+
}
-
+
/**
* Filter out admin pointers that have already been clicked.
*/
function filter_pointers() {
- if ( !empty( $this->pointers ) ) {
+ if ( ! empty( $this->pointers ) ) {
$dismissed = explode( ',', (string) get_user_meta( get_current_user_id(), 'dismissed_wp_pointers', true ) );
- foreach( $dismissed as $d )
- if ( isset( $this->pointers[$d] ) )
- unset( $this->pointers[$d] );
+ foreach ( $dismissed as $d ) {
+ if ( isset( $this->pointers[ $d ] ) ) {
+ unset( $this->pointers[ $d ] );
+ }
+ }
}
}
-
+
/**
* Add basic hooks when on the module's page.
*/
function add_page_hooks() {
$hookname = current_filter();
- if ( $this->strpos( $hookname, 'load-' ) === 0 )
+ if ( $this->strpos( $hookname, 'load-' ) === 0 ) {
$this->pagehook = $this->substr( $hookname, 5 );
- add_action( "admin_print_scripts", Array( $this, 'enqueue_scripts' ) );
- add_action( "admin_print_styles", Array( $this, 'enqueue_styles' ) );
- add_filter( 'aioseop_localize_script_data', Array( $this, 'localize_script_data' ) );
- add_action( $this->prefix . 'settings_header', Array( $this, 'display_tabs' ) );
+ }
+ add_action( 'admin_print_scripts', array( $this, 'enqueue_scripts' ) );
+ add_action( 'admin_print_styles', array( $this, 'enqueue_styles' ) );
+ add_filter( 'aioseop_localize_script_data', array( $this, 'localize_script_data' ) );
+ add_action( $this->prefix . 'settings_header', array( $this, 'display_tabs' ) );
}
-
+
function get_admin_links() {
- if ( !empty( $this->menu_name ) )
+ if ( ! empty( $this->menu_name ) ) {
$name = $this->menu_name;
- else
+ } else {
$name = $this->name;
-
+ }
+
$hookname = plugin_basename( $this->file );
-
- $links = Array();
- $url = '';
- if ( function_exists( 'menu_page_url' ) )
- $url = menu_page_url( $hookname, 0 );
- if ( empty( $url ) )
- $url = esc_url( admin_url( 'admin.php?page=' . $hookname ) );
-
- if ( $this->locations === null )
- array_unshift( $links, array( 'parent' => AIOSEOP_PLUGIN_DIRNAME, 'title' => $name, 'id' => $hookname, 'href' => $url, 'order' => $this->menu_order() ) );
- else {
- foreach( $this->locations as $k => $v ) {
+
+ $links = array();
+ $url = '';
+ if ( function_exists( 'menu_page_url' ) ) {
+ $url = menu_page_url( $hookname, 0 );
+ }
+ if ( empty( $url ) ) {
+ $url = esc_url( admin_url( 'admin.php?page=' . $hookname ) );
+ }
+
+ if ( $this->locations === null ) {
+ array_unshift( $links, array(
+ 'parent' => AIOSEOP_PLUGIN_DIRNAME,
+ 'title' => $name,
+ 'id' => $hookname,
+ 'href' => $url,
+ 'order' => $this->menu_order()
+ ) );
+ } else {
+ foreach ( $this->locations as $k => $v ) {
if ( $v['type'] === 'settings' ) {
if ( $k === 'default' ) {
- array_unshift( $links, array( 'parent' => AIOSEOP_PLUGIN_DIRNAME, 'title' => $name, 'id' => $hookname, 'href' => $url, 'order' => $this->menu_order() ) );
+ array_unshift( $links, array(
+ 'parent' => AIOSEOP_PLUGIN_DIRNAME,
+ 'title' => $name,
+ 'id' => $hookname,
+ 'href' => $url,
+ 'order' => $this->menu_order()
+ ) );
} else {
- if ( !empty( $v['menu_name'] ) )
+ if ( ! empty( $v['menu_name'] ) ) {
$name = $v['menu_name'];
- else
+ } else {
$name = $v['name'];
- array_unshift( $links, array( 'parent' => AIOSEOP_PLUGIN_DIRNAME, 'title' => $name, 'id' => $this->get_prefix( $k ) . $k, 'href' => esc_url( admin_url( 'admin.php?page=' . $this->get_prefix( $k ) . $k ) ), 'order' => $this->menu_order() ) );
+ }
+ array_unshift( $links, array(
+ 'parent' => AIOSEOP_PLUGIN_DIRNAME,
+ 'title' => $name,
+ 'id' => $this->get_prefix( $k ) . $k,
+ 'href' => esc_url( admin_url( 'admin.php?page=' . $this->get_prefix( $k ) . $k ) ),
+ 'order' => $this->menu_order()
+ ) );
}
}
}
}
+
return $links;
}
-
+
function add_admin_bar_submenu() {
global $aioseop_admin_menu, $wp_admin_bar;
-
+
if ( $aioseop_admin_menu ) {
$links = $this->get_admin_links();
- if ( !empty( $links ) )
- foreach( $links as $l )
+ if ( ! empty( $links ) ) {
+ foreach ( $links as $l ) {
$wp_admin_bar->add_menu( $l );
+ }
+ }
}
}
-
+
/**
* Collect metabox data together for tabbed metaboxes.
*/
function filter_return_metaboxes( $args ) {
return array_merge( $args, $this->post_metaboxes );
}
-
+
/** Add submenu for module, call page hooks, set up metaboxes. */
function add_menu( $parent_slug ) {
- if ( !empty( $this->menu_name ) )
+ if ( ! empty( $this->menu_name ) ) {
$name = $this->menu_name;
- else
+ } else {
$name = $this->name;
+ }
if ( $this->locations === null ) {
- $hookname = add_submenu_page( $parent_slug, $name, $name, apply_filters( 'manage_aiosp', 'aiosp_manage_seo' ), plugin_basename( $this->file ), Array( $this, 'display_settings_page' ) );
- add_action( "load-{$hookname}", Array( $this, 'add_page_hooks' ) );
+ $hookname = add_submenu_page( $parent_slug, $name, $name, apply_filters( 'manage_aiosp', 'aiosp_manage_seo' ), plugin_basename( $this->file ), array(
+ $this,
+ 'display_settings_page'
+ ) );
+ add_action( "load-{$hookname}", array( $this, 'add_page_hooks' ) );
+
return true;
}
- foreach( $this->locations as $k => $v ) {
+ foreach ( $this->locations as $k => $v ) {
if ( $v['type'] === 'settings' ) {
if ( $k === 'default' ) {
- if ( !empty( $this->menu_name ) )
+ if ( ! empty( $this->menu_name ) ) {
$name = $this->menu_name;
- else
+ } else {
$name = $this->name;
- $hookname = add_submenu_page( $parent_slug, $name, $name, apply_filters( 'manage_aiosp', 'aiosp_manage_seo' ), plugin_basename( $this->file ), Array( $this, 'display_settings_page' ) );
+ }
+ $hookname = add_submenu_page( $parent_slug, $name, $name, apply_filters( 'manage_aiosp', 'aiosp_manage_seo' ), plugin_basename( $this->file ), array(
+ $this,
+ 'display_settings_page'
+ ) );
} else {
- if ( !empty( $v['menu_name'] ) )
+ if ( ! empty( $v['menu_name'] ) ) {
$name = $v['menu_name'];
- else
+ } else {
$name = $v['name'];
- $hookname = add_submenu_page( $parent_slug, $name, $name, apply_filters( 'manage_aiosp', 'aiosp_manage_seo' ), $this->get_prefix( $k ) . $k, Array( $this, "display_settings_page_$k" ) );
+ }
+ $hookname = add_submenu_page( $parent_slug, $name, $name, apply_filters( 'manage_aiosp', 'aiosp_manage_seo' ), $this->get_prefix( $k ) . $k, array(
+ $this,
+ "display_settings_page_$k"
+ ) );
}
- add_action( "load-{$hookname}", Array( $this, 'add_page_hooks' ) );
+ add_action( "load-{$hookname}", array( $this, 'add_page_hooks' ) );
} elseif ( $v['type'] === 'metabox' ) {
$this->setting_options( $k ); // hack -- make sure this runs anyhow, for now -- pdb
- add_action( 'edit_post', array( $this, 'save_post_data' ) );
- add_action( 'publish_post', array( $this, 'save_post_data' ) );
- add_action( 'add_attachment', array( $this, 'save_post_data' ) );
- add_action( 'edit_attachment', array( $this, 'save_post_data' ) );
- add_action( 'save_post', array( $this, 'save_post_data' ) );
- add_action( 'edit_page_form', array( $this, 'save_post_data' ) );
- if ( isset( $v['display'] ) && !empty( $v['display'] ) ) {
- add_action( "admin_print_scripts", Array( $this, 'enqueue_metabox_scripts' ), 5 );
- if ( $this->tabbed_metaboxes )
- add_filter( 'aioseop_add_post_metabox', Array( $this, 'filter_return_metaboxes' ) );
+ add_action( 'edit_post', array( $this, 'save_post_data' ) );
+ add_action( 'publish_post', array( $this, 'save_post_data' ) );
+ add_action( 'add_attachment', array( $this, 'save_post_data' ) );
+ add_action( 'edit_attachment', array( $this, 'save_post_data' ) );
+ add_action( 'save_post', array( $this, 'save_post_data' ) );
+ add_action( 'edit_page_form', array( $this, 'save_post_data' ) );
+ if ( isset( $v['display'] ) && ! empty( $v['display'] ) ) {
+ add_action( 'admin_print_scripts', array( $this, 'enqueue_metabox_scripts' ), 5 );
+ if ( $this->tabbed_metaboxes ) {
+ add_filter( 'aioseop_add_post_metabox', array( $this, 'filter_return_metaboxes' ) );
+ }
foreach ( $v['display'] as $posttype ) {
$v['location'] = $k;
$v['posttype'] = $posttype;
- if ( !isset($v['context'] ) ) $v['context'] = 'advanced';
- if ( !isset($v['priority'] ) ) $v['priority'] = 'default';
+ if ( ! isset( $v['context'] ) ) {
+ $v['context'] = 'advanced';
+ }
+ if ( ! isset( $v['priority'] ) ) {
+ $v['priority'] = 'default';
+ }
if ( $this->tabbed_metaboxes ) {
- $this->post_metaboxes[] = Array( 'id' => $v['prefix'] . $k, 'title' => $v['name'], 'callback' => Array( $this, 'display_metabox' ),
- 'post_type' => $posttype, 'context' => $v['context'], 'priority' => $v['priority'], 'callback_args' => $v );
+ $this->post_metaboxes[] = array(
+ 'id' => $v['prefix'] . $k,
+ 'title' => $v['name'],
+ 'callback' => array( $this, 'display_metabox' ),
+ 'post_type' => $posttype,
+ 'context' => $v['context'],
+ 'priority' => $v['priority'],
+ 'callback_args' => $v
+ );
} else {
$title = $v['name'];
- if ( $title != $this->plugin_name ) $title = $this->plugin_name . ' - ' . $title;
- if ( !empty( $v['help_link'] ) )
- $title .= "" . __( 'Help', 'all-in-one-seo-pack' ) . " ";
- add_meta_box( $v['prefix'] . $k, $title, Array( $this, 'display_metabox' ), $posttype, $v['context'], $v['priority'], $v );
+ if ( $title != $this->plugin_name ) {
+ $title = $this->plugin_name . ' - ' . $title;
+ }
+ if ( ! empty( $v['help_link'] ) ) {
+ $title .= "" . __( 'Help', 'all-in-one-seo-pack' ) . ' ';
+ }
+ add_meta_box( $v['prefix'] . $k, $title, array(
+ $this,
+ 'display_metabox'
+ ), $posttype, $v['context'], $v['priority'], $v );
}
}
}
}
}
}
-
+
/**
* Update postmeta for metabox.
*/
function save_post_data( $post_id ) {
static $update = false;
- if ( $update ) return;
+ if ( $update ) {
+ return;
+ }
if ( $this->locations !== null ) {
- foreach( $this->locations as $k => $v ) {
- if ( isset($v['type']) && ( $v['type'] === 'metabox' ) ) {
- $opts = $this->default_options( $k );
- $options = Array();
- $update = false;
+ foreach ( $this->locations as $k => $v ) {
+ if ( isset( $v['type'] ) && ( $v['type'] === 'metabox' ) ) {
+ $opts = $this->default_options( $k );
+ $options = array();
+ $update = false;
foreach ( $opts as $l => $o ) {
- if ( isset($_POST[$l] ) ) {
- $options[$l] = stripslashes_deep( $_POST[$l] );
- $options[$l] = esc_attr( $options[$l] );
- $update = true;
+ if ( isset( $_POST[ $l ] ) ) {
+ $options[ $l ] = stripslashes_deep( $_POST[ $l ] );
+ $options[ $l ] = esc_attr( $options[ $l ] );
+ $update = true;
}
}
if ( $update ) {
- $prefix = $this->get_prefix( $k );
+ $prefix = $this->get_prefix( $k );
$options = apply_filters( $prefix . 'filter_metabox_options', $options, $k, $post_id );
update_post_meta( $post_id, '_' . $prefix . $k, $options );
}
@@ -1483,244 +1766,346 @@ function save_post_data( $post_id ) {
}
}
}
-
+
/**
* Outputs radio buttons, checkboxes, selects, multiselects, handles groups.
- */
+ */
function do_multi_input( $args ) {
extract( $args );
$buf1 = '';
$type = $options['type'];
if ( ( $type == 'radio' ) || ( $type == 'checkbox' ) ) {
- $strings = Array(
- 'block' => "%s\n",
- 'group' => "\t%s \n%s\n",
- 'item' => "\t %s \n",
- 'item_args' => Array( 'sel', 'name', 'v', 'attr', 'subopt' ),
- 'selected' => 'checked '
- );
+ $strings = array(
+ 'block' => "%s\n",
+ 'group' => "\t%s \n%s\n",
+ 'item' => "\t %s \n",
+ 'item_args' => array( 'sel', 'name', 'v', 'attr', 'subopt' ),
+ 'selected' => 'checked '
+ );
} else {
- $strings = Array(
- 'block' => "%s\n \n",
- 'group' => "\t\n%s\t \n",
- 'item' => "\t%s \n",
- 'item_args' => Array( 'sel', 'v', 'subopt' ),
- 'selected' => 'selected '
- );
+ $strings = array(
+ 'block' => "%s\n \n",
+ 'group' => "\t\n%s\t \n",
+ 'item' => "\t%s \n",
+ 'item_args' => array( 'sel', 'v', 'subopt' ),
+ 'selected' => 'selected '
+ );
}
$setsel = $strings['selected'];
- if ( isset($options['initial_options'] ) && is_array($options['initial_options']) ) {
+ if ( isset( $options['initial_options'] ) && is_array( $options['initial_options'] ) ) {
foreach ( $options['initial_options'] as $l => $option ) {
$is_group = is_array( $option );
- if ( !$is_group ) $option = Array( $l => $option );
+ if ( ! $is_group ) {
+ $option = array( $l => $option );
+ }
$buf2 = '';
foreach ( $option as $v => $subopt ) {
- $sel = '';
+ $sel = '';
$is_arr = is_array( $value );
if ( is_string( $v ) || is_string( $value ) ) {
- if ( is_string( $value ) )
- $cmp = !strcmp( $v, $value );
- else
- $cmp = !strcmp( $v, "" );
- // $cmp = !strcmp( (string)$v, (string)$value );
- } else
+ if ( is_string( $value ) ) {
+ $cmp = ! strcmp( $v, $value );
+ } else {
+ $cmp = ! strcmp( $v, '' );
+ }
+ // $cmp = !strcmp( (string)$v, (string)$value );
+ } else {
$cmp = ( $value == $v );
- if ( ( !$is_arr && $cmp ) || ( $is_arr && in_array( $v, $value ) ) )
+ }
+ if ( ( ! $is_arr && $cmp ) || ( $is_arr && in_array( $v, $value ) ) ) {
$sel = $setsel;
- $item_arr = Array();
- foreach( $strings['item_args'] as $arg ) $item_arr[] = $$arg;
+ }
+ $item_arr = array();
+ foreach ( $strings['item_args'] as $arg ) {
+ $item_arr[] = $$arg;
+ }
$buf2 .= vsprintf( $strings['item'], $item_arr );
}
- if ( $is_group )
- $buf1 .= sprintf( $strings['group'], $l, $buf2);
- else
+ if ( $is_group ) {
+ $buf1 .= sprintf( $strings['group'], $l, $buf2 );
+ } else {
$buf1 .= $buf2;
- }
+ }
+ }
$buf1 = sprintf( $strings['block'], $buf1 );
}
+
return $buf1;
}
-
+
/**
* Outputs a setting item for settings pages and metaboxes.
*/
function get_option_html( $args ) {
static $n = 0;
extract( $args );
- if ( $options['type'] == 'custom' )
- return apply_filters( "{$prefix}output_option", '', $args );
- if ( in_array( $options['type'], Array( 'multiselect', 'select', 'multicheckbox', 'radio', 'checkbox', 'textarea', 'text', 'submit', 'hidden' ) ) && ( is_string( $value ) ) )
+ if ( $options['type'] == 'custom' ) {
+ return apply_filters( "{$prefix}output_option", '', $args );
+ }
+ if ( in_array( $options['type'], array(
+ 'multiselect',
+ 'select',
+ 'multicheckbox',
+ 'radio',
+ 'checkbox',
+ 'textarea',
+ 'text',
+ 'submit',
+ 'hidden'
+ ) ) && is_string( $value )
+ ) {
$value = esc_attr( $value );
- $buf = '';
+ }
+ $buf = '';
$onload = '';
- if ( !empty( $options['count'] ) ) {
- $n++;
+ if ( ! empty( $options['count'] ) ) {
+ $n ++;
$attr .= " onKeyDown='if (typeof countChars == \"function\") countChars(document.{$this->form}.$name,document.{$this->form}.{$prefix}length$n)' onKeyUp='if (typeof countChars == \"function\") countChars(document.{$this->form}.$name,document.{$this->form}.{$prefix}length$n)'";
$onload = "if (typeof countChars == \"function\") countChars(document.{$this->form}.$name,document.{$this->form}.{$prefix}length$n);";
}
- if ( isset( $opts['id'] ) ) $attr .= " id=\"{$opts['id']}\" ";
+ if ( isset( $opts['id'] ) ) {
+ $attr .= " id=\"{$opts['id']}\" ";
+ }
switch ( $options['type'] ) {
- case 'multiselect': $attr .= ' MULTIPLE';
- $args['attr'] = $attr;
- $args['name'] = $name = "{$name}[]";
- case 'select': $buf .= $this->do_multi_input( $args ); break;
- case 'multicheckbox': $args['name'] = $name = "{$name}[]";
- $args['options']['type'] = $options['type'] = 'checkbox';
- case 'radio': $buf .= $this->do_multi_input( $args ); break;
- case 'checkbox': if ( $value ) $attr .= ' CHECKED';
- $buf .= " \n"; break;
- case 'textarea': $buf .= ""; break;
- case 'image': $buf .= " " .
- " \n";
- break;
- case 'html': $buf .= $value; break;
- default: $buf .= " \n";
- }
- if ( !empty( $options['count'] ) ) {
+ case 'multiselect':
+ $attr .= ' MULTIPLE';
+ $args['attr'] = $attr;
+ $args['name'] = $name = "{$name}[]";
+ case 'select':
+ $buf .= $this->do_multi_input( $args );
+ break;
+ case 'multicheckbox':
+ $args['name'] = $name = "{$name}[]";
+ $args['options']['type'] = $options['type'] = 'checkbox';
+ case 'radio':
+ $buf .= $this->do_multi_input( $args );
+ break;
+ case 'checkbox':
+ if ( $value ) {
+ $attr .= ' CHECKED';
+ }
+ $buf .= " \n";
+ break;
+ case 'textarea':
+ $buf .= "";
+ break;
+ case 'image':
+ $buf .= " " .
+ " \n";
+ break;
+ case 'html':
+ $buf .= $value;
+ break;
+ case 'esc_html':
+ $buf .= "" . esc_html( $value ) . " \n";
+ break;
+ default:
+ $buf .= " \n";
+ }
+ if ( ! empty( $options['count'] ) ) {
$size = 60;
- if ( isset( $options['size'] ) ) $size = $options['size'];
- elseif ( isset( $options['rows'] ) && isset( $options['cols'] ) ) $size = $options['rows'] * $options['cols'];
- if ( isset( $options['count_desc'] ) )
+ if ( isset( $options['size'] ) ) {
+ $size = $options['size'];
+ } elseif ( isset( $options['rows'] ) && isset( $options['cols'] ) ) {
+ $size = $options['rows'] * $options['cols'];
+ }
+ if ( isset( $options['count_desc'] ) ) {
$count_desc = $options['count_desc'];
- else
+ } else {
$count_desc = __( ' characters. Most search engines use a maximum of %s chars for the %s.', 'all-in-one-seo-pack' );
- $buf .= " "
- . sprintf( $count_desc, $size, trim( $this->strtolower( $options['name'] ), ':' ) );
- if ( !empty( $onload ) ) $buf .= "";
+ }
+ $buf .= " "
+ . sprintf( $count_desc, $size, trim( $this->strtolower( $options['name'] ), ':' ) );
+ if ( ! empty( $onload ) ) {
+ $buf .= "";
+ }
}
+
return $buf;
}
-
- const DISPLAY_HELP_START = '%s ';
- const DISPLAY_HELP_END = '%s
';
- const DISPLAY_LABEL_FORMAT = '%s ';
- const DISPLAY_TOP_LABEL = " \n\n\n";
+ const DISPLAY_ROW_TEMPLATE = '
';
+
/**
* Format a row for an option on a settings page.
*/
function get_option_row( $name, $opts, $args ) {
$label_text = $input_attr = $help_text_2 = $id_attr = '';
- if ( $opts['label'] == 'top' )
- $align = 'left';
- else
+ if ( $opts['label'] == 'top' ) {
+ $align = 'left';
+ } else {
$align = 'right';
- if ( isset( $opts['id'] ) ) $id_attr .= " id=\"{$opts['id']}_div\" ";
- if ( $opts['label'] != 'none' ) {
+ }
+ if ( isset( $opts['id'] ) ) {
+ $id_attr .= " id=\"{$opts['id']}_div\" ";
+ }
+ if ( $opts['label'] != 'none' ) {
if ( isset( $opts['help_text'] ) ) {
- $help_text = sprintf( All_in_One_SEO_Pack_Module::DISPLAY_HELP_START, __( 'Click for Help!', 'all-in-one-seo-pack' ), $name, $opts['name'] );
- $help_text_2 = sprintf( All_in_One_SEO_Pack_Module::DISPLAY_HELP_END, $name, $opts['help_text'] );
- } else $help_text = $opts['name'];
+ $help_text = sprintf( All_in_One_SEO_Pack_Module::DISPLAY_HELP_START, __( 'Click for Help!', 'all-in-one-seo-pack' ), $name, $opts['name'] );
+ $help_text_2 = sprintf( All_in_One_SEO_Pack_Module::DISPLAY_HELP_END, $name, $opts['help_text'] );
+ } else {
+ $help_text = $opts['name'];
+ }
$label_text = sprintf( All_in_One_SEO_Pack_Module::DISPLAY_LABEL_FORMAT, $align, $help_text );
- } else $input_attr .= ' aioseop_no_label ';
- if ( $opts['label'] == 'top' ) $label_text .= All_in_One_SEO_Pack_Module::DISPLAY_TOP_LABEL;
+ } else {
+ $input_attr .= ' aioseop_no_label ';
+ }
+ if ( $opts['label'] == 'top' ) {
+ $label_text .= All_in_One_SEO_Pack_Module::DISPLAY_TOP_LABEL;
+ }
$input_attr .= " aioseop_{$opts['type']}_type";
+
return sprintf( All_in_One_SEO_Pack_Module::DISPLAY_ROW_TEMPLATE, $input_attr, $name, $label_text, $id_attr, $this->get_option_html( $args ), $help_text_2 );
}
-
+
/**
* Display options for settings pages and metaboxes, allows for filtering settings, custom display options.
*/
function display_options( $location = null, $meta_args = null ) {
- static $location_settings = Array();
- $defaults = null;
- $prefix = $this->get_prefix( $location );
- $help_link = '';
- if ( is_array( $meta_args['args'] ) && !empty( $meta_args['args']['default_options'] ) ) {
- $defaults = $meta_args['args']['default_options'];
- }
- if ( !empty( $meta_args['callback_args'] ) ) {
- if ( !empty( $meta_args['callback_args']['help_link'] ) ) {
- $help_link = $meta_args['callback_args']['help_link'];
- }
- }
- if ( !empty( $help_link ) )
- echo "
" . __( 'Help', 'all-in-one-seo-pack' ) . " ";
-
- if ( !isset( $location_settings[$prefix] ) ) {
- $current_options = apply_filters( "{$this->prefix}display_options", $this->get_current_options( Array(), $location, $defaults ), $location );
- $settings = apply_filters( "{$this->prefix}display_settings", $this->setting_options( $location, $defaults ), $location, $current_options );
- $current_options = apply_filters( "{$this->prefix}override_options", $current_options, $location, $settings );
- $location_settings[$prefix]['current_options'] = $current_options;
- $location_settings[$prefix]['settings'] = $settings;
- } else {
- $current_options = $location_settings[$prefix]['current_options'];
- $settings = $location_settings[$prefix]['settings'];
- }
- // $opts["snippet"]["default"] = sprintf( $opts["snippet"]["default"], "foo", "bar", "moby" );
- $container = "
";
- if ( is_array( $meta_args['args'] ) && !empty( $meta_args['args']['options'] ) ) {
- $args = Array();
- $arg_keys = Array();
- foreach ( $meta_args['args']['options'] as $a ) {
- if ( !empty($location) ) {
- $key = $prefix . $location . '_' . $a;
- if ( !isset( $settings[$key] ) ) $key = $a;
- } else $key = $prefix . $a;
- if ( isset( $settings[$key] ) ) $arg_keys[$key] = 1;
- elseif ( isset( $settings[$a] ) ) $arg_keys[$a] = 1;
- }
- $setting_keys = array_keys( $settings );
- foreach ( $setting_keys as $s )
- if ( !empty( $arg_keys[$s] ) ) $args[$s] = $settings[$s];
- } else $args = $settings;
- foreach ( $args as $name => $opts ) {
- $attr_list = Array( 'class', 'style', 'readonly', 'disabled', 'size', 'placeholder' );
- if ( $opts['type'] == 'textarea' ) $attr_list = array_merge( $attr_list, Array('rows', 'cols') );
- $attr = '';
- foreach ( $attr_list as $a )
- if ( isset( $opts[$a] ) ) $attr .= ' ' . $a . '="' . esc_attr( $opts[$a] ) . '" ';
- $opt = '';
- if ( isset( $current_options[$name] ) ) $opt = $current_options[$name];
- if ( $opts['label'] == 'none' && $opts['type'] == 'submit' && $opts['save'] == false ) $opt = $opts['name'];
- if ( $opts['type'] == 'html' && empty( $opt ) && $opts['save'] == false ) $opt = $opts['default'];
-
- $args = Array( 'name' => $name, 'options' => $opts, 'attr' => $attr, 'value' => $opt, 'prefix' => $prefix );
- if ( !empty( $opts['nowrap'] ) )
- echo $this->get_option_html( $args );
- else {
- if ( $container ) {
- echo $container;
- $container = '';
+ static $location_settings = array();
+ $defaults = null;
+ $prefix = $this->get_prefix( $location );
+ $help_link = '';
+ if ( is_array( $meta_args['args'] ) && ! empty( $meta_args['args']['default_options'] ) ) {
+ $defaults = $meta_args['args']['default_options'];
+ }
+ if ( ! empty( $meta_args['callback_args'] ) && ! empty( $meta_args['callback_args']['help_link'] ) ) {
+ $help_link = $meta_args['callback_args']['help_link'];
+ }
+ if ( ! empty( $help_link ) ) {
+ echo "
" . __( 'Help', 'all-in-one-seo-pack' ) . ' ';
+ }
+
+ if ( ! isset( $location_settings[ $prefix ] ) ) {
+ $current_options = apply_filters( "{$this->prefix}display_options", $this->get_current_options( array(), $location, $defaults ), $location );
+ $settings = apply_filters( "{$this->prefix}display_settings", $this->setting_options( $location, $defaults ), $location, $current_options );
+ $current_options = apply_filters( "{$this->prefix}override_options", $current_options, $location, $settings );
+ $location_settings[ $prefix ]['current_options'] = $current_options;
+ $location_settings[ $prefix ]['settings'] = $settings;
+ } else {
+ $current_options = $location_settings[ $prefix ]['current_options'];
+ $settings = $location_settings[ $prefix ]['settings'];
+ }
+ // $opts["snippet"]["default"] = sprintf( $opts["snippet"]["default"], "foo", "bar", "moby" );
+ $container = "
";
+ if ( is_array( $meta_args['args'] ) && ! empty( $meta_args['args']['options'] ) ) {
+ $args = array();
+ $arg_keys = array();
+ foreach ( $meta_args['args']['options'] as $a ) {
+ if ( ! empty( $location ) ) {
+ $key = $prefix . $location . '_' . $a;
+ if ( ! isset( $settings[ $key ] ) ) {
+ $key = $a;
}
- echo $this->get_option_row( $name, $opts, $args );
+ } else {
+ $key = $prefix . $a;
+ }
+ if ( isset( $settings[ $key ] ) ) {
+ $arg_keys[ $key ] = 1;
+ } elseif ( isset( $settings[ $a ] ) ) {
+ $arg_keys[ $a ] = 1;
+ }
+ }
+ $setting_keys = array_keys( $settings );
+ foreach ( $setting_keys as $s ) {
+ if ( ! empty( $arg_keys[ $s ] ) ) {
+ $args[ $s ] = $settings[ $s ];
+ }
+ }
+ } else {
+ $args = $settings;
+ }
+ foreach ( $args as $name => $opts ) {
+ $attr_list = array( 'class', 'style', 'readonly', 'disabled', 'size', 'placeholder' );
+ if ( $opts['type'] == 'textarea' ) {
+ $attr_list = array_merge( $attr_list, array( 'rows', 'cols' ) );
+ }
+ $attr = '';
+ foreach ( $attr_list as $a ) {
+ if ( isset( $opts[ $a ] ) ) {
+ $attr .= ' ' . $a . '="' . esc_attr( $opts[ $a ] ) . '" ';
}
}
- if ( !$container ) echo "
";
+ $opt = '';
+ if ( isset( $current_options[ $name ] ) ) {
+ $opt = $current_options[ $name ];
+ }
+ if ( $opts['label'] == 'none' && $opts['type'] == 'submit' && $opts['save'] == false ) {
+ $opt = $opts['name'];
+ }
+ if ( $opts['type'] == 'html' && empty( $opt ) && $opts['save'] == false ) {
+ $opt = $opts['default'];
+ }
+
+ $args = array(
+ 'name' => $name,
+ 'options' => $opts,
+ 'attr' => $attr,
+ 'value' => $opt,
+ 'prefix' => $prefix
+ );
+ if ( ! empty( $opts['nowrap'] ) ) {
+ echo $this->get_option_html( $args );
+ } else {
+ if ( $container ) {
+ echo $container;
+ $container = '';
+ }
+ echo $this->get_option_row( $name, $opts, $args );
+ }
+ }
+ if ( ! $container ) {
+ echo '
';
+ }
}
-
+
function sanitize_domain( $domain ) {
$domain = trim( $domain );
$domain = $this->strtolower( $domain );
- if ( $this->strpos( $domain, "http://" ) === 0 ) $domain = $this->substr( $domain, 7 );
- elseif ( $this->strpos( $domain, "https://" ) === 0 ) $domain = $this->substr( $domain, 8 );
+ if ( $this->strpos( $domain, 'http://' ) === 0 ) {
+ $domain = $this->substr( $domain, 7 );
+ } elseif ( $this->strpos( $domain, 'https://' ) === 0 ) {
+ $domain = $this->substr( $domain, 8 );
+ }
$domain = untrailingslashit( $domain );
+
return $domain;
}
/** Sanitize options */
function sanitize_options( $location = null ) {
foreach ( $this->setting_options( $location ) as $k => $v ) {
- if ( isset( $this->options[$k] ) ) {
- if ( !empty( $v['sanitize'] ) )
+ if ( isset( $this->options[ $k ] ) ) {
+ if ( ! empty( $v['sanitize'] ) ) {
$type = $v['sanitize'];
- else
+ } else {
$type = $v['type'];
+ }
switch ( $type ) {
case 'multiselect':
- case 'multicheckbox': $this->options[$k] = urlencode_deep( $this->options[$k] );
- break;
- case 'textarea': $this->options[$k] = wp_kses_post( $this->options[$k] );
- $this->options[$k] = htmlspecialchars( $this->options[$k], ENT_QUOTES );
- break;
- case 'filename': $this->options[$k] = sanitize_file_name( $this->options[$k] );
- break;
- case 'text': $this->options[$k] = wp_kses_post( $this->options[$k] );
+ case 'multicheckbox':
+ $this->options[ $k ] = urlencode_deep( $this->options[ $k ] );
+ break;
+ case 'textarea':
+ $this->options[ $k ] = wp_kses_post( $this->options[ $k ] );
+ $this->options[ $k ] = htmlspecialchars( $this->options[ $k ], ENT_QUOTES );
+ break;
+ case 'filename':
+ $this->options[ $k ] = sanitize_file_name( $this->options[ $k ] );
+ break;
+ case 'text':
+ $this->options[ $k ] = wp_kses_post( $this->options[ $k ] );
case 'checkbox':
case 'radio':
case 'select':
- default: if ( !is_array( $this->options[$k] ) ) $this->options[$k] = esc_attr( $this->options[$k] );
+ default:
+ if ( ! is_array( $this->options[ $k ] ) ) {
+ $this->options[ $k ] = esc_attr( $this->options[ $k ] );
+ }
}
}
}
@@ -1739,39 +2124,43 @@ function display_metabox( $post, $metabox ) {
function reset_options( $location = null, $delete = false ) {
if ( $delete === true ) {
$this->delete_class_option( $delete );
- $this->options = Array();
+ $this->options = array();
}
$default_options = $this->default_options( $location );
foreach ( $default_options as $k => $v ) {
- $this->options[$k] = $v;
+ $this->options[ $k ] = $v;
}
$this->update_class_option( $this->options );
}
-
+
/** handle option resetting and updating */
function handle_settings_updates( $location = null ) {
$message = '';
- if ( (isset($_POST['action']) && $_POST['action'] == 'aiosp_update_module' &&
- ( isset( $_POST['Submit_Default'] ) || isset( $_POST['Submit_All_Default'] ) || !empty( $_POST['Submit'] ) ) ) ) {
+ if ( ( isset( $_POST['action'] ) && $_POST['action'] == 'aiosp_update_module' &&
+ ( isset( $_POST['Submit_Default'] ) || isset( $_POST['Submit_All_Default'] ) || ! empty( $_POST['Submit'] ) ) )
+ ) {
$nonce = $_POST['nonce-aioseop'];
- if (!wp_verify_nonce($nonce, 'aioseop-nonce')) die ( __( 'Security Check - If you receive this in error, log out and back in to WordPress', 'all-in-one-seo-pack' ) );
+ if ( ! wp_verify_nonce( $nonce, 'aioseop-nonce' ) ) {
+ die ( __( 'Security Check - If you receive this in error, log out and back in to WordPress', 'all-in-one-seo-pack' ) );
+ }
if ( isset( $_POST['Submit_Default'] ) || isset( $_POST['Submit_All_Default'] ) ) {
- $message = __( "Options Reset.", 'all-in-one-seo-pack' );
- if ( isset($_POST['Submit_All_Default']) ) {
+ $message = __( 'Options Reset.', 'all-in-one-seo-pack' );
+ if ( isset( $_POST['Submit_All_Default'] ) ) {
$this->reset_options( $location, true );
do_action( 'aioseop_options_reset' );
} else {
$this->reset_options( $location );
}
}
- if ( !empty( $_POST['Submit'] ) ) {
- $message = __("All in One SEO Options Updated.", 'all-in-one-seo-pack');
+ if ( ! empty( $_POST['Submit'] ) ) {
+ $message = __( 'All in One SEO Options Updated.', 'all-in-one-seo-pack' );
$default_options = $this->default_options( $location );
- foreach( $default_options as $k => $v ) {
- if ( isset( $_POST[$k] ) )
- $this->options[$k] = stripslashes_deep( $_POST[$k] );
- else
- $this->options[$k] = '';
+ foreach ( $default_options as $k => $v ) {
+ if ( isset( $_POST[ $k ] ) ) {
+ $this->options[ $k ] = stripslashes_deep( $_POST[ $k ] );
+ } else {
+ $this->options[ $k ] = '';
+ }
}
$this->sanitize_options( $location );
$this->options = apply_filters( $this->prefix . 'update_options', $this->options, $location );
@@ -1780,202 +2169,312 @@ function handle_settings_updates( $location = null ) {
}
do_action( $this->prefix . 'settings_update', $this->options, $location );
}
+
return $message;
}
/** Update / reset settings, printing options, sanitizing, posting back */
function display_settings_page( $location = null ) {
- if ( $location != null ) $location_info = $this->locations[$location];
- $name = null;
- if ( ( $location ) && ( isset( $location_info['name'] ) ) ) $name = $location_info['name'];
- if ( !$name ) $name = $this->name;
- $message = $this->handle_settings_updates( $location );
- $this->settings_page_init();
- ?>
-
- "; ?>
-
-
+ if ( $location != null ) {
+ $location_info = $this->locations[ $location ];
+ }
+ $name = null;
+ if ( $location && isset( $location_info['name'] ) ) {
+ $name = $location_info['name'];
+ }
+ if ( ! $name ) {
+ $name = $this->name;
+ }
+ $message = $this->handle_settings_updates( $location );
+ $this->settings_page_init();
+ ?>
+
+ prefix . 'settings_header', $location );
+ ?>
+
- prefix . 'settings_footer', $location );
- do_action( 'aioseop_global_settings_footer', $location ); ?>
-
prefix . 'settings_footer', $location );
+ do_action( 'aioseop_global_settings_footer', $location ); ?>
+ locations[$location]['prefix'] ) )
- return $this->locations[$location]['prefix'];
+ if ( ( $location != null ) && isset( $this->locations[ $location ]['prefix'] ) ) {
+ return $this->locations[ $location ]['prefix'];
+ }
+
return $this->prefix;
}
/** Sets up initial settings */
function setting_options( $location = null, $defaults = null ) {
- if ( $defaults === null )
+ if ( $defaults === null ) {
$defaults = $this->default_options;
+ }
$prefix = $this->get_prefix( $location );
- $opts = Array();
- if ( $location == null || $this->locations[$location]['options'] === null )
+ $opts = array();
+ if ( $location == null || $this->locations[ $location ]['options'] === null ) {
$options = $defaults;
- else {
- $options = Array();
- $prefix = "{$prefix}{$location}_";
- if ( !empty( $this->locations[$location]['default_options'] ) )
- $options = $this->locations[$location]['default_options'];
- foreach( $this->locations[$location]['options'] as $opt ) {
- if ( isset( $defaults[$opt] ) )
- $options[$opt] = $defaults[$opt];
- }
- }
- if ( !$prefix ) $prefix = $this->prefix;
- if ( !empty( $options ) )
- foreach ($options as $k => $v) {
- if ( !isset( $v['name'] ) ) $v['name'] = $this->ucwords( strtr( $k, '_', ' ' ) );
- if ( !isset( $v['type'] ) ) $v['type'] = 'checkbox';
- if ( !isset( $v['default'] ) ) $v['default'] = null;
- if ( !isset( $v['initial_options'] ) ) $v['initial_options'] = $v['default'];
- if ( $v['type'] == 'custom' && ( !isset( $v['nowrap'] ) ) ) $v['nowrap'] = true;
- elseif ( !isset( $v['nowrap'] ) ) $v['nowrap'] = null;
+ } else {
+ $options = array();
+ $prefix = "{$prefix}{$location}_";
+ if ( ! empty( $this->locations[ $location ]['default_options'] ) ) {
+ $options = $this->locations[ $location ]['default_options'];
+ }
+ foreach ( $this->locations[ $location ]['options'] as $opt ) {
+ if ( isset( $defaults[ $opt ] ) ) {
+ $options[ $opt ] = $defaults[ $opt ];
+ }
+ }
+ }
+ if ( ! $prefix ) {
+ $prefix = $this->prefix;
+ }
+ if ( ! empty( $options ) ) {
+ foreach ( $options as $k => $v ) {
+ if ( ! isset( $v['name'] ) ) {
+ $v['name'] = $this->ucwords( strtr( $k, '_', ' ' ) );
+ }
+ if ( ! isset( $v['type'] ) ) {
+ $v['type'] = 'checkbox';
+ }
+ if ( ! isset( $v['default'] ) ) {
+ $v['default'] = null;
+ }
+ if ( ! isset( $v['initial_options'] ) ) {
+ $v['initial_options'] = $v['default'];
+ }
+ if ( $v['type'] == 'custom' && ( ! isset( $v['nowrap'] ) ) ) {
+ $v['nowrap'] = true;
+ } elseif ( ! isset( $v['nowrap'] ) ) {
+ $v['nowrap'] = null;
+ }
if ( isset( $v['condshow'] ) ) {
- if ( !is_array( $this->script_data ) ) $this->script_data = Array();
- if ( !isset( $this->script_data['condshow'] ) ) $this->script_data['condshow'] = Array();
- $this->script_data['condshow'][$prefix . $k] = $v['condshow'];
+ if ( ! is_array( $this->script_data ) ) {
+ $this->script_data = array();
+ }
+ if ( ! isset( $this->script_data['condshow'] ) ) {
+ $this->script_data['condshow'] = array();
+ }
+ $this->script_data['condshow'][ $prefix . $k ] = $v['condshow'];
}
if ( $v['type'] == 'submit' ) {
- if ( !isset($v['save'] ) ) $v['save'] = false;
- if ( !isset($v['label'] ) ) $v['label'] = 'none';
- if ( !isset($v['prefix'] ) ) $v['prefix'] = false;
+ if ( ! isset( $v['save'] ) ) {
+ $v['save'] = false;
+ }
+ if ( ! isset( $v['label'] ) ) {
+ $v['label'] = 'none';
+ }
+ if ( ! isset( $v['prefix'] ) ) {
+ $v['prefix'] = false;
+ }
} else {
- if ( !isset($v['label'] ) ) $v['label'] = null;
+ if ( ! isset( $v['label'] ) ) {
+ $v['label'] = null;
+ }
}
if ( $v['type'] == 'hidden' ) {
- if ( !isset($v['label']) ) $v['label'] = 'none';
- if ( !isset($v['prefix']) ) $v['prefix'] = false;
+ if ( ! isset( $v['label'] ) ) {
+ $v['label'] = 'none';
+ }
+ if ( ! isset( $v['prefix'] ) ) {
+ $v['prefix'] = false;
+ }
+ }
+ if ( ( $v['type'] == 'text' ) && ( ! isset( $v['size'] ) ) ) {
+ $v['size'] = 57;
}
- if ( ( $v['type'] == 'text' ) && ( !isset( $v['size'] ) ) ) $v['size'] = 57;
if ( $v['type'] == 'textarea' ) {
- if ( !isset($v['cols'])) $v['cols'] = 57;
- if ( !isset($v['rows'])) $v['rows'] = 2;
+ if ( ! isset( $v['cols'] ) ) {
+ $v['cols'] = 57;
+ }
+ if ( ! isset( $v['rows'] ) ) {
+ $v['rows'] = 2;
+ }
+ }
+ if ( ! isset( $v['save'] ) ) {
+ $v['save'] = true;
+ }
+ if ( ! isset( $v['prefix'] ) ) {
+ $v['prefix'] = true;
+ }
+ if ( $v['prefix'] ) {
+ $opts[ $prefix . $k ] = $v;
+ } else {
+ $opts[ $k ] = $v;
}
- if ( !isset($v['save']) ) $v['save'] = true;
- if ( !isset($v['prefix']) ) $v['prefix'] = true;
- if ( $v['prefix'] )
- $opts[$prefix . $k] = $v;
- else
- $opts[$k] = $v;
}
+ }
+
return $opts;
}
/** Generates just the default option names and values */
function default_options( $location = null, $defaults = null ) {
$options = $this->setting_options( $location, $defaults );
- $opts = Array();
- foreach ( $options as $k => $v ) if ( $v['save'] ) $opts[$k] = $v['default'];
+ $opts = array();
+ foreach ( $options as $k => $v ) {
+ if ( $v['save'] ) {
+ $opts[ $k ] = $v['default'];
+ }
+ }
+
return $opts;
}
-
+
/** Gets the current options stored for a given location. */
- function get_current_options( $opts = Array(), $location = null, $defaults = null, $post = null ) {
- $prefix = $this->get_prefix( $location );
+ function get_current_options( $opts = array(), $location = null, $defaults = null, $post = null ) {
+ $prefix = $this->get_prefix( $location );
$get_opts = '';
- if ( empty( $location ) )
+ if ( empty( $location ) ) {
$type = 'settings';
- else
- $type = $this->locations[$location]['type'];
+ } else {
+ $type = $this->locations[ $location ]['type'];
+ }
if ( $type === 'settings' ) {
$get_opts = $this->get_class_option();
} elseif ( $type == 'metabox' ) {
if ( $post == null ) {
global $post;
}
-
+
if ( ( isset( $_GET['taxonomy'] ) && isset( $_GET['tag_ID'] ) ) || is_category() || is_tag() || is_tax() ) {
if ( AIOSEOPPRO ) {
$get_opts = AIO_ProGeneral::getprotax( $get_opts );
}
-
+
} elseif ( isset( $post ) ) {
$get_opts = get_post_meta( $post->ID, '_' . $prefix . $location, true );
}
}
$defs = $this->default_options( $location, $defaults );
- if ($get_opts == '')
+ if ( $get_opts == '' ) {
$get_opts = $defs;
- else
+ } else {
$get_opts = wp_parse_args( $get_opts, $defs );
+ }
$opts = wp_parse_args( $opts, $get_opts );
+
return $opts;
}
/** Updates the options array in the module; loads saved settings with get_option() or uses defaults */
- function update_options( $opts = Array(), $location = null, $defaults = null ) {
- if ($location === null )
+ function update_options( $opts = array(), $location = null, $defaults = null ) {
+ if ( $location === null ) {
$type = 'settings';
- else
- $type = $this->locations[$location][$type];
+ } else {
+ $type = $this->locations[ $location ][ $type ];
+ }
if ( $type === 'settings' ) {
$get_opts = $this->get_class_option();
}
- if ($get_opts === FALSE)
+ if ( $get_opts === false ) {
$get_opts = $this->default_options( $location, $defaults );
- else
- $this->setting_options( $location, $defaults ); // hack -- make sure this runs anyhow, for now -- pdb
+ } else {
+ $this->setting_options( $location, $defaults );
+ } // hack -- make sure this runs anyhow, for now -- pdb
$this->options = wp_parse_args( $opts, $get_opts );
}
}
diff --git a/wp-content/plugins/all-in-one-seo-pack/admin/aioseop_module_manager.php b/wp-content/plugins/all-in-one-seo-pack/admin/aioseop_module_manager.php
index 859c7a0696..3f3c50dbee 100644
--- a/wp-content/plugins/all-in-one-seo-pack/admin/aioseop_module_manager.php
+++ b/wp-content/plugins/all-in-one-seo-pack/admin/aioseop_module_manager.php
@@ -1,124 +1,208 @@
modules['feature_manager'] = null;
- foreach ( $mod as $m ) $this->modules[$m] = null;
- $reset = false;
- $reset_all = ( isset( $_POST['Submit_All_Default'] ) && $_POST['Submit_All_Default']!='' );
- $reset = ( ( isset( $_POST['Submit_Default'] ) && $_POST['Submit_Default']!='' ) || $reset_all );
- $update = ( isset($_POST['action']) && $_POST['action']
- && ( ( isset( $_POST['Submit'] ) && $_POST['Submit']!='' ) || $reset )
- );
+ foreach ( $mod as $m ) {
+ $this->modules[ $m ] = null;
+ }
+ $reset = false;
+ $reset_all = ( isset( $_POST['Submit_All_Default'] ) && '' !== $_POST['Submit_All_Default'] );
+ $reset = ( ( isset( $_POST['Submit_Default'] ) && '' !== $_POST['Submit_Default'] ) || $reset_all );
+ $update = ( isset( $_POST['action'] ) && $_POST['action']
+ && ( ( isset( $_POST['Submit'] ) && '' !== $_POST['Submit'] ) || $reset )
+ );
if ( $update ) {
- if ( $reset ) $this->settings_reset = true;
- if ( $reset_all ) $this->settings_reset_all = true;
- if ( $_POST['action'] == 'aiosp_update' ) $this->settings_update = true;
- if ( $_POST['action'] == 'aiosp_update_module' ) $this->module_settings_update = true;
+ if ( $reset ) {
+ $this->settings_reset = true;
+ }
+ if ( $reset_all ) {
+ $this->settings_reset_all = true;
+ }
+ if ( 'aiosp_update' === $_POST['action'] ) {
+ $this->settings_update = true;
+ }
+ if ( 'aiosp_update_module' === $_POST['action'] ) {
+ $this->module_settings_update = true;
+ }
}
$this->do_load_module( 'feature_manager', $mod );
}
+ /**
+ * Return module.
+ *
+ * @param $class
+ *
+ * @return $this|bool|mixed
+ */
function return_module( $class ) {
global $aiosp;
- if ( $class == get_class( $aiosp ) ) return $aiosp;
- if ( $class == get_class( $this ) ) return $this;
- foreach( $this->modules as $m )
- if ( is_object( $m ) && ( $class == get_class( $m ) ) )
+ if ( get_class( $aiosp ) === $class ) {
+ return $aiosp;
+ }
+ if ( get_class( $aiosp ) === $class ) {
+ return $this;
+ }
+ foreach ( $this->modules as $m ) {
+ if ( is_object( $m ) && ( get_class( $m ) === $class ) ) {
return $m;
+ }
+ }
+
return false;
}
-
+
+ /**
+ * @return array
+ */
function get_loaded_module_list() {
- $module_list = Array();
- if ( !empty( $this->modules ) ) {
- foreach( $this->modules as $k => $v )
- if ( !empty( $v ) )
- $module_list[$k] = get_class( $v );
+ $module_list = array();
+ if ( ! empty( $this->modules ) ) {
+ foreach ( $this->modules as $k => $v ) {
+ if ( ! empty( $v ) ) {
+ $module_list[ $k ] = get_class( $v );
+ }
+ }
}
+
return $module_list;
}
- // Module name is used for these automatic settings:
- // The aiosp_enable_$module settings - whether each plugin is active or not
- // The name of the .php file containing the module - aioseop_$module.php
- // The name of the class - All_in_One_SEO_Pack_$Module
- // The global $aioseop_$module
- // $this->modules[$module]
+ /**
+ * @param $mod Module.
+ * @param null $args
+ *
+ * @return bool
+ */
function do_load_module( $mod, $args = null ) {
+ // Module name is used for these automatic settings:
+ // The aiosp_enable_$module settings - whether each plugin is active or not.
+ // The name of the .php file containing the module - aioseop_$module.php.
+ // The name of the class - All_in_One_SEO_Pack_$Module.
+ // The global $aioseop_$module.
+ // $this->modules[$module].
+
$mod_path = apply_filters( "aioseop_include_$mod", AIOSEOP_PLUGIN_DIR . "modules/aioseop_$mod.php" );
- if ( !empty( $mod_path ) )
+ if ( ! empty( $mod_path ) ) {
require_once( $mod_path );
- $ref = "aioseop_$mod";
- $classname = "All_in_One_SEO_Pack_" . strtr( ucwords( strtr( $mod, '_', ' ' ) ), ' ', '_' );
- $classname = apply_filters( "aioseop_class_$mod", $classname );
- $module_class = new $classname( $args );
- $GLOBALS[$ref] = $module_class;
- $this->modules[$mod] = $module_class;
- if ( is_user_logged_in() && function_exists( 'is_admin_bar_showing' ) && is_admin_bar_showing() && current_user_can( 'aiosp_manage_seo' ) )
- add_action( 'admin_bar_menu', array( $module_class, 'add_admin_bar_submenu' ), 1001 + $module_class->menu_order() );
+ }
+ $ref = "aioseop_$mod";
+ $classname = 'All_in_One_SEO_Pack_' . strtr( ucwords( strtr( $mod, '_', ' ' ) ), ' ', '_' );
+ $classname = apply_filters( "aioseop_class_$mod", $classname );
+ $module_class = new $classname( $args );
+ $GLOBALS[ $ref ] = $module_class;
+ $this->modules[ $mod ] = $module_class;
+ if ( is_user_logged_in() && function_exists( 'is_admin_bar_showing' ) && is_admin_bar_showing() && current_user_can( 'aiosp_manage_seo' ) ) {
+ add_action( 'admin_bar_menu', array(
+ $module_class,
+ 'add_admin_bar_submenu',
+ ), 1001 + $module_class->menu_order() );
+ }
if ( is_admin() ) {
- add_action( 'aioseop_modules_add_menus', Array( $module_class, 'add_menu' ), $module_class->menu_order() );
- add_action( 'aiosoep_options_reset', Array( $module_class, 'reset_options' ) );
- add_filter( 'aioseop_export_settings', Array( $module_class, 'settings_export' ) );
+ add_action( 'aioseop_modules_add_menus', array(
+ $module_class,
+ 'add_menu',
+ ), $module_class->menu_order() );
+ add_action( 'aiosoep_options_reset', array( $module_class, 'reset_options' ) );
+ add_filter( 'aioseop_export_settings', array( $module_class, 'settings_export' ) );
}
+
return true;
}
+ /**
+ * @param $mod
+ *
+ * @return bool
+ */
function load_module( $mod ) {
static $feature_options = null;
static $feature_prefix = null;
- if ( !is_array( $this->modules ) ) return false;
+ if ( ! is_array( $this->modules ) ) {
+ return false;
+ }
$v = $this->modules[ $mod ];
- if ( $v !== null ) return false; // already loaded
- if ( $mod == 'performance' && !is_super_admin() ) return false;
- if ( ( $mod == 'file_editor' || $mod == 'robots' )
- && ( ( ( defined( 'DISALLOW_FILE_EDIT' ) && DISALLOW_FILE_EDIT )
- || ( defined( 'DISALLOW_FILE_MODS' ) && DISALLOW_FILE_MODS )
- || !is_super_admin() ) ) )
+ if ( null !== $v ) {
+ return false;
+ } // Already loaded.
+ if ( 'performance' === $mod && ! is_super_admin() ) {
+ return false;
+ }
+ if ( ( 'file_editor' === $mod || 'robots' === $mod )
+ && ( ( defined( 'DISALLOW_FILE_EDIT' ) && DISALLOW_FILE_EDIT )
+ || ( defined( 'DISALLOW_FILE_MODS' ) && DISALLOW_FILE_MODS )
+ || ! is_super_admin() )
+ ) {
return false;
+ }
$mod_enable = false;
- $fm_page = ( $this->module_settings_update && wp_verify_nonce( $_POST['nonce-aioseop'], 'aioseop-nonce' ) &&
- isset($_REQUEST['page']) && $_REQUEST['page'] == trailingslashit( AIOSEOP_PLUGIN_DIRNAME ) . 'modules/aioseop_feature_manager.php' );
- if ( $fm_page && !$this->settings_reset ) {
- if ( isset( $_POST["aiosp_feature_manager_enable_$mod"] ) )
- $mod_enable = $_POST["aiosp_feature_manager_enable_$mod"];
- else
- $mod_enable = false;
+ $fm_page = ( $this->module_settings_update && wp_verify_nonce( $_POST['nonce-aioseop'], 'aioseop-nonce' ) &&
+ isset( $_REQUEST['page'] ) && trailingslashit( AIOSEOP_PLUGIN_DIRNAME ) . 'modules/aioseop_feature_manager.php' === $_REQUEST['page'] );
+ if ( $fm_page && ! $this->settings_reset ) {
+ if ( isset( $_POST["aiosp_feature_manager_enable_$mod"] ) ) {
+ $mod_enable = $_POST["aiosp_feature_manager_enable_$mod"];
+ } else {
+ $mod_enable = false;
+ }
} else {
- if ( $feature_prefix == null )
+ if ( null === $feature_prefix ) {
$feature_prefix = $this->modules['feature_manager']->get_prefix();
- if ( $fm_page && $this->settings_reset )
+ }
+ if ( $fm_page && $this->settings_reset ) {
$feature_options = $this->modules['feature_manager']->default_options();
- if ( $feature_options == null ) {
- if ( $this->module_settings_update && wp_verify_nonce( $_POST['nonce-aioseop'], 'aioseop-nonce' ) && $this->settings_reset_all )
+ }
+ if ( null === $feature_options ) {
+ if ( $this->module_settings_update && $this->settings_reset_all && wp_verify_nonce( $_POST['nonce-aioseop'], 'aioseop-nonce' ) ) {
$feature_options = $this->modules['feature_manager']->default_options();
- else
+ } else {
$feature_options = $this->modules['feature_manager']->get_current_options();
+ }
}
- if ( isset( $feature_options["{$feature_prefix}enable_$mod"] ) )
+ if ( isset( $feature_options["{$feature_prefix}enable_$mod"] ) ) {
$mod_enable = $feature_options["{$feature_prefix}enable_$mod"];
+ }
}
- if ( $mod_enable ) return $this->do_load_module( $mod );
+ if ( $mod_enable ) {
+ return $this->do_load_module( $mod );
+ }
+
return false;
}
function load_modules() {
- if ( is_array( $this->modules ) )
- foreach( $this->modules as $k => $v )
+ if ( is_array( $this->modules ) ) {
+ foreach ( $this->modules as $k => $v ) {
$this->load_module( $k );
+ }
+ }
}
}
}
diff --git a/wp-content/plugins/all-in-one-seo-pack/admin/display/general-metaboxes.php b/wp-content/plugins/all-in-one-seo-pack/admin/display/general-metaboxes.php
index 7a58775d78..7dc830cf4c 100644
--- a/wp-content/plugins/all-in-one-seo-pack/admin/display/general-metaboxes.php
+++ b/wp-content/plugins/all-in-one-seo-pack/admin/display/general-metaboxes.php
@@ -3,117 +3,166 @@
/**
* @package All-in-One-SEO-Pack
*/
-
class aiosp_metaboxes {
-
+
+ /**
+ * aiosp_metaboxes constructor.
+ */
function __construct() {
//construct
}
-
-
-
-
-
-
+
+ /**
+ * @param $add
+ * @param $meta
+ */
static function display_extra_metaboxes( $add, $meta ) {
echo "
-
+
-
-
-
-
-
-
+ case 'aioseop-support':
+ ?>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
- ";
+ echo '
';
}
-
-
-
-
-
-
-
-
-
-}
\ No newline at end of file
+
+
+}
diff --git a/wp-content/plugins/all-in-one-seo-pack/admin/display/index.php b/wp-content/plugins/all-in-one-seo-pack/admin/display/index.php
index e71af0ef21..3c379e1835 100644
--- a/wp-content/plugins/all-in-one-seo-pack/admin/display/index.php
+++ b/wp-content/plugins/all-in-one-seo-pack/admin/display/index.php
@@ -1 +1,4 @@
- wp_create_nonce( 'wpseo-import' ) ), admin_url( 'admin.php?page=wpseo_tools&tool=import-export&import=1&importaioseo=1#top#import-seo' ) );
+ $aiourl = add_query_arg( array( '_wpnonce' => wp_create_nonce( 'aiosp-import' ) ), admin_url( 'tools.php?page=aiosp_import' ) );
-
- $yoasturl = add_query_arg( array( '_wpnonce' => wp_create_nonce( 'wpseo-import' ) ), admin_url( 'admin.php?page=wpseo_tools&tool=import-export&import=1&importaioseo=1#top#import-seo' ) );
- $aiourl = add_query_arg( array( '_wpnonce' => wp_create_nonce( 'aiosp-import' ) ), admin_url( 'tools.php?page=aiosp_import' ) );
+ $aioseop_yst_detected_notice_dismissed = get_user_meta( get_current_user_id(), 'aioseop_yst_detected_notice_dismissed', true );
+ if ( empty( $aioseop_yst_detected_notice_dismissed ) ) {
- $aioseop_yst_detected_notice_dismissed = get_user_meta( get_current_user_id(), 'aioseop_yst_detected_notice_dismissed', true );
+ echo '', sprintf( esc_html__( 'The plugin Yoast SEO has been detected. Do you want to %simport its settings%s into All in One SEO Pack?', 'all-in-one-seo-pack' ), sprintf( '', esc_url( $aiourl ) ), ' ' ), '
';
- if ( empty( $aioseop_yst_detected_notice_dismissed ) ) {
+ }
- echo '', sprintf( esc_html__( 'The plugin Yoast SEO has been detected. Do you want to %simport its settings%s into All in One SEO Pack?', 'all-in-one-seo-pack' ), sprintf( '', esc_url( $aiourl ) ), ' ' ), '
';
+ echo '', sprintf( esc_html__( 'The plugin All-In-One-SEO has been detected. Do you want to %simport its settings%s?', 'wordpress-seo' ), sprintf( '', esc_url( $yoasturl ) ), ' ' ), '
';
}
-
-
- echo '', sprintf( esc_html__( 'The plugin All-In-One-SEO has been detected. Do you want to %simport its settings%s?', 'wordpress-seo' ), sprintf( '', esc_url( $yoasturl ) ), ' ' ), '
';
-
-
-
- }
- public function show_deactivate_notice() {
- echo '', esc_html__( 'All in One SEO has been deactivated', 'all-in-one-seo-pack' ), '
';
+ public function show_deactivate_notice() {
+ echo '', esc_html__( 'All in One SEO has been deactivated', 'all-in-one-seo-pack' ), '
';
+ }
}
+} else {
+ add_action( 'init', 'mi_aioseop_yst_detected_notice_dismissed' );
}
-}else{
+
+/**
+ * Deletes the stored dismissal of the notice.
+ *
+ * This should only happen after reactivating after being deactivated.
+ */
+function mi_aioseop_yst_detected_notice_dismissed() {
delete_user_meta( get_current_user_id(), 'aioseop_yst_detected_notice_dismissed' );
}
/**
- * Register the admin menu page
+ * Init for settings import class.
+ *
+ * At the moment we just register the admin menu page.
*/
-add_action('admin_menu', 'aiosp_seometa_settings_init');
function aiosp_seometa_settings_init() {
global $_aiosp_seometa_admin_pagehook;
-
- // Add submenu page link
- $_aiosp_seometa_admin_pagehook = add_submenu_page('tools.php', __('Import SEO Data','all-in-one-seo-pack'), __('SEO Data Import','all-in-one-seo-pack'), 'manage_options', 'aiosp_import', 'aiosp_seometa_admin');
+
+ // TODO Put this in with the rest of the import/export stuff.
+ $_aiosp_seometa_admin_pagehook = add_submenu_page( 'tools.php', __( 'Import SEO Data', 'all-in-one-seo-pack' ), __( 'SEO Data Import', 'all-in-one-seo-pack' ), 'manage_options', 'aiosp_import', 'aiosp_seometa_admin' );
}
+add_action( 'admin_menu', 'aiosp_seometa_settings_init' );
+
/**
- * This function intercepts POST data from the form submission, and uses that
- * data to convert values in the postmeta table from one platform to another.
+ * Intercept POST data from the form submission.
+ *
+ * Use the intercepted data to convert values in the postmeta table from one platform to another.
*/
function aiosp_seometa_action() {
-
- //print_r($_REQUEST);
-
- if ( empty( $_REQUEST['_wpnonce'] ) )
+
+ if ( empty( $_REQUEST['_wpnonce'] ) ) {
return;
-
+ }
+
if ( empty( $_REQUEST['platform_old'] ) ) {
- printf( '', __('Sorry, you can\'t do that. Please choose a platform and then click Analyze or Convert.') );
+ printf( '', __( 'Sorry, you can\'t do that. Please choose a platform and then click Analyze or Convert.' ) );
+
return;
}
-
- if ( $_REQUEST['platform_old'] == 'All in One SEO Pack' ) {
- printf( '', __('Sorry, you can\'t do that. Please choose a platform and then click Analyze or Convert.') );
+
+ if ( 'All in One SEO Pack' === $_REQUEST['platform_old'] ) {
+ printf( '', __( 'Sorry, you can\'t do that. Please choose a platform and then click Analyze or Convert.' ) );
+
return;
}
-
- check_admin_referer('aiosp_nonce'); // Verify nonce
-
- if ( !empty( $_REQUEST['analyze'] ) ) {
-
- printf( '%s ', __('Analysis Results', 'all-in-one-seo-pack') );
-
+
+ check_admin_referer( 'aiosp_nonce' ); // Verify nonce. TODO We should make this better.
+
+ if ( ! empty( $_REQUEST['analyze'] ) ) {
+
+ printf( '%s ', __( 'Analysis Results', 'all-in-one-seo-pack' ) );
+
$response = aiosp_seometa_post_meta_analyze( $_REQUEST['platform_old'], 'All in One SEO Pack' );
if ( is_wp_error( $response ) ) {
- printf( '', __('Sorry, something went wrong. Please try again') );
+ printf( '', __( 'Sorry, something went wrong. Please try again' ) );
+
return;
}
-
- printf( __('Analyzing records in a %s to %s conversion…', 'all-in-one-seo-pack'), esc_html( $_POST['platform_old'] ), 'All in One SEO Pack' );
+
+ printf( __( '
Analyzing records in a %s to %s conversion…', 'all-in-one-seo-pack' ), esc_html( $_POST['platform_old'] ), 'All in One SEO Pack' );
printf( '
%d Compatible Records were identified
', $response->update );
-// printf( '%d Compatible Records will be ignored
', $response->ignore );
-
- printf( '%s
', __('Compatible data:', 'all-in-one-seo-pack') );
+ // printf( '%d Compatible Records will be ignored
', $response->ignore );
+
+ printf( '%s
', __( 'Compatible data:', 'all-in-one-seo-pack' ) );
echo '';
- foreach ( (array)$response->elements as $element ) {
+ foreach ( (array) $response->elements as $element ) {
printf( '%s ', $element );
}
echo ' ';
-
+
return;
}
-
- printf( '%s ', __('Conversion Results', 'all-in-one-seo-pack') );
-
- $result = aiosp_seometa_post_meta_convert( stripslashes($_REQUEST['platform_old']), 'All in One SEO Pack' );
+
+ printf( '%s ', __( 'Conversion Results', 'all-in-one-seo-pack' ) );
+
+ $result = aiosp_seometa_post_meta_convert( stripslashes( $_REQUEST['platform_old'] ), 'All in One SEO Pack' );
if ( is_wp_error( $result ) ) {
- printf( '%s
', __('Sorry, something went wrong. Please try again') );
+ printf( '%s
', __( 'Sorry, something went wrong. Please try again' ) );
+
return;
}
-
+
printf( '%d Records were updated
', isset( $result->updated ) ? $result->updated : 0 );
printf( '%d Records were ignored
', isset( $result->ignored ) ? $result->ignored : 0 );
-
- return;
-
+
}
/**
@@ -122,457 +138,472 @@ function aiosp_seometa_action() {
*/
function aiosp_seometa_admin() {
global $_aiosp_seometa_themes, $_aiosp_seometa_plugins, $_aiosp_seometa_platforms;
-?>
+ ?>
-
-
-
-
-
-
-
-
-
-
-
-
-
', esc_url( 'http://semperfiwebdesign.com/backupbuddy/' ) ), '' ); ?>
-
-
-
-
-
-
-
-
+
-
+
+
+
+
+
-//////////////////FUNCTIONS//////////////////
+
+
- /**
- * This function converts $old meta_key entries in the postmeta table into $new entries.
- *
- * It first checks to see what records for the $new meta_key already exist,
- * storing the corresponding post_id values in an array. When the conversion
- * happens, rows that contain a post_id in that array will be ignored, to
- * avoid duplicate $new meta_key entries.
- *
- * The $old entries will be left as-is if $delete_old is left false. If set
- * to true, the $old entries will be deleted, rather than retained.
- *
- * The function returns an object for error detection, and the number of affected rows.
- */
- function aiosp_seometa_meta_key_convert( $old = '', $new = '', $delete_old = false ) {
+ ', esc_url( 'http://semperfiwebdesign.com/backupbuddy/' ) ), '' ); ?>
+
- do_action( 'pre_aiosp_seometa_meta_key_convert_before', $old, $new, $delete_old );
- global $wpdb;
+
- }
+
- do_action( 'aiosp_seometa_meta_key_convert', $output, $old, $new, $delete_old );
+
- return $output;
+ WP_Error = 1;
- if ( empty( $_aiosp_seometa_platforms[$old_platform] ) || empty( $_aiosp_seometa_platforms[$new_platform] ) ) {
- $output->WP_Error = 1;
- return $output;
- }
+ return $output;
+ }
+
+ // See which records we need to ignore, if any.
+ $exclude = $wpdb->get_results( $wpdb->prepare( "SELECT post_id FROM $wpdb->postmeta WHERE meta_key = %s", $new ) );
- $output->updated = 0;
- $output->deleted = 0;
+ // If no records to ignore, we'll do a basic UPDATE and DELETE.
+ if ( ! $exclude ) {
+
+ $output->updated = $wpdb->update( $wpdb->postmeta, array( 'meta_key' => $new ), array( 'meta_key' => $old ) );
+ $output->deleted = $delete_old ? $wpdb->query( $wpdb->prepare( "DELETE FROM $wpdb->postmeta WHERE meta_key = %s", $old ) ) : 0;
$output->ignored = 0;
- foreach ( (array)$_aiosp_seometa_platforms[$old_platform] as $label => $meta_key ) {
+ } // Else, do a more complex UPDATE and DELETE.
+ else {
- // skip iterations where no $new analog exists
- if ( empty( $_aiosp_seometa_platforms[$new_platform][$label] ) )
- continue;
+ foreach ( (array) $exclude as $key => $value ) {
+ $not_in[] = $value->post_id;
+ }
+ $not_in = implode( ', ', (array) $not_in );
- // set $old and $new meta_key values
- $old = $_aiosp_seometa_platforms[$old_platform][$label];
- $new = $_aiosp_seometa_platforms[$new_platform][$label];
+ $output->updated = $wpdb->query( $wpdb->prepare( "UPDATE $wpdb->postmeta SET meta_key = %s WHERE meta_key = %s AND post_id NOT IN ($not_in)", $new, $old ) );
+ $output->deleted = $delete_old ? $wpdb->query( $wpdb->prepare( "DELETE FROM $wpdb->postmeta WHERE meta_key = %s", $old ) ) : 0;
+ $output->ignored = count( $exclude );
- // convert
- $result = aiosp_seometa_meta_key_convert( $old, $new, $delete_old );
+ }
- // error check
- if ( is_wp_error( $result ) )
- continue;
+ do_action( 'aiosp_seometa_meta_key_convert', $output, $old, $new, $delete_old );
- // update total updated/ignored count
- $output->updated = $output->updated + (int)$result->updated;
- $output->ignored = $output->ignored + (int)$result->ignored;
+ return $output;
- }
+}
- do_action( 'aiosp_seometa_post_meta_convert', $output, $old_platform, $new_platform, $delete_old );
+/**
+ * Convert old to new postmeta.
+ *
+ * Cycle through all compatible SEO entries of two platforms and aiosp_seometa_meta_key_convert conversion for each key.
+ *
+ * @param string $old_platform
+ * @param string $new_platform
+ * @param bool $delete_old
+ *
+ * @return stdClass Results object.
+ */
+function aiosp_seometa_post_meta_convert( $old_platform = '', $new_platform = 'All in One SEO Pack', $delete_old = false ) {
- return $output;
+ do_action( 'pre_aiosp_seometa_post_meta_convert', $old_platform, $new_platform, $delete_old );
- }
+ global $_aiosp_seometa_platforms;
- /**
- * This function analyzes two platforms to see what Compatible elements they share,
- * what data can be converted from one to the other, and which elements to ignore (future).
- */
- function aiosp_seometa_post_meta_analyze( $old_platform = '', $new_platform = 'All in One SEO Pack' ) {
+ $output = new stdClass;
+
+ if ( empty( $_aiosp_seometa_platforms[ $old_platform ] ) || empty( $_aiosp_seometa_platforms[ $new_platform ] ) ) {
+ $output->WP_Error = 1;
- do_action( 'pre_aiosp_seometa_post_meta_analyze', $old_platform, $new_platform );
+ return $output;
+ }
- global $wpdb, $_aiosp_seometa_platforms;
+ $output->updated = 0;
+ $output->deleted = 0;
+ $output->ignored = 0;
- $output = new stdClass;
+ foreach ( (array) $_aiosp_seometa_platforms[ $old_platform ] as $label => $meta_key ) {
- if ( empty( $_aiosp_seometa_platforms[$old_platform] ) || empty( $_aiosp_seometa_platforms[$new_platform] ) ) {
- $output->WP_Error = 1;
- return $output;
+ // Skip iterations where no $new analog exists.
+ if ( empty( $_aiosp_seometa_platforms[ $new_platform ][ $label ] ) ) {
+ continue;
}
- $output->update = 0;
- $output->ignore = 0;
- $output->elements = '';
+ // Set $old and $new meta_key values.
+ $old = $_aiosp_seometa_platforms[ $old_platform ][ $label ];
+ $new = $_aiosp_seometa_platforms[ $new_platform ][ $label ];
- foreach ( (array)$_aiosp_seometa_platforms[$old_platform] as $label => $meta_key ) {
+ // Convert.
+ $result = aiosp_seometa_meta_key_convert( $old, $new, $delete_old );
- // skip iterations where no $new analog exists
- if ( empty( $_aiosp_seometa_platforms[$new_platform][$label] ) )
- continue;
+ // Error check.
+ if ( is_wp_error( $result ) ) {
+ continue;
+ }
- $elements[] = $label;
+ // Update total updated/ignored count.
+ $output->updated += (int) $result->updated;
+ $output->ignored += (int) $result->ignored;
- // see which records to ignore, if any
- $ignore = 0;
- // $ignore = $wpdb->get_results( $wpdb->prepare( "SELECT post_id FROM $wpdb->postmeta WHERE meta_key = %s", $meta_key ) );
+ }
- // see which records to update, if any
- $update = $wpdb->get_results( $wpdb->prepare( "SELECT post_id FROM $wpdb->postmeta WHERE meta_key = %s", $meta_key ) );
+ do_action( 'aiosp_seometa_post_meta_convert', $output, $old_platform, $new_platform, $delete_old );
- // count items in returned arrays
- // $ignore = count( (array)$ignore );
- $update = count( (array)$update );
+ return $output;
- // calculate update/ignore by comparison
- // $update = ( (int)$update > (int)$ignore ) ? ( (int)$update - (int)$ignore ) : 0;
+}
- // update output numbers
- $output->update = $output->update + (int)$update;
- $output->ignore = $output->ignore + (int)$ignore;
+/**
+ * Analyze two platforms to find shared and compatible elements.
+ *
+ * See what data can be converted from one to the other.
+ *
+ * @param string $old_platform
+ * @param string $new_platform
+ *
+ * @return stdClass
+ */
+function aiosp_seometa_post_meta_analyze( $old_platform = '', $new_platform = 'All in One SEO Pack' ) {
+ // TODO Figure out which elements to ignore.
+ do_action( 'pre_aiosp_seometa_post_meta_analyze', $old_platform, $new_platform );
- } // endforeach
+ global $wpdb, $_aiosp_seometa_platforms;
- $output->elements = $elements;
+ $output = new stdClass;
- do_action( 'aiosp_seometa_post_meta_analyze', $output, $old_platform, $new_platform );
+ if ( empty( $_aiosp_seometa_platforms[ $old_platform ] ) || empty( $_aiosp_seometa_platforms[ $new_platform ] ) ) {
+ $output->WP_Error = 1;
return $output;
-
}
-
-
-
-////////////PLUGIN/////////
+ $output->update = 0;
+ $output->ignore = 0;
+ $output->elements = '';
-// define('aiosp_seometa_PLUGIN_DIR', dirname(__FILE__));
+ foreach ( (array) $_aiosp_seometa_platforms[ $old_platform ] as $label => $meta_key ) {
- //add_action( 'plugins_loaded', 'aiosp_seometa_import' );
- /**
- * Initialize the SEO Data Transporter plugin
- */
- function aiosp_seometa_import() {
+ // Skip iterations where no $new analog exists.
+ if ( empty( $_aiosp_seometa_platforms[ $new_platform ][ $label ] ) ) {
+ continue;
+ }
- global $_aiosp_seometa_themes, $_aiosp_seometa_plugins, $_aiosp_seometa_platforms;
+ $elements[] = $label;
- /**
- * The associative array of supported themes.
- */
- $_aiosp_seometa_themes = array(
- // alphabatized
- 'Builder' => array(
- 'Custom Doctitle' => '_builder_seo_title',
- 'META Description' => '_builder_seo_description',
- 'META Keywords' => '_builder_seo_keywords',
- ),
- 'Catalyst' => array(
- 'Custom Doctitle' => '_catalyst_title',
- 'META Description' => '_catalyst_description',
- 'META Keywords' => '_catalyst_keywords',
- 'noindex' => '_catalyst_noindex',
- 'nofollow' => '_catalyst_nofollow',
- 'noarchive' => '_catalyst_noarchive',
- ),
- 'Frugal' => array(
- 'Custom Doctitle' => '_title',
- 'META Description' => '_description',
- 'META Keywords' => '_keywords',
- 'noindex' => '_noindex',
- 'nofollow' => '_nofollow',
- ),
- 'Genesis' => array(
- 'Custom Doctitle' => '_genesis_title',
- 'META Description' => '_genesis_description',
- 'META Keywords' => '_genesis_keywords',
- 'noindex' => '_genesis_noindex',
- 'nofollow' => '_genesis_nofollow',
- 'noarchive' => '_genesis_noarchive',
- 'Canonical URI' => '_genesis_canonical_uri',
- 'Custom Scripts' => '_genesis_scripts',
- 'Redirect URI' => 'redirect',
- ),
- 'Headway' => array(
- 'Custom Doctitle' => '_title',
- 'META Description' => '_description',
- 'META Keywords' => '_keywords',
- ),
- 'Hybrid' => array(
- 'Custom Doctitle' => 'Title',
- 'META Description' => 'Description',
- 'META Keywords' => 'Keywords',
- ),
- 'Thesis 1.x' => array(
- 'Custom Doctitle' => 'thesis_title',
- 'META Description' => 'thesis_description',
- 'META Keywords' => 'thesis_keywords',
- 'Custom Scripts' => 'thesis_javascript_scripts',
- 'Redirect URI' => 'thesis_redirect',
- ),
- /*
- 'Thesis 2.x' => array(
- 'Custom Doctitle' => '_thesis_title_tag',
- 'META Description' => '_thesis_meta_description',
- 'META Keywords' => '_thesis_meta_keywords',
- 'Custom Scripts' => '_thesis_javascript_scripts',
- 'Canonical URI' => '_thesis_canonical_link',
- 'Redirect URI' => '_thesis_redirect',
- ),
- */
- 'WooFramework' => array(
- 'Custom Doctitle' => 'seo_title',
- 'META Description' => 'seo_description',
- 'META Keywords' => 'seo_keywords',
- )
- );
+ // See which records to ignore, if any.
+ $ignore = 0;
+ // $ignore = $wpdb->get_results( $wpdb->prepare( "SELECT post_id FROM $wpdb->postmeta WHERE meta_key = %s", $meta_key ) );
- /**
- * The associative array of supported plugins.
- */
- $_aiosp_seometa_plugins = array(
- // alphabatized
- 'Add Meta Tags' => array(
- 'META Description' => 'description',
- 'META Keywords' => 'keywords',
- ),
- 'All in One SEO Pack' => array(
- 'Custom Doctitle' => '_aioseop_title',
- 'META Description' => '_aioseop_description',
- 'META Keywords' => '_aioseop_keywords',
- ),
- 'Greg\'s High Performance SEO' => array(
- 'Custom Doctitle' => '_ghpseo_secondary_title',
- 'META Description' => '_ghpseo_alternative_description',
- 'META Keywords' => '_ghpseo_keywords',
- ),
- 'Headspace2' => array(
- 'Custom Doctitle' => '_headspace_page_title',
- 'META Description' => '_headspace_description',
- 'META Keywords' => '_headspace_keywords',
- 'Custom Scripts' => '_headspace_scripts',
- ),
- 'Infinite SEO' => array(
- 'Custom Doctitle' => '_wds_title',
- 'META Description' => '_wds_metadesc',
- 'META Keywords' => '_wds_keywords',
- 'noindex' => '_wds_meta-robots-noindex',
- 'nofollow' => '_wds_meta-robots-nofollow',
- 'Canonical URI' => '_wds_canonical',
- 'Redirect URI' => '_wds_redirect',
- ),
- 'Meta SEO Pack' => array(
- 'META Description' => '_msp_description',
- 'META Keywords' => '_msp_keywords',
- ),
- 'Platinum SEO' => array(
- 'Custom Doctitle' => 'title',
- 'META Description' => 'description',
- 'META Keywords' => 'keywords',
- ),
- 'SEO Title Tag' => array(
- 'Custom Doctitle' => 'title_tag',
- 'META Description' => 'meta_description',
- ),
- 'SEO Ultimate' => array(
- 'Custom Doctitle' => '_su_title',
- 'META Description' => '_su_description',
- 'META Keywords' => '_su_keywords',
- 'noindex' => '_su_meta_robots_noindex',
- 'nofollow' => '_su_meta_robots_nofollow',
- ),
- 'Yoast SEO' => array(
- 'Custom Doctitle' => '_yoast_wpseo_title',
- 'META Description' => '_yoast_wpseo_metadesc',
- 'META Keywords' => '_yoast_wpseo_metakeywords',
- 'noindex' => '_yoast_wpseo_meta-robots-noindex',
- 'nofollow' => '_yoast_wpseo_meta-robots-nofollow',
- 'Canonical URI' => '_yoast_wpseo_canonical',
- 'Redirect URI' => '_yoast_wpseo_redirect',
- )
- );
+ // See which records to update, if any.
+ $update = $wpdb->get_results( $wpdb->prepare( "SELECT post_id FROM $wpdb->postmeta WHERE meta_key = %s", $meta_key ) );
- /**
- * The combined array of supported platforms.
- */
- $_aiosp_seometa_platforms = array_merge( $_aiosp_seometa_themes, $_aiosp_seometa_plugins );
+ // Count items in returned arrays.
+ // $ignore = count( (array)$ignore );
+ $update = count( (array) $update );
- /**
- * Include the other elements of the plugin.
- */
- // require_once( aiosp_seometa_PLUGIN_DIR . '/admin.php' );
-// require_once( aiosp_seometa_PLUGIN_DIR . '/functions.php' );
+ // Calculate update/ignore by comparison.
+ // $update = ( (int)$update > (int)$ignore ) ? ( (int)$update - (int)$ignore ) : 0;
- /**
- * Init hook.
- *
- * Hook fires after plugin functions are loaded.
- *
- * @since 0.9.10
- *
- */
- do_action( 'aiosp_seometa_import' );
+ // update output numbers
+ $output->update += (int) $update;
+ $output->ignore += (int) $ignore;
}
- /**
- * Activation Hook
- * @since 0.9.4
- */
- register_activation_hook( __FILE__, 'aiosp_seometa_activation_hook' );
- function aiosp_seometa_activation_hook() {
+ $output->elements = $elements;
- // require_once( aiosp_seometa_PLUGIN_DIR . '/functions.php' );
+ do_action( 'aiosp_seometa_post_meta_analyze', $output, $old_platform, $new_platform );
- aiosp_seometa_meta_key_convert( '_yoast_seo_title', 'yoast_wpseo_title', true );
- aiosp_seometa_meta_key_convert( '_yoast_seo_metadesc', 'yoast_wpseo_metadesc', true );
+ return $output;
- }
+}
+
+
+// define('aiosp_seometa_PLUGIN_DIR', dirname(__FILE__));
+
+//add_action( 'plugins_loaded', 'aiosp_seometa_import' );
+/**
+ * Initialize the SEO Data Transporter plugin
+ */
+function aiosp_seometa_import() {
+
+ global $_aiosp_seometa_themes, $_aiosp_seometa_plugins, $_aiosp_seometa_platforms;
/**
- * Manual conversion test
+ * The associative array of supported themes.
*/
- /*
- $aiosp_seometa_convert = aiosp_seometa_post_meta_convert( 'All in One SEO Pack', 'Genesis', false );
- printf( '%d records were updated', $aiosp_seometa_convert->updated );
- /**/
+ $_aiosp_seometa_themes = array(
+ // alphabatized
+ 'Builder' => array(
+ 'Custom Doctitle' => '_builder_seo_title',
+ 'META Description' => '_builder_seo_description',
+ 'META Keywords' => '_builder_seo_keywords',
+ ),
+ 'Catalyst' => array(
+ 'Custom Doctitle' => '_catalyst_title',
+ 'META Description' => '_catalyst_description',
+ 'META Keywords' => '_catalyst_keywords',
+ 'noindex' => '_catalyst_noindex',
+ 'nofollow' => '_catalyst_nofollow',
+ 'noarchive' => '_catalyst_noarchive',
+ ),
+ 'Frugal' => array(
+ 'Custom Doctitle' => '_title',
+ 'META Description' => '_description',
+ 'META Keywords' => '_keywords',
+ 'noindex' => '_noindex',
+ 'nofollow' => '_nofollow',
+ ),
+ 'Genesis' => array(
+ 'Custom Doctitle' => '_genesis_title',
+ 'META Description' => '_genesis_description',
+ 'META Keywords' => '_genesis_keywords',
+ 'noindex' => '_genesis_noindex',
+ 'nofollow' => '_genesis_nofollow',
+ 'noarchive' => '_genesis_noarchive',
+ 'Canonical URI' => '_genesis_canonical_uri',
+ 'Custom Scripts' => '_genesis_scripts',
+ 'Redirect URI' => 'redirect',
+ ),
+ 'Headway' => array(
+ 'Custom Doctitle' => '_title',
+ 'META Description' => '_description',
+ 'META Keywords' => '_keywords',
+ ),
+ 'Hybrid' => array(
+ 'Custom Doctitle' => 'Title',
+ 'META Description' => 'Description',
+ 'META Keywords' => 'Keywords',
+ ),
+ 'Thesis 1.x' => array(
+ 'Custom Doctitle' => 'thesis_title',
+ 'META Description' => 'thesis_description',
+ 'META Keywords' => 'thesis_keywords',
+ 'Custom Scripts' => 'thesis_javascript_scripts',
+ 'Redirect URI' => 'thesis_redirect',
+ ),
+ /*
+ 'Thesis 2.x' => array(
+ 'Custom Doctitle' => '_thesis_title_tag',
+ 'META Description' => '_thesis_meta_description',
+ 'META Keywords' => '_thesis_meta_keywords',
+ 'Custom Scripts' => '_thesis_javascript_scripts',
+ 'Canonical URI' => '_thesis_canonical_link',
+ 'Redirect URI' => '_thesis_redirect',
+ ),
+ */
+ 'WooFramework' => array(
+ 'Custom Doctitle' => 'seo_title',
+ 'META Description' => 'seo_description',
+ 'META Keywords' => 'seo_keywords',
+ ),
+ );
/**
- * Manual analysis test
+ * The associative array of supported plugins.
*/
- /*
- $aiosp_seometa_analyze = aiosp_seometa_post_meta_analyze( 'All in One SEO Pack', 'Genesis' );
- printf( '%d Compatible Records were identified
', $aiosp_seometa_analyze->update );
- /**/
+ $_aiosp_seometa_plugins = array(
+ // alphabatized
+ 'Add Meta Tags' => array(
+ 'META Description' => 'description',
+ 'META Keywords' => 'keywords',
+ ),
+ 'All in One SEO Pack' => array(
+ 'Custom Doctitle' => '_aioseop_title',
+ 'META Description' => '_aioseop_description',
+ 'META Keywords' => '_aioseop_keywords',
+ ),
+ 'Greg\'s High Performance SEO' => array(
+ 'Custom Doctitle' => '_ghpseo_secondary_title',
+ 'META Description' => '_ghpseo_alternative_description',
+ 'META Keywords' => '_ghpseo_keywords',
+ ),
+ 'Headspace2' => array(
+ 'Custom Doctitle' => '_headspace_page_title',
+ 'META Description' => '_headspace_description',
+ 'META Keywords' => '_headspace_keywords',
+ 'Custom Scripts' => '_headspace_scripts',
+ ),
+ 'Infinite SEO' => array(
+ 'Custom Doctitle' => '_wds_title',
+ 'META Description' => '_wds_metadesc',
+ 'META Keywords' => '_wds_keywords',
+ 'noindex' => '_wds_meta-robots-noindex',
+ 'nofollow' => '_wds_meta-robots-nofollow',
+ 'Canonical URI' => '_wds_canonical',
+ 'Redirect URI' => '_wds_redirect',
+ ),
+ 'Meta SEO Pack' => array(
+ 'META Description' => '_msp_description',
+ 'META Keywords' => '_msp_keywords',
+ ),
+ 'Platinum SEO' => array(
+ 'Custom Doctitle' => 'title',
+ 'META Description' => 'description',
+ 'META Keywords' => 'keywords',
+ ),
+ 'SEO Title Tag' => array(
+ 'Custom Doctitle' => 'title_tag',
+ 'META Description' => 'meta_description',
+ ),
+ 'SEO Ultimate' => array(
+ 'Custom Doctitle' => '_su_title',
+ 'META Description' => '_su_description',
+ 'META Keywords' => '_su_keywords',
+ 'noindex' => '_su_meta_robots_noindex',
+ 'nofollow' => '_su_meta_robots_nofollow',
+ ),
+ 'Yoast SEO' => array(
+ 'Custom Doctitle' => '_yoast_wpseo_title',
+ 'META Description' => '_yoast_wpseo_metadesc',
+ 'META Keywords' => '_yoast_wpseo_metakeywords',
+ 'noindex' => '_yoast_wpseo_meta-robots-noindex',
+ 'nofollow' => '_yoast_wpseo_meta-robots-nofollow',
+ 'Canonical URI' => '_yoast_wpseo_canonical',
+ 'Redirect URI' => '_yoast_wpseo_redirect',
+ ),
+ );
/**
- * Delete all SEO data, from every platform
+ * The combined array of supported platforms.
*/
- /*
- foreach ( $_aiosp_seometa_platforms as $platform => $data ) {
+ $_aiosp_seometa_platforms = array_merge( $_aiosp_seometa_themes, $_aiosp_seometa_plugins );
- foreach ( $data as $field ) {
- $deleted = $wpdb->query( $wpdb->prepare( "DELETE FROM $wpdb->postmeta WHERE meta_key = %s", $field ) );
- printf( '%d %s records deleted ', $deleted, $field );
- }
-
- }
- /**/
+ /**
+ * Include the other elements of the plugin.
+ */
+ // require_once( aiosp_seometa_PLUGIN_DIR . '/admin.php' );
+ // require_once( aiosp_seometa_PLUGIN_DIR . '/functions.php' );
/**
- * Query all SEO data to find the number of records to change
+ * Init hook.
+ *
+ * Hook fires after plugin functions are loaded.
+ *
+ * @since 0.9.10
+ *
*/
+ do_action( 'aiosp_seometa_import' );
+
+}
+
+/**
+ * Activation Hook
+ * @since 0.9.4
+ */
+register_activation_hook( __FILE__, 'aiosp_seometa_activation_hook' );
+function aiosp_seometa_activation_hook() {
+
+ // require_once( aiosp_seometa_PLUGIN_DIR . '/functions.php' );
+
+ aiosp_seometa_meta_key_convert( '_yoast_seo_title', 'yoast_wpseo_title', true );
+ aiosp_seometa_meta_key_convert( '_yoast_seo_metadesc', 'yoast_wpseo_metadesc', true );
+
+}
+
+/**
+ * Manual conversion test
+ */
+/*
+$aiosp_seometa_convert = aiosp_seometa_post_meta_convert( 'All in One SEO Pack', 'Genesis', false );
+printf( '%d records were updated', $aiosp_seometa_convert->updated );
+/**/
+
+/**
+ * Manual analysis test
+ */
+/*
+$aiosp_seometa_analyze = aiosp_seometa_post_meta_analyze( 'All in One SEO Pack', 'Genesis' );
+printf( '%d Compatible Records were identified
', $aiosp_seometa_analyze->update );
+/**/
+
+/**
+ * Delete all SEO data, from every platform
+ */
+/*
+foreach ( $_aiosp_seometa_platforms as $platform => $data ) {
+
+ foreach ( $data as $field ) {
+ $deleted = $wpdb->query( $wpdb->prepare( "DELETE FROM $wpdb->postmeta WHERE meta_key = %s", $field ) );
+ printf( '%d %s records deleted ', $deleted, $field );
+ }
+
+}
+/**/
+
+/**
+ * Query all SEO data to find the number of records to change
+ */
diff --git a/wp-content/plugins/all-in-one-seo-pack/aioseop-init.php b/wp-content/plugins/all-in-one-seo-pack/aioseop-init.php
new file mode 100755
index 0000000000..8e205b8236
--- /dev/null
+++ b/wp-content/plugins/all-in-one-seo-pack/aioseop-init.php
@@ -0,0 +1,7 @@
+log_file = dirname( __FILE__ ) . '/all-in-one-seo-pack.log';
+ $this->log_file = dirname( __FILE__ ) . '/all-in-one-seo-pack.log'; // PHP <5.3 compatibility, once we drop support we can use __DIR___.
- if ( !empty( $aioseop_options ) && isset( $aioseop_options['aiosp_do_log'] ) && $aioseop_options['aiosp_do_log'] )
+ if ( ! empty( $aioseop_options ) && isset( $aioseop_options['aiosp_do_log'] ) && $aioseop_options['aiosp_do_log'] ) {
$this->do_log = true;
- else
+ } else {
$this->do_log = false;
+ }
- $this->name = sprintf( __( '%s Plugin Options', 'all-in-one-seo-pack' ), AIOSEOP_PLUGIN_NAME );
+ $this->name = sprintf( __( '%s Plugin Options', 'all-in-one-seo-pack' ), AIOSEOP_PLUGIN_NAME );
$this->menu_name = __( 'General Settings', 'all-in-one-seo-pack' );
- $this->prefix = 'aiosp_'; // option prefix
- $this->option_name = 'aioseop_options';
+ $this->prefix = 'aiosp_'; // Option prefix.
+ $this->option_name = 'aioseop_options';
$this->store_option = true;
- $this->file = __FILE__; // the current file
- $blog_name = esc_attr( get_bloginfo( 'name' ) );
+ $this->file = __FILE__; // The current file.
+ $blog_name = esc_attr( get_bloginfo( 'name' ) );
parent::__construct();
- $this->help_text = Array(
- "donate" => __( "All donations support continued development of this free software.", 'all-in-one-seo-pack'),
- "license_key" => __( "This will be the license key received when the product was purchased. This is used for automatic upgrades.", 'all-in-one-seo-pack'),
- "can" => __( "This option will automatically generate Canonical URLs for your entire WordPress installation. This will help to prevent duplicate content penalties by Google .", 'all-in-one-seo-pack'),
- "no_paged_canonical_links"=> __( "Checking this option will set the Canonical URL for all paginated content to the first page.", 'all-in-one-seo-pack'),
- "customize_canonical_links"=> __( "Checking this option will allow you to customize Canonical URLs for specific posts.", 'all-in-one-seo-pack'),
- "can_set_protocol" => __( "Set protocol for canonical URLs.", 'all-in-one-seo-pack' ),
- "use_original_title" => __( "Use wp_title to get the title used by the theme; this is disabled by default. If you use this option, set your title formats appropriately, as your theme might try to do its own title SEO as well.", 'all-in-one-seo-pack' ),
- "do_log" => __( "Check this and All in One SEO Pack will create a log of important events (all-in-one-seo-pack.log) in its plugin directory which might help debugging. Make sure this directory is writable.", 'all-in-one-seo-pack' ),
- "home_title" => __( "As the name implies, this will be the Meta Title of your homepage. This is independent of any other option. If not set, the default Site Title (found in WordPress under Settings, General, Site Title) will be used.", 'all-in-one-seo-pack' ),
- "home_description" => __( "This will be the Meta Description for your homepage. This is independent of any other option. The default is no Meta Description at all if this is not set.", 'all-in-one-seo-pack' ),
- "home_keywords" => __( "Enter a comma separated list of your most important keywords for your site that will be written as Meta Keywords on your homepage. Don\'t stuff everything in here.", 'all-in-one-seo-pack' ),
- "use_static_home_info" => __( "Checking this option uses the title, description, and keywords set on your static Front Page.", 'all-in-one-seo-pack' ),
- "togglekeywords" => __( "This option allows you to toggle the use of Meta Keywords throughout the whole of the site.", 'all-in-one-seo-pack' ),
- "use_categories" => __( "Check this if you want your categories for a given post used as the Meta Keywords for this post (in addition to any keywords you specify on the Edit Post screen).", 'all-in-one-seo-pack' ),
- "use_tags_as_keywords" => __( "Check this if you want your tags for a given post used as the Meta Keywords for this post (in addition to any keywords you specify on the Edit Post screen).", 'all-in-one-seo-pack' ),
- "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'),
- "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' ),
- "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' ),
- "cap_cats" => __( "Check this and Category Titles will have the first letter of each word capitalized.", 'all-in-one-seo-pack'),
- "home_page_title_format" =>
- __( "This controls the format of the title tag for your Home Page. The following macros are supported:", 'all-in-one-seo-pack' )
+ $this->help_text = array(
+ 'donate' => __( 'All donations support continued development of this free software.', 'all-in-one-seo-pack' ),
+ 'license_key' => __( 'This will be the license key received when the product was purchased. This is used for automatic upgrades.', 'all-in-one-seo-pack' ),
+ 'can' => __( "This option will automatically generate Canonical URLs for your entire WordPress installation. This will help to prevent duplicate content penalties by Google .", 'all-in-one-seo-pack' ),
+ 'no_paged_canonical_links' => __( 'Checking this option will set the Canonical URL for all paginated content to the first page.', 'all-in-one-seo-pack' ),
+ 'customize_canonical_links' => __( 'Checking this option will allow you to customize Canonical URLs for specific posts.', 'all-in-one-seo-pack' ),
+ 'can_set_protocol' => __( 'Set protocol for canonical URLs.', 'all-in-one-seo-pack' ),
+ 'use_original_title' => __( 'Use wp_title to get the title used by the theme; this is disabled by default. If you use this option, set your title formats appropriately, as your theme might try to do its own title SEO as well.', 'all-in-one-seo-pack' ),
+ 'do_log' => __( 'Check this and All in One SEO Pack will create a log of important events (all-in-one-seo-pack.log) in its plugin directory which might help debugging. Make sure this directory is writable.', 'all-in-one-seo-pack' ),
+ 'home_title' => __( 'As the name implies, this will be the Meta Title of your homepage. This is independent of any other option. If not set, the default Site Title (found in WordPress under Settings, General, Site Title) will be used.', 'all-in-one-seo-pack' ),
+ 'home_description' => __( 'This will be the Meta Description for your homepage. This is independent of any other option. The default is no Meta Description at all if this is not set.', 'all-in-one-seo-pack' ),
+ 'home_keywords' => __( 'Enter a comma separated list of your most important keywords for your site that will be written as Meta Keywords on your homepage. Do not stuff everything in here.', 'all-in-one-seo-pack' ),
+ 'use_static_home_info' => __( 'Checking this option uses the title, description, and keywords set on your static Front Page.', 'all-in-one-seo-pack' ),
+ 'togglekeywords' => __( 'This option allows you to toggle the use of Meta Keywords throughout the whole of the site.', 'all-in-one-seo-pack' ),
+ 'use_categories' => __( 'Check this if you want your categories for a given post used as the Meta Keywords for this post (in addition to any keywords you specify on the Edit Post screen).', 'all-in-one-seo-pack' ),
+ 'use_tags_as_keywords' => __( 'Check this if you want your tags for a given post used as the Meta Keywords for this post (in addition to any keywords you specify on the Edit Post screen).', 'all-in-one-seo-pack' ),
+ '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' ),
+ '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' ),
+ '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' ),
+ 'cap_cats' => __( 'Check this and Category Titles will have the first letter of each word capitalized.', 'all-in-one-seo-pack' ),
+ 'home_page_title_format' =>
+ __( 'This controls the format of the title tag for your Home Page. The following macros are supported:', 'all-in-one-seo-pack' )
. '' . __( '%blog_title% - Your blog title', 'all-in-one-seo-pack' ) . ' ' .
__( '%blog_description% - Your blog description', 'all-in-one-seo-pack' ) . ' ' .
__( '%page_title% - The original title of the page', 'all-in-one-seo-pack' ) . ' ' .
__( "%page_author_login% - This page's author' login", 'all-in-one-seo-pack' ) . ' ' .
__( "%page_author_nicename% - This page's author' nicename", 'all-in-one-seo-pack' ) . ' ' .
__( "%page_author_firstname% - This page's author' first name (capitalized)", 'all-in-one-seo-pack' ) . ' ' .
- __( "%page_author_lastname% - This page's author' last name (capitalized)", 'all-in-one-seo-pack' ) . ' ' .
- ' ',
- "page_title_format" =>
- __( "This controls the format of the title tag for Pages. The following macros are supported:", 'all-in-one-seo-pack' )
+ __( "%page_author_lastname% - This page's author' last name (capitalized)", 'all-in-one-seo-pack' ) . '',
+ 'page_title_format' =>
+ __( 'This controls the format of the title tag for Pages. The following macros are supported:', 'all-in-one-seo-pack' )
. '' . __( '%blog_title% - Your blog title', 'all-in-one-seo-pack' ) . ' ' .
__( '%blog_description% - Your blog description', 'all-in-one-seo-pack' ) . ' ' .
__( '%page_title% - The original title of the page', 'all-in-one-seo-pack' ) . ' ' .
__( "%page_author_login% - This page's author' login", 'all-in-one-seo-pack' ) . ' ' .
__( "%page_author_nicename% - This page's author' nicename", 'all-in-one-seo-pack' ) . ' ' .
__( "%page_author_firstname% - This page's author' first name (capitalized)", 'all-in-one-seo-pack' ) . ' ' .
- __( "%page_author_lastname% - This page's author' last name (capitalized)", 'all-in-one-seo-pack' ) . ' ' .
- ' ',
- "post_title_format" =>
- __( "This controls the format of the title tag for Posts. The following macros are supported:", 'all-in-one-seo-pack' )
+ __( "%page_author_lastname% - This page's author' last name (capitalized)", 'all-in-one-seo-pack' ) . '',
+ 'post_title_format' =>
+ __( 'This controls the format of the title tag for Posts. The following macros are supported:', 'all-in-one-seo-pack' )
. '' . __( '%blog_title% - Your blog title', 'all-in-one-seo-pack' ) . ' ' .
__( '%blog_description% - Your blog description', 'all-in-one-seo-pack' ) . ' ' .
__( '%post_title% - The original title of the post', 'all-in-one-seo-pack' ) . ' ' .
@@ -118,602 +123,886 @@ function __construct() {
__( "%post_author_login% - This post's author' login", 'all-in-one-seo-pack' ) . ' ' .
__( "%post_author_nicename% - This post's author' nicename", 'all-in-one-seo-pack' ) . ' ' .
__( "%post_author_firstname% - This post's author' first name (capitalized)", 'all-in-one-seo-pack' ) . ' ' .
- __( "%post_author_lastname% - This post's author' last name (capitalized)", 'all-in-one-seo-pack' ) . ' ' .
- ' ',
- "category_title_format" =>
- __( "This controls the format of the title tag for Category Archives. The following macros are supported:", 'all-in-one-seo-pack' ) .
+ __( "%post_author_lastname% - This post's author' last name (capitalized)", 'all-in-one-seo-pack' ) . '',
+ 'category_title_format' =>
+ __( 'This controls the format of the title tag for Category Archives. The following macros are supported:', 'all-in-one-seo-pack' ) .
'' . __( '%blog_title% - Your blog title', 'all-in-one-seo-pack' ) . ' ' .
__( '%blog_description% - Your blog description', 'all-in-one-seo-pack' ) . ' ' .
__( '%category_title% - The original title of the category', 'all-in-one-seo-pack' ) . ' ' .
__( '%category_description% - The description of the category', 'all-in-one-seo-pack' ) . ' ',
- "archive_title_format" =>
- __( "This controls the format of the title tag for Custom Post Archives. The following macros are supported:", 'all-in-one-seo-pack' ) .
+ 'archive_title_format' =>
+ __( 'This controls the format of the title tag for Custom Post Archives. The following macros are supported:', 'all-in-one-seo-pack' ) .
'' . __( '%blog_title% - Your blog title', 'all-in-one-seo-pack' ) . ' ' .
__( '%blog_description% - Your blog description', 'all-in-one-seo-pack' ) . ' ' .
__( '%archive_title - The original archive title given by wordpress', 'all-in-one-seo-pack' ) . ' ',
- "date_title_format" =>
- __( "This controls the format of the title tag for Date Archives. The following macros are supported:", 'all-in-one-seo-pack' ) .
+ 'date_title_format' =>
+ __( 'This controls the format of the title tag for Date Archives. The following macros are supported:', 'all-in-one-seo-pack' ) .
'' . __( '%blog_title% - Your blog title', 'all-in-one-seo-pack' ) . ' ' .
__( '%blog_description% - Your blog description', 'all-in-one-seo-pack' ) . ' ' .
__( '%date% - The original archive title given by wordpress, e.g. "2007" or "2007 August"', 'all-in-one-seo-pack' ) . ' ' .
__( '%day% - The original archive day given by wordpress, e.g. "17"', 'all-in-one-seo-pack' ) . ' ' .
__( '%month% - The original archive month given by wordpress, e.g. "August"', 'all-in-one-seo-pack' ) . ' ' .
__( '%year% - The original archive year given by wordpress, e.g. "2007"', 'all-in-one-seo-pack' ) . ' ',
- "author_title_format" =>
- __( "This controls the format of the title tag for Author Archives. The following macros are supported:", 'all-in-one-seo-pack' ) .
+ 'author_title_format' =>
+ __( 'This controls the format of the title tag for Author Archives. The following macros are supported:', 'all-in-one-seo-pack' ) .
'' . __( '%blog_title% - Your blog title', 'all-in-one-seo-pack' ) . ' ' .
__( '%blog_description% - Your blog description', 'all-in-one-seo-pack' ) . ' ' .
__( '%author% - The original archive title given by wordpress, e.g. "Steve" or "John Smith"', 'all-in-one-seo-pack' ) . ' ',
- "tag_title_format" =>
- __( "This controls the format of the title tag for Tag Archives. The following macros are supported:", 'all-in-one-seo-pack' ) .
+ 'tag_title_format' =>
+ __( 'This controls the format of the title tag for Tag Archives. The following macros are supported:', 'all-in-one-seo-pack' ) .
'' . __( '%blog_title% - Your blog title', 'all-in-one-seo-pack' ) . ' ' .
__( '%blog_description% - Your blog description', 'all-in-one-seo-pack' ) . ' ' .
__( '%tag% - The name of the tag', 'all-in-one-seo-pack' ) . ' ',
- "search_title_format" =>
- __( "This controls the format of the title tag for the Search page. The following macros are supported:", 'all-in-one-seo-pack' ) .
+ 'search_title_format' =>
+ __( 'This controls the format of the title tag for the Search page. The following macros are supported:', 'all-in-one-seo-pack' ) .
'' . __( '%blog_title% - Your blog title', 'all-in-one-seo-pack' ) . ' ' .
__( '%blog_description% - Your blog description', 'all-in-one-seo-pack' ) . ' ' .
__( '%search% - What was searched for', 'all-in-one-seo-pack' ) . ' ',
- "description_format" => __( "This controls the format of Meta Descriptions.The following macros are supported:", 'all-in-one-seo-pack' ) .
- '' . __( '%blog_title% - Your blog title', 'all-in-one-seo-pack' ) . ' ' .
- __( '%blog_description% - Your blog description', 'all-in-one-seo-pack' ) . ' ' .
- __( '%description% - The original description as determined by the plugin, e.g. the excerpt if one is set or an auto-generated one if that option is set', 'all-in-one-seo-pack' ) . ' ' .
- __( '%post_title% - The original title of the post', 'all-in-one-seo-pack' ) . ' ' .
- __( '%wp_title% - The original wordpress title, e.g. post_title for posts', 'all-in-one-seo-pack' ) . ' ',
- "404_title_format" => __( "This controls the format of the title tag for the 404 page. The following macros are supported:", 'all-in-one-seo-pack' ) .
- '' . __( '%blog_title% - Your blog title', 'all-in-one-seo-pack' ) . ' ' .
- __( '%blog_description% - Your blog description', 'all-in-one-seo-pack' ) . ' ' .
- __( '%request_url% - The original URL path, like "/url-that-does-not-exist/"', 'all-in-one-seo-pack' ) . ' ' .
- __( '%request_words% - The URL path in human readable form, like "Url That Does Not Exist"', 'all-in-one-seo-pack' ) . ' ' .
- __( '%404_title% - Additional 404 title input"', 'all-in-one-seo-pack' ) . ' ',
- "paged_format" => __( "This string gets appended/prepended to titles of paged index pages (like home or archive pages).", 'all-in-one-seo-pack' )
- . __( 'The following macros are supported:', 'all-in-one-seo-pack' )
- . '' . __( '%page% - The page number', 'all-in-one-seo-pack' ) . ' ',
- "enablecpost" => __( "Check this if you want to use All in One SEO Pack with any Custom Post Types on this site.", 'all-in-one-seo-pack' ),
- "cpostadvanced" => __( "This will show or hide the advanced options for SEO for Custom Post Types.", 'all-in-one-seo-pack' ),
- "cpostactive" => __( "Use these checkboxes to select which Post Types you want to use All in One SEO Pack with.", 'all-in-one-seo-pack' ),
- "taxactive" => __( "Use these checkboxes to select which Taxonomies you want to use All in One SEO Pack with.", 'all-in-one-seo-pack' ),
- "cposttitles" => __( "This allows you to set the title tags for each Custom Post Type.", 'all-in-one-seo-pack' ),
- "posttypecolumns" => __( "This lets you select which screens display the SEO Title, SEO Keywords and SEO Description columns.", 'all-in-one-seo-pack' ),
- "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' ),
- "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' ),
- "google_verify" => __( "Enter your verification code here to verify your site with Google Webmaster Tools.Click here for documentation on this setting ", 'all-in-one-seo-pack' ),
- "bing_verify" => __( "Enter your verification code here to verify your site with Bing Webmaster Tools.Click here for documentation on this setting ", 'all-in-one-seo-pack' ),
- "pinterest_verify" => __( "Enter your verification code here to verify your site with Pinterest.Click here for documentation on this setting ", 'all-in-one-seo-pack' ),
- "google_publisher" => __( "Enter your Google+ Profile URL here to add the rel=“author” tag to your site for Google authorship. It is recommended that the URL you enter here should be your personal Google+ profile. Use the Advanced Authorship Options below if you want greater control over the use of authorship.", 'all-in-one-seo-pack' ),
- "google_disable_profile"=> __( "Check this to remove the Google Plus field from the user profile screen.", 'all-in-one-seo-pack' ),
- "google_author_advanced"=> __( "Enable this to display advanced options for controlling Google Plus authorship information on your website.", 'all-in-one-seo-pack' ),
- "google_author_location"=> __( "This option allows you to control which types of pages you want to display rel=\"author\" on for Google authorship. The options include the Front Page (the homepage of your site), Posts, Pages, and any Custom Post Types. The Everywhere Else option includes 404, search, categories, tags, custom taxonomies, date archives, author archives and any other page template.", 'all-in-one-seo-pack' ),
- "google_enable_publisher"=> __( "This option allows you to control whether rel=\"publisher\" is displayed on the homepage of your site. Google recommends using this if the site is a business website.", 'all-in-one-seo-pack' ),
- "google_specify_publisher"=> __( "The Google+ profile you enter here will appear on your homepage only as the rel=\"publisher\" tag. It is recommended that the URL you enter here should be the Google+ profile for your business.", 'all-in-one-seo-pack' ),
- "google_sitelinks_search"=> __( "Add markup to display the Google Sitelinks Search Box next to your search results in Google.", 'all-in-one-seo-pack' ),
- "google_set_site_name" => __( "Add markup to tell Google the preferred name for your website.", 'all-in-one-seo-pack' ),
- "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' ),
- "google_analytics_id" => __( "Enter your Google Analytics ID here to track visitor behavior on your site using Google Analytics.", 'all-in-one-seo-pack' ),
- "ga_use_universal_analytics" => __( "Use the new Universal Analytics tracking code for Google Analytics.", 'all-in-one-seo-pack' ),
- "ga_advanced_options" => __( "Check to use advanced Google Analytics options.", 'all-in-one-seo-pack' ),
- "ga_domain" => __( "Enter your domain name without the http:// to set your cookie domain.", 'all-in-one-seo-pack' ),
- "ga_multi_domain" => __( "Use this option to enable tracking of multiple or additional domains.", 'all-in-one-seo-pack' ),
- "ga_addl_domains" => __( "Add a list of additional domains to track here. Enter one domain name per line without the http://.", 'all-in-one-seo-pack' ),
- "ga_anonymize_ip" => __( "This enables support for IP Anonymization in Google Analytics.", 'all-in-one-seo-pack' ),
- "ga_display_advertising"=> __( "This enables support for the Display Advertiser Features in Google Analytics.", 'all-in-one-seo-pack' ),
- "ga_exclude_users" => __( "Exclude logged-in users from Google Analytics tracking by role.", 'all-in-one-seo-pack' ),
- "ga_track_outbound_links"=> __( "Check this if you want to track outbound links with Google Analytics.", 'all-in-one-seo-pack' ),
- "ga_link_attribution"=> __( "This enables support for the Enhanced Link Attribution in Google Analytics.", 'all-in-one-seo-pack' ),
- "ga_enhanced_ecommerce" => __( "This enables support for the Enhanced Ecommerce in Google Analytics.", 'all-in-one-seo-pack' ),
- "cpostnoindex" => __( "Set the default NOINDEX setting for each Post Type.", 'all-in-one-seo-pack' ),
- "cpostnofollow" => __( "Set the default NOFOLLOW setting for each Post Type.", 'all-in-one-seo-pack' ),
- "category_noindex" => __( "Check this to ask search engines not to index Category Archives. Useful for avoiding duplicate content.", 'all-in-one-seo-pack' ),
- "archive_date_noindex" => __( "Check this to ask search engines not to index Date Archives. Useful for avoiding duplicate content.", 'all-in-one-seo-pack' ),
- "archive_author_noindex"=> __( "Check this to ask search engines not to index Author Archives. Useful for avoiding duplicate content.", 'all-in-one-seo-pack' ),
- "tags_noindex" => __( "Check this to ask search engines not to index Tag Archives. Useful for avoiding duplicate content.", 'all-in-one-seo-pack' ),
- "search_noindex" => __( "Check this to ask search engines not to index the Search page. Useful for avoiding duplicate content.", 'all-in-one-seo-pack' ),
- "404_noindex" => __( "Check this to ask search engines not to index the 404 page.", 'all-in-one-seo-pack' ),
- "tax_noindex" => __( "Check this to ask search engines not to index custom Taxonomy archive pages. Useful for avoiding duplicate content.", 'all-in-one-seo-pack' ),
- "paginated_noindex" => __( "Check this to ask search engines not to index paginated pages/posts. Useful for avoiding duplicate content.", 'all-in-one-seo-pack' ),
- "paginated_nofollow" => __( "Check this to ask search engines not to follow links from paginated pages/posts. Useful for avoiding duplicate content.", 'all-in-one-seo-pack' ),
- 'noodp' => __( 'Check this box to ask search engines not to use descriptions from the Open Directory Project for your entire site.', 'all-in-one-seo-pack' ),
- 'cpostnoodp' => __( "Set the default noodp setting for each Post Type.", 'all-in-one-seo-pack' ),
- 'noydir' => __( 'Check this box to ask Yahoo! not to use descriptions from the Yahoo! directory for your entire site.', 'all-in-one-seo-pack' ),
- 'cpostnoydir' => __( "Set the default noydir setting for each Post Type.", 'all-in-one-seo-pack' ),
- "skip_excerpt" => __( "Check this and your Meta Descriptions won't be generated from the excerpt.", 'all-in-one-seo-pack' ),
- "generate_descriptions" => __( "Check this and your Meta Descriptions will be auto-generated from your excerpt or content.", 'all-in-one-seo-pack' ),
- "run_shortcodes" => __( "Check this and shortcodes will get executed for descriptions auto-generated from content.", 'all-in-one-seo-pack' ),
- "hide_paginated_descriptions"=> __( "Check this and your Meta Descriptions will be removed from page 2 or later of paginated content.", 'all-in-one-seo-pack' ),
- "dont_truncate_descriptions"=> __( "Check this to prevent your Description from being truncated regardless of its length.", 'all-in-one-seo-pack' ),
- "schema_markup"=> __( "Check this to support Schema.org markup, i.e., itemprop on supported metadata.", 'all-in-one-seo-pack' ),
- "unprotect_meta" => __( "Check this to unprotect internal postmeta fields for use with XMLRPC. If you don't know what that is, leave it unchecked.", 'all-in-one-seo-pack' ),
- "ex_pages" => __( "Enter a comma separated list of pages here to be excluded by All in One SEO Pack. This is helpful when using plugins which generate their own non-WordPress dynamic pages. Ex: /forum/, /contact/ For instance, if you want to exclude the virtual pages generated by a forum plugin, all you have to do is add forum or /forum or /forum/ or and any URL with the word \"forum\" in it, such as http://mysite.com/forum or http://mysite.com/forum/someforumpage here and it will be excluded from All in One SEO Pack.", 'all-in-one-seo-pack' ),
- "post_meta_tags" => __( "What you enter here will be copied verbatim to the header of all Posts. You can enter whatever additional headers you want here, even references to stylesheets.", 'all-in-one-seo-pack' ),
- "page_meta_tags" => __( "What you enter here will be copied verbatim to the header of all Pages. You can enter whatever additional headers you want here, even references to stylesheets.", 'all-in-one-seo-pack' ),
- "front_meta_tags" => __( "What you enter here will be copied verbatim to the header of the front page if you have set a static page in Settings, Reading, Front Page Displays. You can enter whatever additional headers you want here, even references to stylesheets. This will fall back to using Additional Page Headers if you have them set and nothing is entered here.", 'all-in-one-seo-pack' ),
- "home_meta_tags" => __( "What you enter here will be copied verbatim to the header of the home page if you have Front page displays your latest posts selected in Settings, Reading. It will also be copied verbatim to the header on the Posts page if you have one set in Settings, Reading. You can enter whatever additional headers you want here, even references to stylesheets.", 'all-in-one-seo-pack' ),
+ 'description_format' => __( 'This controls the format of Meta Descriptions.The following macros are supported:', 'all-in-one-seo-pack' ) .
+ '' . __( '%blog_title% - Your blog title', 'all-in-one-seo-pack' ) . ' ' .
+ __( '%blog_description% - Your blog description', 'all-in-one-seo-pack' ) . ' ' .
+ __( '%description% - The original description as determined by the plugin, e.g. the excerpt if one is set or an auto-generated one if that option is set', 'all-in-one-seo-pack' ) . ' ' .
+ __( '%post_title% - The original title of the post', 'all-in-one-seo-pack' ) . ' ' .
+ __( '%wp_title% - The original wordpress title, e.g. post_title for posts', 'all-in-one-seo-pack' ) . ' ',
+ '404_title_format' => __( 'This controls the format of the title tag for the 404 page. The following macros are supported:', 'all-in-one-seo-pack' ) .
+ '' . __( '%blog_title% - Your blog title', 'all-in-one-seo-pack' ) . ' ' .
+ __( '%blog_description% - Your blog description', 'all-in-one-seo-pack' ) . ' ' .
+ __( '%request_url% - The original URL path, like "/url-that-does-not-exist/"', 'all-in-one-seo-pack' ) . ' ' .
+ __( '%request_words% - The URL path in human readable form, like "Url That Does Not Exist"', 'all-in-one-seo-pack' ) . ' ' .
+ __( '%404_title% - Additional 404 title input"', 'all-in-one-seo-pack' ) . ' ',
+ 'paged_format' => __( 'This string gets appended/prepended to titles of paged index pages (like home or archive pages).', 'all-in-one-seo-pack' )
+ . __( 'The following macros are supported:', 'all-in-one-seo-pack' )
+ . '' . __( '%page% - The page number', 'all-in-one-seo-pack' ) . ' ',
+ 'enablecpost' => __( 'Check this if you want to use All in One SEO Pack with any Custom Post Types on this site.', 'all-in-one-seo-pack' ),
+ 'cpostadvanced' => __( 'This will show or hide the advanced options for SEO for Custom Post Types.', 'all-in-one-seo-pack' ),
+ 'cpostactive' => __( 'Use these checkboxes to select which Post Types you want to use All in One SEO Pack with.', 'all-in-one-seo-pack' ),
+ 'taxactive' => __( 'Use these checkboxes to select which Taxonomies you want to use All in One SEO Pack with.', 'all-in-one-seo-pack' ),
+ 'cposttitles' => __( 'This allows you to set the title tags for each Custom Post Type.', 'all-in-one-seo-pack' ),
+ 'posttypecolumns' => __( 'This lets you select which screens display the SEO Title, SEO Keywords and SEO Description columns.', 'all-in-one-seo-pack' ),
+ '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' ),
+ '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' ),
+ 'google_verify' => __( "Enter your verification code here to verify your site with Google Webmaster Tools.Click here for documentation on this setting ", 'all-in-one-seo-pack' ),
+ 'bing_verify' => __( "Enter your verification code here to verify your site with Bing Webmaster Tools.Click here for documentation on this setting ", 'all-in-one-seo-pack' ),
+ 'pinterest_verify' => __( "Enter your verification code here to verify your site with Pinterest.Click here for documentation on this setting ", 'all-in-one-seo-pack' ),
+ 'google_publisher' => __( 'Enter your Google+ Profile URL here to add the rel=“author” tag to your site for Google authorship. It is recommended that the URL you enter here should be your personal Google+ profile. Use the Advanced Authorship Options below if you want greater control over the use of authorship.', 'all-in-one-seo-pack' ),
+ 'google_disable_profile' => __( 'Check this to remove the Google Plus field from the user profile screen.', 'all-in-one-seo-pack' ),
+ 'google_author_advanced' => __( 'Enable this to display advanced options for controlling Google Plus authorship information on your website.', 'all-in-one-seo-pack' ),
+ 'google_author_location' => __( 'This option allows you to control which types of pages you want to display rel=\"author\" on for Google authorship. The options include the Front Page (the homepage of your site), Posts, Pages, and any Custom Post Types. The Everywhere Else option includes 404, search, categories, tags, custom taxonomies, date archives, author archives and any other page template.', 'all-in-one-seo-pack' ),
+ 'google_enable_publisher' => __( 'This option allows you to control whether rel=\"publisher\" is displayed on the homepage of your site. Google recommends using this if the site is a business website.', 'all-in-one-seo-pack' ),
+ 'google_specify_publisher' => __( 'The Google+ profile you enter here will appear on your homepage only as the rel=\"publisher\" tag. It is recommended that the URL you enter here should be the Google+ profile for your business.', 'all-in-one-seo-pack' ),
+ 'google_sitelinks_search' => __( 'Add markup to display the Google Sitelinks Search Box next to your search results in Google.', 'all-in-one-seo-pack' ),
+ 'google_set_site_name' => __( 'Add markup to tell Google the preferred name for your website.', 'all-in-one-seo-pack' ),
+ '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' ),
+ 'google_analytics_id' => __( 'Enter your Google Analytics ID here to track visitor behavior on your site using Google Analytics.', 'all-in-one-seo-pack' ),
+ 'ga_use_universal_analytics' => __( 'Use the new Universal Analytics tracking code for Google Analytics.', 'all-in-one-seo-pack' ),
+ 'ga_advanced_options' => __( 'Check to use advanced Google Analytics options.', 'all-in-one-seo-pack' ),
+ 'ga_domain' => __( 'Enter your domain name without the http:// to set your cookie domain.', 'all-in-one-seo-pack' ),
+ 'ga_multi_domain' => __( 'Use this option to enable tracking of multiple or additional domains.', 'all-in-one-seo-pack' ),
+ 'ga_addl_domains' => __( 'Add a list of additional domains to track here. Enter one domain name per line without the http://.', 'all-in-one-seo-pack' ),
+ 'ga_anonymize_ip' => __( 'This enables support for IP Anonymization in Google Analytics.', 'all-in-one-seo-pack' ),
+ 'ga_display_advertising' => __( 'This enables support for the Display Advertiser Features in Google Analytics.', 'all-in-one-seo-pack' ),
+ 'ga_exclude_users' => __( 'Exclude logged-in users from Google Analytics tracking by role.', 'all-in-one-seo-pack' ),
+ 'ga_track_outbound_links' => __( 'Check this if you want to track outbound links with Google Analytics.', 'all-in-one-seo-pack' ),
+ 'ga_link_attribution' => __( 'This enables support for the Enhanced Link Attribution in Google Analytics.', 'all-in-one-seo-pack' ),
+ 'ga_enhanced_ecommerce' => __( 'This enables support for the Enhanced Ecommerce in Google Analytics.', 'all-in-one-seo-pack' ),
+ 'cpostnoindex' => __( 'Set the default NOINDEX setting for each Post Type.', 'all-in-one-seo-pack' ),
+ 'cpostnofollow' => __( 'Set the default NOFOLLOW setting for each Post Type.', 'all-in-one-seo-pack' ),
+
+ 'category_noindex' => __( 'Check this to ask search engines not to index Category Archives. Useful for avoiding duplicate content.', 'all-in-one-seo-pack' ),
+ 'archive_date_noindex' => __( 'Check this to ask search engines not to index Date Archives. Useful for avoiding duplicate content.', 'all-in-one-seo-pack' ),
+ 'archive_author_noindex' => __( 'Check this to ask search engines not to index Author Archives. Useful for avoiding duplicate content.', 'all-in-one-seo-pack' ),
+ 'tags_noindex' => __( 'Check this to ask search engines not to index Tag Archives. Useful for avoiding duplicate content.', 'all-in-one-seo-pack' ),
+ 'search_noindex' => __( 'Check this to ask search engines not to index the Search page. Useful for avoiding duplicate content.', 'all-in-one-seo-pack' ),
+ '404_noindex' => __( 'Check this to ask search engines not to index the 404 page.', 'all-in-one-seo-pack' ),
+ 'tax_noindex' => __( 'Check this to ask search engines not to index custom Taxonomy archive pages. Useful for avoiding duplicate content.', 'all-in-one-seo-pack' ),
+ 'paginated_noindex' => __( 'Check this to ask search engines not to index paginated pages/posts. Useful for avoiding duplicate content.', 'all-in-one-seo-pack' ),
+ 'paginated_nofollow' => __( 'Check this to ask search engines not to follow links from paginated pages/posts. Useful for avoiding duplicate content.', 'all-in-one-seo-pack' ),
+ 'noodp' => __( 'Check this box to ask search engines not to use descriptions from the Open Directory Project for your entire site.', 'all-in-one-seo-pack' ),
+ 'cpostnoodp' => __( 'Set the default noodp setting for each Post Type.', 'all-in-one-seo-pack' ),
+ 'noydir' => __( 'Check this box to ask Yahoo! not to use descriptions from the Yahoo! directory for your entire site.', 'all-in-one-seo-pack' ),
+ 'cpostnoydir' => __( 'Set the default noydir setting for each Post Type.', 'all-in-one-seo-pack' ),
+ 'skip_excerpt' => __( "Check this and your Meta Descriptions won't be generated from the excerpt.", 'all-in-one-seo-pack' ),
+ 'generate_descriptions' => __( 'Check this and your Meta Descriptions will be auto-generated from your excerpt or content.', 'all-in-one-seo-pack' ),
+ 'run_shortcodes' => __( 'Check this and shortcodes will get executed for descriptions auto-generated from content.', 'all-in-one-seo-pack' ),
+ 'hide_paginated_descriptions' => __( 'Check this and your Meta Descriptions will be removed from page 2 or later of paginated content.', 'all-in-one-seo-pack' ),
+ 'dont_truncate_descriptions' => __( 'Check this to prevent your Description from being truncated regardless of its length.', 'all-in-one-seo-pack' ),
+ 'schema_markup' => __( 'Check this to support Schema.org markup, i.e., itemprop on supported metadata.', 'all-in-one-seo-pack' ),
+ 'unprotect_meta' => __( "Check this to unprotect internal postmeta fields for use with XMLRPC. If you don't know what that is, leave it unchecked.", 'all-in-one-seo-pack' ),
+ 'ex_pages' => __( 'Enter a comma separated list of pages here to be excluded by All in One SEO Pack. This is helpful when using plugins which generate their own non-WordPress dynamic pages. Ex: /forum/, /contact/ For instance, if you want to exclude the virtual pages generated by a forum plugin, all you have to do is add forum or /forum or /forum/ or and any URL with the word \"forum\" in it, such as http://mysite.com/forum or http://mysite.com/forum/someforumpage here and it will be excluded from All in One SEO Pack.', 'all-in-one-seo-pack' ),
+ 'post_meta_tags' => __( 'What you enter here will be copied verbatim to the header of all Posts. You can enter whatever additional headers you want here, even references to stylesheets.', 'all-in-one-seo-pack' ),
+ 'page_meta_tags' => __( 'What you enter here will be copied verbatim to the header of all Pages. You can enter whatever additional headers you want here, even references to stylesheets.', 'all-in-one-seo-pack' ),
+ 'front_meta_tags' => __( 'What you enter here will be copied verbatim to the header of the front page if you have set a static page in Settings, Reading, Front Page Displays. You can enter whatever additional headers you want here, even references to stylesheets. This will fall back to using Additional Page Headers if you have them set and nothing is entered here.', 'all-in-one-seo-pack' ),
+ 'home_meta_tags' => __( 'What you enter here will be copied verbatim to the header of the home page if you have Front page displays your latest posts selected in Settings, Reading. It will also be copied verbatim to the header on the Posts page if you have one set in Settings, Reading. You can enter whatever additional headers you want here, even references to stylesheets.', 'all-in-one-seo-pack' ),
);
- $this->help_anchors = Array(
- 'license_key' => '#license-key',
- 'can' => '#canonical-urls',
- 'no_paged_canonical_links' => '#no-pagination-for-canonical-urls',
- 'customize_canonical_links' => '#enable-custom-canonical-urls',
- 'use_original_title' => '#use-original-title',
- 'schema_markup' => '#use-schema-markup',
- 'do_log' => '#log-important-events',
- 'home_title' => '#home-title',
- 'home_description' => '#home-description',
- 'home_keywords' => '#home-keywords',
- 'togglekeywords' => '#use-keywords',
- 'use_categories' => '#use-categories-for-meta-keywords',
- 'use_tags_as_keywords' => '#use-tags-for-meta-keywords',
- 'dynamic_postspage_keywords' => '#dynamically-generate-keywords-for-posts-page',
- 'rewrite_titles' => '#rewrite-titles',
- 'cap_titles' => '#capitalize-titles',
- 'home_page_title_format' => '#title-format-fields',
- 'page_title_format' => '#title-format-fields',
- 'post_title_format' => '#title-format-fields',
- 'category_title_format' => '#title-format-fields',
- 'archive_title_format' => '#title-format-fields',
- 'date_title_format' => '#title-format-fields',
- 'author_title_format' => '#title-format-fields',
- 'tag_title_format' => '#title-format-fields',
- 'search_title_format' => '#title-format-fields',
- '404_title_format' => '#title-format-fields',
- 'enablecpost' => '#seo-for-custom-post-types',
- 'cpostadvanced' => '#enable-advanced-options',
- 'cpostactive' => '#seo-on-only-these-post-types',
- 'taxactive' => '#seo-on-only-these-taxonomies',
- 'cposttitles' => '#custom-titles',
- 'posttypecolumns' => '#show-column-labels-for-custom-post-types',
- 'admin_bar' => '#display-menu-in-admin-bar',
- 'custom_menu_order' => '#display-menu-at-the-top',
- 'google_verify' => '',
- 'bing_verify' => '',
- 'pinterest_verify' => '',
- 'google_publisher' => '#google-plus-default-profile',
- 'google_disable_profile' => '#disable-google-plus-profile',
- 'google_author_advanced' => '#advanced-authorship-options',
- 'google_author_location' => '#display-google-authorship',
- 'google_enable_publisher' => '#display-publisher-meta-on-front-page',
- 'google_specify_publisher' => '#specify-publisher-url',
- 'google_analytics_id' => 'http://semperplugins.com/documentation/setting-up-google-analytics/',
- 'ga_use_universal_analytics' => '#use-universal-analytics',
- 'ga_domain' => '#tracking-domain',
- 'ga_multi_domain' => '#track-multiple-domains-additional-domains',
- 'ga_addl_domains' => '#track-multiple-domains-additional-domains',
- 'ga_anonymize_ip' => '#anonymize-ip-addresses',
- 'ga_display_advertising' => '#display-advertiser-tracking',
- 'ga_exclude_users' => '#exclude-users-from-tracking',
- 'ga_track_outbound_links' => '#track-outbound-links',
- 'ga_link_attribution' => '#enhanced-link-attribution',
- 'ga_enhanced_ecommerce' => '#enhanced-ecommerce',
- 'cpostnoindex' => '#use-noindex-for-paginated-pages-posts',
- 'cpostnofollow' => '#use-nofollow-for-paginated-pages-posts',
- 'noodp' => '#exclude-site-from-the-open-directory-project',
- 'noydir' => '#exclude-site-from-yahoo-directory',
- 'generate_descriptions' => '#autogenerate-descriptions',
- 'run_shortcodes' => '#run-shortcodes-in-autogenerated-descriptions',
+ $this->help_anchors = array(
+ 'license_key' => '#license-key',
+ 'can' => '#canonical-urls',
+ 'no_paged_canonical_links' => '#no-pagination-for-canonical-urls',
+ 'customize_canonical_links' => '#enable-custom-canonical-urls',
+ 'can_set_protocol' => '#set-protocol-for-canonical-urls',
+ 'use_original_title' => '#use-original-title',
+ 'schema_markup' => '#use-schema-markup',
+ 'do_log' => '#log-important-events',
+ 'home_title' => '#home-title',
+ 'home_description' => '#home-description',
+ 'home_keywords' => '#home-keywords',
+ 'use_static_home_info' => '#use-static-front-page-instead',
+ 'togglekeywords' => '#use-keywords',
+ 'use_categories' => '#use-categories-for-meta-keywords',
+ 'use_tags_as_keywords' => '#use-tags-for-meta-keywords',
+ 'dynamic_postspage_keywords' => '#dynamically-generate-keywords-for-posts-page',
+ 'rewrite_titles' => '#rewrite-titles',
+ 'cap_titles' => '#capitalize-titles',
+ 'cap_cats' => '#capitalize-titles',
+ 'home_page_title_format' => '#title-format-fields',
+ 'page_title_format' => '#title-format-fields',
+ 'post_title_format' => '#title-format-fields',
+ 'category_title_format' => '#title-format-fields',
+ 'archive_title_format' => '#title-format-fields',
+ 'date_title_format' => '#title-format-fields',
+ 'author_title_format' => '#title-format-fields',
+ 'tag_title_format' => '#title-format-fields',
+ 'search_title_format' => '#title-format-fields',
+ 'description_format' => '#title-format-fields',
+ '404_title_format' => '#title-format-fields',
+ 'paged_format' => '#title-format-fields',
+ 'enablecpost' => '#seo-for-custom-post-types',
+ 'cpostadvanced' => '#enable-advanced-options',
+ 'cpostactive' => '#seo-on-only-these-post-types',
+ 'taxactive' => '#seo-on-only-these-taxonomies',
+ 'cposttitles' => '#custom-titles',
+ 'posttypecolumns' => '#show-column-labels-for-custom-post-types',
+ 'admin_bar' => '#display-menu-in-admin-bar',
+ 'custom_menu_order' => '#display-menu-at-the-top',
+ 'google_verify' => '',
+ 'bing_verify' => '',
+ 'pinterest_verify' => '',
+ 'google_publisher' => '#google-plus-default-profile',
+ 'google_disable_profile' => '#disable-google-plus-profile',
+ 'google_sitelinks_search' => '#display-sitelinks-search-box',
+ 'google_set_site_name' => '#set-preferred-site-name',
+ 'google_author_advanced' => '#advanced-authorship-options',
+ 'google_author_location' => '#display-google-authorship',
+ 'google_enable_publisher' => '#display-publisher-meta-on-front-page',
+ 'google_specify_publisher' => '#specify-publisher-url',
+ 'google_analytics_id' => 'http://semperplugins.com/documentation/setting-up-google-analytics/',
+ 'ga_use_universal_analytics' => '#use-universal-analytics',
+ 'ga_domain' => '#tracking-domain',
+ 'ga_multi_domain' => '#track-multiple-domains-additional-domains',
+ 'ga_addl_domains' => '#track-multiple-domains-additional-domains',
+ 'ga_anonymize_ip' => '#anonymize-ip-addresses',
+ 'ga_display_advertising' => '#display-advertiser-tracking',
+ 'ga_exclude_users' => '#exclude-users-from-tracking',
+ 'ga_track_outbound_links' => '#track-outbound-links',
+ 'ga_link_attribution' => '#enhanced-link-attribution',
+ 'ga_enhanced_ecommerce' => '#enhanced-ecommerce',
+ 'cpostnoindex' => '#noindex',
+ 'cpostnofollow' => '#nofollow',
+ 'cpostnoodp' => '#noodp',
+ 'cpostnoydir' => '#noydir',
+ 'category_noindex' => '#noindex-settings',
+ 'archive_date_noindex' => '#noindex-settings',
+ 'archive_author_noindex' => '#noindex-settings',
+ 'tags_noindex' => '#noindex-settings',
+ 'search_noindex' => '#use-noindex-for-the-search-page',
+ '404_noindex' => '#use-noindex-for-the-404-page',
+ 'tax_noindex' => '#use-noindex-for-the-taxonomy-archives',
+ 'paginated_noindex' => '#use-noindex-for-paginated-pages-posts',
+ 'paginated_nofollow' => '#use-nofollow-for-paginated-pages-posts',
+ 'noodp' => '#exclude-site-from-the-open-directory-project',
+ 'noydir' => '#exclude-site-from-yahoo-directory',
+ 'skip_excerpt' => '#avoid-using-the-excerpt-in-descriptions',
+ 'generate_descriptions' => '#autogenerate-descriptions',
+ 'run_shortcodes' => '#run-shortcodes-in-autogenerated-descriptions',
'hide_paginated_descriptions' => '#remove-descriptions-for-paginated-pages',
- 'dont_truncate_descriptions' => '#never-shorten-long-descriptions',
- 'unprotect_meta' => '#unprotect-post-meta-fields',
- 'ex_pages' => '#exclude-pages',
- 'post_meta_tags' => '#additional-post-headers',
- 'page_meta_tags' => '#additional-page-headers',
- 'front_meta_tags' => '#additional-front-page-headers',
- 'home_meta_tags' => '#additional-blog-page-headers'
+ 'dont_truncate_descriptions' => '#never-shorten-long-descriptions',
+ 'unprotect_meta' => '#unprotect-post-meta-fields',
+ 'ex_pages' => '#exclude-pages',
+ 'post_meta_tags' => '#additional-post-headers',
+ 'page_meta_tags' => '#additional-page-headers',
+ 'front_meta_tags' => '#additional-front-page-headers',
+ 'home_meta_tags' => '#additional-blog-page-headers',
);
- $meta_help_text = Array(
- 'snippet' => __( 'A preview of what this page might look like in search engine results.', 'all-in-one-seo-pack' ),
- 'title' => __( 'A custom title that shows up in the title tag for this page.', 'all-in-one-seo-pack' ),
- 'description' => __( 'The META description for this page. This will override any autogenerated descriptions.', 'all-in-one-seo-pack' ),
- 'keywords' => __( 'A comma separated list of your most important keywords for this page that will be written as META keywords.', 'all-in-one-seo-pack' ),
- 'custom_link' => __( "Override the canonical URLs for this post.", 'all-in-one-seo-pack'),
- 'noindex' => __( 'Check this box to ask search engines not to index this page.', 'all-in-one-seo-pack' ),
- 'nofollow' => __( 'Check this box to ask search engines not to follow links from this page.', 'all-in-one-seo-pack' ),
- 'noodp' => __( 'Check this box to ask search engines not to use descriptions from the Open Directory Project for this page.', 'all-in-one-seo-pack' ),
- 'noydir' => __( 'Check this box to ask Yahoo! not to use descriptions from the Yahoo! directory for this page.', 'all-in-one-seo-pack' ),
- 'titleatr' => __( 'Set the title attribute for menu links.', 'all-in-one-seo-pack' ),
- 'menulabel' => __( 'Set the label for this page menu item.', 'all-in-one-seo-pack' ),
- 'sitemap_exclude' => __( "Don't display this page in the sitemap.", 'all-in-one-seo-pack' ),
- 'disable' => __( 'Disable SEO on this page.', 'all-in-one-seo-pack' ),
- 'disable_analytics' => __( 'Disable Google Analytics on this page.', 'all-in-one-seo-pack' )
+ $meta_help_text = array(
+ 'snippet' => __( 'A preview of what this page might look like in search engine results.', 'all-in-one-seo-pack' ),
+ 'title' => __( 'A custom title that shows up in the title tag for this page.', 'all-in-one-seo-pack' ),
+ 'description' => __( 'The META description for this page. This will override any autogenerated descriptions.', 'all-in-one-seo-pack' ),
+ 'keywords' => __( 'A comma separated list of your most important keywords for this page that will be written as META keywords.', 'all-in-one-seo-pack' ),
+ 'custom_link' => __( 'Override the canonical URLs for this post.', 'all-in-one-seo-pack' ),
+ 'noindex' => __( 'Check this box to ask search engines not to index this page.', 'all-in-one-seo-pack' ),
+ 'nofollow' => __( 'Check this box to ask search engines not to follow links from this page.', 'all-in-one-seo-pack' ),
+ 'noodp' => __( 'Check this box to ask search engines not to use descriptions from the Open Directory Project for this page.', 'all-in-one-seo-pack' ),
+ 'noydir' => __( 'Check this box to ask Yahoo! not to use descriptions from the Yahoo! directory for this page.', 'all-in-one-seo-pack' ),
+ 'titleatr' => __( 'Set the title attribute for menu links.', 'all-in-one-seo-pack' ),
+ 'menulabel' => __( 'Set the label for this page menu item.', 'all-in-one-seo-pack' ),
+ 'sitemap_exclude' => __( "Don't display this page in the sitemap.", 'all-in-one-seo-pack' ),
+ 'disable' => __( 'Disable SEO on this page.', 'all-in-one-seo-pack' ),
+ 'disable_analytics' => __( 'Disable Google Analytics on this page.', 'all-in-one-seo-pack' ),
);
$this->default_options = array(
- "license_key" => Array(
+ 'license_key' => array(
'name' => __( 'License Key:', 'all-in-one-seo-pack' ),
- 'type' => 'text' ),
- "donate" => Array(
- 'name' => __( 'I enjoy this plugin and have made a donation:', 'all-in-one-seo-pack' ) ),
- "home_title"=> Array(
- 'name' => __( 'Home Title:', 'all-in-one-seo-pack' ),
- 'default' => null, 'type' => 'textarea', 'sanitize' => 'text',
- 'count' => true, 'rows' => 1, 'cols' => 60,
- 'condshow' => Array( "aiosp_use_static_home_info" => 0 ) ),
- "home_description"=> Array(
- 'name' => __( 'Home Description:', 'all-in-one-seo-pack' ),
- 'default' => '', 'type' => 'textarea', 'sanitize' => 'text',
- 'count' => true, 'cols' => 80, 'rows' => 2,
- 'condshow' => Array( "aiosp_use_static_home_info" => 0 ) ),
- "togglekeywords" => Array(
- 'name' => __( 'Use Keywords:', 'all-in-one-seo-pack' ),
- 'default' => 1,
- 'type' => 'radio',
- 'initial_options' => Array( 0 => __( 'Enabled', 'all-in-one-seo-pack' ),
- 1 => __( 'Disabled', 'all-in-one-seo-pack' ) )
- ),
- "home_keywords"=> Array(
- 'name' => __( 'Home Keywords (comma separated):', 'all-in-one-seo-pack' ),
- 'default' => null, 'type' => 'textarea', 'sanitize' => 'text',
- 'condshow' => Array( "aiosp_togglekeywords" => 0, "aiosp_use_static_home_info" => 0 ) ),
- "use_static_home_info" => Array(
- 'name' => __( "Use Static Front Page Instead", 'all-in-one-seo-pack' ),
- 'default' => 0,
- 'type' => 'radio',
- 'initial_options' => Array( 1 => __( 'Enabled', 'all-in-one-seo-pack' ),
- 0 => __( 'Disabled', 'all-in-one-seo-pack' ) )
- ),
- "can"=> Array(
- 'name' => __( 'Canonical URLs:', 'all-in-one-seo-pack' ),
- 'default' => 1),
- "no_paged_canonical_links"=> Array(
- 'name' => __( 'No Pagination for Canonical URLs:', 'all-in-one-seo-pack' ),
- 'default' => 0,
- 'condshow' => Array( "aiosp_can" => 'on' ) ),
- "customize_canonical_links" => Array(
- 'name' => __( 'Enable Custom Canonical URLs:', 'all-in-one-seo-pack' ),
- 'default' => 0,
- 'condshow' => Array( "aiosp_can" => 'on' ) ),
- "can_set_protocol" => Array(
- 'name' => __( 'Set Protocol For Canonical URLs:', 'all-in-one-seo-pack' ),
- 'type' => 'radio',
- 'default' => 'auto',
- 'initial_options' => Array( 'auto' => __( 'Auto', 'all-in-one-seo-pack' ),
- 'http' => __( 'HTTP', 'all-in-one-seo-pack' ),
- 'https' => __( 'HTTPS', 'all-in-one-seo-pack' ) ),
- 'condshow' => Array( "aiosp_can" => 'on' )
+ 'type' => 'text',
+ ),
+ 'donate' => array(
+ 'name' => __( 'I enjoy this plugin and have made a donation:', 'all-in-one-seo-pack' ),
+ ),
+ 'home_title' => array(
+ 'name' => __( 'Home Title:', 'all-in-one-seo-pack' ),
+ 'default' => null,
+ 'type' => 'textarea',
+ 'sanitize' => 'text',
+ 'count' => true,
+ 'rows' => 1,
+ 'cols' => 60,
+ 'condshow' => array( 'aiosp_use_static_home_info' => 0 ),
+ ),
+ 'home_description' => array(
+ 'name' => __( 'Home Description:', 'all-in-one-seo-pack' ),
+ 'default' => '',
+ 'type' => 'textarea',
+ 'sanitize' => 'text',
+ 'count' => true,
+ 'cols' => 80,
+ 'rows' => 2,
+ 'condshow' => array( 'aiosp_use_static_home_info' => 0 ),
+ ),
+ 'togglekeywords' => array(
+ 'name' => __( 'Use Keywords:', 'all-in-one-seo-pack' ),
+ 'default' => 1,
+ 'type' => 'radio',
+ 'initial_options' => array(
+ 0 => __( 'Enabled', 'all-in-one-seo-pack' ),
+ 1 => __( 'Disabled', 'all-in-one-seo-pack' ),
),
- "rewrite_titles"=> Array(
- 'name' => __( 'Rewrite Titles:', 'all-in-one-seo-pack' ),
- 'default' => 1,
- 'type' => 'radio',
- 'initial_options' => Array( 1 => __( 'Enabled', 'all-in-one-seo-pack' ),
- 0 => __( 'Disabled', 'all-in-one-seo-pack' ) )
+ ),
+ 'home_keywords' => array(
+ 'name' => __( 'Home Keywords (comma separated):', 'all-in-one-seo-pack' ),
+ 'default' => null,
+ 'type' => 'textarea',
+ 'sanitize' => 'text',
+ 'condshow' => array( 'aiosp_togglekeywords' => 0, 'aiosp_use_static_home_info' => 0 ),
+ ),
+ 'use_static_home_info' => array(
+ 'name' => __( 'Use Static Front Page Instead', 'all-in-one-seo-pack' ),
+ 'default' => 0,
+ 'type' => 'radio',
+ 'initial_options' => array(
+ 1 => __( 'Enabled', 'all-in-one-seo-pack' ),
+ 0 => __( 'Disabled', 'all-in-one-seo-pack' ),
),
- "force_rewrites"=> Array(
- 'name' => __( 'Force Rewrites:', 'all-in-one-seo-pack' ),
+ ),
+ 'can' => array(
+ 'name' => __( 'Canonical URLs:', 'all-in-one-seo-pack' ),
'default' => 1,
- 'type' => 'hidden',
- 'prefix' => $this->prefix,
- 'initial_options' => Array( 1 => __( 'Enabled', 'all-in-one-seo-pack' ),
- 0 => __( 'Disabled', 'all-in-one-seo-pack' ) )
+ ),
+ 'no_paged_canonical_links' => array(
+ 'name' => __( 'No Pagination for Canonical URLs:', 'all-in-one-seo-pack' ),
+ 'default' => 0,
+ 'condshow' => array( 'aiosp_can' => 'on' ),
+ ),
+ 'customize_canonical_links' => array(
+ 'name' => __( 'Enable Custom Canonical URLs:', 'all-in-one-seo-pack' ),
+ 'default' => 0,
+ 'condshow' => array( 'aiosp_can' => 'on' ),
+ ),
+ 'can_set_protocol' => array(
+ 'name' => __( 'Set Protocol For Canonical URLs:', 'all-in-one-seo-pack' ),
+ 'type' => 'radio',
+ 'default' => 'auto',
+ 'initial_options' => array(
+ 'auto' => __( 'Auto', 'all-in-one-seo-pack' ),
+ 'http' => __( 'HTTP', 'all-in-one-seo-pack' ),
+ 'https' => __( 'HTTPS', 'all-in-one-seo-pack' ),
),
- "use_original_title"=> Array(
- 'name' => __( 'Use Original Title:', 'all-in-one-seo-pack' ),
- 'type' => 'radio',
- 'default' => 0,
- 'initial_options' => Array( 1 => __( 'Enabled', 'all-in-one-seo-pack' ),
- 0 => __( 'Disabled', 'all-in-one-seo-pack' ) )
+ 'condshow' => array( 'aiosp_can' => 'on' ),
+ ),
+ 'rewrite_titles' => array(
+ 'name' => __( 'Rewrite Titles:', 'all-in-one-seo-pack' ),
+ 'default' => 1,
+ 'type' => 'radio',
+ 'initial_options' => array(
+ 1 => __( 'Enabled', 'all-in-one-seo-pack' ),
+ 0 => __( 'Disabled', 'all-in-one-seo-pack' ),
),
- "cap_titles"=> Array(
- 'name' => __( 'Capitalize Tag and Search Titles:', 'all-in-one-seo-pack' ), 'default' => 1),
- "cap_cats"=> Array(
- 'name' => __( 'Capitalize Category Titles:', 'all-in-one-seo-pack' ), 'default' => 1),
- "home_page_title_format"=> Array(
- 'name' => __( 'Home Page Title Format:', 'all-in-one-seo-pack' ),
- 'type' => 'text', 'default' => '%page_title%',
- 'condshow' => Array( "aiosp_rewrite_titles" => 1 ) ),
- "page_title_format"=> Array(
- 'name' => __( 'Page Title Format:', 'all-in-one-seo-pack' ),
- 'type' => 'text', 'default' => '%page_title% | %blog_title%',
- 'condshow' => Array( "aiosp_rewrite_titles" => 1 ) ),
- "post_title_format"=> Array(
- 'name' => __( 'Post Title Format:', 'all-in-one-seo-pack' ),
- 'type' => 'text', 'default' => '%post_title% | %blog_title%',
- 'condshow' => Array( "aiosp_rewrite_titles" => 1 ) ),
- "category_title_format"=> Array(
- 'name' => __( 'Category Title Format:', 'all-in-one-seo-pack' ),
- 'type' => 'text', 'default' => '%category_title% | %blog_title%',
- 'condshow' => Array( "aiosp_rewrite_titles" => 1 ) ),
- "archive_title_format"=> Array(
- 'name' => __( 'Archive Title Format:', 'all-in-one-seo-pack' ),
- 'type' => 'text', 'default' => '%archive_title% | %blog_title%',
- 'condshow' => Array( "aiosp_rewrite_titles" => 1 ) ),
- "date_title_format"=> Array(
- 'name' => __( 'Date Archive Title Format:', 'all-in-one-seo-pack' ),
- 'type' => 'text', 'default' => '%date% | %blog_title%',
- 'condshow' => Array( "aiosp_rewrite_titles" => 1 ) ),
- "author_title_format"=> Array(
- 'name' => __( 'Author Archive Title Format:', 'all-in-one-seo-pack' ),
- 'type' => 'text', 'default' => '%author% | %blog_title%',
- 'condshow' => Array( "aiosp_rewrite_titles" => 1 ) ),
- "tag_title_format"=> Array(
- 'name' => __( 'Tag Title Format:', 'all-in-one-seo-pack' ),
- 'type' => 'text', 'default' => '%tag% | %blog_title%',
- 'condshow' => Array( "aiosp_rewrite_titles" => 1 ) ),
- "search_title_format"=> Array(
- 'name' => __( 'Search Title Format:', 'all-in-one-seo-pack' ),
- 'type' => 'text', 'default' => '%search% | %blog_title%',
- 'condshow' => Array( "aiosp_rewrite_titles" => 1 ) ),
- "description_format"=> Array(
- 'name' => __( 'Description Format', 'all-in-one-seo-pack' ),
- 'type' => 'text', 'default' => '%description%',
- 'condshow' => Array( "aiosp_rewrite_titles" => 1 ) ),
- "404_title_format"=> Array(
- 'name' => __( '404 Title Format:', 'all-in-one-seo-pack' ),
- 'type' => 'text', 'default' => 'Nothing found for %request_words%',
- 'condshow' => Array( "aiosp_rewrite_titles" => 1 ) ),
- "paged_format"=> Array(
- 'name' => __( 'Paged Format:', 'all-in-one-seo-pack' ),
- 'type' => 'text', 'default' => ' - Part %page%',
- 'condshow' => Array( "aiosp_rewrite_titles" => 1 ) ),
- "enablecpost"=> Array(
- 'name' => __( 'SEO for Custom Post Types:', 'all-in-one-seo-pack' ),
- 'default' => 'on',
- 'type' => 'radio',
- 'initial_options' => Array( 'on' => __( 'Enabled', 'all-in-one-seo-pack' ),
- 0 => __( 'Disabled', 'all-in-one-seo-pack' ) )
+ ),
+ 'force_rewrites' => array(
+ 'name' => __( 'Force Rewrites:', 'all-in-one-seo-pack' ),
+ 'default' => 1,
+ 'type' => 'hidden',
+ 'prefix' => $this->prefix,
+ 'initial_options' => array(
+ 1 => __( 'Enabled', 'all-in-one-seo-pack' ),
+ 0 => __( 'Disabled', 'all-in-one-seo-pack' ),
),
- "cpostactive" => Array(
- 'name' => __( 'SEO on only these post types:', 'all-in-one-seo-pack' ),
- 'type' => 'multicheckbox', 'default' => array('post', 'page'),
- 'condshow' => Array( 'aiosp_enablecpost' => 'on' )
+ ),
+ 'use_original_title' => array(
+ 'name' => __( 'Use Original Title:', 'all-in-one-seo-pack' ),
+ 'type' => 'radio',
+ 'default' => 0,
+ 'initial_options' => array(
+ 1 => __( 'Enabled', 'all-in-one-seo-pack' ),
+ 0 => __( 'Disabled', 'all-in-one-seo-pack' ),
),
- "taxactive" => Array(
- 'name' => __( 'SEO on only these taxonomies:', 'all-in-one-seo-pack' ),
- 'type' => 'multicheckbox', 'default' => array('category', 'post_tag'),
- 'condshow' => Array( 'aiosp_enablecpost' => 'on' )
+ ),
+ 'cap_titles' => array(
+ 'name' => __( 'Capitalize Tag and Search Titles:', 'all-in-one-seo-pack' ),
+ 'default' => 1,
+ ),
+ 'cap_cats' => array(
+ 'name' => __( 'Capitalize Category Titles:', 'all-in-one-seo-pack' ),
+ 'default' => 1,
+ ),
+ 'home_page_title_format' => array(
+ 'name' => __( 'Home Page Title Format:', 'all-in-one-seo-pack' ),
+ 'type' => 'text',
+ 'default' => '%page_title%',
+ 'condshow' => array( 'aiosp_rewrite_titles' => 1 ),
+ ),
+ 'page_title_format' => array(
+ 'name' => __( 'Page Title Format:', 'all-in-one-seo-pack' ),
+ 'type' => 'text',
+ 'default' => '%page_title% | %blog_title%',
+ 'condshow' => array( 'aiosp_rewrite_titles' => 1 ),
+ ),
+ 'post_title_format' => array(
+ 'name' => __( 'Post Title Format:', 'all-in-one-seo-pack' ),
+ 'type' => 'text',
+ 'default' => '%post_title% | %blog_title%',
+ 'condshow' => array( 'aiosp_rewrite_titles' => 1 ),
+ ),
+ 'category_title_format' => array(
+ 'name' => __( 'Category Title Format:', 'all-in-one-seo-pack' ),
+ 'type' => 'text',
+ 'default' => '%category_title% | %blog_title%',
+ 'condshow' => array( 'aiosp_rewrite_titles' => 1 ),
+ ),
+ 'archive_title_format' => array(
+ 'name' => __( 'Archive Title Format:', 'all-in-one-seo-pack' ),
+ 'type' => 'text',
+ 'default' => '%archive_title% | %blog_title%',
+ 'condshow' => array( 'aiosp_rewrite_titles' => 1 ),
+ ),
+ 'date_title_format' => array(
+ 'name' => __( 'Date Archive Title Format:', 'all-in-one-seo-pack' ),
+ 'type' => 'text',
+ 'default' => '%date% | %blog_title%',
+ 'condshow' => array( 'aiosp_rewrite_titles' => 1 ),
+ ),
+ 'author_title_format' => array(
+ 'name' => __( 'Author Archive Title Format:', 'all-in-one-seo-pack' ),
+ 'type' => 'text',
+ 'default' => '%author% | %blog_title%',
+ 'condshow' => array( 'aiosp_rewrite_titles' => 1 ),
+ ),
+ 'tag_title_format' => array(
+ 'name' => __( 'Tag Title Format:', 'all-in-one-seo-pack' ),
+ 'type' => 'text',
+ 'default' => '%tag% | %blog_title%',
+ 'condshow' => array( 'aiosp_rewrite_titles' => 1 ),
+ ),
+ 'search_title_format' => array(
+ 'name' => __( 'Search Title Format:', 'all-in-one-seo-pack' ),
+ 'type' => 'text',
+ 'default' => '%search% | %blog_title%',
+ 'condshow' => array( 'aiosp_rewrite_titles' => 1 ),
+ ),
+ 'description_format' => array(
+ 'name' => __( 'Description Format', 'all-in-one-seo-pack' ),
+ 'type' => 'text',
+ 'default' => '%description%',
+ 'condshow' => array( 'aiosp_rewrite_titles' => 1 ),
+ ),
+ '404_title_format' => array(
+ 'name' => __( '404 Title Format:', 'all-in-one-seo-pack' ),
+ 'type' => 'text',
+ 'default' => 'Nothing found for %request_words%',
+ 'condshow' => array( 'aiosp_rewrite_titles' => 1 ),
+ ),
+ 'paged_format' => array(
+ 'name' => __( 'Paged Format:', 'all-in-one-seo-pack' ),
+ 'type' => 'text',
+ 'default' => ' - Part %page%',
+ 'condshow' => array( 'aiosp_rewrite_titles' => 1 ),
+ ),
+ 'enablecpost' => array(
+ 'name' => __( 'SEO for Custom Post Types:', 'all-in-one-seo-pack' ),
+ 'default' => 'on',
+ 'type' => 'radio',
+ 'initial_options' => array(
+ 'on' => __( 'Enabled', 'all-in-one-seo-pack' ),
+ 0 => __( 'Disabled', 'all-in-one-seo-pack' ),
),
- "cpostadvanced" => Array(
- 'name' => __( 'Enable Advanced Options:', 'all-in-one-seo-pack' ),
- 'default' => 0, 'type' => 'radio',
- 'initial_options' => Array( 'on' => __( 'Enabled', 'all-in-one-seo-pack' ),
- 0 => __( 'Disabled', 'all-in-one-seo-pack' ) ),
- 'label' => null,
- 'condshow' => Array( "aiosp_enablecpost" => 'on' )
+ ),
+ 'cpostactive' => array(
+ 'name' => __( 'SEO on only these post types:', 'all-in-one-seo-pack' ),
+ 'type' => 'multicheckbox',
+ 'default' => array( 'post', 'page' ),
+ 'condshow' => array( 'aiosp_enablecpost' => 'on' ),
+ ),
+ 'taxactive' => array(
+ 'name' => __( 'SEO on only these taxonomies:', 'all-in-one-seo-pack' ),
+ 'type' => 'multicheckbox',
+ 'default' => array( 'category', 'post_tag' ),
+ 'condshow' => array( 'aiosp_enablecpost' => 'on' ),
+ ),
+ 'cpostadvanced' => array(
+ 'name' => __( 'Enable Advanced Options:', 'all-in-one-seo-pack' ),
+ 'default' => 0,
+ 'type' => 'radio',
+ 'initial_options' => array(
+ 'on' => __( 'Enabled', 'all-in-one-seo-pack' ),
+ 0 => __( 'Disabled', 'all-in-one-seo-pack' ),
),
- "cpostnoindex" => Array(
- 'name' => __( 'Default to NOINDEX:', 'all-in-one-seo-pack' ),
- 'type' => 'multicheckbox', 'default' => array(),
+ 'label' => null,
+ 'condshow' => array( 'aiosp_enablecpost' => 'on' ),
+ ),
+ 'cpostnoindex' => array(
+ 'name' => __( 'Default to NOINDEX:', 'all-in-one-seo-pack' ),
+ 'type' => 'multicheckbox',
+ 'default' => array(),
+ ),
+ 'cpostnofollow' => array(
+ 'name' => __( 'Default to NOFOLLOW:', 'all-in-one-seo-pack' ),
+ 'type' => 'multicheckbox',
+ 'default' => array(),
+ ),
+ 'cpostnoodp' => array(
+ 'name' => __( 'Default to NOODP:', 'all-in-one-seo-pack' ),
+ 'type' => 'multicheckbox',
+ 'default' => array(),
+ ),
+ 'cpostnoydir' => array(
+ 'name' => __( 'Default to NOYDIR:', 'all-in-one-seo-pack' ),
+ 'type' => 'multicheckbox',
+ 'default' => array(),
+ ),
+ 'cposttitles' => array(
+ 'name' => __( 'Custom titles:', 'all-in-one-seo-pack' ),
+ 'type' => 'checkbox',
+ 'default' => 0,
+ 'condshow' => array(
+ 'aiosp_rewrite_titles' => 1,
+ 'aiosp_enablecpost' => 'on',
+ 'aiosp_cpostadvanced' => 'on',
),
- "cpostnofollow" => Array(
- 'name' => __( 'Default to NOFOLLOW:', 'all-in-one-seo-pack' ),
- 'type' => 'multicheckbox', 'default' => array(),
+ ),
+ 'posttypecolumns' => array(
+ 'name' => __( 'Show Column Labels for Custom Post Types:', 'all-in-one-seo-pack' ),
+ 'type' => 'multicheckbox',
+ 'default' => array( 'post', 'page' ),
+ 'condshow' => array( 'aiosp_enablecpost' => 'on' ),
+ ),
+ 'admin_bar' => array(
+ 'name' => __( 'Display Menu In Admin Bar:', 'all-in-one-seo-pack' ),
+ 'default' => 'on',
+ ),
+ 'custom_menu_order' => array(
+ 'name' => __( 'Display Menu At The Top:', 'all-in-one-seo-pack' ),
+ 'default' => 'on',
+ ),
+ 'google_verify' => array(
+ 'name' => __( 'Google Webmaster Tools:', 'all-in-one-seo-pack' ),
+ 'default' => '',
+ 'type' => 'text',
+ ),
+ 'bing_verify' => array(
+ 'name' => __( 'Bing Webmaster Center:', 'all-in-one-seo-pack' ),
+ 'default' => '',
+ 'type' => 'text',
+ ),
+ 'pinterest_verify' => array(
+ 'name' => __( 'Pinterest Site Verification:', 'all-in-one-seo-pack' ),
+ 'default' => '',
+ 'type' => 'text',
+ ),
+ 'google_publisher' => array(
+ 'name' => __( 'Google Plus Default Profile:', 'all-in-one-seo-pack' ),
+ 'default' => '',
+ 'type' => 'text',
+ ),
+ 'google_disable_profile' => array(
+ 'name' => __( 'Disable Google Plus Profile:', 'all-in-one-seo-pack' ),
+ 'default' => 0,
+ 'type' => 'checkbox',
+ ),
+ 'google_sitelinks_search' => array(
+ 'name' => __( 'Display Sitelinks Search Box:', 'all-in-one-seo-pack' ),
+ ),
+ 'google_set_site_name' => array(
+ 'name' => __( 'Set Preferred Site Name:', 'all-in-one-seo-pack' ),
+ ),
+ 'google_specify_site_name' => array(
+ 'name' => __( 'Specify A Preferred Name:', 'all-in-one-seo-pack' ),
+ 'type' => 'text',
+ 'placeholder' => $blog_name,
+ 'condshow' => array( 'aiosp_google_set_site_name' => 'on' ),
+ ),
+ 'google_author_advanced' => array(
+ 'name' => __( 'Advanced Authorship Options:', 'all-in-one-seo-pack' ),
+ 'default' => 0,
+ 'type' => 'radio',
+ 'initial_options' => array(
+ 'on' => __( 'Enabled', 'all-in-one-seo-pack' ),
+ 0 => __( 'Disabled', 'all-in-one-seo-pack' ),
),
- "cpostnoodp"=> Array(
- 'name' => __( 'Default to NOODP:', 'all-in-one-seo-pack' ),
- 'type' => 'multicheckbox', 'default' => array(),
+ 'label' => null,
+ ),
+ 'google_author_location' => array(
+ 'name' => __( 'Display Google Authorship:', 'all-in-one-seo-pack' ),
+ 'default' => array( 'all' ),
+ 'type' => 'multicheckbox',
+ 'condshow' => array( 'aiosp_google_author_advanced' => 'on' ),
+ ),
+ 'google_enable_publisher' => array(
+ 'name' => __( 'Display Publisher Meta on Front Page:', 'all-in-one-seo-pack' ),
+ 'default' => 'on',
+ 'type' => 'radio',
+ 'initial_options' => array(
+ 'on' => __( 'Enabled', 'all-in-one-seo-pack' ),
+ 0 => __( 'Disabled', 'all-in-one-seo-pack' ),
),
- "cpostnoydir"=> Array(
- 'name' => __( 'Default to NOYDIR:', 'all-in-one-seo-pack' ),
- 'type' => 'multicheckbox', 'default' => array(),
+ 'condshow' => array( 'aiosp_google_author_advanced' => 'on' ),
+ ),
+ 'google_specify_publisher' => array(
+ 'name' => __( 'Specify Publisher URL:', 'all-in-one-seo-pack' ),
+ 'type' => 'text',
+ 'condshow' => array( 'aiosp_google_author_advanced' => 'on', 'aiosp_google_enable_publisher' => 'on' ),
+ ),
+ // "google_connect"=>array( 'name' => __( 'Connect With Google Analytics', 'all-in-one-seo-pack' ), ),
+ 'google_analytics_id' => array(
+ 'name' => __( 'Google Analytics ID:', 'all-in-one-seo-pack' ),
+ 'default' => null,
+ 'type' => 'text',
+ 'placeholder' => 'UA-########-#',
+ ),
+ 'ga_use_universal_analytics' => array(
+ 'name' => __( 'Use Universal Analytics:', 'all-in-one-seo-pack' ),
+ 'default' => 0,
+ 'condshow' => array(
+ 'aiosp_google_analytics_id' => array(
+ 'lhs' => 'aiosp_google_analytics_id',
+ 'op' => '!=',
+ 'rhs' => '',
+ ),
),
- "cposttitles" => Array(
- 'name' => __( 'Custom titles:', 'all-in-one-seo-pack' ),
- 'type' => 'checkbox', 'default' => 0,
- 'condshow' => Array( "aiosp_rewrite_titles" => 1, 'aiosp_enablecpost' => 'on', 'aiosp_cpostadvanced' => 'on' )
+ ),
+ 'ga_advanced_options' => array(
+ 'name' => __( 'Advanced Analytics Options:', 'all-in-one-seo-pack' ),
+ 'default' => 'on',
+ 'type' => 'radio',
+ 'initial_options' => array(
+ 'on' => __( 'Enabled', 'all-in-one-seo-pack' ),
+ 0 => __( 'Disabled', 'all-in-one-seo-pack' ),
),
- "posttypecolumns" => Array(
- 'name' => __( 'Show Column Labels for Custom Post Types:', 'all-in-one-seo-pack' ),
- 'type' => 'multicheckbox', 'default' => array('post', 'page'),
- 'condshow' => Array( 'aiosp_enablecpost' => 'on' ) ),
- "admin_bar" => Array(
- 'name' => __( 'Display Menu In Admin Bar:', 'all-in-one-seo-pack' ), 'default' => 'on',
+ 'condshow' => array(
+ 'aiosp_google_analytics_id' => array(
+ 'lhs' => 'aiosp_google_analytics_id',
+ 'op' => '!=',
+ 'rhs' => '',
+ ),
),
- "custom_menu_order" => Array(
- 'name' => __( 'Display Menu At The Top:', 'all-in-one-seo-pack' ), 'default' => 'on',
+ ),
+ 'ga_domain' => array(
+ 'name' => __( 'Tracking Domain:', 'all-in-one-seo-pack' ),
+ 'type' => 'text',
+ 'condshow' => array(
+ 'aiosp_google_analytics_id' => array(
+ 'lhs' => 'aiosp_google_analytics_id',
+ 'op' => '!=',
+ 'rhs' => '',
+ ),
+ 'aiosp_ga_advanced_options' => 'on',
),
- "google_verify" => Array(
- 'name' => __( 'Google Webmaster Tools:', 'all-in-one-seo-pack' ), 'default' => '', 'type' => 'text'
+ ),
+ 'ga_multi_domain' => array(
+ 'name' => __( 'Track Multiple Domains:', 'all-in-one-seo-pack' ),
+ 'default' => 0,
+ 'condshow' => array(
+ 'aiosp_google_analytics_id' => array(
+ 'lhs' => 'aiosp_google_analytics_id',
+ 'op' => '!=',
+ 'rhs' => '',
+ ),
+ 'aiosp_ga_advanced_options' => 'on',
),
- "bing_verify" => Array(
- 'name' => __( 'Bing Webmaster Center:', 'all-in-one-seo-pack' ), 'default' => '', 'type' => 'text'
+ ),
+ 'ga_addl_domains' => array(
+ 'name' => __( 'Additional Domains:', 'all-in-one-seo-pack' ),
+ 'type' => 'textarea',
+ 'condshow' => array(
+ 'aiosp_google_analytics_id' => array(
+ 'lhs' => 'aiosp_google_analytics_id',
+ 'op' => '!=',
+ 'rhs' => '',
+ ),
+ 'aiosp_ga_advanced_options' => 'on',
+ 'aiosp_ga_multi_domain' => 'on',
),
- "pinterest_verify" => Array(
- 'name' => __( 'Pinterest Site Verification:', 'all-in-one-seo-pack' ), 'default' => '', 'type' => 'text'
+ ),
+ 'ga_anonymize_ip' => array(
+ 'name' => __( 'Anonymize IP Addresses:', 'all-in-one-seo-pack' ),
+ 'type' => 'checkbox',
+ 'condshow' => array(
+ 'aiosp_google_analytics_id' => array(
+ 'lhs' => 'aiosp_google_analytics_id',
+ 'op' => '!=',
+ 'rhs' => '',
+ ),
+ 'aiosp_ga_advanced_options' => 'on',
),
- "google_publisher"=> Array(
- 'name' => __( 'Google Plus Default Profile:', 'all-in-one-seo-pack' ), 'default' => '', 'type' => 'text'
+ ),
+ 'ga_display_advertising' => array(
+ 'name' => __( 'Display Advertiser Tracking:', 'all-in-one-seo-pack' ),
+ 'type' => 'checkbox',
+ 'condshow' => array(
+ 'aiosp_google_analytics_id' => array(
+ 'lhs' => 'aiosp_google_analytics_id',
+ 'op' => '!=',
+ 'rhs' => '',
+ ),
+ 'aiosp_ga_advanced_options' => 'on',
),
- "google_disable_profile"=> Array(
- 'name' => __( 'Disable Google Plus Profile:', 'all-in-one-seo-pack' ), 'default' => 0, 'type' => 'checkbox'
+ ),
+ 'ga_exclude_users' => array(
+ 'name' => __( 'Exclude Users From Tracking:', 'all-in-one-seo-pack' ),
+ 'type' => 'multicheckbox',
+ 'condshow' => array(
+ 'aiosp_google_analytics_id' => array(
+ 'lhs' => 'aiosp_google_analytics_id',
+ 'op' => '!=',
+ 'rhs' => '',
+ ),
+ 'aiosp_ga_advanced_options' => 'on',
),
- "google_sitelinks_search" => Array(
- 'name' => __( 'Display Sitelinks Search Box:', 'all-in-one-seo-pack' )
- ),
- "google_set_site_name" => Array(
- 'name' => __( 'Set Preferred Site Name:', 'all-in-one-seo-pack' )
- ),
- "google_specify_site_name" => Array(
- 'name' => __( 'Specify A Preferred Name:', 'all-in-one-seo-pack' ),
- 'type' => 'text',
- 'placeholder' => $blog_name,
- 'condshow' => Array( 'aiosp_google_set_site_name' => 'on' )
- ),
- "google_author_advanced" => Array(
- 'name' => __( 'Advanced Authorship Options:', 'all-in-one-seo-pack' ),
- 'default' => 0, 'type' => 'radio',
- 'initial_options' => Array( 'on' => __( 'Enabled', 'all-in-one-seo-pack' ),
- 0 => __( 'Disabled', 'all-in-one-seo-pack' ) ),
- 'label' => null
+ ),
+ 'ga_track_outbound_links' => array(
+ 'name' => __( 'Track Outbound Links:', 'all-in-one-seo-pack' ),
+ 'default' => 0,
+ 'condshow' => array(
+ 'aiosp_google_analytics_id' => array(
+ 'lhs' => 'aiosp_google_analytics_id',
+ 'op' => '!=',
+ 'rhs' => '',
),
- "google_author_location"=> Array(
- 'name' => __( 'Display Google Authorship:', 'all-in-one-seo-pack' ), 'default' => array( 'all' ), 'type' => 'multicheckbox',
- 'condshow' => Array( 'aiosp_google_author_advanced' => 'on' )
+ 'aiosp_ga_advanced_options' => 'on',
),
- "google_enable_publisher" => Array(
- 'name' => __( 'Display Publisher Meta on Front Page:', 'all-in-one-seo-pack' ),
- 'default' => 'on', 'type' => 'radio',
- 'initial_options' => Array( 'on' => __( 'Enabled', 'all-in-one-seo-pack' ),
- 0 => __( 'Disabled', 'all-in-one-seo-pack' ) ),
- 'condshow' => Array( 'aiosp_google_author_advanced' => 'on' )
+ ),
+ 'ga_link_attribution' => array(
+ 'name' => __( 'Enhanced Link Attribution:', 'all-in-one-seo-pack' ),
+ 'default' => 0,
+ 'condshow' => array(
+ 'aiosp_google_analytics_id' => array(
+ 'lhs' => 'aiosp_google_analytics_id',
+ 'op' => '!=',
+ 'rhs' => '',
+ ),
+ 'aiosp_ga_advanced_options' => 'on',
),
- "google_specify_publisher" => Array(
- 'name' => __( 'Specify Publisher URL:', 'all-in-one-seo-pack' ), 'type' => 'text',
- 'condshow' => Array( 'aiosp_google_author_advanced' => 'on', 'aiosp_google_enable_publisher' => 'on' )
+ ),
+ 'ga_enhanced_ecommerce' => array(
+ 'name' => __( 'Enhanced Ecommerce:', 'all-in-one-seo-pack' ),
+ 'default' => 0,
+ 'condshow' => array(
+ 'aiosp_google_analytics_id' => array(
+ 'lhs' => 'aiosp_google_analytics_id',
+ 'op' => '!=',
+ 'rhs' => '',
+ ),
+ 'aiosp_ga_use_universal_analytics' => 'on',
+ 'aiosp_ga_advanced_options' => 'on',
),
-// "google_connect"=>Array( 'name' => __( 'Connect With Google Analytics', 'all-in-one-seo-pack' ), ),
- "google_analytics_id"=> Array(
- 'name' => __( 'Google Analytics ID:', 'all-in-one-seo-pack' ),
- 'default' => null, 'type' => 'text', 'placeholder' => 'UA-########-#' ),
- "ga_use_universal_analytics" => Array(
- 'name' => __( 'Use Universal Analytics:', 'all-in-one-seo-pack' ),
+ ),
+ 'use_categories' => array(
+ 'name' => __( 'Use Categories for META keywords:', 'all-in-one-seo-pack' ),
+ 'default' => 0,
+ 'condshow' => array( 'aiosp_togglekeywords' => 0 ),
+ ),
+ 'use_tags_as_keywords' => array(
+ 'name' => __( 'Use Tags for META keywords:', 'all-in-one-seo-pack' ),
+ 'default' => 1,
+ 'condshow' => array( 'aiosp_togglekeywords' => 0 ),
+ ),
+ 'dynamic_postspage_keywords' => array(
+ 'name' => __( 'Dynamically Generate Keywords for Posts Page/Archives:', 'all-in-one-seo-pack' ),
+ 'default' => 1,
+ 'condshow' => array( 'aiosp_togglekeywords' => 0 ),
+ ),
+ 'category_noindex' => array(
+ 'name' => __( 'Use noindex for Categories:', 'all-in-one-seo-pack' ),
+ 'default' => 1,
+ ),
+ 'archive_date_noindex' => array(
+ 'name' => __( 'Use noindex for Date Archives:', 'all-in-one-seo-pack' ),
+ 'default' => 1,
+ ),
+ 'archive_author_noindex' => array(
+ 'name' => __( 'Use noindex for Author Archives:', 'all-in-one-seo-pack' ),
+ 'default' => 1,
+ ),
+ 'tags_noindex' => array(
+ 'name' => __( 'Use noindex for Tag Archives:', 'all-in-one-seo-pack' ),
'default' => 0,
- 'condshow' => Array( 'aiosp_google_analytics_id' => Array( 'lhs' => 'aiosp_google_analytics_id', 'op' => '!=', 'rhs' => '' ) ) ),
- "ga_advanced_options"=> Array(
- 'name' => __( 'Advanced Analytics Options:', 'all-in-one-seo-pack' ),
- 'default' => 'on',
- 'type' => 'radio',
- 'initial_options' => Array( 'on' => __( 'Enabled', 'all-in-one-seo-pack' ),
- 0 => __( 'Disabled', 'all-in-one-seo-pack' ) ),
- 'condshow' => Array( 'aiosp_google_analytics_id' => Array( 'lhs' => 'aiosp_google_analytics_id', 'op' => '!=', 'rhs' => '' ) ) ),
- "ga_domain"=> Array(
- 'name' => __( 'Tracking Domain:', 'all-in-one-seo-pack' ),
- 'type' => 'text',
- 'condshow' => Array( 'aiosp_google_analytics_id' => Array( 'lhs' => 'aiosp_google_analytics_id', 'op' => '!=', 'rhs' => '' ), 'aiosp_ga_advanced_options' => 'on') ),
- "ga_multi_domain"=> Array(
- 'name' => __( 'Track Multiple Domains:', 'all-in-one-seo-pack' ),
+ ),
+ 'search_noindex' => array(
+ 'name' => __( 'Use noindex for the Search page:', 'all-in-one-seo-pack' ),
+ 'default' => 0,
+ ),
+ '404_noindex' => array(
+ 'name' => __( 'Use noindex for the 404 page:', 'all-in-one-seo-pack' ),
+ 'default' => 0,
+ ),
+ 'tax_noindex' => array(
+ 'name' => __( 'Use noindex for Taxonomy Archives:', 'all-in-one-seo-pack' ),
+ 'type' => 'multicheckbox',
+ 'default' => array(),
+ 'condshow' => array( 'aiosp_enablecpost' => 'on', 'aiosp_cpostadvanced' => 'on' ),
+ ),
+ 'paginated_noindex' => array(
+ 'name' => __( 'Use noindex for paginated pages/posts:', 'all-in-one-seo-pack' ),
'default' => 0,
- 'condshow' => Array( 'aiosp_google_analytics_id' => Array( 'lhs' => 'aiosp_google_analytics_id', 'op' => '!=', 'rhs' => '' ), 'aiosp_ga_advanced_options' => 'on' ) ),
- "ga_addl_domains" => Array(
- 'name' => __( 'Additional Domains:', 'all-in-one-seo-pack' ),
- 'type' => 'textarea',
- 'condshow' => Array( 'aiosp_google_analytics_id' => Array( 'lhs' => 'aiosp_google_analytics_id', 'op' => '!=', 'rhs' => '' ), 'aiosp_ga_advanced_options' => 'on', 'aiosp_ga_multi_domain' => 'on' ) ),
- "ga_anonymize_ip"=> Array(
- 'name' => __( 'Anonymize IP Addresses:', 'all-in-one-seo-pack' ),
- 'type' => 'checkbox',
- 'condshow' => Array( 'aiosp_google_analytics_id' => Array( 'lhs' => 'aiosp_google_analytics_id', 'op' => '!=', 'rhs' => '' ), 'aiosp_ga_advanced_options' => 'on' ) ),
- "ga_display_advertising"=> Array(
- 'name' => __( 'Display Advertiser Tracking:', 'all-in-one-seo-pack' ),
- 'type' => 'checkbox',
- 'condshow' => Array( 'aiosp_google_analytics_id' => Array( 'lhs' => 'aiosp_google_analytics_id', 'op' => '!=', 'rhs' => '' ), 'aiosp_ga_advanced_options' => 'on' ) ),
- "ga_exclude_users"=> Array(
- 'name' => __( 'Exclude Users From Tracking:', 'all-in-one-seo-pack' ),
- 'type' => 'multicheckbox',
- 'condshow' => Array( 'aiosp_google_analytics_id' => Array( 'lhs' => 'aiosp_google_analytics_id', 'op' => '!=', 'rhs' => '' ), 'aiosp_ga_advanced_options' => 'on' ) ),
- "ga_track_outbound_links"=> Array(
- 'name' => __( 'Track Outbound Links:', 'all-in-one-seo-pack' ),
+ ),
+ 'paginated_nofollow' => array(
+ 'name' => __( 'Use nofollow for paginated pages/posts:', 'all-in-one-seo-pack' ),
'default' => 0,
- 'condshow' => Array( 'aiosp_google_analytics_id' => Array( 'lhs' => 'aiosp_google_analytics_id', 'op' => '!=', 'rhs' => '' ), 'aiosp_ga_advanced_options' => 'on' ) ),
- "ga_link_attribution"=> Array(
- 'name' => __( 'Enhanced Link Attribution:', 'all-in-one-seo-pack' ),
+ ),
+ 'noodp' => array(
+ 'name' => __( 'Exclude site from the Open Directory Project:', 'all-in-one-seo-pack' ),
'default' => 0,
- 'condshow' => Array( 'aiosp_google_analytics_id' => Array( 'lhs' => 'aiosp_google_analytics_id', 'op' => '!=', 'rhs' => '' ), 'aiosp_ga_advanced_options' => 'on' ) ),
- "ga_enhanced_ecommerce"=> Array(
- 'name' => __( 'Enhanced Ecommerce:', 'all-in-one-seo-pack' ),
+ ),
+ 'noydir' => array(
+ 'name' => __( 'Exclude site from Yahoo! Directory:', 'all-in-one-seo-pack' ),
'default' => 0,
- 'condshow' => Array( 'aiosp_google_analytics_id' => Array( 'lhs' => 'aiosp_google_analytics_id', 'op' => '!=', 'rhs' => '' ), 'aiosp_ga_use_universal_analytics' => 'on', 'aiosp_ga_advanced_options' => 'on' ) ),
- "use_categories"=> Array(
- 'name' => __( 'Use Categories for META keywords:', 'all-in-one-seo-pack' ),
+ ),
+ 'skip_excerpt' => array(
+ 'name' => __( 'Avoid Using The Excerpt In Descriptions:', 'all-in-one-seo-pack' ),
'default' => 0,
- 'condshow' => Array( "aiosp_togglekeywords" => 0 ) ),
- "use_tags_as_keywords" => Array(
- 'name' => __( 'Use Tags for META keywords:', 'all-in-one-seo-pack' ),
+ ),
+ 'generate_descriptions' => array(
+ 'name' => __( 'Autogenerate Descriptions:', 'all-in-one-seo-pack' ),
'default' => 1,
- 'condshow' => Array( "aiosp_togglekeywords" => 0 ) ),
- "dynamic_postspage_keywords"=> Array(
- 'name' => __( 'Dynamically Generate Keywords for Posts Page/Archives:', 'all-in-one-seo-pack' ),
+ ),
+ 'run_shortcodes' => array(
+ 'name' => __( 'Run Shortcodes In Autogenerated Descriptions:', 'all-in-one-seo-pack' ),
+ 'default' => 0,
+ 'condshow' => array( 'aiosp_generate_descriptions' => 'on' ),
+ ),
+ 'hide_paginated_descriptions' => array(
+ 'name' => __( 'Remove Descriptions For Paginated Pages:', 'all-in-one-seo-pack' ),
+ 'default' => 0,
+ ),
+ 'dont_truncate_descriptions' => array(
+ 'name' => __( 'Never Shorten Long Descriptions:', 'all-in-one-seo-pack' ),
+ 'default' => 0,
+ ),
+ 'schema_markup' => array(
+ 'name' => __( 'Use Schema.org Markup', 'all-in-one-seo-pack' ),
'default' => 1,
- 'condshow' => Array( "aiosp_togglekeywords" => 0 ) ),
- "category_noindex"=> Array(
- 'name' => __( 'Use noindex for Categories:', 'all-in-one-seo-pack' ),
- 'default' => 1),
- "archive_date_noindex"=> Array(
- 'name' => __( 'Use noindex for Date Archives:', 'all-in-one-seo-pack' ),
- 'default' => 1),
- "archive_author_noindex"=> Array(
- 'name' => __( 'Use noindex for Author Archives:', 'all-in-one-seo-pack' ),
- 'default' => 1),
- "tags_noindex"=> Array(
- 'name' => __( 'Use noindex for Tag Archives:', 'all-in-one-seo-pack' ),
- 'default' => 0),
- "search_noindex"=> Array(
- 'name' => __( 'Use noindex for the Search page:', 'all-in-one-seo-pack' ),
- 'default' => 0),
- "404_noindex"=> Array(
- 'name' => __( 'Use noindex for the 404 page:', 'all-in-one-seo-pack' ),
- 'default' => 0),
- "tax_noindex"=> Array(
- 'name' => __( 'Use noindex for Taxonomy Archives:', 'all-in-one-seo-pack' ),
- 'type' => 'multicheckbox', 'default' => array(),
- 'condshow' => Array( 'aiosp_enablecpost' => 'on', 'aiosp_cpostadvanced' => 'on' )
- ),
- "paginated_noindex" => Array(
- 'name' => __( 'Use noindex for paginated pages/posts:', 'all-in-one-seo-pack' ),
- 'default' => 0),
- "paginated_nofollow"=> Array(
- 'name' => __( 'Use nofollow for paginated pages/posts:', 'all-in-one-seo-pack' ),
- 'default' => 0),
- "noodp"=> Array(
- 'name' => __( 'Exclude site from the Open Directory Project:', 'all-in-one-seo-pack' ),
- 'default' => 0),
- "noydir"=> Array(
- 'name' => __( 'Exclude site from Yahoo! Directory:', 'all-in-one-seo-pack' ),
- 'default' => 0),
- "skip_excerpt"=> Array(
- 'name' => __( 'Avoid Using The Excerpt In Descriptions:', 'all-in-one-seo-pack' ),
- 'default' => 0 ),
- "generate_descriptions"=> Array(
- 'name' => __( 'Autogenerate Descriptions:', 'all-in-one-seo-pack' ),
- 'default' => 1),
- "run_shortcodes"=> Array(
- 'name' => __( 'Run Shortcodes In Autogenerated Descriptions:', 'all-in-one-seo-pack' ),
+ ),
+ 'unprotect_meta' => array(
+ 'name' => __( 'Unprotect Post Meta Fields:', 'all-in-one-seo-pack' ),
'default' => 0,
- 'condshow' => Array( 'aiosp_generate_descriptions' => 'on' ) ),
- "hide_paginated_descriptions"=> Array(
- 'name' => __( 'Remove Descriptions For Paginated Pages:', 'all-in-one-seo-pack' ),
- 'default' => 0),
- "dont_truncate_descriptions"=> Array(
- 'name' => __( 'Never Shorten Long Descriptions:', 'all-in-one-seo-pack' ),
- 'default' => 0),
- "schema_markup"=> Array(
- 'name' => __( 'Use Schema.org Markup', 'all-in-one-seo-pack' ),
- 'default' => 1),
- "unprotect_meta"=> Array(
- 'name' => __( 'Unprotect Post Meta Fields:', 'all-in-one-seo-pack' ),
- 'default' => 0),
- "ex_pages" => Array(
- 'name' => __( 'Exclude Pages:', 'all-in-one-seo-pack' ),
- 'type' => 'textarea', 'default' => '' ),
- "post_meta_tags"=> Array(
- 'name' => __( 'Additional Post Headers:', 'all-in-one-seo-pack' ),
- 'type' => 'textarea', 'default' => '', 'sanitize' => 'default' ),
- "page_meta_tags"=> Array(
- 'name' => __( 'Additional Page Headers:', 'all-in-one-seo-pack' ),
- 'type' => 'textarea', 'default' => '', 'sanitize' => 'default' ),
- "front_meta_tags"=> Array(
- 'name' => __( 'Additional Front Page Headers:', 'all-in-one-seo-pack' ),
- 'type' => 'textarea', 'default' => '', 'sanitize' => 'default' ),
- "home_meta_tags"=> Array(
- 'name' => __( 'Additional Blog Page Headers:', 'all-in-one-seo-pack' ),
- 'type' => 'textarea', 'default' => '', 'sanitize' => 'default' ),
- "do_log"=> Array(
- 'name' => __( 'Log important events:', 'all-in-one-seo-pack' ),
- 'default' => null ),
- );
+ ),
+ 'ex_pages' => array(
+ 'name' => __( 'Exclude Pages:', 'all-in-one-seo-pack' ),
+ 'type' => 'textarea',
+ 'default' => '',
+ ),
+ 'post_meta_tags' => array(
+ 'name' => __( 'Additional Post Headers:', 'all-in-one-seo-pack' ),
+ 'type' => 'textarea',
+ 'default' => '',
+ 'sanitize' => 'default',
+ ),
+ 'page_meta_tags' => array(
+ 'name' => __( 'Additional Page Headers:', 'all-in-one-seo-pack' ),
+ 'type' => 'textarea',
+ 'default' => '',
+ 'sanitize' => 'default',
+ ),
+ 'front_meta_tags' => array(
+ 'name' => __( 'Additional Front Page Headers:', 'all-in-one-seo-pack' ),
+ 'type' => 'textarea',
+ 'default' => '',
+ 'sanitize' => 'default',
+ ),
+ 'home_meta_tags' => array(
+ 'name' => __( 'Additional Blog Page Headers:', 'all-in-one-seo-pack' ),
+ 'type' => 'textarea',
+ 'default' => '',
+ 'sanitize' => 'default',
+ ),
+ 'do_log' => array(
+ 'name' => __( 'Log important events:', 'all-in-one-seo-pack' ),
+ 'default' => null,
+ ),
+ );
- if ( AIOSEOPPRO ) {
- unset($this->default_options['donate']);
- } else {
- unset($this->default_options['license_key']);
- unset($this->default_options['taxactive']);
- }
-
- $this->locations = Array(
- 'default' => Array( 'name' => $this->name, 'prefix' => 'aiosp_', 'type' => 'settings', 'options' => null ),
- 'aiosp' => Array( 'name' => $this->plugin_name, 'type' => 'metabox', 'prefix' => '', 'help_link' => 'http://semperplugins.com/sections/postpage-settings/',
- 'options' => Array( 'edit', 'nonce-aioseop-edit', AIOSEOPPRO ? 'support' : 'upgrade' , 'snippet', 'title', 'description', 'keywords', 'custom_link', 'noindex', 'nofollow', 'noodp', 'noydir', 'titleatr', 'menulabel', 'sitemap_exclude', 'disable', 'disable_analytics' ),
- 'default_options' => Array(
- 'edit' => Array( 'type' => 'hidden', 'default' => 'aiosp_edit', 'prefix' => true, 'nowrap' => 1 ),
- 'nonce-aioseop-edit' => Array( 'type' => 'hidden', 'default' => null, 'prefix' => false, 'nowrap' => 1 ),
- 'upgrade' => Array( 'type' => 'html', 'label' => 'none',
- 'default' => aiosp_common::get_upgrade_hyperlink( 'meta', __('Upgrade to All in One SEO Pack Pro Version', 'all-in-one-seo-pack'), __('UPGRADE TO PRO VERSION', 'all-in-one-seo-pack'), '_blank' )
- ),
- 'support' => Array( 'type' => 'html', 'label' => 'none',
- 'default' => ''
- . __( 'Support Forum', 'all-in-one-seo-pack' ) . ' '
- ),
- 'snippet' => Array( 'name' => __( 'Preview Snippet', 'all-in-one-seo-pack' ), 'type' => 'custom', 'label' => 'top',
- 'default' => '
+ if ( AIOSEOPPRO ) {
+ unset( $this->default_options['donate'] );
+ } else {
+ unset( $this->default_options['license_key'] );
+ unset( $this->default_options['taxactive'] );
+ }
+
+ $this->locations = array(
+ 'default' => array( 'name' => $this->name, 'prefix' => 'aiosp_', 'type' => 'settings', 'options' => null ),
+ 'aiosp' => array(
+ 'name' => $this->plugin_name,
+ 'type' => 'metabox',
+ 'prefix' => '',
+ 'help_link' => 'http://semperplugins.com/sections/postpage-settings/',
+ 'options' => array(
+ 'edit',
+ 'nonce-aioseop-edit',
+ AIOSEOPPRO ? 'support' : 'upgrade',
+ 'snippet',
+ 'title',
+ 'description',
+ 'keywords',
+ 'custom_link',
+ 'noindex',
+ 'nofollow',
+ 'noodp',
+ 'noydir',
+ 'titleatr',
+ 'menulabel',
+ 'sitemap_exclude',
+ 'disable',
+ 'disable_analytics',
+ ),
+ 'default_options' => array(
+ 'edit' => array(
+ 'type' => 'hidden',
+ 'default' => 'aiosp_edit',
+ 'prefix' => true,
+ 'nowrap' => 1,
+ ),
+ 'nonce-aioseop-edit' => array(
+ 'type' => 'hidden',
+ 'default' => null,
+ 'prefix' => false,
+ 'nowrap' => 1,
+ ),
+ 'upgrade' => array(
+ 'type' => 'html',
+ 'label' => 'none',
+ 'default' => aiosp_common::get_upgrade_hyperlink( 'meta', __( 'Upgrade to All in One SEO Pack Pro Version', 'all-in-one-seo-pack' ), __( 'UPGRADE TO PRO VERSION', 'all-in-one-seo-pack' ), '_blank' ),
+ ),
+ 'support' => array(
+ 'type' => 'html',
+ 'label' => 'none',
+ 'default' => ''
+ . __( 'Support Forum', 'all-in-one-seo-pack' ) . ' ',
+ ),
+ 'snippet' => array(
+ 'name' => __( 'Preview Snippet', 'all-in-one-seo-pack' ),
+ 'type' => 'custom',
+ 'label' => 'top',
+ 'default' => '
- ' ),
- 'title' => Array( 'name' => __( 'Title', 'all-in-one-seo-pack' ), 'type' => 'text', 'count' => true, 'size' => 60 ),
- 'description' => Array( 'name' => __( 'Description', 'all-in-one-seo-pack' ), 'type' => 'textarea', 'count' => true, 'cols' => 80, 'rows' => 2 ),
-
- 'keywords' => Array( 'name' => __( 'Keywords (comma separated)', 'all-in-one-seo-pack' ), 'type' => 'text' ),
- 'custom_link' => Array( 'name' => __( 'Custom Canonical URL', 'all-in-one-seo-pack' ), 'type' => 'text', 'size' => 60 ),
- 'noindex' => Array( 'name' => __( "Robots Meta NOINDEX", 'all-in-one-seo-pack' ), 'default' => '' ),
- 'nofollow' => Array( 'name' => __( "Robots Meta NOFOLLOW", 'all-in-one-seo-pack' ), 'default' => '' ),
- 'noodp' => Array( 'name' => __( "Robots Meta NOODP", 'all-in-one-seo-pack' ) ),
- 'noydir' => Array( 'name' => __( "Robots Meta NOYDIR", 'all-in-one-seo-pack' ) ),
- 'titleatr' => Array( 'name' => __( 'Title Attribute', 'all-in-one-seo-pack' ), 'type' => 'text', 'size' => 60 ),
- 'menulabel' => Array( 'name' => __( 'Menu Label', 'all-in-one-seo-pack' ), 'type' => 'text', 'size' => 60 ),
- 'sitemap_exclude' => Array( 'name' => __( 'Exclude From Sitemap', 'all-in-one-seo-pack' ) ),
- 'disable' => Array( 'name' => __( 'Disable on this page/post', 'all-in-one-seo-pack' ) ),
- 'disable_analytics' => Array( 'name' => __( 'Disable Google Analytics', 'all-in-one-seo-pack' ), 'condshow' => Array( 'aiosp_disable' => 'on' ) ) ),
- 'display' => null )
- );
-
- if ( !empty( $meta_help_text ) )
- foreach( $meta_help_text as $k => $v )
- $this->locations['aiosp']['default_options'][$k]['help_text'] = $v;
-
- $this->layout = Array(
- 'default' => Array(
- 'name' => __( 'General Settings', 'all-in-one-seo-pack' ),
- 'help_link' => 'http://semperplugins.com/documentation/general-settings/',
- 'options' => Array() // this is set below, to the remaining options -- pdb
+ ',
),
- 'home' => Array(
- 'name' => __( 'Home Page Settings', 'all-in-one-seo-pack' ),
- 'help_link' => 'http://semperplugins.com/documentation/home-page-settings/',
- 'options' => Array( 'home_title', 'home_description', 'home_keywords', 'use_static_home_info' )
+ 'title' => array(
+ 'name' => __( 'Title', 'all-in-one-seo-pack' ),
+ 'type' => 'text',
+ 'count' => true,
+ 'size' => 60,
),
- 'title' => Array(
- 'name' => __( 'Title Settings', 'all-in-one-seo-pack' ),
- 'help_link' => 'http://semperplugins.com/documentation/title-settings/',
- 'options' => Array( "rewrite_titles", "force_rewrites", "cap_titles", "cap_cats", "home_page_title_format", "page_title_format", "post_title_format", "category_title_format", "archive_title_format", "date_title_format", "author_title_format",
- "tag_title_format", "search_title_format", "description_format", "404_title_format", "paged_format" )
+ 'description' => array(
+ 'name' => __( 'Description', 'all-in-one-seo-pack' ),
+ 'type' => 'textarea',
+ 'count' => true,
+ 'cols' => 80,
+ 'rows' => 2,
),
- 'cpt' => Array(
- 'name' => __( 'Custom Post Type Settings', 'all-in-one-seo-pack' ),
- 'help_link' => 'http://semperplugins.com/documentation/custom-post-type-settings/',
- 'options' => Array( "enablecpost", "cpostadvanced", "taxactive","cpostactive", "cposttitles" )
+
+ 'keywords' => array(
+ 'name' => __( 'Keywords (comma separated)', 'all-in-one-seo-pack' ),
+ 'type' => 'text',
+ ),
+ 'custom_link' => array(
+ 'name' => __( 'Custom Canonical URL', 'all-in-one-seo-pack' ),
+ 'type' => 'text',
+ 'size' => 60,
),
- 'display' => Array(
- 'name' => __( 'Display Settings', 'all-in-one-seo-pack' ),
- 'help_link' => 'http://semperplugins.com/documentation/display-settings/',
- 'options' => Array( "posttypecolumns", "admin_bar", "custom_menu_order" )
+ 'noindex' => array(
+ 'name' => __( 'Robots Meta NOINDEX', 'all-in-one-seo-pack' ),
+ 'default' => '',
),
- 'webmaster' => Array(
- 'name' => __( 'Webmaster Verification', 'all-in-one-seo-pack' ),
- 'help_link' => 'http://semperplugins.com/sections/webmaster-verification/',
- 'options' => Array( "google_verify", "bing_verify", "pinterest_verify" )
+ 'nofollow' => array(
+ 'name' => __( 'Robots Meta NOFOLLOW', 'all-in-one-seo-pack' ),
+ 'default' => '',
),
- 'google' => Array(
- 'name' => __( 'Google Settings', 'all-in-one-seo-pack' ),
- 'help_link' => 'http://semperplugins.com/documentation/google-settings/',
- 'options' => Array( "google_publisher", "google_disable_profile", "google_sitelinks_search", "google_set_site_name", "google_specify_site_name", "google_author_advanced", "google_author_location", "google_enable_publisher" , "google_specify_publisher",
- // "google_connect",
- "google_analytics_id", "ga_use_universal_analytics", "ga_advanced_options", "ga_domain", "ga_multi_domain", "ga_addl_domains", "ga_anonymize_ip", "ga_display_advertising", "ga_exclude_users", "ga_track_outbound_links", "ga_link_attribution", "ga_enhanced_ecommerce" )
+ 'noodp' => array( 'name' => __( 'Robots Meta NOODP', 'all-in-one-seo-pack' ) ),
+ 'noydir' => array( 'name' => __( 'Robots Meta NOYDIR', 'all-in-one-seo-pack' ) ),
+ 'titleatr' => array(
+ 'name' => __( 'Title Attribute', 'all-in-one-seo-pack' ),
+ 'type' => 'text',
+ 'size' => 60,
),
- 'noindex' => Array(
- 'name' => __( 'Noindex Settings', 'all-in-one-seo-pack' ),
- 'help_link' => 'http://semperplugins.com/documentation/noindex-settings/',
- 'options' => Array( 'cpostnoindex', 'cpostnofollow', 'cpostnoodp', 'cpostnoydir', 'category_noindex', 'archive_date_noindex', 'archive_author_noindex', 'tags_noindex', 'search_noindex', '404_noindex', 'tax_noindex', 'paginated_noindex', 'paginated_nofollow', 'noodp', 'noydir' )
+ 'menulabel' => array(
+ 'name' => __( 'Menu Label', 'all-in-one-seo-pack' ),
+ 'type' => 'text',
+ 'size' => 60,
),
- 'advanced' => Array(
- 'name' => __( 'Advanced Settings', 'all-in-one-seo-pack' ),
- 'help_link' => 'http://semperplugins.com/documentation/advanced-settings/',
- 'options' => Array( 'generate_descriptions', 'skip_excerpt', 'run_shortcodes', 'hide_paginated_descriptions', 'dont_truncate_descriptions', 'unprotect_meta', 'ex_pages', 'post_meta_tags', 'page_meta_tags', 'front_meta_tags', 'home_meta_tags' )
+ 'sitemap_exclude' => array( 'name' => __( 'Exclude From Sitemap', 'all-in-one-seo-pack' ) ),
+ 'disable' => array( 'name' => __( 'Disable on this page/post', 'all-in-one-seo-pack' ) ),
+ 'disable_analytics' => array(
+ 'name' => __( 'Disable Google Analytics', 'all-in-one-seo-pack' ),
+ 'condshow' => array( 'aiosp_disable' => 'on' ),
),
- 'keywords' => Array(
- 'name' => __( 'Keyword Settings', 'all-in-one-seo-pack' ),
- 'help_link' => 'http://semperplugins.com/documentation/keyword-settings/',
- 'options' => Array( "togglekeywords", "use_categories", "use_tags_as_keywords", "dynamic_postspage_keywords" )
- )
- );
+ ),
+ 'display' => null,
+ ),
+ );
- if(!AIOSEOPPRO){
- unset($this->layout['cpt']['options']['2']);
- }
+ if ( ! empty( $meta_help_text ) ) {
+ foreach ( $meta_help_text as $k => $v ) {
+ $this->locations['aiosp']['default_options'][ $k ]['help_text'] = $v;
+ }
+ }
+
+ $this->layout = array(
+ 'default' => array(
+ 'name' => __( 'General Settings', 'all-in-one-seo-pack' ),
+ 'help_link' => 'https://semperplugins.com/documentation/general-settings/',
+ 'options' => array(), // This is set below, to the remaining options -- pdb.
+ ),
+ 'home' => array(
+ 'name' => __( 'Home Page Settings', 'all-in-one-seo-pack' ),
+ 'help_link' => 'https://semperplugins.com/documentation/home-page-settings/',
+ 'options' => array( 'home_title', 'home_description', 'home_keywords', 'use_static_home_info' ),
+ ),
+ 'title' => array(
+ 'name' => __( 'Title Settings', 'all-in-one-seo-pack' ),
+ 'help_link' => 'https://semperplugins.com/documentation/title-settings/',
+ 'options' => array(
+ 'rewrite_titles',
+ 'force_rewrites',
+ 'cap_titles',
+ 'cap_cats',
+ 'home_page_title_format',
+ 'page_title_format',
+ 'post_title_format',
+ 'category_title_format',
+ 'archive_title_format',
+ 'date_title_format',
+ 'author_title_format',
+ 'tag_title_format',
+ 'search_title_format',
+ 'description_format',
+ '404_title_format',
+ 'paged_format',
+ ),
+ ),
+ 'cpt' => array(
+ 'name' => __( 'Custom Post Type Settings', 'all-in-one-seo-pack' ),
+ 'help_link' => 'http://semperplugins.com/documentation/custom-post-type-settings/',
+ 'options' => array( 'enablecpost', 'cpostadvanced', 'taxactive', 'cpostactive', 'cposttitles' ),
+ ),
+ 'display' => array(
+ 'name' => __( 'Display Settings', 'all-in-one-seo-pack' ),
+ 'help_link' => 'http://semperplugins.com/documentation/display-settings/',
+ 'options' => array( 'posttypecolumns', 'admin_bar', 'custom_menu_order' ),
+ ),
+ 'webmaster' => array(
+ 'name' => __( 'Webmaster Verification', 'all-in-one-seo-pack' ),
+ 'help_link' => 'http://semperplugins.com/sections/webmaster-verification/',
+ 'options' => array( 'google_verify', 'bing_verify', 'pinterest_verify' ),
+ ),
+ 'google' => array(
+ 'name' => __( 'Google Settings', 'all-in-one-seo-pack' ),
+ 'help_link' => 'http://semperplugins.com/documentation/google-settings/',
+ 'options' => array(
+ 'google_publisher',
+ 'google_disable_profile',
+ 'google_sitelinks_search',
+ 'google_set_site_name',
+ 'google_specify_site_name',
+ 'google_author_advanced',
+ 'google_author_location',
+ 'google_enable_publisher',
+ 'google_specify_publisher',
+ // "google_connect",
+ 'google_analytics_id',
+ 'ga_use_universal_analytics',
+ 'ga_advanced_options',
+ 'ga_domain',
+ 'ga_multi_domain',
+ 'ga_addl_domains',
+ 'ga_anonymize_ip',
+ 'ga_display_advertising',
+ 'ga_exclude_users',
+ 'ga_track_outbound_links',
+ 'ga_link_attribution',
+ 'ga_enhanced_ecommerce',
+ ),
+ ),
+ 'noindex' => array(
+ 'name' => __( 'Noindex Settings', 'all-in-one-seo-pack' ),
+ 'help_link' => 'http://semperplugins.com/documentation/noindex-settings/',
+ 'options' => array(
+ 'cpostnoindex',
+ 'cpostnofollow',
+ 'cpostnoodp',
+ 'cpostnoydir',
+ 'category_noindex',
+ 'archive_date_noindex',
+ 'archive_author_noindex',
+ 'tags_noindex',
+ 'search_noindex',
+ '404_noindex',
+ 'tax_noindex',
+ 'paginated_noindex',
+ 'paginated_nofollow',
+ 'noodp',
+ 'noydir',
+ ),
+ ),
+ 'advanced' => array(
+ 'name' => __( 'Advanced Settings', 'all-in-one-seo-pack' ),
+ 'help_link' => 'http://semperplugins.com/documentation/advanced-settings/',
+ 'options' => array(
+ 'generate_descriptions',
+ 'skip_excerpt',
+ 'run_shortcodes',
+ 'hide_paginated_descriptions',
+ 'dont_truncate_descriptions',
+ 'unprotect_meta',
+ 'ex_pages',
+ 'post_meta_tags',
+ 'page_meta_tags',
+ 'front_meta_tags',
+ 'home_meta_tags',
+ ),
+ ),
+ 'keywords' => array(
+ 'name' => __( 'Keyword Settings', 'all-in-one-seo-pack' ),
+ 'help_link' => 'http://semperplugins.com/documentation/keyword-settings/',
+ 'options' => array(
+ 'togglekeywords',
+ 'use_categories',
+ 'use_tags_as_keywords',
+ 'dynamic_postspage_keywords',
+ ),
+ ),
+ );
+
+ if ( ! AIOSEOPPRO ) {
+ unset( $this->layout['cpt']['options']['2'] );
+ }
- $other_options = Array();
- foreach( $this->layout as $k => $v )
- $other_options = array_merge( $other_options, $v['options'] );
+ $other_options = array();
+ foreach ( $this->layout as $k => $v ) {
+ $other_options = array_merge( $other_options, $v['options'] );
+ }
+
+ $this->layout['default']['options'] = array_diff( array_keys( $this->default_options ), $other_options );
- $this->layout['default']['options'] = array_diff( array_keys( $this->default_options ), $other_options );
+ if ( is_admin() ) {
+ $this->add_help_text_links();
+ add_action( 'aioseop_global_settings_header', array( $this, 'display_right_sidebar' ) );
+ add_action( 'aioseop_global_settings_footer', array( $this, 'display_settings_footer' ) );
+ add_action( 'output_option', array( $this, 'custom_output_option' ), 10, 2 );
+ add_action( 'all_admin_notices', array( $this, 'visibility_warning' ) );
- if ( is_admin() ) {
- $this->add_help_text_links();
- add_action( "aioseop_global_settings_header", Array( $this, 'display_right_sidebar' ) );
- add_action( "aioseop_global_settings_footer", Array( $this, 'display_settings_footer' ) );
- add_action( "output_option", Array( $this, 'custom_output_option' ), 10, 2 );
- add_action('all_admin_notices', array( $this, 'visibility_warning'));
-
- if(!AIOSEOPPRO){
+ if ( ! AIOSEOPPRO ) {
// add_action('all_admin_notices', array( $this, 'woo_upgrade_notice'));
- }
- }
- if(AIOSEOPPRO){
- add_action( 'split_shared_term', Array( $this, 'split_shared_term' ), 10, 4 );
- }
- }
+ }
+ }
+ if ( AIOSEOPPRO ) {
+ add_action( 'split_shared_term', array( $this, 'split_shared_term' ), 10, 4 );
+ }
+ }
-//good candidate for pro dir
- function get_all_term_data( $term_id ) {
- $terms = Array();
- $optlist = Array( 'keywords', 'description', 'title', 'custom_link', 'sitemap_exclude', 'disable', 'disable_analytics', 'noindex', 'nofollow', 'noodp', 'noydir', 'titleatr', 'menulabel' );
- foreach( $optlist as $f ) {
- $meta = get_term_meta( $term_id, '_aioseop_' . $f, true );
- if ( !empty( $meta ) ) {
- $terms['_aioseop_' . $f] = $meta;
+ //good candidate for pro dir
+
+ /**
+ * Use custom callback for outputting snippet
+ *
+ * @param $buf
+ * @param $args
+ *
+ * @return string
+ */
+ function custom_output_option( $buf, $args ) {
+ if ( 'aiosp_snippet' === $args['name'] ) {
+ $args['options']['type'] = 'html';
+ $args['options']['nowrap'] = false;
+ $args['options']['save'] = false;
+ $info = $this->get_page_snippet_info();
+ extract( $info );
+ } else {
+ return '';
+ }
+
+ if ( $this->strlen( $title ) > 70 ) {
+ $title = $this->trim_excerpt_without_filters( $title, 70 ) . '...';
+ }
+ if ( $this->strlen( $description ) > 156 ) {
+ $description = $this->trim_excerpt_without_filters( $description, 156 ) . '...';
+ }
+ $extra_title_len = 0;
+ if ( empty( $title_format ) ) {
+ $title = '' . esc_attr( wp_strip_all_tags( html_entity_decode( $title ) ) ) . ' ';
+ } else {
+ if ( strpos( $title_format, '%blog_title%' ) !== false ) {
+ $title_format = str_replace( '%blog_title%', get_bloginfo( 'name' ), $title_format );
+ }
+ $title_format = $this->apply_cf_fields( $title_format );
+ $replace_title = '' . esc_attr( wp_strip_all_tags( html_entity_decode( $title ) ) ) . ' ';
+ if ( strpos( $title_format, '%post_title%' ) !== false ) {
+ $title_format = str_replace( '%post_title%', $replace_title, $title_format );
+ }
+ if ( strpos( $title_format, '%page_title%' ) !== false ) {
+ $title_format = str_replace( '%page_title%', $replace_title, $title_format );
+ }
+ if ( $w->is_category || $w->is_tag || $w->is_tax ) {
+ if ( AIOSEOPPRO && ! empty( $_GET ) && ! empty( $_GET['taxonomy'] ) && ! empty( $_GET['tag_ID'] ) && function_exists( 'wp_get_split_terms' ) ) {
+ $term_id = intval( $_GET['tag_ID'] );
+ $was_split = get_term_meta( $term_id, '_aioseop_term_was_split', true );
+ if ( ! $was_split ) {
+ $split_terms = wp_get_split_terms( $term_id, $_GET['taxonomy'] );
+ if ( ! empty( $split_terms ) ) {
+ foreach ( $split_terms as $new_tax => $new_term ) {
+ $this->split_shared_term( $term_id, $new_term );
+ }
}
}
- return $terms;
}
-
-//good candidate for pro dir
- function split_shared_term( $term_id, $new_term_id, $term_taxonomy_id = '', $taxonomy = '' ) {
- $terms = $this->get_all_term_data( $term_id );
- if ( !empty( $terms ) ) {
- $new_terms = $this->get_all_term_data( $new_term_id );
- if ( empty( $new_terms ) ) {
- foreach( $terms as $k => $v ) {
- add_term_meta( $new_term_id, $k, $v, true );
+ if ( strpos( $title_format, '%category_title%' ) !== false ) {
+ $title_format = str_replace( '%category_title%', $replace_title, $title_format );
+ }
+ if ( strpos( $title_format, '%taxonomy_title%' ) !== false ) {
+ $title_format = str_replace( '%taxonomy_title%', $replace_title, $title_format );
+ }
+ } else {
+ if ( strpos( $title_format, '%category%' ) !== false ) {
+ $title_format = str_replace( '%category%', $category, $title_format );
+ }
+ if ( strpos( $title_format, '%category_title%' ) !== false ) {
+ $title_format = str_replace( '%category_title%', $category, $title_format );
+ }
+ if ( strpos( $title_format, '%taxonomy_title%' ) !== false ) {
+ $title_format = str_replace( '%taxonomy_title%', $category, $title_format );
+ }
+ if ( AIOSEOPPRO ) {
+ if ( strpos( $title_format, '%tax_' ) && ! empty( $p ) ) {
+ $taxes = get_object_taxonomies( $p, 'objects' );
+ if ( ! empty( $taxes ) ) {
+ foreach ( $taxes as $t ) {
+ if ( strpos( $title_format, "%tax_{$t->name}%" ) ) {
+ $terms = $this->get_all_terms( $p->ID, $t->name );
+ $term = '';
+ if ( count( $terms ) > 0 ) {
+ $term = $terms[0];
+ }
+ $title_format = str_replace( "%tax_{$t->name}%", $term, $title_format );
+ }
}
- add_term_meta( $term_id, '_aioseop_term_was_split', true, true );
}
}
+ }
}
+ if ( strpos( $title_format, '%taxonomy_description%' ) !== false ) {
+ $title_format = str_replace( '%taxonomy_description%', $description, $title_format );
+ }
+
+ $title_format = preg_replace( '/%([^%]*?)%/', '', $title_format );
+ $title = $title_format;
+ $extra_title_len = strlen( str_replace( $replace_title, '', $title_format ) );
+ }
+
+ $args['value'] = sprintf( $args['value'], $title, esc_url( $url ), esc_attr( wp_strip_all_tags( $description ) ) );
+ $extra_title_len = (int) $extra_title_len;
+ $args['value'] .= "";
+ $buf = $this->get_option_row( $args['name'], $args['options'], $args );
+
+ return $buf;
+ }
+//good candidate for pro dir
+
+ /**
+ * @return array
+ */
function get_page_snippet_info() {
- static $info = Array();
- if ( !empty( $info ) )
+ static $info = array();
+ if ( ! empty( $info ) ) {
return $info;
+ }
global $post, $aioseop_options, $wp_query;
$title = $url = $description = $term = $category = '';
- $p = $post; $w = $wp_query;
- if ( !is_object( $post ) ) $post = $this->get_queried_object();
- if ( empty( $this->meta_opts ) )
- $this->meta_opts = $this->get_current_options( Array(), 'aiosp' );
- if ( !is_object( $post ) && is_admin() && !empty( $_GET ) && !empty( $_GET['post_type'] ) && !empty( $_GET['taxonomy'] ) && !empty( $_GET['tag_ID'] ) ) {
+ $p = $post;
+ $w = $wp_query;
+ if ( ! is_object( $post ) ) {
+ $post = $this->get_queried_object();
+ }
+ if ( empty( $this->meta_opts ) ) {
+ $this->meta_opts = $this->get_current_options( array(), 'aiosp' );
+ }
+ if ( ! is_object( $post ) && is_admin() && ! empty( $_GET ) && ! empty( $_GET['post_type'] ) && ! empty( $_GET['taxonomy'] ) && ! empty( $_GET['tag_ID'] ) ) {
$term = get_term_by( 'id', $_GET['tag_ID'], $_GET['taxonomy'] );
}
if ( is_object( $post ) ) {
- $opts = $this->meta_opts;
+ $opts = $this->meta_opts;
$post_id = $p->ID;
- if ( empty( $post->post_modified_gmt ) )
+ if ( empty( $post->post_modified_gmt ) ) {
$wp_query = new WP_Query( array( 'p' => $post_id, 'post_type' => $post->post_type ) );
- if ( $post->post_type == 'page' )
+ }
+ if ( 'page' === $post->post_type ) {
$wp_query->is_page = true;
- elseif ( $post->post_type == 'attachment' )
+ } elseif ( 'attachment' === $post->post_type ) {
$wp_query->is_attachment = true;
- else
+ } else {
$wp_query->is_single = true;
- if ( empty( $this->is_front_page ) ) $this->is_front_page = false;
- if ( get_option( 'show_on_front' ) == 'page' ) {
- if ( is_page() && $post->ID == get_option( 'page_on_front' ) )
+ }
+ if ( empty( $this->is_front_page ) ) {
+ $this->is_front_page = false;
+ }
+ if ( 'page' === get_option( 'show_on_front' ) ) {
+ if ( is_page() && $post->ID == get_option( 'page_on_front' ) ) {
$this->is_front_page = true;
- elseif ( $post->ID == get_option( 'page_for_posts' ) )
+ } elseif ( $post->ID == get_option( 'page_for_posts' ) ) {
$wp_query->is_home = true;
+ }
}
$wp_query->queried_object = $post;
- if ( !empty( $post ) && !$wp_query->is_home && !$this->is_front_page ) {
- $title = $this->internationalize( get_post_meta( $post->ID, "_aioseop_title", true ) );
- if ( empty( $title ) ) $title = $post->post_title;
+ if ( ! empty( $post ) && ! $wp_query->is_home && ! $this->is_front_page ) {
+ $title = $this->internationalize( get_post_meta( $post->ID, '_aioseop_title', true ) );
+ if ( empty( $title ) ) {
+ $title = $post->post_title;
+ }
}
$title_format = '';
if ( empty( $title ) ) {
@@ -897,47 +1393,65 @@ function get_page_snippet_info() {
}
$description = $this->get_main_description( $post );
if ( empty( $title_format ) ) {
- if ( is_page() )
+ if ( is_page() ) {
$title_format = $aioseop_options['aiosp_page_title_format'];
- elseif ( is_single() || is_attachment() )
+ } elseif ( is_single() || is_attachment() ) {
$title_format = $this->get_post_title_format( 'post', $post );
+ }
}
if ( empty( $title_format ) ) {
$title_format = '%post_title%';
}
$categories = $this->get_all_categories( $post_id );
- $category = '';
- if ( count( $categories ) > 0 )
+ $category = '';
+ if ( count( $categories ) > 0 ) {
$category = $categories[0];
+ }
} else if ( is_object( $term ) ) {
- if ( $_GET['taxonomy'] == 'category' ) {
- query_posts( Array( 'cat' => $_GET['tag_ID'] ) );
- } else if ( $_GET['taxonomy'] == 'post_tag' ) {
- query_posts( Array( 'tag' => $term->slug ) );
+ if ( 'category' === $_GET['taxonomy'] ) {
+ query_posts( array( 'cat' => $_GET['tag_ID'] ) );
+ } else if ( 'post_tag' === $_GET['taxonomy'] ) {
+ query_posts( array( 'tag' => $term->slug ) );
} else {
- query_posts( Array( 'page' => '', $_GET['taxonomy'] => $term->slug, 'post_type' => $_GET['post_type'] ) );
+ query_posts( array(
+ 'page' => '',
+ $_GET['taxonomy'] => $term->slug,
+ 'post_type' => $_GET['post_type'],
+ ) );
}
- if ( empty( $this->meta_opts ) )
- $this->meta_opts = $this->get_current_options( Array(), 'aiosp' );
- $title = $this->get_tax_name( $_GET['taxonomy'] );
+ if ( empty( $this->meta_opts ) ) {
+ $this->meta_opts = $this->get_current_options( array(), 'aiosp' );
+ }
+ $title = $this->get_tax_name( $_GET['taxonomy'] );
$title_format = $this->get_tax_title_format();
- $opts = $this->meta_opts;
- if ( !empty( $opts ) ) $description = $opts['aiosp_description'];
- if ( empty( $description ) ) $description = term_description();
+ $opts = $this->meta_opts;
+ if ( ! empty( $opts ) ) {
+ $description = $opts['aiosp_description'];
+ }
+ if ( empty( $description ) ) {
+ $description = term_description();
+ }
$description = $this->internationalize( $description );
}
$show_page = true;
- if ( !empty( $aioseop_options["aiosp_no_paged_canonical_links"] ) ) $show_page = false;
+ if ( ! empty( $aioseop_options['aiosp_no_paged_canonical_links'] ) ) {
+ $show_page = false;
+ }
if ( $aioseop_options['aiosp_can'] ) {
- if ( !empty( $aioseop_options['aiosp_customize_canonical_links'] ) && !empty( $opts['aiosp_custom_link'] ) ) $url = $opts['aiosp_custom_link'];
- if ( empty( $url ) )
+ if ( ! empty( $aioseop_options['aiosp_customize_canonical_links'] ) && ! empty( $opts['aiosp_custom_link'] ) ) {
+ $url = $opts['aiosp_custom_link'];
+ }
+ if ( empty( $url ) ) {
$url = $this->aiosp_mrt_get_url( $wp_query, $show_page );
+ }
$url = apply_filters( 'aioseop_canonical_url', $url );
}
- if ( !$url ) $url = get_permalink();
+ if ( ! $url ) {
+ $url = get_permalink();
+ }
- $title = $this->apply_cf_fields( $title );
+ $title = $this->apply_cf_fields( $title );
$description = $this->apply_cf_fields( $description );
$description = apply_filters( 'aioseop_description', $description );
@@ -945,376 +1459,82 @@ function get_page_snippet_info() {
$keywords = $this->apply_cf_fields( $keywords );
$keywords = apply_filters( 'aioseop_keywords', $keywords );
- $info = Array( 'title' => $title, 'description' => $description, 'keywords' => $keywords, 'url' => $url,
- 'title_format' => $title_format, 'category' => $category, 'w' => $wp_query, 'p' => $post );
+ $info = array(
+ 'title' => $title,
+ 'description' => $description,
+ 'keywords' => $keywords,
+ 'url' => $url,
+ 'title_format' => $title_format,
+ 'category' => $category,
+ 'w' => $wp_query,
+ 'p' => $post,
+ );
wp_reset_postdata();
- $wp_query = $w; $post = $p;
- return $info;
- }
-
- /*** Use custom callback for outputting snippet ***/
- function custom_output_option( $buf, $args ) {
- if ( $args['name'] == 'aiosp_snippet' ) {
- $args['options']['type'] = 'html';
- $args['options']['nowrap'] = false;
- $args['options']['save'] = false;
- $info = $this->get_page_snippet_info();
- extract( $info );
- } else return '';
-
- if ( $this->strlen( $title ) > 70 ) $title = $this->trim_excerpt_without_filters( $title, 70 ) . '...';
- if ( $this->strlen( $description ) > 156 ) $description = $this->trim_excerpt_without_filters( $description, 156 ) . '...';
- $extra_title_len = 0;
- if ( empty( $title_format ) ) {
- $title = '' . esc_attr( wp_strip_all_tags( html_entity_decode( $title ) ) ) . ' ';
- } else {
- if ( strpos( $title_format, '%blog_title%' ) !== false ) $title_format = str_replace( '%blog_title%', get_bloginfo( 'name' ), $title_format );
- $title_format = $this->apply_cf_fields( $title_format );
- $replace_title = '' . esc_attr( wp_strip_all_tags( html_entity_decode( $title ) ) ) . ' ';
- if ( strpos( $title_format, '%post_title%' ) !== false ) $title_format = str_replace( '%post_title%', $replace_title, $title_format );
- if ( strpos( $title_format, '%page_title%' ) !== false ) $title_format = str_replace( '%page_title%', $replace_title, $title_format );
- if ( $w->is_category || $w->is_tag || $w->is_tax ) {
- if(AIOSEOPPRO){
- if ( !empty( $_GET ) && !empty( $_GET['taxonomy'] ) && !empty( $_GET['tag_ID'] ) && function_exists( 'wp_get_split_terms' ) ) {
- $term_id = intval( $_GET['tag_ID'] );
- $was_split = get_term_meta( $term_id, '_aioseop_term_was_split', true );
- if ( !$was_split ) {
- $split_terms = wp_get_split_terms( $term_id, $_GET['taxonomy'] );
- if ( !empty( $split_terms ) ) {
- foreach ( $split_terms as $new_tax => $new_term ) {
- $this->split_shared_term( $term_id, $new_term );
- }
- }
- }
- }
- }
- if ( strpos( $title_format, '%category_title%' ) !== false ) $title_format = str_replace( '%category_title%', $replace_title, $title_format );
- if ( strpos( $title_format, '%taxonomy_title%' ) !== false ) $title_format = str_replace( '%taxonomy_title%', $replace_title, $title_format );
- } else {
- if ( strpos( $title_format, '%category%' ) !== false ) $title_format = str_replace( '%category%', $category, $title_format );
- if ( strpos( $title_format, '%category_title%' ) !== false ) $title_format = str_replace( '%category_title%', $category, $title_format );
- if ( strpos( $title_format, '%taxonomy_title%' ) !== false ) $title_format = str_replace( '%taxonomy_title%', $category, $title_format );
- if(AIOSEOPPRO){
- if ( strpos( $title_format, "%tax_" ) && !empty( $p ) ) {
- $taxes = get_object_taxonomies( $p, 'objects' );
- if ( !empty( $taxes ) )
- foreach( $taxes as $t )
- if ( strpos( $title_format, "%tax_{$t->name}%" ) ) {
- $terms = $this->get_all_terms( $p->ID, $t->name );
- $term = '';
- if ( count( $terms ) > 0 )
- $term = $terms[0];
- $title_format = str_replace( "%tax_{$t->name}%", $term, $title_format );
- }
- }
- }
- }
- if ( strpos( $title_format, '%taxonomy_description%' ) !== false ) $title_format = str_replace( '%taxonomy_description%', $description, $title_format );
-
- $title_format = preg_replace( '/%([^%]*?)%/', '', $title_format );
- $title = $title_format;
- $extra_title_len = strlen( str_replace( $replace_title, '', $title_format ) );
- }
-
- $args['value'] = sprintf( $args['value'], $title, esc_url( $url ), esc_attr( wp_strip_all_tags( $description ) ) );
- $extra_title_len = (int)$extra_title_len;
- $args['value'] .= "";
- $buf = $this->get_option_row( $args['name'], $args['options'], $args );
-
- return $buf;
- }
-
- function add_page_icon() {
- wp_enqueue_script( 'wp-pointer', false, array( 'jquery' ) );
- wp_enqueue_style( 'wp-pointer' );
- $this->add_admin_pointers();
-
-
- wp_enqueue_style( 'aiosp_admin_style' , AIOSEOP_PLUGIN_URL . 'css/aiosp_admin.css' );
-?>
-
- label ) ){
- if ( $post_objs[$p]->_builtin && empty( $aioseop_options['aiosp_enablecpost'] )){
- $post_types[$p] = $post_objs[$p]->label;
- }elseif (!empty( $aioseop_options['aiosp_enablecpost'] ) || $aiosp_enablecpost == 'on' ) {
- $post_types[$p] = $post_objs[$p]->label;
- }
- }
- else{
- $post_types[$p] = $p;
- }
- }
-
- foreach ($pt as $p){
- if ( !empty( $post_objs[$p]->label)){
- $all_post_types[$p] = $post_objs[$p]->label;
- }
- }
-
- $taxes = get_taxonomies( '', 'objects' );
- $tx = array_keys( $taxes );
- $remtax = array( 'nav_menu', 'link_category', 'post_format' );
- $tx = array_diff( $tx, $remtax );
- $tax_types = Array();
- foreach( $tx as $t )
- if ( !empty( $taxes[$t]->label ) )
- $tax_types[$t] = $taxes[$t]->label;
- else
- $taxes[$t] = $t;
- $this->default_options["posttypecolumns"]['initial_options'] = $post_types;
- $this->default_options["cpostactive"]['initial_options'] = $all_post_types;
- $this->default_options["cpostnoindex"]['initial_options'] = $post_types;
- $this->default_options["cpostnofollow"]['initial_options'] = $post_types;
- $this->default_options["cpostnoodp"]['initial_options'] = $post_types;
- $this->default_options["cpostnoydir"]['initial_options'] = $post_types;
- if ( AIOSEOPPRO ) $this->default_options["taxactive"]['initial_options'] = $tax_types;
- $this->default_options["google_author_location"]['initial_options'] = $post_types;
- $this->default_options['google_author_location' ]['initial_options'] = array_merge( Array( 'front' => __( 'Front Page', 'all-in-one-seo-pack' ) ), $post_types, Array( 'all' => __( 'Everywhere Else', 'all-in-one-seo-pack' ) ) );
- $this->default_options["google_author_location"]['default'] = array_keys( $this->default_options["google_author_location"]['initial_options'] );
-
- foreach ( $post_types as $p => $pt ) {
- $field = $p . "_title_format";
- $name = $post_objs[$p]->labels->singular_name;
- if ( !isset( $this->default_options[$field] ) ) {
- $this->default_options[$field] = Array (
- 'name' => "$name " . __( 'Title Format:', 'all-in-one-seo-pack' ) . " ($p)",
- 'type' => 'text',
- 'default' => '%post_title% | %blog_title%',
- 'condshow' => Array( 'aiosp_rewrite_titles' => 1, 'aiosp_enablecpost' => 'on', 'aiosp_cpostadvanced' => 'on', 'aiosp_cposttitles' => 'on', 'aiosp_cpostactive\[\]' => $p )
- );
- $this->help_text[$field] = __( 'The following macros are supported:', 'all-in-one-seo-pack' )
- . '' . __( '%blog_title% - Your blog title', 'all-in-one-seo-pack' ) . ' ' .
- __( '%blog_description% - Your blog description', 'all-in-one-seo-pack' ) . ' ' .
- __( '%post_title% - The original title of the post.', 'all-in-one-seo-pack' ) . ' ';
- $taxes = get_object_taxonomies( $p, 'objects' );
- if ( !empty( $taxes ) )
- foreach( $taxes as $n => $t )
- $this->help_text[$field] .= sprintf( __( "%%tax_%s%% - This post's associated %s taxonomy title", 'all-in-one-seo-pack' ), $n, $t->label ) . ' ';
- $this->help_text[$field] .=
- __( "%post_author_login% - This post's author' login", 'all-in-one-seo-pack' ) . ' ' .
- __( "%post_author_nicename% - This post's author' nicename", 'all-in-one-seo-pack' ) . ' ' .
- __( "%post_author_firstname% - This post's author' first name (capitalized)", 'all-in-one-seo-pack' ) . ' ' .
- __( "%post_author_lastname% - This post's author' last name (capitalized)", 'all-in-one-seo-pack' ) . ' ' .
- ' ';
- $this->help_anchors[$field] = '#custom-titles';
- $this->layout['cpt']['options'][] = $field;
- }
- }
- global $wp_roles;
- if ( ! isset( $wp_roles ) ) {
- $wp_roles = new WP_Roles();
- }
- $role_names = $wp_roles->get_names();
- ksort( $role_names );
- $this->default_options["ga_exclude_users"]['initial_options'] = $role_names;
-
- unset( $tax_types['category'] );
- unset( $tax_types['post_tag'] );
- $this->default_options["tax_noindex"]['initial_options'] = $tax_types;
- if ( empty( $tax_types ) )
- unset( $this->default_options["tax_noindex"] );
-
- if (AIOSEOPPRO) {
- foreach ( $tax_types as $p => $pt ) {
- $field = $p . "_tax_title_format";
- $name = $pt;
- if ( !isset( $this->default_options[$field] ) ) {
- $this->default_options[$field] = Array (
- 'name' => "$name " . __( 'Taxonomy Title Format:', 'all-in-one-seo-pack' ),
- 'type' => 'text',
- 'default' => '%taxonomy_title% | %blog_title%',
- 'condshow' => Array( 'aiosp_rewrite_titles' => 1, 'aiosp_enablecpost' => 'on', 'aiosp_cpostadvanced' => 'on', 'aiosp_cposttitles' => 'on', 'aiosp_taxactive\[\]' => $p )
- );
- $this->help_text[$field] = __( "The following macros are supported:", 'all-in-one-seo-pack' ) .
- '' . __( '%blog_title% - Your blog title', 'all-in-one-seo-pack' ) . ' ' .
- __( '%blog_description% - Your blog description', 'all-in-one-seo-pack' ) . ' ' .
- __( '%taxonomy_title% - The original title of the taxonomy', 'all-in-one-seo-pack' ) . ' ' .
- __( '%taxonomy_description% - The description of the taxonomy', 'all-in-one-seo-pack' ) . ' ';
- $this->help_anchors[$field] = '#custom-titles';
- $this->layout['cpt']['options'][] = $field;
- }
- }
- }
- $this->setting_options();
- $this->add_help_text_links();
-
- if (AIOSEOPPRO){
- global $aioseop_update_checker;
- add_action( "{$this->prefix}update_options", Array( $aioseop_update_checker, 'license_change_check' ), 10, 2 );
- add_action( "{$this->prefix}settings_update", Array( $aioseop_update_checker, 'update_check' ), 10, 2 );
- }
-
- add_filter( "{$this->prefix}display_options", Array( $this, 'filter_options' ), 10, 2 );
- parent::add_page_hooks();
- }
+ $wp_query = $w;
+ $post = $p;
- function add_admin_pointers() {
- if ( AIOSEOPPRO ) {
- $this->pointers['aioseop_menu_236'] = Array( 'pointer_target' => '#toplevel_page_all-in-one-seo-pack-pro-aioseop_class',
- 'pointer_text' => '' . sprintf( __( 'Welcome to Version %s!', 'all-in-one-seo-pack' ), AIOSEOP_VERSION )
- . ' ' . __( 'Thank you for running the latest and greatest All in One SEO Pack Pro ever! Please review your settings, as we\'re always adding new features for you!', 'all-in-one-seo-pack' ) . '
',
- 'pointer_edge' => 'top',
- 'pointer_align' => 'left',
- 'pointer_scope' => 'global'
- );
- $this->pointers['aioseop_welcome_230'] = Array( 'pointer_target' => '#aioseop_top_button',
- 'pointer_text' => '' . sprintf( __( 'Review Your Settings', 'all-in-one-seo-pack' ), AIOSEOP_VERSION )
- . ' ' . __( 'New in 2.4: Improved support for taxonomies, Woocommerce and massive performance improvements under the hood! Please review your settings on each options page!', 'all-in-one-seo-pack' ) . '
',
- 'pointer_edge' => 'bottom',
- 'pointer_align' => 'left',
- 'pointer_scope' => 'local'
- );
- $this->filter_pointers();
- }
- else {
- $this->pointers['aioseop_menu_220'] = Array( 'pointer_target' => '#toplevel_page_all-in-one-seo-pack-aioseop_class',
- 'pointer_text' => '' . sprintf( __( 'Welcome to Version %s!', 'all-in-one-seo-pack' ), AIOSEOP_VERSION )
- . ' ' . __( 'Thank you for running the latest and greatest All in One SEO Pack ever! Please review your settings, as we\'re always adding new features for you!', 'all-in-one-seo-pack' ) . '
',
- 'pointer_edge' => 'top',
- 'pointer_align' => 'left',
- 'pointer_scope' => 'global'
- );
- $this->pointers['aioseop_welcome_220'] = Array( 'pointer_target' => '#aioseop_top_button',
- 'pointer_text' => '' . sprintf( __( 'Review Your Settings', 'all-in-one-seo-pack' ), AIOSEOP_VERSION )
- . ' ' . __( 'Thank you for running the latest and greatest All in One SEO Pack ever! New since 2.2: Control who accesses your site with the new Robots.txt Editor and File Editor modules! Enable them from the Feature Manager. Remember to review your settings, we have added some new ones!', 'all-in-one-seo-pack' ) . '
',
- 'pointer_edge' => 'bottom',
- 'pointer_align' => 'left',
- 'pointer_scope' => 'local'
- );
- $this->filter_pointers();
- }
- }
-
- function settings_page_init() {
- add_filter( "{$this->prefix}submit_options", Array( $this, 'filter_submit' ) );
- }
-
- function enqueue_scripts() {
- add_filter( "{$this->prefix}display_settings", Array( $this, 'filter_settings' ), 10, 3 );
- add_filter( "{$this->prefix}display_options", Array( $this, 'filter_options' ), 10, 2 );
- parent::enqueue_scripts();
- }
-
- function filter_submit( $submit ) {
- $submit['Submit_Default']['value'] = __( 'Reset General Settings to Defaults', 'all-in-one-seo-pack' ) . ' »';
- $submit['Submit_All_Default'] = Array( 'type' => 'submit', 'class' => 'button-secondary', 'value' => __( 'Reset ALL Settings to Defaults', 'all-in-one-seo-pack' ) . ' »' );
- return $submit;
+ return $info;
}
/**
- * Handle resetting options to defaults, but preserve the license key if pro.
+ * @return null|object|WP_Post
*/
- function reset_options( $location = null, $delete = false ) {
- if ( AIOSEOPPRO) {
- global $aioseop_update_checker;
+ function get_queried_object() {
+ static $p = null;
+ global $wp_query, $post;
+ if ( null !== $p ) {
+ return $p;
}
- if ( $delete === true ) {
-
- if ( AIOSEOPPRO ) {
- $license_key = '';
- if ( isset( $this->options ) && isset( $this->options['aiosp_license_key'] ) )
- $license_key = $this->options['aiosp_license_key'];
- }
-
- $this->delete_class_option( $delete );
-
- if ( AIOSEOPPRO ) {
- $this->options = Array( 'aiosp_license_key' => $license_key );
- } else {
- $this->options = Array();
+ if ( is_object( $post ) ) {
+ $p = $post;
+ } else {
+ if ( ! $wp_query ) {
+ return null;
}
+ $p = $wp_query->get_queried_object();
}
- $default_options = $this->default_options( $location );
- if ( AIOSEOPPRO ) {
- foreach ( $default_options as $k => $v )
- if ( $k != 'aiosp_license_key' )
- $this->options[$k] = $v;
- $aioseop_update_checker->license_key = $this->options['aiosp_license_key'];
- } else {
- foreach ( $default_options as $k => $v )
- $this->options[$k] = $v;
- }
- $this->update_class_option( $this->options );
+ return $p;
}
- function get_current_options( $opts = Array(), $location = null, $defaults = null, $post = null ) {
- if ( ( $location === 'aiosp' ) && ( $this->locations[$location]['type'] == 'metabox' ) ) {
- if ( $post == null ) {
+ /**
+ * @param array $opts
+ * @param null $location
+ * @param null $defaults
+ * @param null $post
+ *
+ * @return array
+ */
+ function get_current_options( $opts = array(), $location = null, $defaults = null, $post = null ) {
+ if ( ( 'aiosp' === $location) && ( 'metabox' == $this->locations[ $location ]['type'] ) ) {
+ if ( null === $post ) {
global $post;
}
$post_id = $post;
- if ( is_object( $post_id ) )
+ if ( is_object( $post_id ) ) {
$post_id = $post_id->ID;
+ }
$get_opts = $this->default_options( $location );
- $optlist = Array( 'keywords', 'description', 'title', 'custom_link', 'sitemap_exclude', 'disable', 'disable_analytics', 'noindex', 'nofollow', 'noodp', 'noydir', 'titleatr', 'menulabel' );
- if ( !( !empty( $this->options['aiosp_can'] ) ) && ( !empty( $this->options['aiosp_customize_canonical_links'] ) ) ) {
- unset( $optlist["custom_link"] );
+ $optlist = array(
+ 'keywords',
+ 'description',
+ 'title',
+ 'custom_link',
+ 'sitemap_exclude',
+ 'disable',
+ 'disable_analytics',
+ 'noindex',
+ 'nofollow',
+ 'noodp',
+ 'noydir',
+ 'titleatr',
+ 'menulabel',
+ );
+ if ( ! ( ! empty( $this->options['aiosp_can'] ) ) && ( ! empty( $this->options['aiosp_customize_canonical_links'] ) ) ) {
+ unset( $optlist['custom_link'] );
}
foreach ( $optlist as $f ) {
- $meta = '';
+ $meta = '';
$field = "aiosp_$f";
if ( AIOSEOPPRO ) {
@@ -1323,1977 +1543,3147 @@ function get_current_options( $opts = Array(), $location = null, $defaults = nul
$meta = get_term_meta( $_GET['tag_ID'], '_aioseop_' . $f, true );
} else {
$queried_object = get_queried_object();
- if ( !empty( $queried_object ) && !empty( $queried_object->term_id ) ) {
+ if ( ! empty( $queried_object ) && ! empty( $queried_object->term_id ) ) {
$meta = get_term_meta( $queried_object->term_id, '_aioseop_' . $f, true );
}
}
- } else
+ } else {
$meta = get_post_meta( $post_id, '_aioseop_' . $f, true );
+ }
if ( 'title' === $f || 'description' === $f ) {
- $get_opts[$field] = htmlspecialchars( ( $meta ) );
+ $get_opts[ $field ] = htmlspecialchars( $meta );
} else {
- $get_opts[$field] = htmlspecialchars( stripslashes( $meta ) );
+ $get_opts[ $field ] = htmlspecialchars( stripslashes( $meta ) );
}
} else {
$field = "aiosp_$f";
- $meta = get_post_meta( $post_id, '_aioseop_' . $f, true );
+ $meta = get_post_meta( $post_id, '_aioseop_' . $f, true );
if ( 'title' === $f || 'description' === $f ) {
- $get_opts[$field] = htmlspecialchars( ( $meta ) );
+ $get_opts[ $field ] = htmlspecialchars( $meta );
} else {
- $get_opts[$field] = htmlspecialchars( stripslashes( $meta ) );
+ $get_opts[ $field ] = htmlspecialchars( stripslashes( $meta ) );
}
}
}
$opts = wp_parse_args( $opts, $get_opts );
+
return $opts;
} else {
$options = parent::get_current_options( $opts, $location, $defaults );
+
return $options;
}
}
- function filter_settings( $settings, $location, $current ) {
- if ( $location == null ) {
- $prefix = $this->prefix;
-
- foreach ( Array( 'seopostcol', 'seocustptcol', 'debug_info', 'max_words_excerpt' ) as $opt )
- unset( $settings["{$prefix}$opt"] );
-
- if ( !class_exists( 'DOMDocument' ) ) {
- unset( $settings["{prefix}google_connect"] );
- }
- if ( AIOSEOPPRO ) {
- if ( !empty( $this->options['aiosp_license_key'] ) ) {
- $settings['aiosp_license_key']['type'] = 'password';
- $settings['aiosp_license_key']['size'] = 38;
- }
- }
- } elseif ( $location == 'aiosp' ) {
- global $post, $aioseop_sitemap;
- $prefix = $this->get_prefix( $location ) . $location . '_';
- if ( !empty( $post ) ) {
- $post_type = get_post_type( $post );
- if ( !empty( $this->options['aiosp_cpostnoindex'] ) && ( in_array( $post_type, $this->options['aiosp_cpostnoindex'] ) ) ) {
- $settings["{$prefix}noindex"]['type'] = 'select';
- $settings["{$prefix}noindex"]['initial_options'] = Array( '' => __( 'Default - noindex', 'all-in-one-seo-pack' ), 'off' => __( 'index', 'all-in-one-seo-pack' ), 'on' => __( 'noindex', 'all-in-one-seo-pack' ) );
- }
- if ( !empty( $this->options['aiosp_cpostnofollow'] ) && ( in_array( $post_type, $this->options['aiosp_cpostnofollow'] ) ) ) {
- $settings["{$prefix}nofollow"]['type'] = 'select';
- $settings["{$prefix}nofollow"]['initial_options'] = Array( '' => __( 'Default - nofollow', 'all-in-one-seo-pack' ), 'off' => __( 'follow', 'all-in-one-seo-pack' ), 'on' => __( 'nofollow', 'all-in-one-seo-pack' ) );
- }
- if ( !empty( $this->options['aiosp_cpostnoodp'] ) && ( in_array( $post_type, $this->options['aiosp_cpostnoodp'] ) ) ) {
- $settings["{$prefix}noodp"]['type'] = 'select';
- $settings["{$prefix}noodp"]['initial_options'] = Array( '' => __( 'Default - noodp', 'all-in-one-seo-pack' ), 'off' => __( 'odp', 'all-in-one-seo-pack' ), 'on' => __( 'noodp', 'all-in-one-seo-pack' ) );
- }
- if ( !empty( $this->options['aiosp_cpostnoydir'] ) && ( in_array( $post_type, $this->options['aiosp_cpostnoydir'] ) ) ) {
- $settings["{$prefix}noydir"]['type'] = 'select';
- $settings["{$prefix}noydir"]['initial_options'] = Array( '' => __( 'Default - noydir', 'all-in-one-seo-pack' ), 'off' => __( 'ydir', 'all-in-one-seo-pack' ), 'on' => __( 'noydir', 'all-in-one-seo-pack' ) );
- }
- global $post;
- $info = $this->get_page_snippet_info();
- extract( $info );
- $settings["{$prefix}title"]['placeholder'] = $title;
- $settings["{$prefix}description"]['placeholder'] = $description;
- $settings["{$prefix}keywords"]['placeholder'] = $keywords;
- }
+ /**
+ * @param $in
+ *
+ * @return mixed|void
+ */
+ function internationalize( $in ) {
+ if ( function_exists( 'langswitch_filter_langs_with_message' ) ) {
+ $in = langswitch_filter_langs_with_message( $in );
+ }
- if ( !AIOSEOPPRO ){
- if ( !current_user_can( 'update_plugins' ) )
- unset( $settings["{$prefix}upgrade"] );
- }
+ if ( function_exists( 'polyglot_filter' ) ) {
+ $in = polyglot_filter( $in );
+ }
- if ( !is_object( $aioseop_sitemap ) )
- unset( $settings['aiosp_sitemap_exclude'] );
- if ( is_object( $post ) ) {
- if ( $post->post_type != 'page' ) {
- unset( $settings["{$prefix}titleatr"] );
- unset( $settings["{$prefix}menulabel"] );
- }
- }
- if ( !empty( $this->options[$this->prefix . 'togglekeywords'] ) ) {
- unset( $settings["{$prefix}keywords"] );
- unset( $settings["{$prefix}togglekeywords"] );
- } elseif ( !empty( $current["{$prefix}togglekeywords"] ) ) {
- unset( $settings["{$prefix}keywords"] );
- }
- if ( empty( $this->options['aiosp_can'] ) || ( empty( $this->options['aiosp_customize_canonical_links'] ) ) ) {
- unset( $settings["{$prefix}custom_link"] );
- }
+ if ( function_exists( 'qtrans_useCurrentLanguageIfNotFoundUseDefaultLanguage' ) ) {
+ $in = qtrans_useCurrentLanguageIfNotFoundUseDefaultLanguage( $in );
+ } elseif ( function_exists( 'ppqtrans_useCurrentLanguageIfNotFoundUseDefaultLanguage' ) ) {
+ $in = ppqtrans_useCurrentLanguageIfNotFoundUseDefaultLanguage( $in );
+ } elseif ( function_exists( 'qtranxf_useCurrentLanguageIfNotFoundUseDefaultLanguage' ) ) {
+ $in = qtranxf_useCurrentLanguageIfNotFoundUseDefaultLanguage( $in );
}
- return $settings;
+
+ return apply_filters( 'localization', $in );
}
- function filter_options( $options, $location ) {
- if ( $location == 'aiosp' ) {
- global $post;
- if ( !empty( $post ) ) {
- $prefix = $this->prefix;
- $post_type = get_post_type( $post );
- foreach( Array( 'noindex', 'nofollow', 'noodp', 'noydir' ) as $no ) {
- if ( empty( $this->options['aiosp_cpost' . $no] ) || ( !in_array( $post_type, $this->options['aiosp_cpost' . $no] ) ) )
- if ( isset( $options["{$prefix}{$no}"] ) && ( $options["{$prefix}{$no}"] != 'on' ) )
- unset( $options["{$prefix}{$no}"] );
- }
- }
- }
- if ( $location == null ) {
- $prefix = $this->prefix;
- if ( isset( $options["{$prefix}rewrite_titles"] ) && ( !empty( $options["{$prefix}rewrite_titles"] ) ) )
- $options["{$prefix}rewrite_titles"] = 1;
- if ( ( isset( $options["{$prefix}enablecpost"] ) ) && ( $options["{$prefix}enablecpost"] === '' ) )
- $options["{$prefix}enablecpost"] = 0;
- if ( ( isset( $options["{$prefix}use_original_title"] ) ) && ( $options["{$prefix}use_original_title"] === '' ) )
- $options["{$prefix}use_original_title"] = 0;
+ /*** Used to filter wp_title(), get our title. ***/
+ function wp_title() {
+ global $aioseop_options;
+ $title = false;
+ $post = $this->get_queried_object();
+ if ( ! empty( $aioseop_options['aiosp_rewrite_titles'] ) ) {
+ $title = $this->get_aioseop_title( $post );
+ $title = $this->apply_cf_fields( $title );
}
- return $options;
- }
-
+ if ( false === $title ) {
+ $title = $this->get_original_title();
+ }
- function get_queried_object() {
- static $p = null;
- global $wp_query, $post;
- if ( $p !== null ) return $p;
- if ( is_object( $post ) )
- $p = $post;
- else {
- if ( !$wp_query ) return null;
- $p = $wp_query->get_queried_object();
+ // If we're going to have this here, which seems logical, we should probably take it out of other places... do all titles pass through here?
+ // The following lines have been commented out to fix an error with Capitalize Titles as reported in the WP forums
+ // if ( !empty( $aioseop_options['aiosp_cap_titles'] ) )
+ // $title = $this->capitalize( $title );
+
+ return apply_filters( 'aioseop_title', $title );
+ }
+
+ /**
+ * Gets the title that will be used by AIOSEOP for title rewrites or returns false.
+ *
+ * @param $post
+ *
+ * @return bool|string
+ */
+ function get_aioseop_title( $post ) {
+ global $aioseop_options;
+ // the_search_query() is not suitable, it cannot just return.
+ global $s, $STagging;
+ $opts = $this->meta_opts;
+ if ( is_front_page() ) {
+ if ( ! empty( $aioseop_options['aiosp_use_static_home_info'] ) ) {
+ global $post;
+ if ( get_option( 'show_on_front' ) == 'page' && is_page() && $post->ID == get_option( 'page_on_front' ) ) {
+ $title = $this->internationalize( get_post_meta( $post->ID, '_aioseop_title', true ) );
+ if ( ! $title ) {
+ $title = $this->internationalize( $post->post_title );
+ }
+ if ( ! $title ) {
+ $title = $this->internationalize( $this->get_original_title( '', false ) );
+ }
+ if ( ! empty( $aioseop_options['aiosp_home_page_title_format'] ) ) {
+ $title = $this->apply_page_title_format( $title, $post, $aioseop_options['aiosp_home_page_title_format'] );
+ }
+ $title = $this->paged_title( $title );
+ $title = apply_filters( 'aioseop_home_page_title', $title );
+ }
+ } else {
+ $title = $this->internationalize( $aioseop_options['aiosp_home_title'] );
+ if ( ! empty( $aioseop_options['aiosp_home_page_title_format'] ) ) {
+ $title = $this->apply_page_title_format( $title, null, $aioseop_options['aiosp_home_page_title_format'] );
+ }
+ }
+ if ( empty( $title ) ) {
+ $title = $this->internationalize( get_option( 'blogname' ) ) . ' | ' . $this->internationalize( get_bloginfo( 'description' ) );
+ }
+
+ global $post;
+ $post_id = $post->ID;
+
+ if ( is_post_type_archive() && is_post_type_archive( 'product' ) && $post_id = woocommerce_get_page_id( 'shop' ) && $post = get_post( $post_id ) ) {
+ $frontpage_id = get_option( 'page_on_front' );
+
+ if ( woocommerce_get_page_id( 'shop' ) == get_option( 'page_on_front' ) && ! empty( $aioseop_options['aiosp_use_static_home_info'] ) ) {
+ $title = $this->internationalize( get_post_meta( $post->ID, '_aioseop_title', true ) );
+ }
+ // $title = $this->internationalize( $aioseop_options['aiosp_home_title'] );
+ if ( ! $title ) {
+ $title = $this->internationalize( get_post_meta( $frontpage_id, '_aioseop_title', true ) );
+ } // This is/was causing the first product to come through.
+ if ( ! $title ) {
+ $title = $this->internationalize( $post->post_title );
+ }
+ if ( ! $title ) {
+ $title = $this->internationalize( $this->get_original_title( '', false ) );
+ }
+
+ $title = $this->apply_page_title_format( $title, $post );
+ $title = $this->paged_title( $title );
+ $title = apply_filters( 'aioseop_title_page', $title );
+
+ return $title;
+
+ }
+
+ return $this->paged_title( $title ); //this is returned for woo
+ } else if ( is_attachment() ) {
+ if ( null === $post ) {
+ return false;
+ }
+ $title = get_post_meta( $post->ID, '_aioseop_title', true );
+ if ( empty( $title ) ) {
+ $title = $post->post_title;
+ }
+ if ( empty( $title ) ) {
+ $title = $this->get_original_title( '', false );
+ }
+ if ( empty( $title ) ) {
+ $title = get_the_title( $post->post_parent );
+ }
+ $title = apply_filters( 'aioseop_attachment_title', $this->internationalize( $this->apply_post_title_format( $title, '', $post ) ) );
+
+ return $title;
+ } else if ( is_page() || $this->is_static_posts_page() || ( is_home() && ! $this->is_static_posts_page() ) ) {
+ if ( null === $post ) {
+ return false;
+ }
+ if ( $this->is_static_front_page() && ( $home_title = $this->internationalize( $aioseop_options['aiosp_home_title'] ) ) ) {
+ if ( ! empty( $aioseop_options['aiosp_home_page_title_format'] ) ) {
+ $home_title = $this->apply_page_title_format( $home_title, $post, $aioseop_options['aiosp_home_page_title_format'] );
+ }
+
+ // Home title filter.
+ return apply_filters( 'aioseop_home_page_title', $home_title );
+ } else {
+ $page_for_posts = '';
+ if ( is_home() ) {
+ $page_for_posts = get_option( 'page_for_posts' );
+ }
+ if ( $page_for_posts ) {
+ $title = $this->internationalize( get_post_meta( $page_for_posts, '_aioseop_title', true ) );
+ if ( ! $title ) {
+ $post_page = get_post( $page_for_posts );
+ $title = $this->internationalize( $post_page->post_title );
+ }
+ } else {
+ $title = $this->internationalize( get_post_meta( $post->ID, '_aioseop_title', true ) );
+ if ( ! $title ) {
+ $title = $this->internationalize( $post->post_title );
+ }
+ }
+ if ( ! $title ) {
+ $title = $this->internationalize( $this->get_original_title( '', false ) );
+ }
+
+ $title = $this->apply_page_title_format( $title, $post );
+ $title = $this->paged_title( $title );
+ $title = apply_filters( 'aioseop_title_page', $title );
+ if ( $this->is_static_posts_page() ) {
+ $title = apply_filters( 'single_post_title', $title );
+ }
+
+ return $title;
+ }
+ } else if ( function_exists( 'woocommerce_get_page_id' ) && is_post_type_archive( 'product' ) && ( $post_id = woocommerce_get_page_id( 'shop' ) ) && ( $post = get_post( $post_id ) ) ) {
+ // Too far down? -mrt.
+ $title = $this->internationalize( get_post_meta( $post->ID, '_aioseop_title', true ) );
+ if ( ! $title ) {
+ $title = $this->internationalize( $post->post_title );
+ }
+ if ( ! $title ) {
+ $title = $this->internationalize( $this->get_original_title( '', false ) );
+ }
+ $title = $this->apply_page_title_format( $title, $post );
+ $title = $this->paged_title( $title );
+ $title = apply_filters( 'aioseop_title_page', $title );
+
+ return $title;
+ } else if ( is_single() ) {
+ // We're not in the loop :(.
+ if ( null === $post ) {
+ return false;
+ }
+ $categories = $this->get_all_categories();
+ $category = '';
+ if ( count( $categories ) > 0 ) {
+ $category = $categories[0];
+ }
+ $title = $this->internationalize( get_post_meta( $post->ID, '_aioseop_title', true ) );
+ if ( ! $title ) {
+ $title = $this->internationalize( get_post_meta( $post->ID, 'title_tag', true ) );
+ if ( ! $title ) {
+ $title = $this->internationalize( $this->get_original_title( '', false ) );
+ }
+ }
+ if ( empty( $title ) ) {
+ $title = $post->post_title;
+ }
+ if ( ! empty( $title ) ) {
+ $title = $this->apply_post_title_format( $title, $category, $post );
+ }
+ $title = $this->paged_title( $title );
+
+ return apply_filters( 'aioseop_title_single', $title );
+ } else if ( is_search() && isset( $s ) && ! empty( $s ) ) {
+ $search = esc_attr( stripslashes( $s ) );
+ if ( ! empty( $aioseop_options['aiosp_cap_titles'] ) ) {
+ $search = $this->capitalize( $search );
+ }
+ $title_format = $aioseop_options['aiosp_search_title_format'];
+ $title = str_replace( '%blog_title%', $this->internationalize( get_bloginfo( 'name' ) ), $title_format );
+ if ( strpos( $title, '%blog_description%' ) !== false ) {
+ $title = str_replace( '%blog_description%', $this->internationalize( get_bloginfo( 'description' ) ), $title );
+ }
+ if ( strpos( $title, '%search%' ) !== false ) {
+ $title = str_replace( '%search%', $search, $title );
+ }
+ $title = $this->paged_title( $title );
+
+ return $title;
+ } else if ( is_tag() ) {
+ global $utw;
+ $tag = $tag_description = '';
+ if ( $utw ) {
+ $tags = $utw->GetCurrentTagSet();
+ $tag = $tags[0]->tag;
+ $tag = str_replace( '-', ' ', $tag );
+ } else {
+ if ( AIOSEOPPRO ) {
+ if ( ! empty( $opts ) && ! empty( $opts['aiosp_title'] ) ) {
+ $tag = $opts['aiosp_title'];
+ }
+ if ( ! empty( $opts ) ) {
+ if ( ! empty( $opts['aiosp_title'] ) ) {
+ $tag = $opts['aiosp_title'];
+ }
+ if ( ! empty( $opts['aiosp_description'] ) ) {
+ $tag_description = $opts['aiosp_description'];
+ }
+ }
+ }
+ if ( empty( $tag ) ) {
+ $tag = $this->get_original_title( '', false );
+ }
+ if ( empty( $tag_description ) ) {
+ $tag_description = tag_description();
+ }
+ $tag = $this->internationalize( $tag );
+ $tag_description = $this->internationalize( $tag_description );
+ }
+ if ( $tag ) {
+ if ( ! empty( $aioseop_options['aiosp_cap_titles'] ) ) {
+ $tag = $this->capitalize( $tag );
+ }
+ $title_format = $aioseop_options['aiosp_tag_title_format'];
+ $title = str_replace( '%blog_title%', $this->internationalize( get_bloginfo( 'name' ) ), $title_format );
+ if ( strpos( $title, '%blog_description%' ) !== false ) {
+ $title = str_replace( '%blog_description%', $this->internationalize( get_bloginfo( 'description' ) ), $title );
+ }
+ if ( strpos( $title, '%tag%' ) !== false ) {
+ $title = str_replace( '%tag%', $tag, $title );
+ }
+ if ( strpos( $title, '%tag_description%' ) !== false ) {
+ $title = str_replace( '%tag_description%', $tag_description, $title );
+ }
+ if ( strpos( $title, '%taxonomy_description%' ) !== false ) {
+ $title = str_replace( '%taxonomy_description%', $tag_description, $title );
+ }
+ $title = trim( wp_strip_all_tags( $title ) );
+ $title = str_replace( array( '"', "\r\n", "\n" ), array( '"', ' ', ' ' ), $title );
+ $title = $this->paged_title( $title );
+
+ return $title;
+ }
+ } else if ( ( is_tax() || is_category() ) && ! is_feed() ) {
+ return $this->get_tax_title();
+ } else if ( isset( $STagging ) && $STagging->is_tag_view() ) { // Simple tagging support.
+ $tag = $STagging->search_tag;
+ if ( $tag ) {
+ if ( ! empty( $aioseop_options['aiosp_cap_titles'] ) ) {
+ $tag = $this->capitalize( $tag );
+ }
+ $title_format = $aioseop_options['aiosp_tag_title_format'];
+ $title = str_replace( '%blog_title%', $this->internationalize( get_bloginfo( 'name' ) ), $title_format );
+ if ( strpos( $title, '%blog_description%' ) !== false ) {
+ $title = str_replace( '%blog_description%', $this->internationalize( get_bloginfo( 'description' ) ), $title );
+ }
+ if ( strpos( $title, '%tag%' ) !== false ) {
+ $title = str_replace( '%tag%', $tag, $title );
+ }
+ $title = $this->paged_title( $title );
+
+ return $title;
+ }
+ } else if ( is_archive() || is_post_type_archive() ) {
+ if ( is_author() ) {
+ $author = $this->internationalize( $this->get_original_title( '', false ) );
+ $title_format = $aioseop_options['aiosp_author_title_format'];
+ $new_title = str_replace( '%author%', $author, $title_format );
+ } else if ( is_date() ) {
+ global $wp_query;
+ $date = $this->internationalize( $this->get_original_title( '', false ) );
+ $title_format = $aioseop_options['aiosp_date_title_format'];
+ $new_title = str_replace( '%date%', $date, $title_format );
+ $day = get_query_var( 'day' );
+ if ( empty( $day ) ) {
+ $day = '';
+ }
+ $new_title = str_replace( '%day%', $day, $new_title );
+ $monthnum = get_query_var( 'monthnum' );
+ $year = get_query_var( 'year' );
+ if ( empty( $monthnum ) || is_year() ) {
+ $month = '';
+ $monthnum = 0;
+ }
+ $month = date( 'F', mktime( 0, 0, 0, (int) $monthnum, 1, (int) $year ) );
+ $new_title = str_replace( '%monthnum%', $monthnum, $new_title );
+ if ( strpos( $new_title, '%month%' ) !== false ) {
+ $new_title = str_replace( '%month%', $month, $new_title );
+ }
+ if ( strpos( $new_title, '%year%' ) !== false ) {
+ $new_title = str_replace( '%year%', get_query_var( 'year' ), $new_title );
+ }
+ } else if ( is_post_type_archive() ) {
+ if ( empty( $title ) ) {
+ $title = $this->get_original_title( '', false );
+ }
+ $new_title = apply_filters( 'aioseop_archive_title', $this->apply_archive_title_format( $title ) );
+ } else {
+ return false;
+ }
+ $new_title = str_replace( '%blog_title%', $this->internationalize( get_bloginfo( 'name' ) ), $new_title );
+ if ( strpos( $new_title, '%blog_description%' ) !== false ) {
+ $new_title = str_replace( '%blog_description%', $this->internationalize( get_bloginfo( 'description' ) ), $new_title );
+ }
+ $title = trim( $new_title );
+ $title = $this->paged_title( $title );
+
+ return $title;
+ } else if ( is_404() ) {
+ $title_format = $aioseop_options['aiosp_404_title_format'];
+ $new_title = str_replace( '%blog_title%', $this->internationalize( get_bloginfo( 'name' ) ), $title_format );
+ if ( strpos( $new_title, '%blog_description%' ) !== false ) {
+ $new_title = str_replace( '%blog_description%', $this->internationalize( get_bloginfo( 'description' ) ), $new_title );
+ }
+ if ( strpos( $new_title, '%request_url%' ) !== false ) {
+ $new_title = str_replace( '%request_url%', $_SERVER['REQUEST_URI'], $new_title );
+ }
+ if ( strpos( $new_title, '%request_words%' ) !== false ) {
+ $new_title = str_replace( '%request_words%', $this->request_as_words( $_SERVER['REQUEST_URI'] ), $new_title );
+ }
+ if ( strpos( $new_title, '%404_title%' ) !== false ) {
+ $new_title = str_replace( '%404_title%', $this->internationalize( $this->get_original_title( '', false ) ), $new_title );
+ }
+
+ return $new_title;
+ }
+
+ return false;
+ }
+
+ /**
+ * @param string $sep
+ * @param bool $echo
+ * @param string $seplocation
+ *
+ * @return The original title as delivered by WP (well, in most cases).
+ */
+ function get_original_title( $sep = '|', $echo = false, $seplocation = '' ) {
+ global $aioseop_options;
+ if ( ! empty( $aioseop_options['aiosp_use_original_title'] ) ) {
+ $has_filter = has_filter( 'wp_title', array( $this, 'wp_title' ) );
+ if ( false !== $has_filter ) {
+ remove_filter( 'wp_title', array( $this, 'wp_title' ), $has_filter );
+ }
+ if ( current_theme_supports( 'title-tag' ) ) {
+ $sep = '|';
+ $echo = false;
+ $seplocation = 'right';
+ }
+ $title = wp_title( $sep, $echo, $seplocation );
+ if ( false !== $has_filter ) {
+ add_filter( 'wp_title', array( $this, 'wp_title' ), $has_filter );
+ }
+ if ( $title && ( $title = trim( $title ) ) ) {
+ return trim( $title );
+ }
+ }
+
+ // the_search_query() is not suitable, it cannot just return.
+ global $s;
+
+ $title = null;
+
+ if ( is_home() ) {
+ $title = get_option( 'blogname' );
+ } else if ( is_single() ) {
+ $title = $this->internationalize( single_post_title( '', false ) );
+ } else if ( is_search() && isset( $s ) && ! empty( $s ) ) {
+ $search = esc_attr( stripslashes( $s ) );
+ if ( ! empty( $aioseop_options['aiosp_cap_titles'] ) ) {
+ $search = $this->capitalize( $search );
+ }
+ $title = $search;
+ } else if ( ( is_tax() || is_category() ) && ! is_feed() ) {
+ $category_name = $this->ucwords( $this->internationalize( single_cat_title( '', false ) ) );
+ $title = $category_name;
+ } else if ( is_page() ) {
+ $title = $this->internationalize( single_post_title( '', false ) );
+ } else if ( is_tag() ) {
+ global $utw;
+ if ( $utw ) {
+ $tags = $utw->GetCurrentTagSet();
+ $tag = $tags[0]->tag;
+ $tag = str_replace( '-', ' ', $tag );
+ } else {
+ // For WordPress > 2.3.
+ $tag = $this->internationalize( single_term_title( '', false ) );
+ }
+ if ( $tag ) {
+ $title = $tag;
+ }
+ } else if ( is_author() ) {
+ $author = get_userdata( get_query_var( 'author' ) );
+ if ( $author === false ) {
+ global $wp_query;
+ $author = $wp_query->get_queried_object();
+ }
+ if ( $author !== false ) {
+ $title = $author->display_name;
+ }
+ } else if ( is_day() ) {
+ $title = get_the_date();
+ } else if ( is_month() ) {
+ $title = get_the_date( 'F, Y' );
+ } else if ( is_year() ) {
+ $title = get_the_date( 'Y' );
+ } else if ( is_archive() ) {
+ $title = $this->internationalize( post_type_archive_title( '', false ) );
+ } else if ( is_404() ) {
+ $title_format = $aioseop_options['aiosp_404_title_format'];
+ $new_title = str_replace( '%blog_title%', $this->internationalize( get_bloginfo( 'name' ) ), $title_format );
+ if ( strpos( $new_title, '%blog_description%' ) !== false ) {
+ $new_title = str_replace( '%blog_description%', $this->internationalize( get_bloginfo( 'description' ) ), $new_title );
+ }
+ if ( strpos( $new_title, '%request_url%' ) !== false ) {
+ $new_title = str_replace( '%request_url%', $_SERVER['REQUEST_URI'], $new_title );
+ }
+ if ( strpos( $new_title, '%request_words%' ) !== false ) {
+ $new_title = str_replace( '%request_words%', $this->request_as_words( $_SERVER['REQUEST_URI'] ), $new_title );
+ }
+ $title = $new_title;
+ }
+
+ return trim( $title );
+ }
+
+ /**
+ * @param $s
+ *
+ * @return string
+ */
+ function capitalize( $s ) {
+ $s = trim( $s );
+ $tokens = explode( ' ', $s );
+ while ( list( $key, $val ) = each( $tokens ) ) {
+ $tokens[ $key ] = trim( $tokens[ $key ] );
+ $tokens[ $key ] = $this->strtoupper( $this->substr( $tokens[ $key ], 0, 1 ) ) . $this->substr( $tokens[ $key ], 1 );
+ }
+ $s = implode( ' ', $tokens );
+
+ return $s;
+ }
+
+ /**
+ * @param $request
+ *
+ * @return User -readable nice words for a given request.
+ */
+ function request_as_words( $request ) {
+ $request = htmlspecialchars( $request );
+ $request = str_replace( '.html', ' ', $request );
+ $request = str_replace( '.htm', ' ', $request );
+ $request = str_replace( '.', ' ', $request );
+ $request = str_replace( '/', ' ', $request );
+ $request = str_replace( '-', ' ', $request );
+ $request_a = explode( ' ', $request );
+ $request_new = array();
+ foreach ( $request_a as $token ) {
+ $request_new[] = $this->ucwords( trim( $token ) );
+ }
+ $request = implode( ' ', $request_new );
+
+ return $request;
+ }
+
+ /**
+ * @param $title
+ * @param null $p
+ * @param string $title_format
+ *
+ * @return string
+ */
+ function apply_page_title_format( $title, $p = null, $title_format = '' ) {
+ global $aioseop_options;
+ if ( $p === null ) {
+ global $post;
+ } else {
+ $post = $p;
+ }
+ if ( empty( $title_format ) ) {
+ $title_format = $aioseop_options['aiosp_page_title_format'];
+ }
+
+ return $this->title_placeholder_helper( $title, $post, 'page', $title_format );
+ }
+
+ /**
+ * @param $title
+ * @param $post
+ * @param string $type
+ * @param string $title_format
+ * @param string $category
+ *
+ * @return string
+ */
+ function title_placeholder_helper( $title, $post, $type = 'post', $title_format = '', $category = '' ) {
+ if ( ! empty( $post ) ) {
+ $authordata = get_userdata( $post->post_author );
+ } else {
+ $authordata = new WP_User();
+ }
+ $new_title = str_replace( '%blog_title%', $this->internationalize( get_bloginfo( 'name' ) ), $title_format );
+ if ( strpos( $new_title, '%blog_description%' ) !== false ) {
+ $new_title = str_replace( '%blog_description%', $this->internationalize( get_bloginfo( 'description' ) ), $new_title );
+ }
+ if ( strpos( $new_title, "%{$type}_title%" ) !== false ) {
+ $new_title = str_replace( "%{$type}_title%", $title, $new_title );
+ }
+ if ( $type == 'post' ) {
+ if ( strpos( $new_title, '%category%' ) !== false ) {
+ $new_title = str_replace( '%category%', $category, $new_title );
+ }
+ if ( strpos( $new_title, '%category_title%' ) !== false ) {
+ $new_title = str_replace( '%category_title%', $category, $new_title );
+ }
+ if ( strpos( $new_title, '%tax_' ) && ! empty( $post ) ) {
+ $taxes = get_object_taxonomies( $post, 'objects' );
+ if ( ! empty( $taxes ) ) {
+ foreach ( $taxes as $t ) {
+ if ( strpos( $new_title, "%tax_{$t->name}%" ) ) {
+ $terms = $this->get_all_terms( $post->ID, $t->name );
+ $term = '';
+ if ( count( $terms ) > 0 ) {
+ $term = $terms[0];
+ }
+ $new_title = str_replace( "%tax_{$t->name}%", $term, $new_title );
+ }
+ }
+ }
+ }
+ }
+ if ( strpos( $new_title, "%{$type}_author_login%" ) !== false ) {
+ $new_title = str_replace( "%{$type}_author_login%", $authordata->user_login, $new_title );
+ }
+ if ( strpos( $new_title, "%{$type}_author_nicename%" ) !== false ) {
+ $new_title = str_replace( "%{$type}_author_nicename%", $authordata->user_nicename, $new_title );
+ }
+ if ( strpos( $new_title, "%{$type}_author_firstname%" ) !== false ) {
+ $new_title = str_replace( "%{$type}_author_firstname%", $this->ucwords( $authordata->first_name ), $new_title );
+ }
+ if ( strpos( $new_title, "%{$type}_author_lastname%" ) !== false ) {
+ $new_title = str_replace( "%{$type}_author_lastname%", $this->ucwords( $authordata->last_name ), $new_title );
+ }
+ $title = trim( $new_title );
+
+ return $title;
+ }
+
+ /**
+ * @param $id
+ * @param $taxonomy
+ *
+ * @return array
+ */
+ function get_all_terms( $id, $taxonomy ) {
+ $keywords = array();
+ $terms = get_the_terms( $id, $taxonomy );
+ if ( ! empty( $terms ) ) {
+ foreach ( $terms as $term ) {
+ $keywords[] = $this->internationalize( $term->name );
+ }
+ }
+
+ return $keywords;
+ }
+
+ /**
+ * @param $title
+ *
+ * @return string
+ */
+ function paged_title( $title ) {
+ // The page number if paged.
+ global $paged;
+ global $aioseop_options;
+ // Simple tagging support.
+ global $STagging;
+ $page = get_query_var( 'page' );
+ if ( $paged > $page ) {
+ $page = $paged;
+ }
+ if ( is_paged() || ( isset( $STagging ) && $STagging->is_tag_view() && $paged ) || ( $page > 1 ) ) {
+ $part = $this->internationalize( $aioseop_options['aiosp_paged_format'] );
+ if ( isset( $part ) || ! empty( $part ) ) {
+ $part = ' ' . trim( $part );
+ $part = str_replace( '%page%', $page, $part );
+ $this->log( "paged_title() [$title] [$part]" );
+ $title .= $part;
+ }
+ }
+
+ return $title;
+ }
+
+ /**
+ * @param $message
+ */
+ function log( $message ) {
+ if ( $this->do_log ) {
+ @error_log( date( 'Y-m-d H:i:s' ) . ' ' . $message . "\n", 3, $this->log_file );
+ }
+ }
+
+ /**
+ * @param $title
+ * @param string $category
+ * @param null $p
+ *
+ * @return string
+ */
+ function apply_post_title_format( $title, $category = '', $p = null ) {
+ if ( $p === null ) {
+ global $post;
+ } else {
+ $post = $p;
+ }
+ $title_format = $this->get_post_title_format( 'post', $post );
+
+ return $this->title_placeholder_helper( $title, $post, 'post', $title_format, $category );
+ }
+
+ /**
+ * @param string $title_type
+ * @param null $p
+ *
+ * @return bool|string
+ */
+ function get_post_title_format( $title_type = 'post', $p = null ) {
+ global $aioseop_options;
+ if ( ( $title_type != 'post' ) && ( $title_type != 'archive' ) ) {
+ return false;
+ }
+ $title_format = "%{$title_type}_title% | %blog_title%";
+ if ( isset( $aioseop_options["aiosp_{$title_type}_title_format"] ) ) {
+ $title_format = $aioseop_options["aiosp_{$title_type}_title_format"];
+ }
+ if ( ! empty( $aioseop_options['aiosp_enablecpost'] ) && ! empty( $aioseop_options['aiosp_cpostactive'] ) ) {
+ $wp_post_types = $aioseop_options['aiosp_cpostactive'];
+ if ( ! empty( $aioseop_options['aiosp_cposttitles'] ) ) {
+ if ( ( ( $title_type == 'archive' ) && is_post_type_archive( $wp_post_types ) && $prefix = "aiosp_{$title_type}_" ) ||
+ ( ( $title_type == 'post' ) && $this->is_singular( $wp_post_types, $p ) && $prefix = 'aiosp_' )
+ ) {
+ $post_type = get_post_type( $p );
+ if ( ! empty( $aioseop_options["{$prefix}{$post_type}_title_format"] ) ) {
+ $title_format = $aioseop_options["{$prefix}{$post_type}_title_format"];
+ }
+ }
+ }
+ }
+
+ return $title_format;
+ }
+
+ /**
+ * @param array $post_types
+ * @param null $post
+ *
+ * @return bool
+ */
+ function is_singular( $post_types = array(), $post = null ) {
+ if ( ! empty( $post_types ) && is_object( $post ) ) {
+ return in_array( $post->post_type, (array) $post_types );
+ } else {
+ return is_singular( $post_types );
+ }
+ }
+
+ /**
+ * @return bool|null
+ */
+ function is_static_posts_page() {
+ static $is_posts_page = null;
+ if ( $is_posts_page !== null ) {
+ return $is_posts_page;
+ }
+ $post = $this->get_queried_object();
+ $is_posts_page = ( get_option( 'show_on_front' ) == 'page' && is_home() && ! empty( $post ) && $post->ID == get_option( 'page_for_posts' ) );
+
+ return $is_posts_page;
+ }
+
+ /**
+ * @return bool|null
+ */
+ function is_static_front_page() {
+ if ( isset( $this->is_front_page ) && $this->is_front_page !== null ) {
+ return $this->is_front_page;
+ }
+ $post = $this->get_queried_object();
+ $this->is_front_page = ( get_option( 'show_on_front' ) == 'page' && is_page() && ! empty( $post ) && $post->ID == get_option( 'page_on_front' ) );
+
+ return $this->is_front_page;
+ }
+
+ /**
+ * @param int $id
+ *
+ * @return array
+ */
+ function get_all_categories( $id = 0 ) {
+ $keywords = array();
+ $categories = get_the_category( $id );
+ if ( ! empty( $categories ) ) {
+ foreach ( $categories as $category ) {
+ $keywords[] = $this->internationalize( $category->cat_name );
+ }
+ }
+
+ return $keywords;
+ }
+
+ /**
+ * @param string $tax
+ *
+ * @return string
+ */
+ function get_tax_title( $tax = '' ) {
+ if ( AIOSEOPPRO ) {
+ if ( empty( $this->meta_opts ) ) {
+ $this->meta_opts = $this->get_current_options( array(), 'aiosp' );
+ }
}
- return $p;
+ if ( empty( $tax ) ) {
+ if ( is_category() ) {
+ $tax = 'category';
+ } else {
+ $tax = get_query_var( 'taxonomy' );
+ }
+ }
+ $name = $this->get_tax_name( $tax );
+ $desc = $this->get_tax_desc( $tax );
+
+ return $this->apply_tax_title_format( $name, $desc, $tax );
}
- function is_page_included() {
+ // Handle prev / next links.
+
+ /**
+ * @param $tax
+ *
+ * @return mixed|void
+ */
+ function get_tax_name( $tax ) {
global $aioseop_options;
- if ( is_feed() ) return false;
- if ( aioseop_mrt_exclude_this_page() ) return false;
- $post = $this->get_queried_object();
- $post_type = '';
- if ( !empty( $post ) && !empty( $post->post_type ) )
- $post_type = $post->post_type;
- if ( empty( $aioseop_options['aiosp_enablecpost'] ) ) {
- $wp_post_types = get_post_types( Array( '_builtin' => true ) ); // don't display meta if SEO isn't enabled on custom post types -- pdb
- if( is_singular() && !in_array( $post_type, $wp_post_types ) && !is_front_page() ) return false;
+ if ( AIOSEOPPRO ) {
+ $opts = $this->meta_opts;
+ if ( ! empty( $opts ) ) {
+ $name = $opts['aiosp_title'];
+ }
} else {
- $wp_post_types = $aioseop_options['aiosp_cpostactive'];
- if ( empty( $wp_post_types ) ) $wp_post_types = Array();
- if ( AIOSEOPPRO ) {
- if ( is_tax() ) {
- if ( empty( $aioseop_options['aiosp_taxactive'] ) || !is_tax( $aioseop_options['aiosp_taxactive'] ) ) return false;
- } elseif ( is_category() ) {
- if ( empty( $aioseop_options['aiosp_taxactive'] ) || !in_array( 'category', $aioseop_options['aiosp_taxactive'] ) ) return false;
- } elseif ( is_tag() ) {
- if ( empty( $aioseop_options['aiosp_taxactive'] ) || !in_array( 'post_tag', $aioseop_options['aiosp_taxactive'] ) ) return false;
- } else if ( !in_array( $post_type, $wp_post_types ) && !is_front_page() && !is_post_type_archive( $wp_post_types ) && !is_404() ) return false;
+ $name = '';
+ }
+ if ( empty( $name ) ) {
+ $name = single_term_title( '', false );
+ }
+ // 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?
+ // if ( ( $tax == 'category' ) && ( !empty( $aioseop_options['aiosp_cap_cats'] ) ) )
+ // $name = $this->ucwords( $name );
+
+ return $this->internationalize( $name );
+ }
+
+ /**
+ * @param $tax
+ *
+ * @return mixed|void
+ */
+ function get_tax_desc( $tax ) {
+ if ( AIOSEOPPRO ) {
+ $opts = $this->meta_opts;
+ if ( ! empty( $opts ) ) {
+ $desc = $opts['aiosp_description'];
+ }
+ } else {
+ $desc = '';
+ }
+ if ( empty( $desc ) ) {
+ $desc = term_description( '', $tax );
+ }
+
+ return $this->internationalize( $desc );
+ }
+
+ /**
+ * @param $category_name
+ * @param $category_description
+ * @param string $tax
+ *
+ * @return string
+ */
+ function apply_tax_title_format( $category_name, $category_description, $tax = '' ) {
+ if ( empty( $tax ) ) {
+ $tax = get_query_var( 'taxonomy' );
+ }
+ $title_format = $this->get_tax_title_format( $tax );
+ $title = str_replace( '%taxonomy_title%', $category_name, $title_format );
+ if ( strpos( $title, '%taxonomy_description%' ) !== false ) {
+ $title = str_replace( '%taxonomy_description%', $category_description, $title );
+ }
+ if ( strpos( $title, '%category_title%' ) !== false ) {
+ $title = str_replace( '%category_title%', $category_name, $title );
+ }
+ if ( strpos( $title, '%category_description%' ) !== false ) {
+ $title = str_replace( '%category_description%', $category_description, $title );
+ }
+ if ( strpos( $title, '%blog_title%' ) !== false ) {
+ $title = str_replace( '%blog_title%', $this->internationalize( get_bloginfo( 'name' ) ), $title );
+ }
+ if ( strpos( $title, '%blog_description%' ) !== false ) {
+ $title = str_replace( '%blog_description%', $this->internationalize( get_bloginfo( 'description' ) ), $title );
+ }
+ $title = wp_strip_all_tags( $title );
+
+ return $this->paged_title( $title );
+ }
+
+ /**
+ * @param string $tax
+ *
+ * @return string
+ */
+ function get_tax_title_format( $tax = '' ) {
+ global $aioseop_options;
+ if ( AIOSEOPPRO ) {
+ $title_format = '%taxonomy_title% | %blog_title%';
+ if ( is_category() ) {
+ $title_format = $aioseop_options['aiosp_category_title_format'];
+ } else {
+ $taxes = $aioseop_options['aiosp_taxactive'];
+ if ( empty( $tax ) ) {
+ $tax = get_query_var( 'taxonomy' );
+ }
+ if ( ! empty( $aioseop_options["aiosp_{$tax}_tax_title_format"] ) ) {
+ $title_format = $aioseop_options["aiosp_{$tax}_tax_title_format"];
+ }
+ }
+ if ( empty( $title_format ) ) {
+ $title_format = '%category_title% | %blog_title%';
+ }
+ } else {
+ $title_format = '%category_title% | %blog_title%';
+ if ( ! empty( $aioseop_options['aiosp_category_title_format'] ) ) {
+ $title_format = $aioseop_options['aiosp_category_title_format'];
+ }
+
+ return $title_format;
+ }
+
+ return $title_format;
+ }
+
+ /**
+ * @param $title
+ * @param string $category
+ *
+ * @return string
+ */
+ function apply_archive_title_format( $title, $category = '' ) {
+ $title_format = $this->get_archive_title_format();
+ $r_title = array( '%blog_title%', '%blog_description%', '%archive_title%' );
+ $d_title = array(
+ $this->internationalize( get_bloginfo( 'name' ) ),
+ $this->internationalize( get_bloginfo( 'description' ) ),
+ post_type_archive_title( '', false ),
+ );
+ $title = trim( str_replace( $r_title, $d_title, $title_format ) );
+
+ return $title;
+ }
+
+ /**
+ * @return bool|string
+ */
+ function get_archive_title_format() {
+ return $this->get_post_title_format( 'archive' );
+ }
+
+ /**
+ * @param null $post
+ *
+ * @return mixed|string|void
+ */
+ function get_main_description( $post = null ) {
+ global $aioseop_options;
+ $opts = $this->meta_opts;
+ $description = '';
+ if ( is_author() && $this->show_page_description() ) {
+ $description = $this->internationalize( get_the_author_meta( 'description' ) );
+ } else if ( function_exists( 'woocommerce_get_page_id' ) && is_post_type_archive( 'product' ) && ( $post_id = woocommerce_get_page_id( 'shop' ) ) && ( $post = get_post( $post_id ) ) ) {
+ // $description = $this->get_post_description( $post );
+ // $description = $this->apply_cf_fields( $description );
+ if ( ! ( woocommerce_get_page_id( 'shop' ) == get_option( 'page_on_front' ) ) ) {
+ $description = trim( $this->internationalize( get_post_meta( $post->ID, '_aioseop_description', true ) ) );
+ } else if ( woocommerce_get_page_id( 'shop' ) == get_option( 'page_on_front' ) && ! empty( $aioseop_options['aiosp_use_static_home_info'] ) ) {
+ // $description = $this->get_aioseop_description( $post );
+ $description = trim( $this->internationalize( get_post_meta( $post->ID, '_aioseop_description', true ) ) );
+ } else if ( woocommerce_get_page_id( 'shop' ) == get_option( 'page_on_front' ) && empty( $aioseop_options['aiosp_use_static_home_info'] ) ) {
+ $description = $this->get_aioseop_description( $post );
+ }
+ } else if ( is_front_page() ) {
+ $description = $this->get_aioseop_description( $post );
+ } else if ( is_single() || is_page() || is_attachment() || is_home() || $this->is_static_posts_page() ) {
+ $description = $this->get_aioseop_description( $post );
+ } else if ( ( is_category() || is_tag() || is_tax() ) && $this->show_page_description() ) {
+ if ( ! empty( $opts ) && AIOSEOPPRO ) {
+ $description = $opts['aiosp_description'];
+ }
+ if ( empty( $description ) ) {
+ $description = term_description();
+ }
+ $description = $this->internationalize( $description );
+ }
+ if ( empty( $aioseop_options['aiosp_dont_truncate_descriptions'] ) ) {
+ $description = $this->trim_excerpt_without_filters( $description );
+ }
+
+ return $description;
+ }
+
+ /**
+ * @return bool
+ */
+ function show_page_description() {
+ global $aioseop_options;
+ if ( ! empty( $aioseop_options['aiosp_hide_paginated_descriptions'] ) ) {
+ $page = $this->get_page_number();
+ if ( ! empty( $page ) && ( $page > 1 ) ) {
+ return false;
+ }
+ }
+
+ return true;
+ }
+
+ /**
+ * @return mixed
+ */
+ function get_page_number() {
+ $page = get_query_var( 'page' );
+ if ( empty( $page ) ) {
+ $page = get_query_var( 'paged' );
+ }
+
+ return $page;
+ }
+
+ /**
+ * @param null $post
+ *
+ * @return mixed|string
+ */
+ function get_aioseop_description( $post = null ) {
+ global $aioseop_options;
+ if ( null === $post ) {
+ $post = $GLOBALS['post'];
+ }
+ $blog_page = aiosp_common::get_blog_page();
+ $description = '';
+ if ( is_front_page() && empty( $aioseop_options['aiosp_use_static_home_info'] ) ) {
+ $description = trim( $this->internationalize( $aioseop_options['aiosp_home_description'] ) );
+ } elseif ( ! empty( $blog_page ) ) {
+ $description = $this->get_post_description( $blog_page );
+ }
+ if ( empty( $description ) && is_object( $post ) && ! is_archive() && empty( $blog_page ) ) {
+ $description = $this->get_post_description( $post );
+ }
+ $description = $this->apply_cf_fields( $description );
+
+ return $description;
+ }
+
+ /**
+ * @param $post
+ *
+ * @return mixed|string
+ */
+ function get_post_description( $post ) {
+ global $aioseop_options;
+ $description = '';
+ if ( ! $this->show_page_description() ) {
+ return '';
+ }
+ $description = trim( $this->internationalize( get_post_meta( $post->ID, '_aioseop_description', true ) ) );
+ if ( ! empty( $post ) && post_password_required( $post ) ) {
+ return $description;
+ }
+ if ( ! $description ) {
+ if ( empty( $aioseop_options['aiosp_skip_excerpt'] ) ) {
+ $description = $this->trim_excerpt_without_filters_full_length( $this->internationalize( $post->post_excerpt ) );
+ }
+ if ( ! $description && isset( $aioseop_options['aiosp_generate_descriptions'] ) && $aioseop_options['aiosp_generate_descriptions'] ) {
+ $content = $post->post_content;
+ if ( ! empty( $aioseop_options['aiosp_run_shortcodes'] ) ) {
+ $content = do_shortcode( $content );
+ }
+ $content = wp_strip_all_tags( $content );
+ $description = $this->trim_excerpt_without_filters( $this->internationalize( $content ) );
+ }
+ }
+
+ // Internal whitespace trim.
+ $description = preg_replace( '/\s\s+/u', ' ', $description );
+
+ return $description;
+ }
+
+ /**
+ * @param $text
+ *
+ * @return string
+ */
+ function trim_excerpt_without_filters_full_length( $text ) {
+ $text = str_replace( ']]>', ']]>', $text );
+ $text = preg_replace( '|\[(.+?)\](.+?\[/\\1\])?|s', '', $text );
+ $text = wp_strip_all_tags( $text );
+
+ return trim( $text );
+ }
+
+ /**
+ * @param $text
+ * @param int $max
+ *
+ * @return string
+ */
+ function trim_excerpt_without_filters( $text, $max = 0 ) {
+ $text = str_replace( ']]>', ']]>', $text );
+ $text = preg_replace( '|\[(.+?)\](.+?\[/\\1\])?|s', '', $text );
+ $text = wp_strip_all_tags( $text );
+ // Treat other common word-break characters like a space.
+ $text2 = preg_replace( '/[,._\-=+&!\?;:*]/s', ' ', $text );
+ if ( ! $max ) {
+ $max = $this->maximum_description_length;
+ }
+ $max_orig = $max;
+ $len = $this->strlen( $text2 );
+ if ( $max < $len ) {
+ if ( function_exists( 'mb_strrpos' ) ) {
+ $pos = mb_strrpos( $text2, ' ', - ( $len - $max ) );
+ if ( false === $pos ) {
+ $pos = $max;
+ }
+ if ( $pos > $this->minimum_description_length ) {
+ $max = $pos;
+ } else {
+ $max = $this->minimum_description_length;
+ }
+ } else {
+ while ( ' ' != $text2[ $max ] && $max > $this->minimum_description_length ) {
+ $max --;
+ }
+ }
+
+ // Probably no valid chars to break on?
+ if ( $len > $max_orig && $max < intval( $max_orig / 2 ) ) {
+ $max = $max_orig;
+ }
+ }
+ $text = $this->substr( $text, 0, $max );
+
+ return trim( $text );
+ }
+
+ /**
+ * @param $query
+ * @param bool $show_page
+ *
+ * @return bool|false|string
+ */
+ function aiosp_mrt_get_url( $query, $show_page = true ) {
+ if ( $query->is_404 || $query->is_search ) {
+ return false;
+ }
+ $link = '';
+ $haspost = count( $query->posts ) > 0;
+ if ( get_query_var( 'm' ) ) {
+ $m = preg_replace( '/[^0-9]/', '', get_query_var( 'm' ) );
+ switch ( $this->strlen( $m ) ) {
+ case 4:
+ $link = get_year_link( $m );
+ break;
+ case 6:
+ $link = get_month_link( $this->substr( $m, 0, 4 ), $this->substr( $m, 4, 2 ) );
+ break;
+ case 8:
+ $link = get_day_link( $this->substr( $m, 0, 4 ), $this->substr( $m, 4, 2 ), $this->substr( $m, 6, 2 ) );
+ break;
+ default:
+ return false;
+ }
+ } elseif ( $query->is_home && ( get_option( 'show_on_front' ) == 'page' ) && ( $pageid = get_option( 'page_for_posts' ) ) ) {
+ $link = get_permalink( $pageid );
+ } elseif ( is_front_page() || ( $query->is_home && ( get_option( 'show_on_front' ) != 'page' || ! get_option( 'page_for_posts' ) ) ) ) {
+ if ( function_exists( 'icl_get_home_url' ) ) {
+ $link = icl_get_home_url();
} else {
- if ( is_singular() && !in_array( $post_type, $wp_post_types ) && !is_front_page() ) return false;
- if ( is_post_type_archive() && !is_post_type_archive( $wp_post_types ) ) return false;
+ $link = trailingslashit( home_url() );
+ }
+ } elseif ( ( $query->is_single || $query->is_page ) && $haspost ) {
+ $post = $query->posts[0];
+ $link = get_permalink( $post->ID );
+ } elseif ( $query->is_author && $haspost ) {
+ $author = get_userdata( get_query_var( 'author' ) );
+ if ( false === $author ) {
+ return false;
+ }
+ $link = get_author_posts_url( $author->ID, $author->user_nicename );
+ } elseif ( $query->is_category && $haspost ) {
+ $link = get_category_link( get_query_var( 'cat' ) );
+ } elseif ( $query->is_tag && $haspost ) {
+ $tag = get_term_by( 'slug', get_query_var( 'tag' ), 'post_tag' );
+ if ( ! empty( $tag->term_id ) ) {
+ $link = get_tag_link( $tag->term_id );
+ }
+ } elseif ( $query->is_day && $haspost ) {
+ $link = get_day_link( get_query_var( 'year' ),
+ get_query_var( 'monthnum' ),
+ get_query_var( 'day' ) );
+ } elseif ( $query->is_month && $haspost ) {
+ $link = get_month_link( get_query_var( 'year' ),
+ get_query_var( 'monthnum' ) );
+ } elseif ( $query->is_year && $haspost ) {
+ $link = get_year_link( get_query_var( 'year' ) );
+ } elseif ( $query->is_tax && $haspost ) {
+ $taxonomy = get_query_var( 'taxonomy' );
+ $term = get_query_var( 'term' );
+ if ( ! empty( $term ) ) {
+ $link = get_term_link( $term, $taxonomy );
+ }
+ } elseif ( $query->is_archive && function_exists( 'get_post_type_archive_link' ) && ( $post_type = get_query_var( 'post_type' ) ) ) {
+ if ( is_array( $post_type ) ) {
+ $post_type = reset( $post_type );
}
+ $link = get_post_type_archive_link( $post_type );
+ } else {
+ return false;
}
-
- $this->meta_opts = $this->get_current_options( Array(), 'aiosp' );
-
- $aiosp_disable = $aiosp_disable_analytics = false;
-
- if ( !empty( $this->meta_opts ) ) {
- if ( isset( $this->meta_opts['aiosp_disable'] ) ) $aiosp_disable = $this->meta_opts['aiosp_disable'];
- if ( isset( $this->meta_opts['aiosp_disable_analytics'] ) ) $aiosp_disable_analytics = $this->meta_opts['aiosp_disable_analytics'];
+ if ( empty( $link ) || ! is_string( $link ) ) {
+ return false;
}
-
- if ( $aiosp_disable ) {
- if ( !$aiosp_disable_analytics ) {
- if ( aioseop_option_isset( 'aiosp_google_analytics_id' ) ) {
- remove_action( 'aioseop_modules_wp_head', array( $this, 'aiosp_google_analytics' ) );
- add_action( 'wp_head', array( $this, 'aiosp_google_analytics' ) );
+ if ( apply_filters( 'aioseop_canonical_url_pagination', $show_page ) ) {
+ $link = $this->get_paged( $link );
+ }
+ if ( ! empty( $link ) ) {
+ global $aioseop_options;
+ if ( isset( $aioseop_options['aiosp_can_set_protocol'] ) && ( 'auto' !== $aioseop_options['aiosp_can_set_protocol'] ) ) {
+ if ( 'http' === $aioseop_options['aiosp_can_set_protocol'] ) {
+ $link = preg_replace( '/^https:/i', 'http:', $link );
+ } elseif ( 'https' === $aioseop_options['aiosp_can_set_protocol'] ) {
+ $link = preg_replace( '/^http:/i', 'https:', $link );
}
}
- return false;
}
- if ( !empty( $this->meta_opts ) && $this->meta_opts['aiosp_disable'] == true ) return false;
-
- return true;
+ return $link;
}
- function template_redirect() {
- global $aioseop_options;
-
- $post = $this->get_queried_object();
-
- if ( !$this->is_page_included() ) return;
-
- if ( !empty( $aioseop_options['aiosp_rewrite_titles'] ) ) {
- $force_rewrites = 1;
- if ( isset( $aioseop_options['aiosp_force_rewrites'] ) )
- $force_rewrites = $aioseop_options['aiosp_force_rewrites'];
- if ( $force_rewrites )
- ob_start( array( $this, 'output_callback_for_title' ) );
- else
- add_filter( 'wp_title', array( $this, 'wp_title' ), 20 );
+ /**
+ * @param $link
+ *
+ * @return string
+ */
+ function get_paged( $link ) {
+ global $wp_rewrite;
+ $page = $this->get_page_number();
+ $page_name = 'page';
+ if ( ! empty( $wp_rewrite ) && ! empty( $wp_rewrite->pagination_base ) ) {
+ $page_name = $wp_rewrite->pagination_base;
+ }
+ if ( ! empty( $page ) && $page > 1 ) {
+ if ( $page == get_query_var( 'page' ) ) {
+ $link = trailingslashit( $link ) . "$page";
+ } else {
+ $link = trailingslashit( $link ) . trailingslashit( $page_name ) . $page;
+ }
+ $link = user_trailingslashit( $link, 'paged' );
}
- }
- function output_callback_for_title( $content ) {
- return $this->rewrite_title( $content );
+ return $link;
}
- function add_hooks() {
- global $aioseop_options, $aioseop_update_checker;
-
- $role = get_role( 'administrator' );
- if ( is_object( $role ) ) $role->add_cap( 'aiosp_manage_seo' );
-
- aioseop_update_settings_check();
- add_filter( 'user_contactmethods', 'aioseop_add_contactmethods' );
- if ( is_user_logged_in() && function_exists( 'is_admin_bar_showing' ) && is_admin_bar_showing() && current_user_can( 'aiosp_manage_seo' ) )
- add_action( 'admin_bar_menu', array( $this, 'admin_bar_menu' ), 1000 );
-
- if ( is_admin() ) {
- add_action( 'admin_menu', array( $this, 'admin_menu' ) );
- add_action( 'admin_head', array( $this, 'add_page_icon' ) );
- add_action( 'admin_init', 'aioseop_addmycolumns', 1 );
- add_action( 'admin_init', 'aioseop_handle_ignore_notice' );
- if ( AIOSEOPPRO ){
- if ( current_user_can( 'update_plugins' ) )
- add_action( 'admin_notices', Array( $aioseop_update_checker, 'key_warning' ) );
- add_action( 'after_plugin_row_' . AIOSEOP_PLUGIN_BASENAME, Array( $aioseop_update_checker, 'add_plugin_row' ) );
+ /**
+ * @return comma|string
+ */
+ function get_main_keywords() {
+ global $aioseop_options;
+ global $aioseop_keywords;
+ global $post;
+ $opts = $this->meta_opts;
+ if ( ( is_front_page() && $aioseop_options['aiosp_home_keywords'] && ! $this->is_static_posts_page() ) || $this->is_static_front_page() ) {
+ if ( ! empty( $aioseop_options['aiosp_use_static_home_info'] ) ) {
+ $keywords = $this->get_all_keywords();
+ } else {
+ $keywords = trim( $this->internationalize( $aioseop_options['aiosp_home_keywords'] ) );
}
+ } elseif ( empty( $aioseop_options['aiosp_dynamic_postspage_keywords'] ) && $this->is_static_posts_page() ) {
+ $keywords = stripslashes( $this->internationalize( $opts['aiosp_keywords'] ) ); // And if option = use page set keywords instead of keywords from recent posts.
+ } elseif ( ( $blog_page = aiosp_common::get_blog_page( $post ) ) && empty( $aioseop_options['aiosp_dynamic_postspage_keywords'] ) ) {
+ $keywords = stripslashes( $this->internationalize( get_post_meta( $blog_page->ID, '_aioseop_keywords', true ) ) );
+ } elseif ( empty( $aioseop_options['aiosp_dynamic_postspage_keywords'] ) && ( is_archive() || is_post_type_archive() ) ) {
+ $keywords = '';
} else {
- if ( $aioseop_options['aiosp_can'] == '1' || $aioseop_options['aiosp_can'] == 'on' )
- remove_action( 'wp_head', 'rel_canonical' );
- ////analytics
- if ( aioseop_option_isset( 'aiosp_google_analytics_id' ) )
- add_action( 'aioseop_modules_wp_head', array( $this, 'aiosp_google_analytics' ) );
- add_filter( 'wp_list_pages', 'aioseop_list_pages' );
- add_action( 'wp_head', array( $this, 'wp_head'), apply_filters( 'aioseop_wp_head_priority', 1 ) );
- add_action( 'template_redirect', array( $this, 'template_redirect' ), 0 );
- add_filter( 'wp_list_pages_excludes', 'aioseop_get_pages_start' );
- add_filter( 'get_pages', 'aioseop_get_pages' );
+ $keywords = $this->get_all_keywords();
}
- }
-
- function is_static_front_page() {
- if ( isset( $this->is_front_page ) && $this->is_front_page !== null ) return $this->is_front_page;
- $post = $this->get_queried_object();
- $this->is_front_page = ( get_option( 'show_on_front' ) == 'page' && is_page() && !empty( $post ) && $post->ID == get_option( 'page_on_front' ) );
- return $this->is_front_page;
- }
- function is_static_posts_page() {
- static $is_posts_page = null;
- if ( $is_posts_page !== null ) return $is_posts_page;
- $post = $this->get_queried_object();
- $is_posts_page = ( get_option( 'show_on_front' ) == 'page' && is_home() && !empty( $post ) && $post->ID == get_option( 'page_for_posts' ) );
- return $is_posts_page;
+ return $keywords;
}
- function check_rewrite_handler() {
+ /**
+ * @return comma-separated list of unique keywords
+ */
+ function get_all_keywords() {
+ global $posts;
global $aioseop_options;
+ if ( is_404() ) {
+ return null;
+ }
+ // If we are on synthetic pages.
+ if ( ! is_home() && ! is_page() && ! is_single() && ! $this->is_static_front_page() && ! $this->is_static_posts_page() && ! is_archive() && ! is_post_type_archive() && ! is_category() && ! is_tag() && ! is_tax() ) {
+ return null;
+ }
+ $keywords = array();
+ $opts = $this->meta_opts;
+ if ( ! empty( $opts['aiosp_keywords'] ) ) {
+ $traverse = $this->keyword_string_to_list( $this->internationalize( $opts['aiosp_keywords'] ) );
+ if ( ! empty( $traverse ) ) {
+ foreach ( $traverse as $keyword ) {
+ $keywords[] = $keyword;
+ }
+ }
+ }
+ if ( empty( $posts ) ) {
+ global $post;
+ $post_arr = array( $post );
+ } else {
+ $post_arr = $posts;
+ }
+ if ( is_array( $post_arr ) ) {
+ $postcount = count( $post_arr );
+ foreach ( $post_arr as $p ) {
+ if ( $p ) {
+ $id = $p->ID;
+ if ( 1 == $postcount || ! empty( $aioseop_options['aiosp_dynamic_postspage_keywords'] ) ) {
+ // Custom field keywords.
+ $keywords_i = null;
+ $keywords_i = stripslashes( $this->internationalize( get_post_meta( $id, '_aioseop_keywords', true ) ) );
+ if ( is_attachment() ) {
+ $id = $p->post_parent;
+ if ( empty( $keywords_i ) ) {
+ $keywords_i = stripslashes( $this->internationalize( get_post_meta( $id, '_aioseop_keywords', true ) ) );
+ }
+ }
+ $traverse = $this->keyword_string_to_list( $keywords_i );
+ if ( ! empty( $traverse ) ) {
+ foreach ( $traverse as $keyword ) {
+ $keywords[] = $keyword;
+ }
+ }
+ }
- $force_rewrites = 1;
- if ( isset( $aioseop_options['aiosp_force_rewrites'] ) )
- $force_rewrites = $aioseop_options['aiosp_force_rewrites'];
+ if ( ! empty( $aioseop_options['aiosp_use_tags_as_keywords'] ) ) {
+ $keywords = array_merge( $keywords, $this->get_all_tags( $id ) );
+ }
+ // Autometa.
+ $autometa = stripslashes( get_post_meta( $id, 'autometa', true ) );
+ if ( isset( $autometa ) && ! empty( $autometa ) ) {
+ $autometa_array = explode( ' ', $autometa );
+ foreach ( $autometa_array as $e ) {
+ $keywords[] = $e;
+ }
+ }
- if ( !empty( $aioseop_options['aiosp_rewrite_titles'] ) && $force_rewrites ) {
- // make the title rewrite as short as possible
- if (function_exists( 'ob_list_handlers' ) ) {
- $active_handlers = ob_list_handlers();
- } else {
- $active_handlers = array();
- }
- if (sizeof($active_handlers) > 0 &&
- $this->strtolower( $active_handlers[sizeof( $active_handlers ) - 1] ) ==
- $this->strtolower( 'All_in_One_SEO_Pack::output_callback_for_title' ) ) {
- ob_end_flush();
- } else {
- $this->log( "another plugin interfering?" );
- // if we get here there *could* be trouble with another plugin :(
- $this->ob_start_detected = true;
- if ( $this->option_isset( "rewrite_titles" ) ) { // try alternate method -- pdb
- $aioseop_options['aiosp_rewrite_titles'] = 0;
- $force_rewrites = 0;
- add_filter( 'wp_title', array( $this, 'wp_title' ), 20 );
- }
- if ( function_exists( 'ob_list_handlers' ) ) {
- foreach ( ob_list_handlers() as $handler ) {
- $this->log( "detected output handler $handler" );
+ if ( isset( $aioseop_options['aiosp_use_categories'] ) && $aioseop_options['aiosp_use_categories'] && ! is_page() ) {
+ $keywords = array_merge( $keywords, $this->get_all_categories( $id ) );
}
}
}
}
+
+ return $this->get_unique_keywords( $keywords );
}
- // handle prev / next links
- function get_prev_next_links( $post = null ) {
- $prev = $next = '';
- $page = $this->get_page_number();
- if ( is_home() || is_archive() || is_paged() ) {
- global $wp_query;
- $max_page = $wp_query->max_num_pages;
- if ( $page > 1 )
- $prev = get_previous_posts_page_link();
- if ( $page < $max_page ) {
- $paged = $GLOBALS['paged'];
- if ( !is_single() ) {
- if ( !$paged )
- $paged = 1;
- $nextpage = intval($paged) + 1;
- if ( !$max_page || $max_page >= $nextpage )
- $next = get_pagenum_link($nextpage);
- }
- }
- } else if ( is_page() || is_single() ) {
- $numpages = 1;
- $multipage = 0;
- $page = get_query_var('page');
- if ( ! $page )
- $page = 1;
- if ( is_single() || is_page() || is_feed() )
- $more = 1;
- $content = $post->post_content;
- if ( false !== strpos( $content, '' ) ) {
- if ( $page > 1 )
- $more = 1;
- $content = str_replace( "\n\n", '', $content );
- $content = str_replace( "\n", '', $content );
- $content = str_replace( "\n", '', $content );
- // Ignore nextpage at the beginning of the content.
- if ( 0 === strpos( $content, '' ) )
- $content = substr( $content, 15 );
- $pages = explode('', $content);
- $numpages = count($pages);
- if ( $numpages > 1 )
- $multipage = 1;
- }
- if ( !empty( $page ) ) {
- if ( $page > 1 )
- $prev = _wp_link_page( $page - 1 );
- if ( $page + 1 <= $numpages )
- $next = _wp_link_page( $page + 1 );
- }
- if ( !empty( $prev ) ) {
- $prev = $this->substr( $prev, 9, -2 );
+ /**
+ * @param $keywords
+ *
+ * @return array
+ */
+ function keyword_string_to_list( $keywords ) {
+ $traverse = array();
+ $keywords_i = str_replace( '"', '', $keywords );
+ if ( isset( $keywords_i ) && ! empty( $keywords_i ) ) {
+ $traverse = explode( ',', $keywords_i );
+ }
+
+ return $traverse;
+ }
+
+ /**
+ * @param int $id
+ *
+ * @return array
+ */
+ function get_all_tags( $id = 0 ) {
+ $keywords = array();
+ $tags = get_the_tags( $id );
+ if ( ! empty( $tags ) && is_array( $tags ) ) {
+ foreach ( $tags as $tag ) {
+ $keywords[] = $this->internationalize( $tag->name );
}
- if ( !empty( $next ) ) {
- $next = $this->substr( $next, 9, -2 );
+ }
+ // Ultimate Tag Warrior integration.
+ global $utw;
+ if ( $utw ) {
+ $tags = $utw->GetTagsForPost( $p );
+ if ( is_array( $tags ) ) {
+ foreach ( $tags as $tag ) {
+ $tag = $tag->tag;
+ $tag = str_replace( '_', ' ', $tag );
+ $tag = str_replace( '-', ' ', $tag );
+ $tag = stripslashes( $tag );
+ $keywords[] = $tag;
+ }
}
}
- return Array( 'prev' => $prev, 'next' => $next );
- }
- function get_google_authorship( $post ) {
- global $aioseop_options;
- $page = $this->get_page_number();
- // handle authorship
- $googleplus = $publisher = $author = '';
+ return $keywords;
+ }
- if ( !empty( $post ) && isset( $post->post_author ) && empty( $aioseop_options['aiosp_google_disable_profile'] ) )
- $googleplus = get_the_author_meta( 'googleplus', $post->post_author );
+ /**
+ * @param $keywords
+ *
+ * @return string
+ */
+ function get_unique_keywords( $keywords ) {
+ return implode( ',', $this->clean_keyword_list( $keywords ) );
+ }
- if ( empty( $googleplus ) && !empty( $aioseop_options['aiosp_google_publisher'] ) )
- $googleplus = $aioseop_options['aiosp_google_publisher'];
+ /**
+ * @param $keywords
+ *
+ * @return array
+ */
+ function clean_keyword_list( $keywords ) {
+ $small_keywords = array();
+ if ( ! is_array( $keywords ) ) {
+ $keywords = $this->keyword_string_to_list( $keywords );
+ }
+ if ( ! empty( $keywords ) ) {
+ foreach ( $keywords as $word ) {
+ $small_keywords[] = trim( $this->strtolower( $word ) );
+ }
+ }
- if ( ( is_front_page() ) && ( $page < 2 ) ) {
- if ( !empty( $aioseop_options['aiosp_google_publisher'] ) )
- $publisher = $aioseop_options['aiosp_google_publisher'];
+ return array_unique( $small_keywords );
+ }
- if ( !empty( $aioseop_options["aiosp_google_author_advanced"] ) ) {
- if ( empty( $aioseop_options["aiosp_google_enable_publisher"] ) ) {
- $publisher = '';
- } elseif ( !empty( $aioseop_options["aiosp_google_specify_publisher"] ) ) {
- $publisher = $aioseop_options["aiosp_google_specify_publisher"];
+ /**
+ * @param $term_id
+ * @param $new_term_id
+ * @param string $term_taxonomy_id
+ * @param string $taxonomy
+ */
+ function split_shared_term( $term_id, $new_term_id, $term_taxonomy_id = '', $taxonomy = '' ) {
+ $terms = $this->get_all_term_data( $term_id );
+ if ( ! empty( $terms ) ) {
+ $new_terms = $this->get_all_term_data( $new_term_id );
+ if ( empty( $new_terms ) ) {
+ foreach ( $terms as $k => $v ) {
+ add_term_meta( $new_term_id, $k, $v, true );
}
+ add_term_meta( $term_id, '_aioseop_term_was_split', true, true );
}
}
- if ( is_singular() && ( !empty( $googleplus ) ) )
- $author = $googleplus;
- else if ( !empty( $aioseop_options['aiosp_google_publisher'] ) )
- $author = $aioseop_options['aiosp_google_publisher'];
+ }
- if ( !empty( $aioseop_options['aiosp_google_author_advanced'] ) && isset( $aioseop_options['aiosp_google_author_location'] ) ) {
- if ( empty( $aioseop_options['aiosp_google_author_location'] ) )
- $aioseop_options['aiosp_google_author_location'] = Array();
- if ( is_front_page() && !in_array( 'front', $aioseop_options['aiosp_google_author_location'] ) ) {
- $author = '';
- } else {
- if ( in_array( 'all', $aioseop_options['aiosp_google_author_location'] ) ) {
- if ( is_singular() && !is_singular( $aioseop_options['aiosp_google_author_location'] ) )
- $author = '';
- } else {
- if ( !is_singular( $aioseop_options['aiosp_google_author_location'] ) )
- $author = '';
- }
+ /**
+ * @param $term_id
+ *
+ * @return array
+ */
+ function get_all_term_data( $term_id ) {
+ $terms = array();
+ $optlist = array(
+ 'keywords',
+ 'description',
+ 'title',
+ 'custom_link',
+ 'sitemap_exclude',
+ 'disable',
+ 'disable_analytics',
+ 'noindex',
+ 'nofollow',
+ 'noodp',
+ 'noydir',
+ 'titleatr',
+ 'menulabel',
+ );
+ foreach ( $optlist as $f ) {
+ $meta = get_term_meta( $term_id, '_aioseop_' . $f, true );
+ if ( ! empty( $meta ) ) {
+ $terms[ '_aioseop_' . $f ] = $meta;
}
}
- return Array( 'publisher' => $publisher, 'author' => $author );
+ return $terms;
}
- function visibility_warning() {
-
- $aioseop_visibility_notice_dismissed = get_user_meta( get_current_user_id(), 'aioseop_visibility_notice_dismissed', true );
-
- if ( '0' == get_option('blog_public') && empty( $aioseop_visibility_notice_dismissed ) ) {
-
- printf( '
- ',
- __( 'Warning: You\'re blocking access to search engines.', 'all-in-one-seo-pack' ),
- sprintf( __( 'You can %s click here%s to go to your reading settings and toggle your blog visibility.', 'all-in-one-seo-pack' ), sprintf( '', esc_url( admin_url( 'options-reading.php' ) ) ), ' ' ));
+ function add_page_icon() {
+ wp_enqueue_script( 'wp-pointer', false, array( 'jquery' ) );
+ wp_enqueue_style( 'wp-pointer' );
+ $this->add_admin_pointers();
- }elseif( '1' == get_option('blog_public') && !empty( $aioseop_visibility_notice_dismissed ) ){
- delete_user_meta( get_current_user_id(), 'aioseop_visibility_notice_dismissed' );
+ wp_enqueue_style( 'aiosp_admin_style', AIOSEOP_PLUGIN_URL . 'css/aiosp_admin.css' );
+ ?>
+
+ pointers['aioseop_menu_236'] = array(
+ 'pointer_target' => '#toplevel_page_all-in-one-seo-pack-pro-aioseop_class',
+ 'pointer_text' => '' . sprintf( __( 'Welcome to Version %s!', 'all-in-one-seo-pack' ), AIOSEOP_VERSION )
+ . ' ' . __( 'Thank you for running the latest and greatest All in One SEO Pack Pro ever! Please review your settings, as we\'re always adding new features for you!', 'all-in-one-seo-pack' ) . '
',
+ 'pointer_edge' => 'top',
+ 'pointer_align' => 'left',
+ 'pointer_scope' => 'global',
+ );
+ $this->pointers['aioseop_welcome_230'] = array(
+ 'pointer_target' => '#aioseop_top_button',
+ 'pointer_text' => '' . sprintf( __( 'Review Your Settings', 'all-in-one-seo-pack' ), AIOSEOP_VERSION )
+ . ' ' . __( 'New in 2.4: Improved support for taxonomies, Woocommerce and massive performance improvements under the hood! Please review your settings on each options page!', 'all-in-one-seo-pack' ) . '
',
+ 'pointer_edge' => 'bottom',
+ 'pointer_align' => 'left',
+ 'pointer_scope' => 'local',
+ );
+ $this->filter_pointers();
+ } else {
+ $this->pointers['aioseop_menu_220'] = array(
+ 'pointer_target' => '#toplevel_page_all-in-one-seo-pack-aioseop_class',
+ 'pointer_text' => '' . sprintf( __( 'Welcome to Version %s!', 'all-in-one-seo-pack' ), AIOSEOP_VERSION )
+ . ' ' . __( 'Thank you for running the latest and greatest All in One SEO Pack ever! Please review your settings, as we\'re always adding new features for you!', 'all-in-one-seo-pack' ) . '
',
+ 'pointer_edge' => 'top',
+ 'pointer_align' => 'left',
+ 'pointer_scope' => 'global',
+ );
+ $this->pointers['aioseop_welcome_220'] = array(
+ 'pointer_target' => '#aioseop_top_button',
+ 'pointer_text' => '' . sprintf( __( 'Review Your Settings', 'all-in-one-seo-pack' ), AIOSEOP_VERSION )
+ . ' ' . __( 'Thank you for running the latest and greatest All in One SEO Pack ever! New since 2.2: Control who accesses your site with the new Robots.txt Editor and File Editor modules! Enable them from the Feature Manager. Remember to review your settings, we have added some new ones!', 'all-in-one-seo-pack' ) . '
',
+ 'pointer_edge' => 'bottom',
+ 'pointer_align' => 'left',
+ 'pointer_scope' => 'local',
+ );
+ $this->filter_pointers();
+ }
}
- function woo_upgrade_notice() {
-
- $aioseop_woo_upgrade_notice_dismissed = get_user_meta( get_current_user_id(), 'aioseop_woo_upgrade_notice_dismissed', true );
+ function add_page_hooks() {
- if ( class_exists( 'WooCommerce' ) && empty( $aioseop_woo_upgrade_notice_dismissed ) && current_user_can( 'manage_options' ) ) {
+ global $aioseop_options;
- printf( '
-
-
- %1$s
- %2$s
+ $post_objs = get_post_types( '', 'objects' );
+ $pt = array_keys( $post_objs );
+ $rempost = array( 'revision', 'nav_menu_item' );
+ $pt = array_diff( $pt, $rempost );
+ $post_types = array();
-
-
',
- __( 'We\'ve detected you\'re running WooCommerce.', 'all-in-one-seo-pack' ),
- sprintf( __( '%s Upgrade%s to All in One SEO Pack Pro for increased SEO compatibility for your products.', 'all-in-one-seo-pack' ), sprintf( '', esc_url( 'http://semperplugins.com/plugins/all-in-one-seo-pack-pro-version/?loc=woo' ) ), ' ' ));
+ $aiosp_enablecpost = '';
+ if ( isset( $_REQUEST['aiosp_enablecpost'] ) ) {
+ $aiosp_enablecpost = $_REQUEST['aiosp_enablecpost'];
+ }
- }elseif( !class_exists( 'WooCommerce' ) && !empty( $aioseop_woo_upgrade_notice_dismissed ) ){
- delete_user_meta( get_current_user_id(), 'aioseop_woo_upgrade_notice_dismissed' );
+ foreach ( $pt as $p ) {
+ if ( ! empty( $post_objs[ $p ]->label ) ) {
+ if ( $post_objs[ $p ]->_builtin && empty( $aioseop_options['aiosp_enablecpost'] ) ) {
+ $post_types[ $p ] = $post_objs[ $p ]->label;
+ } elseif ( ! empty( $aioseop_options['aiosp_enablecpost'] ) || $aiosp_enablecpost == 'on' ) {
+ $post_types[ $p ] = $post_objs[ $p ]->label;
+ }
+ } else {
+ $post_types[ $p ] = $p;
}
- }
+ }
- function get_robots_meta() {
- global $aioseop_options;
- $opts = $this->meta_opts;
- $page = $this->get_page_number();
- $robots_meta = $tax_noindex = '';
- if ( isset( $aioseop_options['aiosp_tax_noindex'] ) ) $tax_noindex = $aioseop_options['aiosp_tax_noindex'];
+ foreach ( $pt as $p ) {
+ if ( ! empty( $post_objs[ $p ]->label ) ) {
+ $all_post_types[ $p ] = $post_objs[ $p ]->label;
+ }
+ }
- if ( empty( $tax_noindex ) || !is_array( $tax_noindex) ) $tax_noindex = Array();
+ $taxes = get_taxonomies( '', 'objects' );
+ $tx = array_keys( $taxes );
+ $remtax = array( 'nav_menu', 'link_category', 'post_format' );
+ $tx = array_diff( $tx, $remtax );
+ $tax_types = array();
+ foreach ( $tx as $t ) {
+ if ( ! empty( $taxes[ $t ]->label ) ) {
+ $tax_types[ $t ] = $taxes[ $t ]->label;
+ } else {
+ $taxes[ $t ] = $t;
+ }
+ }
+ $this->default_options['posttypecolumns']['initial_options'] = $post_types;
+ $this->default_options['cpostactive']['initial_options'] = $all_post_types;
+ $this->default_options['cpostnoindex']['initial_options'] = $post_types;
+ $this->default_options['cpostnofollow']['initial_options'] = $post_types;
+ $this->default_options['cpostnoodp']['initial_options'] = $post_types;
+ $this->default_options['cpostnoydir']['initial_options'] = $post_types;
+ if ( AIOSEOPPRO ) {
+ $this->default_options['taxactive']['initial_options'] = $tax_types;
+ }
+ $this->default_options['google_author_location']['initial_options'] = $post_types;
+ $this->default_options['google_author_location']['initial_options'] = array_merge( array( 'front' => __( 'Front Page', 'all-in-one-seo-pack' ) ), $post_types, array( 'all' => __( 'Everywhere Else', 'all-in-one-seo-pack' ) ) );
+ $this->default_options['google_author_location']['default'] = array_keys( $this->default_options['google_author_location']['initial_options'] );
- $aiosp_noindex = $aiosp_nofollow = $aiosp_noodp = $aiosp_noydir = '';
- $noindex = "index";
- $nofollow = "follow";
- if ( ( is_category() && !empty( $aioseop_options['aiosp_category_noindex'] ) ) || ( !is_category() && is_archive() && !is_tag() && !is_tax()
- && ( ( is_date() && !empty( $aioseop_options['aiosp_archive_date_noindex'] ) ) || ( is_author() && !empty( $aioseop_options['aiosp_archive_author_noindex'] ) ) ) )
- || ( is_tag() && !empty( $aioseop_options['aiosp_tags_noindex'] ) )
- || ( is_search() && !empty( $aioseop_options['aiosp_search_noindex'] ) )
- || ( is_404() && !empty( $aioseop_options['aiosp_404_noindex'] ) )
- || ( is_tax() && in_array( get_query_var( 'taxonomy' ), $tax_noindex ) ) ) {
- $noindex = 'noindex';
- } elseif ( ( is_single() || is_page() || $this->is_static_posts_page() || is_attachment() || is_category() || is_tag() || is_tax() || ( $page > 1 ) ) ) {
- $post_type = get_post_type();
- if ( !empty( $opts ) ) {
- $aiosp_noindex = htmlspecialchars( stripslashes( $opts['aiosp_noindex'] ) );
- $aiosp_nofollow = htmlspecialchars( stripslashes( $opts['aiosp_nofollow'] ) );
- $aiosp_noodp = htmlspecialchars( stripslashes( $opts['aiosp_noodp'] ) );
- $aiosp_noydir = htmlspecialchars( stripslashes( $opts['aiosp_noydir'] ) );
- }
- if ( $aiosp_noindex || $aiosp_nofollow || $aiosp_noodp || $aiosp_noydir || !empty( $aioseop_options['aiosp_cpostnoindex'] )
- || !empty( $aioseop_options['aiosp_cpostnofollow'] ) || !empty( $aioseop_options['aiosp_cpostnoodp'] ) || !empty( $aioseop_options['aiosp_cpostnoydir'] )
- || !empty( $aioseop_options['aiosp_paginated_noindex'] ) || !empty( $aioseop_options['aiosp_paginated_nofollow'] ) ) {
- if ( ( $aiosp_noindex == 'on' ) || ( ( !empty( $aioseop_options['aiosp_paginated_noindex'] ) ) && ( ( $page > 1 ) ) ) ||
- ( ( $aiosp_noindex == '' ) && ( !empty( $aioseop_options['aiosp_cpostnoindex'] ) ) && ( in_array( $post_type, $aioseop_options['aiosp_cpostnoindex'] ) ) ) )
- $noindex = "noindex";
- if ( ( $aiosp_nofollow == 'on' ) || ( ( !empty( $aioseop_options['aiosp_paginated_nofollow'] ) ) && ( ( $page > 1 ) ) ) ||
- ( ( $aiosp_nofollow == '' ) && ( !empty( $aioseop_options['aiosp_cpostnofollow'] ) ) && ( in_array( $post_type, $aioseop_options['aiosp_cpostnofollow'] ) ) ) )
- $nofollow = "nofollow";
- if ( ( $aiosp_noodp == 'on' ) || ( empty( $aiosp_noodp ) && ( !empty( $aioseop_options['aiosp_cpostnoodp'] ) && ( in_array( $post_type, $aioseop_options['aiosp_cpostnoodp'] ) ) ) ) )
- $aiosp_noodp = true;
- else
- $aiosp_noodp = false;
- if ( ( $aiosp_noydir == 'on' ) || ( empty( $aiosp_noydir ) && ( !empty( $aioseop_options['aiosp_cpostnoydir'] ) && ( in_array( $post_type, $aioseop_options['aiosp_cpostnoydir'] ) ) ) ) )
- $aiosp_noydir = true;
- else
- $aiosp_noydir = false;
+ foreach ( $post_types as $p => $pt ) {
+ $field = $p . '_title_format';
+ $name = $post_objs[ $p ]->labels->singular_name;
+ if ( ! isset( $this->default_options[ $field ] ) ) {
+ $this->default_options[ $field ] = array(
+ 'name' => "$name " . __( 'Title Format:', 'all-in-one-seo-pack' ) . " ($p)",
+ 'type' => 'text',
+ 'default' => '%post_title% | %blog_title%',
+ 'condshow' => array(
+ 'aiosp_rewrite_titles' => 1,
+ 'aiosp_enablecpost' => 'on',
+ 'aiosp_cpostadvanced' => 'on',
+ 'aiosp_cposttitles' => 'on',
+ 'aiosp_cpostactive\[\]' => $p,
+ ),
+ );
+ $this->help_text[ $field ] = __( 'The following macros are supported:', 'all-in-one-seo-pack' )
+ . '' . __( '%blog_title% - Your blog title', 'all-in-one-seo-pack' ) . ' ' .
+ __( '%blog_description% - Your blog description', 'all-in-one-seo-pack' ) . ' ' .
+ __( '%post_title% - The original title of the post.', 'all-in-one-seo-pack' ) . ' ';
+ $taxes = get_object_taxonomies( $p, 'objects' );
+ if ( ! empty( $taxes ) ) {
+ foreach ( $taxes as $n => $t ) {
+ $this->help_text[ $field ] .= sprintf( __( "%%tax_%s%% - This post's associated %s taxonomy title", 'all-in-one-seo-pack' ), $n, $t->label ) . ' ';
+ }
+ }
+ $this->help_text[ $field ] .=
+ __( "%post_author_login% - This post's author' login", 'all-in-one-seo-pack' ) . ' ' .
+ __( "%post_author_nicename% - This post's author' nicename", 'all-in-one-seo-pack' ) . ' ' .
+ __( "%post_author_firstname% - This post's author' first name (capitalized)", 'all-in-one-seo-pack' ) . ' ' .
+ __( "%post_author_lastname% - This post's author' last name (capitalized)", 'all-in-one-seo-pack' ) . ' ' .
+ ' ';
+ $this->help_anchors[ $field ] = '#custom-titles';
+ $this->layout['cpt']['options'][] = $field;
}
}
- if ( !empty( $aioseop_options['aiosp_noodp'] ) && $aioseop_options['aiosp_noodp'] ) $aiosp_noodp = true;
- if ( !empty( $aioseop_options['aiosp_noydir'] ) && $aioseop_options['aiosp_noydir'] ) $aiosp_noydir = true;
- if ( $aiosp_noodp ) $nofollow .= ',noodp';
- if ( $aiosp_noydir ) $nofollow .= ',noydir';
- $robots_meta = $noindex . ',' . $nofollow;
- if ( $robots_meta == 'index,follow' ) $robots_meta = '';
- return $robots_meta;
- }
+ global $wp_roles;
+ if ( ! isset( $wp_roles ) ) {
+ $wp_roles = new WP_Roles();
+ }
+ $role_names = $wp_roles->get_names();
+ ksort( $role_names );
+ $this->default_options['ga_exclude_users']['initial_options'] = $role_names;
- function get_main_description( $post = null ) {
- global $aioseop_options;
- $opts = $this->meta_opts;
- $description = '';
- if ( is_author() && $this->show_page_description() ) {
- $description = $this->internationalize( get_the_author_meta( 'description' ) );
- } else if ( function_exists( 'woocommerce_get_page_id' ) && is_post_type_archive( 'product' ) && ( $post_id = woocommerce_get_page_id( 'shop' ) ) && ( $post = get_post( $post_id ) ) ) {
- //$description = $this->get_post_description( $post );
- //$description = $this->apply_cf_fields( $description );
- if ( !(woocommerce_get_page_id( 'shop' ) == get_option( 'page_on_front' ) ) ){
- $description = trim( ( $this->internationalize( get_post_meta( $post->ID, "_aioseop_description", true ) ) ) );
- }
- else if ( woocommerce_get_page_id( 'shop' ) == get_option( 'page_on_front' ) && !empty( $aioseop_options['aiosp_use_static_home_info'] ) ){
- //$description = $this->get_aioseop_description( $post );
- $description = trim( ( $this->internationalize( get_post_meta( $post->ID, "_aioseop_description", true ) ) ) );
- }else if ( woocommerce_get_page_id( 'shop' ) == get_option( 'page_on_front' ) && empty( $aioseop_options['aiosp_use_static_home_info'] ) ){
- $description = $this->get_aioseop_description( $post );
+ unset( $tax_types['category'] );
+ unset( $tax_types['post_tag'] );
+ $this->default_options['tax_noindex']['initial_options'] = $tax_types;
+ if ( empty( $tax_types ) ) {
+ unset( $this->default_options['tax_noindex'] );
}
- } else if ( is_front_page() ) {
- $description = $this->get_aioseop_description( $post );
- } else if ( is_single() || is_page() || is_attachment() || is_home() || $this->is_static_posts_page() ) {
- $description = $this->get_aioseop_description( $post );
- } else if ( ( is_category() || is_tag() || is_tax() ) && $this->show_page_description() ) {
- if ( !empty( $opts ) && AIOSEOPPRO ) $description = $opts['aiosp_description'];
- if ( empty( $description ) ) $description = term_description();
- $description = $this->internationalize( $description );
+
+ if ( AIOSEOPPRO ) {
+ foreach ( $tax_types as $p => $pt ) {
+ $field = $p . '_tax_title_format';
+ $name = $pt;
+ if ( ! isset( $this->default_options[ $field ] ) ) {
+ $this->default_options[ $field ] = array(
+ 'name' => "$name " . __( 'Taxonomy Title Format:', 'all-in-one-seo-pack' ),
+ 'type' => 'text',
+ 'default' => '%taxonomy_title% | %blog_title%',
+ 'condshow' => array(
+ 'aiosp_rewrite_titles' => 1,
+ 'aiosp_enablecpost' => 'on',
+ 'aiosp_cpostadvanced' => 'on',
+ 'aiosp_cposttitles' => 'on',
+ 'aiosp_taxactive\[\]' => $p,
+ ),
+ );
+ $this->help_text[ $field ] = __( 'The following macros are supported:', 'all-in-one-seo-pack' ) .
+ '' . __( '%blog_title% - Your blog title', 'all-in-one-seo-pack' ) . ' ' .
+ __( '%blog_description% - Your blog description', 'all-in-one-seo-pack' ) . ' ' .
+ __( '%taxonomy_title% - The original title of the taxonomy', 'all-in-one-seo-pack' ) . ' ' .
+ __( '%taxonomy_description% - The description of the taxonomy', 'all-in-one-seo-pack' ) . ' ';
+ $this->help_anchors[ $field ] = '#custom-titles';
+ $this->layout['cpt']['options'][] = $field;
+ }
+ }
}
- if ( empty( $aioseop_options['aiosp_dont_truncate_descriptions'] ) ) {
- $description = $this->trim_excerpt_without_filters( $description );
+ $this->setting_options();
+ $this->add_help_text_links();
+
+ if ( AIOSEOPPRO ) {
+ global $aioseop_update_checker;
+ add_action( "{$this->prefix}update_options", array(
+ $aioseop_update_checker,
+ 'license_change_check',
+ ), 10, 2 );
+ add_action( "{$this->prefix}settings_update", array( $aioseop_update_checker, 'update_check' ), 10, 2 );
}
- return $description;
- }
- function trim_description( $description ) {
- $description = trim( wp_strip_all_tags( $description ) );
- $description = str_replace( '"', '"', $description );
- $description = str_replace( "\r\n", ' ', $description );
- $description = str_replace( "\n", ' ', $description );
- return $description;
+ add_filter( "{$this->prefix}display_options", array( $this, 'filter_options' ), 10, 2 );
+ parent::add_page_hooks();
}
- function apply_description_format( $description, $post = null ) {
- global $aioseop_options;
- $description_format = $aioseop_options['aiosp_description_format'];
- if ( !isset( $description_format ) || empty( $description_format ) ) {
- $description_format = "%description%";
- }
- $description = str_replace( '%description%', apply_filters( 'aioseop_description_override', $description ), $description_format );
- if ( strpos( $description, '%blog_title%' ) !== false ) $description = str_replace( '%blog_title%', get_bloginfo( 'name' ), $description );
- if ( strpos( $description, '%blog_description%' ) !== false ) $description = str_replace( '%blog_description%', get_bloginfo( 'description' ), $description );
- if ( strpos( $description, '%wp_title%' ) !== false ) $description = str_replace( '%wp_title%', $this->get_original_title(), $description );
- if ( strpos( $description, '%post_title%' ) !== false ) $description = str_replace( '%post_title%', $this->get_aioseop_title( $post ), $description );
+ function settings_page_init() {
+ add_filter( "{$this->prefix}submit_options", array( $this, 'filter_submit' ) );
+ }
+ function enqueue_scripts() {
+ add_filter( "{$this->prefix}display_settings", array( $this, 'filter_settings' ), 10, 3 );
+ add_filter( "{$this->prefix}display_options", array( $this, 'filter_options' ), 10, 2 );
+ parent::enqueue_scripts();
+ }
- /*this was intended to make attachment descriptions unique if pulling from the parent... let's remove it and see if there are any problems
- *on the roadmap is to have a better hierarchy for attachment description pulling
- * if ($aioseop_options['aiosp_can']) $description = $this->make_unique_att_desc($description);
- */
+ /**
+ * @param $submit
+ *
+ * @return mixed
+ */
+ function filter_submit( $submit ) {
+ $submit['Submit_Default']['value'] = __( 'Reset General Settings to Defaults', 'all-in-one-seo-pack' ) . ' »';
+ $submit['Submit_All_Default'] = array(
+ 'type' => 'submit',
+ 'class' => 'button-secondary',
+ 'value' => __( 'Reset ALL Settings to Defaults', 'all-in-one-seo-pack' ) . ' »',
+ );
- return $description;
+ return $submit;
}
- function make_unique_att_desc($description){
- global $wp_query;
- if( is_attachment() ) {
-
- $url = $this->aiosp_mrt_get_url( $wp_query );
- if ( $url ) {
- $matches = Array();
- preg_match_all( '/(\d+)/', $url, $matches );
- if ( is_array( $matches ) ){
- $uniqueDesc = join( '', $matches[0] );
+ /**
+ * Handle resetting options to defaults, but preserve the license key if pro.
+ *
+ * @param null $location
+ * @param bool $delete
+ */
+ function reset_options( $location = null, $delete = false ) {
+ if ( AIOSEOPPRO ) {
+ global $aioseop_update_checker;
+ }
+ if ( $delete === true ) {
+
+ if ( AIOSEOPPRO ) {
+ $license_key = '';
+ if ( isset( $this->options ) && isset( $this->options['aiosp_license_key'] ) ) {
+ $license_key = $this->options['aiosp_license_key'];
}
}
- $description .= ' ' . $uniqueDesc;
- return $description;
- }
- }
- function get_main_keywords() {
- global $aioseop_options;
- global $aioseop_keywords;
- global $post;
- $opts = $this->meta_opts;
- if ( ( ( is_front_page() && $aioseop_options['aiosp_home_keywords'] && !$this->is_static_posts_page() ) || $this->is_static_front_page() ) ) {
- if ( !empty( $aioseop_options['aiosp_use_static_home_info'] ) ) {
- $keywords = $this->get_all_keywords();
+ $this->delete_class_option( $delete );
+
+ if ( AIOSEOPPRO ) {
+ $this->options = array( 'aiosp_license_key' => $license_key );
} else {
- $keywords = trim( $this->internationalize( $aioseop_options['aiosp_home_keywords'] ) );
+ $this->options = array();
}
- } elseif ( empty( $aioseop_options['aiosp_dynamic_postspage_keywords'] ) && $this->is_static_posts_page() ) {
- $keywords = stripslashes( $this->internationalize( $opts["aiosp_keywords"] ) ); // and if option = use page set keywords instead of keywords from recent posts
- } elseif ( ( $blog_page = aiosp_common::get_blog_page( $post ) ) && empty( $aioseop_options['aiosp_dynamic_postspage_keywords'] ) ) {
- $keywords = stripslashes( $this->internationalize( get_post_meta( $blog_page->ID, "_aioseop_keywords", true ) ) );
- } elseif ( empty( $aioseop_options['aiosp_dynamic_postspage_keywords'] ) && ( is_archive() || is_post_type_archive() ) ) {
- $keywords = "";
- } else {
- $keywords = $this->get_all_keywords();
}
- return $keywords;
- }
+ $default_options = $this->default_options( $location );
- function wp_head() {
- if ( !$this->is_page_included() ) return;
- $opts = $this->meta_opts;
- global $aioseop_update_checker, $wp_query, $aioseop_options, $posts;
- static $aioseop_dup_counter = 0;
- $aioseop_dup_counter++;
- if ( $aioseop_dup_counter > 1 ) {
- echo "\n\n";
- return;
- }
- if ( is_home() && !is_front_page() ) {
- $post = aiosp_common::get_blog_page();
- } else {
- $post = $this->get_queried_object();
+ if ( AIOSEOPPRO ) {
+ foreach ( $default_options as $k => $v ) {
+ if ( $k != 'aiosp_license_key' ) {
+ $this->options[ $k ] = $v;
+ }
}
- $meta_string = null;
- $description = '';
- // logging - rewrite handler check for output buffering
- $this->check_rewrite_handler();
- if ( AIOSEOPPRO ) {
- echo "\n\n";
- if ( AIOSEOPPRO ) echo "\n";
- $blog_page = aiosp_common::get_blog_page( $post );
- $save_posts = $posts;
- if ( function_exists( 'woocommerce_get_page_id' ) && is_post_type_archive( 'product' ) && ( $post_id = woocommerce_get_page_id( 'shop' ) ) && ( $post = get_post( $post_id ) ) ) {
- global $posts;
- $opts = $this->meta_opts = $this->get_current_options( Array(), 'aiosp', null, $post );
- $posts = Array();
- $posts[] = $post;
- }
- $posts = $save_posts;
- $description = apply_filters( 'aioseop_description', $this->get_main_description( $post ) ); // get the description
- // handle the description format
- if ( isset($description) && ( $this->strlen($description) > $this->minimum_description_length ) && !( is_front_page() && is_paged() ) ) {
- $description = $this->trim_description( $description );
- if ( !isset( $meta_string) ) $meta_string = '';
- // description format
- $description = apply_filters( 'aioseop_description_full', $this->apply_description_format( $description, $post ) );
- $desc_attr = '';
- if ( !empty( $aioseop_options['aiosp_schema_markup'] ) )
- $desc_attr = 'itemprop="description"';
- $desc_attr = apply_filters( 'aioseop_description_attributes', $desc_attr );
- $meta_string .= sprintf( " \n", $desc_attr, $description );
- }
- // get the keywords
- $togglekeywords = 0;
- if ( isset( $aioseop_options['aiosp_togglekeywords'] ) )
- $togglekeywords = $aioseop_options['aiosp_togglekeywords'];
- if ( $togglekeywords == 0 && !( is_front_page() && is_paged() ) ) {
- $keywords = $this->get_main_keywords();
- $keywords = $this->apply_cf_fields( $keywords );
- $keywords = apply_filters( 'aioseop_keywords', $keywords );
-
- if ( isset( $keywords ) && !empty( $keywords ) ) {
- if ( isset( $meta_string ) ) $meta_string .= "\n";
- $keywords = wp_filter_nohtml_kses( str_replace( '"', '', $keywords ) );
- $key_attr = '';
- if ( !empty( $aioseop_options['aiosp_schema_markup'] ) )
- $key_attr = 'itemprop="keywords"';
- $key_attr = apply_filters( 'aioseop_keywords_attributes', $key_attr );
- $meta_string .= sprintf( " \n", $key_attr, $keywords );
- }
- }
- // handle noindex, nofollow - robots meta
- $robots_meta = apply_filters( 'aioseop_robots_meta', $this->get_robots_meta() );
- if ( !empty( $robots_meta ) )
- $meta_string .= ' ' . "\n";
- // handle site verification
- if ( is_front_page() ) {
- foreach( Array( 'google' => 'google-site-verification', 'bing' => 'msvalidate.01', 'pinterest' => 'p:domain_verify' ) as $k => $v )
- if ( !empty( $aioseop_options["aiosp_{$k}_verify"] ) )
- $meta_string .= ' ' . "\n";
-
- // sitelinks search
- if ( !empty( $aioseop_options["aiosp_google_sitelinks_search"] ) || !empty( $aioseop_options["aiosp_google_set_site_name"] ) )
- $meta_string .= $this->sitelinks_search_box() . "\n";
- }
- // handle extra meta fields
- foreach( Array( 'page_meta', 'post_meta', 'home_meta', 'front_meta' ) as $meta ) {
- if ( !empty( $aioseop_options["aiosp_{$meta}_tags" ] ) )
- $$meta = html_entity_decode( stripslashes( $aioseop_options["aiosp_{$meta}_tags" ] ), ENT_QUOTES );
- else
- $$meta = '';
- }
- if ( is_page() && isset( $page_meta ) && !empty( $page_meta ) && ( !is_front_page() || empty( $front_meta ) ) ) {
- if ( isset( $meta_string ) ) $meta_string .= "\n";
- $meta_string .= $page_meta;
- }
- if ( is_single() && isset( $post_meta ) && !empty( $post_meta ) ) {
- if ( isset( $meta_string ) ) $meta_string .= "\n";
- $meta_string .= $post_meta;
- }
- // handle authorship
- $authorship = $this->get_google_authorship( $post );
- $publisher = apply_filters( 'aioseop_google_publisher', $authorship["publisher"] );
- if ( !empty( $publisher ) )
- $meta_string = ' ' . "\n" . $meta_string;
- $author = apply_filters( 'aioseop_google_author', $authorship["author"] );
- if ( !empty( $author ) )
- $meta_string = ' ' . "\n" . $meta_string;
-
- if ( is_front_page() && !empty( $front_meta ) ) {
- if ( isset( $meta_string ) ) $meta_string .= "\n";
- $meta_string .= $front_meta;
- } else {
- if ( is_home() && !empty( $home_meta ) ) {
- if ( isset( $meta_string ) ) $meta_string .= "\n";
- $meta_string .= $home_meta;
- }
- }
- $prev_next = $this->get_prev_next_links( $post );
- $prev = apply_filters( 'aioseop_prev_link', $prev_next['prev'] );
- $next = apply_filters( 'aioseop_next_link', $prev_next['next'] );
- if ( !empty( $prev ) ) $meta_string .= " \n";
- if ( !empty( $next ) ) $meta_string .= " \n";
- if ( $meta_string != null ) echo "$meta_string\n";
- // handle canonical links
- $show_page = true;
- if ( !empty( $aioseop_options["aiosp_no_paged_canonical_links"] ) ) $show_page = false;
-
- if ( $aioseop_options['aiosp_can'] ) {
- $url = '';
- if ( !empty( $aioseop_options['aiosp_customize_canonical_links'] ) && !empty( $opts['aiosp_custom_link'] ) ) $url = $opts['aiosp_custom_link'];
- if ( empty( $url ) )
- $url = $this->aiosp_mrt_get_url( $wp_query, $show_page );
- $url = apply_filters( 'aioseop_canonical_url', $url );
- if ( !empty( $url ) )
- echo ' '."\n";
- }
- do_action( 'aioseop_modules_wp_head' );
- if ( AIOSEOPPRO ) {
- echo "\n";
- } else{
- echo "\n";
+ $aioseop_update_checker->license_key = $this->options['aiosp_license_key'];
+ } else {
+ foreach ( $default_options as $k => $v ) {
+ $this->options[ $k ] = $v;
}
- }
-
- function override_options( $options, $location, $settings ) {
- if ( class_exists( 'DOMDocument' ) ) {
- $options['aiosp_google_connect'] = $settings['aiosp_google_connect']['default'];
}
- return $options;
+ $this->update_class_option( $this->options );
}
- function get_analytics_domain() {
- global $aioseop_options;
- if ( !empty( $aioseop_options['aiosp_ga_domain'] ) )
- return $this->sanitize_domain( $aioseop_options['aiosp_ga_domain'] );
- return '';
- }
+ /**
+ * @param $settings
+ * @param $location
+ * @param $current
+ *
+ * @return mixed
+ */
+ function filter_settings( $settings, $location, $current ) {
+ if ( $location == null ) {
+ $prefix = $this->prefix;
- function universal_analytics() {
- global $aioseop_options;
- $analytics = '';
- if ( !empty( $aioseop_options['aiosp_ga_use_universal_analytics'] ) ) {
- $allow_linker = $cookie_domain = $domain = $addl_domains = $domain_list = '';
- if ( !empty( $aioseop_options['aiosp_ga_advanced_options'] ) )
- $cookie_domain = $this->get_analytics_domain();
- if ( !empty( $cookie_domain ) ) {
- $cookie_domain = esc_js( $cookie_domain );
- $cookie_domain = "'cookieDomain': '{$cookie_domain}'";
+ foreach ( array( 'seopostcol', 'seocustptcol', 'debug_info', 'max_words_excerpt' ) as $opt ) {
+ unset( $settings["{$prefix}$opt"] );
}
- if ( empty( $cookie_domain ) ) {
- $domain = ", 'auto'";
+
+ if ( ! class_exists( 'DOMDocument' ) ) {
+ unset( $settings['{prefix}google_connect'] );
}
- if ( !empty( $aioseop_options['aiosp_ga_advanced_options'] ) && !empty( $aioseop_options['aiosp_ga_multi_domain'] ) ) {
- $allow_linker = "'allowLinker': true";
- if ( !empty( $aioseop_options['aiosp_ga_addl_domains'] ) ) {
- $addl_domains = trim( $aioseop_options['aiosp_ga_addl_domains'] );
- $addl_domains = preg_split('/[\s,]+/', $addl_domains);
- if ( !empty( $addl_domains ) ) {
- foreach( $addl_domains as $d ) {
- $d = $this->sanitize_domain( $d );
- if ( !empty( $d ) ) {
- if ( !empty( $domain_list ) )
- $domain_list .= ", ";
- $domain_list .= "'" . $d . "'";
- }
- }
- }
+ if ( AIOSEOPPRO ) {
+ if ( ! empty( $this->options['aiosp_license_key'] ) ) {
+ $settings['aiosp_license_key']['type'] = 'password';
+ $settings['aiosp_license_key']['size'] = 38;
}
}
- $extra_options = '';
- if ( !empty( $aioseop_options['aiosp_ga_advanced_options'] ) && !empty( $aioseop_options['aiosp_ga_display_advertising'] ) ) {
- $extra_options .= "ga('require', 'displayfeatures');";
+ } elseif ( $location == 'aiosp' ) {
+ global $post, $aioseop_sitemap;
+ $prefix = $this->get_prefix( $location ) . $location . '_';
+ if ( ! empty( $post ) ) {
+ $post_type = get_post_type( $post );
+ if ( ! empty( $this->options['aiosp_cpostnoindex'] ) && in_array( $post_type, $this->options['aiosp_cpostnoindex'] ) ) {
+ $settings["{$prefix}noindex"]['type'] = 'select';
+ $settings["{$prefix}noindex"]['initial_options'] = array(
+ '' => __( 'Default - noindex', 'all-in-one-seo-pack' ),
+ 'off' => __( 'index', 'all-in-one-seo-pack' ),
+ 'on' => __( 'noindex', 'all-in-one-seo-pack' ),
+ );
+ }
+ if ( ! empty( $this->options['aiosp_cpostnofollow'] ) && in_array( $post_type, $this->options['aiosp_cpostnofollow'] ) ) {
+ $settings["{$prefix}nofollow"]['type'] = 'select';
+ $settings["{$prefix}nofollow"]['initial_options'] = array(
+ '' => __( 'Default - nofollow', 'all-in-one-seo-pack' ),
+ 'off' => __( 'follow', 'all-in-one-seo-pack' ),
+ 'on' => __( 'nofollow', 'all-in-one-seo-pack' ),
+ );
+ }
+ if ( ! empty( $this->options['aiosp_cpostnoodp'] ) && in_array( $post_type, $this->options['aiosp_cpostnoodp'] ) ) {
+ $settings["{$prefix}noodp"]['type'] = 'select';
+ $settings["{$prefix}noodp"]['initial_options'] = array(
+ '' => __( 'Default - noodp', 'all-in-one-seo-pack' ),
+ 'off' => __( 'odp', 'all-in-one-seo-pack' ),
+ 'on' => __( 'noodp', 'all-in-one-seo-pack' ),
+ );
+ }
+ if ( ! empty( $this->options['aiosp_cpostnoydir'] ) && in_array( $post_type, $this->options['aiosp_cpostnoydir'] ) ) {
+ $settings["{$prefix}noydir"]['type'] = 'select';
+ $settings["{$prefix}noydir"]['initial_options'] = array(
+ '' => __( 'Default - noydir', 'all-in-one-seo-pack' ),
+ 'off' => __( 'ydir', 'all-in-one-seo-pack' ),
+ 'on' => __( 'noydir', 'all-in-one-seo-pack' ),
+ );
+ }
+ global $post;
+ $info = $this->get_page_snippet_info();
+ extract( $info );
+ $settings["{$prefix}title"]['placeholder'] = $title;
+ $settings["{$prefix}description"]['placeholder'] = $description;
+ $settings["{$prefix}keywords"]['placeholder'] = $keywords;
}
- if ( !empty( $aioseop_options['aiosp_ga_advanced_options'] ) && !empty( $aioseop_options['aiosp_ga_enhanced_ecommerce'] ) ) {
- if ( !empty( $extra_options ) ) $extra_options .= "\n\t\t\t";
- $extra_options .= "ga('require', 'ec');";
+
+ if ( ! AIOSEOPPRO ) {
+ if ( ! current_user_can( 'update_plugins' ) ) {
+ unset( $settings["{$prefix}upgrade"] );
+ }
}
- if ( !empty( $domain_list ) ) {
- if ( !empty( $extra_options ) ) $extra_options .= "\n\t\t\t";
- $extra_options .= "ga('require', 'linker');\n\t\t\tga('linker:autoLink', [{$domain_list}] );";
+
+ if ( ! is_object( $aioseop_sitemap ) ) {
+ unset( $settings['aiosp_sitemap_exclude'] );
}
- if ( !empty( $aioseop_options['aiosp_ga_advanced_options'] ) && !empty( $aioseop_options['aiosp_ga_link_attribution'] ) ) {
- if ( !empty( $extra_options ) ) $extra_options .= "\n\t\t\t";
- $extra_options .= "ga('require', 'linkid', 'linkid.js');";
+ if ( is_object( $post ) ) {
+ if ( $post->post_type != 'page' ) {
+ unset( $settings["{$prefix}titleatr"] );
+ unset( $settings["{$prefix}menulabel"] );
+ }
+ }
+ if ( ! empty( $this->options[ $this->prefix . 'togglekeywords' ] ) ) {
+ unset( $settings["{$prefix}keywords"] );
+ unset( $settings["{$prefix}togglekeywords"] );
+ } elseif ( ! empty( $current["{$prefix}togglekeywords"] ) ) {
+ unset( $settings["{$prefix}keywords"] );
+ }
+ if ( empty( $this->options['aiosp_can'] ) || empty( $this->options['aiosp_customize_canonical_links'] ) ) {
+ unset( $settings["{$prefix}custom_link"] );
}
+ }
- if ( !empty( $aioseop_options['aiosp_ga_advanced_options'] ) && !empty( $aioseop_options['aiosp_ga_anonymize_ip'] ) ) {
- if ( !empty( $extra_options ) ) $extra_options .= "\n\t\t\t";
- $extra_options .= "ga('set', 'anonymizeIp', true);";
+ return $settings;
+ }
+
+ /**
+ * @param $options
+ * @param $location
+ *
+ * @return mixed
+ */
+ function filter_options( $options, $location ) {
+ if ( $location == 'aiosp' ) {
+ global $post;
+ if ( ! empty( $post ) ) {
+ $prefix = $this->prefix;
+ $post_type = get_post_type( $post );
+ foreach ( array( 'noindex', 'nofollow', 'noodp', 'noydir' ) as $no ) {
+ if ( empty( $this->options[ 'aiosp_cpost' . $no ] ) || ( ! in_array( $post_type, $this->options[ 'aiosp_cpost' . $no ] ) ) ) {
+ if ( isset( $options["{$prefix}{$no}"] ) && ( $options["{$prefix}{$no}"] != 'on' ) ) {
+ unset( $options["{$prefix}{$no}"] );
+ }
+ }
+ }
+ }
+ }
+ if ( $location == null ) {
+ $prefix = $this->prefix;
+ if ( isset( $options["{$prefix}rewrite_titles"] ) && ( ! empty( $options["{$prefix}rewrite_titles"] ) ) ) {
+ $options["{$prefix}rewrite_titles"] = 1;
}
- $js_options = Array();
- foreach( Array( 'cookie_domain', 'allow_linker' ) as $opts ) {
- if ( !empty( $$opts ) ) $js_options[] = $$opts;
+ if ( isset( $options["{$prefix}enablecpost"] ) && ( $options["{$prefix}enablecpost"] === '' ) ) {
+ $options["{$prefix}enablecpost"] = 0;
}
- if ( !empty( $js_options ) ) {
- $js_options = join( ',', $js_options );
- $js_options = ', { ' . $js_options . ' } ';
- } else $js_options = '';
- $analytics_id = esc_js( $aioseop_options["aiosp_google_analytics_id"] );
- $analytics =<<
- (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
- (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
- m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
- })(window,document,'script','//www.google-analytics.com/analytics.js','ga');
+ if ( isset( $options["{$prefix}use_original_title"] ) && ( $options["{$prefix}use_original_title"] === '' ) ) {
+ $options["{$prefix}use_original_title"] = 0;
+ }
+ }
- ga('create', '{$analytics_id}'{$domain}{$js_options});
- {$extra_options}
- ga('send', 'pageview');
-
+ return $options;
+ }
-EOF;
+ function template_redirect() {
+ global $aioseop_options;
+
+ $post = $this->get_queried_object();
+
+ if ( ! $this->is_page_included() ) {
+ return;
}
- return $analytics;
- }
-function aiosp_google_analytics() {
- global $aioseop_options;
- $analytics = '';
- if ( !empty( $aioseop_options['aiosp_ga_advanced_options'] ) && !empty( $aioseop_options['aiosp_ga_exclude_users'] ) ) {
- if ( is_user_logged_in() ) {
- global $current_user;
- if ( empty( $current_user ) ) get_currentuserinfo();
- if ( !empty( $current_user ) ) {
- $intersect = array_intersect( $aioseop_options['aiosp_ga_exclude_users'], $current_user->roles );
- if ( !empty( $intersect ) ) return;
- }
- }
- }
- if ( !empty( $aioseop_options['aiosp_google_analytics_id'] ) ) {
- ob_start();
- $analytics = $this->universal_analytics();
- echo $analytics;
- if ( empty( $analytics ) ) {
-?>
-
-
-get_queried_object();
+ $post_type = '';
+ if ( ! empty( $post ) && ! empty( $post->post_type ) ) {
+ $post_type = $post->post_type;
+ }
+ if ( empty( $aioseop_options['aiosp_enablecpost'] ) ) {
+ $wp_post_types = get_post_types( array( '_builtin' => true ) ); // Don't display meta if SEO isn't enabled on custom post types -- pdb.
+ if ( is_singular() && ! in_array( $post_type, $wp_post_types ) && ! is_front_page() ) {
+ return false;
+ }
+ } else {
+ $wp_post_types = $aioseop_options['aiosp_cpostactive'];
+ if ( empty( $wp_post_types ) ) {
+ $wp_post_types = array();
+ }
+ if ( AIOSEOPPRO ) {
+ if ( is_tax() ) {
+ if ( empty( $aioseop_options['aiosp_taxactive'] ) || ! is_tax( $aioseop_options['aiosp_taxactive'] ) ) {
+ return false;
+ }
+ } elseif ( is_category() ) {
+ if ( empty( $aioseop_options['aiosp_taxactive'] ) || ! in_array( 'category', $aioseop_options['aiosp_taxactive'] ) ) {
+ return false;
+ }
+ } elseif ( is_tag() ) {
+ if ( empty( $aioseop_options['aiosp_taxactive'] ) || ! in_array( 'post_tag', $aioseop_options['aiosp_taxactive'] ) ) {
+ return false;
+ }
+ } else if ( ! in_array( $post_type, $wp_post_types ) && ! is_front_page() && ! is_post_type_archive( $wp_post_types ) && ! is_404() ) {
+ return false;
+ }
} else {
- $blog_name = get_bloginfo( 'name' );
+ if ( is_singular() && ! in_array( $post_type, $wp_post_types ) && ! is_front_page() ) {
+ return false;
+ }
+ if ( is_post_type_archive() && ! is_post_type_archive( $wp_post_types ) ) {
+ return false;
+ }
}
- $blog_name = esc_attr( $blog_name );
- $name_block=<<meta_opts = $this->get_current_options( array(), 'aiosp' );
- $search_box=<<
- {
- "@context": "http://schema.org",
- "@type": "WebSite",
-EOF;
- if ( !empty( $name_block ) ) $search_box .= $name_block;
- if ( !empty( $search_block ) ) $search_box .= $search_block;
- $search_box.=<<
-EOF;
- return apply_filters( 'aiosp_sitelinks_search_box', $search_box );
- }
+ $aiosp_disable = $aiosp_disable_analytics = false;
- function aiosp_mrt_get_url( $query, $show_page = true ) {
- if ( $query->is_404 || $query->is_search )
- return false;
- $link = '';
- $haspost = count( $query->posts ) > 0;
- if ( get_query_var( 'm' ) ) {
- $m = preg_replace( '/[^0-9]/', '', get_query_var( 'm' ) );
- switch ( $this->strlen( $m ) ) {
- case 4: $link = get_year_link( $m ); break;
- case 6: $link = get_month_link( $this->substr( $m, 0, 4), $this->substr($m, 4, 2 ) ); break;
- case 8: $link = get_day_link( $this->substr( $m, 0, 4 ), $this->substr( $m, 4, 2 ), $this->substr( $m, 6, 2 ) ); break;
- default:
- return false;
+ if ( ! empty( $this->meta_opts ) ) {
+ if ( isset( $this->meta_opts['aiosp_disable'] ) ) {
+ $aiosp_disable = $this->meta_opts['aiosp_disable'];
}
- } elseif ( ( $query->is_home && (get_option( 'show_on_front' ) == 'page' ) && ( $pageid = get_option( 'page_for_posts' ) ) ) ) {
- $link = get_permalink( $pageid );
- } elseif ( is_front_page() || ( $query->is_home && ( get_option( 'show_on_front' ) != 'page' || !get_option( 'page_for_posts' ) ) ) ) {
- if ( function_exists( 'icl_get_home_url' ) ) {
- $link = icl_get_home_url();
- } else {
- $link = trailingslashit( home_url() );
+ if ( isset( $this->meta_opts['aiosp_disable_analytics'] ) ) {
+ $aiosp_disable_analytics = $this->meta_opts['aiosp_disable_analytics'];
}
- } elseif ( ( $query->is_single || $query->is_page ) && $haspost ) {
- $post = $query->posts[0];
- $link = get_permalink( $post->ID );
- } elseif ( $query->is_author && $haspost ) {
- $author = get_userdata( get_query_var( 'author' ) );
- if ($author === false) return false;
- $link = get_author_posts_url( $author->ID, $author->user_nicename );
- } elseif ( $query->is_category && $haspost ) {
- $link = get_category_link( get_query_var( 'cat' ) );
- } elseif ( $query->is_tag && $haspost ) {
- $tag = get_term_by( 'slug', get_query_var( 'tag' ), 'post_tag' );
- if ( !empty( $tag->term_id ) )
- $link = get_tag_link( $tag->term_id );
- } elseif ( $query->is_day && $haspost ) {
- $link = get_day_link( get_query_var( 'year' ),
- get_query_var( 'monthnum' ),
- get_query_var( 'day' ) );
- } elseif ( $query->is_month && $haspost ) {
- $link = get_month_link( get_query_var( 'year' ),
- get_query_var( 'monthnum' ) );
- } elseif ( $query->is_year && $haspost ) {
- $link = get_year_link( get_query_var( 'year' ) );
- } elseif ( $query->is_tax && $haspost ) {
- $taxonomy = get_query_var( 'taxonomy' );
- $term = get_query_var( 'term' );
- if ( !empty( $term ) )
- $link = get_term_link( $term, $taxonomy );
- } elseif ( $query->is_archive && function_exists( 'get_post_type_archive_link' ) && ( $post_type = get_query_var( 'post_type' ) ) ) {
- if ( is_array( $post_type ) )
- $post_type = reset( $post_type );
- $link = get_post_type_archive_link( $post_type );
- } else {
- return false;
- }
- if ( empty( $link ) || !is_string( $link ) ) return false;
- if ( apply_filters( 'aioseop_canonical_url_pagination', $show_page ) )
- $link = $this->get_paged( $link );
- if ( !empty( $link ) ) {
- global $aioseop_options;
- if ( !empty( $aioseop_options['aiosp_can_set_protocol'] ) && ( $aioseop_options['aiosp_can_set_protocol'] != 'auto' ) ) {
- if ( $aioseop_options['aiosp_can_set_protocol'] == 'http' ) {
- $link = preg_replace("/^https:/i", "http:", $link );
- } elseif ( $aioseop_options['aiosp_can_set_protocol'] == 'https' ) {
- $link = preg_replace("/^http:/i", "https:", $link );
+ }
+
+ if ( $aiosp_disable ) {
+ if ( ! $aiosp_disable_analytics ) {
+ if ( aioseop_option_isset( 'aiosp_google_analytics_id' ) ) {
+ remove_action( 'aioseop_modules_wp_head', array( $this, 'aiosp_google_analytics' ) );
+ add_action( 'wp_head', array( $this, 'aiosp_google_analytics' ) );
}
}
+
+ return false;
}
- return $link;
+
+ if ( ! empty( $this->meta_opts ) && $this->meta_opts['aiosp_disable'] == true ) {
+ return false;
+ }
+
+ return true;
}
- function get_page_number() {
- $page = get_query_var( 'page' );
- if ( empty( $page ) )
- $page = get_query_var( 'paged' );
- return $page;
+ /**
+ * @param $content
+ *
+ * @return mixed|string
+ */
+ function output_callback_for_title( $content ) {
+ return $this->rewrite_title( $content );
}
- function get_paged( $link ) {
- global $wp_rewrite;
- $page = $this->get_page_number();
- $page_name = 'page';
- if ( !empty( $wp_rewrite ) && !empty( $wp_rewrite->pagination_base ) ) $page_name = $wp_rewrite->pagination_base;
- if ( !empty( $page ) && $page > 1 ) {
- if ( get_query_var( 'page' ) == $page )
- $link = trailingslashit( $link ) . "$page";
- else
- $link = trailingslashit( $link ) . trailingslashit( $page_name ) . $page;
- $link = user_trailingslashit( $link, 'paged' );
+ /**
+ * Used for forcing title rewrites.
+ *
+ * @param $header
+ *
+ * @return mixed|string
+ */
+ function rewrite_title( $header ) {
+ global $wp_query;
+ if ( ! $wp_query ) {
+ $header .= "\n";
+
+ return $header;
+ }
+ $title = $this->wp_title();
+ if ( ! empty( $title ) ) {
+ $header = $this->replace_title( $header, $title );
}
- return $link;
- }
- function is_singular( $post_types = Array(), $post = null ) {
- if ( !empty( $post_types ) && is_object( $post ) )
- return in_array( $post->post_type, (array)$post_types );
- else
- return is_singular( $post_types );
+ return $header;
}
- function show_page_description() {
- global $aioseop_options;
- if ( !empty( $aioseop_options['aiosp_hide_paginated_descriptions'] ) ) {
- $page = $this->get_page_number();
- if ( !empty( $page ) && ( $page > 1 ) )
- return false;
- }
- return true;
+ /**
+ * @param $content
+ * @param $title
+ *
+ * @return mixed
+ */
+ function replace_title( $content, $title ) {
+ // We can probably improve this... I'm not sure half of this is even being used.
+ $title = trim( strip_tags( $title ) );
+ $title_tag_start = 'strpos( $content, $title_tag_start );
+ $end = $this->strpos( $content, $title_tag_end );
+ $this->title_start = $start;
+ $this->title_end = $end;
+ $this->orig_title = $title;
+
+ return preg_replace( '/]*?)\s*>([^<]*?)<\/title\s*>/is', '' . preg_replace( '/(\$|\\\\)(?=\d)/', '\\\\\1', strip_tags( $title ) ) . ' ', $content, 1 );
}
- function get_post_description( $post ) {
- global $aioseop_options;
- $description = '';
- if ( !$this->show_page_description() ) {
- return '';
- }
- $description = trim( ( $this->internationalize( get_post_meta( $post->ID, "_aioseop_description", true ) ) ) );
- if ( !empty( $post ) && post_password_required( $post ) ) {
- return $description;
+ function add_hooks() {
+ global $aioseop_options, $aioseop_update_checker;
+
+ // MOVED TO MAIN PLUGIN FILE IN ORDER TO FIRE SOONS
+ //$role = get_role( 'administrator' );
+ //if ( is_object( $role ) ) {
+ // $role->add_cap( 'aiosp_manage_seo' );
+ //}
+
+ aioseop_update_settings_check();
+ add_filter( 'user_contactmethods', 'aioseop_add_contactmethods' );
+ if ( is_user_logged_in() && function_exists( 'is_admin_bar_showing' ) && is_admin_bar_showing() && current_user_can( 'aiosp_manage_seo' ) ) {
+ add_action( 'admin_bar_menu', array( $this, 'admin_bar_menu' ), 1000 );
}
- if ( !$description ) {
- if ( empty( $aioseop_options["aiosp_skip_excerpt"] ) )
- $description = $this->trim_excerpt_without_filters_full_length( $this->internationalize( $post->post_excerpt ) );
- if ( !$description && $aioseop_options["aiosp_generate_descriptions"] ) {
- $content = $post->post_content;
- if ( !empty( $aioseop_options["aiosp_run_shortcodes"] ) ) $content = do_shortcode( $content );
- $content = wp_strip_all_tags( $content );
- $description = $this->trim_excerpt_without_filters( $this->internationalize( $content ) );
+
+ if ( is_admin() ) {
+ add_action( 'admin_menu', array( $this, 'admin_menu' ) );
+ add_action( 'admin_head', array( $this, 'add_page_icon' ) );
+ add_action( 'admin_init', 'aioseop_addmycolumns', 1 );
+ add_action( 'admin_init', 'aioseop_handle_ignore_notice' );
+ if ( AIOSEOPPRO ) {
+ if ( current_user_can( 'update_plugins' ) ) {
+ add_action( 'admin_notices', array( $aioseop_update_checker, 'key_warning' ) );
+ }
+ add_action( 'after_plugin_row_' . AIOSEOP_PLUGIN_BASENAME, array(
+ $aioseop_update_checker,
+ 'add_plugin_row',
+ ) );
+ }
+ } else {
+ if ( $aioseop_options['aiosp_can'] == '1' || $aioseop_options['aiosp_can'] == 'on' ) {
+ remove_action( 'wp_head', 'rel_canonical' );
+ }
+ // Analytics.
+ if ( aioseop_option_isset( 'aiosp_google_analytics_id' ) ) {
+ add_action( 'aioseop_modules_wp_head', array( $this, 'aiosp_google_analytics' ) );
}
+ add_filter( 'wp_list_pages', 'aioseop_list_pages' );
+ add_action( 'wp_head', array( $this, 'wp_head' ), apply_filters( 'aioseop_wp_head_priority', 1 ) );
+ add_action( 'template_redirect', array( $this, 'template_redirect' ), 0 );
+ add_filter( 'wp_list_pages_excludes', 'aioseop_get_pages_start' );
+ add_filter( 'get_pages', 'aioseop_get_pages' );
}
-
- // "internal whitespace trim"
- $description = preg_replace( "/\s\s+/u", " ", $description );
- return $description;
}
+ function visibility_warning() {
- function get_aioseop_description( $post = null ) {
- global $aioseop_options;
- if ( $post === null )
- $post = $GLOBALS["post"];
- $blog_page = aiosp_common::get_blog_page();
- $description = '';
- if ( is_front_page() && empty( $aioseop_options['aiosp_use_static_home_info'] ) )
- $description = trim( ( $this->internationalize( $aioseop_options['aiosp_home_description'] ) ) );
- elseif ( !empty( $blog_page ) )
- $description = $this->get_post_description( $blog_page );
- if ( empty( $description ) && is_object( $post ) && !is_archive() && empty( $blog_page ) )
- $description = $this->get_post_description( $post );
- $description = $this->apply_cf_fields( $description );
- return $description;
- }
+ $aioseop_visibility_notice_dismissed = get_user_meta( get_current_user_id(), 'aioseop_visibility_notice_dismissed', true );
- function replace_title( $content, $title ) {
- //We can probably improve this... I'm not sure half of this is even being used.
- $title = trim( strip_tags( $title ) );
- $title_tag_start = "strpos( $content, $title_tag_start );
- $end = $this->strpos( $content, $title_tag_end );
- $this->title_start = $start;
- $this->title_end = $end;
- $this->orig_title = $title;
+ if ( '0' == get_option( 'blog_public' ) && empty( $aioseop_visibility_notice_dismissed ) ) {
+
+ printf( '
+ ',
+ __( 'Warning: You\'re blocking access to search engines.', 'all-in-one-seo-pack' ),
+ sprintf( __( 'You can %s click here%s to go to your reading settings and toggle your blog visibility.', 'all-in-one-seo-pack' ), sprintf( '', esc_url( admin_url( 'options-reading.php' ) ) ), ' ' ) );
- return preg_replace( '/]*?)\s*>([^<]*?)<\/title\s*>/is', '' . preg_replace('/(\$|\\\\)(?=\d)/', '\\\\\1', strip_tags( $title ) ) . ' ', $content, 1 );
+ } elseif ( '1' == get_option( 'blog_public' ) && ! empty( $aioseop_visibility_notice_dismissed ) ) {
+ delete_user_meta( get_current_user_id(), 'aioseop_visibility_notice_dismissed' );
+ }
}
- function internationalize( $in ) {
- if ( function_exists( 'langswitch_filter_langs_with_message' ) )
- $in = langswitch_filter_langs_with_message( $in );
+ function woo_upgrade_notice() {
- if ( function_exists( 'polyglot_filter' ) )
- $in = polyglot_filter( $in );
+ $aioseop_woo_upgrade_notice_dismissed = get_user_meta( get_current_user_id(), 'aioseop_woo_upgrade_notice_dismissed', true );
- if ( function_exists( 'qtrans_useCurrentLanguageIfNotFoundUseDefaultLanguage' ) ) {
- $in = qtrans_useCurrentLanguageIfNotFoundUseDefaultLanguage( $in );
- } elseif ( function_exists( 'ppqtrans_useCurrentLanguageIfNotFoundUseDefaultLanguage' ) ) {
- $in = ppqtrans_useCurrentLanguageIfNotFoundUseDefaultLanguage( $in );
- } elseif ( function_exists( 'qtranxf_useCurrentLanguageIfNotFoundUseDefaultLanguage' ) ) {
- $in = qtranxf_useCurrentLanguageIfNotFoundUseDefaultLanguage( $in );
- }
+ if ( class_exists( 'WooCommerce' ) && empty( $aioseop_woo_upgrade_notice_dismissed ) && current_user_can( 'manage_options' ) ) {
+
+ printf( '
+ ',
+ __( 'We\'ve detected you\'re running WooCommerce.', 'all-in-one-seo-pack' ),
+ sprintf( __( '%s Upgrade%s to All in One SEO Pack Pro for increased SEO compatibility for your products.', 'all-in-one-seo-pack' ), sprintf( '', esc_url( 'http://semperplugins.com/plugins/all-in-one-seo-pack-pro-version/?loc=woo' ) ), ' ' ) );
- return apply_filters( 'localization', $in );
+ } elseif ( ! class_exists( 'WooCommerce' ) && ! empty( $aioseop_woo_upgrade_notice_dismissed ) ) {
+ delete_user_meta( get_current_user_id(), 'aioseop_woo_upgrade_notice_dismissed' );
+ }
}
- /** @return The original title as delivered by WP (well, in most cases) */
- function get_original_title( $sep = '|', $echo = false, $seplocation = '' ) {
- global $aioseop_options;
- if ( !empty( $aioseop_options['aiosp_use_original_title'] ) ) {
- $has_filter = has_filter( 'wp_title', Array( $this, 'wp_title' ) );
- if ( $has_filter !== false )
- remove_filter( 'wp_title', Array( $this, 'wp_title' ), $has_filter );
- if ( current_theme_supports( 'title-tag' ) ) {
- $sep = '|';
- $echo = false;
- $seplocation = 'right';
+ /**
+ * @param $description
+ *
+ * @return string
+ */
+ function make_unique_att_desc( $description ) {
+ global $wp_query;
+ if ( is_attachment() ) {
+
+ $url = $this->aiosp_mrt_get_url( $wp_query );
+ if ( $url ) {
+ $matches = array();
+ preg_match_all( '/(\d+)/', $url, $matches );
+ if ( is_array( $matches ) ) {
+ $uniqueDesc = join( '', $matches[0] );
+ }
}
- $title = wp_title( $sep, $echo, $seplocation );
- if ( $has_filter !== false )
- add_filter( 'wp_title', Array( $this, 'wp_title' ), $has_filter );
- if ( $title && ( $title = trim( $title ) ) )
- return trim( $title );
+ $description .= ' ' . $uniqueDesc;
}
- // the_search_query() is not suitable, it cannot just return
- global $s;
+ return $description;
+ }
- $title = null;
+ function wp_head() {
+ if ( ! $this->is_page_included() ) {
+ return;
+ }
+ $opts = $this->meta_opts;
+ global $aioseop_update_checker, $wp_query, $aioseop_options, $posts;
+ static $aioseop_dup_counter = 0;
+ $aioseop_dup_counter ++;
+ if ( $aioseop_dup_counter > 1 ) {
+ echo "\n\n";
- if ( is_home() ) {
- $title = get_option( 'blogname' );
- } else if ( is_single() ) {
- $title = $this->internationalize( single_post_title( '', false ) );
- } else if ( is_search() && isset($s) && !empty($s) ) {
- $search = esc_attr( stripslashes($s) );
- if ( !empty( $aioseop_options['aiosp_cap_titles'] ) )
- $search = $this->capitalize( $search );
- $title = $search;
- } else if ( ( is_tax() || is_category() ) && !is_feed() ) {
- $category_name = $this->ucwords($this->internationalize( single_cat_title( '', false ) ) );
- $title = $category_name;
- } else if ( is_page() ) {
- $title = $this->internationalize( single_post_title( '', false ) );
- } else if ( is_tag() ) {
- global $utw;
- if ( $utw ) {
- $tags = $utw->GetCurrentTagSet();
- $tag = $tags[0]->tag;
- $tag = str_replace('-', ' ', $tag);
- } else {
- // wordpress > 2.3
- $tag = $this->internationalize( single_term_title( '', false ) );
+ return;
+ }
+ if ( is_home() && ! is_front_page() ) {
+ $post = aiosp_common::get_blog_page();
+ } else {
+ $post = $this->get_queried_object();
+ }
+ $meta_string = null;
+ $description = '';
+ // Logging - rewrite handler check for output buffering.
+ $this->check_rewrite_handler();
+ if ( AIOSEOPPRO ) {
+ echo "\n\n";
+ if ( AIOSEOPPRO ) {
+ echo '\n";
+ }
+ $blog_page = aiosp_common::get_blog_page( $post );
+ $save_posts = $posts;
+ if ( function_exists( 'woocommerce_get_page_id' ) && is_post_type_archive( 'product' ) && ( $post_id = woocommerce_get_page_id( 'shop' ) ) && ( $post = get_post( $post_id ) ) ) {
+ global $posts;
+ $opts = $this->meta_opts = $this->get_current_options( array(), 'aiosp', null, $post );
+ $posts = array();
+ $posts[] = $post;
+ }
+ $posts = $save_posts;
+ $description = apply_filters( 'aioseop_description', $this->get_main_description( $post ) ); // Get the description.
+ // Handle the description format.
+ if ( isset( $description ) && ( $this->strlen( $description ) > $this->minimum_description_length ) && ! ( is_front_page() && is_paged() ) ) {
+ $description = $this->trim_description( $description );
+ if ( ! isset( $meta_string ) ) {
+ $meta_string = '';
}
- if ( $tag ) $title = $tag;
- } else if ( is_author() ) {
- $author = get_userdata( get_query_var( 'author' ) );
- if ( $author === false ) {
- global $wp_query;
- $author = $wp_query->get_queried_object();
+ // Description format.
+ $description = apply_filters( 'aioseop_description_full', $this->apply_description_format( $description, $post ) );
+ $desc_attr = '';
+ if ( ! empty( $aioseop_options['aiosp_schema_markup'] ) ) {
+ $desc_attr = 'itemprop="description"';
}
- if ($author !== false)
- $title = $author->display_name;
- } else if ( is_day() ) {
- $title = get_the_date();
- } else if ( is_month() ) {
- $title = get_the_date( 'F, Y' );
- } else if ( is_year() ) {
- $title = get_the_date( 'Y' );
- } else if ( is_archive() ) {
- $title = $this->internationalize( post_type_archive_title( '', false) );
- } else if ( is_404() ) {
- $title_format = $aioseop_options['aiosp_404_title_format'];
- $new_title = str_replace( '%blog_title%', $this->internationalize( get_bloginfo( 'name' ) ), $title_format );
- if ( strpos( $new_title, '%blog_description%' ) !== false ) $new_title = str_replace( '%blog_description%', $this->internationalize( get_bloginfo( 'description' ) ), $new_title );
- if ( strpos( $new_title, '%request_url%' ) !== false ) $new_title = str_replace( '%request_url%', $_SERVER['REQUEST_URI'], $new_title);
- if ( strpos( $new_title, '%request_words%' ) !== false ) $new_title = str_replace( '%request_words%', $this->request_as_words( $_SERVER['REQUEST_URI'] ), $new_title );
- $title = $new_title;
+ $desc_attr = apply_filters( 'aioseop_description_attributes', $desc_attr );
+ $meta_string .= sprintf( " \n", $desc_attr, $description );
}
- return trim( $title );
- }
+ // Get the keywords.
+ $togglekeywords = 0;
+ if ( isset( $aioseop_options['aiosp_togglekeywords'] ) ) {
+ $togglekeywords = $aioseop_options['aiosp_togglekeywords'];
+ }
+ if ( $togglekeywords == 0 && ! ( is_front_page() && is_paged() ) ) {
+ $keywords = $this->get_main_keywords();
+ $keywords = $this->apply_cf_fields( $keywords );
+ $keywords = apply_filters( 'aioseop_keywords', $keywords );
+
+ if ( isset( $keywords ) && ! empty( $keywords ) ) {
+ if ( isset( $meta_string ) ) {
+ $meta_string .= "\n";
+ }
+ $keywords = wp_filter_nohtml_kses( str_replace( '"', '', $keywords ) );
+ $key_attr = '';
+ if ( ! empty( $aioseop_options['aiosp_schema_markup'] ) ) {
+ $key_attr = 'itemprop="keywords"';
+ }
+ $key_attr = apply_filters( 'aioseop_keywords_attributes', $key_attr );
+ $meta_string .= sprintf( " \n", $key_attr, $keywords );
+ }
+ }
+ // Handle noindex, nofollow - robots meta.
+ $robots_meta = apply_filters( 'aioseop_robots_meta', $this->get_robots_meta() );
+ if ( ! empty( $robots_meta ) ) {
+ $meta_string .= ' ' . "\n";
+ }
+ // Handle site verification.
+ if ( is_front_page() ) {
+ foreach (
+ array(
+ 'google' => 'google-site-verification',
+ 'bing' => 'msvalidate.01',
+ 'pinterest' => 'p:domain_verify',
+ ) as $k => $v
+ ) {
+ if ( ! empty( $aioseop_options["aiosp_{$k}_verify"] ) ) {
+ $meta_string .= ' ' . "\n";
+ }
+ }
- function paged_title( $title ) {
- // the page number if paged
- global $paged;
- global $aioseop_options;
- // simple tagging support
- global $STagging;
- $page = get_query_var( 'page' );
- if ( $paged > $page ) $page = $paged;
- if ( is_paged() || ( isset($STagging) && $STagging->is_tag_view() && $paged ) || ( $page > 1 ) ) {
- $part = $this->internationalize( $aioseop_options['aiosp_paged_format'] );
- if ( isset( $part ) || !empty( $part ) ) {
- $part = " " . trim( $part );
- $part = str_replace( '%page%', $page, $part );
- $this->log( "paged_title() [$title] [$part]" );
- $title .= $part;
+ // Sitelinks search.
+ if ( ! empty( $aioseop_options['aiosp_google_sitelinks_search'] ) || ! empty( $aioseop_options['aiosp_google_set_site_name'] ) ) {
+ $meta_string .= $this->sitelinks_search_box() . "\n";
}
}
- return $title;
- }
+ // Handle extra meta fields.
+ foreach ( array( 'page_meta', 'post_meta', 'home_meta', 'front_meta' ) as $meta ) {
+ if ( ! empty( $aioseop_options["aiosp_{$meta}_tags"] ) ) {
+ $$meta = html_entity_decode( stripslashes( $aioseop_options["aiosp_{$meta}_tags"] ), ENT_QUOTES );
+ } else {
+ $$meta = '';
+ }
+ }
+ if ( is_page() && isset( $page_meta ) && ! empty( $page_meta ) && ( ! is_front_page() || empty( $front_meta ) ) ) {
+ if ( isset( $meta_string ) ) {
+ $meta_string .= "\n";
+ }
+ $meta_string .= $page_meta;
+ }
+ if ( is_single() && isset( $post_meta ) && ! empty( $post_meta ) ) {
+ if ( isset( $meta_string ) ) {
+ $meta_string .= "\n";
+ }
+ $meta_string .= $post_meta;
+ }
+ // Handle authorship.
+ $authorship = $this->get_google_authorship( $post );
+ $publisher = apply_filters( 'aioseop_google_publisher', $authorship['publisher'] );
+ if ( ! empty( $publisher ) ) {
+ $meta_string = ' ' . "\n" . $meta_string;
+ }
+ $author = apply_filters( 'aioseop_google_author', $authorship['author'] );
+ if ( ! empty( $author ) ) {
+ $meta_string = ' ' . "\n" . $meta_string;
+ }
- function get_tax_title_format( $tax = '' ) {
- global $aioseop_options;
- if ( AIOSEOPPRO ){
- $title_format = '%taxonomy_title% | %blog_title%';
- if ( is_category() ) {
- $title_format = $aioseop_options['aiosp_category_title_format'];
+ if ( is_front_page() && ! empty( $front_meta ) ) {
+ if ( isset( $meta_string ) ) {
+ $meta_string .= "\n";
+ }
+ $meta_string .= $front_meta;
} else {
- $taxes = $aioseop_options['aiosp_taxactive'];
- if ( empty( $tax ) )
- $tax = get_query_var( 'taxonomy' );
- if ( !empty( $aioseop_options["aiosp_{$tax}_tax_title_format"] ) )
- $title_format = $aioseop_options["aiosp_{$tax}_tax_title_format"];
+ if ( is_home() && ! empty( $home_meta ) ) {
+ if ( isset( $meta_string ) ) {
+ $meta_string .= "\n";
+ }
+ $meta_string .= $home_meta;
+ }
}
- if ( empty( $title_format ) )
- $title_format = '%category_title% | %blog_title%';
- } else {
- $title_format = '%category_title% | %blog_title%';
- if ( !empty( $aioseop_options['aiosp_category_title_format'] ) )
- $title_format = $aioseop_options['aiosp_category_title_format'];
- return $title_format;
+ $prev_next = $this->get_prev_next_links( $post );
+ $prev = apply_filters( 'aioseop_prev_link', $prev_next['prev'] );
+ $next = apply_filters( 'aioseop_next_link', $prev_next['next'] );
+ if ( ! empty( $prev ) ) {
+ $meta_string .= " \n";
+ }
+ if ( ! empty( $next ) ) {
+ $meta_string .= " \n";
+ }
+ if ( $meta_string != null ) {
+ echo "$meta_string\n";
}
- return $title_format;
- }
-
- function apply_tax_title_format( $category_name, $category_description, $tax = '' ) {
- if ( empty( $tax ) ) $tax = get_query_var( 'taxonomy' );
- $title_format = $this->get_tax_title_format( $tax );
- $title = str_replace( '%taxonomy_title%', $category_name, $title_format );
- if ( strpos( $title, '%taxonomy_description%' ) !== false ) $title = str_replace( '%taxonomy_description%', $category_description, $title );
- if ( strpos( $title, '%category_title%' ) !== false ) $title = str_replace( '%category_title%', $category_name, $title );
- if ( strpos( $title, '%category_description%' ) !== false ) $title = str_replace( '%category_description%', $category_description, $title );
- if ( strpos( $title, '%blog_title%' ) !== false ) $title = str_replace( '%blog_title%', $this->internationalize( get_bloginfo( 'name' ) ), $title );
- if ( strpos( $title, '%blog_description%' ) !== false ) $title = str_replace( '%blog_description%', $this->internationalize( get_bloginfo( 'description' ) ), $title );
- $title = wp_strip_all_tags( $title );
- return $this->paged_title( $title );
- }
- function get_tax_name( $tax ) {
- global $aioseop_options;
- if ( AIOSEOPPRO ){
- $opts = $this->meta_opts;
- if ( !empty( $opts ) )
- $name = $opts['aiosp_title'];
- } else {
- $name = '';
+ // Handle canonical links.
+ $show_page = true;
+ if ( ! empty( $aioseop_options['aiosp_no_paged_canonical_links'] ) ) {
+ $show_page = false;
}
- if ( empty( $name ) ) $name = single_term_title( '', false );
- //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??
- // if ( ( $tax == 'category' ) && ( !empty( $aioseop_options['aiosp_cap_cats'] ) ) )
- // $name = $this->ucwords( $name );
- return $this->internationalize( $name );
- }
+ if ( $aioseop_options['aiosp_can'] ) {
+ $url = '';
+ if ( ! empty( $aioseop_options['aiosp_customize_canonical_links'] ) && ! empty( $opts['aiosp_custom_link'] ) ) {
+ $url = $opts['aiosp_custom_link'];
+ }
+ if ( empty( $url ) ) {
+ $url = $this->aiosp_mrt_get_url( $wp_query, $show_page );
+ }
- function get_tax_desc( $tax ) {
+ $url = $this->validate_url_scheme( $url );
+
+ $url = apply_filters( 'aioseop_canonical_url', $url );
+ if ( ! empty( $url ) ) {
+ echo ' ' . "\n";
+ }
+ }
+ do_action( 'aioseop_modules_wp_head' );
if ( AIOSEOPPRO ) {
- $opts = $this->meta_opts;
- if ( !empty( $opts ) )
- $desc = $opts['aiosp_description'];
+ echo "\n";
} else {
- $desc = '';
+ echo "\n";
}
- if ( empty( $desc ) ) $desc = term_description( '', $tax );
- return $this->internationalize( $desc );
}
- function get_tax_title( $tax = '' ) {
- if ( AIOSEOPPRO ){
- if ( empty( $this->meta_opts ) )
- $this->meta_opts = $this->get_current_options( Array(), 'aiosp' );
+ /**
+ * Check rewrite handler.
+ */
+ function check_rewrite_handler() {
+ global $aioseop_options;
+
+ $force_rewrites = 1;
+ if ( isset( $aioseop_options['aiosp_force_rewrites'] ) ) {
+ $force_rewrites = $aioseop_options['aiosp_force_rewrites'];
}
- if ( empty( $tax ) )
- if ( is_category() )
- $tax = 'category';
- else
- $tax = get_query_var( 'taxonomy' );
- $name = $this->get_tax_name( $tax );
- $desc = $this->get_tax_desc( $tax );
- return $this->apply_tax_title_format( $name, $desc, $tax );
- }
- function get_post_title_format( $title_type = 'post', $p = null ) {
- global $aioseop_options;
- if ( ( $title_type != 'post' ) && ( $title_type != 'archive' ) ) return false;
- $title_format = "%{$title_type}_title% | %blog_title%";
- if ( isset( $aioseop_options["aiosp_{$title_type}_title_format"] ) )
- $title_format = $aioseop_options["aiosp_{$title_type}_title_format"];
- if( !empty( $aioseop_options['aiosp_enablecpost'] ) && !empty( $aioseop_options['aiosp_cpostactive'] ) ) {
- $wp_post_types = $aioseop_options['aiosp_cpostactive'];
- if ( !empty( $aioseop_options["aiosp_cposttitles"] ) ) {
- if ( ( ( $title_type == 'archive' ) && is_post_type_archive( $wp_post_types ) && $prefix = "aiosp_{$title_type}_" ) ||
- ( ( $title_type == 'post' ) && $this->is_singular( $wp_post_types, $p ) && $prefix = "aiosp_" ) ) {
- $post_type = get_post_type( $p );
- if ( !empty( $aioseop_options["{$prefix}{$post_type}_title_format"] ) ) {
- $title_format = $aioseop_options["{$prefix}{$post_type}_title_format"];
- }
+ if ( ! empty( $aioseop_options['aiosp_rewrite_titles'] ) && $force_rewrites ) {
+ // Make the title rewrite as short as possible.
+ if ( function_exists( 'ob_list_handlers' ) ) {
+ $active_handlers = ob_list_handlers();
+ } else {
+ $active_handlers = array();
+ }
+ if ( sizeof( $active_handlers ) > 0 &&
+ $this->strtolower( $active_handlers[ sizeof( $active_handlers ) - 1 ] ) ==
+ $this->strtolower( 'All_in_One_SEO_Pack::output_callback_for_title' )
+ ) {
+ ob_end_flush();
+ } else {
+ $this->log( 'another plugin interfering?' );
+ // If we get here there *could* be trouble with another plugin :(.
+ $this->ob_start_detected = true;
+ if ( $this->option_isset( 'rewrite_titles' ) ) { // Try alternate method -- pdb.
+ $aioseop_options['aiosp_rewrite_titles'] = 0;
+ $force_rewrites = 0;
+ add_filter( 'wp_title', array( $this, 'wp_title' ), 20 );
+ }
+ if ( function_exists( 'ob_list_handlers' ) ) {
+ foreach ( ob_list_handlers() as $handler ) {
+ $this->log( "detected output handler $handler" );
+ }
}
}
}
- return $title_format;
}
- function get_archive_title_format() {
- return $this->get_post_title_format( "archive" );
- }
+ /**
+ * @param $description
+ *
+ * @return mixed|string
+ */
+ function trim_description( $description ) {
+ $description = trim( wp_strip_all_tags( $description ) );
+ $description = str_replace( '"', '"', $description );
+ $description = str_replace( "\r\n", ' ', $description );
+ $description = str_replace( "\n", ' ', $description );
- function apply_archive_title_format( $title, $category = '' ) {
- $title_format = $this->get_archive_title_format();
- $r_title = array( '%blog_title%', '%blog_description%', '%archive_title%' );
- $d_title = array( $this->internationalize( get_bloginfo('name') ), $this->internationalize( get_bloginfo( 'description' ) ), post_type_archive_title( '', false ) );
- $title = trim( str_replace( $r_title, $d_title, $title_format ) );
- return $title;
+ return $description;
}
- function title_placeholder_helper( $title, $post, $type = 'post', $title_format = '', $category = '' ) {
- if ( !empty( $post ) )
- $authordata = get_userdata( $post->post_author );
- else
- $authordata = new WP_User();
- $new_title = str_replace( "%blog_title%", $this->internationalize( get_bloginfo( 'name' ) ), $title_format );
- if ( strpos( $new_title, "%blog_description%" ) !== false ) $new_title = str_replace( "%blog_description%", $this->internationalize( get_bloginfo( 'description' ) ), $new_title );
- if ( strpos( $new_title, "%{$type}_title%" ) !== false ) $new_title = str_replace( "%{$type}_title%", $title, $new_title );
- if ( $type == 'post' ) {
- if ( strpos( $new_title, "%category%" ) !== false ) $new_title = str_replace( "%category%", $category, $new_title );
- if ( strpos( $new_title, "%category_title%" ) !== false ) $new_title = str_replace( "%category_title%", $category, $new_title );
- if ( strpos( $new_title, "%tax_" ) && !empty( $post ) ) {
- $taxes = get_object_taxonomies( $post, 'objects' );
- if ( !empty( $taxes ) )
- foreach( $taxes as $t )
- if ( strpos( $new_title, "%tax_{$t->name}%" ) ) {
- $terms = $this->get_all_terms( $post->ID, $t->name );
- $term = '';
- if ( count( $terms ) > 0 )
- $term = $terms[0];
- $new_title = str_replace( "%tax_{$t->name}%", $term, $new_title );
- }
- }
+ /**
+ * @param $description
+ * @param null $post
+ *
+ * @return mixed
+ */
+ function apply_description_format( $description, $post = null ) {
+ global $aioseop_options;
+ $description_format = $aioseop_options['aiosp_description_format'];
+ if ( ! isset( $description_format ) || empty( $description_format ) ) {
+ $description_format = '%description%';
}
- if ( strpos( $new_title, "%{$type}_author_login%" ) !== false ) $new_title = str_replace( "%{$type}_author_login%", $authordata->user_login, $new_title );
- if ( strpos( $new_title, "%{$type}_author_nicename%" ) !== false ) $new_title = str_replace( "%{$type}_author_nicename%", $authordata->user_nicename, $new_title );
- if ( strpos( $new_title, "%{$type}_author_firstname%" ) !== false ) $new_title = str_replace( "%{$type}_author_firstname%", $this->ucwords($authordata->first_name ), $new_title );
- if ( strpos( $new_title, "%{$type}_author_lastname%" ) !== false ) $new_title = str_replace( "%{$type}_author_lastname%", $this->ucwords($authordata->last_name ), $new_title );
- $title = trim( $new_title );
- return $title;
- }
-
- function apply_post_title_format( $title, $category = '', $p = null ) {
- if ( $p === null ) {
- global $post;
- } else {
- $post = $p;
+ $description = str_replace( '%description%', apply_filters( 'aioseop_description_override', $description ), $description_format );
+ if ( strpos( $description, '%blog_title%' ) !== false ) {
+ $description = str_replace( '%blog_title%', get_bloginfo( 'name' ), $description );
}
- $title_format = $this->get_post_title_format( 'post', $post );
- return $this->title_placeholder_helper( $title, $post, 'post', $title_format, $category );
+ if ( strpos( $description, '%blog_description%' ) !== false ) {
+ $description = str_replace( '%blog_description%', get_bloginfo( 'description' ), $description );
+ }
+ if ( strpos( $description, '%wp_title%' ) !== false ) {
+ $description = str_replace( '%wp_title%', $this->get_original_title(), $description );
+ }
+ if ( strpos( $description, '%post_title%' ) !== false ) {
+ $description = str_replace( '%post_title%', $this->get_aioseop_title( $post ), $description );
+ }
+
+
+ /*this was intended to make attachment descriptions unique if pulling from the parent... let's remove it and see if there are any problems
+ *on the roadmap is to have a better hierarchy for attachment description pulling
+ * if ($aioseop_options['aiosp_can']) $description = $this->make_unique_att_desc($description);
+ */
+
+ return $description;
}
- function apply_page_title_format( $title, $p = null, $title_format = '' ) {
+ /**
+ * @return string
+ */
+ function get_robots_meta() {
global $aioseop_options;
- if ( $p === null ) {
- global $post;
- } else {
- $post = $p;
+ $opts = $this->meta_opts;
+ $page = $this->get_page_number();
+ $robots_meta = $tax_noindex = '';
+ if ( isset( $aioseop_options['aiosp_tax_noindex'] ) ) {
+ $tax_noindex = $aioseop_options['aiosp_tax_noindex'];
+ }
+
+ if ( empty( $tax_noindex ) || ! is_array( $tax_noindex ) ) {
+ $tax_noindex = array();
+ }
+
+ $aiosp_noindex = $aiosp_nofollow = $aiosp_noodp = $aiosp_noydir = '';
+ $noindex = 'index';
+ $nofollow = 'follow';
+ if ( ( is_category() && ! empty( $aioseop_options['aiosp_category_noindex'] ) ) || ( ! is_category() && is_archive() && ! is_tag() && ! is_tax()
+ && ( ( is_date() && ! empty( $aioseop_options['aiosp_archive_date_noindex'] ) ) || ( is_author() && ! empty( $aioseop_options['aiosp_archive_author_noindex'] ) ) ) )
+ || ( is_tag() && ! empty( $aioseop_options['aiosp_tags_noindex'] ) )
+ || ( is_search() && ! empty( $aioseop_options['aiosp_search_noindex'] ) )
+ || ( is_404() && ! empty( $aioseop_options['aiosp_404_noindex'] ) )
+ || ( is_tax() && in_array( get_query_var( 'taxonomy' ), $tax_noindex ) )
+ ) {
+ $noindex = 'noindex';
+ } elseif ( is_single() || is_page() || $this->is_static_posts_page() || is_attachment() || is_category() || is_tag() || is_tax() || ( $page > 1 ) ) {
+ $post_type = get_post_type();
+ if ( ! empty( $opts ) ) {
+ $aiosp_noindex = htmlspecialchars( stripslashes( $opts['aiosp_noindex'] ) );
+ $aiosp_nofollow = htmlspecialchars( stripslashes( $opts['aiosp_nofollow'] ) );
+ $aiosp_noodp = htmlspecialchars( stripslashes( $opts['aiosp_noodp'] ) );
+ $aiosp_noydir = htmlspecialchars( stripslashes( $opts['aiosp_noydir'] ) );
+ }
+ if ( $aiosp_noindex || $aiosp_nofollow || $aiosp_noodp || $aiosp_noydir || ! empty( $aioseop_options['aiosp_cpostnoindex'] )
+ || ! empty( $aioseop_options['aiosp_cpostnofollow'] ) || ! empty( $aioseop_options['aiosp_cpostnoodp'] ) || ! empty( $aioseop_options['aiosp_cpostnoydir'] )
+ || ! empty( $aioseop_options['aiosp_paginated_noindex'] ) || ! empty( $aioseop_options['aiosp_paginated_nofollow'] )
+ ) {
+ if ( ( $aiosp_noindex == 'on' ) || ( ( ! empty( $aioseop_options['aiosp_paginated_noindex'] ) ) && $page > 1 ) ||
+ ( ( $aiosp_noindex == '' ) && ( ! empty( $aioseop_options['aiosp_cpostnoindex'] ) ) && in_array( $post_type, $aioseop_options['aiosp_cpostnoindex'] ) )
+ ) {
+ $noindex = 'noindex';
+ }
+ if ( ( $aiosp_nofollow == 'on' ) || ( ( ! empty( $aioseop_options['aiosp_paginated_nofollow'] ) ) && $page > 1 ) ||
+ ( ( $aiosp_nofollow == '' ) && ( ! empty( $aioseop_options['aiosp_cpostnofollow'] ) ) && in_array( $post_type, $aioseop_options['aiosp_cpostnofollow'] ) )
+ ) {
+ $nofollow = 'nofollow';
+ }
+ if ( ( $aiosp_noodp == 'on' ) || ( empty( $aiosp_noodp ) && ( ! empty( $aioseop_options['aiosp_cpostnoodp'] ) && in_array( $post_type, $aioseop_options['aiosp_cpostnoodp'] ) ) ) ) {
+ $aiosp_noodp = true;
+ } else {
+ $aiosp_noodp = false;
+ }
+ if ( ( $aiosp_noydir == 'on' ) || ( empty( $aiosp_noydir ) && ( ! empty( $aioseop_options['aiosp_cpostnoydir'] ) && in_array( $post_type, $aioseop_options['aiosp_cpostnoydir'] ) ) ) ) {
+ $aiosp_noydir = true;
+ } else {
+ $aiosp_noydir = false;
+ }
+ }
+ }
+ if ( ! empty( $aioseop_options['aiosp_noodp'] ) && $aioseop_options['aiosp_noodp'] ) {
+ $aiosp_noodp = true;
}
- if ( empty( $title_format ) )
- $title_format = $aioseop_options['aiosp_page_title_format'];
- return $this->title_placeholder_helper( $title, $post, 'page', $title_format );
+ if ( ! empty( $aioseop_options['aiosp_noydir'] ) && $aioseop_options['aiosp_noydir'] ) {
+ $aiosp_noydir = true;
+ }
+ if ( $aiosp_noodp ) {
+ $nofollow .= ',noodp';
+ }
+ if ( $aiosp_noydir ) {
+ $nofollow .= ',noydir';
+ }
+ $robots_meta = $noindex . ',' . $nofollow;
+ if ( $robots_meta == 'index,follow' ) {
+ $robots_meta = '';
+ }
+
+ return $robots_meta;
}
- /*** Gets the title that will be used by AIOSEOP for title rewrites or returns false. ***/
- function get_aioseop_title( $post ) {
+ /**
+ * @return mixed|void
+ */
+ function sitelinks_search_box() {
global $aioseop_options;
- // the_search_query() is not suitable, it cannot just return
- global $s, $STagging;
- $opts = $this->meta_opts;
- if ( is_front_page() ) {
- if ( !empty( $aioseop_options['aiosp_use_static_home_info'] ) ) {
- global $post;
- if ( get_option( 'show_on_front' ) == 'page' && is_page() && $post->ID == get_option( 'page_on_front' ) ) {
- $title = $this->internationalize( get_post_meta( $post->ID, "_aioseop_title", true ) );
- if ( !$title ) $title = $this->internationalize( $post->post_title );
- if ( !$title ) $title = $this->internationalize( $this->get_original_title( '', false ) );
- if ( !empty( $aioseop_options['aiosp_home_page_title_format'] ) )
- $title = $this->apply_page_title_format( $title, $post, $aioseop_options['aiosp_home_page_title_format'] );
- $title = $this->paged_title( $title );
- $title = apply_filters( 'aioseop_home_page_title', $title );
- }
+ $home_url = esc_url( get_home_url() );
+ $name_block = $search_block = '';
+ if ( ! empty( $aioseop_options['aiosp_google_set_site_name'] ) ) {
+ if ( ! empty( $aioseop_options['aiosp_google_specify_site_name'] ) ) {
+ $blog_name = $aioseop_options['aiosp_google_specify_site_name'];
} else {
- $title = $this->internationalize( $aioseop_options['aiosp_home_title'] );
- if ( !empty( $aioseop_options['aiosp_home_page_title_format'] ) )
- $title = $this->apply_page_title_format( $title, null, $aioseop_options['aiosp_home_page_title_format'] );
+ $blog_name = get_bloginfo( 'name' );
}
- if (empty( $title ) )
- $title = $this->internationalize( get_option( 'blogname' ) ) . ' | ' . $this->internationalize( get_bloginfo( 'description' ) );
+ $blog_name = esc_attr( $blog_name );
+ $name_block = <<ID;
+ if ( ! empty( $aioseop_options['aiosp_google_sitelinks_search'] ) ) {
+ $search_block = <<
+ {
+ "@context": "http://schema.org",
+ "@type": "WebSite",
+EOF;
+ if ( ! empty( $name_block ) ) {
+ $search_box .= $name_block;
+ }
+ if ( ! empty( $search_block ) ) {
+ $search_box .= $search_block;
+ }
+ $search_box .= <<
+EOF;
- if ( woocommerce_get_page_id( 'shop' ) == get_option( 'page_on_front' ) && !empty( $aioseop_options['aiosp_use_static_home_info'] ) ){
- $title = $this->internationalize( get_post_meta( $post->ID, "_aioseop_title", true ) );
- }
- //$title = $this->internationalize( $aioseop_options['aiosp_home_title'] );
- if ( !$title ) $title = $this->internationalize( get_post_meta( $frontpage_id, "_aioseop_title", true ) ); //this is/was causing the first product to come through
- if ( !$title ) $title = $this->internationalize( $post->post_title );
- if ( !$title ) $title = $this->internationalize( $this->get_original_title( '', false ) );
+ return apply_filters( 'aiosp_sitelinks_search_box', $search_box );
+ }
+ /**
+ * @param $post
+ *
+ * @return array
+ */
+ function get_google_authorship( $post ) {
+ global $aioseop_options;
+ $page = $this->get_page_number();
+ // Handle authorship.
+ $googleplus = $publisher = $author = '';
+ if ( ! empty( $post ) && isset( $post->post_author ) && empty( $aioseop_options['aiosp_google_disable_profile'] ) ) {
+ $googleplus = get_the_author_meta( 'googleplus', $post->post_author );
+ }
- $title = $this->apply_page_title_format( $title, $post );
- $title = $this->paged_title( $title );
- $title = apply_filters( 'aioseop_title_page', $title );
- return $title;
+ if ( empty( $googleplus ) && ! empty( $aioseop_options['aiosp_google_publisher'] ) ) {
+ $googleplus = $aioseop_options['aiosp_google_publisher'];
+ }
+ if ( is_front_page() && ( $page < 2 ) ) {
+ if ( ! empty( $aioseop_options['aiosp_google_publisher'] ) ) {
+ $publisher = $aioseop_options['aiosp_google_publisher'];
}
- return $this->paged_title( $title ); //this is returned for woo
- } else if ( is_attachment() ) {
- if ( $post === null ) return false;
- $title = get_post_meta( $post->ID, "_aioseop_title", true );
- if ( empty( $title ) ) $title = $post->post_title;
- if ( empty( $title ) ) $title = $this->get_original_title( '', false );
- if ( empty( $title ) ) $title = get_the_title( $post->post_parent );
- $title = apply_filters( 'aioseop_attachment_title', $this->internationalize( $this->apply_post_title_format( $title, '', $post ) ) );
- return $title;
- } else if ( is_page() || $this->is_static_posts_page() || ( is_home() && !$this->is_static_posts_page() ) ) {
- if ( $post === null ) return false;
- if ( ( $this->is_static_front_page() ) && ( $home_title = $this->internationalize( $aioseop_options['aiosp_home_title'] ) ) ) {
- if ( !empty( $aioseop_options['aiosp_home_page_title_format'] ) )
- $home_title = $this->apply_page_title_format( $home_title, $post, $aioseop_options['aiosp_home_page_title_format'] );
- //home title filter
- return apply_filters( 'aioseop_home_page_title', $home_title );
- } else {
- $page_for_posts = '';
- if ( is_home() )
- $page_for_posts = get_option( 'page_for_posts' );
- if ( $page_for_posts ) {
- $title = $this->internationalize( get_post_meta( $page_for_posts, "_aioseop_title", true ) );
- if ( !$title ) {
- $post_page = get_post( $page_for_posts );
- $title = $this->internationalize( $post_page->post_title );
- }
- } else {
- $title = $this->internationalize( get_post_meta( $post->ID, "_aioseop_title", true ) );
- if ( !$title )
- $title = $this->internationalize( $post->post_title );
+ if ( ! empty( $aioseop_options['aiosp_google_author_advanced'] ) ) {
+ if ( empty( $aioseop_options['aiosp_google_enable_publisher'] ) ) {
+ $publisher = '';
+ } elseif ( ! empty( $aioseop_options['aiosp_google_specify_publisher'] ) ) {
+ $publisher = $aioseop_options['aiosp_google_specify_publisher'];
}
- if ( !$title )
- $title = $this->internationalize( $this->get_original_title( '', false ) );
-
- $title = $this->apply_page_title_format( $title, $post );
- $title = $this->paged_title( $title );
- $title = apply_filters( 'aioseop_title_page', $title );
- if ( $this->is_static_posts_page() )
- $title = apply_filters( 'single_post_title', $title );
- return $title;
}
- } else if ( function_exists( 'woocommerce_get_page_id' ) && is_post_type_archive( 'product' ) && ( $post_id = woocommerce_get_page_id( 'shop' ) ) && ( $post = get_post( $post_id ) ) ) {
- //too far down? -mrt
- $title = $this->internationalize( get_post_meta( $post->ID, "_aioseop_title", true ) );
- if ( !$title ) $title = $this->internationalize( $post->post_title );
- if ( !$title ) $title = $this->internationalize( $this->get_original_title( '', false ) );
- $title = $this->apply_page_title_format( $title, $post );
- $title = $this->paged_title( $title );
- $title = apply_filters( 'aioseop_title_page', $title );
- return $title;
- } else if ( is_single() ) {
- // we're not in the loop :(
- if ( $post === null ) return false;
- $categories = $this->get_all_categories();
- $category = '';
- if ( count( $categories ) > 0 )
- $category = $categories[0];
- $title = $this->internationalize( get_post_meta( $post->ID, "_aioseop_title", true ) );
- if ( !$title ) {
- $title = $this->internationalize( get_post_meta( $post->ID, "title_tag", true ) );
- if ( !$title ) $title = $this->internationalize($this->get_original_title( '', false ) );
+ }
+ if ( is_singular() && ( ! empty( $googleplus ) ) ) {
+ $author = $googleplus;
+ } else if ( ! empty( $aioseop_options['aiosp_google_publisher'] ) ) {
+ $author = $aioseop_options['aiosp_google_publisher'];
+ }
+
+ if ( ! empty( $aioseop_options['aiosp_google_author_advanced'] ) && isset( $aioseop_options['aiosp_google_author_location'] ) ) {
+ if ( empty( $aioseop_options['aiosp_google_author_location'] ) ) {
+ $aioseop_options['aiosp_google_author_location'] = array();
}
- if ( empty( $title ) ) $title = $post->post_title;
- if ( !empty( $title ) )
- $title = $this->apply_post_title_format( $title, $category, $post );
- $title = $this->paged_title( $title );
- return apply_filters( 'aioseop_title_single', $title );
- } else if ( is_search() && isset( $s ) && !empty( $s ) ) {
- $search = esc_attr( stripslashes( $s ) );
- if ( !empty( $aioseop_options['aiosp_cap_titles'] ) )
- $search = $this->capitalize( $search );
- $title_format = $aioseop_options['aiosp_search_title_format'];
- $title = str_replace( '%blog_title%', $this->internationalize( get_bloginfo( 'name' ) ), $title_format );
- if ( strpos( $title, '%blog_description%' ) !== false ) $title = str_replace( '%blog_description%', $this->internationalize( get_bloginfo( 'description' ) ), $title );
- if ( strpos( $title, '%search%' ) !== false ) $title = str_replace( '%search%', $search, $title );
- $title = $this->paged_title( $title );
- return $title;
- } else if ( is_tag() ) {
- global $utw;
- $tag = $tag_description = '';
- if ( $utw ) {
- $tags = $utw->GetCurrentTagSet();
- $tag = $tags[0]->tag;
- $tag = str_replace('-', ' ', $tag);
+ if ( is_front_page() && ! in_array( 'front', $aioseop_options['aiosp_google_author_location'] ) ) {
+ $author = '';
} else {
- if ( AIOSEOPPRO ){
- if ( !empty( $opts ) && !empty( $opts['aiosp_title'] ) ) $tag = $opts['aiosp_title'];
- if ( !empty( $opts ) ) {
- if ( !empty( $opts['aiosp_title'] ) ) $tag = $opts['aiosp_title'];
- if ( !empty( $opts['aiosp_description'] ) ) $tag_description = $opts['aiosp_description'];
+ if ( in_array( 'all', $aioseop_options['aiosp_google_author_location'] ) ) {
+ if ( is_singular() && ! is_singular( $aioseop_options['aiosp_google_author_location'] ) ) {
+ $author = '';
+ }
+ } else {
+ if ( ! is_singular( $aioseop_options['aiosp_google_author_location'] ) ) {
+ $author = '';
}
}
- if ( empty( $tag ) ) $tag = $this->get_original_title( '', false );
- if ( empty( $tag_description ) ) $tag_description = tag_description();
- $tag = $this->internationalize( $tag );
- $tag_description = $this->internationalize( $tag_description );
- }
- if ( $tag ) {
- if ( !empty( $aioseop_options['aiosp_cap_titles'] ) )
- $tag = $this->capitalize( $tag );
- $title_format = $aioseop_options['aiosp_tag_title_format'];
- $title = str_replace( '%blog_title%', $this->internationalize( get_bloginfo('name') ), $title_format );
- if ( strpos( $title, '%blog_description%' ) !== false ) $title = str_replace( '%blog_description%', $this->internationalize( get_bloginfo( 'description') ), $title );
- if ( strpos( $title, '%tag%' ) !== false ) $title = str_replace( '%tag%', $tag, $title );
- if ( strpos( $title, '%tag_description%' ) !== false ) $title = str_replace( '%tag_description%', $tag_description, $title );
- if ( strpos( $title, '%taxonomy_description%' ) !== false ) $title = str_replace( '%taxonomy_description%', $tag_description, $title );
- $title = trim( wp_strip_all_tags( $title ) );
- $title = str_replace( Array( '"', "\r\n", "\n" ), Array( '"', ' ', ' ' ), $title );
- $title = $this->paged_title( $title );
- return $title;
- }
- } else if ( ( is_tax() || is_category() ) && !is_feed() ) {
- return $this->get_tax_title();
- } else if ( isset( $STagging ) && $STagging->is_tag_view() ) { // simple tagging support
- $tag = $STagging->search_tag;
- if ( $tag ) {
- if ( !empty( $aioseop_options['aiosp_cap_titles'] ) )
- $tag = $this->capitalize($tag);
- $title_format = $aioseop_options['aiosp_tag_title_format'];
- $title = str_replace( '%blog_title%', $this->internationalize( get_bloginfo( 'name') ), $title_format);
- if ( strpos( $title, '%blog_description%' ) !== false ) $title = str_replace( '%blog_description%', $this->internationalize( get_bloginfo( 'description') ), $title);
- if ( strpos( $title, '%tag%' ) !== false ) $title = str_replace( '%tag%', $tag, $title );
- $title = $this->paged_title( $title );
- return $title;
}
- } else if ( is_archive() || is_post_type_archive() ) {
- if ( is_author() ) {
- $author = $this->internationalize( $this->get_original_title( '', false ) );
- $title_format = $aioseop_options['aiosp_author_title_format'];
- $new_title = str_replace( '%author%', $author, $title_format );
- } else if ( is_date() ) {
- global $wp_query;
- $date = $this->internationalize( $this->get_original_title( '', false ) );
- $title_format = $aioseop_options['aiosp_date_title_format'];
- $new_title = str_replace( '%date%', $date, $title_format );
- $day = get_query_var( 'day' );
- if ( empty( $day ) ) $day = '';
- $new_title = str_replace( '%day%', $day, $new_title );
- $monthnum = get_query_var( 'monthnum' );
- $year = get_query_var( 'year' );
- if ( empty( $monthnum ) || is_year() ) {
- $month = '';
- $monthnum = 0;
- }
- $month = date( "F", mktime( 0,0,0,(int)$monthnum,1,(int)$year ) );
- $new_title = str_replace( '%monthnum%', $monthnum, $new_title );
- if ( strpos( $new_title, '%month%' ) !== false ) $new_title = str_replace( '%month%', $month, $new_title );
- if ( strpos( $new_title, '%year%' ) !== false ) $new_title = str_replace( '%year%', get_query_var( 'year' ), $new_title );
- } else if ( is_post_type_archive() ) {
- if ( empty( $title ) ) $title = $this->get_original_title( '', false );
- $new_title = apply_filters( 'aioseop_archive_title', $this->apply_archive_title_format( $title ) );
- } else return false;
- $new_title = str_replace( '%blog_title%', $this->internationalize( get_bloginfo( 'name' ) ), $new_title );
- if ( strpos( $new_title, '%blog_description%' ) !== false ) $new_title = str_replace( '%blog_description%', $this->internationalize( get_bloginfo( 'description' ) ), $new_title );
- $title = trim( $new_title );
- $title = $this->paged_title( $title );
- return $title;
- } else if ( is_404() ) {
- $title_format = $aioseop_options['aiosp_404_title_format'];
- $new_title = str_replace( '%blog_title%', $this->internationalize( get_bloginfo( 'name') ), $title_format );
- if ( strpos( $new_title, '%blog_description%' ) !== false ) $new_title = str_replace( '%blog_description%', $this->internationalize( get_bloginfo( 'description' ) ), $new_title );
- if ( strpos( $new_title, '%request_url%' ) !== false ) $new_title = str_replace( '%request_url%', $_SERVER['REQUEST_URI'], $new_title );
- if ( strpos( $new_title, '%request_words%' ) !== false ) $new_title = str_replace( '%request_words%', $this->request_as_words( $_SERVER['REQUEST_URI'] ), $new_title );
- if ( strpos( $new_title, '%404_title%' ) !== false ) $new_title = str_replace( '%404_title%', $this->internationalize( $this->get_original_title( '', false ) ), $new_title );
- return $new_title;
- }
- return false;
- }
-
- /*** Used to filter wp_title(), get our title. ***/
- function wp_title() {
- global $aioseop_options;
- $title = false;
- $post = $this->get_queried_object();
- if ( !empty( $aioseop_options['aiosp_rewrite_titles'] ) ) {
- $title = $this->get_aioseop_title( $post );
- $title = $this->apply_cf_fields( $title );
}
- if ( $title === false )
- $title = $this->get_original_title();
-
- //if we're going to have this here, which seems logical, we should probably take it out of other places... do all titles pass through here?
- // The following lines have been commented out to fix an error with Capitalize Titles as reported in the WP forums
- // if ( !empty( $aioseop_options['aiosp_cap_titles'] ) )
- // $title = $this->capitalize( $title );
-
- return apply_filters( 'aioseop_title', $title );
- }
-
- /*** Used for forcing title rewrites. ***/
- function rewrite_title($header) {
- global $wp_query;
- if (!$wp_query) {
- $header .= "\n";
- return $header;
- }
- $title = $this->wp_title();
- if ( !empty( $title ) )
- $header = $this->replace_title( $header, $title );
- return $header;
+ return array( 'publisher' => $publisher, 'author' => $author );
}
/**
- * @return User-readable nice words for a given request.
+ * @param null $post
+ *
+ * @return array
*/
- function request_as_words( $request ) {
- $request = htmlspecialchars( $request );
- $request = str_replace( '.html', ' ', $request );
- $request = str_replace( '.htm', ' ', $request );
- $request = str_replace( '.', ' ', $request );
- $request = str_replace( '/', ' ', $request );
- $request = str_replace( '-', ' ', $request );
- $request_a = explode( ' ', $request );
- $request_new = array();
- foreach ( $request_a as $token ) {
- $request_new[] = $this->ucwords( trim( $token ) );
- }
- $request = implode( ' ', $request_new );
- return $request;
- }
-
- function capitalize( $s ) {
- $s = trim( $s );
- $tokens = explode( ' ', $s );
- while ( list( $key, $val ) = each( $tokens ) ) {
- $tokens[ $key ] = trim( $tokens[ $key ] );
- $tokens[ $key ] = $this->strtoupper( $this->substr( $tokens[$key], 0, 1 ) ) . $this->substr( $tokens[$key], 1 );
- }
- $s = implode( ' ', $tokens );
- return $s;
- }
-
- function trim_excerpt_without_filters( $text, $max = 0 ) {
- $text = str_replace( ']]>', ']]>', $text );
- $text = preg_replace( '|\[(.+?)\](.+?\[/\\1\])?|s', '', $text );
- $text = wp_strip_all_tags( $text );
- // Treat other common word-break characters like a space
- $text2 = preg_replace( '/[,._\-=+&!\?;:*]/s', ' ', $text );
- if ( !$max ) $max = $this->maximum_description_length;
- $max_orig = $max;
- $len = $this->strlen( $text2 );
- if ( $max < $len ) {
- if ( function_exists( 'mb_strrpos' ) ) {
- $pos = mb_strrpos( $text2, ' ', -($len - $max) );
- if ( $pos === false ) $pos = $max;
- if ( $pos > $this->minimum_description_length ) {
- $max = $pos;
- } else {
- $max = $this->minimum_description_length;
+ function get_prev_next_links( $post = null ) {
+ $prev = $next = '';
+ $page = $this->get_page_number();
+ if ( is_home() || is_archive() || is_paged() ) {
+ global $wp_query;
+ $max_page = $wp_query->max_num_pages;
+ if ( $page > 1 ) {
+ $prev = get_previous_posts_page_link();
+ }
+ if ( $page < $max_page ) {
+ $paged = $GLOBALS['paged'];
+ if ( ! is_single() ) {
+ if ( ! $paged ) {
+ $paged = 1;
+ }
+ $nextpage = intval( $paged ) + 1;
+ if ( ! $max_page || $max_page >= $nextpage ) {
+ $next = get_pagenum_link( $nextpage );
+ }
}
- } else {
- while( $text2[$max] != ' ' && $max > $this->minimum_description_length ) {
- $max--;
+ }
+ } else if ( is_page() || is_single() ) {
+ $numpages = 1;
+ $multipage = 0;
+ $page = get_query_var( 'page' );
+ if ( ! $page ) {
+ $page = 1;
+ }
+ if ( is_single() || is_page() || is_feed() ) {
+ $more = 1;
+ }
+ $content = $post->post_content;
+ if ( false !== strpos( $content, '' ) ) {
+ if ( $page > 1 ) {
+ $more = 1;
+ }
+ $content = str_replace( "\n\n", '', $content );
+ $content = str_replace( "\n", '', $content );
+ $content = str_replace( "\n", '', $content );
+ // Ignore nextpage at the beginning of the content.
+ if ( 0 === strpos( $content, '' ) ) {
+ $content = substr( $content, 15 );
+ }
+ $pages = explode( '', $content );
+ $numpages = count( $pages );
+ if ( $numpages > 1 ) {
+ $multipage = 1;
}
}
-
- // probably no valid chars to break on?
- if ( $len > $max_orig && $max < intval( $max_orig / 2 ) ) {
- $max = $max_orig;
+ if ( ! empty( $page ) ) {
+ if ( $page > 1 ) {
+ $prev = _wp_link_page( $page - 1 );
+ }
+ if ( $page + 1 <= $numpages ) {
+ $next = _wp_link_page( $page + 1 );
+ }
+ }
+ if ( ! empty( $prev ) ) {
+ $prev = $this->substr( $prev, 9, - 2 );
+ }
+ if ( ! empty( $next ) ) {
+ $next = $this->substr( $next, 9, - 2 );
}
}
- $text = $this->substr( $text, 0, $max );
- return trim( $text );
- }
- function trim_excerpt_without_filters_full_length( $text ) {
- $text = str_replace( ']]>', ']]>', $text );
- $text = preg_replace( '|\[(.+?)\](.+?\[/\\1\])?|s', '', $text );
- $text = wp_strip_all_tags( $text );
- return trim( ( $text ) );
+ return array( 'prev' => $prev, 'next' => $next );
}
- function keyword_string_to_list( $keywords ) {
- $traverse = Array();
- $keywords_i = str_replace( '"', '', $keywords );
- if (isset( $keywords_i ) && !empty( $keywords_i ) ) {
- $traverse = explode( ',', $keywords_i );
- }
- return $traverse;
- }
+ /**
+ *
+ * Validates whether the url should be https or http.
+ *
+ * Mainly we're just using this for canonical URLS, but eventually it may be useful for other things
+ *
+ * @param $url
+ *
+ * @return string $url
+ *
+ * @since 2.3.5
+ */
+ function validate_url_scheme( $url ) {
- function get_all_categories( $id = 0 ) {
- $keywords = Array();
- $categories = get_the_category( $id );
- if ( !empty( $categories ) )
- foreach ( $categories as $category )
- $keywords[] = $this->internationalize( $category->cat_name );
- return $keywords;
- }
+ // TODO we should check for the site setting in the case of auto.
- function get_all_tags( $id = 0 ) {
- $keywords = Array();
- $tags = get_the_tags( $id );
- if ( !empty( $tags ) && is_array( $tags) )
- foreach ( $tags as $tag )
- $keywords[] = $this->internationalize( $tag->name );
- // Ultimate Tag Warrior integration
- global $utw;
- if ( $utw ) {
- $tags = $utw->GetTagsForPost( $p );
- if ( is_array( $tags ) )
- foreach ( $tags as $tag ) {
- $tag = $tag->tag;
- $tag = str_replace( '_', ' ', $tag );
- $tag = str_replace( '-', ' ', $tag );
- $tag = stripslashes( $tag );
- $keywords[] = $tag;
- }
- }
- return $keywords;
- }
+ global $aioseop_options;
+
+ if( ! isset( $aioseop_options['aiosp_can_set_protocol'] ) ){
+ return $url; // Just send the url back if there's nothing there.
+ }
+
+ if ( $aioseop_options['aiosp_can_set_protocol'] == 'http' ) {
+ $url = preg_replace( '/^https:/i', 'http:', $url );
+ }
+ if ( $aioseop_options['aiosp_can_set_protocol'] == 'https' ) {
+ $url = preg_replace( '/^http:/i', 'https:', $url );
+ }
- function get_all_terms( $id, $taxonomy ) {
- $keywords = Array();
- $terms = get_the_terms( $id, $taxonomy );
- if ( !empty( $terms ) )
- foreach ( $terms as $term )
- $keywords[] = $this->internationalize( $term->name );
- return $keywords;
+ return $url;
}
/**
- * @return comma-separated list of unique keywords
+ * @param $options
+ * @param $location
+ * @param $settings
+ *
+ * @return mixed
*/
- function get_all_keywords() {
- global $posts;
- global $aioseop_options;
- if ( is_404() ) return null;
- // if we are on synthetic pages
- if ( !is_home() && !is_page() && !is_single() && !$this->is_static_front_page() && !$this->is_static_posts_page() && !is_archive() && !is_post_type_archive() &&!is_category() && !is_tag() && !is_tax() )
- return null;
- $keywords = array();
- $opts = $this->meta_opts;
- if ( !empty( $opts["aiosp_keywords"] ) ) {
- $traverse = $this->keyword_string_to_list( $this->internationalize( $opts["aiosp_keywords"] ) );
- if ( !empty( $traverse ) )
- foreach ( $traverse as $keyword ) $keywords[] = $keyword;
+ function override_options( $options, $location, $settings ) {
+ if ( class_exists( 'DOMDocument' ) ) {
+ $options['aiosp_google_connect'] = $settings['aiosp_google_connect']['default'];
}
- if ( empty( $posts ) ) {
- global $post;
- $post_arr = Array( $post );
- } else {
- $post_arr = $posts;
+
+ return $options;
+ }
+
+ function aiosp_google_analytics() {
+ global $aioseop_options;
+ $analytics = '';
+ if ( ! empty( $aioseop_options['aiosp_ga_advanced_options'] ) && ! empty( $aioseop_options['aiosp_ga_exclude_users'] ) ) {
+ if ( is_user_logged_in() ) {
+ global $current_user;
+ if ( empty( $current_user ) ) {
+ wp_get_current_user();
+ }
+ if ( ! empty( $current_user ) ) {
+ $intersect = array_intersect( $aioseop_options['aiosp_ga_exclude_users'], $current_user->roles );
+ if ( ! empty( $intersect ) ) {
+ return;
+ }
+ }
+ }
}
- if ( is_array( $post_arr ) ) {
- $postcount = count( $post_arr );
- foreach ( $post_arr as $p ) {
- if ( $p ) {
- $id = $p->ID;
- if ( $postcount == 1 || !empty( $aioseop_options['aiosp_dynamic_postspage_keywords'] ) ) {
- // custom field keywords
- $keywords_i = null;
- $keywords_i = stripslashes( $this->internationalize( get_post_meta( $id, "_aioseop_keywords", true ) ) );
- if ( is_attachment() ) {
- $id = $p->post_parent;
- if ( empty( $keywords_i ) )
- $keywords_i = stripslashes( $this->internationalize( get_post_meta( $id, "_aioseop_keywords", true ) ) );
+ if ( ! empty( $aioseop_options['aiosp_google_analytics_id'] ) ) {
+ ob_start();
+ $analytics = $this->universal_analytics();
+ echo $analytics;
+ if ( empty( $analytics ) ) {
+ ?>
+
+
+
+ clean_keyword_list( $keywords ) );
+ /**
+ * @return string
+ */
+ function universal_analytics() {
+ global $aioseop_options;
+ $analytics = '';
+ if ( ! empty( $aioseop_options['aiosp_ga_use_universal_analytics'] ) ) {
+ $allow_linker = $cookie_domain = $domain = $addl_domains = $domain_list = '';
+ if ( ! empty( $aioseop_options['aiosp_ga_advanced_options'] ) ) {
+ $cookie_domain = $this->get_analytics_domain();
+ }
+ if ( ! empty( $cookie_domain ) ) {
+ $cookie_domain = esc_js( $cookie_domain );
+ $cookie_domain = "'cookieDomain': '{$cookie_domain}'";
+ }
+ if ( empty( $cookie_domain ) ) {
+ $domain = ", 'auto'";
+ }
+ if ( ! empty( $aioseop_options['aiosp_ga_advanced_options'] ) && ! empty( $aioseop_options['aiosp_ga_multi_domain'] ) ) {
+ $allow_linker = "'allowLinker': true";
+ if ( ! empty( $aioseop_options['aiosp_ga_addl_domains'] ) ) {
+ $addl_domains = trim( $aioseop_options['aiosp_ga_addl_domains'] );
+ $addl_domains = preg_split( '/[\s,]+/', $addl_domains );
+ if ( ! empty( $addl_domains ) ) {
+ foreach ( $addl_domains as $d ) {
+ $d = $this->sanitize_domain( $d );
+ if ( ! empty( $d ) ) {
+ if ( ! empty( $domain_list ) ) {
+ $domain_list .= ', ';
+ }
+ $domain_list .= "'" . $d . "'";
+ }
+ }
+ }
+ }
+ }
+ $extra_options = '';
+ if ( ! empty( $aioseop_options['aiosp_ga_advanced_options'] ) && ! empty( $aioseop_options['aiosp_ga_display_advertising'] ) ) {
+ $extra_options .= "ga('require', 'displayfeatures');";
+ }
+ if ( ! empty( $aioseop_options['aiosp_ga_advanced_options'] ) && ! empty( $aioseop_options['aiosp_ga_enhanced_ecommerce'] ) ) {
+ if ( ! empty( $extra_options ) ) {
+ $extra_options .= "\n\t\t\t";
+ }
+ $extra_options .= "ga('require', 'ec');";
+ }
+ if ( ! empty( $domain_list ) ) {
+ if ( ! empty( $extra_options ) ) {
+ $extra_options .= "\n\t\t\t";
+ }
+ $extra_options .= "ga('require', 'linker');\n\t\t\tga('linker:autoLink', [{$domain_list}] );";
+ }
+ if ( ! empty( $aioseop_options['aiosp_ga_advanced_options'] ) && ! empty( $aioseop_options['aiosp_ga_link_attribution'] ) ) {
+ if ( ! empty( $extra_options ) ) {
+ $extra_options .= "\n\t\t\t";
+ }
+ $extra_options .= "ga('require', 'linkid', 'linkid.js');";
+ }
+
+ if ( ! empty( $aioseop_options['aiosp_ga_advanced_options'] ) && ! empty( $aioseop_options['aiosp_ga_anonymize_ip'] ) ) {
+ if ( ! empty( $extra_options ) ) {
+ $extra_options .= "\n\t\t\t";
+ }
+ $extra_options .= "ga('set', 'anonymizeIp', true);";
+ }
+ $js_options = array();
+ foreach ( array( 'cookie_domain', 'allow_linker' ) as $opts ) {
+ if ( ! empty( $$opts ) ) {
+ $js_options[] = $$opts;
+ }
+ }
+ if ( ! empty( $js_options ) ) {
+ $js_options = join( ',', $js_options );
+ $js_options = ', { ' . $js_options . ' } ';
+ } else {
+ $js_options = '';
+ }
+ $analytics_id = esc_js( $aioseop_options['aiosp_google_analytics_id'] );
+ $analytics = <<
+ (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
+ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
+ m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
+ })(window,document,'script','//www.google-analytics.com/analytics.js','ga');
+
+ ga('create', '{$analytics_id}'{$domain}{$js_options});
+ {$extra_options}
+ ga('send', 'pageview');
+
+
+EOF;
+ }
+
+ return $analytics;
}
- function log( $message ) {
- if ( $this->do_log ) {
- @error_log( date( 'Y-m-d H:i:s' ) . " " . $message . "\n", 3, $this->log_file );
+ /**
+ * @return mixed|string
+ */
+ function get_analytics_domain() {
+ global $aioseop_options;
+ if ( ! empty( $aioseop_options['aiosp_ga_domain'] ) ) {
+ return $this->sanitize_domain( $aioseop_options['aiosp_ga_domain'] );
}
+
+ return '';
}
+ /**
+ * @param $id
+ *
+ * @return bool
+ */
function save_post_data( $id ) {
$awmp_edit = $nonce = null;
- if ( empty( $_POST ) ) return false;
- if ( isset( $_POST[ 'aiosp_edit' ] ) ) $awmp_edit = $_POST['aiosp_edit'];
- if ( isset( $_POST[ 'nonce-aioseop-edit' ] ) ) $nonce = $_POST['nonce-aioseop-edit'];
-
- if ( isset($awmp_edit) && !empty($awmp_edit) && wp_verify_nonce($nonce, 'edit-aioseop-nonce') ) {
+ if ( empty( $_POST ) ) {
+ return false;
+ }
+ if ( isset( $_POST['aiosp_edit'] ) ) {
+ $awmp_edit = $_POST['aiosp_edit'];
+ }
+ if ( isset( $_POST['nonce-aioseop-edit'] ) ) {
+ $nonce = $_POST['nonce-aioseop-edit'];
+ }
- $optlist = Array( 'keywords', 'description', 'title', 'custom_link', 'sitemap_exclude', 'disable', 'disable_analytics', 'noindex', 'nofollow', 'noodp', 'noydir', 'titleatr', 'menulabel' );
- if ( !( !empty( $this->options['aiosp_can'] ) ) && ( !empty( $this->options['aiosp_customize_canonical_links'] ) ) ) {
- unset( $optlist["custom_link"] );
+ if ( isset( $awmp_edit ) && ! empty( $awmp_edit ) && wp_verify_nonce( $nonce, 'edit-aioseop-nonce' ) ) {
+
+ $optlist = array(
+ 'keywords',
+ 'description',
+ 'title',
+ 'custom_link',
+ 'sitemap_exclude',
+ 'disable',
+ 'disable_analytics',
+ 'noindex',
+ 'nofollow',
+ 'noodp',
+ 'noydir',
+ 'titleatr',
+ 'menulabel',
+ );
+ if ( ! ( ! empty( $this->options['aiosp_can'] ) ) && ( ! empty( $this->options['aiosp_customize_canonical_links'] ) ) ) {
+ unset( $optlist['custom_link'] );
}
- foreach ( $optlist as $f ) {
+ foreach ( $optlist as $f ) {
$field = "aiosp_$f";
- if ( isset( $_POST[$field] ) ) $$field = $_POST[$field];
- }
+ if ( isset( $_POST[ $field ] ) ) {
+ $$field = $_POST[ $field ];
+ }
+ }
- $optlist = Array( 'keywords', 'description', 'title', 'custom_link', 'noindex', 'nofollow', 'noodp', 'noydir', 'titleatr', 'menulabel' );
- if ( !( !empty( $this->options['aiosp_can'] ) ) && ( !empty( $this->options['aiosp_customize_canonical_links'] ) ) ) {
- unset( $optlist["custom_link"] );
+ $optlist = array(
+ 'keywords',
+ 'description',
+ 'title',
+ 'custom_link',
+ 'noindex',
+ 'nofollow',
+ 'noodp',
+ 'noydir',
+ 'titleatr',
+ 'menulabel',
+ );
+ if ( ! ( ! empty( $this->options['aiosp_can'] ) ) && ( ! empty( $this->options['aiosp_customize_canonical_links'] ) ) ) {
+ unset( $optlist['custom_link'] );
}
- foreach ( $optlist as $f )
+ foreach ( $optlist as $f ) {
delete_post_meta( $id, "_aioseop_{$f}" );
+ }
- if ( $this->is_admin() ) {
- delete_post_meta($id, '_aioseop_sitemap_exclude' );
- delete_post_meta($id, '_aioseop_disable' );
- delete_post_meta($id, '_aioseop_disable_analytics' );
+ if ( $this->is_admin() ) {
+ delete_post_meta( $id, '_aioseop_sitemap_exclude' );
+ delete_post_meta( $id, '_aioseop_disable' );
+ delete_post_meta( $id, '_aioseop_disable_analytics' );
}
foreach ( $optlist as $f ) {
- $var = "aiosp_$f";
+ $var = "aiosp_$f";
$field = "_aioseop_$f";
- if ( isset( $$var ) && !empty( $$var ) )
- add_post_meta( $id, $field, $$var );
- }
- if (isset( $aiosp_sitemap_exclude ) && !empty( $aiosp_sitemap_exclude ) && $this->is_admin() )
- add_post_meta( $id, '_aioseop_sitemap_exclude', $aiosp_sitemap_exclude );
- if (isset( $aiosp_disable ) && !empty( $aiosp_disable ) && $this->is_admin() ) {
- add_post_meta( $id, '_aioseop_disable', $aiosp_disable );
- if (isset( $aiosp_disable_analytics ) && !empty( $aiosp_disable_analytics ) )
- add_post_meta( $id, '_aioseop_disable_analytics', $aiosp_disable_analytics );
+ if ( isset( $$var ) && ! empty( $$var ) ) {
+ add_post_meta( $id, $field, $$var );
+ }
}
- }
+ if ( isset( $aiosp_sitemap_exclude ) && ! empty( $aiosp_sitemap_exclude ) && $this->is_admin() ) {
+ add_post_meta( $id, '_aioseop_sitemap_exclude', $aiosp_sitemap_exclude );
+ }
+ if ( isset( $aiosp_disable ) && ! empty( $aiosp_disable ) && $this->is_admin() ) {
+ add_post_meta( $id, '_aioseop_disable', $aiosp_disable );
+ if ( isset( $aiosp_disable_analytics ) && ! empty( $aiosp_disable_analytics ) ) {
+ add_post_meta( $id, '_aioseop_disable_analytics', $aiosp_disable_analytics );
+ }
+ }
+ }
}
+ /**
+ * @param $post
+ * @param $metabox
+ */
function display_tabbed_metabox( $post, $metabox ) {
$tabs = $metabox['args'];
echo '';
$header = $this->get_metabox_header( $tabs );
echo $header;
- $active = "";
- foreach( $tabs as $m ) {
- echo '
';
- if ( !$active ) $active = ' style="display:none;"';
+ $active = '';
+ foreach ( $tabs as $m ) {
+ echo '
';
+ if ( ! $active ) {
+ $active = ' style="display:none;"';
+ }
$m['args'] = $m['callback_args'];
$m['callback'][0]->{$m['callback'][1]}( $post, $m );
echo '
';
@@ -3301,129 +4691,225 @@ function display_tabbed_metabox( $post, $metabox ) {
echo '
';
}
+ /**
+ * @param $tabs
+ *
+ * @return string
+ */
+ function get_metabox_header( $tabs ) {
+ $header = '';
+
+ return $header;
+ }
+
function admin_bar_menu() {
global $wp_admin_bar, $aioseop_admin_menu, $aioseop_options, $post;
$toggle = '';
- if ( isset($_POST['aiosp_use_original_title']) && isset($_POST['aiosp_admin_bar']) ) $toggle = 'on';
- if ( isset($_POST['aiosp_use_original_title']) && !isset($_POST['aiosp_admin_bar']) ) $toggle = 'off';
+ if ( isset( $_POST['aiosp_use_original_title'] ) && isset( $_POST['aiosp_admin_bar'] ) ) {
+ $toggle = 'on';
+ }
+ if ( isset( $_POST['aiosp_use_original_title'] ) && ! isset( $_POST['aiosp_admin_bar'] ) ) {
+ $toggle = 'off';
+ }
- if ( !empty( $aioseop_options['aiosp_admin_bar'] ) && $toggle != 'off' || isset($_POST['aiosp_admin_bar']) ) {
+ if ( ! empty( $aioseop_options['aiosp_admin_bar'] ) && $toggle != 'off' || isset( $_POST['aiosp_admin_bar'] ) ) {
$menu_slug = plugin_basename( __FILE__ );
$url = '';
- if ( function_exists( 'menu_page_url' ) )
- $url = menu_page_url( $menu_slug, 0 );
- if ( empty( $url ) )
- $url = esc_url( admin_url( 'admin.php?page=' . $menu_slug ) );
-
- $wp_admin_bar->add_menu( array( 'id' => AIOSEOP_PLUGIN_DIRNAME, 'title' => __( 'SEO', 'all-in-one-seo-pack' ), 'href' => $url ) );
+ if ( function_exists( 'menu_page_url' ) ) {
+ $url = menu_page_url( $menu_slug, 0 );
+ }
+ if ( empty( $url ) ) {
+ $url = esc_url( admin_url( 'admin.php?page=' . $menu_slug ) );
+ }
- if ( current_user_can( 'update_plugins' ) && !AIOSEOPPRO ){
- $wp_admin_bar->add_menu( array( 'parent' => AIOSEOP_PLUGIN_DIRNAME, 'title' => __( 'Upgrade To Pro', 'all-in-one-seo-pack' ), 'id' => 'aioseop-pro-upgrade', 'href' => 'http://semperplugins.com/plugins/all-in-one-seo-pack-pro-version/?loc=menu', 'meta' => Array( 'target' => '_blank' ) ) );
- // add_action( 'admin_bar_menu', array( $this, 'admin_bar_upgrade_menu' ), 1101 );
+ $wp_admin_bar->add_menu( array(
+ 'id' => AIOSEOP_PLUGIN_DIRNAME,
+ 'title' => __( 'SEO', 'all-in-one-seo-pack' ),
+ 'href' => $url,
+ ) );
+
+ if ( current_user_can( 'update_plugins' ) && ! AIOSEOPPRO ) {
+ $wp_admin_bar->add_menu( array(
+ 'parent' => AIOSEOP_PLUGIN_DIRNAME,
+ 'title' => __( 'Upgrade To Pro', 'all-in-one-seo-pack' ),
+ 'id' => 'aioseop-pro-upgrade',
+ 'href' => 'http://semperplugins.com/plugins/all-in-one-seo-pack-pro-version/?loc=menu',
+ 'meta' => array( 'target' => '_blank' ),
+ ) );
+ // add_action( 'admin_bar_menu', array( $this, 'admin_bar_upgrade_menu' ), 1101 );
}
$aioseop_admin_menu = 1;
- if ( !is_admin() && !empty( $post ) ) {
+ if ( ! is_admin() && ! empty( $post ) ) {
$blog_page = aiosp_common::get_blog_page( $post );
- if ( !empty( $blog_page ) ) $post = $blog_page;
- $wp_admin_bar->add_menu( array( 'id' => 'aiosp_edit_' . $post->ID, 'parent' => AIOSEOP_PLUGIN_DIRNAME, 'title' => __( 'Edit SEO', 'all-in-one-seo-pack' ), 'href' => get_edit_post_link( $post->ID ) . '#aiosp' ) );
+ if ( ! empty( $blog_page ) ) {
+ $post = $blog_page;
+ }
+ $wp_admin_bar->add_menu( array(
+ 'id' => 'aiosp_edit_' . $post->ID,
+ 'parent' => AIOSEOP_PLUGIN_DIRNAME,
+ 'title' => __( 'Edit SEO', 'all-in-one-seo-pack' ),
+ 'href' => get_edit_post_link( $post->ID ) . '#aiosp',
+ ) );
}
}
}
-
-
+ /**
+ * Order for adding the menus for the aioseop_modules_add_menus hook.
+ */
function menu_order() {
return 5;
}
+ /**
+ * @param $tax
+ */
function display_category_metaboxes( $tax ) {
$screen = 'edit-' . $tax->taxonomy;
- ?>
-
-
-
+
+
+
+ options['aiosp_can'] ) ) && ( !empty( $this->options['aiosp_customize_canonical_links'] ) ) ) {
- unset( $optlist["custom_link"] );
+ $optlist = array(
+ 'keywords',
+ 'description',
+ 'title',
+ 'custom_link',
+ 'noindex',
+ 'nofollow',
+ 'noodp',
+ 'noydir',
+ 'titleatr',
+ 'menulabel',
+ );
+ if ( ! ( ! empty( $this->options['aiosp_can'] ) ) && ( ! empty( $this->options['aiosp_customize_canonical_links'] ) ) ) {
+ unset( $optlist['custom_link'] );
}
- foreach ( $optlist as $f )
+ foreach ( $optlist as $f ) {
delete_term_meta( $id, "_aioseop_{$f}" );
+ }
- if ( $this->is_admin() ) {
- delete_term_meta($id, '_aioseop_sitemap_exclude' );
- delete_term_meta($id, '_aioseop_disable' );
- delete_term_meta($id, '_aioseop_disable_analytics' );
+ if ( $this->is_admin() ) {
+ delete_term_meta( $id, '_aioseop_sitemap_exclude' );
+ delete_term_meta( $id, '_aioseop_disable' );
+ delete_term_meta( $id, '_aioseop_disable_analytics' );
}
foreach ( $optlist as $f ) {
- $var = "aiosp_$f";
+ $var = "aiosp_$f";
$field = "_aioseop_$f";
- if ( isset( $$var ) && !empty( $$var ) )
- add_term_meta( $id, $field, $$var );
- }
- if (isset( $aiosp_sitemap_exclude ) && !empty( $aiosp_sitemap_exclude ) && $this->is_admin() )
- add_term_meta( $id, '_aioseop_sitemap_exclude', $aiosp_sitemap_exclude );
- if (isset( $aiosp_disable ) && !empty( $aiosp_disable ) && $this->is_admin() ) {
- add_term_meta( $id, '_aioseop_disable', $aiosp_disable );
- if (isset( $aiosp_disable_analytics ) && !empty( $aiosp_disable_analytics ) )
- add_term_meta( $id, '_aioseop_disable_analytics', $aiosp_disable_analytics );
+ if ( isset( $$var ) && ! empty( $$var ) ) {
+ add_term_meta( $id, $field, $$var );
+ }
+ }
+ if ( isset( $aiosp_sitemap_exclude ) && ! empty( $aiosp_sitemap_exclude ) && $this->is_admin() ) {
+ add_term_meta( $id, '_aioseop_sitemap_exclude', $aiosp_sitemap_exclude );
+ }
+ if ( isset( $aiosp_disable ) && ! empty( $aiosp_disable ) && $this->is_admin() ) {
+ add_term_meta( $id, '_aioseop_disable', $aiosp_disable );
+ if ( isset( $aiosp_disable_analytics ) && ! empty( $aiosp_disable_analytics ) ) {
+ add_term_meta( $id, '_aioseop_disable_analytics', $aiosp_disable_analytics );
+ }
}
- }
+ }
}
function admin_menu() {
- $file = plugin_basename( __FILE__ );
+ $file = plugin_basename( __FILE__ );
$menu_name = __( 'All in One SEO', 'all-in-one-seo-pack' );
- $this->locations['aiosp']['default_options']['nonce-aioseop-edit']['default'] = wp_create_nonce('edit-aioseop-nonce');
+ $this->locations['aiosp']['default_options']['nonce-aioseop-edit']['default'] = wp_create_nonce( 'edit-aioseop-nonce' );
$custom_menu_order = false;
global $aioseop_options;
- if ( !isset( $aioseop_options['custom_menu_order'] ) )
+ if ( ! isset( $aioseop_options['custom_menu_order'] ) ) {
$custom_menu_order = true;
+ }
- $this->update_options( );
+ $this->update_options();
$this->add_admin_pointers();
- if ( !empty( $this->pointers ) )
- foreach( $this->pointers as $k => $p )
- if ( !empty( $p["pointer_scope"] ) && ( $p["pointer_scope"] == 'global' ) )
- unset( $this->pointers[$k] );
+ if ( ! empty( $this->pointers ) ) {
+ foreach ( $this->pointers as $k => $p ) {
+ if ( ! empty( $p['pointer_scope'] ) && ( $p['pointer_scope'] == 'global' ) ) {
+ unset( $this->pointers[ $k ] );
+ }
+ }
+ }
$donated = false;
- if ( ( isset( $_POST ) ) && ( isset( $_POST['module'] ) ) && ( isset( $_POST['nonce-aioseop'] ) ) && ( $_POST['module'] == 'All_in_One_SEO_Pack' ) && ( wp_verify_nonce( $_POST['nonce-aioseop'], 'aioseop-nonce' ) ) ) {
- if ( isset( $_POST["aiosp_donate"] ) )
- $donated = $_POST["aiosp_donate"];
- if ( isset($_POST["Submit"] ) ) {
- if ( isset( $_POST["aiosp_custom_menu_order"] ) )
- $custom_menu_order = $_POST["aiosp_custom_menu_order"];
- else
+ if ( isset( $_POST ) && isset( $_POST['module'] ) && isset( $_POST['nonce-aioseop'] ) && ( $_POST['module'] == 'All_in_One_SEO_Pack' ) && wp_verify_nonce( $_POST['nonce-aioseop'], 'aioseop-nonce' ) ) {
+ if ( isset( $_POST['aiosp_donate'] ) ) {
+ $donated = $_POST['aiosp_donate'];
+ }
+ if ( isset( $_POST['Submit'] ) ) {
+ if ( isset( $_POST['aiosp_custom_menu_order'] ) ) {
+ $custom_menu_order = $_POST['aiosp_custom_menu_order'];
+ } else {
$custom_menu_order = false;
- } else if ( ( isset($_POST["Submit_Default"] ) ) || ( ( isset($_POST["Submit_All_Default"] ) ) ) ) {
+ }
+ } else if ( isset( $_POST['Submit_Default'] ) || isset( $_POST['Submit_All_Default'] ) ) {
$custom_menu_order = true;
}
} else {
- if ( isset( $this->options["aiosp_donate"] ) )
- $donated = $this->options["aiosp_donate"];
- if ( isset( $this->options["aiosp_custom_menu_order"] ) )
- $custom_menu_order = $this->options["aiosp_custom_menu_order"];
+ if ( isset( $this->options['aiosp_donate'] ) ) {
+ $donated = $this->options['aiosp_donate'];
+ }
+ if ( isset( $this->options['aiosp_custom_menu_order'] ) ) {
+ $custom_menu_order = $this->options['aiosp_custom_menu_order'];
+ }
}
if ( $custom_menu_order ) {
@@ -3432,140 +4918,166 @@ function admin_menu() {
}
if ( $donated ) {
- // Thank you for your donation
- $this->pointers['aioseop_donate'] = Array( 'pointer_target' => '#aiosp_donate_wrapper',
- 'pointer_text' => '
' . __( 'Thank you!', 'all-in-one-seo-pack' )
- . ' ' . __( 'Thank you for your donation, it helps keep this plugin free and actively developed!', 'all-in-one-seo-pack' ) . '
'
- );
+ // Thank you for your donation.
+ $this->pointers['aioseop_donate'] = array(
+ 'pointer_target' => '#aiosp_donate_wrapper',
+ 'pointer_text' => '
' . __( 'Thank you!', 'all-in-one-seo-pack' )
+ . ' ' . __( 'Thank you for your donation, it helps keep this plugin free and actively developed!', 'all-in-one-seo-pack' ) . '
',
+ );
}
- if ( !AIOSEOPPRO ){
- if ( !empty( $this->pointers ) )
- foreach( $this->pointers as $k => $p )
- if ( !empty( $p["pointer_scope"] ) && ( $p["pointer_scope"] == 'global' ) )
- unset( $this->pointers[$k] );
+ if ( ! AIOSEOPPRO ) {
+ if ( ! empty( $this->pointers ) ) {
+ foreach ( $this->pointers as $k => $p ) {
+ if ( ! empty( $p['pointer_scope'] ) && ( $p['pointer_scope'] == 'global' ) ) {
+ unset( $this->pointers[ $k ] );
+ }
+ }
+ }
- $this->filter_pointers();
+ $this->filter_pointers();
}
- if ( !empty( $this->options['aiosp_enablecpost'] ) && $this->options['aiosp_enablecpost'] ) {
+ if ( ! empty( $this->options['aiosp_enablecpost'] ) && $this->options['aiosp_enablecpost'] ) {
if ( AIOSEOPPRO ) {
- $this->locations['aiosp']['display'] = $this->options['aiosp_cpostactive'];
- if ( !empty( $this->options['aiosp_taxactive'] ) ) {
- foreach( $this->options['aiosp_taxactive'] as $tax ) {
- $this->locations['aiosp']['display'][] = 'edit-' . $tax;
- add_action( "{$tax}_edit_form", Array( $this, 'display_category_metaboxes' ) );
- add_action( "edited_{$tax}", Array( $this, 'save_category_metaboxes' ) );
+ $this->locations['aiosp']['display'] = $this->options['aiosp_cpostactive'];
+ if ( ! empty( $this->options['aiosp_taxactive'] ) ) {
+ foreach ( $this->options['aiosp_taxactive'] as $tax ) {
+ $this->locations['aiosp']['display'][] = 'edit-' . $tax;
+ add_action( "{$tax}_edit_form", array( $this, 'display_category_metaboxes' ) );
+ add_action( "edited_{$tax}", array( $this, 'save_category_metaboxes' ) );
+ }
}
- }
} else {
- if ( !empty( $this->options['aiosp_cpostactive'] ) ) {
+ if ( ! empty( $this->options['aiosp_cpostactive'] ) ) {
$this->locations['aiosp']['display'] = $this->options['aiosp_cpostactive'];
} else {
- $this->locations['aiosp']['display'] = Array();
+ $this->locations['aiosp']['display'] = array();
}
}
} else {
- $this->locations['aiosp']['display'] = Array( 'post', 'page' );
+ $this->locations['aiosp']['display'] = array( 'post', 'page' );
}
- add_menu_page( $menu_name, $menu_name, apply_filters( 'manage_aiosp', 'aiosp_manage_seo' ) , $file, Array( $this, 'display_settings_page' ) );
+ add_menu_page( $menu_name, $menu_name, apply_filters( 'manage_aiosp', 'aiosp_manage_seo' ), $file, array(
+ $this,
+ 'display_settings_page',
+ ) );
- add_meta_box('aioseop-list', __( "Join Our Mailing List", 'all-in-one-seo-pack' ), array( 'aiosp_metaboxes', 'display_extra_metaboxes'), 'aioseop_metaboxes', 'normal', 'core');
- if ( AIOSEOPPRO ){
- add_meta_box('aioseop-about', __( "About", 'all-in-one-seo-pack' ), array( 'aiosp_metaboxes', 'display_extra_metaboxes'), 'aioseop_metaboxes', 'side', 'core');
+ add_meta_box( 'aioseop-list', __( 'Join Our Mailing List', 'all-in-one-seo-pack' ), array(
+ 'aiosp_metaboxes',
+ 'display_extra_metaboxes',
+ ), 'aioseop_metaboxes', 'normal', 'core' );
+ if ( AIOSEOPPRO ) {
+ add_meta_box( 'aioseop-about', __( 'About', 'all-in-one-seo-pack' ), array(
+ 'aiosp_metaboxes',
+ 'display_extra_metaboxes',
+ ), 'aioseop_metaboxes', 'side', 'core' );
} else {
- add_meta_box('aioseop-about', "About
Version " . AIOSEOP_VERSION . " ", array( 'aiosp_metaboxes', 'display_extra_metaboxes'), 'aioseop_metaboxes', 'side', 'core');
+ add_meta_box( 'aioseop-about', "About
Version " . AIOSEOP_VERSION . ' ', array(
+ 'aiosp_metaboxes',
+ 'display_extra_metaboxes',
+ ), 'aioseop_metaboxes', 'side', 'core' );
}
- add_meta_box('aioseop-support', __( "Support", 'all-in-one-seo-pack' ) . "
" . __( "Version", 'all-in-one-seo-pack' ) . " " . AIOSEOP_VERSION . " ", array( 'aiosp_metaboxes', 'display_extra_metaboxes'), 'aioseop_metaboxes', 'side', 'core');
+ add_meta_box( 'aioseop-support', __( 'Support', 'all-in-one-seo-pack' ) . "
" . __( 'Version', 'all-in-one-seo-pack' ) . ' ' . AIOSEOP_VERSION . ' ', array(
+ 'aiosp_metaboxes',
+ 'display_extra_metaboxes',
+ ), 'aioseop_metaboxes', 'side', 'core' );
- add_action( 'aioseop_modules_add_menus', Array( $this, 'add_menu' ), 5 );
+ add_action( 'aioseop_modules_add_menus', array( $this, 'add_menu' ), 5 );
do_action( 'aioseop_modules_add_menus', $file );
- $metaboxes = apply_filters( 'aioseop_add_post_metabox', Array() );
+ $metaboxes = apply_filters( 'aioseop_add_post_metabox', array() );
- if ( !empty( $metaboxes ) ) {
+ if ( ! empty( $metaboxes ) ) {
if ( $this->tabbed_metaboxes ) {
- $tabs = Array();
+ $tabs = array();
$tab_num = 0;
foreach ( $metaboxes as $m ) {
- if ( !isset( $tabs[ $m['post_type'] ] ) ) $tabs[ $m['post_type'] ] = Array();
+ if ( ! isset( $tabs[ $m['post_type'] ] ) ) {
+ $tabs[ $m['post_type'] ] = array();
+ }
$tabs[ $m['post_type'] ][] = $m;
}
- if ( !empty( $tabs ) ) {
- foreach( $tabs as $p => $m ) {
+ if ( ! empty( $tabs ) ) {
+ foreach ( $tabs as $p => $m ) {
$tab_num = count( $m );
- $title = $m[0]['title'];
- if ( $title != $this->plugin_name ) $title = $this->plugin_name . ' - ' . $title;
+ $title = $m[0]['title'];
+ if ( $title != $this->plugin_name ) {
+ $title = $this->plugin_name . ' - ' . $title;
+ }
if ( $tab_num <= 1 ) {
- if ( !empty( $m[0]['callback_args']['help_link'] ) )
- $title .= "
" . __( 'Help', 'all-in-one-seo-pack' ) . " ";
+ if ( ! empty( $m[0]['callback_args']['help_link'] ) ) {
+ $title .= "
" . __( 'Help', 'all-in-one-seo-pack' ) . ' ';
+ }
add_meta_box( $m[0]['id'], $title, $m[0]['callback'], $m[0]['post_type'], $m[0]['context'], $m[0]['priority'], $m[0]['callback_args'] );
} elseif ( $tab_num > 1 ) {
- add_meta_box( $m[0]['id'] . '_tabbed', $title, Array( $this, 'display_tabbed_metabox' ), $m[0]['post_type'], $m[0]['context'], $m[0]['priority'], $m );
+ add_meta_box( $m[0]['id'] . '_tabbed', $title, array(
+ $this,
+ 'display_tabbed_metabox',
+ ), $m[0]['post_type'], $m[0]['context'], $m[0]['priority'], $m );
}
}
}
} else {
foreach ( $metaboxes as $m ) {
$title = $m['title'];
- if ( $title != $this->plugin_name ) $title = $this->plugin_name . ' - ' . $title;
- if ( !empty( $m['help_link'] ) )
- $title .= "
" . __( 'Help', 'all-in-one-seo-pack' ) . " ";
+ if ( $title != $this->plugin_name ) {
+ $title = $this->plugin_name . ' - ' . $title;
+ }
+ if ( ! empty( $m['help_link'] ) ) {
+ $title .= "
" . __( 'Help', 'all-in-one-seo-pack' ) . ' ';
+ }
add_meta_box( $m['id'], $title, $m['callback'], $m['post_type'], $m['context'], $m['priority'], $m['callback_args'] );
}
}
}
}
- function get_metabox_header( $tabs ) {
- $header = '';
- return $header;
- }
-
+ /**
+ * @param $menu_order
+ *
+ * @return array
+ */
function set_menu_order( $menu_order ) {
$order = array();
- $file = plugin_basename( __FILE__ );
+ $file = plugin_basename( __FILE__ );
foreach ( $menu_order as $index => $item ) {
- if ( $item != $file ) $order[] = $item;
- if ( $index == 0 ) $order[] = $file;
+ if ( $item != $file ) {
+ $order[] = $item;
+ }
+ if ( $index == 0 ) {
+ $order[] = $file;
+ }
}
+
return $order;
}
function display_settings_header() {
}
- function display_settings_footer( ) {
+
+ function display_settings_footer() {
}
- function display_right_sidebar( ) {
+ function display_right_sidebar() {
global $wpdb;
- if( !get_option( 'aioseop_options' ) ) {
+ if ( ! get_option( 'aioseop_options' ) ) {
$msg = "
Your database options need to be updated. (Back up your database before updating.)
";
- aioseop_output_dismissable_notice( $msg, "", "error" );
+ aioseop_output_dismissable_notice( $msg, '', 'error' );
}
-?>
+ ?>
+ add_cap( 'aiosp_manage_seo' );
+ }
+ }
+}
+add_action( 'plugins_loaded', 'aiosp_add_cap' );
-//register_activation_hook(__FILE__,'aioseop_activate_pl');
+if ( ! defined( 'AIOSEOP_PLUGIN_NAME' ) ) {
+ define( 'AIOSEOP_PLUGIN_NAME', $aioseop_plugin_name );
+}
+// Do we need this? register_activation_hook(__FILE__,'aioseop_activate_pl');.
if ( ! defined( 'AIOSEOP_PLUGIN_DIR' ) ) {
- define( 'AIOSEOP_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
-} elseif ( AIOSEOP_PLUGIN_DIR != plugin_dir_path( __FILE__ ) ) {
-
-//this is not a great message
-/*
- add_action( 'admin_notices', create_function( '', 'echo "' . "
" . sprintf(
- __( "%s detected a conflict; please deactivate the plugin located in %s.", 'all-in-one-seo-pack' ),
- $aioseop_plugin_name, AIOSEOP_PLUGIN_DIR ) . "
" . '";' ) );
-*/
-
- return;
+ define( 'AIOSEOP_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
+} elseif ( AIOSEOP_PLUGIN_DIR !== plugin_dir_path( __FILE__ ) ) {
+ /*
+ This is not a great message.
+ add_action( 'admin_notices', create_function( '', 'echo "' . "
" . sprintf(
+ __( "%s detected a conflict; please deactivate the plugin located in %s.", 'all-in-one-seo-pack' ),
+ $aioseop_plugin_name, AIOSEOP_PLUGIN_DIR ) . "
" . '";' ) );
+ */
+ return;
}
-if ( ! defined( 'AIOSEOP_PLUGIN_BASENAME' ) )
- define( 'AIOSEOP_PLUGIN_BASENAME', plugin_basename( __FILE__ ) );
-if ( ! defined( 'AIOSEOP_PLUGIN_DIRNAME' ) )
- define( 'AIOSEOP_PLUGIN_DIRNAME', dirname( AIOSEOP_PLUGIN_BASENAME ) );
-if ( ! defined( 'AIOSEOP_PLUGIN_URL' ) )
- define( 'AIOSEOP_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
-if ( ! defined( 'AIOSEOP_PLUGIN_IMAGES_URL' ) )
- define( 'AIOSEOP_PLUGIN_IMAGES_URL', AIOSEOP_PLUGIN_URL . 'images/' );
-if ( ! defined( 'AIOSEOP_BASELINE_MEM_LIMIT' ) )
- define( 'AIOSEOP_BASELINE_MEM_LIMIT', 268435456 ); // 256MB
-if ( ! defined( 'WP_CONTENT_URL' ) )
- define( 'WP_CONTENT_URL', site_url() . '/wp-content' );
-if ( ! defined( 'WP_ADMIN_URL' ) )
- define( 'WP_ADMIN_URL', site_url() . '/wp-admin' );
-if ( ! defined( 'WP_CONTENT_DIR' ) )
- define( 'WP_CONTENT_DIR', ABSPATH . 'wp-content' );
-if ( ! defined( 'WP_PLUGIN_URL' ) )
- define( 'WP_PLUGIN_URL', WP_CONTENT_URL. '/plugins' );
-if ( ! defined( 'WP_PLUGIN_DIR' ) )
- define( 'WP_PLUGIN_DIR', WP_CONTENT_DIR . '/plugins' );
+if ( ! defined( 'AIOSEOP_PLUGIN_BASENAME' ) ) {
+ define( 'AIOSEOP_PLUGIN_BASENAME', plugin_basename( __FILE__ ) );
+}
+if ( ! defined( 'AIOSEOP_PLUGIN_DIRNAME' ) ) {
+ define( 'AIOSEOP_PLUGIN_DIRNAME', dirname( AIOSEOP_PLUGIN_BASENAME ) );
+}
+if ( ! defined( 'AIOSEOP_PLUGIN_URL' ) ) {
+ define( 'AIOSEOP_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
+}
+if ( ! defined( 'AIOSEOP_PLUGIN_IMAGES_URL' ) ) {
+ define( 'AIOSEOP_PLUGIN_IMAGES_URL', AIOSEOP_PLUGIN_URL . 'images/' );
+}
+if ( ! defined( 'AIOSEOP_BASELINE_MEM_LIMIT' ) ) {
+ define( 'AIOSEOP_BASELINE_MEM_LIMIT', 268435456 );
+} // 256MB
+if ( ! defined( 'WP_CONTENT_URL' ) ) {
+ define( 'WP_CONTENT_URL', site_url() . '/wp-content' );
+}
+if ( ! defined( 'WP_ADMIN_URL' ) ) {
+ define( 'WP_ADMIN_URL', site_url() . '/wp-admin' );
+}
+if ( ! defined( 'WP_CONTENT_DIR' ) ) {
+ define( 'WP_CONTENT_DIR', ABSPATH . 'wp-content' );
+}
+if ( ! defined( 'WP_PLUGIN_URL' ) ) {
+ define( 'WP_PLUGIN_URL', WP_CONTENT_URL . '/plugins' );
+}
+if ( ! defined( 'WP_PLUGIN_DIR' ) ) {
+ define( 'WP_PLUGIN_DIR', WP_CONTENT_DIR . '/plugins' );
+}
global $aiosp, $aioseop_options, $aioseop_modules, $aioseop_module_list, $aiosp_activation, $aioseop_mem_limit, $aioseop_get_pages_start, $aioseop_admin_menu;
$aioseop_get_pages_start = $aioseop_admin_menu = 0;
@@ -105,253 +135,290 @@
$aioseop_mem_limit = @ini_get( 'memory_limit' );
-if ( !function_exists( 'aioseop_convert_bytestring' ) ) {
- function aioseop_convert_bytestring( $byteString ) {
+if ( ! function_exists( 'aioseop_convert_bytestring' ) ) {
+ /**
+ * @param $byte_string
+ *
+ * @return int
+ */
+ function aioseop_convert_bytestring( $byte_string ) {
$num = 0;
- preg_match( '/^\s*([0-9.]+)\s*([KMGTPE])B?\s*$/i', $byteString, $matches );
- if ( !empty( $matches ) ) {
- $num = ( float )$matches[1];
+ preg_match( '/^\s*([0-9.]+)\s*([KMGTPE])B?\s*$/i', $byte_string, $matches );
+ if ( ! empty( $matches ) ) {
+ $num = (float) $matches[1];
switch ( strtoupper( $matches[2] ) ) {
- case 'E': $num = $num * 1024;
- case 'P': $num = $num * 1024;
- case 'T': $num = $num * 1024;
- case 'G': $num = $num * 1024;
- case 'M': $num = $num * 1024;
- case 'K': $num = $num * 1024;
+ case 'E':
+ $num *= 1024;
+ case 'P':
+ $num *= 1024;
+ case 'T':
+ $num *= 1024;
+ case 'G':
+ $num *= 1024;
+ case 'M':
+ $num *= 1024;
+ case 'K':
+ $num *= 1024;
}
}
+
return intval( $num );
}
}
if ( is_array( $aioseop_options ) && isset( $aioseop_options['modules'] ) && isset( $aioseop_options['modules']['aiosp_performance_options'] ) ) {
$perf_opts = $aioseop_options['modules']['aiosp_performance_options'];
- if ( isset( $perf_opts['aiosp_performance_memory_limit'] ) )
+ if ( isset( $perf_opts['aiosp_performance_memory_limit'] ) ) {
$aioseop_mem_limit = $perf_opts['aiosp_performance_memory_limit'];
- if ( isset( $perf_opts['aiosp_performance_execution_time'] ) && ( $perf_opts['aiosp_performance_execution_time'] !== '' ) ) {
- @ini_set( 'max_execution_time', (int)$perf_opts['aiosp_performance_execution_time'] );
- @set_time_limit( (int)$perf_opts['aiosp_performance_execution_time'] );
+ }
+ if ( isset( $perf_opts['aiosp_performance_execution_time'] ) && ( '' !== $perf_opts['aiosp_performance_execution_time'] ) ) {
+ @ini_set( 'max_execution_time', (int) $perf_opts['aiosp_performance_execution_time'] );
+ @set_time_limit( (int) $perf_opts['aiosp_performance_execution_time'] );
}
} else {
$aioseop_mem_limit = aioseop_convert_bytestring( $aioseop_mem_limit );
- if ( ( $aioseop_mem_limit > 0 ) && ( $aioseop_mem_limit < AIOSEOP_BASELINE_MEM_LIMIT ) )
+ if ( ( $aioseop_mem_limit > 0 ) && ( $aioseop_mem_limit < AIOSEOP_BASELINE_MEM_LIMIT ) ) {
$aioseop_mem_limit = AIOSEOP_BASELINE_MEM_LIMIT;
+ }
}
-if ( !empty( $aioseop_mem_limit ) ) {
- if ( !is_int( $aioseop_mem_limit ) )
+if ( ! empty( $aioseop_mem_limit ) ) {
+ if ( ! is_int( $aioseop_mem_limit ) ) {
$aioseop_mem_limit = aioseop_convert_bytestring( $aioseop_mem_limit );
- if ( ( $aioseop_mem_limit > 0 ) && ( $aioseop_mem_limit <= AIOSEOP_BASELINE_MEM_LIMIT ) )
+ }
+ if ( ( $aioseop_mem_limit > 0 ) && ( $aioseop_mem_limit <= AIOSEOP_BASELINE_MEM_LIMIT ) ) {
@ini_set( 'memory_limit', $aioseop_mem_limit );
+ }
}
-$aiosp_activation = false;
-$aioseop_module_list = Array( 'sitemap', 'opengraph', 'robots', 'file_editor', 'importer_exporter', 'bad_robots', 'performance' ); // list all available modules here
+$aiosp_activation = false;
+$aioseop_module_list = array(
+ 'sitemap',
+ 'opengraph',
+ 'robots',
+ 'file_editor',
+ 'importer_exporter',
+ 'bad_robots',
+ 'performance',
+); // list all available modules here
-if (AIOSEOPPRO){
+if ( AIOSEOPPRO ) {
$aioseop_module_list[] = 'video_sitemap';
}
if ( class_exists( 'All_in_One_SEO_Pack' ) ) {
add_action( 'admin_notices', create_function( '', 'echo "
The All In One SEO Pack class is already defined";'
- . "if ( class_exists( 'ReflectionClass' ) ) { \$r = new ReflectionClass( 'All_in_One_SEO_Pack' ); echo ' in ' . \$r->getFileName(); } "
- . ' echo ", preventing All In One SEO Pack from loading.
";' ) );
- return;
+ . "if ( class_exists( 'ReflectionClass' ) ) { \$r = new ReflectionClass( 'All_in_One_SEO_Pack' ); echo ' in ' . \$r->getFileName(); } "
+ . ' echo ", preventing All In One SEO Pack from loading.
";' ) );
+
+ return;
}
-if ( AIOSEOPPRO ){
-
- require( AIOSEOP_PLUGIN_DIR . 'pro/sfwd_update_checker.php');
+if ( AIOSEOPPRO ) {
+
+ require( AIOSEOP_PLUGIN_DIR . 'pro/sfwd_update_checker.php' );
$aioseop_update_checker = new SFWD_Update_Checker(
- 'http://semperplugins.com/upgrade_plugins.php',
- __FILE__,
- 'aioseop'
+ 'http://semperplugins.com/upgrade_plugins.php',
+ __FILE__,
+ 'aioseop'
);
-
-
-$aioseop_update_checker->plugin_name = AIOSEOP_PLUGIN_NAME;
-$aioseop_update_checker->plugin_basename = AIOSEOP_PLUGIN_BASENAME;
-if ( !empty( $aioseop_options['aiosp_license_key'] ) )
- $aioseop_update_checker->license_key = $aioseop_options['aiosp_license_key'];
-else
- $aioseop_update_checker->license_key = '';
-$aioseop_update_checker->options_page = 'all-in-one-seo-pack-pro/aioseop_class.php';
-$aioseop_update_checker->renewal_page = 'http://semperplugins.com/all-in-one-seo-pack-pro-support-updates-renewal/';
-$aioseop_update_checker->addQueryArgFilter( Array( $aioseop_update_checker, 'add_secret_key' ) );
+ $aioseop_update_checker->plugin_name = AIOSEOP_PLUGIN_NAME;
+ $aioseop_update_checker->plugin_basename = AIOSEOP_PLUGIN_BASENAME;
+ if ( ! empty( $aioseop_options['aiosp_license_key'] ) ) {
+ $aioseop_update_checker->license_key = $aioseop_options['aiosp_license_key'];
+ } else {
+ $aioseop_update_checker->license_key = '';
+ }
+ $aioseop_update_checker->options_page = 'all-in-one-seo-pack-pro/aioseop_class.php';
+ $aioseop_update_checker->renewal_page = 'http://semperplugins.com/all-in-one-seo-pack-pro-support-updates-renewal/';
+
+ $aioseop_update_checker->addQueryArgFilter( array( $aioseop_update_checker, 'add_secret_key' ) );
}
-/**
- * Check if we just got activated.
- */
-if ( !function_exists( 'aioseop_activate' ) ) {
+if ( ! function_exists( 'aioseop_activate' ) ) {
+
function aioseop_activate() {
-
- global $aiosp_activation;
- if ( AIOSEOPPRO ){
- global $aioseop_update_checker;
- }
- $aiosp_activation = true;
- delete_transient( "aioseop_oauth_current" );
+
+ //Check if we just got activated.
+ global $aiosp_activation;
+ if ( AIOSEOPPRO ) {
+ global $aioseop_update_checker;
+ }
+ $aiosp_activation = true;
delete_user_meta( get_current_user_id(), 'aioseop_yst_detected_notice_dismissed' );
- if ( AIOSEOPPRO ){
- $aioseop_update_checker->checkForUpdates();
+ if ( AIOSEOPPRO ) {
+ $aioseop_update_checker->checkForUpdates();
}
}
}
add_action( 'plugins_loaded', 'aioseop_init_class' );
+if ( ! function_exists( 'aiosp_plugin_row_meta' ) ) {
+ add_filter( 'plugin_row_meta', 'aiosp_plugin_row_meta', 10, 2 );
-if(!function_exists('aiosp_plugin_row_meta')){
+ /**
+ * @param $actions
+ * @param $plugin_file
+ *
+ * @return array
+ */
+ function aiosp_plugin_row_meta( $actions, $plugin_file ) {
-add_filter( 'plugin_row_meta', 'aiosp_plugin_row_meta', 10, 2 );
+ if ( ! AIOSEOPPRO ) {
-function aiosp_plugin_row_meta( $actions, $plugin_file ) {
+ $action_links = array(
+ 'donatelink' => array(
+ 'label' => __( 'Donate', 'all-in-one-seo-pack' ),
+ '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',
+ ),
+ 'amazon' => array(
+ 'label' => __( 'Amazon Wishlist', 'all-in-one-seo-pack' ),
+ 'url' => 'https://www.amazon.com/wishlist/1NFQ133FNCOOA/ref=wl_web',
+ ),
-if(!AIOSEOPPRO){
+ );
- $action_links = array(
- 'donatelink' => array(
- 'label' => __('Donate', 'all-in-one-seo-pack'),
- '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'
- )
-,
- 'amazon' => array(
- 'label' => __('Amazon Wishlist', 'all-in-one-seo-pack'),
- 'url' => 'https://www.amazon.com/wishlist/1NFQ133FNCOOA/ref=wl_web'
- )
-
-
-);
-
-}else{
- $action_links = '';
-}
+ } else {
+ $action_links = '';
+ }
- return aiosp_action_links( $actions, $plugin_file, $action_links, 'after');
-}
+ return aiosp_action_links( $actions, $plugin_file, $action_links, 'after' );
+ }
}
+if ( ! function_exists( 'aiosp_add_action_links' ) ) {
+ add_filter( 'plugin_action_links_' . plugin_basename( __FILE__ ), 'aiosp_add_action_links', 10, 2 );
+ /**
+ * @param $actions
+ * @param $plugin_file
+ *
+ * @return array
+ */
+ function aiosp_add_action_links( $actions, $plugin_file ) {
+ $aioseop_plugin_dirname = AIOSEOP_PLUGIN_DIRNAME;
+ $action_links = array();
+ $action_links = array(
+ 'settings' => array(
+ 'label' => __( 'SEO Settings', 'all-in-one-seo-pack' ),
+ 'url' => get_admin_url( null, "admin.php?page=$aioseop_plugin_dirname/aioseop_class.php" ),
+ ),
-if(!function_exists('aiosp_add_action_links')) {
-
-
-add_filter( 'plugin_action_links_' . plugin_basename(__FILE__) , 'aiosp_add_action_links', 10, 2 );
-
-
+ 'forum' => array(
+ 'label' => __( 'Support Forum', 'all-in-one-seo-pack' ),
+ 'url' => 'http://semperplugins.com/support/',
+ ),
-function aiosp_add_action_links( $actions, $plugin_file ) {
-
- $aioseop_plugin_dirname = AIOSEOP_PLUGIN_DIRNAME;
- $action_links = Array();
- $action_links = array(
- 'settings' => array(
- 'label' => __('SEO Settings', 'all-in-one-seo-pack'),
- 'url' => get_admin_url(null, "admin.php?page=$aioseop_plugin_dirname/aioseop_class.php")
- ),
-
- 'forum' => array(
- 'label' => __('Support Forum', 'all-in-one-seo-pack'),
- 'url' => 'http://semperplugins.com/support/'
+ 'docs' => array(
+ 'label' => __( 'Documentation', 'all-in-one-seo-pack' ),
+ 'url' => 'http://semperplugins.com/documentation/',
),
- 'docs' => array(
- 'label' => __('Documentation', 'all-in-one-seo-pack'),
- 'url' => 'http://semperplugins.com/documentation/'
- )
-
- );
+ );
-unset( $actions['edit'] );
+ unset( $actions['edit'] );
-if(!AIOSEOPPRO){
-$action_links['proupgrade'] =
- array(
- 'label' => __('Upgrade to Pro', 'all-in-one-seo-pack'),
- 'url' => 'http://semperplugins.com/plugins/all-in-one-seo-pack-pro-version/?loc=plugins'
+ if ( ! AIOSEOPPRO ) {
+ $action_links['proupgrade'] =
+ array(
+ 'label' => __( 'Upgrade to Pro', 'all-in-one-seo-pack' ),
+ 'url' => 'http://semperplugins.com/plugins/all-in-one-seo-pack-pro-version/?loc=plugins',
-);
-}
+ );
+ }
- return aiosp_action_links( $actions, $plugin_file, $action_links, 'before');
+ return aiosp_action_links( $actions, $plugin_file, $action_links, 'before' );
+ }
}
+
+if ( ! function_exists( 'aiosp_action_links' ) ) {
+
+ /**
+ * @param $actions
+ * @param $plugin_file
+ * @param array $action_links
+ * @param string $position
+ *
+ * @return array
+ */
+ function aiosp_action_links( $actions, $plugin_file, $action_links = array(), $position = 'after' ) {
+ static $plugin;
+ if ( ! isset( $plugin ) ) {
+ $plugin = plugin_basename( __FILE__ );
+ }
+ if ( $plugin === $plugin_file && ! empty( $action_links ) ) {
+ foreach ( $action_links as $key => $value ) {
+ $link = array( $key => '' . $value['label'] . ' ' );
+ if ( 'after' === $position ) {
+ $actions = array_merge( $actions, $link );
+ } else {
+ $actions = array_merge( $link, $actions );
+ }
+ }//foreach
+ }// if
+ return $actions;
+ }
}
- if(!function_exists('aiosp_action_links')) {
-function aiosp_action_links ( $actions, $plugin_file, $action_links = array(), $position = 'after' ) {
- static $plugin;
- if( !isset($plugin) ) {
- $plugin = plugin_basename( __FILE__ );
- }
- if( $plugin == $plugin_file && !empty( $action_links ) ) {
- foreach( $action_links as $key => $value ) {
- $link = array( $key => '' . $value['label'] . ' ' );
- if( $position == 'after' ) {
- $actions = array_merge( $actions, $link );
- } else {
- $actions = array_merge( $link, $actions );
- }
- }//foreach
- }// if
- return $actions;
-}
-}
-if ( !function_exists( 'aioseop_init_class' ) ) {
+if ( ! function_exists( 'aioseop_init_class' ) ) {
function aioseop_init_class() {
global $aiosp;
load_plugin_textdomain( 'all-in-one-seo-pack', false, dirname( plugin_basename( __FILE__ ) ) . '/i18n/' );
require_once( AIOSEOP_PLUGIN_DIR . 'inc/aioseop_functions.php' );
require_once( AIOSEOP_PLUGIN_DIR . 'aioseop_class.php' );
- require_once( AIOSEOP_PLUGIN_DIR . 'inc/aioseop_updates_class.php');
- require_once( AIOSEOP_PLUGIN_DIR . 'inc/commonstrings.php');
- require_once( AIOSEOP_PLUGIN_DIR . 'admin/display/postedit.php');
- require_once( AIOSEOP_PLUGIN_DIR . 'admin/display/general-metaboxes.php');
- require_once( AIOSEOP_PLUGIN_DIR . 'inc/aiosp_common.php');
- require_once( AIOSEOP_PLUGIN_DIR . 'admin/meta_import.php');
-
- if( AIOSEOPPRO ){
+ require_once( AIOSEOP_PLUGIN_DIR . 'inc/aioseop_updates_class.php' );
+ require_once( AIOSEOP_PLUGIN_DIR . 'inc/commonstrings.php' );
+ require_once( AIOSEOP_PLUGIN_DIR . 'admin/display/postedit.php' );
+ require_once( AIOSEOP_PLUGIN_DIR . 'admin/display/general-metaboxes.php' );
+ require_once( AIOSEOP_PLUGIN_DIR . 'inc/aiosp_common.php' );
+ require_once( AIOSEOP_PLUGIN_DIR . 'admin/meta_import.php' );
+ require_once( AIOSEOP_PLUGIN_DIR . 'inc/translations.php' );
+ require_once( AIOSEOP_PLUGIN_DIR . 'public/opengraph.php' );
+ require_once( AIOSEOP_PLUGIN_DIR . 'inc/compatability/compat-init.php');
+ require_once( AIOSEOP_PLUGIN_DIR . 'public/front.php' );
+
+ if ( AIOSEOPPRO ) {
require_once( AIOSEOP_PLUGIN_DIR . 'pro/functions_general.php' );
- require_once( AIOSEOP_PLUGIN_DIR . 'pro/functions_class.php');
- require_once( AIOSEOP_PLUGIN_DIR . 'pro/aioseop_pro_updates_class.php');
+ require_once( AIOSEOP_PLUGIN_DIR . 'pro/functions_class.php' );
+ require_once( AIOSEOP_PLUGIN_DIR . 'pro/aioseop_pro_updates_class.php' );
}
aiosp_seometa_import(); // call importer functions... this should be moved somewhere better
-
+
$aiosp = new All_in_One_SEO_Pack();
-
+
$aioseop_updates = new AIOSEOP_Updates();
- if( AIOSEOPPRO ){
+ if ( AIOSEOPPRO ) {
$aioseop_pro_updates = new AIOSEOP_Pro_Updates();
add_action( 'admin_init', array( $aioseop_pro_updates, 'version_updates' ), 12 );
}
- if ( aioseop_option_isset( 'aiosp_unprotect_meta' ) )
+ if ( aioseop_option_isset( 'aiosp_unprotect_meta' ) ) {
add_filter( 'is_protected_meta', 'aioseop_unprotect_meta', 10, 3 );
-
-
-
+ }
add_action( 'init', array( $aiosp, 'add_hooks' ) );
add_action( 'admin_init', array( $aioseop_updates, 'version_updates' ), 11 );
-
- if ( defined( 'DOING_AJAX' ) && !empty( $_POST ) && !empty( $_POST['action'] ) && ( $_POST['action'] === 'aioseop_ajax_scan_header' ) ) {
+
+ if ( defined( 'DOING_AJAX' ) && ! empty( $_POST ) && ! empty( $_POST['action'] ) && 'aioseop_ajax_scan_header' === $_POST['action'] ) {
remove_action( 'init', array( $aiosp, 'add_hooks' ) );
- add_action('admin_init', 'aioseop_scan_post_header' );
- add_action('shutdown', 'aioseop_ajax_scan_header' ); // if the action doesn't run -- pdb
- include_once(ABSPATH . 'wp-admin/includes/screen.php');
+ add_action( 'admin_init', 'aioseop_scan_post_header' );
+ add_action( 'shutdown', 'aioseop_ajax_scan_header' ); // if the action doesn't run -- pdb
+ include_once( ABSPATH . 'wp-admin/includes/screen.php' );
global $current_screen;
- if ( class_exists( 'WP_Screen' ) )
+ if ( class_exists( 'WP_Screen' ) ) {
$current_screen = WP_Screen::get( 'front' );
+ }
}
}
}
@@ -360,47 +427,49 @@ function aioseop_init_class() {
//add_action( 'after_setup_theme', 'aioseop_load_modules' );
if ( is_admin() ) {
- add_action( 'wp_ajax_aioseop_ajax_save_meta', 'aioseop_ajax_save_meta' );
- add_action( 'wp_ajax_aioseop_ajax_save_url', 'aioseop_ajax_save_url' );
- add_action( 'wp_ajax_aioseop_ajax_delete_url', 'aioseop_ajax_delete_url' );
- add_action( 'wp_ajax_aioseop_ajax_scan_header', 'aioseop_ajax_scan_header' );
- if(AIOSEOPPRO){
+ add_action( 'wp_ajax_aioseop_ajax_save_meta', 'aioseop_ajax_save_meta' );
+ add_action( 'wp_ajax_aioseop_ajax_save_url', 'aioseop_ajax_save_url' );
+ add_action( 'wp_ajax_aioseop_ajax_delete_url', 'aioseop_ajax_delete_url' );
+ add_action( 'wp_ajax_aioseop_ajax_scan_header', 'aioseop_ajax_scan_header' );
+ if ( AIOSEOPPRO ) {
add_action( 'wp_ajax_aioseop_ajax_facebook_debug', 'aioseop_ajax_facebook_debug' );
}
- add_action( 'wp_ajax_aioseop_ajax_save_settings', 'aioseop_ajax_save_settings');
- add_action( 'wp_ajax_aioseop_ajax_get_menu_links', 'aioseop_ajax_get_menu_links');
- add_action( 'wp_ajax_aioseo_dismiss_yst_notice' , 'aioseop_update_yst_detected_notice');
- add_action( 'wp_ajax_aioseo_dismiss_visibility_notice' , 'aioseop_update_user_visibilitynotice');
- add_action( 'wp_ajax_aioseo_dismiss_woo_upgrade_notice' , 'aioseop_woo_upgrade_notice_dismissed');
- if(AIOSEOPPRO){
- add_action( 'wp_ajax_aioseop_ajax_update_oembed', 'aioseop_ajax_update_oembed' );
+ add_action( 'wp_ajax_aioseop_ajax_save_settings', 'aioseop_ajax_save_settings' );
+ add_action( 'wp_ajax_aioseop_ajax_get_menu_links', 'aioseop_ajax_get_menu_links' );
+ add_action( 'wp_ajax_aioseo_dismiss_yst_notice', 'aioseop_update_yst_detected_notice' );
+ add_action( 'wp_ajax_aioseo_dismiss_visibility_notice', 'aioseop_update_user_visibilitynotice' );
+ add_action( 'wp_ajax_aioseo_dismiss_woo_upgrade_notice', 'aioseop_woo_upgrade_notice_dismissed' );
+ if ( AIOSEOPPRO ) {
+ add_action( 'wp_ajax_aioseop_ajax_update_oembed', 'aioseop_ajax_update_oembed' );
}
}
-if ( !function_exists( 'aioseop_scan_post_header' ) ) {
+if ( ! function_exists( 'aioseop_scan_post_header' ) ) {
function aioseop_scan_post_header() {
require_once( ABSPATH . WPINC . '/default-filters.php' );
global $wp_query;
$wp_query->query_vars['paged'] = 0;
- query_posts('post_type=post&posts_per_page=1');
- if (have_posts()) the_post();
+ query_posts( 'post_type=post&posts_per_page=1' );
+ if ( have_posts() ) {
+ the_post();
+ }
}
}
-require_once( AIOSEOP_PLUGIN_DIR . 'aioseop_init.php' );
-
+require_once( AIOSEOP_PLUGIN_DIR . 'aioseop-init.php' );
-if(!function_exists('aioseop_install')){
-register_activation_hook( __FILE__, 'aioseop_install' );
+if ( ! function_exists( 'aioseop_install' ) ) {
+ register_activation_hook( __FILE__, 'aioseop_install' );
-function aioseop_install(){
- aioseop_activate();
-}
+ function aioseop_install() {
+ aioseop_activate();
+ }
}
-if(!function_exists('disable_all_in_one_free')){
-function disable_all_in_one_free(){
- if ( AIOSEOPPRO && is_plugin_active( 'all-in-one-seo-pack/all_in_one_seo_pack.php' )){
- deactivate_plugins( 'all-in-one-seo-pack/all_in_one_seo_pack.php' );
+if ( ! function_exists( 'disable_all_in_one_free' ) ) {
+ function disable_all_in_one_free() {
+ if ( AIOSEOPPRO && is_plugin_active( 'all-in-one-seo-pack/all_in_one_seo_pack.php' ) ) {
+ deactivate_plugins( 'all-in-one-seo-pack/all_in_one_seo_pack.php' );
+ }
}
-}}
+}
diff --git a/wp-content/plugins/all-in-one-seo-pack/css/aiosp_admin.css b/wp-content/plugins/all-in-one-seo-pack/css/aiosp_admin.css
index 315264e60a..e10a62098f 100644
--- a/wp-content/plugins/all-in-one-seo-pack/css/aiosp_admin.css
+++ b/wp-content/plugins/all-in-one-seo-pack/css/aiosp_admin.css
@@ -1,72 +1,76 @@
- #toplevel_page_all-in-one-seo-pack-pro-aioseop_class .wp-menu-image {
- background: url(../images/shield-sprite-16.png) no-repeat 8px 6px !important;
- }
- #toplevel_page_all-in-one-seo-pack-aioseop_class .wp-menu-image {
- background: url(../images/shield-sprite-16.png) no-repeat 8px 6px !important;
- }
- #toplevel_page_all-in-one-seo-pack-pro-aioseop_class .wp-menu-image img {
- display: none;
- }
- #toplevel_page_all-in-one-seo-pack-aioseop_class .wp-menu-image img {
- display: none;
- }
- #adminmenu #toplevel_page_all-in-one-seo-pack-pro-aioseop_class .wp-menu-image:before {
- content: '';
- }
- #toplevel_page_all-in-one-seo-pack-aioseop_class .wp-menu-image:before {
- content: '' !important;
- }
- #toplevel_page_all-in-one-seo-pack-pro-aioseop_class:hover .wp-menu-image, #toplevel_page_all-in-one-seo-pack-pro-aioseop_class.wp-has-current-submenu .wp-menu-image {
- background-position: 8px -26px !important;
- }
- #toplevel_page_all-in-one-seo-pack-aioseop_class:hover .wp-menu-image, #toplevel_page_all-in-one-seo-pack-aioseop_class.wp-has-current-submenu .wp-menu-image {
- background-position: 8px -26px !important;
- }
- #icon-aioseop.icon32 {
- background: url(../images/shield32.png) no-repeat left top !important;
- }
- #aioseop_settings_header #message {
- padding: 5px 0px 5px 50px;
- background-image: url(../images/update32.png);
- background-repeat: no-repeat;
- background-position: 10px;
- font-size: 14px;
- min-height: 32px;
- clear: none;
- }
+#toplevel_page_all-in-one-seo-pack-pro-aioseop_class .wp-menu-image {
+ background: url(../images/shield-sprite-16.png) no-repeat 8px 6px !important;
+}
+
+#toplevel_page_all-in-one-seo-pack-aioseop_class .wp-menu-image {
+ background: url(../images/shield-sprite-16.png) no-repeat 8px 6px !important;
+}
+
+#toplevel_page_all-in-one-seo-pack-pro-aioseop_class .wp-menu-image img {
+ display: none;
+}
+
+#toplevel_page_all-in-one-seo-pack-aioseop_class .wp-menu-image img {
+ display: none;
+}
+
+#adminmenu #toplevel_page_all-in-one-seo-pack-pro-aioseop_class .wp-menu-image:before {
+ content: '';
+}
+
+#toplevel_page_all-in-one-seo-pack-aioseop_class .wp-menu-image:before {
+ content: '' !important;
+}
- @media
- only screen and (-webkit-min-device-pixel-ratio: 1.5),
- only screen and ( min--moz-device-pixel-ratio: 1.5),
- only screen and ( -o-min-device-pixel-ratio: 3/2),
- only screen and ( min-device-pixel-ratio: 1.5),
- only screen and ( min-resolution: 1.5dppx) {
+#toplevel_page_all-in-one-seo-pack-pro-aioseop_class:hover .wp-menu-image, #toplevel_page_all-in-one-seo-pack-pro-aioseop_class.wp-has-current-submenu .wp-menu-image {
+ background-position: 8px -26px !important;
+}
- #toplevel_page_all-in-one-seo-pack-pro-aioseop_class .wp-menu-image {
- background-image: url('../images/shield-sprite-32.png') !important;
- -webkit-background-size: 16px 48px !important;
- -moz-background-size: 16px 48px !important;
- background-size: 16px 48px !important;
- }
+#toplevel_page_all-in-one-seo-pack-aioseop_class:hover .wp-menu-image, #toplevel_page_all-in-one-seo-pack-aioseop_class.wp-has-current-submenu .wp-menu-image {
+ background-position: 8px -26px !important;
+}
- #toplevel_page_all-in-one-seo-pack-aioseop_class .wp-menu-image {
- background-image: url('../images/shield-sprite-32.png') !important;
- -webkit-background-size: 16px 48px !important;
- -moz-background-size: 16px 48px !important;
- background-size: 16px 48px !important;
- }
+#icon-aioseop.icon32 {
+ background: url(../images/shield32.png) no-repeat left top !important;
+}
- #icon-aioseop.icon32 {
- background-image: url('../images/shield64.png') !important;
- -webkit-background-size: 32px 32px !important;
- -moz-background-size: 32px 32px !important;
- background-size: 32px 32px !important;
- }
+#aioseop_settings_header #message {
+ padding: 5px 0px 5px 50px;
+ background-image: url(../images/update32.png);
+ background-repeat: no-repeat;
+ background-position: 10px;
+ font-size: 14px;
+ min-height: 32px;
+ clear: none;
+}
- #aioseop_settings_header #message {
- background-image: url(../images/update64.png) !important;
- -webkit-background-size: 32px 32px !important;
- -moz-background-size: 32px 32px !important;
- background-size: 32px 32px !important;
- }
- }
\ No newline at end of file
+@media only screen and (-webkit-min-device-pixel-ratio: 1.5), only screen and ( min--moz-device-pixel-ratio: 1.5), only screen and ( -o-min-device-pixel-ratio: 3/2), only screen and ( min-device-pixel-ratio: 1.5), only screen and ( min-resolution: 1.5dppx) {
+
+ #toplevel_page_all-in-one-seo-pack-pro-aioseop_class .wp-menu-image {
+ background-image: url('../images/shield-sprite-32.png') !important;
+ -webkit-background-size: 16px 48px !important;
+ -moz-background-size: 16px 48px !important;
+ background-size: 16px 48px !important;
+ }
+
+ #toplevel_page_all-in-one-seo-pack-aioseop_class .wp-menu-image {
+ background-image: url('../images/shield-sprite-32.png') !important;
+ -webkit-background-size: 16px 48px !important;
+ -moz-background-size: 16px 48px !important;
+ background-size: 16px 48px !important;
+ }
+
+ #icon-aioseop.icon32 {
+ background-image: url('../images/shield64.png') !important;
+ -webkit-background-size: 32px 32px !important;
+ -moz-background-size: 32px 32px !important;
+ background-size: 32px 32px !important;
+ }
+
+ #aioseop_settings_header #message {
+ background-image: url(../images/update64.png) !important;
+ -webkit-background-size: 32px 32px !important;
+ -moz-background-size: 32px 32px !important;
+ background-size: 32px 32px !important;
+ }
+}
diff --git a/wp-content/plugins/all-in-one-seo-pack/css/modules/aioseop_module-rtl.css b/wp-content/plugins/all-in-one-seo-pack/css/modules/aioseop_module-rtl.css
index 5b67097432..e8d0cbb77a 100644
--- a/wp-content/plugins/all-in-one-seo-pack/css/modules/aioseop_module-rtl.css
+++ b/wp-content/plugins/all-in-one-seo-pack/css/modules/aioseop_module-rtl.css
@@ -1,232 +1,246 @@
* {
- direction: rtl !important
+ direction: rtl !important
}
.form-table.aioseop {
- clear: none
+ clear: none
}
.form-table.aioseop th {
- padding: 10px 9px 12px 0;
- direction: rtl
+ padding: 10px 9px 12px 0;
+ direction: rtl
}
.aioseop_help_text_link,
.aioseop_help_text_link:active {
- text-align: right;
- float: right
+ text-align: right;
+ float: right
}
.aioseop_help_text_link span {
- left: -60px;
+ left: -60px;
}
.aioseop_meta_box_help > label {
- margin-left: 0;
- margin-right: 8px
+ margin-left: 0;
+ margin-right: 8px
}
.aioseop_help_text_link img {
- float: left
+ float: left
}
.aioseop_meta_box_help,
.aioseop_meta_box_help:active {
- float: left;
- padding-left: 0;
- margin-right: 0;
- margin-left: 64px
+ float: left;
+ padding-left: 0;
+ margin-right: 0;
+ margin-left: 64px
}
.aioseop_label {
- padding-left: 0;
- padding-right: 20px;
- text-align: right;
- direction: rtl
+ padding-left: 0;
+ padding-right: 20px;
+ text-align: right;
+ direction: rtl
}
.aioseop input[type="text"] {
- padding: 2px 10px 2px 0
+ padding: 2px 10px 2px 0
}
.aioseop textarea {
- padding: 10px 10px 0 0
+ padding: 10px 10px 0 0
}
.aioseop_help_text_div {
- text-align: right;
- margin: 8px 0 10px 0
+ text-align: right;
+ margin: 8px 0 10px 0
}
.aioseop_help_text {
- float: right;
- clear: right
+ float: right;
+ clear: right
}
.aioseop_head_nav {
- float: right
+ float: right
}
.aioseop_head_nav_tab {
- margin: 0 15px 0 0;
- float: right
+ margin: 0 15px 0 0;
+ float: right
}
.aioseop_head_nav_tab:first-child {
- margin-right: 0
+ margin-right: 0
}
.aioseop_header {
- float: right;
- clear: right
+ float: right;
+ clear: right
}
.aioseop_nopad {
- padding-right: 0
+ padding-right: 0
}
.aioseop_adverts {
- float: left
+ float: left
}
.aioseop_content {
- clear: right
+ clear: right
}
#aiosp_feature_manager_metabox.postbox {
- float: right
+ float: right
}
.aioseop_sidebar {
- margin-left: 0;
- margin-right: 10px
+ margin-left: 0;
+ margin-right: 10px
}
.aioseop_option_label {
- float: right !important;
- clear: right !important;
+ float: right !important;
+ clear: right !important;
}
.aioseop_settings_left {
- float: right;
+ float: right;
}
.aioseop_option_input {
- float: left; /*clear: right !important;*/
- padding-left: 0;
- padding-right: 1px;
- margin-bottom: 20px;
- width: 60%;
- min-width: 160px;
+ float: left; /*clear: right !important;*/
+ padding-left: 0;
+ padding-right: 1px;
+ margin-bottom: 20px;
+ width: 60%;
+ min-width: 160px;
}
.aioseop_top {
- margin: 10px 0 0 10px
+ margin: 10px 0 0 10px
}
.aioseop_right_sidebar {
- float: left
+ float: left
}
div.aioseop_feature {
- float: right
+ float: right
}
-.aioseop_feature .feature_button {
+.aioseop_feature #free-flag {
float: left;
margin-right: 0;
- margin-left: 10px
+ background: none repeat scroll 0 0 #D23D46;
+ color: #FFFFFF;
+ padding: 5px 12px;
+ position: relative;
+}
+
+.aioseop_feature #free-flag:before,
+.aioseop_feature #free-flag:after {
+ display: none;
+}
+
+.aioseop_feature .feature_button {
+ float: left;
+ margin-right: 0;
+ margin-left: 10px
}
.aioseop_follow_button {
- margin-right: 0;
- margin-left: 5px
+ margin-right: 0;
+ margin-left: 5px
}
.aioseop_wrapper {
- padding-left: 0;
- padding-right: 5px;
- direction: rtl
+ padding-left: 0;
+ padding-right: 5px;
+ direction: rtl
}
.aioseop_input {
- clear: left
+ clear: left
}
#aiosp div.preview_snippet {
- padding: 15px 7px 20px 15px
+ padding: 15px 7px 20px 15px
}
#aiosp_sitemap_addl_pages,
#aiosp_video_sitemap_addl_pages {
- clear: right;
- margin-left: 0px;
- margin-right: 20px
+ clear: right;
+ margin-left: 0;
+ margin-right: 20px
}
.All_in_One_SEO_Pack_Opengraph table.aioseop_table {
- border-left: 0 solid #dfdfdf;
- border-right: 1px solid #dfdfdf
+ border-left: 0 solid #dfdfdf;
+ border-right: 1px solid #dfdfdf
}
.All_in_One_SEO_Pack_Opengraph table.aioseop_table th {
- border-right: 0 solid #dfdfdf;
- border-left: 1px solid #dfdfdf
+ border-right: 0 solid #dfdfdf;
+ border-left: 1px solid #dfdfdf
}
.All_in_One_SEO_Pack_Opengraph table.aioseop_table td {
- border-right: 0 solid #dfdfdf;
- border-left: 1px solid #dfdfdf
+ border-right: 0 solid #dfdfdf;
+ border-left: 1px solid #dfdfdf
}
#aiosp_sitemap_addl_pages_metabox table.aioseop_table td,
#aiosp_video_sitemap_addl_pages_metabox table.aioseop_table td {
- padding-left: 0;
- padding-right: 5%
+ padding-left: 0;
+ padding-right: 5%
}
.aioseop_settings_left .postbox {
- float: right
+ float: right
}
.aioseop_option_setting_label {
- padding-left: 0;
- padding-right: 1px
+ padding-left: 0;
+ padding-right: 1px
}
.aioseop_settings_left .postbox .inside {
- clear: left
+ clear: left
}
-.postbox h2 .Taha {
- float: left !important;
+.postbox h2 .Taha {
+ float: left !important;
}
#aiosp_settings_form .aioseop_no_label,
.aioseop_no_label {
- float: right;
- margin: 0 13px 0 23px
+ float: right;
+ margin: 0 13px 0 23px
}
.aioseop_module.error.below-h2 {
- margin: 0 0 15px 477px !important
+ margin: 0 0 15px 477px !important
}
.robots img {
- margin: 0 2px 0 0
+ margin: 0 2px 0 0
}
/* Robots.txt styling */
#aiosp_robots_generator_robotgen_wrapper .aioseop_option_div,
#aiosp_robots_generator_robothtml_wrapper .aioseop_option_div {
- margin-top: 10px;
+ margin-top: 10px;
}
div.aioseop_notice a.aioseop_dismiss_link {
- position: absolute;
- top: 10px;
- left: 10px;
- text-align: left;
+ position: absolute;
+ top: 10px;
+ left: 10px;
+ text-align: left;
}
/*
@@ -237,65 +251,65 @@ div.aioseop_notice a.aioseop_dismiss_link {
}*/
.aioseop_help_text ul {
- margin: 15px 20px 0 0
+ margin: 15px 20px 0 0
}
.aioseop_header_tabs li a.aioseop_header_tab {
- margin: 5px 0 0 5px
+ margin: 5px 0 0 5px
}
.aioseop_header_tabs li:first-child a.aioseop_header_tab {
- border-left: solid 0 #CCC;
- border-right: solid 1px #CCC;
- margin-left: 0;
- margin-right: 5px
+ border-left: solid 0 #CCC;
+ border-right: solid 1px #CCC;
+ margin-left: 0;
+ margin-right: 5px
}
.aioseop_tab {
- padding-left: 0;
- padding-right: 5px
+ padding-left: 0;
+ padding-right: 5px
}
form#aiosp_settings_form,
.aioseop_tabs_div {
- padding-right: 0;
- padding-left: 477px
+ padding-right: 0;
+ padding-left: 477px
}
#aiosp_settings_form ul.sfwd_debug_settings li strong {
- float: right;
- text-align: left;
- margin-right: 0;
- margin-left: 8px;
- padding-right: 0;
- padding-left: 8px
+ float: right;
+ text-align: left;
+ margin-right: 0;
+ margin-left: 8px;
+ padding-right: 0;
+ padding-left: 8px
}
#aiosp_settings_form ul.sfwd_debug_settings li {
- clear: right
+ clear: right
}
.aioseop_advert {
- direction: rtl;
- float: right;
- z-index: 999999
+ direction: rtl;
+ float: right;
+ z-index: 999999
}
.aioseop_advert form input {
- float: left
+ float: left
}
.MRL {
- margin-left: 0 !important;
- margin-right: 20px !important;
+ margin-left: 0 !important;
+ margin-right: 20px !important;
}
.aioseop_upload_image_label {
- clear: right !important;
- float: none !important;
+ clear: right !important;
+ float: none !important;
}
.aioseop_upload_image_button {
- float: right !important;
- margin-bottom: 5px !important;
-}
\ No newline at end of file
+ float: right !important;
+ margin-bottom: 5px !important;
+}
diff --git a/wp-content/plugins/all-in-one-seo-pack/css/modules/aioseop_module.css b/wp-content/plugins/all-in-one-seo-pack/css/modules/aioseop_module.css
index 0ca96a681b..ac9d4449bd 100644
--- a/wp-content/plugins/all-in-one-seo-pack/css/modules/aioseop_module.css
+++ b/wp-content/plugins/all-in-one-seo-pack/css/modules/aioseop_module.css
@@ -1,1120 +1,1309 @@
-.form-table.aioseop {
- clear: none;
-}
-.form-table.aioseop td {
- vertical-align: top;
- padding: 16px 0 10px 0;
- line-height: 20px;
- font-size: 12px;
-}
-.form-table.aioseop th {
- width: 200px;
- padding: 10px 0 12px 9px;
-}
-.aioseop_help_text_link, .aioseop_help_text_link:active {
- text-align: left;
- float: left;
- max-width: 300px;
- min-width: 1px;
- padding-top: 2px;
- outline: none;
- color: #888;
- border: 2px solid #888;
- border-radius: 33px;
- width: 22px;
- height: 20px;
- display: inline-block;
- font-family: sans-serif;
-}
-.aioseop_help_text_link span {
- position: absolute;
- left: 21px;
- font-size: 14px;
-}
-.aioseop_help_text_link:before {
- content: '\a0?';
- color: #888;
- font-size: 19px;
-}
-
-#aioseop-support .aioseop_metabox_text, #aioseop-support a {
- font-size: 14px;
- color: #000;
- text-decoration: none;
-}
-
-.aioseop_icon {
- display: inline-block;
- width: 40px;
- height: 40px;
- background-repeat: no-repeat;
- background-size: 100%;
- vertical-align: middle;
- margin: 10px;
-}
-
-.aioseop_book_icon {
- background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABABAMAAABYR2ztAAAAKlBMVEUAAAAAn+cAneEAnuABnuEBnuEAnuEAn+QAn+QAneAAnuEAneAAnuAAneFPI9ocAAAADnRSTlMAII/P/wCQMADwANDvnyPbz6kAAAB9SURBVHgB7c+xCQMgEIVhZwiSSRzhkRBImsA5gVUmuBGcJbUDxlhY6T2wvh/sPvBd+HdJWCSj0N8bsEEiIIOAyEBhIDGAcwA4cDBy4MDBTeuqCR5abXCvBHy+6ybQrs2R0jsH/As+srEzC55qggi81AIZ+waQxkBmQK5tD34LnXJVZf9y5gAAAABJRU5ErkJggg==);
-}
-
-.aioseop_cog_icon {
- background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAMAAACdt4HsAAAAeFBMVEUAAAAAn+MAnOIAn+cAneIAneEAn+MAnuEAneIAnuAAnuAAneEAn+cAn+QAn98AnuEAn98AneAAneEAneAAnOIAnuAAnuEAnuAAneEAn+EAnuEAnuAAneEAneAAneAAn+QAnuEAnuABnuEAneAAn+EAnuIAnuMBnuHeY3dlAAAAJ3RSTlMAQFAAYIAAkADP3wAgMACgEACfrwC/X++PbwAAcODwALDAANAATz8hP00ZAAACHklEQVR4Xq3XbWObIBAHcPAJJRjJVmtso4vL2vv+33AzJO2J/LuE9PfGFyR4HHiAgCQxyRMiYEtGTL5BBGzJiVEviIAtFTH6FRGowdBC/QsQqKGhhebeIdTkqe+LwFbkqew2SGyDftDKz12Q2AXYlhgeA46AD/G5oyD9zJO0zIEhvXd91L0mSPcmnZlek0nPhHu4mKu2ov+q2rZzOWE5kBRBFjNRzDRFqD6X8oGiHK5fo+0oSmcv06goknLfQk3RzHkaWwIGlUhrZaIGAto5iQn6uyw+yAFOpSgUTDEHJqqZc5DR2rgqw8lIa7mbRkkMLOOBoWZlWYrynwzGzx1C/3cdlEcvf7sgL5MTq8rGz22QNwjDP+cGBYBDOC6qcnLTNqQCeRbuYdEU4In47YjL84RSwEk+Tq8qT7xvhMc5eXsj78Buga866O4dQrXs4OEk3jaNTWC1Cfc43nSa0MQ0fCFFLWXL9saWFjQMgFOfEUR+zsl1KWeRBaWr3e7c01q3Lmld+FfiSVFQ/2ehp6B8IzaorGvJ8q8Jl/ViIkDv396tfX/bawKm81J+eGtLH91cX+xIUUZ7XYmPHTBmA0U4feMh6zqVwzTe8ubQvmBoUJeDphoIGtT5tVaq0Ttopvyom4M4xqz8YGXhiCLAnIKhg8N2iA30cLzrxmJH/H4cASejrjzcFHXpwrcukwIiRQZv2QICtjQP352/9fYuC+Qv593CTVvcgwkAAAAASUVORK5CYII=);
-}
-
-.aioseop_file_icon {
- background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAMAAACdt4HsAAAAPFBMVEUAAAAAneAAn98AneIAneEAnuAAn+QAnuAAnuAAnuEAn+MAnuEAneAAnuEAn+EAneEAnOIAnuEAnuABnuG5yOaaAAAAE3RSTlMA0BBgn88wv++gQLCvX2+PUJDAyp/15gAAALdJREFUeF7t1z2ygzAMhVFJjm0C5Ff732uaMCSWCVzTJO/paz1zRsVtTM/OUT+Wx5PQchJ1Q2O/CETdVk51IOjWugAeYLvUAEU6rAO4oLhQB2bSvh+NAAKU2AgYQGIEDHgXbjhQCFcYKIQuoUApZBQwQg8CRhhAwArSBlCagNAI0LTqAQCq3fcC+jOA7e8DDuhK/wDwHfgOfAe+A98B2BcC3Aaw+XiCBdp3AtOcNAgs9FoACZ7ufwCe6pfMGb29UwAAAABJRU5ErkJggg==);
-}
-
-.aioseop_help_icon {
- background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAMAAACdt4HsAAAAflBMVEUAAAAAn98AnuIAn+EAneAAnuAAnuAAn+QAn+QAneEAnuAAnuAAn+EAnuAAnuEAneAAn+cAneAAnuAAn98AnOIAnuEAneIAn+MAnuEAnuEAn+EAneIAneEAneEAnuEAn+MAneAAneEAnuMAnOIAn+cAneEBnuEAneAAnuMBnuEoGewkAAAAKXRSTlMAEE9/r7/fADCPzwBv718AIPDAAFCwYEAAoAAAn4CQAOAAPwAAcADQAFP96WQAAAMNSURBVHhelZcNc5swDIatBghpoCGEj9Jij2XLMv3/P7glkoNtZJo+d+0lhBOveSXZUjHgZZOkGf4nS5PNC5wiKPFqvnvFgNddvpVQy0tQZCiSFfCEAtiUGKXcwFcB3kpcpXx791HetypFn2NdH9EnrX67KPdL46g/tl3PeqHvWidM2fxyUM7n3fzgof8R0A9zjN3PGTV/HB+6teg66EeIUQqQIGOiSQMGmeRgUQfGPn/Ktyv0k9UQKrCxWzitAq3V6dvYIDG8f8mAROO6ULF/3ecTaHazcvIgjTw/PxfFeVFErCHd31C3fx2v39cKGy6qLKyA1tGr/v8BLWDyb3OLqiw+XGCiq8DFxIvypMKIHqMXvaeLmmyEkn1xSTCAjWcMS7gruFD+eo/QuEC7AYCy+nJXkC1/r5A4Gq2NrQCvjMnL7OZCLggY3KoAI5jMEvKt2hohBYK3wiveuwx8i3qn/uvVf0O2Hh5MnLwOZMTrXgGt4OCi7RuyXNg1F1oDqEZIQh2K6oUALalSWqgiIwUIM4VVqZZvdlkE7QQFFLRVNS3l5NLZarMkgkx6ebWiNPqzSu9nEkM2KDZhjbykh+19KKri3+LkIxLhVlE/E4CaAjsd4AYo9zJkR9huGF7CtPYSX9FyXG4XFHe2UQIt9fIGa6NNJBErX2r35O0wp7KEbZYSNpVtMYngSpbZYoI1G9YClFzOp+vKS6jviLFJ+fWgDralfZO5peW2xX8LKB9NdTtxsQuc7/wV0OTv/YRyiUuIugCls7FwizffsXHgzcRurjEjYgH8zdVKyODZJUDGAuxZubNnt5BIgMQ7YNyowy2c0XfCqyNX6HzE2Ve8A28+nmDDHaJyD9sNChpkxvCYRxgkEjitAkl40AzPjxm7KdNnSAzLgaNFZhcVATtkBmliGaTJSJ6mBnnkMWgpx+XAMZZoMbGZqXEHm6Q4sxA4F4k7DEkjD1PVGJCmGFDLQ5elO+Iqx7B/q88A0FKI+DSlBLMuE4pMF3h6+DZXDLia6PAtA41u67uUqW51E02uf46zvXx+HY4YAAAAAElFTkSuQmCC);
-}
-
-.aioseop_support_icon {
- background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAMAAACdt4HsAAAAe1BMVEUAAAAAn98AnuIAn+EAneAAnuAAnuABnuEAn98An+QAneEAnuAAn+QAn+EAnuAAnuEAneAAnuEAneIAn+MAn+cAn+cAnuEAnuEAnOIAneEAneEAnOIAnuAAneEAn+MAneAAneEAneIAnuEAnuIAneAAnuAAneABnuEAnuPdwDkgAAAAKXRSTlMAEE9/r7/f/wAwj88Ab+9f0JBgQCAAALBQcAAAAJ8AAIAAoADgwPAAP4Dl7rAAAALsSURBVHgBtdcBc6I6EAfwRCH/KjUSTCW2eHK8kHff/xM+Dg5NlsTTOu830xmc0BhJdtllKXy1znKBgciz9Yq/JbC3mM22AFFsN+8x7H2B7wSixI4/sAK+lkiSa/63CfbXfy9VddAfA32oVHmdYn8MsaNP55jUhpOFmRqTXH/4mP/BSExOnxEnTKT58jDveouZaCIEZltvWna7POPm8GPhgJtzbIIMnvq4UMOTXWZsvjgjoD8IjcCZrkAh1H4SLUIq3EYDQjSEBGH8XdASVPUzUIGS2jsHORbyJpC8gzWDChGaPsL4ItnwxyUiuuPqnBdAkW9X/3SIkPxPMLWIkZJcL7XTNnKJb5J8XMEJ33YaVyCQYJUZ0tjGKIsE8XsXNuNUFpStvFMQGR4Xvhlyoppi51AjUAcZhdPRIVzr8UCzYzEfS91afxOJDle2Hc9IBaBoGMdg/raq/3s49/NPm/6TGQDl5Up3DoCN5G9uAbjOO6AlAMPa8Zd4JI0kP55k41EAWlaT+w0Ae4mytyAenQDUrCcZsCMr8igydADQM0ECrydf4zEA+uZGAygYBv96ivF4RG3GffNgsJiAfr439v9MUN7/CeXFgwGzrz1Eu9hG9eQ2Rg+SaKJE5CB1y6Ps7h1ld/FMR9mEm6vPEoCIBZMAIM/e8xoTQRjO+5y8fT0ZJvlc5PwJ57fymlDWMloBLKoHsb4mlPLCLnNKyxDIwpRGR72UtsEgUhoKrx7bR4Z3c1J9Tyft7ep3Wl9t04l/rFBefrFwh29y/N7L1TlynXy5JpbQHY3qS6Dslfnq4guYa+UXC4xBj4W+CSTvYFMEuOeLLKf9Ytssd5hw6TJv9FKhOeqeK3W7ZcNRP1Nsd7GOpXu83O/iLY8ij5CwmKlUz2TcIy2PIy2PT/eYZLRV5fsMk542XaHK3VrV/a+p7fu1uzWyjiZs9pPgrUOSa6ONJ8FPFlH2xB9uvlUJolTJ5juOm7buLQa2r1uvkSX+A/xd+1xZLxG0AAAAAElFTkSuQmCC);
-}
-
-.aioseop_youtube_icon {
- background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAMAAACdt4HsAAAARVBMVEUAAAAAn+cAn+EAneAAnuABnuEAn+cAn98AneEAn98AnOIAnuAAnOIAneIAneIAnuEAnuEAneEAnuEBnuEAn+QAneAAneCXjc90AAAAF3RSTlMAIG+vz/8AEJ8AUO8AYACgAHCwADDw0E/SOHoAAAEBSURBVHgB7dbBjsIgGATgH+UvCAso3fL+j7rDYZMerGGZQ5NNv8TrREZLRy47F3O7Wx1m7zezAMjSOa9/5t2jkweEqBNi+ALBJ+mklHOWnINOC/0buKjTokMHRQnlKUYpRl5HBQ32KFXfW783HVDFHgWsrg0EWNEDK4z0+yEAEhuAIsgAFMEFQOECILEBKIIMQBFcABQuABIbgCLIABTBBUBhAzx5BEuWGM/9GT35V7bkwxTPfZw9eaVZ8lKN517rI8NHmr43cPyufXi5Rh1Q+dc7PTAWduI83abTNteHJjvz6KEJYeoU2+/UBVcm+tuNbTCv2nRYq2k/9ylXwL8I+AGj+lzlceKDYQAAAABJRU5ErkJggg==);
-}
-
-.aioseop_help_text_link.aioseop_meta_box_help:before {
-font-size: 14px;
-}
-.aioseop_meta_box_help > label {
- position: absolute;
- margin-left: 8px;
-}
-div.aioseop_tip_icon {
- font-size: 14px;
- border: 1px solid #888;
- width: 1em;
- text-align: center;
- padding: 0px 4px;
- -webkit-border-radius: 12px;
- -moz-border-radius: 12px;
- -webkit-box-shadow: 1px 1px 1px #888;
- -moz-box-shadow: 1px 1px 1px #888;
- box-shadow: 1px 1px 1px #888;
- border-radius: 12px;
-}
-div.aioseop_tip_icon:before {
- content: '?';
-}
-.aioseop_help_text_link img {
- width: 40px;
- float: left;
-}
-.aioseop_meta_box_help, .aioseop_meta_box_help:active {
- float: right;
- padding-left: 0px;
- width: 16px;
- margin-right: 32px;
- text-decoration: none;
- height: 15px;
- padding-top: 1px;
- position: relative;
-}
-.aioseop_label {
- color: #5F5F5F;
- font-weight: bold;
- line-height: 19px;
- padding-left: 10px; /*changed from 20px to 10px for certain language support*/
- display: inline-block;
- text-align: left;
- position: absolute;
- font-family: 'Open Sans', sans-serif;
- width: 26%;
- min-width: 120px;
- max-width: 230px;
-}
-.aioseop_option_div {
- max-height: 160px;
- min-height: 43px;
- width: 95%;
- overflow-y: auto;
-}
-.aioseop_overflowed {
- border: 1px solid #e1e1e1;
-}
-.aioseop input[type="text"] {
- color: #515151;
- height: 35px;
- padding: 10px 0px 10px 10px;
- font-size: 14px;
- width: 95%;
- max-width: 600px;
-}
-.aioseop textarea {
- color: #515151;
- padding: 10px 0px 0px 10px;
- margin: 0px;
- font-size: 14px;
- line-height: 25px;
- width: 95%;
- max-width: 600px;
-}
-.aioseop_help_text_div {
- text-align:left;
- width:100%;
- margin: 10px 0px 10px 0px;
-}
-.aioseop_help_text {
- font-size: 12px;
- float: left;
- clear: left;
- color: #797979;
- line-height: 15px;
- font-style: italic;
-}
-.aioseop_head_tagline {
- color: #5F5F5F;
- font-size: 13px;
-}
-
-.aioseop_head_nav {
- float: left;
- font-size: 18px;
- margin: 0px 0 16px 0;
- font-family: "HelveticaNeue-Light","Helvetica Neue Light","Helvetica Neue",sans-serif;
- border-bottom: 1px solid #CCC;
- width: 100%;
-}
-.aioseop_head_nav_tab {
- padding: 10px 15px 10px 15px;
- margin: 0 0 0 15px;
- border-width: 1px 1px 0;
- border-radius: 4px 4px 0px 0;
- border-style: solid;
- border-color: #CCC #CCC white;
- float: left;
- opacity: 0.5;
- color: black;
- text-shadow: white 0 1px 0;
- text-decoration: none;
-}
-.aioseop_head_nav_tab.aioseop_head_nav_active {
- opacity: 1;
- margin-bottom: -1px;
- border-width: 1px;
-}
-.aioseop_head_nav_tab:first-child {
- margin-left: 0px;
-}
-.aioseop_head_nav_tab:hover {
- opacity:1;
-}
-.aioseop_header {
- float: left;
- clear: left;
-}
-
-.aioseop_advert {
- padding: 10px;
- margin-bottom: 30px;
- border: 1px solid #DDD;
- height: 200px;
- width: 423px;
-}
-
-.headwaythemes {
- background-color: #FFFFFF;
- padding-bottom: 110px;
- height: 125px;
-}
-
-.aioseop_nopad {
- padding-left: 0px;
- padding-top: 0px;
-}
-
-.aioseop_nopad_all {
- padding: 0px;
- height: 220px;
- width: 445px;
- margin-bottom: 20px;
- border: none;
-}
-
-.aioseop_adverts {
- float: right;
-}
-
-.wincherad {
- width: 100%;
- height: 100%;
- background-size: 100%;
- background-repeat: no-repeat;
- margin-bottom: 0px;
- border: none;
-}
-/*
-#wincher11 {
- background-image: url(images/banner11.png);
-}
-#wincher12 {
- background-image: url(images/banner12.png);
-}
-#wincher13 {
- background-image: url(images/banner13.png);
-}
-#wincher14 {
- background-image: url(images/banner14.png);
-}
-#wincher15 {
- background-image: url(images/banner15.png);
-}
-*/
-#wincher21 {
- background-image: url(../../modules/images/banner21.jpg);
-}
-#wincher22 {
- background-image: url(../../modules/images/banner22.jpg);
-}
-.aioseop_content {
- min-width: 760px;
- clear: left;
-}
-.aioseop_options_wrapper {
-}
-.aioseop_options_wrapper .hndle {
- font-size: 15px;
- font-family: Georgia,"Times New Roman","Bitstream Charter",Times,serif;
- font-weight: normal;
- padding: 7px 10px;
- margin: 0;
- line-height: 1;
-}
-.aioseop_options_wrapper .submit input.button-primary {
- margin-bottom: 5px;
-}
-#aiosp_feature_manager_metabox.postbox {
- margin-top: 20px;
- float: left;
-}
-.aioseop_advert p {
- margin: 25px 0 25px 0;
-}
-/*
-.widget, #widget-list .widget-top, .postbox, #titlediv, .aioseop_options_wrapper .postarea, .stuffbox {
- border-color: #DFDFDF;
- -moz-box-shadow: inset 0 1px 0 #fff;
- -webkit-box-shadow: inset 0 1px 0 #fff;
- box-shadow: inset 0 1px 0 #fff;
- -moz-border-radius: 3px;
- -khtml-border-radius: 3px;
- -webkit-border-radius: 3px;
- border-radius: 3px;
-}
-*/
-.aioseop_options_wrapper .postarea {
- border-color: #DFDFDF;
- -moz-box-shadow: inset 0 1px 0 #fff;
- -webkit-box-shadow: inset 0 1px 0 #fff;
- box-shadow: inset 0 1px 0 #fff;
- -moz-border-radius: 3px;
- -khtml-border-radius: 3px;
- -webkit-border-radius: 3px;
- border-radius: 3px;
-}
-.aioseop_advert h3 {
- padding: 0;
- margin-top: 6px;
-}
-.aioseop_metabox_text p {
- margin: 0 0 0px 0;
- width: 101%;
-}
-.aioseop_sidebar {
- width: 457px;
- margin-left: 10px;
-}
-.aioseop_metabox_text {
- margin-bottom: 0px;
-}
-.aioseop_metabox_wrapper {
- padding: 0px;
-}
-.aioseop_metabox_text *:last-child {
- margin: 0;
-}
-.aioseop_metabox_feature {
- margin-top: 20px;
-}
-
-.aioseop_metabox_feature img {
-}
-
-.aioseop_option_label {
- float: left;
- margin: 0px;
- min-width: 150px;
- width: 37%;
- max-width: 270px;
- padding-top: 3px;
- padding-bottom: 3px;
- height:67px !important; /*added for certain language support*/
-}
-.aioseop_metabox_text h2 {
- font-size: 14px;
- padding: 0px;
- font-weight: bold;
- line-height: 29px;
-}
-#aioseop-about {
- width: 443px;
- margin-bottom: 20px;
-}
-#aioseop-about .aioseop_metabox_text #mc-embedded-subscribe-form h2 {
- font-size: 13px;
-}
-.aioseop_sidebar #mc-embedded-subscribe-form {
- margin: 0 0 10px 0;
- background: white;
- padding: 10px 10px;
- border: 1px solid #DDD;
-}
-.aioseop input[readonly] {
- background-color: #EEE;
- margin: 5px 0 5px 0 !important;
-}
-/*
-.aioseop input[type="button"] {
- border-radius: 5px;
- font-size: 15px;
-}
-*/
-.aioseop_settings_left {
- float: left;
- padding: 0px;
- margin: 0px;
- width: 100%;
-}
-
-body.all-in-one-seo_page_all-in-one-seo-pack-aioseop_feature_manager .aioseop_settings_left {
- margin-top: 20px;
-}
-
-body.all-in-one-seo_page_all-in-one-seo-pack-pro-aioseop_feature_manager .aioseop_settings_left {
- margin-top: 20px;
-}
-
-#aioseop_top_button {
- margin-top: 5px;
- height: 30px;
-}
-
-#aioseop-list #mce-EMAIL {
- margin-top: 5px;
- width: 250px;
-}
-
-.aioseop_top {
- margin: 10px 10px 0px 0px;
-/* margin: 10px 477px 0px 0px; */
-}
-
-.aioseop_top #aioseop-list {
- margin-bottom: 0px;
-}
-
-.aioseop_right_sidebar {
- float: right;
- margin-top: 35px;
-}
-/*
-#wpbody-content {
- min-width: 1180px;
-}
-*/
-#aiosp_settings_form .button-primary.hidden {
- display: none;
-}
-form#edittag div#aiosp_titleatr_wrapper, form#edittag div#aiosp_menulabel_wrapper, form#edittag div#aiosp_sitemap_exclude_wrapper {
- display: none;
-}
-.All_in_One_SEO_Pack_Feature_Manager > #aiosp_settings_form > #aioseop_top_button {
- height: 5px;
-}
-.All_in_One_SEO_Pack_Feature_Manager > .aioseop_right_sidebar.aioseop_options_wrapper {
- margin-top: 10px;
-}
-div#aiosp_feature_manager_metabox .inside {
- padding: 8px;
-}
-div.aioseop_feature {
- position: relative;
- display: inline-block;
- float: left;
- vertical-align: top;
- width: 240px;
- height: 288px;
- margin: 8px;
- border: 1px solid #DEDEDE;
- -moz-border-radius: 3px;
- -webkit-border-radius: 3px;
- border-radius: 3px;
- background: white;
- padding: 10px 0px 0px;
- -webkit-box-shadow: inset 0 1px 0 #fff, inset 0 0 20px rgba(0,0,0,0.05), 0 1px 2px rgba( 0,0,0,0.1 );
- -moz-box-shadow: inset 0 1px 0 #fff, inset 0 0 20px rgba(0,0,0,0.05), 0 1px 2px rgba( 0,0,0,0.1 );
- box-shadow: inset 0 1px 0 #fff, inset 0 0 20px rgba(0,0,0,0.05), 0 1px 2px rgba( 0,0,0,0.1 );
- -webkit-transition-duration: .4s;
- -moz-transition-duration: .4s;
-}
-.aioseop_feature h3 {
- font-size: 17px;
- margin: 0;
- padding: 0px 10px 5px 10px;
- font-weight: normal;
- font-style: normal;
- font-family: "Helvetica Neue",Helvetica,Arial,"Lucida Grande",Verdana,"Bitstream Vera Sans",sans-serif;
-}
-.aioseop_feature p {
- line-height: 150%;
- font-size: 12px;
- font-family: Georgia,"Times New Roman","Bitstream Charter",Times,serif;
- margin-bottom: 20px;
- color: #666;
- padding: 0px 10px;
-}
-.aioseop_feature p.aioseop_desc {
- min-height: 80px;
-}
-.aioseop_feature .feature_button {
- float: right;
- margin-bottom: 10px;
- margin-right: 10px;
- min-width: 80px;
- text-align: center;
-}
-.aioseop_feature .feature_button:before {
- content: "Activate";
-}
-.aioseop_feature .active.feature_button:before {
- content: "Deactivate";
-}
-div.aioseop_feature .aioseop_featured_image {
- min-height: 100px;
- background-repeat: no-repeat;
- display: block;
- margin: 0 auto;
- width: 133px;
-}
-div.aioseop_feature .aioseop_featured_image {
- background-image: url(../../modules/images/Default-BW-Standard.png);
-}
-div.aioseop_feature .aioseop_featured_image.active {
- background-image: url(../../modules/images/Default-Color-Standard.png);
-}
-div.aioseop_feature#aioseop_sitemap .aioseop_featured_image {
- background-image: url(../../modules/images/XMLSitemaps-BW-Standard.png);
-}
-div.aioseop_feature#aioseop_sitemap .aioseop_featured_image.active {
- background-image: url(../../modules/images/XMLSitemaps-Color-Standard.png);
-}
-div.aioseop_feature#aioseop_video_sitemap .aioseop_featured_image {
- background-image: url(../../modules/images/VideoSitemap-BW-Standard.png);
-}
-div.aioseop_feature#aioseop_video_sitemap .aioseop_featured_image.active {
- background-image: url(../../modules/images/VideoSitemap-Color-Standard.png);
-}
-div.aioseop_feature#aioseop_opengraph .aioseop_featured_image {
- background-image: url(../../modules/images/SocialMeta-BW-Standard.png);
-}
-div.aioseop_feature#aioseop_opengraph .aioseop_featured_image.active {
- background-image: url(../../modules/images/SocialMeta-Color-Standard.png);
-}
-div.aioseop_feature#aioseop_robots .aioseop_featured_image, div.aioseop_feature#aioseop_bad_robots .aioseop_featured_image {
- background-image: url(../../modules/images/Robots-BW-Standard.png);
-}
-div.aioseop_feature#aioseop_robots .aioseop_featured_image.active, div.aioseop_feature#aioseop_bad_robots .aioseop_featured_image.active {
- background-image: url(../../modules/images/Robots-Color-Standard.png);
-}
-div.aioseop_feature#aioseop_file_editor .aioseop_featured_image {
- background-image: url(../../modules/images/FileEditor-BW-Standard.png);
-}
-div.aioseop_feature#aioseop_file_editor .aioseop_featured_image.active {
- background-image: url(../../modules/images/FileEditor-Color-Standard.png);
-}
-div.aioseop_feature#aioseop_importer_exporter .aioseop_featured_image {
- background-image: url(../../modules/images/ImporterExporter-BW-Standard.png);
-}
-div.aioseop_feature#aioseop_importer_exporter .aioseop_featured_image.active {
- background-image: url(../../modules/images/ImporterExporter-Color-Standard.png);
-}
-div.aioseop_feature#aioseop_performance .aioseop_featured_image {
- background-image: url(../../modules/images/Performance-BW-Standard.png);
-}
-div.aioseop_feature#aioseop_performance .aioseop_featured_image.active {
- background-image: url(../../modules/images/Performance-Color-Standard.png);
-}
-div.aioseop_feature#aioseop_coming_soon .aioseop_featured_image {
- background-image: url(../../modules/images/Default-Color-Standard.png);
-}
-div.aioseop_feature#aioseop_coming_soon2 .aioseop_featured_image {
- background-image: url(../../modules/images/Default-Color-Standard.png);
-}
-.All_in_One_SEO_Pack_Sitemap > form > .wrap > .form-table,
-.All_in_One_SEO_Pack_Video_Sitemap > form > .wrap > .form-table {
- max-width: 500px;
- clear: none;
-}
-.aioseop_follow_button {
- min-height: 50px;
- background-repeat: no-repeat;
- display: inline-block;
- width: 100px;
- background-size: auto 50px !important;
- margin-right: 0px;
-}
-.aioseop_facebook_follow {
- background-image: url(../../modules/images/facebook-follow-standard.png);
-}
-.aioseop_twitter_follow {
- background-image: url(../../modules/images/twitter-follow-standard.png);
-}
-@media
-only screen and (-webkit-min-device-pixel-ratio: 1.5),
-only screen and ( min--moz-device-pixel-ratio: 1.5),
-only screen and ( -o-min-device-pixel-ratio: 3/2),
-only screen and ( min-device-pixel-ratio: 1.5),
-only screen and ( min-resolution: 1.5dppx) {
- div.aioseop_feature .aioseop_featured_image {
- background-size: auto 100px !important;
- }
- div.aioseop_feature .aioseop_featured_image.active {
- background-image: url(../../modules/images/Default-Color-Retina.png);
- }
- div.aioseop_feature .aioseop_featured_image {
- background-image: url(../../modules/images/Default-BW-Retina.png);
- }
- div.aioseop_feature#aioseop_sitemap .aioseop_featured_image {
- background-image: url(../../modules/images/XMLSitemaps-BW-Retina.png);
- }
- div.aioseop_feature#aioseop_sitemap .aioseop_featured_image.active {
- background-image: url(../../modules/images/XMLSitemaps-Color-Retina.png);
- }
- div.aioseop_feature#aioseop_video_sitemap .aioseop_featured_image {
- background-image: url(../../modules/images/VideoSitemap-BW-Retina.png);
- }
- div.aioseop_feature#aioseop_video_sitemap .aioseop_featured_image.active {
- background-image: url(../../modules/images/VideoSitemap-Color-Retina.png);
- }
- div.aioseop_feature#aioseop_opengraph .aioseop_featured_image {
- background-image: url(../../modules/images/SocialMeta-BW-Retina.png);
- }
- div.aioseop_feature#aioseop_opengraph .aioseop_featured_image.active {
- background-image: url(../../modules/images/SocialMeta-Color-Retina.png);
- }
- div.aioseop_feature#aioseop_robots .aioseop_featured_image, div.aioseop_feature#aioseop_bad_robots .aioseop_featured_image {
- background-image: url(../../modules/images/Robots-BW-Retina.png);
- }
- div.aioseop_feature#aioseop_robots .aioseop_featured_image.active, div.aioseop_feature#aioseop_bad_robots .aioseop_featured_image.active {
- background-image: url(../../modules/images/Robots-Color-Retina.png);
- }
- div.aioseop_feature#aioseop_file_editor .aioseop_featured_image {
- background-image: url(../../modules/images/FileEditor-BW-Retina.png);
- }
- div.aioseop_feature#aioseop_file_editor .aioseop_featured_image.active {
- background-image: url(../../modules/images/FileEditor-Color-Retina.png);
- }
- div.aioseop_feature#aioseop_importer_exporter .aioseop_featured_image {
- background-image: url(../../modules/images/ImporterExporter-BW-Retina.png);
- }
- div.aioseop_feature#aioseop_importer_exporter .aioseop_featured_image.active {
- background-image: url(../../modules/images/ImporterExporter-Color-Retina.png);
- }
- div.aioseop_feature#aioseop_performance .aioseop_featured_image {
- background-image: url(../../modules/images/Performance-BW-Retina.png);
- }
- div.aioseop_feature#aioseop_performance .aioseop_featured_image.active {
- background-image: url(../../modules/images/Performance-Color-Retina.png);
- }
- div.aioseop_feature#aioseop_coming_soon .aioseop_featured_image {
- background-image: url(../../modules/images/Default-BW-Retina.png);
- }
- div.aioseop_feature#aioseop_coming_soon2 .aioseop_featured_image {
- background-image: url(../../modules/images/Default-BW-Retina.png);
- }
- .aioseop_facebook_follow {
- background-image: url(../../modules/images/facebook-follow-retina.png);
- }
- .aioseop_twitter_follow {
- background-image: url(../../modules/images/twitter-follow-retina.png);
- }
-}
-
-.aioseop_options {
- width: 100%;
- margin: 18px 0px 10px 0px;
-}
-.aioseop_wrapper {
- width: 100%;
- padding-left: 5px;
-}
-.aioseop_input {
- clear: left;
- width: 100%;
- padding: 5px;
- display: inline;
-}
-.aioseop_option_input {
- float: left;
- width: 61%;
- margin: 0;
- padding-left: 1px;
- min-width: 160px;
-/* max-width: 900px; */
-}
-#aiosp div.preview_snippet {
- border: 1px solid #ebebeb;
- padding: 15px 15px 20px 7px;
- background-color: #fff;
-}
-div#aioseop_snippet {
- font-family: arial, sans-serif;
- font-size: 13px;
-}
-div#aioseop_snippet > h3 {
- font-size: 16px;
- padding: 8px 0;
- border: 0px;
- background: inherit;
-}
-div#aioseop_snippet > h3 > a {
- color: #12c;
- text-decoration: none;
- cursor: pointer;
-}
-div#aioseop_snippet > div {
- color: #222;
- max-width: 42em;
-}
-div#aioseop_snippet > div > div {
- display: block;
- margin-bottom: 1px;
-}
-div#aioseop_snippet > div > div > cite {
- color: #093;
- font-style: normal;
-}
-div#aioseop_snippet > div > span {
- margin: 0px;
- padding: 0px;
- border: 0px;
-}
-#aiosp_sitemap_addl_pages,
-#aiosp_video_sitemap_addl_pages {
- clear: left;
- margin-left: 20px;
- max-width: 1072px;
-}
-#aiosp_sitemap_addl_pages_metabox .aioseop_wrapper,
-#aiosp_video_sitemap_addl_pages_metabox .aioseop_wrapper {
- width: 23%;
- min-width: 165px;
- display: inline-block;
- max-width: 265px;
-}
-#aiosp_sitemap_addl_pages_metabox .aioseop_help_text_div,
-#aiosp_video_sitemap_addl_pages_metabox .aioseop_help_text_div {
- position: absolute;
- margin: 5px 0px 10px 0px;
-}
-#aiosp_sitemap_addl_pages_metabox .aioseop_option_input,
-#aiosp_video_sitemap_addl_pages_metabox .aioseop_option_input {
- width: 94%;
- min-width: 94%;
-}
-#aiosp_sitemap_addl_pages_metabox table.aioseop_table,
-#aiosp_video_sitemap_addl_pages_metabox table.aioseop_table {
- width: 96%;
- border: 1px solid #CCC;
- margin: 5px 0px 10px 0px;
-}
-table.aioseop_table tr:nth-child(odd) {
- background-color: #EEE;
-}
-.All_in_One_SEO_Pack_Opengraph table.aioseop_table tr:nth-child(odd) {
- background-color: rgba( 238, 238, 238, 0.5 );
-}
-table.aioseop_table td {
- width: 23%;
-}
-.All_in_One_SEO_Pack_Opengraph table.aioseop_table {
- width: 80%;
- max-width: 800px;
- display: block;
- border-top: 1px solid #dfdfdf;
- border-left: 1px solid #dfdfdf;
-}
-.All_in_One_SEO_Pack_Opengraph table.aioseop_table th {
- width: 18%;
- border-right: 1px solid #dfdfdf;
- border-bottom: 1px solid #dfdfdf;
-}
-.All_in_One_SEO_Pack_Opengraph div.aioseop_meta_info {
- margin-top:10px;
- border: 1px solid #dfdfdf;
- width:80%;
- max-width:800px;
-}
-.All_in_One_SEO_Pack_Opengraph table.aioseop_table tr.aioseop_table_header th {
- background: #f1f1f1;
- background-image: -webkit-gradient(linear,left bottom,left top,from(#ececec),to(#f9f9f9));
- background-image: -webkit-linear-gradient(bottom,#ececec,#f9f9f9);
- background-image: -moz-linear-gradient(bottom,#ececec,#f9f9f9);
- background-image: -o-linear-gradient(bottom,#ececec,#f9f9f9);
- background-image: linear-gradient(to top,#ececec,#f9f9f9);
- padding: 5px;
- border-bottom-color: #dfdfdf;
- text-shadow: #fff 0 1px 0;
- -webkit-box-shadow: 0 1px 0 #fff;
- -moz-box-shadow: 0 1px 0 #fff;
- box-shadow: 0 1px 0 #fff;
-}
-.All_in_One_SEO_Pack_Opengraph table.aioseop_table td {
- border-right: 1px solid #dfdfdf;
- border-bottom: 1px solid #dfdfdf;
-}
-#aioseop_opengraph_settings_facebook_debug_result li.aioseop_opengraph_settings_facebook_debug_item {
- display: inline-block;
- width: 30%;
- vertical-align: top;
-}
-#aioseop_opengraph_settings_facebook_debug_result li.aioseop_opengraph_settings_facebook_debug_item:nth-child(even) {
- font-weight: bold;
-}
-#aioseop_opengraph_settings_facebook_debug_result li.aioseop_opengraph_settings_facebook_debug_item:nth-child(odd) {
- width: 70%;
-}
-#aiosp_sitemap_addl_pages_metabox table.aioseop_table td,
-#aiosp_video_sitemap_addl_pages_metabox table.aioseop_table td {
- width: 25%;
- padding-left: 5%;
-}
-table.aioseop_table td, table.aioseop_table th {
- padding: 3px;
-}
-.aioseop_top_label .aioseop_option_input,
-.aioseop_no_label .aioseop_option_input {
- width: 100%;
-}
-
-#aiosp_settings_form .postbox {
- margin: 0px 0px 20px 0px;
-}
-
-.aioseop_settings_left .postbox {
- float: left;
- width: 100%;
-}
-.aioseop_option_setting_label {
- min-height: 35px;
- display: inline-block;
- white-space: nowrap;
- overflow: hidden;
- padding-left: 1px;
- max-width: 229px;
- min-width: 160px;
- width: 33%;
-}
-.aioseop_settings_left .postbox .inside {
- padding: 0;
- margin: 0;
- clear: right;
-}
-#aiosp_settings_form .aioseop_no_label, .aioseop_no_label {
- float: left;
- width: 92%;
- max-width: 100%;
- margin: 0px 23px 0px 13px;
-}
-.aioseop_top_label {
- width: 96%;
- margin: 0 10px;
-}
-.aioseop_hidden_type {
- margin: 0;
- padding: 0;
- height: 0;
-}
-.aioseop_module.error.below-h2 {
- padding: 5px 0px;
- margin: 0px 477px 15px 0px !important;
-}
-#aioseop_opengraph_settings .inside {
- margin: 0;
- padding: 0;
-}
-#aioseop_opengraph_settings_image_wrapper img {
- width: auto;
- height: 75px;
-}
-#aioseop_opengraph_settings_image_wrapper .aioseop_option_setting_label {
- max-width: 160px;
- min-width: 100px;
- width: 30%;
-}
-.aioseop_input input[type="checkbox"],
-.aioseop_input input[type="radio"] {
- vertical-align: text-bottom;
- margin-top: 8px;
-}
-#aiosp_importer_exporter_import_export_help_wrapper .aioseop_option_div {
- max-height: initial;
-}
-#aiosp {
- width: 100%;
-}
-
-.aioseop_input.aioseop_top_label .aioseop_option_input {
- margin: 0 0 10px 0;
-}
-
-.aiosp_file_editor_settings > .aioseop_textarea_type .aioseop_option_div {
- max-height: none;
-}
-
-/* Robots.txt styling */
-#aiosp_robots_generator_robotgen_wrapper .aioseop_option_div,
-#aiosp_robots_generator_robothtml_wrapper .aioseop_option_div {
- max-height: none;
-}
-.aioseop_option_input .widefat td {
- vertical-align: middle;
-}
-.entry-row.robots.quirks {
- font-weight: bold;
- opacity: 1;
-}
-.entry-row.robots {
- opacity: 0.8;
-}
-.entry-row.robots.invalid {
- opacity: 1;
- font-weight: bold;
-}
-.invalid .entry_label {
- font-weight: bold;
-}
-.column_label, .entry_label {
-}
-.aioseop .aioseop_option_input tbody {
- background: #FCFCFC;
-}
-.All_in_One_SEO_Pack_Robots .aioseop .aioseop_option_input tbody {
- background: transparent;
-}
-.entry-row.robots div {
- height: 20px;
- vertical-align: middle;
- width: 90%;
- margin: 0 0 4px 0;
-}
-.robots img {
- margin: 0 0 0 2px;
- opacity: 0.6;
-}
-
-.aioseop_option_docs {
- width: 98%;
- display: none;
- border: 1px solid #D3D3D3;
- margin-top: 20px;
- padding: 1%;
- background-color: #EEE;
-}
-.aioseop_option_docs h3 {
- background:none;
-}
-div.aioseop_notice {
- position: relative;
-}
-div.aioseop_notice a.aioseop_dismiss_link {
- position: absolute;
- top: 10px;
- right: 10px;
-}
-.aioseop_error_notice {
- color: #f00;
- font-weight: bold;
-}
-
-.aioseop_input select {
- margin: 7px 0px;
-}
-.aioseop_help_text ul {
- margin: 15px 0 0 20px;
-}
-
-.aioseop_help_text ul li {
- line-height: 20px;
- margin: 0;
-}
-.aioseop_sidebar #side-sortables {
- width: 98%;
-}
-#aioseop_opengraph_settings .aioseop_option_label {
- width: 30%;
-}
-.aioseop_tabs {
- padding-top: 6px;
-}
-.aioseop_tabs.hide, .aioseop_header_tabs.hide {
- display: block !important;
-}
-.aioseop_header_tabs li {
- display: inline;
- padding: 0px;
- margin: 0px;
-}
-.aioseop_header_tabs {
- margin: 0px;
-}
-.aioseop_header_nav {
- margin: 0px;
-}
-.aioseop_header_tabs li a.aioseop_header_tab.active {
- background-color: rgb( 255, 255, 255 );
- border-bottom-color: rgba( 255, 255, 255, 0.5 );
- font-weight: bold;
-}
-.aioseop_header_tabs li a.aioseop_header_tab {
- height: 18px;
- font: 13px/18px Arial,Helvetica,sans-serif normal;
- text-decoration: none;
- margin: 5px 5px 0 0;
- padding: 4px 5px 2px;
- cursor: pointer;
- border-width: 1px;
- border-style: solid;
- -webkit-border-top-right-radius: 3px;
- -webkit-border-top-left-radius: 3px;
- border-top-right-radius: 3px;
- border-top-left-radius: 3px;
- background-color: rgb( 255, 255, 255 );
- background-color: rgba( 255, 255, 255, 0.5 );
- border-color: #ccc;
- color: #5F5F5F;
-}
-.aioseop_header_tabs li:first-child a.aioseop_header_tab {
- border-left: solid 1px #CCC;
- margin-left: 5px;
-}
-.aioseop_tab {
- border: solid 1px #CCC;
- background-color: rgb( 255, 255, 255 );
- background-color: rgba( 255, 255, 255, 0.5 );
- padding-left: 5px;
-}
-.aioseop_loading {
- background-image: url('../../images/activity.gif');
- display: inline-block;
- width: 24px;
- height: 24px;
- margin: 0px;
- padding: 0px;
- vertical-align: bottom;
-}
-.aiosp_delete_url {
- background-image: url('../../images/delete.png');
- display: inline-block;
- width: 16px;
- height: 16px;
- margin: 0px;
- padding: 0px;
- vertical-align: bottom;
-}
-form#aiosp_settings_form, .aioseop_tabs_div {
- padding-right: 477px;
-}
-.aioseop_tabs_div {
- margin-top: 10px;
-}
-/*
-.wrap > h2 {
- padding-bottom: 14px;
-}
-div.wrap > form table.form-table {
- clear: none;
- width: 580px;
-}
-div.wrap > div#message.error {
- max-width: 540px;
-}
-*/
-#aiosp_settings_form ul.sfwd_debug_settings li strong {
- display: block;
- float: left;
- text-align: right;
- background-color: #DDD;
- margin-right: 8px;
- padding: 1px;
- padding-right: 8px;
- overflow: auto;
- width: 200px;
- min-height: 16px;
-}
-#aiosp_settings_form ul.sfwd_debug_settings li:nth-child(2n+1) strong {
- background-color: #CCC;
-}
-#aiosp_settings_form ul.sfwd_debug_settings li {
- clear: left;
- padding: 5px;
- margin: 0px;
- padding: 0px;
- background-color: #EEE;
- overflow: auto;
- max-width: 75%;
- min-width: 800px;
-}
-#aiosp_settings_form ul.sfwd_debug_settings li:nth-child(2n) {
- background-color: #DDD;
-}
-div.sfwd_debug_mail_sent {
- background-color: #080;
- border: 1px solid #0A0;
- margin: 10px 0px 10px 0px;
- width: 598px;
- color: #FFF;
- text-align: center;
-}
-div.sfwd_debug_error {
- background-color: #F00;
- color: #FFF;
- border: 1px solid #A00;
- margin: 10px 0px 10px 0px;
- width: 598px;
- text-align: center;
- font-weight: bolder;
-}
-#aiosp_performance_status_wrapper .aioseop_option_div {
- max-height: 420px;
-}
-
-#aioseop_coming_soon, #aioseop_coming_soon2 {
- padding-top: 40px;
- text-align: center;
- height: 258px;
- font-size: 16px;
-}
-/*
-#aioseop_coming_soon {
- text-align: center;
- background-color: rgba(255, 255, 255, 0.5);
-}
-#aioseop_coming_soon p {
- padding: 0px;
- margin: 0px;
- font-size: 16px;
- font-family: Arial,Helvetica,sans-serif;
-}
-#aioseop_coming_soon img {
- padding-top: 40%;
-}
-*/
-.MRL {
-margin-left: 20px !important;
-margin-bottom: 10px !important;
-}
+/**
+ * Controls all the styling of the plugin.
+ *
+ * @author Michael Torbert.
+ * @author Semper Fi Web Design.
+ * @copyright http://semperplugins.com
+ * @package All-in-One-SEO-Pack.
+ */
+
+.form-table.aioseop {
+ clear: none;
+}
+
+.form-table.aioseop td {
+ vertical-align: top;
+ padding: 16px 0 10px 0;
+ line-height: 20px;
+ font-size: 12px;
+}
+
+.form-table.aioseop th {
+ width: 200px;
+ padding: 10px 0 12px 9px;
+}
+
+.aioseop_help_text_link,
+.aioseop_help_text_link:active {
+ text-align: left;
+ float: left;
+ max-width: 300px;
+ min-width: 1px;
+ padding-top: 2px;
+ outline: none;
+ color: #888;
+ border: 2px solid #888;
+ border-radius: 33px;
+ width: 22px;
+ height: 20px;
+ font-family: sans-serif;
+}
+
+.aioseop_help_text_link span {
+ position: absolute;
+ left: 21px;
+ font-size: 14px;
+}
+
+.aioseop_help_text_link:before {
+ content: '\a0?';
+ color: #888;
+ font-size: 19px;
+}
+
+#aioseop-support .aioseop_metabox_text,
+#aioseop-support a {
+ font-size: 14px;
+ color: #000;
+ text-decoration: none;
+}
+
+.aioseop_icon {
+ display: inline-block;
+ width: 40px;
+ height: 40px;
+ background-repeat: no-repeat;
+ background-size: 100%;
+ vertical-align: middle;
+ margin: 10px;
+}
+
+.aioseop_book_icon {
+ background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABABAMAAABYR2ztAAAAKlBMVEUAAAAAn+cAneEAnuABnuEBnuEAnuEAn+QAn+QAneAAnuEAneAAnuAAneFPI9ocAAAADnRSTlMAII/P/wCQMADwANDvnyPbz6kAAAB9SURBVHgB7c+xCQMgEIVhZwiSSRzhkRBImsA5gVUmuBGcJbUDxlhY6T2wvh/sPvBd+HdJWCSj0N8bsEEiIIOAyEBhIDGAcwA4cDBy4MDBTeuqCR5abXCvBHy+6ybQrs2R0jsH/As+srEzC55qggi81AIZ+waQxkBmQK5tD34LnXJVZf9y5gAAAABJRU5ErkJggg==);
+}
+
+.aioseop_cog_icon {
+ background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAMAAACdt4HsAAAAeFBMVEUAAAAAn+MAnOIAn+cAneIAneEAn+MAnuEAneIAnuAAnuAAneEAn+cAn+QAn98AnuEAn98AneAAneEAneAAnOIAnuAAnuEAnuAAneEAn+EAnuEAnuAAneEAneAAneAAn+QAnuEAnuABnuEAneAAn+EAnuIAnuMBnuHeY3dlAAAAJ3RSTlMAQFAAYIAAkADP3wAgMACgEACfrwC/X++PbwAAcODwALDAANAATz8hP00ZAAACHklEQVR4Xq3XbWObIBAHcPAJJRjJVmtso4vL2vv+33AzJO2J/LuE9PfGFyR4HHiAgCQxyRMiYEtGTL5BBGzJiVEviIAtFTH6FRGowdBC/QsQqKGhhebeIdTkqe+LwFbkqew2SGyDftDKz12Q2AXYlhgeA46AD/G5oyD9zJO0zIEhvXd91L0mSPcmnZlek0nPhHu4mKu2ov+q2rZzOWE5kBRBFjNRzDRFqD6X8oGiHK5fo+0oSmcv06goknLfQk3RzHkaWwIGlUhrZaIGAto5iQn6uyw+yAFOpSgUTDEHJqqZc5DR2rgqw8lIa7mbRkkMLOOBoWZlWYrynwzGzx1C/3cdlEcvf7sgL5MTq8rGz22QNwjDP+cGBYBDOC6qcnLTNqQCeRbuYdEU4In47YjL84RSwEk+Tq8qT7xvhMc5eXsj78Buga866O4dQrXs4OEk3jaNTWC1Cfc43nSa0MQ0fCFFLWXL9saWFjQMgFOfEUR+zsl1KWeRBaWr3e7c01q3Lmld+FfiSVFQ/2ehp6B8IzaorGvJ8q8Jl/ViIkDv396tfX/bawKm81J+eGtLH91cX+xIUUZ7XYmPHTBmA0U4feMh6zqVwzTe8ubQvmBoUJeDphoIGtT5tVaq0Ttopvyom4M4xqz8YGXhiCLAnIKhg8N2iA30cLzrxmJH/H4cASejrjzcFHXpwrcukwIiRQZv2QICtjQP352/9fYuC+Qv593CTVvcgwkAAAAASUVORK5CYII=);
+}
+
+.aioseop_file_icon {
+ background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAMAAACdt4HsAAAAPFBMVEUAAAAAneAAn98AneIAneEAnuAAn+QAnuAAnuAAnuEAn+MAnuEAneAAnuEAn+EAneEAnOIAnuEAnuABnuG5yOaaAAAAE3RSTlMA0BBgn88wv++gQLCvX2+PUJDAyp/15gAAALdJREFUeF7t1z2ygzAMhVFJjm0C5Ff732uaMCSWCVzTJO/paz1zRsVtTM/OUT+Wx5PQchJ1Q2O/CETdVk51IOjWugAeYLvUAEU6rAO4oLhQB2bSvh+NAAKU2AgYQGIEDHgXbjhQCFcYKIQuoUApZBQwQg8CRhhAwArSBlCagNAI0LTqAQCq3fcC+jOA7e8DDuhK/wDwHfgOfAe+A98B2BcC3Aaw+XiCBdp3AtOcNAgs9FoACZ7ufwCe6pfMGb29UwAAAABJRU5ErkJggg==);
+}
+
+.aioseop_help_icon {
+ background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAMAAACdt4HsAAAAflBMVEUAAAAAn98AnuIAn+EAneAAnuAAnuAAn+QAn+QAneEAnuAAnuAAn+EAnuAAnuEAneAAn+cAneAAnuAAn98AnOIAnuEAneIAn+MAnuEAnuEAn+EAneIAneEAneEAnuEAn+MAneAAneEAnuMAnOIAn+cAneEBnuEAneAAnuMBnuEoGewkAAAAKXRSTlMAEE9/r7/fADCPzwBv718AIPDAAFCwYEAAoAAAn4CQAOAAPwAAcADQAFP96WQAAAMNSURBVHhelZcNc5swDIatBghpoCGEj9Jij2XLMv3/P7glkoNtZJo+d+0lhBOveSXZUjHgZZOkGf4nS5PNC5wiKPFqvnvFgNddvpVQy0tQZCiSFfCEAtiUGKXcwFcB3kpcpXx791HetypFn2NdH9EnrX67KPdL46g/tl3PeqHvWidM2fxyUM7n3fzgof8R0A9zjN3PGTV/HB+6teg66EeIUQqQIGOiSQMGmeRgUQfGPn/Ktyv0k9UQKrCxWzitAq3V6dvYIDG8f8mAROO6ULF/3ecTaHazcvIgjTw/PxfFeVFErCHd31C3fx2v39cKGy6qLKyA1tGr/v8BLWDyb3OLqiw+XGCiq8DFxIvypMKIHqMXvaeLmmyEkn1xSTCAjWcMS7gruFD+eo/QuEC7AYCy+nJXkC1/r5A4Gq2NrQCvjMnL7OZCLggY3KoAI5jMEvKt2hohBYK3wiveuwx8i3qn/uvVf0O2Hh5MnLwOZMTrXgGt4OCi7RuyXNg1F1oDqEZIQh2K6oUALalSWqgiIwUIM4VVqZZvdlkE7QQFFLRVNS3l5NLZarMkgkx6ebWiNPqzSu9nEkM2KDZhjbykh+19KKri3+LkIxLhVlE/E4CaAjsd4AYo9zJkR9huGF7CtPYSX9FyXG4XFHe2UQIt9fIGa6NNJBErX2r35O0wp7KEbZYSNpVtMYngSpbZYoI1G9YClFzOp+vKS6jviLFJ+fWgDralfZO5peW2xX8LKB9NdTtxsQuc7/wV0OTv/YRyiUuIugCls7FwizffsXHgzcRurjEjYgH8zdVKyODZJUDGAuxZubNnt5BIgMQ7YNyowy2c0XfCqyNX6HzE2Ve8A28+nmDDHaJyD9sNChpkxvCYRxgkEjitAkl40AzPjxm7KdNnSAzLgaNFZhcVATtkBmliGaTJSJ6mBnnkMWgpx+XAMZZoMbGZqXEHm6Q4sxA4F4k7DEkjD1PVGJCmGFDLQ5elO+Iqx7B/q88A0FKI+DSlBLMuE4pMF3h6+DZXDLia6PAtA41u67uUqW51E02uf46zvXx+HY4YAAAAAElFTkSuQmCC);
+}
+
+.aioseop_support_icon {
+ background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAMAAACdt4HsAAAAe1BMVEUAAAAAn98AnuIAn+EAneAAnuAAnuABnuEAn98An+QAneEAnuAAn+QAn+EAnuAAnuEAneAAnuEAneIAn+MAn+cAn+cAnuEAnuEAnOIAneEAneEAnOIAnuAAneEAn+MAneAAneEAneIAnuEAnuIAneAAnuAAneABnuEAnuPdwDkgAAAAKXRSTlMAEE9/r7/f/wAwj88Ab+9f0JBgQCAAALBQcAAAAJ8AAIAAoADgwPAAP4Dl7rAAAALsSURBVHgBtdcBc6I6EAfwRCH/KjUSTCW2eHK8kHff/xM+Dg5NlsTTOu830xmc0BhJdtllKXy1znKBgciz9Yq/JbC3mM22AFFsN+8x7H2B7wSixI4/sAK+lkiSa/63CfbXfy9VddAfA32oVHmdYn8MsaNP55jUhpOFmRqTXH/4mP/BSExOnxEnTKT58jDveouZaCIEZltvWna7POPm8GPhgJtzbIIMnvq4UMOTXWZsvjgjoD8IjcCZrkAh1H4SLUIq3EYDQjSEBGH8XdASVPUzUIGS2jsHORbyJpC8gzWDChGaPsL4ItnwxyUiuuPqnBdAkW9X/3SIkPxPMLWIkZJcL7XTNnKJb5J8XMEJ33YaVyCQYJUZ0tjGKIsE8XsXNuNUFpStvFMQGR4Xvhlyoppi51AjUAcZhdPRIVzr8UCzYzEfS91afxOJDle2Hc9IBaBoGMdg/raq/3s49/NPm/6TGQDl5Up3DoCN5G9uAbjOO6AlAMPa8Zd4JI0kP55k41EAWlaT+w0Ae4mytyAenQDUrCcZsCMr8igydADQM0ECrydf4zEA+uZGAygYBv96ivF4RG3GffNgsJiAfr439v9MUN7/CeXFgwGzrz1Eu9hG9eQ2Rg+SaKJE5CB1y6Ps7h1ld/FMR9mEm6vPEoCIBZMAIM/e8xoTQRjO+5y8fT0ZJvlc5PwJ57fymlDWMloBLKoHsb4mlPLCLnNKyxDIwpRGR72UtsEgUhoKrx7bR4Z3c1J9Tyft7ep3Wl9t04l/rFBefrFwh29y/N7L1TlynXy5JpbQHY3qS6Dslfnq4guYa+UXC4xBj4W+CSTvYFMEuOeLLKf9Ytssd5hw6TJv9FKhOeqeK3W7ZcNRP1Nsd7GOpXu83O/iLY8ij5CwmKlUz2TcIy2PIy2PT/eYZLRV5fsMk542XaHK3VrV/a+p7fu1uzWyjiZs9pPgrUOSa6ONJ8FPFlH2xB9uvlUJolTJ5juOm7buLQa2r1uvkSX+A/xd+1xZLxG0AAAAAElFTkSuQmCC);
+}
+
+.aioseop_youtube_icon {
+ background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAMAAACdt4HsAAAARVBMVEUAAAAAn+cAn+EAneAAnuABnuEAn+cAn98AneEAn98AnOIAnuAAnOIAneIAneIAnuEAnuEAneEAnuEBnuEAn+QAneAAneCXjc90AAAAF3RSTlMAIG+vz/8AEJ8AUO8AYACgAHCwADDw0E/SOHoAAAEBSURBVHgB7dbBjsIgGATgH+UvCAso3fL+j7rDYZMerGGZQ5NNv8TrREZLRy47F3O7Wx1m7zezAMjSOa9/5t2jkweEqBNi+ALBJ+mklHOWnINOC/0buKjTokMHRQnlKUYpRl5HBQ32KFXfW783HVDFHgWsrg0EWNEDK4z0+yEAEhuAIsgAFMEFQOECILEBKIIMQBFcABQuABIbgCLIABTBBUBhAzx5BEuWGM/9GT35V7bkwxTPfZw9eaVZ8lKN517rI8NHmr43cPyufXi5Rh1Q+dc7PTAWduI83abTNteHJjvz6KEJYeoU2+/UBVcm+tuNbTCv2nRYq2k/9ylXwL8I+AGj+lzlceKDYQAAAABJRU5ErkJggg==);
+}
+
+.aioseop_help_text_link.aioseop_meta_box_help:before {
+ font-size: 14px;
+}
+
+.aioseop_meta_box_help > label {
+ position: absolute;
+ margin-left: 8px;
+}
+
+div.aioseop_tip_icon {
+ font-size: 14px;
+ border: 1px solid #888;
+ width: 1em;
+ text-align: center;
+ padding: 0 4px;
+ -webkit-border-radius: 12px;
+ -moz-border-radius: 12px;
+ -webkit-box-shadow: 1px 1px 1px #888;
+ -moz-box-shadow: 1px 1px 1px #888;
+ box-shadow: 1px 1px 1px #888;
+ border-radius: 12px;
+}
+
+div.aioseop_tip_icon:before {
+ content: '?';
+}
+
+.aioseop_help_text_link img {
+ width: 40px;
+ float: left;
+}
+
+.aioseop_meta_box_help,
+.aioseop_meta_box_help:active {
+ float: right;
+ padding-left: 0;
+ width: 16px;
+ margin-right: 32px;
+ text-decoration: none;
+ height: 15px;
+ padding-top: 1px;
+ position: relative;
+}
+
+.aioseop_label {
+ color: #5F5F5F;
+ font-weight: bold;
+ line-height: 19px;
+ padding-left: 10px; /*changed from 20px to 10px for certain language support*/
+ display: inline-block;
+ text-align: left;
+ position: absolute;
+ font-family: 'Open Sans', sans-serif;
+ width: 26%;
+ min-width: 120px;
+ max-width: 230px;
+}
+
+.aioseop_option_div {
+ max-height: 160px;
+ min-height: 43px;
+ width: 95%;
+ overflow-y: auto;
+}
+
+.aioseop_overflowed {
+ border: 1px solid #e1e1e1;
+}
+
+.aioseop input[type="text"] {
+ color: #515151;
+ height: 35px;
+ padding: 10px 0 10px 10px;
+ font-size: 14px;
+ width: 95%;
+ max-width: 600px;
+}
+
+.aioseop textarea {
+ color: #515151;
+ padding: 10px 0 0 10px;
+ margin: 0;
+ font-size: 14px;
+ line-height: 25px;
+ width: 95%;
+ max-width: 600px;
+}
+
+.aioseop_help_text_div {
+ text-align: left;
+ width: 100%;
+ margin: 10px 0 10px 0;
+}
+
+.aioseop_help_text {
+ font-size: 12px;
+ float: left;
+ clear: left;
+ color: #797979;
+ line-height: 15px;
+ font-style: italic;
+}
+
+.aioseop_head_tagline {
+ color: #5F5F5F;
+ font-size: 13px;
+}
+
+.aioseop_head_nav {
+ float: left;
+ font-size: 18px;
+ margin: 0 0 16px 0;
+ font-family: "HelveticaNeue-Light",
+ "Helvetica Neue Light",
+ "Helvetica Neue",
+ sans-serif;
+ border-bottom: 1px solid #CCC;
+ width: 100%;
+}
+
+.aioseop_head_nav_tab {
+ padding: 10px 15px 10px 15px;
+ margin: 0 0 0 15px;
+ border-radius: 4px 4px 0 0;
+ border: 1px solid #CCC;
+ border-bottom: 0 white;
+ float: left;
+ opacity: 0.5;
+ color: black;
+ text-shadow: white 0 1px 0;
+ text-decoration: none;
+}
+
+.aioseop_head_nav_tab.aioseop_head_nav_active {
+ opacity: 1;
+ margin-bottom: -1px;
+ border-width: 1px;
+}
+
+.aioseop_head_nav_tab:first-child {
+ margin-left: 0;
+}
+
+.aioseop_head_nav_tab:hover {
+ opacity: 1;
+}
+
+.aioseop_header {
+ float: left;
+ clear: left;
+}
+
+.aioseop_advert {
+ padding: 10px;
+ margin-bottom: 30px;
+ border: 1px solid #DDD;
+ height: 200px;
+ width: 423px;
+}
+
+.headwaythemes {
+ background-color: #FFFFFF;
+ padding-bottom: 110px;
+ height: 125px;
+}
+
+.aioseop_nopad {
+ padding-left: 0;
+ padding-top: 0;
+}
+
+.aioseop_nopad_all {
+ padding: 0;
+ height: 220px;
+ width: 445px;
+ margin-bottom: 20px;
+ border: none;
+}
+
+.aioseop_adverts {
+ float: right;
+}
+
+.wincherad {
+ width: 100%;
+ height: 100%;
+ background-size: 100%;
+ background-repeat: no-repeat;
+ margin-bottom: 0;
+ border: none;
+}
+
+#wincher21 {
+ background-image: url(../../modules/images/banner21.jpg);
+}
+
+#wincher22 {
+ background-image: url(../../modules/images/banner22.jpg);
+}
+
+.aioseop_content {
+ min-width: 760px;
+ clear: left;
+}
+
+.aioseop_options_wrapper {
+}
+
+.aioseop_options_wrapper .hndle {
+ font-size: 15px;
+ font-family: Georgia,
+ "Times New Roman",
+ "Bitstream Charter",
+ Times,
+ serif;
+ font-weight: normal;
+ padding: 7px 10px;
+ margin: 0;
+ line-height: 1;
+}
+
+.aioseop_options_wrapper .submit input.button-primary {
+ margin-bottom: 5px;
+}
+
+#aiosp_feature_manager_metabox.postbox {
+ margin-top: 20px;
+ float: left;
+}
+
+.aioseop_advert p {
+ margin: 25px 0 25px 0;
+}
+
+.aioseop_options_wrapper .postarea {
+ border-color: #DFDFDF;
+ -moz-box-shadow: inset 0 1px 0 #fff;
+ -webkit-box-shadow: inset 0 1px 0 #fff;
+ box-shadow: inset 0 1px 0 #fff;
+ -moz-border-radius: 3px;
+ -webkit-border-radius: 3px;
+ border-radius: 3px;
+}
+
+.aioseop_advert h3 {
+ padding: 0;
+ margin-top: 6px;
+}
+
+.aioseop_metabox_text p {
+ margin: 0 0 0 0;
+ width: 101%;
+}
+
+.aioseop_sidebar {
+ width: 457px;
+ margin-left: 10px;
+}
+
+.aioseop_metabox_text {
+ margin-bottom: 0;
+}
+
+.aioseop_metabox_wrapper {
+ padding: 0;
+}
+
+.aioseop_metabox_text *:last-child {
+ margin: 0;
+}
+
+.aioseop_metabox_feature {
+ margin-top: 20px;
+}
+
+.aioseop_option_label {
+ float: left;
+ margin: 0;
+ min-width: 150px;
+ width: 37%;
+ max-width: 270px;
+ padding-top: 3px;
+ padding-bottom: 3px;
+ height: 67px !important; /*added for certain language support*/
+}
+
+.aioseop_metabox_text h2 {
+ font-size: 14px;
+ padding: 0;
+ font-weight: bold;
+ line-height: 29px;
+}
+
+#aioseop-about {
+ width: 443px;
+ margin-bottom: 20px;
+}
+
+#aioseop-about .aioseop_metabox_text #mc-embedded-subscribe-form h2 {
+ font-size: 13px;
+}
+
+.aioseop_sidebar #mc-embedded-subscribe-form {
+ margin: 0 0 10px 0;
+ background: white;
+ padding: 10px 10px;
+ border: 1px solid #DDD;
+}
+
+.aioseop input[readonly] {
+ background-color: #EEE;
+ margin: 5px 0 5px 0 !important;
+}
+
+.aioseop_settings_left {
+ float: left;
+ padding: 0;
+ margin: 0;
+ width: 100%;
+}
+
+body.all-in-one-seo_page_all-in-one-seo-pack-aioseop_feature_manager .aioseop_settings_left {
+ margin-top: 20px;
+}
+
+body.all-in-one-seo_page_all-in-one-seo-pack-pro-aioseop_feature_manager .aioseop_settings_left {
+ margin-top: 20px;
+}
+
+#aioseop_top_button {
+ margin-top: 5px;
+ height: 30px;
+}
+
+#aioseop-list #mce-EMAIL {
+ margin-top: 5px;
+ width: 250px;
+}
+
+.aioseop_top {
+ margin: 10px 10px 0 0;
+ /* margin: 10px 477px 0px 0px; */
+}
+
+.aioseop_top #aioseop-list {
+ margin-bottom: 0;
+}
+
+.aioseop_right_sidebar {
+ float: right;
+ margin-top: 35px;
+}
+
+#aiosp_settings_form .button-primary.hidden {
+ display: none;
+}
+
+form#edittag div#aiosp_titleatr_wrapper,
+form#edittag div#aiosp_menulabel_wrapper,
+form#edittag div#aiosp_sitemap_exclude_wrapper {
+ display: none;
+}
+
+.All_in_One_SEO_Pack_Feature_Manager > #aiosp_settings_form > #aioseop_top_button {
+ height: 5px;
+ position: absolute;
+ top: 0;
+ width: 97%;
+}
+
+.All_in_One_SEO_Pack_Feature_Manager > #aiosp_settings_form > .aioseop_settings_left {
+ margin-top: 10px;
+}
+
+.All_in_One_SEO_Pack_Feature_Manager > .aioseop_right_sidebar.aioseop_options_wrapper {
+ margin-top: 10px;
+}
+
+div#aiosp_feature_manager_metabox .inside {
+ padding: 8px;
+}
+
+div.aioseop_feature {
+ position: relative;
+ display: inline-block;
+ float: left;
+ vertical-align: top;
+ width: 240px;
+ height: 288px;
+ margin: 8px;
+ border: 1px solid #DEDEDE;
+ -moz-border-radius: 3px;
+ -webkit-border-radius: 3px;
+ border-radius: 3px;
+ background: white;
+ padding: 10px 0 0;
+ -webkit-box-shadow: inset 0 1px 0 #fff,
+ inset 0 0 20px rgba(0, 0, 0, 0.05),
+ 0 1px 2px rgba(0, 0, 0, 0.1);
+ -moz-box-shadow: inset 0 1px 0 #fff,
+ inset 0 0 20px rgba(0, 0, 0, 0.05),
+ 0 1px 2px rgba(0, 0, 0, 0.1);
+ box-shadow: inset 0 1px 0 #fff,
+ inset 0 0 20px rgba(0, 0, 0, 0.05),
+ 0 1px 2px rgba(0, 0, 0, 0.1);
+ -webkit-transition-duration: .4s;
+ -moz-transition-duration: .4s;
+}
+
+.aioseop_feature #free-flag {
+ float: right;
+ margin-right: -7px;
+ background: none repeat scroll 0 0 #D23D46;
+ color: #FFFFFF;
+ padding: 5px 12px 6px 5px;
+ position: relative;
+}
+
+.aioseop_feature #free-flag:before {
+ border-color: #D23D46 #D23D46 #D23D46 transparent;
+ border-style: solid;
+ border-width: 14px 4px 15px 10px;
+ content: "";
+ left: -14px;
+ position: absolute;
+ top: 0;
+}
+
+.aioseop_feature #free-flag:after {
+ border-color: #892026 transparent transparent;
+ border-style: solid;
+ border-width: 6px 6px 6px 0;
+ bottom: -12px;
+ content: "";
+ position: absolute;
+ right: 0;
+}
+
+#aioseop_coming_soon #free-flag {
+ display: none;
+}
+
+.aioseop_feature h3 {
+ font-size: 17px;
+ margin: 0;
+ padding: 0 10px 5px 10px;
+ font-weight: normal;
+ font-style: normal;
+ font-family: "Helvetica Neue",
+ Helvetica,
+ Arial,
+ "Lucida Grande",
+ Verdana,
+ "Bitstream Vera Sans",
+ sans-serif;
+}
+
+.aioseop_feature p {
+ line-height: 150%;
+ font-size: 12px;
+ font-family: Georgia,
+ "Times New Roman",
+ "Bitstream Charter",
+ Times, serif;
+ margin-bottom: 20px;
+ color: #666;
+ padding: 0 10px;
+}
+
+.aioseop_feature p.aioseop_desc {
+ min-height: 80px;
+}
+
+.aioseop_feature .feature_button {
+ float: right;
+ margin-bottom: 10px;
+ margin-right: 10px;
+ min-width: 80px;
+ text-align: center;
+}
+
+.aioseop_feature .feature_button:before {
+ content: "Activate";
+}
+
+.aioseop_feature .active.feature_button:before {
+ content: "Deactivate";
+}
+
+div.aioseop_feature .aioseop_featured_image {
+ min-height: 100px;
+ background-repeat: no-repeat;
+ display: block;
+ margin: 0 auto;
+ width: 133px;
+}
+
+div.aioseop_feature .aioseop_featured_image {
+ background-image: url(../../modules/images/Default-BW-Standard.png);
+}
+
+div.aioseop_feature .aioseop_featured_image.active {
+ background-image: url(../../modules/images/Default-Color-Standard.png);
+}
+
+div.aioseop_feature#aioseop_sitemap .aioseop_featured_image {
+ background-image: url(../../modules/images/XMLSitemaps-BW-Standard.png);
+}
+
+div.aioseop_feature#aioseop_sitemap .aioseop_featured_image.active {
+ background-image: url(../../modules/images/XMLSitemaps-Color-Standard.png);
+}
+
+div.aioseop_feature#aioseop_video_sitemap .aioseop_featured_image {
+ background-image: url(../../modules/images/VideoSitemap-BW-Standard.png);
+}
+
+div.aioseop_feature#aioseop_video_sitemap .aioseop_featured_image.active {
+ background-image: url(../../modules/images/VideoSitemap-Color-Standard.png);
+}
+
+div.aioseop_feature#aioseop_opengraph .aioseop_featured_image {
+ background-image: url(../../modules/images/SocialMeta-BW-Standard.png);
+}
+
+div.aioseop_feature#aioseop_opengraph .aioseop_featured_image.active {
+ background-image: url(../../modules/images/SocialMeta-Color-Standard.png);
+}
+
+div.aioseop_feature#aioseop_robots .aioseop_featured_image, div.aioseop_feature#aioseop_bad_robots .aioseop_featured_image {
+ background-image: url(../../modules/images/Robots-BW-Standard.png);
+}
+
+div.aioseop_feature#aioseop_robots .aioseop_featured_image.active, div.aioseop_feature#aioseop_bad_robots .aioseop_featured_image.active {
+ background-image: url(../../modules/images/Robots-Color-Standard.png);
+}
+
+div.aioseop_feature#aioseop_file_editor .aioseop_featured_image {
+ background-image: url(../../modules/images/FileEditor-BW-Standard.png);
+}
+
+div.aioseop_feature#aioseop_file_editor .aioseop_featured_image.active {
+ background-image: url(../../modules/images/FileEditor-Color-Standard.png);
+}
+
+div.aioseop_feature#aioseop_importer_exporter .aioseop_featured_image {
+ background-image: url(../../modules/images/ImporterExporter-BW-Standard.png);
+}
+
+div.aioseop_feature#aioseop_importer_exporter .aioseop_featured_image.active {
+ background-image: url(../../modules/images/ImporterExporter-Color-Standard.png);
+}
+
+div.aioseop_feature#aioseop_performance .aioseop_featured_image {
+ background-image: url(../../modules/images/Performance-BW-Standard.png);
+}
+
+div.aioseop_feature#aioseop_performance .aioseop_featured_image.active {
+ background-image: url(../../modules/images/Performance-Color-Standard.png);
+}
+
+div.aioseop_feature#aioseop_coming_soon .aioseop_featured_image {
+ background-image: url(../../modules/images/Default-Color-Standard.png);
+}
+
+div.aioseop_feature#aioseop_coming_soon2 .aioseop_featured_image {
+ background-image: url(../../modules/images/Default-Color-Standard.png);
+}
+
+.All_in_One_SEO_Pack_Sitemap > form > .wrap > .form-table,
+.All_in_One_SEO_Pack_Video_Sitemap > form > .wrap > .form-table {
+ max-width: 500px;
+ clear: none;
+}
+
+.aioseop_follow_button {
+ min-height: 50px;
+ background-repeat: no-repeat;
+ display: inline-block;
+ width: 100px;
+ background-size: auto 50px !important;
+ margin-right: 0;
+}
+
+.aioseop_facebook_follow {
+ background-image: url(../../modules/images/facebook-follow-standard.png);
+}
+
+.aioseop_twitter_follow {
+ background-image: url(../../modules/images/twitter-follow-standard.png);
+}
+
+@media only screen and (-webkit-min-device-pixel-ratio: 1.5), only screen and ( min--moz-device-pixel-ratio: 1.5), only screen and ( -o-min-device-pixel-ratio: 3/2), only screen and ( min-device-pixel-ratio: 1.5), only screen and ( min-resolution: 1.5dppx) {
+ div.aioseop_feature .aioseop_featured_image {
+ background-size: auto 100px !important;
+ }
+
+ div.aioseop_feature .aioseop_featured_image.active {
+ background-image: url(../../modules/images/Default-Color-Retina.png);
+ }
+
+ div.aioseop_feature .aioseop_featured_image {
+ background-image: url(../../modules/images/Default-BW-Retina.png);
+ }
+
+ div.aioseop_feature#aioseop_sitemap .aioseop_featured_image {
+ background-image: url(../../modules/images/XMLSitemaps-BW-Retina.png);
+ }
+
+ div.aioseop_feature#aioseop_sitemap .aioseop_featured_image.active {
+ background-image: url(../../modules/images/XMLSitemaps-Color-Retina.png);
+ }
+
+ div.aioseop_feature#aioseop_video_sitemap .aioseop_featured_image {
+ background-image: url(../../modules/images/VideoSitemap-BW-Retina.png);
+ }
+
+ div.aioseop_feature#aioseop_video_sitemap .aioseop_featured_image.active {
+ background-image: url(../../modules/images/VideoSitemap-Color-Retina.png);
+ }
+
+ div.aioseop_feature#aioseop_opengraph .aioseop_featured_image {
+ background-image: url(../../modules/images/SocialMeta-BW-Retina.png);
+ }
+
+ div.aioseop_feature#aioseop_opengraph .aioseop_featured_image.active {
+ background-image: url(../../modules/images/SocialMeta-Color-Retina.png);
+ }
+
+ div.aioseop_feature#aioseop_robots .aioseop_featured_image, div.aioseop_feature#aioseop_bad_robots .aioseop_featured_image {
+ background-image: url(../../modules/images/Robots-BW-Retina.png);
+ }
+
+ div.aioseop_feature#aioseop_robots .aioseop_featured_image.active, div.aioseop_feature#aioseop_bad_robots .aioseop_featured_image.active {
+ background-image: url(../../modules/images/Robots-Color-Retina.png);
+ }
+
+ div.aioseop_feature#aioseop_file_editor .aioseop_featured_image {
+ background-image: url(../../modules/images/FileEditor-BW-Retina.png);
+ }
+
+ div.aioseop_feature#aioseop_file_editor .aioseop_featured_image.active {
+ background-image: url(../../modules/images/FileEditor-Color-Retina.png);
+ }
+
+ div.aioseop_feature#aioseop_importer_exporter .aioseop_featured_image {
+ background-image: url(../../modules/images/ImporterExporter-BW-Retina.png);
+ }
+
+ div.aioseop_feature#aioseop_importer_exporter .aioseop_featured_image.active {
+ background-image: url(../../modules/images/ImporterExporter-Color-Retina.png);
+ }
+
+ div.aioseop_feature#aioseop_performance .aioseop_featured_image {
+ background-image: url(../../modules/images/Performance-BW-Retina.png);
+ }
+
+ div.aioseop_feature#aioseop_performance .aioseop_featured_image.active {
+ background-image: url(../../modules/images/Performance-Color-Retina.png);
+ }
+
+ div.aioseop_feature#aioseop_coming_soon .aioseop_featured_image {
+ background-image: url(../../modules/images/Default-BW-Retina.png);
+ }
+
+ div.aioseop_feature#aioseop_coming_soon2 .aioseop_featured_image {
+ background-image: url(../../modules/images/Default-BW-Retina.png);
+ }
+
+ .aioseop_facebook_follow {
+ background-image: url(../../modules/images/facebook-follow-retina.png);
+ }
+
+ .aioseop_twitter_follow {
+ background-image: url(../../modules/images/twitter-follow-retina.png);
+ }
+}
+
+.aioseop_options {
+ width: 100%;
+ margin: 18px 0 10px 0;
+}
+
+.aioseop_wrapper {
+ width: 100%;
+ padding-left: 5px;
+}
+
+.aioseop_input {
+ clear: left;
+ width: 100%;
+ padding: 5px;
+ display: inline;
+}
+
+.aioseop_option_input {
+ float: left;
+ width: 61%;
+ margin: 0;
+ padding-left: 1px;
+ min-width: 160px;
+ /* max-width: 900px; */
+}
+
+#aiosp div.preview_snippet {
+ border: 1px solid #ebebeb;
+ padding: 15px 15px 20px 7px;
+ background-color: #fff;
+}
+
+div#aioseop_snippet {
+ font-family: arial, sans-serif;
+ font-size: 13px;
+}
+
+div#aioseop_snippet > h3 {
+ font-size: 16px;
+ padding: 8px 0;
+ border: 0;
+ background: inherit;
+}
+
+div#aioseop_snippet > h3 > a {
+ color: #12c;
+ text-decoration: none;
+ cursor: pointer;
+}
+
+div#aioseop_snippet > div {
+ color: #222;
+ max-width: 42em;
+}
+
+div#aioseop_snippet > div > div {
+ display: block;
+ margin-bottom: 1px;
+}
+
+div#aioseop_snippet > div > div > cite {
+ color: #093;
+ font-style: normal;
+}
+
+div#aioseop_snippet > div > span {
+ margin: 0;
+ padding: 0;
+ border: 0;
+}
+
+#aiosp_sitemap_addl_pages,
+#aiosp_video_sitemap_addl_pages {
+ clear: left;
+ margin-left: 20px;
+ max-width: 1072px;
+}
+
+#aiosp_sitemap_addl_pages_metabox .aioseop_wrapper,
+#aiosp_video_sitemap_addl_pages_metabox .aioseop_wrapper {
+ width: 23%;
+ min-width: 165px;
+ display: inline-block;
+ max-width: 265px;
+}
+
+#aiosp_sitemap_addl_pages_metabox .aioseop_help_text_div,
+#aiosp_video_sitemap_addl_pages_metabox .aioseop_help_text_div {
+ position: absolute;
+ margin: 5px 0 10px 0;
+}
+
+#aiosp_sitemap_addl_pages_metabox .aioseop_option_input,
+#aiosp_video_sitemap_addl_pages_metabox .aioseop_option_input {
+ width: 94%;
+ min-width: 94%;
+}
+
+#aiosp_sitemap_addl_pages_metabox table.aioseop_table,
+#aiosp_video_sitemap_addl_pages_metabox table.aioseop_table {
+ width: 96%;
+ border: 1px solid #CCC;
+ margin: 5px 0 10px 0;
+}
+
+table.aioseop_table tr:nth-child(odd) {
+ background-color: #EEE;
+}
+
+.All_in_One_SEO_Pack_Opengraph table.aioseop_table tr:nth-child(odd) {
+ background-color: rgba(238, 238, 238, 0.5);
+}
+
+table.aioseop_table td {
+ width: 23%;
+}
+
+.All_in_One_SEO_Pack_Opengraph table.aioseop_table {
+ width: 80%;
+ max-width: 800px;
+ display: block;
+ border-top: 1px solid #dfdfdf;
+ border-left: 1px solid #dfdfdf;
+}
+
+.All_in_One_SEO_Pack_Opengraph table.aioseop_table th {
+ width: 18%;
+ border-right: 1px solid #dfdfdf;
+ border-bottom: 1px solid #dfdfdf;
+}
+
+.All_in_One_SEO_Pack_Opengraph div.aioseop_meta_info {
+ margin-top: 10px;
+ border: 1px solid #dfdfdf;
+ width: 80%;
+ max-width: 800px;
+}
+
+.All_in_One_SEO_Pack_Opengraph table.aioseop_table tr.aioseop_table_header th {
+ background: #f1f1f1;
+ background-image: -webkit-gradient(linear, left bottom, left top, from(#ececec), to(#f9f9f9));
+ background-image: -webkit-linear-gradient(bottom, #ececec, #f9f9f9);
+ background-image: -moz-linear-gradient(bottom, #ececec, #f9f9f9);
+ background-image: -o-linear-gradient(bottom, #ececec, #f9f9f9);
+ background-image: linear-gradient(to top, #ececec, #f9f9f9);
+ padding: 5px;
+ border-bottom-color: #dfdfdf;
+ text-shadow: #fff 0 1px 0;
+ -webkit-box-shadow: 0 1px 0 #fff;
+ -moz-box-shadow: 0 1px 0 #fff;
+ box-shadow: 0 1px 0 #fff;
+}
+
+.All_in_One_SEO_Pack_Opengraph table.aioseop_table td {
+ border-right: 1px solid #dfdfdf;
+ border-bottom: 1px solid #dfdfdf;
+}
+
+#aioseop_opengraph_settings_facebook_debug_result li.aioseop_opengraph_settings_facebook_debug_item {
+ display: inline-block;
+ width: 30%;
+ vertical-align: top;
+}
+
+#aioseop_opengraph_settings_facebook_debug_result li.aioseop_opengraph_settings_facebook_debug_item:nth-child(even) {
+ font-weight: bold;
+}
+
+#aioseop_opengraph_settings_facebook_debug_result li.aioseop_opengraph_settings_facebook_debug_item:nth-child(odd) {
+ width: 70%;
+}
+
+#aiosp_sitemap_addl_pages_metabox table.aioseop_table td,
+#aiosp_video_sitemap_addl_pages_metabox table.aioseop_table td {
+ width: 25%;
+ padding-left: 5%;
+}
+
+table.aioseop_table td, table.aioseop_table th {
+ padding: 3px;
+}
+
+.aioseop_top_label .aioseop_option_input,
+.aioseop_no_label .aioseop_option_input {
+ width: 100%;
+}
+
+#aiosp_settings_form .postbox {
+ margin: 0 0 20px 0;
+}
+
+.aioseop_settings_left .postbox {
+ float: left;
+ width: 100%;
+}
+
+.aioseop_option_setting_label {
+ min-height: 35px;
+ display: inline-block;
+ white-space: nowrap;
+ overflow: hidden;
+ padding-left: 1px;
+ max-width: 229px;
+ min-width: 160px;
+ width: 33%;
+}
+
+.aioseop_settings_left .postbox .inside {
+ padding: 0;
+ margin: 0;
+ clear: right;
+}
+
+#aiosp_settings_form .aioseop_no_label, .aioseop_no_label {
+ float: left;
+ width: 92%;
+ max-width: 100%;
+ margin: 0 23px 0 13px;
+}
+
+.aioseop_top_label {
+ width: 96%;
+ margin: 0 10px;
+}
+
+.aioseop_hidden_type {
+ margin: 0;
+ padding: 0;
+ height: 0;
+}
+
+.aioseop_module.error.below-h2 {
+ padding: 5px 0;
+ margin: 0 477px 15px 0 !important;
+}
+
+#aioseop_opengraph_settings .inside {
+ margin: 0;
+ padding: 0;
+}
+
+#aioseop_opengraph_settings_image_wrapper img {
+ width: auto;
+ height: 75px;
+}
+
+#aioseop_opengraph_settings_image_wrapper .aioseop_option_setting_label {
+ max-width: 160px;
+ min-width: 100px;
+ width: 30%;
+}
+
+.aioseop_input input[type="checkbox"],
+.aioseop_input input[type="radio"] {
+ vertical-align: text-bottom;
+ margin-top: 8px;
+}
+
+#aiosp_importer_exporter_import_export_help_wrapper .aioseop_option_div {
+ max-height: initial;
+}
+
+#aiosp {
+ width: 100%;
+}
+
+.aioseop_input.aioseop_top_label .aioseop_option_input {
+ margin: 0 0 10px 0;
+}
+
+.aiosp_file_editor_settings > .aioseop_textarea_type .aioseop_option_div {
+ max-height: none;
+}
+
+/* Robots.txt styling */
+#aiosp_robots_generator_robotgen_wrapper .aioseop_option_div,
+#aiosp_robots_generator_robothtml_wrapper .aioseop_option_div {
+ max-height: none;
+}
+
+.aioseop_option_input .widefat td {
+ vertical-align: middle;
+}
+
+.entry-row.robots.quirks {
+ font-weight: bold;
+ opacity: 1;
+}
+
+.entry-row.robots {
+ opacity: 0.8;
+}
+
+.entry-row.robots.invalid {
+ opacity: 1;
+ font-weight: bold;
+}
+
+.invalid .entry_label {
+ font-weight: bold;
+}
+
+.aioseop .aioseop_option_input tbody {
+ background: #FCFCFC;
+}
+
+.All_in_One_SEO_Pack_Robots .aioseop .aioseop_option_input tbody {
+ background: transparent;
+}
+
+.entry-row.robots div {
+ height: 20px;
+ vertical-align: middle;
+ width: 90%;
+ margin: 0 0 4px 0;
+}
+
+.robots img {
+ margin: 0 0 0 2px;
+ opacity: 0.6;
+}
+
+.aioseop_option_docs {
+ width: 98%;
+ display: none;
+ border: 1px solid #D3D3D3;
+ margin-top: 20px;
+ padding: 1%;
+ background-color: #EEE;
+}
+
+.aioseop_option_docs h3 {
+ background: none;
+}
+
+div.aioseop_notice {
+ position: relative;
+}
+
+div.aioseop_notice a.aioseop_dismiss_link {
+ position: absolute;
+ top: 10px;
+ right: 10px;
+}
+
+.aioseop_error_notice {
+ color: #f00;
+ font-weight: bold;
+}
+
+.aioseop_input select {
+ margin: 7px 0;
+}
+
+.aioseop_help_text ul {
+ margin: 15px 0 0 20px;
+}
+
+.aioseop_help_text ul li {
+ line-height: 20px;
+ margin: 0;
+}
+
+.aioseop_sidebar #side-sortables {
+ width: 98%;
+}
+
+#aioseop_opengraph_settings .aioseop_option_label {
+ width: 30%;
+}
+
+.aioseop_tabs {
+ padding-top: 6px;
+}
+
+.aioseop_tabs.hide,
+.aioseop_header_tabs.hide {
+ display: block !important;
+}
+
+.aioseop_header_tabs li {
+ display: inline;
+ padding: 0;
+ margin: 0;
+}
+
+.aioseop_header_tabs {
+ margin: 0;
+}
+
+.aioseop_header_nav {
+ margin: 0;
+}
+
+.aioseop_header_tabs li a.aioseop_header_tab.active {
+ background-color: rgb(255, 255, 255);
+ border-bottom-color: rgba(255, 255, 255, 0.5);
+ font-weight: bold;
+}
+
+.aioseop_header_tabs li a.aioseop_header_tab {
+ height: 18px;
+ font: 13px/18px Arial,
+ Helvetica,
+ sans-serif normal;
+ text-decoration: none;
+ margin: 5px 5px 0 0;
+ padding: 4px 5px 2px;
+ cursor: pointer;
+ -webkit-border-top-right-radius: 3px;
+ -webkit-border-top-left-radius: 3px;
+ border-top-right-radius: 3px;
+ border-top-left-radius: 3px;
+ background-color: rgb(255, 255, 255);
+ background-color: rgba(255, 255, 255, 0.5);
+ border: 1px solid #ccc;
+ color: #5F5F5F;
+}
+
+/* Fix for Chrome */
+@media screen and (-webkit-min-device-pixel-ratio:0) {
+
+ .aioseop_header_tabs li a.aioseop_header_tab {
+ padding-bottom: 0;
+ }
+}
+
+/* Fix for Safari */
+_:-webkit-full-screen:not(:root:root), .aioseop_header_tabs li a.aioseop_header_tab {
+ padding-bottom: 2px;
+}
+
+.aioseop_header_tabs li:first-child a.aioseop_header_tab {
+ border-left: solid 1px #CCC;
+ margin-left: 5px;
+}
+
+.aioseop_tab {
+ border: solid 1px #CCC;
+ background-color: rgb(255, 255, 255);
+ background-color: rgba(255, 255, 255, 0.5);
+ padding-left: 5px;
+}
+
+.aioseop_loading {
+ background-image: url('../../images/activity.gif');
+ display: inline-block;
+ width: 24px;
+ height: 24px;
+ margin: 0;
+ padding: 0;
+ vertical-align: bottom;
+}
+
+.aiosp_delete_url {
+ background-image: url('../../images/delete.png');
+ display: inline-block;
+ width: 16px;
+ height: 16px;
+ margin: 0;
+ padding: 0;
+ vertical-align: bottom;
+}
+
+form#aiosp_settings_form,
+.aioseop_tabs_div {
+ padding-right: 477px;
+}
+
+.aioseop_tabs_div {
+ margin-top: 10px;
+}
+
+#aiosp_settings_form ul.sfwd_debug_settings li strong {
+ display: block;
+ float: left;
+ text-align: right;
+ background-color: #DDD;
+ margin-right: 8px;
+ padding: 1px 8px 1px 1px;
+ overflow: auto;
+ width: 200px;
+ min-height: 16px;
+}
+
+#aiosp_settings_form ul.sfwd_debug_settings li:nth-child(2n+1) strong {
+ background-color: #CCC;
+}
+
+#aiosp_settings_form ul.sfwd_debug_settings li {
+ clear: left;
+ margin: 0;
+ padding: 0;
+ background-color: #EEE;
+ overflow: auto;
+ max-width: 75%;
+ min-width: 800px;
+}
+
+#aiosp_settings_form ul.sfwd_debug_settings li:nth-child(2n) {
+ background-color: #DDD;
+}
+
+div.sfwd_debug_mail_sent {
+ background-color: #080;
+ border: 1px solid #0A0;
+ margin: 10px 0 10px 0;
+ width: 598px;
+ color: #FFF;
+ text-align: center;
+}
+
+div.sfwd_debug_error {
+ background-color: #F00;
+ color: #FFF;
+ border: 1px solid #A00;
+ margin: 10px 0 10px 0;
+ width: 598px;
+ text-align: center;
+ font-weight: bolder;
+}
+
+#aiosp_performance_status_wrapper .aioseop_option_div {
+ max-height: 420px;
+}
+
+#aioseop_coming_soon, #aioseop_coming_soon2 {
+ padding-top: 40px;
+ text-align: center;
+ height: 258px;
+ font-size: 16px;
+}
+
+.MRL {
+ margin-left: 20px !important;
+ margin-bottom: 10px !important;
+}
diff --git a/wp-content/plugins/all-in-one-seo-pack/i18n/all-in-one-seo-pack-am.mo b/wp-content/plugins/all-in-one-seo-pack/i18n/all-in-one-seo-pack-am.mo
new file mode 100755
index 0000000000..6a7ad3c406
Binary files /dev/null and b/wp-content/plugins/all-in-one-seo-pack/i18n/all-in-one-seo-pack-am.mo differ
diff --git a/wp-content/plugins/all-in-one-seo-pack/i18n/all-in-one-seo-pack-ar.mo b/wp-content/plugins/all-in-one-seo-pack/i18n/all-in-one-seo-pack-ar.mo
deleted file mode 100644
index 558473f73f..0000000000
Binary files a/wp-content/plugins/all-in-one-seo-pack/i18n/all-in-one-seo-pack-ar.mo and /dev/null differ
diff --git a/wp-content/plugins/all-in-one-seo-pack/i18n/all-in-one-seo-pack-art_xemoji.mo b/wp-content/plugins/all-in-one-seo-pack/i18n/all-in-one-seo-pack-art_xemoji.mo
new file mode 100755
index 0000000000..c74b596dcf
Binary files /dev/null and b/wp-content/plugins/all-in-one-seo-pack/i18n/all-in-one-seo-pack-art_xemoji.mo differ
diff --git a/wp-content/plugins/all-in-one-seo-pack/i18n/all-in-one-seo-pack-ary.mo b/wp-content/plugins/all-in-one-seo-pack/i18n/all-in-one-seo-pack-ary.mo
deleted file mode 100755
index cd69e2b6fa..0000000000
Binary files a/wp-content/plugins/all-in-one-seo-pack/i18n/all-in-one-seo-pack-ary.mo and /dev/null differ
diff --git a/wp-content/plugins/all-in-one-seo-pack/i18n/all-in-one-seo-pack-bg_BG.mo b/wp-content/plugins/all-in-one-seo-pack/i18n/all-in-one-seo-pack-bg_BG.mo
deleted file mode 100644
index 59f2befeb3..0000000000
Binary files a/wp-content/plugins/all-in-one-seo-pack/i18n/all-in-one-seo-pack-bg_BG.mo and /dev/null differ
diff --git a/wp-content/plugins/all-in-one-seo-pack/i18n/all-in-one-seo-pack-bn_BD.mo b/wp-content/plugins/all-in-one-seo-pack/i18n/all-in-one-seo-pack-bn_BD.mo
new file mode 100755
index 0000000000..2b9a64ab8f
Binary files /dev/null and b/wp-content/plugins/all-in-one-seo-pack/i18n/all-in-one-seo-pack-bn_BD.mo differ
diff --git a/wp-content/plugins/all-in-one-seo-pack/i18n/all-in-one-seo-pack-bs_BA.mo b/wp-content/plugins/all-in-one-seo-pack/i18n/all-in-one-seo-pack-bs_BA.mo
new file mode 100755
index 0000000000..e1d383fe8e
Binary files /dev/null and b/wp-content/plugins/all-in-one-seo-pack/i18n/all-in-one-seo-pack-bs_BA.mo differ
diff --git a/wp-content/plugins/all-in-one-seo-pack/i18n/all-in-one-seo-pack-ca.mo b/wp-content/plugins/all-in-one-seo-pack/i18n/all-in-one-seo-pack-ca.mo
deleted file mode 100755
index 85369f3e2a..0000000000
Binary files a/wp-content/plugins/all-in-one-seo-pack/i18n/all-in-one-seo-pack-ca.mo and /dev/null differ
diff --git a/wp-content/plugins/all-in-one-seo-pack/i18n/all-in-one-seo-pack-de_DE.mo b/wp-content/plugins/all-in-one-seo-pack/i18n/all-in-one-seo-pack-de_DE.mo
deleted file mode 100644
index feee17fbaa..0000000000
Binary files a/wp-content/plugins/all-in-one-seo-pack/i18n/all-in-one-seo-pack-de_DE.mo and /dev/null differ
diff --git a/wp-content/plugins/all-in-one-seo-pack/i18n/all-in-one-seo-pack-el.mo b/wp-content/plugins/all-in-one-seo-pack/i18n/all-in-one-seo-pack-el.mo
index 5cdcc9615f..ee189b9562 100644
Binary files a/wp-content/plugins/all-in-one-seo-pack/i18n/all-in-one-seo-pack-el.mo and b/wp-content/plugins/all-in-one-seo-pack/i18n/all-in-one-seo-pack-el.mo differ
diff --git a/wp-content/plugins/all-in-one-seo-pack/i18n/all-in-one-seo-pack-en_AU.mo b/wp-content/plugins/all-in-one-seo-pack/i18n/all-in-one-seo-pack-en_AU.mo
deleted file mode 100644
index 351c92e7ec..0000000000
Binary files a/wp-content/plugins/all-in-one-seo-pack/i18n/all-in-one-seo-pack-en_AU.mo and /dev/null differ
diff --git a/wp-content/plugins/all-in-one-seo-pack/i18n/all-in-one-seo-pack-en_CA.mo b/wp-content/plugins/all-in-one-seo-pack/i18n/all-in-one-seo-pack-en_CA.mo
deleted file mode 100644
index 511eab31b5..0000000000
Binary files a/wp-content/plugins/all-in-one-seo-pack/i18n/all-in-one-seo-pack-en_CA.mo and /dev/null differ
diff --git a/wp-content/plugins/all-in-one-seo-pack/i18n/all-in-one-seo-pack-en_GB.mo b/wp-content/plugins/all-in-one-seo-pack/i18n/all-in-one-seo-pack-en_GB.mo
deleted file mode 100644
index c0e6219dfb..0000000000
Binary files a/wp-content/plugins/all-in-one-seo-pack/i18n/all-in-one-seo-pack-en_GB.mo and /dev/null differ
diff --git a/wp-content/plugins/all-in-one-seo-pack/i18n/all-in-one-seo-pack-en_NZ.mo b/wp-content/plugins/all-in-one-seo-pack/i18n/all-in-one-seo-pack-en_NZ.mo
deleted file mode 100755
index 3df83dcb3b..0000000000
Binary files a/wp-content/plugins/all-in-one-seo-pack/i18n/all-in-one-seo-pack-en_NZ.mo and /dev/null differ
diff --git a/wp-content/plugins/all-in-one-seo-pack/i18n/all-in-one-seo-pack-en_ZA.mo b/wp-content/plugins/all-in-one-seo-pack/i18n/all-in-one-seo-pack-en_ZA.mo
index 06604700ad..2c486385bd 100644
Binary files a/wp-content/plugins/all-in-one-seo-pack/i18n/all-in-one-seo-pack-en_ZA.mo and b/wp-content/plugins/all-in-one-seo-pack/i18n/all-in-one-seo-pack-en_ZA.mo differ
diff --git a/wp-content/plugins/all-in-one-seo-pack/i18n/all-in-one-seo-pack-es_CL.mo b/wp-content/plugins/all-in-one-seo-pack/i18n/all-in-one-seo-pack-es_CL.mo
deleted file mode 100644
index 1eaeb4faf3..0000000000
Binary files a/wp-content/plugins/all-in-one-seo-pack/i18n/all-in-one-seo-pack-es_CL.mo and /dev/null differ
diff --git a/wp-content/plugins/all-in-one-seo-pack/i18n/all-in-one-seo-pack-es_ES.mo b/wp-content/plugins/all-in-one-seo-pack/i18n/all-in-one-seo-pack-es_ES.mo
index f6b28f9452..c254ab2c24 100644
Binary files a/wp-content/plugins/all-in-one-seo-pack/i18n/all-in-one-seo-pack-es_ES.mo and b/wp-content/plugins/all-in-one-seo-pack/i18n/all-in-one-seo-pack-es_ES.mo differ
diff --git a/wp-content/plugins/all-in-one-seo-pack/i18n/all-in-one-seo-pack-es_MX.mo b/wp-content/plugins/all-in-one-seo-pack/i18n/all-in-one-seo-pack-es_MX.mo
deleted file mode 100644
index 1eaeb4faf3..0000000000
Binary files a/wp-content/plugins/all-in-one-seo-pack/i18n/all-in-one-seo-pack-es_MX.mo and /dev/null differ
diff --git a/wp-content/plugins/all-in-one-seo-pack/i18n/all-in-one-seo-pack-es_VE.mo b/wp-content/plugins/all-in-one-seo-pack/i18n/all-in-one-seo-pack-es_VE.mo
index 1eaeb4faf3..8b128d98dd 100644
Binary files a/wp-content/plugins/all-in-one-seo-pack/i18n/all-in-one-seo-pack-es_VE.mo and b/wp-content/plugins/all-in-one-seo-pack/i18n/all-in-one-seo-pack-es_VE.mo differ
diff --git a/wp-content/plugins/all-in-one-seo-pack/i18n/all-in-one-seo-pack-et.mo b/wp-content/plugins/all-in-one-seo-pack/i18n/all-in-one-seo-pack-et.mo
index 5995354c40..beb48a0ace 100755
Binary files a/wp-content/plugins/all-in-one-seo-pack/i18n/all-in-one-seo-pack-et.mo and b/wp-content/plugins/all-in-one-seo-pack/i18n/all-in-one-seo-pack-et.mo differ
diff --git a/wp-content/plugins/all-in-one-seo-pack/i18n/all-in-one-seo-pack-fa_IR.mo b/wp-content/plugins/all-in-one-seo-pack/i18n/all-in-one-seo-pack-fa_IR.mo
deleted file mode 100644
index 56ab2e2464..0000000000
Binary files a/wp-content/plugins/all-in-one-seo-pack/i18n/all-in-one-seo-pack-fa_IR.mo and /dev/null differ
diff --git a/wp-content/plugins/all-in-one-seo-pack/i18n/all-in-one-seo-pack-fi.mo b/wp-content/plugins/all-in-one-seo-pack/i18n/all-in-one-seo-pack-fi.mo
deleted file mode 100755
index 7c48aa9d53..0000000000
Binary files a/wp-content/plugins/all-in-one-seo-pack/i18n/all-in-one-seo-pack-fi.mo and /dev/null differ
diff --git a/wp-content/plugins/all-in-one-seo-pack/i18n/all-in-one-seo-pack-fr_CA.mo b/wp-content/plugins/all-in-one-seo-pack/i18n/all-in-one-seo-pack-fr_CA.mo
index 51c25db938..9b513aec92 100644
Binary files a/wp-content/plugins/all-in-one-seo-pack/i18n/all-in-one-seo-pack-fr_CA.mo and b/wp-content/plugins/all-in-one-seo-pack/i18n/all-in-one-seo-pack-fr_CA.mo differ
diff --git a/wp-content/plugins/all-in-one-seo-pack/i18n/all-in-one-seo-pack-fr_FR.mo b/wp-content/plugins/all-in-one-seo-pack/i18n/all-in-one-seo-pack-fr_FR.mo
index fd81aad34f..b515d4b0ef 100644
Binary files a/wp-content/plugins/all-in-one-seo-pack/i18n/all-in-one-seo-pack-fr_FR.mo and b/wp-content/plugins/all-in-one-seo-pack/i18n/all-in-one-seo-pack-fr_FR.mo differ
diff --git a/wp-content/plugins/all-in-one-seo-pack/i18n/all-in-one-seo-pack-he_IL.mo b/wp-content/plugins/all-in-one-seo-pack/i18n/all-in-one-seo-pack-he_IL.mo
index 74e7de72e4..846068dc00 100755
Binary files a/wp-content/plugins/all-in-one-seo-pack/i18n/all-in-one-seo-pack-he_IL.mo and b/wp-content/plugins/all-in-one-seo-pack/i18n/all-in-one-seo-pack-he_IL.mo differ
diff --git a/wp-content/plugins/all-in-one-seo-pack/i18n/all-in-one-seo-pack-hi_IN.mo b/wp-content/plugins/all-in-one-seo-pack/i18n/all-in-one-seo-pack-hi_IN.mo
deleted file mode 100644
index 4fe5d01070..0000000000
Binary files a/wp-content/plugins/all-in-one-seo-pack/i18n/all-in-one-seo-pack-hi_IN.mo and /dev/null differ
diff --git a/wp-content/plugins/all-in-one-seo-pack/i18n/all-in-one-seo-pack-hr.mo b/wp-content/plugins/all-in-one-seo-pack/i18n/all-in-one-seo-pack-hr.mo
deleted file mode 100644
index 5bedb99e27..0000000000
Binary files a/wp-content/plugins/all-in-one-seo-pack/i18n/all-in-one-seo-pack-hr.mo and /dev/null differ
diff --git a/wp-content/plugins/all-in-one-seo-pack/i18n/all-in-one-seo-pack-hu_HU.mo b/wp-content/plugins/all-in-one-seo-pack/i18n/all-in-one-seo-pack-hu_HU.mo
deleted file mode 100644
index 2aab1288ed..0000000000
Binary files a/wp-content/plugins/all-in-one-seo-pack/i18n/all-in-one-seo-pack-hu_HU.mo and /dev/null differ
diff --git a/wp-content/plugins/all-in-one-seo-pack/i18n/all-in-one-seo-pack-hy b/wp-content/plugins/all-in-one-seo-pack/i18n/all-in-one-seo-pack-hy
deleted file mode 100755
index 3664dd8def..0000000000
Binary files a/wp-content/plugins/all-in-one-seo-pack/i18n/all-in-one-seo-pack-hy and /dev/null differ
diff --git a/wp-content/plugins/all-in-one-seo-pack/i18n/all-in-one-seo-pack-hy.mo b/wp-content/plugins/all-in-one-seo-pack/i18n/all-in-one-seo-pack-hy.mo
new file mode 100755
index 0000000000..161f56954a
Binary files /dev/null and b/wp-content/plugins/all-in-one-seo-pack/i18n/all-in-one-seo-pack-hy.mo differ
diff --git a/wp-content/plugins/all-in-one-seo-pack/i18n/all-in-one-seo-pack-id_ID.mo b/wp-content/plugins/all-in-one-seo-pack/i18n/all-in-one-seo-pack-id_ID.mo
index f9aad6a2aa..d8246c5092 100755
Binary files a/wp-content/plugins/all-in-one-seo-pack/i18n/all-in-one-seo-pack-id_ID.mo and b/wp-content/plugins/all-in-one-seo-pack/i18n/all-in-one-seo-pack-id_ID.mo differ
diff --git a/wp-content/plugins/all-in-one-seo-pack/i18n/all-in-one-seo-pack-it_IT.mo b/wp-content/plugins/all-in-one-seo-pack/i18n/all-in-one-seo-pack-it_IT.mo
deleted file mode 100644
index e6f51fd0c1..0000000000
Binary files a/wp-content/plugins/all-in-one-seo-pack/i18n/all-in-one-seo-pack-it_IT.mo and /dev/null differ
diff --git a/wp-content/plugins/all-in-one-seo-pack/i18n/all-in-one-seo-pack-ja.mo b/wp-content/plugins/all-in-one-seo-pack/i18n/all-in-one-seo-pack-ja.mo
index 62d25f8436..ac6d9aaee9 100644
Binary files a/wp-content/plugins/all-in-one-seo-pack/i18n/all-in-one-seo-pack-ja.mo and b/wp-content/plugins/all-in-one-seo-pack/i18n/all-in-one-seo-pack-ja.mo differ
diff --git a/wp-content/plugins/all-in-one-seo-pack/i18n/all-in-one-seo-pack-jv_ID.mo b/wp-content/plugins/all-in-one-seo-pack/i18n/all-in-one-seo-pack-jv_ID.mo
new file mode 100755
index 0000000000..b2227164d4
Binary files /dev/null and b/wp-content/plugins/all-in-one-seo-pack/i18n/all-in-one-seo-pack-jv_ID.mo differ
diff --git a/wp-content/plugins/all-in-one-seo-pack/i18n/all-in-one-seo-pack-ko_KR.mo b/wp-content/plugins/all-in-one-seo-pack/i18n/all-in-one-seo-pack-ko_KR.mo
deleted file mode 100644
index 2bbb46a5ad..0000000000
Binary files a/wp-content/plugins/all-in-one-seo-pack/i18n/all-in-one-seo-pack-ko_KR.mo and /dev/null differ
diff --git a/wp-content/plugins/all-in-one-seo-pack/i18n/all-in-one-seo-pack-lv.mo b/wp-content/plugins/all-in-one-seo-pack/i18n/all-in-one-seo-pack-lv.mo
new file mode 100755
index 0000000000..b6ba89cbfb
Binary files /dev/null and b/wp-content/plugins/all-in-one-seo-pack/i18n/all-in-one-seo-pack-lv.mo differ
diff --git a/wp-content/plugins/all-in-one-seo-pack/i18n/all-in-one-seo-pack-mk_MK.mo b/wp-content/plugins/all-in-one-seo-pack/i18n/all-in-one-seo-pack-mk_MK.mo
new file mode 100755
index 0000000000..b103ade4f3
Binary files /dev/null and b/wp-content/plugins/all-in-one-seo-pack/i18n/all-in-one-seo-pack-mk_MK.mo differ
diff --git a/wp-content/plugins/all-in-one-seo-pack/i18n/all-in-one-seo-pack-mn.mo b/wp-content/plugins/all-in-one-seo-pack/i18n/all-in-one-seo-pack-mn.mo
new file mode 100755
index 0000000000..a0118a65f4
Binary files /dev/null and b/wp-content/plugins/all-in-one-seo-pack/i18n/all-in-one-seo-pack-mn.mo differ
diff --git a/wp-content/plugins/all-in-one-seo-pack/i18n/all-in-one-seo-pack-mr.mo b/wp-content/plugins/all-in-one-seo-pack/i18n/all-in-one-seo-pack-mr.mo
new file mode 100755
index 0000000000..531b172094
Binary files /dev/null and b/wp-content/plugins/all-in-one-seo-pack/i18n/all-in-one-seo-pack-mr.mo differ
diff --git a/wp-content/plugins/all-in-one-seo-pack/i18n/all-in-one-seo-pack-ms_MY.mo b/wp-content/plugins/all-in-one-seo-pack/i18n/all-in-one-seo-pack-ms_MY.mo
new file mode 100755
index 0000000000..175d855f66
Binary files /dev/null and b/wp-content/plugins/all-in-one-seo-pack/i18n/all-in-one-seo-pack-ms_MY.mo differ
diff --git a/wp-content/plugins/all-in-one-seo-pack/i18n/all-in-one-seo-pack-nb_NO.mo b/wp-content/plugins/all-in-one-seo-pack/i18n/all-in-one-seo-pack-nb_NO.mo
deleted file mode 100644
index 74326344cf..0000000000
Binary files a/wp-content/plugins/all-in-one-seo-pack/i18n/all-in-one-seo-pack-nb_NO.mo and /dev/null differ
diff --git a/wp-content/plugins/all-in-one-seo-pack/i18n/all-in-one-seo-pack-nl.mo b/wp-content/plugins/all-in-one-seo-pack/i18n/all-in-one-seo-pack-nl.mo
deleted file mode 100755
index a3fc76b278..0000000000
Binary files a/wp-content/plugins/all-in-one-seo-pack/i18n/all-in-one-seo-pack-nl.mo and /dev/null differ
diff --git a/wp-content/plugins/all-in-one-seo-pack/i18n/all-in-one-seo-pack-nl_NL.mo b/wp-content/plugins/all-in-one-seo-pack/i18n/all-in-one-seo-pack-nl_NL.mo
deleted file mode 100644
index b79d869372..0000000000
Binary files a/wp-content/plugins/all-in-one-seo-pack/i18n/all-in-one-seo-pack-nl_NL.mo and /dev/null differ
diff --git a/wp-content/plugins/all-in-one-seo-pack/i18n/all-in-one-seo-pack-nn_NO.mo b/wp-content/plugins/all-in-one-seo-pack/i18n/all-in-one-seo-pack-nn_NO.mo
deleted file mode 100644
index 4b82665100..0000000000
Binary files a/wp-content/plugins/all-in-one-seo-pack/i18n/all-in-one-seo-pack-nn_NO.mo and /dev/null differ
diff --git a/wp-content/plugins/all-in-one-seo-pack/i18n/all-in-one-seo-pack-oci.mo b/wp-content/plugins/all-in-one-seo-pack/i18n/all-in-one-seo-pack-oci.mo
index 098f2d72cc..3daa63d8ee 100644
Binary files a/wp-content/plugins/all-in-one-seo-pack/i18n/all-in-one-seo-pack-oci.mo and b/wp-content/plugins/all-in-one-seo-pack/i18n/all-in-one-seo-pack-oci.mo differ
diff --git a/wp-content/plugins/all-in-one-seo-pack/i18n/all-in-one-seo-pack-pa_IN.mo b/wp-content/plugins/all-in-one-seo-pack/i18n/all-in-one-seo-pack-pa_IN.mo
index dca116f20d..007b28c3eb 100644
Binary files a/wp-content/plugins/all-in-one-seo-pack/i18n/all-in-one-seo-pack-pa_IN.mo and b/wp-content/plugins/all-in-one-seo-pack/i18n/all-in-one-seo-pack-pa_IN.mo differ
diff --git a/wp-content/plugins/all-in-one-seo-pack/i18n/all-in-one-seo-pack-pl_PL.mo b/wp-content/plugins/all-in-one-seo-pack/i18n/all-in-one-seo-pack-pl_PL.mo
deleted file mode 100644
index 9323ba6d40..0000000000
Binary files a/wp-content/plugins/all-in-one-seo-pack/i18n/all-in-one-seo-pack-pl_PL.mo and /dev/null differ
diff --git a/wp-content/plugins/all-in-one-seo-pack/i18n/all-in-one-seo-pack-ps.mo b/wp-content/plugins/all-in-one-seo-pack/i18n/all-in-one-seo-pack-ps.mo
new file mode 100755
index 0000000000..20a51537c6
Binary files /dev/null and b/wp-content/plugins/all-in-one-seo-pack/i18n/all-in-one-seo-pack-ps.mo differ
diff --git a/wp-content/plugins/all-in-one-seo-pack/i18n/all-in-one-seo-pack-pt_BR.mo b/wp-content/plugins/all-in-one-seo-pack/i18n/all-in-one-seo-pack-pt_BR.mo
deleted file mode 100755
index 6ad592fe5d..0000000000
Binary files a/wp-content/plugins/all-in-one-seo-pack/i18n/all-in-one-seo-pack-pt_BR.mo and /dev/null differ
diff --git a/wp-content/plugins/all-in-one-seo-pack/i18n/all-in-one-seo-pack-pt_PT.mo b/wp-content/plugins/all-in-one-seo-pack/i18n/all-in-one-seo-pack-pt_PT.mo
deleted file mode 100644
index 0d91986774..0000000000
Binary files a/wp-content/plugins/all-in-one-seo-pack/i18n/all-in-one-seo-pack-pt_PT.mo and /dev/null differ
diff --git a/wp-content/plugins/all-in-one-seo-pack/i18n/all-in-one-seo-pack-ro_RO.mo b/wp-content/plugins/all-in-one-seo-pack/i18n/all-in-one-seo-pack-ro_RO.mo
deleted file mode 100644
index 027a6d9f2b..0000000000
Binary files a/wp-content/plugins/all-in-one-seo-pack/i18n/all-in-one-seo-pack-ro_RO.mo and /dev/null differ
diff --git a/wp-content/plugins/all-in-one-seo-pack/i18n/all-in-one-seo-pack-ru_RU.mo b/wp-content/plugins/all-in-one-seo-pack/i18n/all-in-one-seo-pack-ru_RU.mo
deleted file mode 100644
index d28f00e2db..0000000000
Binary files a/wp-content/plugins/all-in-one-seo-pack/i18n/all-in-one-seo-pack-ru_RU.mo and /dev/null differ
diff --git a/wp-content/plugins/all-in-one-seo-pack/i18n/all-in-one-seo-pack-si_LK.mo b/wp-content/plugins/all-in-one-seo-pack/i18n/all-in-one-seo-pack-si_LK.mo
new file mode 100755
index 0000000000..c0aaefccc4
Binary files /dev/null and b/wp-content/plugins/all-in-one-seo-pack/i18n/all-in-one-seo-pack-si_LK.mo differ
diff --git a/wp-content/plugins/all-in-one-seo-pack/i18n/all-in-one-seo-pack-sl_SL.mo b/wp-content/plugins/all-in-one-seo-pack/i18n/all-in-one-seo-pack-sl_SL.mo
deleted file mode 100755
index 59bc0e5869..0000000000
Binary files a/wp-content/plugins/all-in-one-seo-pack/i18n/all-in-one-seo-pack-sl_SL.mo and /dev/null differ
diff --git a/wp-content/plugins/all-in-one-seo-pack/i18n/all-in-one-seo-pack-sq.mo b/wp-content/plugins/all-in-one-seo-pack/i18n/all-in-one-seo-pack-sq.mo
deleted file mode 100644
index 3bb3fbc38e..0000000000
Binary files a/wp-content/plugins/all-in-one-seo-pack/i18n/all-in-one-seo-pack-sq.mo and /dev/null differ
diff --git a/wp-content/plugins/all-in-one-seo-pack/i18n/all-in-one-seo-pack-sr_RS.mo b/wp-content/plugins/all-in-one-seo-pack/i18n/all-in-one-seo-pack-sr_RS.mo
deleted file mode 100644
index 6954ac4bed..0000000000
Binary files a/wp-content/plugins/all-in-one-seo-pack/i18n/all-in-one-seo-pack-sr_RS.mo and /dev/null differ
diff --git a/wp-content/plugins/all-in-one-seo-pack/i18n/all-in-one-seo-pack-sv_SE.mo b/wp-content/plugins/all-in-one-seo-pack/i18n/all-in-one-seo-pack-sv_SE.mo
index d75357525d..0558729702 100644
Binary files a/wp-content/plugins/all-in-one-seo-pack/i18n/all-in-one-seo-pack-sv_SE.mo and b/wp-content/plugins/all-in-one-seo-pack/i18n/all-in-one-seo-pack-sv_SE.mo differ
diff --git a/wp-content/plugins/all-in-one-seo-pack/i18n/all-in-one-seo-pack-ta_IN.mo b/wp-content/plugins/all-in-one-seo-pack/i18n/all-in-one-seo-pack-ta_IN.mo
new file mode 100755
index 0000000000..c35ad3c5f9
Binary files /dev/null and b/wp-content/plugins/all-in-one-seo-pack/i18n/all-in-one-seo-pack-ta_IN.mo differ
diff --git a/wp-content/plugins/all-in-one-seo-pack/i18n/all-in-one-seo-pack-tg.mo b/wp-content/plugins/all-in-one-seo-pack/i18n/all-in-one-seo-pack-tg.mo
new file mode 100755
index 0000000000..93a892904e
Binary files /dev/null and b/wp-content/plugins/all-in-one-seo-pack/i18n/all-in-one-seo-pack-tg.mo differ
diff --git a/wp-content/plugins/all-in-one-seo-pack/i18n/all-in-one-seo-pack-tr_TR.mo b/wp-content/plugins/all-in-one-seo-pack/i18n/all-in-one-seo-pack-tr_TR.mo
deleted file mode 100644
index aa5870822e..0000000000
Binary files a/wp-content/plugins/all-in-one-seo-pack/i18n/all-in-one-seo-pack-tr_TR.mo and /dev/null differ
diff --git a/wp-content/plugins/all-in-one-seo-pack/i18n/all-in-one-seo-pack-uk.mo b/wp-content/plugins/all-in-one-seo-pack/i18n/all-in-one-seo-pack-uk.mo
index 87d213c1b6..7f91f696b5 100644
Binary files a/wp-content/plugins/all-in-one-seo-pack/i18n/all-in-one-seo-pack-uk.mo and b/wp-content/plugins/all-in-one-seo-pack/i18n/all-in-one-seo-pack-uk.mo differ
diff --git a/wp-content/plugins/all-in-one-seo-pack/i18n/all-in-one-seo-pack-ur.mo b/wp-content/plugins/all-in-one-seo-pack/i18n/all-in-one-seo-pack-ur.mo
index 301b7e3f76..fc6cb7c79d 100755
Binary files a/wp-content/plugins/all-in-one-seo-pack/i18n/all-in-one-seo-pack-ur.mo and b/wp-content/plugins/all-in-one-seo-pack/i18n/all-in-one-seo-pack-ur.mo differ
diff --git a/wp-content/plugins/all-in-one-seo-pack/i18n/all-in-one-seo-pack-vi.mo b/wp-content/plugins/all-in-one-seo-pack/i18n/all-in-one-seo-pack-vi.mo
deleted file mode 100644
index c186356b7c..0000000000
Binary files a/wp-content/plugins/all-in-one-seo-pack/i18n/all-in-one-seo-pack-vi.mo and /dev/null differ
diff --git a/wp-content/plugins/all-in-one-seo-pack/i18n/all-in-one-seo-pack-zh_CN.mo b/wp-content/plugins/all-in-one-seo-pack/i18n/all-in-one-seo-pack-zh_CN.mo
deleted file mode 100644
index fe9abb5445..0000000000
Binary files a/wp-content/plugins/all-in-one-seo-pack/i18n/all-in-one-seo-pack-zh_CN.mo and /dev/null differ
diff --git a/wp-content/plugins/all-in-one-seo-pack/i18n/all-in-one-seo-pack-zh_TW.mo b/wp-content/plugins/all-in-one-seo-pack/i18n/all-in-one-seo-pack-zh_TW.mo
index c94a8d05e3..555802e85f 100644
Binary files a/wp-content/plugins/all-in-one-seo-pack/i18n/all-in-one-seo-pack-zh_TW.mo and b/wp-content/plugins/all-in-one-seo-pack/i18n/all-in-one-seo-pack-zh_TW.mo differ
diff --git a/wp-content/plugins/all-in-one-seo-pack/inc/aioseop_functions.php b/wp-content/plugins/all-in-one-seo-pack/inc/aioseop_functions.php
index a818d3e5ef..da0b714866 100644
--- a/wp-content/plugins/all-in-one-seo-pack/inc/aioseop_functions.php
+++ b/wp-content/plugins/all-in-one-seo-pack/inc/aioseop_functions.php
@@ -1,77 +1,91 @@
load_modules();
+ require_once( AIOSEOP_PLUGIN_DIR . 'admin/aioseop_module_manager.php' );
+ $aioseop_modules = new All_in_One_SEO_Pack_Module_Manager( apply_filters( 'aioseop_module_list', $aioseop_module_list ) );
+ $aioseop_modules->load_modules();
}
}
-if ( !function_exists( 'aioseop_get_options' ) ) {
+if ( ! function_exists( 'aioseop_get_options' ) ) {
+ /**
+ * @return mixed|void
+ */
function aioseop_get_options() {
global $aioseop_options;
$aioseop_options = get_option( 'aioseop_options' );
$aioseop_options = apply_filters( 'aioseop_get_options', $aioseop_options );
+
return $aioseop_options;
}
}
-/**
- * Check if settings need to be updated / migrated from old version.
- */
-if ( !function_exists( 'aioseop_update_settings_check' ) ) {
+if ( ! function_exists( 'aioseop_update_settings_check' ) ) {
+ /**
+ * Check if settings need to be updated / migrated from old version.
+ *
+ * @TODO See when this is from and if we can move it elsewhere... our new db updates/upgrades class?
+ */
function aioseop_update_settings_check() {
global $aioseop_options;
- if ( ( isset( $_POST['aioseop_migrate_options'] ) ) ||
- ( empty( $aioseop_options ) ) )
+ if ( empty( $aioseop_options ) || isset( $_POST['aioseop_migrate_options'] ) ) {
aioseop_mrt_mkarry();
- // WPML has now attached to filters, read settings again so they can be translated
+ }
+ // WPML has now attached to filters, read settings again so they can be translated.
aioseop_get_options();
$update_options = false;
- if ( !empty( $aioseop_options ) ) {
- if ( !empty( $aioseop_options['aiosp_archive_noindex'] ) ) { // migrate setting for noindex archives
+ if ( ! empty( $aioseop_options ) ) {
+ if ( ! empty( $aioseop_options['aiosp_archive_noindex'] ) ) { // Migrate setting for noindex archives.
$aioseop_options['aiosp_archive_date_noindex'] = $aioseop_options['aiosp_archive_author_noindex'] = $aioseop_options['aiosp_archive_noindex'];
unset( $aioseop_options['aiosp_archive_noindex'] );
$update_options = true;
}
- if ( !empty( $aioseop_options['aiosp_archive_title_format'] ) && empty( $aioseop_options['aiosp_date_title_format'] ) ) {
+ if ( ! empty( $aioseop_options['aiosp_archive_title_format'] ) && empty( $aioseop_options['aiosp_date_title_format'] ) ) {
$aioseop_options['aiosp_date_title_format'] = $aioseop_options['aiosp_archive_title_format'];
unset( $aioseop_options['aiosp_archive_title_format'] );
$update_options = true;
}
- if ( !empty( $aioseop_options['aiosp_archive_title_format'] ) && ( $aioseop_options['aiosp_archive_title_format'] == '%date% | %blog_title%' ) ) {
+ if ( ! empty( $aioseop_options['aiosp_archive_title_format'] ) && ( $aioseop_options['aiosp_archive_title_format'] === '%date% | %blog_title%' ) ) {
$aioseop_options['aiosp_archive_title_format'] = '%archive_title% | %blog_title%';
- $update_options = true;
+ $update_options = true;
}
- if ( $update_options )
+ if ( $update_options ) {
update_option( 'aioseop_options', $aioseop_options );
+ }
}
}
}
-/**
- * Initialize settings to defaults.
- */
-if ( !function_exists( 'aioseop_mrt_mkarry' ) ) {
+if ( ! function_exists( 'aioseop_mrt_mkarry' ) ) {
+ /**
+ * Initialize settings to defaults.
+ *
+ * @TODO Should also move.
+ */
function aioseop_mrt_mkarry() {
global $aiosp;
global $aioseop_options;
$naioseop_options = $aiosp->default_options();
- if( get_option( 'aiosp_post_title_format' ) ) {
- foreach( $naioseop_options as $aioseop_opt_name => $value ) {
- if( $aioseop_oldval = get_option( $aioseop_opt_name ) ) {
- $naioseop_options[$aioseop_opt_name] = $aioseop_oldval;
+ if ( get_option( 'aiosp_post_title_format' ) ) {
+ foreach ( $naioseop_options as $aioseop_opt_name => $value ) {
+ if ( $aioseop_oldval = get_option( $aioseop_opt_name ) ) {
+ $naioseop_options[ $aioseop_opt_name ] = $aioseop_oldval;
}
- if( $aioseop_oldval == '' ) {
- $naioseop_options[$aioseop_opt_name] = '';
+ if ( $aioseop_oldval == '' ) {
+ $naioseop_options[ $aioseop_opt_name ] = '';
}
delete_option( $aioseop_opt_name );
}
@@ -81,375 +95,500 @@ function aioseop_mrt_mkarry() {
}
}
-if ( !function_exists( 'aioseop_activate_pl' ) ) {
+if ( ! function_exists( 'aioseop_activate_pl' ) ) {
+ /**
+ * @TODO see if this still gets used.
+ */
function aioseop_activate_pl() {
- if( $aioseop_options = get_option( 'aioseop_options' ) ) {
- $aioseop_options['aiosp_enabled'] = "0";
+ if ( $aioseop_options = get_option( 'aioseop_options' ) ) {
+ $aioseop_options['aiosp_enabled'] = '0';
- if( empty( $aioseop_options['aiosp_posttypecolumns'] ) ) {
- $aioseop_options['aiosp_posttypecolumns'] = array('post','page');
+ if ( empty( $aioseop_options['aiosp_posttypecolumns'] ) ) {
+ $aioseop_options['aiosp_posttypecolumns'] = array( 'post', 'page' );
}
- update_option('aioseop_options', $aioseop_options);
+ update_option( 'aioseop_options', $aioseop_options );
}
}
}
-if ( !function_exists( 'aioseop_get_version' ) ) {
+if ( ! function_exists( 'aioseop_get_version' ) ) {
+ /**
+ * Returns the version.
+ *
+ * I'm not sure why we have BOTH a function and a constant for this. -mrt
+ *
+ * @return string
+ */
function aioseop_get_version() {
return AIOSEOP_VERSION;
}
}
-if ( !function_exists( 'aioseop_option_isset' ) ) {
+if ( ! function_exists( 'aioseop_option_isset' ) ) {
+ /**
+ * Checks if an option isset.
+ *
+ * @param $option
+ *
+ * @return bool
+ */
function aioseop_option_isset( $option ) {
global $aioseop_options;
- return ( ( isset( $aioseop_options[$option] ) ) && $aioseop_options[$option] );
+
+ return ( isset( $aioseop_options[ $option ] ) && $aioseop_options[ $option ] );
}
}
-if ( !function_exists( 'aioseop_addmycolumns' ) ) {
+if ( ! function_exists( 'aioseop_addmycolumns' ) ) {
+ /**
+ * Adds posttype columns.
+ *
+ * @TODO We should see if this is still being used, and move it either way.
+ */
function aioseop_addmycolumns() {
global $aioseop_options, $pagenow;
$aiosp_posttypecolumns = Array();
- if ( !empty( $aioseop_options) && !empty( $aioseop_options['aiosp_posttypecolumns'] ) ) {
+ if ( ! empty( $aioseop_options ) && ! empty( $aioseop_options['aiosp_posttypecolumns'] ) ) {
$aiosp_posttypecolumns = $aioseop_options['aiosp_posttypecolumns'];
}
- if ( !empty( $pagenow ) && ( $pagenow == 'upload.php' ) )
+ if ( ! empty( $pagenow ) && ( $pagenow === 'upload.php' ) ) {
$post_type = 'attachment';
- elseif ( !isset( $_REQUEST['post_type'] ) )
+ } elseif ( ! isset( $_REQUEST['post_type'] ) ) {
$post_type = 'post';
- else
+ } else {
$post_type = $_REQUEST['post_type'];
+ }
- if( is_array( $aiosp_posttypecolumns ) && in_array( $post_type, $aiosp_posttypecolumns ) ) {
+ if ( is_array( $aiosp_posttypecolumns ) && in_array( $post_type, $aiosp_posttypecolumns ) ) {
add_action( 'admin_head', 'aioseop_admin_head' );
- if ( $post_type == 'page' )
+ if ( $post_type === 'page' ) {
add_filter( 'manage_pages_columns', 'aioseop_mrt_pcolumns' );
- elseif ( $post_type == 'attachment' )
+ } elseif ( $post_type === 'attachment' ) {
add_filter( 'manage_media_columns', 'aioseop_mrt_pcolumns' );
- else
+ } else {
add_filter( 'manage_posts_columns', 'aioseop_mrt_pcolumns' );
- if ( $post_type == 'attachment' )
+ }
+ if ( $post_type === 'attachment' ) {
add_action( 'manage_media_custom_column', 'aioseop_mrt_pccolumn', 10, 2 );
- elseif ( is_post_type_hierarchical( $post_type ) )
+ } elseif ( is_post_type_hierarchical( $post_type ) ) {
add_action( 'manage_pages_custom_column', 'aioseop_mrt_pccolumn', 10, 2 );
- else
+ } else {
add_action( 'manage_posts_custom_column', 'aioseop_mrt_pccolumn', 10, 2 );
+ }
}
}
}
-if ( !function_exists( 'aioseop_mrt_pcolumns' ) ) {
+if ( ! function_exists( 'aioseop_mrt_pcolumns' ) ) {
+
+ /**
+ * @param $aioseopc
+ *
+ * @return mixed
+ */
function aioseop_mrt_pcolumns( $aioseopc ) {
global $aioseop_options;
- $aioseopc['seotitle'] = __( 'SEO Title', 'all-in-one-seo-pack' );
- $aioseopc['seodesc'] = __( 'SEO Description', 'all-in-one-seo-pack' );
- if ( empty( $aioseop_options['aiosp_togglekeywords'] ) )
+ $aioseopc['seotitle'] = __( 'SEO Title', 'all-in-one-seo-pack' );
+ $aioseopc['seodesc'] = __( 'SEO Description', 'all-in-one-seo-pack' );
+ if ( empty( $aioseop_options['aiosp_togglekeywords'] ) ) {
$aioseopc['seokeywords'] = __( 'SEO Keywords', 'all-in-one-seo-pack' );
- return $aioseopc;
+ }
+
+ return $aioseopc;
}
}
-if ( !function_exists( 'aioseop_admin_head' ) ) {
+if ( ! function_exists( 'aioseop_admin_head' ) ) {
+
function aioseop_admin_head() {
echo '';
- ?>
ID;
- if ( !empty( $_GET["aioseop_reset_notices"] ) ) {
+ if ( ! empty( $_GET['aioseop_reset_notices'] ) ) {
delete_user_meta( $user_id, 'aioseop_ignore_notice' );
}
- if ( !empty($_GET['aioseop_ignore_notice'] ) ) {
+ if ( ! empty( $_GET['aioseop_ignore_notice'] ) ) {
add_user_meta( $user_id, 'aioseop_ignore_notice', $_GET['aioseop_ignore_notice'], false );
}
}
}
}
-if ( !function_exists( 'aioseop_output_notice' ) ) {
- function aioseop_output_notice( $message, $id = '', $class = "updated fade" ) {
+if ( ! function_exists( 'aioseop_output_notice' ) ) {
+
+ /**
+ * @param $message
+ * @param string $id
+ * @param string $class
+ *
+ * @return bool
+ */
+ function aioseop_output_notice( $message, $id = '', $class = 'updated fade' ) {
$class = 'aioseop_notice ' . $class;
- if ( !empty( $class ) ) $class = ' class="' . esc_attr( $class ) . '"';
- if ( !empty( $id ) ) $class .= ' id="' . esc_attr( $id ) . '"';
+ if ( ! empty( $class ) ) {
+ $class = ' class="' . esc_attr( $class ) . '"';
+ }
+ if ( ! empty( $id ) ) {
+ $class .= ' id="' . esc_attr( $id ) . '"';
+ }
$dismiss = ' ';
- echo "" . wp_kses_post( $message ) . "
";
+ echo "" . wp_kses_post( $message ) . '
';
+
return true;
}
}
-if ( !function_exists( 'aioseop_output_dismissable_notice' ) ) {
- function aioseop_output_dismissable_notice( $message, $id = "", $class = "updated fade") {
+if ( ! function_exists( 'aioseop_output_dismissable_notice' ) ) {
+
+ /**
+ * @param $message
+ * @param string $id
+ * @param string $class
+ *
+ * @return bool
+ */
+ function aioseop_output_dismissable_notice( $message, $id = '', $class = 'updated fade' ) {
global $current_user;
- if ( !empty( $current_user ) ) {
+ if ( ! empty( $current_user ) ) {
$user_id = $current_user->ID;
- $msgid = md5( $message );
- $ignore = get_user_meta( $user_id, 'aioseop_ignore_notice' );
- if ( !empty( $ignore ) && in_array( $msgid, $ignore ) ) return false;
+ $msgid = md5( $message );
+ $ignore = get_user_meta( $user_id, 'aioseop_ignore_notice' );
+ if ( ! empty( $ignore ) && in_array( $msgid, $ignore ) ) {
+ return false;
+ }
global $wp;
$qa = Array();
- wp_parse_str( $_SERVER["QUERY_STRING"], $qa );
+ wp_parse_str( $_SERVER['QUERY_STRING'], $qa );
$qa['aioseop_ignore_notice'] = $msgid;
- $url = '?' . build_query( $qa );
- $message = '' . $message . '
Dismiss
';
+ $url = '?' . build_query( $qa );
+ $message = '' . $message . '
Dismiss
';
}
+
return aioseop_output_notice( $message, $id, $class );
}
}
-if ( !function_exists( 'aioseop_ajax_save_meta' ) ) {
+if ( ! function_exists( 'aioseop_ajax_save_meta' ) ) {
+
function aioseop_ajax_save_meta() {
- if ( !empty( $_POST['_inline_edit'] ) && ( $_POST['_inline_edit'] != 'undefined' ) )
+ if ( ! empty( $_POST['_inline_edit'] ) && ( $_POST['_inline_edit'] !== 'undefined' ) ) {
check_ajax_referer( 'inlineeditnonce', '_inline_edit' );
- $post_id = intval( $_POST['post_id'] );
+ }
+ $post_id = intval( $_POST['post_id'] );
$new_meta = strip_tags( $_POST['new_meta'] );
- $target = $_POST['target_meta'];
+ $target = $_POST['target_meta'];
check_ajax_referer( 'aioseop_meta_' . $target . '_' . $post_id, '_nonce' );
$result = '';
- if ( in_array( $target, Array( 'title', 'description', 'keywords' ) ) && current_user_can( 'edit_post', $post_id ) ) {
+ if ( in_array( $target, Array(
+ 'title',
+ 'description',
+ 'keywords',
+ ) ) && current_user_can( 'edit_post', $post_id )
+ ) {
update_post_meta( $post_id, '_aioseop_' . $target, esc_attr( $new_meta ) );
$result = get_post_meta( $post_id, '_aioseop_' . $target, true );
} else {
die();
}
- if( $result != '' ):
+ if ( $result != '' ):
$label = " " . $result . ' ';
else:
$label = "" . __( 'No', 'all-in-one-seo-pack' ) . ' ' . $target . ' ';
endif;
- $nonce = wp_create_nonce( "aioseop_meta_{$target}_{$post_id}" );
+ $nonce = wp_create_nonce( "aioseop_meta_{$target}_{$post_id}" );
$output = ''
- . ' ' . $label;
- die( "jQuery('div#aioseop_" . $target . "_" . $post_id . "').fadeOut('fast', function() { var my_label = " . json_encode( $output ) . ";
- jQuery('div#aioseop_" . $target . "_" . $post_id . "').html(my_label).fadeIn('fast');
+ . 'onclick=\'aioseop_ajax_edit_meta_form(' . $post_id . ', "' . $target . '", "' . $nonce . '");return false;\' title="' . __( 'Edit' ) . '">'
+ . ' ' . $label;
+ die( "jQuery('div#aioseop_" . $target . '_' . $post_id . "').fadeOut('fast', function() { var my_label = " . json_encode( $output ) . ";
+ jQuery('div#aioseop_" . $target . '_' . $post_id . "').html(my_label).fadeIn('fast');
});" );
}
}
-if ( !function_exists( 'aioseop_ajax_init' ) ) {
+if ( ! function_exists( 'aioseop_ajax_init' ) ) {
+
function aioseop_ajax_init() {
- if ( !empty( $_POST ) && !empty( $_POST['settings'] ) && (!empty( $_POST['nonce-aioseop'])||(!empty( $_POST['nonce-aioseop-edit']))) && !empty( $_POST['options'] ) ) {
- $_POST = stripslashes_deep( $_POST );
+ if ( ! empty( $_POST ) && ! empty( $_POST['settings'] ) && ( ! empty( $_POST['nonce-aioseop'] ) || ( ! empty( $_POST['nonce-aioseop-edit'] ) ) ) && ! empty( $_POST['options'] ) ) {
+ $_POST = stripslashes_deep( $_POST );
$settings = esc_attr( $_POST['settings'] );
- if ( ! defined( 'AIOSEOP_AJAX_MSG_TMPL' ) )
- define( 'AIOSEOP_AJAX_MSG_TMPL', "jQuery('div#aiosp_$settings').fadeOut('fast', function(){jQuery('div#aiosp_$settings').html('%s').fadeIn('fast');});" );
+ if ( ! defined( 'AIOSEOP_AJAX_MSG_TMPL' ) ) {
+ define( 'AIOSEOP_AJAX_MSG_TMPL', "jQuery('div#aiosp_$settings').fadeOut('fast', function(){jQuery('div#aiosp_$settings').html('%s').fadeIn('fast');});" );
+ }
- if ( !wp_verify_nonce($_POST['nonce-aioseop'], 'aioseop-nonce') )
- die( sprintf( AIOSEOP_AJAX_MSG_TMPL, __( "Unauthorized access; try reloading the page.", 'all-in-one-seo-pack' ) ) );
+ if ( ! wp_verify_nonce( $_POST['nonce-aioseop'], 'aioseop-nonce' ) ) {
+ die( sprintf( AIOSEOP_AJAX_MSG_TMPL, __( 'Unauthorized access; try reloading the page.', 'all-in-one-seo-pack' ) ) );
+ }
} else {
- die(0);
+ die( 0 );
}
}
}
- function aioseop_embed_handler_html( $return, $url, $attr ) {
- return AIO_ProGeneral::aioseop_embed_handler_html();
- }
+/**
+ * @param $return
+ * @param $url
+ * @param $attr
+ *
+ * @return mixed
+ */
+function aioseop_embed_handler_html( $return, $url, $attr ) {
+ return AIO_ProGeneral::aioseop_embed_handler_html();
+}
- function aioseop_ajax_update_oembed() {
- AIO_ProGeneral::aioseop_ajax_update_oembed();
- }
+function aioseop_ajax_update_oembed() {
+ AIO_ProGeneral::aioseop_ajax_update_oembed();
+}
+
+if ( ! function_exists( 'aioseop_ajax_save_url' ) ) {
-if ( !function_exists( 'aioseop_ajax_save_url' ) ) {
function aioseop_ajax_save_url() {
aioseop_ajax_init();
$options = Array();
parse_str( $_POST['options'], $options );
- foreach( $options as $k => $v ) $_POST[$k] = $v;
+ foreach ( $options as $k => $v ) {
+ $_POST[ $k ] = $v;
+ }
$_POST['action'] = 'aiosp_update_module';
global $aiosp, $aioseop_modules;
aioseop_load_modules();
$aiosp->admin_menu();
- if ( !empty( $_POST['settings'] ) && ( $_POST['settings'] == 'video_sitemap_addl_pages' ) ) {
- $module = $aioseop_modules->return_module( "All_in_One_SEO_Pack_Video_Sitemap" );
- } elseif ( !empty( $_POST['settings'] ) && ( $_POST['settings'] == 'news_sitemap_addl_pages' ) ) {
- $module = $aioseop_modules->return_module( "All_in_One_SEO_Pack_News_Sitemap" );
+ if ( ! empty( $_POST['settings'] ) && ( $_POST['settings'] === 'video_sitemap_addl_pages' ) ) {
+ $module = $aioseop_modules->return_module( 'All_in_One_SEO_Pack_Video_Sitemap' );
+ } elseif ( ! empty( $_POST['settings'] ) && ( $_POST['settings'] === 'news_sitemap_addl_pages' ) ) {
+ $module = $aioseop_modules->return_module( 'All_in_One_SEO_Pack_News_Sitemap' );
} else {
- $module = $aioseop_modules->return_module( "All_in_One_SEO_Pack_Sitemap" );
+ $module = $aioseop_modules->return_module( 'All_in_One_SEO_Pack_Sitemap' );
}
$_POST['location'] = null;
- $_POST['Submit'] = 'ajax';
+ $_POST['Submit'] = 'ajax';
$module->add_page_hooks();
$prefix = $module->get_prefix();
- $_POST = $module->get_current_options( $_POST, null );
+ $_POST = $module->get_current_options( $_POST, null );
$module->handle_settings_updates( null );
$options = $module->get_current_options( Array(), null );
- $output = $module->display_custom_options( '', Array( 'name' => $prefix . 'addl_pages', 'type' => 'custom', 'save' => true, 'value' => $options[$prefix . 'addl_pages'], 'attr' => '' ) );
- $output = str_replace( "'", "\'", $output );
- $output = str_replace( "\n", '\n', $output );
+ $output = $module->display_custom_options( '', Array(
+ 'name' => $prefix . 'addl_pages',
+ 'type' => 'custom',
+ 'save' => true,
+ 'value' => $options[ $prefix . 'addl_pages' ],
+ 'attr' => '',
+ ) );
+ $output = str_replace( "'", "\'", $output );
+ $output = str_replace( "\n", '\n', $output );
die( sprintf( AIOSEOP_AJAX_MSG_TMPL, $output ) );
}
}
-if ( !function_exists( 'aioseop_ajax_delete_url' ) ) {
+if ( ! function_exists( 'aioseop_ajax_delete_url' ) ) {
+
function aioseop_ajax_delete_url() {
aioseop_ajax_init();
- $options = Array();
- $options = esc_attr( $_POST['options'] );
+ $options = Array();
+ $options = esc_attr( $_POST['options'] );
$_POST['action'] = 'aiosp_update_module';
global $aiosp, $aioseop_modules;
aioseop_load_modules();
$aiosp->admin_menu();
- $module = $aioseop_modules->return_module( "All_in_One_SEO_Pack_Sitemap" );
+ $module = $aioseop_modules->return_module( 'All_in_One_SEO_Pack_Sitemap' );
$_POST['location'] = null;
- $_POST['Submit'] = 'ajax';
+ $_POST['Submit'] = 'ajax';
$module->add_page_hooks();
- $_POST = (Array)$module->get_current_options( $_POST, null );
- if ( !empty( $_POST['aiosp_sitemap_addl_pages'] ) && ( is_object( $_POST['aiosp_sitemap_addl_pages'] ) ) )
- $_POST['aiosp_sitemap_addl_pages'] = (Array)$_POST['aiosp_sitemap_addl_pages'];
- if ( !empty( $_POST['aiosp_sitemap_addl_pages'] ) && ( !empty( $_POST['aiosp_sitemap_addl_pages'][ $options ] ) ) ) {
+ $_POST = (Array) $module->get_current_options( $_POST, null );
+ if ( ! empty( $_POST['aiosp_sitemap_addl_pages'] ) && is_object( $_POST['aiosp_sitemap_addl_pages'] ) ) {
+ $_POST['aiosp_sitemap_addl_pages'] = (Array) $_POST['aiosp_sitemap_addl_pages'];
+ }
+ if ( ! empty( $_POST['aiosp_sitemap_addl_pages'] ) && ( ! empty( $_POST['aiosp_sitemap_addl_pages'][ $options ] ) ) ) {
unset( $_POST['aiosp_sitemap_addl_pages'][ $options ] );
- if ( empty( $_POST['aiosp_sitemap_addl_pages'] ) )
+ if ( empty( $_POST['aiosp_sitemap_addl_pages'] ) ) {
$_POST['aiosp_sitemap_addl_pages'] = '';
- else
+ } else {
$_POST['aiosp_sitemap_addl_pages'] = json_encode( $_POST['aiosp_sitemap_addl_pages'] );
+ }
$module->handle_settings_updates( null );
$options = $module->get_current_options( Array(), null );
- $output = $module->display_custom_options( '', Array( 'name' => 'aiosp_sitemap_addl_pages', 'type' => 'custom', 'save' => true, 'value' => $options['aiosp_sitemap_addl_pages'], 'attr' => '' ) );
- $output = str_replace( "'", "\'", $output );
- $output = str_replace( "\n", '\n', $output );
+ $output = $module->display_custom_options( '', Array(
+ 'name' => 'aiosp_sitemap_addl_pages',
+ 'type' => 'custom',
+ 'save' => true,
+ 'value' => $options['aiosp_sitemap_addl_pages'],
+ 'attr' => '',
+ ) );
+ $output = str_replace( "'", "\'", $output );
+ $output = str_replace( "\n", '\n', $output );
} else {
- $output = sprintf( __( "Row %s not found; no rows were deleted.", 'all-in-one-seo-pack' ), esc_attr( $options ) );
+ $output = sprintf( __( 'Row %s not found; no rows were deleted.', 'all-in-one-seo-pack' ), esc_attr( $options ) );
}
die( sprintf( AIOSEOP_AJAX_MSG_TMPL, $output ) );
}
}
-if ( !function_exists( 'aioseop_ajax_scan_header' ) ) {
+if ( ! function_exists( 'aioseop_ajax_scan_header' ) ) {
function aioseop_ajax_scan_header() {
- $_POST["options"] = "foo";
+ $_POST['options'] = 'foo';
aioseop_ajax_init();
$options = Array();
parse_str( $_POST['options'], $options );
- foreach( $options as $k => $v ) $_POST[$k] = $v;
- $_POST['action'] = 'aiosp_update_module';
+ foreach ( $options as $k => $v ) {
+ $_POST[ $k ] = $v;
+ }
+ $_POST['action'] = 'aiosp_update_module';
$_POST['location'] = null;
- $_POST['Submit'] = 'ajax';
+ $_POST['Submit'] = 'ajax';
ob_start();
- do_action('wp');
+ do_action( 'wp' );
global $aioseop_modules;
- $module = $aioseop_modules->return_module( "All_in_One_SEO_Pack_Opengraph" );
+ $module = $aioseop_modules->return_module( 'All_in_One_SEO_Pack_Opengraph' );
wp_head();
$output = ob_get_clean();
global $aiosp;
- $output = $aiosp->html_string_to_array( $output );
- $meta = '';
+ $output = $aiosp->html_string_to_array( $output );
+ $meta = '';
$metatags = Array(
- 'facebook' => Array( 'name' => 'property', 'value' => 'content' ),
- 'twitter' => Array( 'name' => 'name', 'value' => 'value' ),
- 'google+' => Array( 'name' => 'itemprop', 'value' => 'content' )
+ 'facebook' => Array( 'name' => 'property', 'value' => 'content' ),
+ 'twitter' => Array( 'name' => 'name', 'value' => 'value' ),
+ 'google+' => Array( 'name' => 'itemprop', 'value' => 'content' ),
);
$metadata = Array(
- 'facebook' => Array(
- 'title' => 'og:title',
- 'type' => 'og:type',
- 'url' => 'og:url',
- 'thumbnail' => 'og:image',
- 'sitename' => 'og:site_name',
- 'key' => 'fb:admins',
- 'description' => 'og:description'
- ),
- 'google+' => Array(
- 'thumbnail' => 'image',
- 'title' => 'name',
- 'description' => 'description'
- ),
- 'twitter' => Array(
- 'card' => 'twitter:card',
- 'url' => 'twitter:url',
- 'title' => 'twitter:title',
- 'description' => 'twitter:description',
- 'thumbnail' => 'twitter:image'
- )
+ 'facebook' => Array(
+ 'title' => 'og:title',
+ 'type' => 'og:type',
+ 'url' => 'og:url',
+ 'thumbnail' => 'og:image',
+ 'sitename' => 'og:site_name',
+ 'key' => 'fb:admins',
+ 'description' => 'og:description',
+ ),
+ 'google+' => Array(
+ 'thumbnail' => 'image',
+ 'title' => 'name',
+ 'description' => 'description',
+ ),
+ 'twitter' => Array(
+ 'card' => 'twitter:card',
+ 'url' => 'twitter:url',
+ 'title' => 'twitter:title',
+ 'description' => 'twitter:description',
+ 'thumbnail' => 'twitter:image',
+ ),
);
- if ( !empty( $output ) && !empty( $output['head'] ) && !empty( $output['head']['meta'] ) )
- foreach( $output['head']['meta'] as $v )
- if ( !empty( $v['@attributes'] ) ) {
+ if ( ! empty( $output ) && ! empty( $output['head'] ) && ! empty( $output['head']['meta'] ) ) {
+ foreach ( $output['head']['meta'] as $v ) {
+ if ( ! empty( $v['@attributes'] ) ) {
$m = $v['@attributes'];
- foreach( $metatags as $type => $tags )
- if ( !empty( $m[$tags['name']] ) && !empty( $m[$tags['value']] ) )
- foreach( $metadata[$type] as $tk => $tv )
- if ( $m[$tags['name']] == $tv )
- $meta .= "" . sprintf( __( 'Duplicate %s Meta'), ucwords( $type ) ) . " " . ucwords( $tk ) . " {$m[$tags['name']]} {$m[$tags['value']]} \n";
+ foreach ( $metatags as $type => $tags ) {
+ if ( ! empty( $m[ $tags['name'] ] ) && ! empty( $m[ $tags['value'] ] ) ) {
+ foreach ( $metadata[ $type ] as $tk => $tv ) {
+ if ( $m[ $tags['name'] ] == $tv ) {
+ $meta .= "" . sprintf( __( 'Duplicate %s Meta' ), ucwords( $type ) ) . ' ' . ucwords( $tk ) . " {$m[$tags['name']]} {$m[$tags['value']]} \n";
+ }
+ }
+ }
+ }
}
- if ( empty( $meta ) ) $meta = '' . __( 'No duplicate meta tags found.', 'all-in-one-seo-pack' ) . ' ';
- else {
- $meta = "";
+ }
+ }
+ if ( empty( $meta ) ) {
+ $meta = '' . __( 'No duplicate meta tags found.', 'all-in-one-seo-pack' ) . ' ';
+ } else {
+ $meta = "';
$meta .= "
";
+ $meta .= '' . __( 'Please refer to the document for each tool for help in using these to debug your social meta.', 'all-in-one-seo-pack' ) . '';
}
$output = $meta;
$output = str_replace( "'", "\'", $output );
@@ -458,188 +597,273 @@ function aioseop_ajax_scan_header() {
}
}
-if (!function_exists('aioseop_ajax_save_settings')) {
+if ( ! function_exists( 'aioseop_ajax_save_settings' ) ) {
+
function aioseop_ajax_save_settings() {
aioseop_ajax_init();
$options = Array();
parse_str( $_POST['options'], $options );
- $_POST = $options;
+ $_POST = $options;
$_POST['action'] = 'aiosp_update_module';
global $aiosp, $aioseop_modules;
aioseop_load_modules();
$aiosp->admin_menu();
$module = $aioseop_modules->return_module( $_POST['module'] );
unset( $_POST['module'] );
- if ( empty( $_POST['location'] ) ) $_POST['location'] = null;
+ if ( empty( $_POST['location'] ) ) {
+ $_POST['location'] = null;
+ }
$_POST['Submit'] = 'ajax';
$module->add_page_hooks();
$output = $module->handle_settings_updates( $_POST['location'] );
- if( AIOSEOPPRO ){
- $output = '
';
- }else{
- $output = '';
- }
+ if ( AIOSEOPPRO ) {
+ $output = '';
+ } else {
+ $output = '';
+ }
die( sprintf( AIOSEOP_AJAX_MSG_TMPL, $output ) );
}
}
-if (!function_exists('aioseop_ajax_get_menu_links')) {
+if ( ! function_exists( 'aioseop_ajax_get_menu_links' ) ) {
+
function aioseop_ajax_get_menu_links() {
aioseop_ajax_init();
$options = Array();
parse_str( $_POST['options'], $options );
- $_POST = $options;
+ $_POST = $options;
$_POST['action'] = 'aiosp_update_module';
global $aiosp, $aioseop_modules;
aioseop_load_modules();
$aiosp->admin_menu();
- if ( empty( $_POST['location'] ) ) $_POST['location'] = null;
+ if ( empty( $_POST['location'] ) ) {
+ $_POST['location'] = null;
+ }
$_POST['Submit'] = 'ajax';
- $modlist = $aioseop_modules->get_loaded_module_list();
- $links = Array();
- $link_list = Array();
- $link = $aiosp->get_admin_links();
- if ( !empty( $link ) )
- foreach( $link as $l )
- if ( !empty( $l ) ) {
- if ( empty( $link_list[$l['order']] ) ) $link_list[$l['order']] = Array();
- $link_list[$l['order']][$l['title']] = $l['href'];
+ $modlist = $aioseop_modules->get_loaded_module_list();
+ $links = Array();
+ $link_list = Array();
+ $link = $aiosp->get_admin_links();
+ if ( ! empty( $link ) ) {
+ foreach ( $link as $l ) {
+ if ( ! empty( $l ) ) {
+ if ( empty( $link_list[ $l['order'] ] ) ) {
+ $link_list[ $l['order'] ] = Array();
+ }
+ $link_list[ $l['order'] ][ $l['title'] ] = $l['href'];
}
- if ( !empty( $modlist ) )
- foreach( $modlist as $k => $v ) {
+ }
+ }
+ if ( ! empty( $modlist ) ) {
+ foreach ( $modlist as $k => $v ) {
$mod = $aioseop_modules->return_module( $v );
if ( is_object( $mod ) ) {
$mod->add_page_hooks();
$link = $mod->get_admin_links();
- foreach( $link as $l )
- if ( !empty( $l ) ) {
- if ( empty( $link_list[$l['order']] ) ) $link_list[$l['order']] = Array();
- $link_list[$l['order']][$l['title']] = $l['href'];
+ foreach ( $link as $l ) {
+ if ( ! empty( $l ) ) {
+ if ( empty( $link_list[ $l['order'] ] ) ) {
+ $link_list[ $l['order'] ] = Array();
+ }
+ $link_list[ $l['order'] ][ $l['title'] ] = $l['href'];
}
+ }
}
}
- if ( !empty( $link_list ) ) {
+ }
+ if ( ! empty( $link_list ) ) {
ksort( $link_list );
- foreach( $link_list as $ll )
- foreach( $ll as $k => $v )
- $links[$k] = $v;
- }
- $output = "";
- if ( !empty( $links ) )
- foreach( $links as $k => $v ) {
- if ( $k == "Feature Manager" )
+ foreach ( $link_list as $ll ) {
+ foreach ( $ll as $k => $v ) {
+ $links[ $k ] = $v;
+ }
+ }
+ }
+ $output = '';
+ if ( ! empty( $links ) ) {
+ foreach ( $links as $k => $v ) {
+ if ( $k === 'Feature Manager' ) {
$current = ' class="current"';
- else
+ } else {
$current = '';
- $output .= "" . esc_attr( $k ) . " ";
+ }
+ $output .= "" . esc_attr( $k ) . ' ';
}
- $output .= " ";
- die( sprintf( "jQuery('{$_POST['target']}').fadeOut('fast', function(){jQuery('{$_POST['target']}').html('%s').fadeIn('fast');});", addslashes( $output ) ));
+ }
+ $output .= ' ';
+ die( sprintf( "jQuery('{$_POST['target']}').fadeOut('fast', function(){jQuery('{$_POST['target']}').html('%s').fadeIn('fast');});", addslashes( $output ) ) );
}
}
-if ( !function_exists( 'aioseop_mrt_pccolumn' ) ) {
- function aioseop_mrt_pccolumn($aioseopcn, $aioseoppi) {
- $id = $aioseoppi;
+if ( ! function_exists( 'aioseop_mrt_pccolumn' ) ) {
+
+ /**
+ * @param $aioseopcn
+ * @param $aioseoppi
+ */
+ function aioseop_mrt_pccolumn( $aioseopcn, $aioseoppi ) {
+ $id = $aioseoppi;
$target = null;
- if( $aioseopcn == 'seotitle' ) $target = 'title';
- if( $aioseopcn == 'seokeywords' ) $target = 'keywords';
- if( $aioseopcn == 'seodesc' ) $target = 'description';
- if ( !$target ) return;
- if( current_user_can( 'edit_post', $id ) ) { ?>
+ if ( $aioseopcn === 'seotitle' ) {
+ $target = 'title';
+ }
+ if ( $aioseopcn === 'seokeywords' ) {
+ $target = 'keywords';
+ }
+ if ( $aioseopcn === 'seodesc' ) {
+ $target = 'description';
+ }
+ if ( ! $target ) {
+ return;
+ }
+ if ( current_user_can( 'edit_post', $id ) ) { ?>