Cryout Serious Theme Settings - Version 0.5.6

Version Description

  • Added support for Mantra 2.5
Download this release

Release Info

Developer Cryout Creations
Plugin Icon wp plugin Cryout Serious Theme Settings
Version 0.5.6
Comparing to
See all releases

Code changes from version 0.5.3 to 0.5.6

cryout-theme-settings.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Cryout Serious Theme Settings
4
  Plugin URI: http://www.cryoutcreations.eu/serious-theme-settings
5
  Description: This plugin is designed to restore our theme's settings page functionality after the enforcement of the Customize-based theme settings. It is only compatible with and will only function when one of our themes is active: Nirvana, Parabola or Tempera.
6
- Version: 0.5.3
7
  Author: Cryout Creations
8
  Author URI: http://www.cryoutcreations.eu
9
  License: GPLv3
@@ -11,7 +11,7 @@
11
  */
12
 
13
  class Cryout_Theme_Settings {
14
- public $version = "0.5.3";
15
  public $settings = array();
16
 
17
  private $status = 0; // 0 = inactive, 1 = active, 2 = good theme, wrong version, 3 = wrong theme, 4 = compatibility for wp4.4
@@ -20,6 +20,7 @@ class Cryout_Theme_Settings {
20
  'nirvana' => '1.2',
21
  'tempera' => '1.4',
22
  'parabola' => '1.6',
 
23
  );
24
  private $compatibility_themes = array(
25
  'tempera' => '0.9',
@@ -29,6 +30,7 @@ class Cryout_Theme_Settings {
29
  private $slug = 'cryout-theme-settings';
30
  private $title = '';
31
  public $current_theme = array();
 
32
 
33
  public function __construct(){
34
  add_action( 'init', array( $this, 'register' ) );
@@ -72,19 +74,50 @@ class Cryout_Theme_Settings {
72
  $current_theme_slug = strtolower( wp_get_theme()->Template );
73
  $current_theme_version = wp_get_theme($current_theme_slug)->Version;
74
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
75
  $this->current_theme = array(
76
  'slug' => $current_theme_slug,
77
  'version' => $current_theme_version,
78
- );
79
 
80
  if (in_array( $current_theme_slug, array_keys( $this->supported_themes) )) {
81
  // supported theme, check version
82
- if ( version_compare( $current_theme_version, $this->supported_themes[$current_theme_slug] ) >=0 ):
83
  // supported version
84
  $this->status = 1;
85
  return 1;
86
- elseif ( (version_compare( $current_theme_version, $this->compatibility_themes[$current_theme_slug] ) >=0 ) &&
87
- (version_compare($wp_version, '4.4') >= 0) ):
88
  // compatibility mode
89
  $this->status = 4;
90
  return 4;
@@ -102,7 +135,7 @@ class Cryout_Theme_Settings {
102
  } // supported_theme()
103
 
104
  public function enqueue_script($hook) {
105
- if ( $GLOBALS['plugin_page'] == $this->current_theme['slug'] . '-page' )
106
  wp_enqueue_script( 'cryout-theme-settings-code', plugins_url( 'code.js', __FILE__ ), NULL, $this->version );
107
  } // enqueue_script()
108
 
3
  Plugin Name: Cryout Serious Theme Settings
4
  Plugin URI: http://www.cryoutcreations.eu/serious-theme-settings
5
  Description: This plugin is designed to restore our theme's settings page functionality after the enforcement of the Customize-based theme settings. It is only compatible with and will only function when one of our themes is active: Nirvana, Parabola or Tempera.
6
+ Version: 0.5.6
7
  Author: Cryout Creations
8
  Author URI: http://www.cryoutcreations.eu
9
  License: GPLv3
11
  */
12
 
13
  class Cryout_Theme_Settings {
14
+ public $version = "0.5.6";
15
  public $settings = array();
16
 
17
  private $status = 0; // 0 = inactive, 1 = active, 2 = good theme, wrong version, 3 = wrong theme, 4 = compatibility for wp4.4
20
  'nirvana' => '1.2',
21
  'tempera' => '1.4',
22
  'parabola' => '1.6',
23
+ 'mantra' => '2.5',
24
  );
25
  private $compatibility_themes = array(
26
  'tempera' => '0.9',
30
  private $slug = 'cryout-theme-settings';
31
  private $title = '';
32
  public $current_theme = array();
33
+ public $renamed_theme = false;
34
 
35
  public function __construct(){
36
  add_action( 'init', array( $this, 'register' ) );
74
  $current_theme_slug = strtolower( wp_get_theme()->Template );
75
  $current_theme_version = wp_get_theme($current_theme_slug)->Version;
76
 
77
+ if (!in_array( $current_theme_slug, array_keys( $this->supported_themes) )) {
78
+ // theme slug does not match supported themes
79
+ // perform additional checks for theme constants
80
+
81
+ if (defined('MANTRA_VERSION')) {
82
+ if ($current_theme_slug != 'mantra') $this->renamed_theme = true;
83
+ $current_theme_slug = 'mantra';
84
+ $current_theme_version = MANTRA_VERSION;
85
+ }
86
+ if (defined('PARABOLA_VERSION')) {
87
+ if ($current_theme_slug != 'parabola') $this->renamed_theme = true;
88
+ $current_theme_slug = 'parabola';
89
+ $current_theme_version = PARABOLA_VERSION;
90
+ }
91
+ if (defined('TEMPERA_VERSION')) {
92
+ if ($current_theme_slug != 'tempera') $this->renamed_theme = true;
93
+ $current_theme_slug = 'tempera';
94
+ $current_theme_version = TEMPERA_VERSION;
95
+ }
96
+ if (defined('NIRVANA_VERSION')) {
97
+ if ($current_theme_slug != 'nirvana') $this->renamed_theme = true;
98
+ $current_theme_slug = 'nirvana';
99
+ $current_theme_version = NIRVANA_VERSION;
100
+ }
101
+ if (defined('_CRYOUT_THEME_NAME')) {
102
+ if ($current_theme_slug != _CRYOUT_THEME_NAME) $this->renamed_theme = true;
103
+ $current_theme_slug = _CRYOUT_THEME_NAME;
104
+ if (defined('_CRYOUT_THEME_VERSION')) $current_theme_version = _CRYOUT_THEME_VERSION;
105
+ }
106
+ } // end additional checks
107
+
108
  $this->current_theme = array(
109
  'slug' => $current_theme_slug,
110
  'version' => $current_theme_version,
111
+ );
112
 
113
  if (in_array( $current_theme_slug, array_keys( $this->supported_themes) )) {
114
  // supported theme, check version
115
+ if ( version_compare( $current_theme_version, $this->supported_themes[$current_theme_slug], '>=' ) ):
116
  // supported version
117
  $this->status = 1;
118
  return 1;
119
+ elseif ( (version_compare( $current_theme_version, $this->compatibility_themes[$current_theme_slug], '>=' ) ) &&
120
+ (version_compare($wp_version, '4.3.9999') >= 0) ):
121
  // compatibility mode
122
  $this->status = 4;
123
  return 4;
135
  } // supported_theme()
136
 
137
  public function enqueue_script($hook) {
138
+ if ( !empty($GLOBALS['plugin_page']) && ($GLOBALS['plugin_page'] == $this->current_theme['slug'] . '-page') )
139
  wp_enqueue_script( 'cryout-theme-settings-code', plugins_url( 'code.js', __FILE__ ), NULL, $this->version );
140
  } // enqueue_script()
141
 
inc/mantra.php ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if (function_exists('mantra_init_fn')):
3
+ add_action('admin_init', 'mantra_init_fn');
4
+ endif;
5
+
6
+ function mantra_theme_settings_restore($class='') {
7
+ global $cryout_theme_settings;
8
+ ?>
9
+ <form name="mantra_form" action="options.php" method="post" enctype="multipart/form-data">
10
+ <div id="accordion">
11
+ <?php settings_fields('ma_options'); ?>
12
+ <?php do_settings_sections('mantra-page'); ?>
13
+ </div>
14
+ <div id="submitDiv">
15
+ <br>
16
+ <input class="button" name="ma_options[mantra_submit]" type="submit" style="float:right;" value="<?php _e('Save Changes','mantra'); ?>" />
17
+ <input class="button" name="ma_options[mantra_defaults]" id="mantra_defaults" type="submit" style="float:left;" value="<?php _e('Reset to Defaults','mantra'); ?>" />
18
+ </div>
19
+ </form>
20
+ <?php
21
+ } // mantra_theme_settings_buttons()
inc/parabola.php CHANGED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if (function_exists('parabola_init_fn')):
3
+ add_action('admin_init', 'parabola_init_fn');
4
+ endif;
5
+
6
+ function parabola_theme_settings_restore($class='') {
7
+ global $cryout_theme_settings;
8
+ ?>
9
+ <form name="parabola_form" action="options.php" method="post" enctype="multipart/form-data">
10
+ <div id="accordion">
11
+ <?php settings_fields('parabola_settings'); ?>
12
+ <?php do_settings_sections('parabola-page'); ?>
13
+ </div>
14
+ <div id="submitDiv">
15
+ <br>
16
+ <input class="button" name="parabola_settings[parabola_submit]" type="submit" style="float:right;" value="<?php _e('Save Changes','parabola'); ?>" />
17
+ <input class="button" name="parabola_settings[parabola_defaults]" id="parabola_defaults" type="submit" style="float:left;" value="<?php _e('Reset to Defaults','parabola'); ?>" />
18
+ </div>
19
+ </form>
20
+ <?php
21
+ } // parabola_theme_settings_buttons()
inc/settings.php CHANGED
@@ -8,7 +8,7 @@
8
  Navigate <a href="themes.php?page=<?php echo $this->current_theme['slug'] ?>-page"><strong>here</strong></a> to configure <?php echo ucwords($this->current_theme['slug']) ?>.
9
  </p></div>
10
  <?php elseif ($this->status == 4): ?>
11
- <div class="updated"><p>Current active (or parent) theme is: <strong><?php echo ucwords($this->current_theme['slug']); ?></strong> and you are running Wordpress 4.4 or newer.
12
  The plugin is <strong style="color: #008000;">active</strong> in compatibility mode.<br>
13
  <br>
14
  Navigate <a href="themes.php?page=<?php echo $this->current_theme['slug'] ?>-page"><strong>here</strong></a> to configure <?php echo ucwords($this->current_theme['slug']) ?>.
@@ -39,6 +39,12 @@
39
  <?php endswitch; ?>
40
  </p></div>
41
  <?php endif; ?>
 
 
 
 
 
 
42
 
43
  <div id="poststuff">
44
  <div id="post-body" class="metabox-holder columns-2">
@@ -47,19 +53,28 @@
47
 
48
  <div class="postbox">
49
 
50
- <div class="handlediv" title="Click to toggle"><br></div>
51
  <h3 class="hndle"><span>About</span></h3>
52
 
53
  <div class="inside">
54
  <p>
55
  This plugin is designed to inter-operate with our supported themes:
56
- <ul><li><a href="http://wordpress.org/themes/nirvana" target="_blank">Nirvana</a> version 1.2 and newer</li>
 
57
  <li><a href="http://wordpress.org/themes/parabola" target="_blank">Parabola</a> version 1.6 and newer</li>
58
  <li><a href="http://wordpress.org/themes/tempera" target="_blank">Tempera</a> version 1.4 and newer</li>
59
  </ul>
60
  To restore their theme settings pages which we had to remove due to the Customize-based settings enforcement.<br>
61
- If you are using a different theme or theme version you do not need this plugin.
62
- </p>
 
 
 
 
 
 
 
 
63
  </div>
64
  </div>
65
 
8
  Navigate <a href="themes.php?page=<?php echo $this->current_theme['slug'] ?>-page"><strong>here</strong></a> to configure <?php echo ucwords($this->current_theme['slug']) ?>.
9
  </p></div>
10
  <?php elseif ($this->status == 4): ?>
11
+ <div class="updated"><p>Current active (or parent) theme is: <strong><?php echo ucwords($this->current_theme['slug']); ?></strong> and you are running WordPress 4.4 or newer.
12
  The plugin is <strong style="color: #008000;">active</strong> in compatibility mode.<br>
13
  <br>
14
  Navigate <a href="themes.php?page=<?php echo $this->current_theme['slug'] ?>-page"><strong>here</strong></a> to configure <?php echo ucwords($this->current_theme['slug']) ?>.
39
  <?php endswitch; ?>
40
  </p></div>
41
  <?php endif; ?>
42
+ <?php if ($this->renamed_theme) :?>
43
+ <div class="error">
44
+ <p>The plugin has detected that you have renamed the theme folder - this will limit your ability to update the theme.<br>
45
+ If you need to customize the theme code, we strongly recommend creating a <a href="http://www.cryoutcreations.eu/wordpress-themes/wordpress-tutorials/wordpress-child-themes" target="_blank">child theme</a>.</p>
46
+ </div>
47
+ <?php endif; ?>
48
 
49
  <div id="poststuff">
50
  <div id="post-body" class="metabox-holder columns-2">
53
 
54
  <div class="postbox">
55
 
56
+ <div class="handlediv"><br></div>
57
  <h3 class="hndle"><span>About</span></h3>
58
 
59
  <div class="inside">
60
  <p>
61
  This plugin is designed to inter-operate with our supported themes:
62
+ <ul><li><a href="http://wordpress.org/themes/mantra" target="_blank">Mantra</a> version 2.5 and newer</li>
63
+ <li><a href="http://wordpress.org/themes/nirvana" target="_blank">Nirvana</a> version 1.2 and newer</li>
64
  <li><a href="http://wordpress.org/themes/parabola" target="_blank">Parabola</a> version 1.6 and newer</li>
65
  <li><a href="http://wordpress.org/themes/tempera" target="_blank">Tempera</a> version 1.4 and newer</li>
66
  </ul>
67
  To restore their theme settings pages which we had to remove due to the Customize-based settings enforcement.<br>
68
+ </p>
69
+ <hr>
70
+ <p>
71
+ Additionally, the plugin will restore the settings page to working condition on WordPress 4.4-RC1 and newer with:
72
+ <ul><li><u>Tempera</u> versions 0.9 - 1.3.3</li>
73
+ <li><u>Parabola</u> versions 0.9 - 1.5.1</li>
74
+ <li><a href="http://wordpress.org/themes/mantra" target="_blank">Mantra</a> versions 2.0 - 2.4.1.1</li>
75
+ </ul>
76
+ </p>
77
+ <p>If you are using a different theme or a theme version not listed here this plugin will not activate.</p>
78
  </div>
79
  </div>
80
 
inc/tempera.php CHANGED
@@ -4,7 +4,6 @@ if (function_exists('tempera_init_fn')):
4
  endif;
5
 
6
  function tempera_theme_settings_restore($class='') {
7
- global $wp_version;
8
  global $cryout_theme_settings;
9
  ?>
10
  <form name="tempera_form" id="tempera_form" action="options.php" method="post" enctype="multipart/form-data">
4
  endif;
5
 
6
  function tempera_theme_settings_restore($class='') {
 
7
  global $cryout_theme_settings;
8
  ?>
9
  <form name="tempera_form" id="tempera_form" action="options.php" method="post" enctype="multipart/form-data">
readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: cryout-creations
3
  Donate link: http://www.cryoutcreations.eu/donate/
4
  Tags: theme, admin
5
  Requires at least: 4.0
6
- Tested up to: 4.4-RC1
7
- Stable tag: 0.5.3
8
  License: GPLv3
9
  License URI: http://www.gnu.org/licenses/gpl.html
10
 
@@ -12,34 +12,54 @@ This plugin is designed to inter-operate with our Mantra, Parabola, Tempera, Nir
12
 
13
  == Description ==
14
 
15
- This plugin is designed to inter-operate with our [Parabola](https://wordpress.org/themes/parabola/), [Tempera](https://wordpress.org/themes/tempera/), [Nirvana](https://wordpress.org/themes/nirvana/) themes and restore their advanced settings pages which we had to remove due to the Customize-based settings enforcement.
16
 
17
- Additionally, it returns the themes' settings pages to working condition in Mantra, Parabola and Tempera on Wordpress 4.4-RC1 and newer.
18
 
19
  = Compatibility =
20
- The plugin is meant to be used with the following theme releases:
21
 
22
- * Parabola version 1.6 and newer
23
- * Tempera version 1.4 and newer
24
  * Nirvana version 1.2 and newer
 
 
 
25
 
26
- On Wordpress 4.4-RC1 or newer it will restore the settings pages to working condition in:
27
 
28
- * Parabola versions 0.9 - 1.5.1
29
  * Tempera versions 0.9 - 1.3.3
 
30
  * Mantra versions 2.0 - 2.4.1.1
31
 
32
- You do not need this plugin if you do not use one of the listed themes and do not use Wordpress 4.4
33
 
34
  == Installation ==
35
 
36
- 0. Have one of our supported themes activated with a non-working or missing settings page.
 
 
 
 
 
 
 
 
 
37
  1. Upload `cryout-theme-settings` folder to the `/wp-content/plugins/` directory
38
  2. Activate the plugin through the 'Plugins' menu in WordPress
39
- 3. Navigate to Appearance > "Theme" Settings to access the restored theme settings page.
40
 
41
  == Changelog ==
42
 
 
 
 
 
 
 
 
 
 
 
43
  = 0.5.3 =
44
  * Added support for Tempera 1.4
45
  * Fixed typo causing error in compatibility code
@@ -52,4 +72,4 @@ You do not need this plugin if you do not use one of the listed themes and do no
52
  * Clarified plugin information
53
 
54
  = 0.5 =
55
- * Initial release. Currently only Nirvana 1.2 implements support for this plugin.
3
  Donate link: http://www.cryoutcreations.eu/donate/
4
  Tags: theme, admin
5
  Requires at least: 4.0
6
+ Tested up to: 4.4.2
7
+ Stable tag: 0.5.6
8
  License: GPLv3
9
  License URI: http://www.gnu.org/licenses/gpl.html
10
 
12
 
13
  == Description ==
14
 
15
+ This plugin is designed to inter-operate with our [Nirvana](https://wordpress.org/themes/nirvana/), [Tempera](https://wordpress.org/themes/tempera/), [Parabola](https://wordpress.org/themes/parabola/), [Mantra](https://wordpress.org/themes/mantra/)themes and restore their advanced settings pages which we had to remove due to the Customize-based settings transition.
16
 
17
+ Additionally, it fixes an incompatibility between the older version of listed themes and Wordpress 4.4 and newer.
18
 
19
  = Compatibility =
20
+ The plugin is meant to be used with the following theme releases regardless of WordPress version:
21
 
 
 
22
  * Nirvana version 1.2 and newer
23
+ * Tempera version 1.4 and newer
24
+ * Parabola version 1.6 and newer
25
+ * Mantra version 2.5 and newer
26
 
27
+ Additionally, it is needed to correct an incompatibility between WordPress 4.4 and newer and the following theme versions:
28
 
 
29
  * Tempera versions 0.9 - 1.3.3
30
+ * Parabola versions 0.9 - 1.5.1
31
  * Mantra versions 2.0 - 2.4.1.1
32
 
33
+ You do not need this plugin if you use do not use any of the listed themes.
34
 
35
  == Installation ==
36
 
37
+ = Automatic installation =
38
+
39
+ 0. Have one of our supported themes activated with a non-working or disabled settings page.
40
+ 1. Navigate to Plugins in your dashboard and click the Add New button.
41
+ 2. Type in "Cryout Theme Settings" in the search box on the right and press Enter, then click the Install button next to the plugin title.
42
+ 3. After installation Activate the plugin, then navigate to Appearance > [Theme] Settings to access the restored theme settings page.
43
+
44
+ = Manual installation =
45
+
46
+ 0. Have one of our supported themes activated with a non-working or disabled settings page.
47
  1. Upload `cryout-theme-settings` folder to the `/wp-content/plugins/` directory
48
  2. Activate the plugin through the 'Plugins' menu in WordPress
49
+ 3. Navigate to Appearance > [Theme] Settings to access the restored theme settings page.
50
 
51
  == Changelog ==
52
 
53
+ = 0.5.6 =
54
+ * Added support for Mantra 2.5
55
+
56
+ = 0.5.5 =
57
+ * Added support for Parabola 1.6
58
+ * Added detection of supported themes when the theme folder is renamed
59
+
60
+ = 0.5.4 =
61
+ * Fixed compatibility support for Mantra
62
+
63
  = 0.5.3 =
64
  * Added support for Tempera 1.4
65
  * Fixed typo causing error in compatibility code
72
  * Clarified plugin information
73
 
74
  = 0.5 =
75
+ * Initial release. Currently Nirvana 1.2 implements support for this plugin.