Import Settings into WordPress SEO by Yoast - Version 1.0.3

Version Description

  • Add support for Yoast SEO Premium
  • Add 'Auto Calculate SEO Score'
Download this release

Release Info

Developer WPAllImport
Plugin Icon 128x128 Import Settings into WordPress SEO by Yoast
Version 1.0.3
Comparing to
See all releases

Code changes from version 1.0.2 to 1.0.3

Files changed (3) hide show
  1. rapid-addon.php +10 -3
  2. readme.txt +6 -2
  3. yoast-addon.php +19 -11
rapid-addon.php CHANGED
@@ -59,6 +59,10 @@ if (!class_exists('RapidAddon')) {
59
 
60
  function is_active_addon($post_type = null) {
61
 
 
 
 
 
62
  $addon_active = false;
63
 
64
  if ($post_type !== null) {
@@ -133,6 +137,8 @@ if (!class_exists('RapidAddon')) {
133
  }
134
 
135
  function parse($data) {
 
 
136
 
137
  $parsedData = $this->helper_parse($data, $this->options_array());
138
  return $parsedData;
@@ -863,8 +869,8 @@ if (!class_exists('RapidAddon')) {
863
 
864
  $tmp_files = array();
865
 
866
- foreach ($options[$this->slug] as $option_name => $option_value) {
867
- if ( isset($import->options[$this->slug][$option_name]) and $import->options[$this->slug][$option_name] != '') {
868
  if ($import->options[$this->slug][$option_name] == "xpath") {
869
  if ($import->options[$this->slug]['xpaths'][$option_name] == ""){
870
  $count and $this->data[$option_name] = array_fill(0, $count, "");
@@ -872,7 +878,8 @@ if (!class_exists('RapidAddon')) {
872
  $data[$option_name] = XmlImportParser::factory($xml, $cxpath, $import->options[$this->slug]['xpaths'][$option_name], $file)->parse($records);
873
  $tmp_files[] = $file;
874
  }
875
- } else {
 
876
  $data[$option_name] = XmlImportParser::factory($xml, $cxpath, $import->options[$this->slug][$option_name], $file)->parse();
877
  $tmp_files[] = $file;
878
  }
59
 
60
  function is_active_addon($post_type = null) {
61
 
62
+ if ( ! is_plugin_active('wp-all-import-pro/wp-all-import-pro.php') and ! is_plugin_active('wp-all-import/plugin.php') ){
63
+ return false;
64
+ }
65
+
66
  $addon_active = false;
67
 
68
  if ($post_type !== null) {
137
  }
138
 
139
  function parse($data) {
140
+
141
+ if ( ! $this->is_active_addon($data['import']->options['custom_type'])) return false;
142
 
143
  $parsedData = $this->helper_parse($data, $this->options_array());
144
  return $parsedData;
869
 
870
  $tmp_files = array();
871
 
872
+ foreach ($options[$this->slug] as $option_name => $option_value) {
873
+ if ( isset($import->options[$this->slug][$option_name]) and $import->options[$this->slug][$option_name] != '') {
874
  if ($import->options[$this->slug][$option_name] == "xpath") {
875
  if ($import->options[$this->slug]['xpaths'][$option_name] == ""){
876
  $count and $this->data[$option_name] = array_fill(0, $count, "");
878
  $data[$option_name] = XmlImportParser::factory($xml, $cxpath, $import->options[$this->slug]['xpaths'][$option_name], $file)->parse($records);
879
  $tmp_files[] = $file;
880
  }
881
+ }
882
+ else {
883
  $data[$option_name] = XmlImportParser::factory($xml, $cxpath, $import->options[$this->slug][$option_name], $file)->parse();
884
  $tmp_files[] = $file;
885
  }
readme.txt CHANGED
@@ -4,8 +4,8 @@ Tags: seo, import seo, search engine optimization, import search engine optimiza
4
  License: GPLv2 or later
5
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
6
  Requires at least: 4.1.0
7
- Tested up to: 4.3
8
- Stable tag: 1.0.2
9
 
10
  Easily import SEO settings from any XML or CSV file to Yoast WordPress SEO with the Yoast WordPress SEO Add-On for WP All Import.
11
 
@@ -66,6 +66,10 @@ The Yoast WordPress SEO Add-On will appear in the Step 3 of WP All Import.
66
 
67
  == Changelog ==
68
 
 
 
 
 
69
  = 1.0.2 =
70
  * Update WP All Import add-on API
71
 
4
  License: GPLv2 or later
5
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
6
  Requires at least: 4.1.0
7
+ Tested up to: 4.3.1
8
+ Stable tag: 1.0.3
9
 
10
  Easily import SEO settings from any XML or CSV file to Yoast WordPress SEO with the Yoast WordPress SEO Add-On for WP All Import.
11
 
66
 
67
  == Changelog ==
68
 
69
+ = 1.0.3 =
70
+ * Add support for Yoast SEO Premium
71
+ * Add 'Auto Calculate SEO Score'
72
+
73
  = 1.0.2 =
74
  * Update WP All Import add-on API
75
 
yoast-addon.php CHANGED
@@ -4,7 +4,7 @@
4
  Plugin Name: WP All Import - Yoast WordPress SEO Add-On
5
  Plugin URI: http://www.wpallimport.com/
6
  Description: Import data into Yoast WordPress SEO with WP All Import.
7
- Version: 1.0.2
8
  Author: Soflyy
9
  */
10
 
@@ -99,16 +99,19 @@ $yoast_addon->add_options(
99
 
100
  $yoast_addon->set_import_function( 'yoast_seo_addon_import' );
101
 
102
- $yoast_addon->admin_notice(
103
- 'The Yoast WordPress SEO Add-On requires WP All Import <a href="http://www.wpallimport.com/order-now/?utm_source=free-plugin&utm_medium=dot-org&utm_campaign=yoast" target="_blank">Pro</a> or <a href="http://wordpress.org/plugins/wp-all-import" target="_blank">Free</a>, and the <a href="https://yoast.com/wordpress/plugins/seo/">Yoast WordPress SEO</a> plugin.',
104
- array(
105
- "plugins" => array( "wordpress-seo/wp-seo.php" )
106
- ) );
107
 
108
- $yoast_addon->run(
109
- array(
110
- "plugins" => array( "wordpress-seo/wp-seo.php" )
111
- ) );
 
 
 
 
 
 
 
112
 
113
  function yoast_seo_addon_import( $post_id, $data, $import_options ) {
114
 
@@ -165,5 +168,10 @@ function yoast_seo_addon_import( $post_id, $data, $import_options ) {
165
  }
166
  }
167
  }
168
-
 
 
 
 
 
169
  }
4
  Plugin Name: WP All Import - Yoast WordPress SEO Add-On
5
  Plugin URI: http://www.wpallimport.com/
6
  Description: Import data into Yoast WordPress SEO with WP All Import.
7
+ Version: 1.0.3
8
  Author: Soflyy
9
  */
10
 
99
 
100
  $yoast_addon->set_import_function( 'yoast_seo_addon_import' );
101
 
102
+ if ( !is_plugin_active( "wordpress-seo/wp-seo.php" ) && !is_plugin_active( "wordpress-seo-premium/wp-seo-premium.php" ) ) {
 
 
 
 
103
 
104
+ $yoast_addon->admin_notice(
105
+ 'The Yoast WordPress SEO Add-On requires WP All Import <a href="http://www.wpallimport.com/order-now/?utm_source=free-plugin&utm_medium=dot-org&utm_campaign=yoast" target="_blank">Pro</a> or <a href="http://wordpress.org/plugins/wp-all-import" target="_blank">Free</a>, and the <a href="https://yoast.com/wordpress/plugins/seo/">Yoast WordPress SEO</a> plugin.'
106
+ );
107
+
108
+ }
109
+
110
+ if ( is_plugin_active( "wordpress-seo/wp-seo.php" ) || is_plugin_active( "wordpress-seo-premium/wp-seo-premium.php" ) ) {
111
+
112
+ $yoast_addon->run();
113
+
114
+ }
115
 
116
  function yoast_seo_addon_import( $post_id, $data, $import_options ) {
117
 
168
  }
169
  }
170
  }
171
+ // calculate _yoast_wpseo_linkdex
172
+ if (class_exists('WPSEO_Metabox'))
173
+ {
174
+ $seo = new WPSEO_Metabox();
175
+ $seo->calculate_results( get_post($post_id) );
176
+ }
177
  }