Ocean Demo Import - Version 1.0.3.1

Version Description

  • Fixed: Preview demos url.
Download this release

Release Info

Developer oceanwp
Plugin Icon 128x128 Ocean Demo Import
Version 1.0.3.1
Comparing to
See all releases

Code changes from version 1.0.3 to 1.0.3.1

includes/importer.php CHANGED
@@ -19,7 +19,19 @@ class ODI_Importer {
19
  * @since 1.0.0
20
  */
21
  public function __construct() {
 
 
 
 
 
 
 
 
 
 
22
  add_action( 'admin_init', array( $this, 'init' ) );
 
 
23
  add_filter( 'upload_mimes', array( $this, 'allow_xml_uploads' ) );
24
  }
25
 
@@ -176,7 +188,6 @@ class ODI_Importer {
176
  'categories' => array( 'Business' ),
177
  'xml_file' => $url . 'stylish/sample-data.xml',
178
  'theme_settings' => $url . 'stylish/oceanwp-export.json',
179
- 'widgets_file' => $url . 'stylish/widgets.wie',
180
  'home_title' => 'Home',
181
  'blog_title' => 'Blog',
182
  'posts_to_show' => '12',
@@ -196,11 +207,11 @@ class ODI_Importer {
196
  'is_shop' => false,
197
  ),
198
 
199
- 'underwear' => array(
200
  'categories' => array( 'eCommerce' ),
201
- 'xml_file' => $url . 'underwear/sample-data.xml',
202
- 'theme_settings' => $url . 'underwear/oceanwp-export.json',
203
- 'widgets_file' => $url . 'underwear/widgets.wie',
204
  'home_title' => 'Home',
205
  'blog_title' => 'Blog',
206
  'posts_to_show' => '3',
19
  * @since 1.0.0
20
  */
21
  public function __construct() {
22
+
23
+ // Return if not in admin
24
+ if ( ! is_admin() || is_customize_preview() ) {
25
+ return;
26
+ }
27
+
28
+ // Disable Woo Wizard
29
+ add_filter( 'woocommerce_enable_setup_wizard', false );
30
+
31
+ // Start things
32
  add_action( 'admin_init', array( $this, 'init' ) );
33
+
34
+ // Allows xml uploads
35
  add_filter( 'upload_mimes', array( $this, 'allow_xml_uploads' ) );
36
  }
37
 
188
  'categories' => array( 'Business' ),
189
  'xml_file' => $url . 'stylish/sample-data.xml',
190
  'theme_settings' => $url . 'stylish/oceanwp-export.json',
 
191
  'home_title' => 'Home',
192
  'blog_title' => 'Blog',
193
  'posts_to_show' => '12',
207
  'is_shop' => false,
208
  ),
209
 
210
+ 'lingerie' => array(
211
  'categories' => array( 'eCommerce' ),
212
+ 'xml_file' => $url . 'lingerie/sample-data.xml',
213
+ 'theme_settings' => $url . 'lingerie/oceanwp-export.json',
214
+ 'widgets_file' => $url . 'lingerie/widgets.wie',
215
  'home_title' => 'Home',
216
  'blog_title' => 'Blog',
217
  'posts_to_show' => '3',
includes/install-demos.php CHANGED
@@ -15,7 +15,7 @@ class ODI_Install_Demos {
15
  * Start things up
16
  */
17
  public function __construct() {
18
- add_action( 'admin_menu', array( $this, 'add_page' ), 50 );
19
  }
20
 
21
  /**
@@ -114,10 +114,7 @@ class ODI_Install_Demos {
114
 
115
  <?php
116
  // Loop through all demos
117
- foreach ( $demos as $demo => $key ) {
118
-
119
- // Preview url
120
- $preview = $ocean_url . $demo; ?>
121
 
122
  <div class="theme-wrap" data-categories="<?php echo esc_attr( ODI_Importer::get_item_categories( $key ) ); ?>" data-name="<?php echo esc_attr( strtolower( $demo ) ); ?>">
123
 
@@ -139,7 +136,7 @@ class ODI_Install_Demos {
139
 
140
  <div class="theme-actions">
141
  <a class="button button-secondary odi-install" data-demo-id="<?php echo esc_attr( $demo ); ?>" href="#"><?php _e( 'Install', 'ocean-demo-import' ); ?></a>
142
- <a class="button button-primary" href="<?php echo esc_url( $preview ); ?>" target="_blank"><?php _e( 'Preview', 'ocean-demo-import' ); ?></a>
143
  </div>
144
 
145
  </div>
15
  * Start things up
16
  */
17
  public function __construct() {
18
+ add_action( 'admin_menu', array( $this, 'add_page' ), 11 );
19
  }
20
 
21
  /**
114
 
115
  <?php
116
  // Loop through all demos
117
+ foreach ( $demos as $demo => $key ) { ?>
 
 
 
118
 
119
  <div class="theme-wrap" data-categories="<?php echo esc_attr( ODI_Importer::get_item_categories( $key ) ); ?>" data-name="<?php echo esc_attr( strtolower( $demo ) ); ?>">
120
 
136
 
137
  <div class="theme-actions">
138
  <a class="button button-secondary odi-install" data-demo-id="<?php echo esc_attr( $demo ); ?>" href="#"><?php _e( 'Install', 'ocean-demo-import' ); ?></a>
139
+ <a class="button button-primary" href="https://<?php echo esc_attr( $demo ); ?>.oceanwp.org/" target="_blank"><?php _e( 'Preview', 'ocean-demo-import' ); ?></a>
140
  </div>
141
 
142
  </div>
ocean-demo-import.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: Ocean Demo Import
4
  * Plugin URI: https://oceanwp.org/extension/ocean-demo-import/
5
  * Description: Import the OceanWP demo content, widgets and customizer settings with one click.
6
- * Version: 1.0.3
7
  * Author: OceanWP
8
  * Author URI: https://oceanwp.org/
9
  * Requires at least: 4.0.0
@@ -87,7 +87,7 @@ final class Ocean_Demo_Import {
87
  $this->token = 'ocean-demo-import';
88
  $this->plugin_url = plugin_dir_url( __FILE__ );
89
  $this->plugin_path = plugin_dir_path( __FILE__ );
90
- $this->version = '1.0.3';
91
 
92
  define( 'ODI_PATH', $this->plugin_path );
93
  define( 'ODI_URL', $this->plugin_url );
@@ -174,7 +174,8 @@ final class Ocean_Demo_Import {
174
  $theme = wp_get_theme();
175
 
176
  if ( 'OceanWP' == $theme->name || 'oceanwp' == $theme->template ) {
177
- if ( is_admin() ) {
 
178
  require_once( ODI_PATH .'/includes/class/class-helpers.php' );
179
  require_once( ODI_PATH .'/includes/importer.php' );
180
  require_once( ODI_PATH .'/includes/install-demos.php' );
3
  * Plugin Name: Ocean Demo Import
4
  * Plugin URI: https://oceanwp.org/extension/ocean-demo-import/
5
  * Description: Import the OceanWP demo content, widgets and customizer settings with one click.
6
+ * Version: 1.0.3.1
7
  * Author: OceanWP
8
  * Author URI: https://oceanwp.org/
9
  * Requires at least: 4.0.0
87
  $this->token = 'ocean-demo-import';
88
  $this->plugin_url = plugin_dir_url( __FILE__ );
89
  $this->plugin_path = plugin_dir_path( __FILE__ );
90
+ $this->version = '1.0.3.1';
91
 
92
  define( 'ODI_PATH', $this->plugin_path );
93
  define( 'ODI_URL', $this->plugin_url );
174
  $theme = wp_get_theme();
175
 
176
  if ( 'OceanWP' == $theme->name || 'oceanwp' == $theme->template ) {
177
+ if ( is_admin()
178
+ && version_compare( PHP_VERSION, '5.4', '>=' ) ) {
179
  require_once( ODI_PATH .'/includes/class/class-helpers.php' );
180
  require_once( ODI_PATH .'/includes/importer.php' );
181
  require_once( ODI_PATH .'/includes/install-demos.php' );
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: oceanwp
3
  Tags: import, content, demo, data, widgets, settings, oceanwp
4
  Requires at least: 4.0
5
  Tested up to: 4.8
6
- Stable tag: 1.0.3
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
@@ -30,8 +30,11 @@ This plugin will only work with the [OceanWP](https://oceanwp.org/) theme.
30
 
31
  == Changelog ==
32
 
 
 
 
33
  = 1.0.3 =
34
- - Added: New eCommerce demo [Simple](https://oceanwp.org/simple/).
35
 
36
  = 1.0.2 =
37
  - Added: Filter and search bar to easily find a demo.
3
  Tags: import, content, demo, data, widgets, settings, oceanwp
4
  Requires at least: 4.0
5
  Tested up to: 4.8
6
+ Stable tag: 1.0.3.1
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
30
 
31
  == Changelog ==
32
 
33
+ = 1.0.3.1 =
34
+ - Fixed: Preview demos url.
35
+
36
  = 1.0.3 =
37
+ - Added: New eCommerce demo [Simple](https://simple.oceanwp.org/).
38
 
39
  = 1.0.2 =
40
  - Added: Filter and search bar to easily find a demo.