Ocean Extra - Version 1.0.6

Version Description

  • Improvement exporter.
Download this release

Release Info

Developer oceanwp
Plugin Icon 128x128 Ocean Extra
Version 1.0.6
Comparing to
See all releases

Code changes from version 1.0.5 to 1.0.6

Files changed (3) hide show
  1. includes/panel/import-export.php +11 -25
  2. ocean-extra.php +2 -2
  3. readme.txt +4 -1
includes/panel/import-export.php CHANGED
@@ -82,18 +82,15 @@ class Ocean_Import_Export {
82
  // Export requested
83
  if ( ! empty( $_GET['export'] ) ) {
84
 
85
- // Get an array of all the theme mods
86
- $mods = get_theme_mods();
87
 
88
- if ( $mods ) {
89
-
90
- $get_mods = array();
91
-
92
- foreach ( $mods as $mod => $value ) {
93
- $get_mods[$mod] = maybe_unserialize( $value );
94
  }
95
 
96
- $json = json_encode( $get_mods );
97
 
98
  } else {
99
 
@@ -101,26 +98,15 @@ class Ocean_Import_Export {
101
 
102
  }
103
 
104
- // Get file size
105
- $filesize = strlen( $json );
106
-
107
- // Headers to prompt "Save As"
108
- header( 'Content-Type: application/octet-stream' );
109
- header( 'Content-Disposition: attachment; filename=ocean-export.json' );
110
- header( 'Expires: 0' );
111
- header( 'Cache-Control: must-revalidate' );
112
- header( 'Pragma: public' );
113
- header( 'Content-Length: ' . $filesize );
114
-
115
- // Clear buffering just in case
116
- @ob_end_clean();
117
- flush();
118
 
119
  // Output file contents
120
  echo $json;
121
 
122
- // Stop execution
123
- exit;
124
 
125
  }
126
 
82
  // Export requested
83
  if ( ! empty( $_GET['export'] ) ) {
84
 
85
+ if ( $theme_mods = get_theme_mods() ) {
 
86
 
87
+ $mods = array();
88
+
89
+ foreach ( $theme_mods as $theme_mod => $value ) {
90
+ $mods[$theme_mod] = maybe_unserialize( $value );
 
 
91
  }
92
 
93
+ $json = json_encode( $mods );
94
 
95
  } else {
96
 
98
 
99
  }
100
 
101
+ // Set the download headers.
102
+ header( 'Content-disposition: attachment; filename=ocean-export.json' );
103
+ header( 'Content-Type: application/octet-stream; charset=' . get_option( 'blog_charset' ) );
 
 
 
 
 
 
 
 
 
 
 
104
 
105
  // Output file contents
106
  echo $json;
107
 
108
+ // Start execution
109
+ die;
110
 
111
  }
112
 
ocean-extra.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: Ocean Extra
4
  * Plugin URI: https://oceanwp.org/extension/ocean-extra/
5
  * Description: Add extra features like metaboxes, custom CSS and a panel to activate the premium extensions.
6
- * Version: 1.0.5
7
  * Author: OceanWP
8
  * Author URI: https://oceanwp.org/
9
  * Requires at least: 4.0.0
@@ -86,7 +86,7 @@ final class Ocean_Extra {
86
  $this->token = 'ocean-extra';
87
  $this->plugin_url = plugin_dir_url( __FILE__ );
88
  $this->plugin_path = plugin_dir_path( __FILE__ );
89
- $this->version = '1.0.5';
90
 
91
  define( 'OE_ROOT', dirname( __FILE__ ) );
92
  define( 'OE_ADMIN_PANEL_HOOK_PREFIX', 'theme-panel_page_ocean-panel' );
3
  * Plugin Name: Ocean Extra
4
  * Plugin URI: https://oceanwp.org/extension/ocean-extra/
5
  * Description: Add extra features like metaboxes, custom CSS and a panel to activate the premium extensions.
6
+ * Version: 1.0.6
7
  * Author: OceanWP
8
  * Author URI: https://oceanwp.org/
9
  * Requires at least: 4.0.0
86
  $this->token = 'ocean-extra';
87
  $this->plugin_url = plugin_dir_url( __FILE__ );
88
  $this->plugin_path = plugin_dir_path( __FILE__ );
89
+ $this->version = '1.0.6';
90
 
91
  define( 'OE_ROOT', dirname( __FILE__ ) );
92
  define( 'OE_ADMIN_PANEL_HOOK_PREFIX', 'theme-panel_page_ocean-panel' );
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: oceanwp
3
  Tags: meta boxes, meta box, metaboxes, metabox, social sharing, ocean
4
  Requires at least: 3.5
5
  Tested up to: 4.6.1
6
- Stable tag: 1.0.5
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
@@ -33,6 +33,9 @@ This plugin will only work with the [Ocean](https://oceanwp.org/) theme.
33
 
34
  == Changelog ==
35
 
 
 
 
36
  = 1.0.5 =
37
  - New import/export tab to easily import or export your settings.
38
 
3
  Tags: meta boxes, meta box, metaboxes, metabox, social sharing, ocean
4
  Requires at least: 3.5
5
  Tested up to: 4.6.1
6
+ Stable tag: 1.0.6
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
33
 
34
  == Changelog ==
35
 
36
+ = 1.0.6 =
37
+ - Improvement exporter.
38
+
39
  = 1.0.5 =
40
  - New import/export tab to easily import or export your settings.
41