Sydney Toolbox - Version 1.06

Version Description

  • Bumped compatibility to 5.3
Download this release

Release Info

Developer athemes
Plugin Icon wp plugin Sydney Toolbox
Version 1.06
Comparing to
See all releases

Code changes from version 1.03 to 1.06

Files changed (2) hide show
  1. README.txt +8 -2
  2. sydney-toolbox.php +32 -20
README.txt CHANGED
@@ -2,8 +2,8 @@
2
  Contributors: athemes, vladff
3
  Tags: sydney, custom post types, custom fields
4
  Requires at least: 4.0
5
- Tested up to: 4.9.4
6
- Stable tag: 1.03
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
@@ -28,6 +28,12 @@ None yet.
28
 
29
  == Changelog ==
30
 
 
 
 
 
 
 
31
  = 1.03 =
32
  * Added Elementor blocks and support
33
 
2
  Contributors: athemes, vladff
3
  Tags: sydney, custom post types, custom fields
4
  Requires at least: 4.0
5
+ Tested up to: 5.3
6
+ Stable tag: 1.06
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
28
 
29
  == Changelog ==
30
 
31
+ = 1.06 =
32
+ * Bumped compatibility to 5.3
33
+
34
+ = 1.04 =
35
+ * Added PHP version check. Minimum required version is 5.4.
36
+
37
  = 1.03 =
38
  * Added Elementor blocks and support
39
 
sydney-toolbox.php CHANGED
@@ -10,7 +10,7 @@
10
  * Plugin Name: Sydney Toolbox
11
  * Plugin URI: http://athemes.com/plugins/sydney-toolbox
12
  * Description: Registers custom post types and custom fields for the Sydney theme
13
- * Version: 1.03
14
  * Author: aThemes
15
  * Author URI: http://athemes.com
16
  * License: GPL-2.0+
@@ -82,29 +82,38 @@ class Sydney_Toolbox {
82
  }
83
 
84
  function elementor_includes() {
85
- require_once( ST_DIR . 'inc/elementor/block-testimonials.php' );
86
- require_once( ST_DIR . 'inc/elementor/block-posts.php' );
87
- require_once( ST_DIR . 'inc/elementor/block-portfolio.php' );
88
- require_once( ST_DIR . 'inc/elementor/block-employee-carousel.php' );
89
-
90
- if ( $this->is_pro() ) {
91
- require_once( ST_DIR . 'inc/elementor/block-employee.php' );
92
- require_once( ST_DIR . 'inc/elementor/block-pricing.php' );
93
- require_once( ST_DIR . 'inc/elementor/block-timeline.php' );
 
 
94
  }
95
  }
96
 
97
  function elementor_category() {
98
- \Elementor\Plugin::$instance->elements_manager->add_category(
99
- 'sydney-elements',
100
- [
101
- 'title' => __( 'Sydney Elements', 'sydney-toolbox' ),
102
- 'icon' => 'fa fa-plug', //default icon
103
- ],
104
- 2 // position
105
- );
 
 
106
  }
107
 
 
 
 
 
 
108
 
109
  /**
110
  * Translations
@@ -137,7 +146,7 @@ class Sydney_Toolbox {
137
  /**
138
  * Get current theme
139
  */
140
- function is_pro() {
141
  $theme = wp_get_theme();
142
  $parent = wp_get_theme()->parent();
143
  if ( ( $theme != 'Sydney Pro' ) && ( $parent != 'Sydney Pro') ) {
@@ -162,4 +171,7 @@ class Sydney_Toolbox {
162
  function sydney_toolbox_plugin() {
163
  return Sydney_Toolbox::get_instance();
164
  }
165
- add_action('plugins_loaded', 'sydney_toolbox_plugin', 1);
 
 
 
10
  * Plugin Name: Sydney Toolbox
11
  * Plugin URI: http://athemes.com/plugins/sydney-toolbox
12
  * Description: Registers custom post types and custom fields for the Sydney theme
13
+ * Version: 1.06
14
  * Author: aThemes
15
  * Author URI: http://athemes.com
16
  * License: GPL-2.0+
82
  }
83
 
84
  function elementor_includes() {
85
+ if ( !version_compare(PHP_VERSION, '5.4', '<=') ) {
86
+ require_once( ST_DIR . 'inc/elementor/block-testimonials.php' );
87
+ require_once( ST_DIR . 'inc/elementor/block-posts.php' );
88
+ require_once( ST_DIR . 'inc/elementor/block-portfolio.php' );
89
+ require_once( ST_DIR . 'inc/elementor/block-employee-carousel.php' );
90
+
91
+ if ( $this->is_pro() ) {
92
+ require_once( ST_DIR . 'inc/elementor/block-employee.php' );
93
+ require_once( ST_DIR . 'inc/elementor/block-pricing.php' );
94
+ require_once( ST_DIR . 'inc/elementor/block-timeline.php' );
95
+ }
96
  }
97
  }
98
 
99
  function elementor_category() {
100
+ if ( !version_compare(PHP_VERSION, '5.4', '<=') ) {
101
+ \Elementor\Plugin::$instance->elements_manager->add_category(
102
+ 'sydney-elements',
103
+ [
104
+ 'title' => __( 'Sydney Elements', 'sydney-toolbox' ),
105
+ 'icon' => 'fa fa-plug',
106
+ ],
107
+ 2
108
+ );
109
+ }
110
  }
111
 
112
+ static function install() {
113
+ if ( version_compare(PHP_VERSION, '5.4', '<=') ) {
114
+ wp_die( __( 'Sydney Toolbox requires PHP 5.4. Please contact your host to upgrade your PHP. The plugin was <strong>not</strong> activated.', 'sydney-toolbox' ) );
115
+ };
116
+ }
117
 
118
  /**
119
  * Translations
146
  /**
147
  * Get current theme
148
  */
149
+ public static function is_pro() {
150
  $theme = wp_get_theme();
151
  $parent = wp_get_theme()->parent();
152
  if ( ( $theme != 'Sydney Pro' ) && ( $parent != 'Sydney Pro') ) {
171
  function sydney_toolbox_plugin() {
172
  return Sydney_Toolbox::get_instance();
173
  }
174
+ add_action('plugins_loaded', 'sydney_toolbox_plugin', 1);
175
+
176
+ //Does not activate the plugin on PHP less than 5.4
177
+ register_activation_hook( __FILE__, array( 'Sydney_Toolbox', 'install' ) );