Unyson - Version 2.4.6

Version Description

  • Fixed: Extensions uninstalled after auto-update #263
Download this release

Release Info

Developer Unyson
Plugin Icon 128x128 Unyson
Version 2.4.6
Comparing to
See all releases

Code changes from version 2.4.5 to 2.4.6

framework/core/components/extensions.php CHANGED
@@ -92,7 +92,19 @@ final class _FW_Component_Extensions
92
  {
93
  require dirname(__FILE__) .'/extensions/class-fw-extension-default.php';
94
 
95
- if (is_admin()) {
 
 
 
 
 
 
 
 
 
 
 
 
96
  require dirname(__FILE__) .'/extensions/manager/class--fw-extensions-manager.php';
97
 
98
  $this->manager = new _FW_Extensions_Manager();
92
  {
93
  require dirname(__FILE__) .'/extensions/class-fw-extension-default.php';
94
 
95
+ if (
96
+ /**
97
+ * Do not load in frontend because it has no functionality that can be useful in frontend
98
+ */
99
+ is_admin()
100
+ ||
101
+ /**
102
+ * While in cron request (on auto-update), is_admin() is false
103
+ * but we need the actions that moves extensions to a tmp dir then back, on plugin update
104
+ * todo: maybe move those actions here in this class?
105
+ */
106
+ defined( 'DOING_CRON' )
107
+ ) {
108
  require dirname(__FILE__) .'/extensions/manager/class--fw-extensions-manager.php';
109
 
110
  $this->manager = new _FW_Extensions_Manager();
framework/core/components/extensions/manager/class--fw-extensions-manager.php CHANGED
@@ -27,16 +27,16 @@ final class _FW_Extensions_Manager
27
 
28
  public function __construct()
29
  {
30
- if (!is_admin()) {
31
- return;
32
- }
33
-
34
  // In any case/permission, make sure to not miss the plugin update actions to prevent extensions delete
35
  {
36
  add_action('fw_plugin_pre_update', array($this, '_action_plugin_pre_update'));
37
  add_action('fw_plugin_post_update', array($this, '_action_plugin_post_update'));
38
  }
39
 
 
 
 
 
40
  if (!$this->can_activate() && !$this->can_install()) {
41
  return;
42
  }
27
 
28
  public function __construct()
29
  {
 
 
 
 
30
  // In any case/permission, make sure to not miss the plugin update actions to prevent extensions delete
31
  {
32
  add_action('fw_plugin_pre_update', array($this, '_action_plugin_pre_update'));
33
  add_action('fw_plugin_post_update', array($this, '_action_plugin_post_update'));
34
  }
35
 
36
+ if (!is_admin()) {
37
+ return;
38
+ }
39
+
40
  if (!$this->can_activate() && !$this->can_install()) {
41
  return;
42
  }
framework/manifest.php CHANGED
@@ -4,4 +4,4 @@ $manifest = array();
4
 
5
  $manifest['name'] = __('Unyson', 'fw');
6
 
7
- $manifest['version'] = '2.4.5';
4
 
5
  $manifest['name'] = __('Unyson', 'fw');
6
 
7
+ $manifest['version'] = '2.4.6';
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: unyson, themefusecom
3
  Tags: page builder, cms, grid, layout, responsive, back up, backup, db backup, dump, migrate, schedule, search engine optimization, seo, media, slideshow, shortcode, slide, slideshare, slideshow, google sitemaps, sitemaps, analytics, google analytics, calendar, event, events, google maps, learning, lessons, sidebars, breadcrumbs, review, portfolio, framework
4
  Requires at least: 4.0.0
5
  Tested up to: 4.2
6
- Stable tag: 2.4.5
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
@@ -82,6 +82,9 @@ Yes; Unyson will work with any theme.
82
 
83
  == Changelog ==
84
 
 
 
 
85
  = 2.4.5 =
86
  * Fixed [#768](https://github.com/ThemeFuse/Unyson/issues/768)
87
  * Create `ABSPATH .'/fw-update.log'` on plugin update to help solve [#263](https://github.com/ThemeFuse/Unyson/issues/263)
3
  Tags: page builder, cms, grid, layout, responsive, back up, backup, db backup, dump, migrate, schedule, search engine optimization, seo, media, slideshow, shortcode, slide, slideshare, slideshow, google sitemaps, sitemaps, analytics, google analytics, calendar, event, events, google maps, learning, lessons, sidebars, breadcrumbs, review, portfolio, framework
4
  Requires at least: 4.0.0
5
  Tested up to: 4.2
6
+ Stable tag: 2.4.6
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
82
 
83
  == Changelog ==
84
 
85
+ = 2.4.6 =
86
+ * Fixed: Extensions uninstalled after auto-update [#263](https://github.com/ThemeFuse/Unyson/issues/263)
87
+
88
  = 2.4.5 =
89
  * Fixed [#768](https://github.com/ThemeFuse/Unyson/issues/768)
90
  * Create `ABSPATH .'/fw-update.log'` on plugin update to help solve [#263](https://github.com/ThemeFuse/Unyson/issues/263)
unyson.php CHANGED
@@ -1,9 +1,9 @@
1
  <?php if ( ! defined( 'ABSPATH' ) ) die( 'Forbidden' );
2
  /**
3
  * Plugin Name: Unyson
4
- * Plugin URI: http://unyson.themefuse.com/
5
  * Description: A free drag & drop framework that comes with a bunch of built in extensions that will help you develop premium themes fast & easy.
6
- * Version: 2.4.5
7
  * Author: ThemeFuse
8
  * Author URI: http://themefuse.com
9
  * License: GPL2+
@@ -130,7 +130,6 @@ if (defined('FW')) {
130
  add_filter( 'upgrader_pre_install', array(__CLASS__, '_filter_fw_check_if_plugin_pre_update'), 9999, 2 );
131
  add_filter( 'upgrader_post_install', array(__CLASS__, '_filter_fw_check_if_plugin_post_update'), 9999, 2 );
132
  add_action( 'automatic_updates_complete', array(__CLASS__, '_action_fw_automatic_updates_complete') );
133
- add_filter( 'auto_update_plugin', array(__CLASS__, '_filter_fw_disable_auto_update'), 10, 2 );
134
  }
135
 
136
  public static function _filter_fw_check_if_plugin_pre_update( $result, $data ) {
@@ -175,26 +174,13 @@ if (defined('FW')) {
175
  }
176
 
177
  foreach ($results['plugin'] as $plugin) {
178
- if ('unyson' === strtolower($plugin->item->slug)) {
179
  do_action( 'fw_automatic_update_complete', $plugin->result ); self::_fw_update_debug_log('fw_automatic_update_complete '. ($plugin->result ? 'OK' : 'NOT OK'));
180
  break;
181
  }
182
  }
183
  }
184
 
185
- public static function _filter_fw_disable_auto_update ( $update, $item ) {
186
- if ('unyson' === strtolower($item->slug)) {
187
- /**
188
- * Prevent Unyson auto update
189
- * An attempt to fix https://github.com/ThemeFuse/Unyson/issues/263
190
- */
191
- do_action('fw_plugin_auto_update_stop'); self::_fw_update_debug_log('fw_plugin_auto_update_stop');
192
- return false;
193
- } else {
194
- return $update;
195
- }
196
- }
197
-
198
  /**
199
  * Log debug information in ABSPATH/fw-update.log
200
  * @param string $message
1
  <?php if ( ! defined( 'ABSPATH' ) ) die( 'Forbidden' );
2
  /**
3
  * Plugin Name: Unyson
4
+ * Plugin URI: http://unyson.io/
5
  * Description: A free drag & drop framework that comes with a bunch of built in extensions that will help you develop premium themes fast & easy.
6
+ * Version: 2.4.6
7
  * Author: ThemeFuse
8
  * Author URI: http://themefuse.com
9
  * License: GPL2+
130
  add_filter( 'upgrader_pre_install', array(__CLASS__, '_filter_fw_check_if_plugin_pre_update'), 9999, 2 );
131
  add_filter( 'upgrader_post_install', array(__CLASS__, '_filter_fw_check_if_plugin_post_update'), 9999, 2 );
132
  add_action( 'automatic_updates_complete', array(__CLASS__, '_action_fw_automatic_updates_complete') );
 
133
  }
134
 
135
  public static function _filter_fw_check_if_plugin_pre_update( $result, $data ) {
174
  }
175
 
176
  foreach ($results['plugin'] as $plugin) {
177
+ if (plugin_basename( __FILE__ ) === strtolower($plugin->item->plugin)) {
178
  do_action( 'fw_automatic_update_complete', $plugin->result ); self::_fw_update_debug_log('fw_automatic_update_complete '. ($plugin->result ? 'OK' : 'NOT OK'));
179
  break;
180
  }
181
  }
182
  }
183
 
 
 
 
 
 
 
 
 
 
 
 
 
 
184
  /**
185
  * Log debug information in ABSPATH/fw-update.log
186
  * @param string $message