Styles - Version 1.0.17

Version Description

  • New: Increase memory limit for logged in users. May fix a white screen some users experienced when attempting to preview their site.
Download this release

Release Info

Developer pdclark
Plugin Icon Styles
Version 1.0.17
Comparing to
See all releases

Code changes from version 1.0.16 to 1.0.17

Files changed (3) hide show
  1. classes/styles-plugin.php +33 -1
  2. readme.txt +6 -1
  3. styles.php +1 -1
classes/styles-plugin.php CHANGED
@@ -12,7 +12,7 @@ class Styles_Plugin {
12
  *
13
  * @var string
14
  **/
15
- var $version = '1.0.15';
16
 
17
  /**
18
  * Plugin DB version
@@ -73,6 +73,10 @@ class Styles_Plugin {
73
  || apply_filters( 'styles_force_rebuild', false )
74
  ) {
75
 
 
 
 
 
76
  require_once dirname( __FILE__ ) . '/styles-child.php';
77
  require_once dirname( __FILE__ ) . '/styles-child-updatable.php';
78
  require_once dirname( __FILE__ ) . '/styles-child-theme.php';
@@ -167,4 +171,32 @@ class Styles_Plugin {
167
  return $classes;
168
  }
169
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
170
  }
12
  *
13
  * @var string
14
  **/
15
+ var $version = '1.0.17';
16
 
17
  /**
18
  * Plugin DB version
73
  || apply_filters( 'styles_force_rebuild', false )
74
  ) {
75
 
76
+ // Only for logged-in users.
77
+ // Targeting theme preview and customize.php.
78
+ $this->increase_memory_limit();
79
+
80
  require_once dirname( __FILE__ ) . '/styles-child.php';
81
  require_once dirname( __FILE__ ) . '/styles-child-updatable.php';
82
  require_once dirname( __FILE__ ) . '/styles-child-theme.php';
171
  return $classes;
172
  }
173
 
174
+ /**
175
+ * Increase memory limit; for logged-in users only.
176
+ * Not the same as increasing memory *usage*.
177
+ * Gives extra padding to customize.php and its preview.
178
+ *
179
+ * Based on pluginbuddy.php, a part of iTheme's BackupBuddy.
180
+ *
181
+ * @author Dustin Bolton
182
+ */
183
+ public static function increase_memory_limit() {
184
+ // Increase the memory limit
185
+ $current_memory_limit = trim( @ini_get( 'memory_limit' ) );
186
+
187
+ // Make sure a minimum memory limit of 256MB is set.
188
+ if ( preg_match( '/(\d+)(\w*)/', $current_memory_limit, $matches ) ) {
189
+ $current_memory_limit = $matches[1];
190
+ $unit = $matches[2];
191
+ // Up memory limit if currently lower than 256M.
192
+ if ( 'g' !== strtolower( $unit ) ) {
193
+ if ( ( $current_memory_limit < 256 ) || ( 'm' !== strtolower( $unit ) ) )
194
+ @ini_set('memory_limit', '256M');
195
+ }
196
+ } else {
197
+ // Couldn't determine current limit, set to 256M to be safe.
198
+ @ini_set('memory_limit', '256M');
199
+ }
200
+ }
201
+
202
  }
readme.txt CHANGED
@@ -5,7 +5,7 @@ Author URI: http://brainstormmedia.com
5
  Tags: css, stylesheet, appearance, customize, customizer, colors, color picker, background, fonts, google fonts, user interface, twenty ten, twenty eleven, twenty twelve, twenty thirteen
6
  Requires at least: 3.4
7
  Tested up to: 3.6
8
- Stable tag: 1.0.16
9
 
10
  Be creative with colors and fonts. Styles changes everything.
11
 
@@ -90,6 +90,10 @@ No! Styles is very careful about only loading what is needed to get its job done
90
 
91
  == Changelog ==
92
 
 
 
 
 
93
  = 1.0.16 =
94
 
95
  * New: Filter `styles_get_group_id` for merging with existing groups.
@@ -214,6 +218,7 @@ No! Styles is very careful about only loading what is needed to get its job done
214
 
215
  == Upgrade Notice ==
216
 
 
217
  * Fix: Customize Theme button loads customizer for current site in network. Resolves [#38](https://github.com/stylesplugin/styles/issues/38). Thanks @jivedig.
218
  * Fix: Child and parent theme options no longer effect each other. Resolves [#29](https://github.com/stylesplugin/styles/issues/29). Thanks @jivedig.
219
  * New: Filter `styles_get_group_id` for merging with existing groups.
5
  Tags: css, stylesheet, appearance, customize, customizer, colors, color picker, background, fonts, google fonts, user interface, twenty ten, twenty eleven, twenty twelve, twenty thirteen
6
  Requires at least: 3.4
7
  Tested up to: 3.6
8
+ Stable tag: 1.0.17
9
 
10
  Be creative with colors and fonts. Styles changes everything.
11
 
90
 
91
  == Changelog ==
92
 
93
+ = 1.0.17 =
94
+
95
+ * New: Increase memory limit for logged in users. May fix a white screen some users experienced when attempting to preview their site.
96
+
97
  = 1.0.16 =
98
 
99
  * New: Filter `styles_get_group_id` for merging with existing groups.
218
 
219
  == Upgrade Notice ==
220
 
221
+ * New: Increase memory limit for logged in users. May fix a white screen some users experienced when attempting to preview their site.
222
  * Fix: Customize Theme button loads customizer for current site in network. Resolves [#38](https://github.com/stylesplugin/styles/issues/38). Thanks @jivedig.
223
  * Fix: Child and parent theme options no longer effect each other. Resolves [#29](https://github.com/stylesplugin/styles/issues/29). Thanks @jivedig.
224
  * New: Filter `styles_get_group_id` for merging with existing groups.
styles.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Styles
4
  Plugin URI: http://stylesplugin.com
5
  Description: Change the appearance of your theme using the <a href="customize.php">WordPress Customizer</a>. Styles changes everything.
6
- Version: 1.0.16
7
  Author: Brainstorm Media
8
  Author URI: http://brainstormmedia.com
9
  */
3
  Plugin Name: Styles
4
  Plugin URI: http://stylesplugin.com
5
  Description: Change the appearance of your theme using the <a href="customize.php">WordPress Customizer</a>. Styles changes everything.
6
+ Version: 1.0.17
7
  Author: Brainstorm Media
8
  Author URI: http://brainstormmedia.com
9
  */