Unyson - Version 2.1.13

Version Description

  • Make requests to custom Github API Cache service to prevent Github API rate limit exceeded error #138
Download this release

Release Info

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

Code changes from version 2.1.12 to 2.1.13

framework/core/components/extensions/manager/class--fw-extensions-manager.php CHANGED
@@ -1743,7 +1743,10 @@ final class _FW_Extensions_Manager
1743
  } else {
1744
  $http = new WP_Http();
1745
 
1746
- $response = $http->get('https://api.github.com/repos/'. $source_data['user_repo'] .'/releases');
 
 
 
1747
 
1748
  unset($http);
1749
 
1743
  } else {
1744
  $http = new WP_Http();
1745
 
1746
+ $response = $http->get(
1747
+ apply_filters('fw_github_api_url', 'https://api.github.com')
1748
+ . '/repos/'. $source_data['user_repo'] .'/releases'
1749
+ );
1750
 
1751
  unset($http);
1752
 
framework/extensions/update/extensions/github-update/class-fw-extension-github-update.php CHANGED
@@ -41,6 +41,15 @@ class FW_Extension_Github_Update extends FW_Ext_Update_Service
41
  {
42
  }
43
 
 
 
 
 
 
 
 
 
 
44
  private function fetch_latest_version($user_slash_repo)
45
  {
46
  /**
@@ -58,7 +67,9 @@ class FW_Extension_Github_Update extends FW_Ext_Update_Service
58
 
59
  $http = new WP_Http();
60
 
61
- $response = $http->get('https://api.github.com/repos/'. $user_slash_repo .'/releases');
 
 
62
 
63
  unset($http);
64
 
@@ -203,7 +214,9 @@ class FW_Extension_Github_Update extends FW_Ext_Update_Service
203
  {
204
  $http = new WP_Http();
205
 
206
- $response = $http->get('https://api.github.com/repos/'. $user_slash_repo .'/releases');
 
 
207
 
208
  unset($http);
209
 
41
  {
42
  }
43
 
44
+ /**
45
+ * @param string $append '/foo/bar'
46
+ * @return string
47
+ */
48
+ private function get_github_api_url($append)
49
+ {
50
+ return apply_filters('fw_github_api_url', 'https://api.github.com') . $append;
51
+ }
52
+
53
  private function fetch_latest_version($user_slash_repo)
54
  {
55
  /**
67
 
68
  $http = new WP_Http();
69
 
70
+ $response = $http->get(
71
+ $this->get_github_api_url('/repos/'. $user_slash_repo .'/releases')
72
+ );
73
 
74
  unset($http);
75
 
214
  {
215
  $http = new WP_Http();
216
 
217
+ $response = $http->get(
218
+ $this->get_github_api_url('/repos/'. $user_slash_repo .'/releases')
219
+ );
220
 
221
  unset($http);
222
 
framework/extensions/update/manifest.php CHANGED
@@ -6,5 +6,5 @@ $manifest['name'] = __('Update', 'fw');
6
  $manifest['description'] = __('Keep you framework, extensions and theme up to date.', 'fw');
7
  $manifest['standalone'] = true;
8
 
9
- $manifest['version'] = '1.0.5';
10
  $manifest['github_update'] = 'ThemeFuse/Unyson-Update-Extension';
6
  $manifest['description'] = __('Keep you framework, extensions and theme up to date.', 'fw');
7
  $manifest['standalone'] = true;
8
 
9
+ $manifest['version'] = '1.0.6';
10
  $manifest['github_update'] = 'ThemeFuse/Unyson-Update-Extension';
framework/helpers/general.php CHANGED
@@ -785,10 +785,7 @@ function fw_current_url() {
785
 
786
  $pageURL .= '://';
787
 
788
- if ($_SERVER['SERVER_PORT'] != '80')
789
- $pageURL .= $_SERVER['SERVER_NAME'].':'.$_SERVER['SERVER_PORT'].$_SERVER['REQUEST_URI'];
790
- else
791
- $pageURL .= $_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI'];
792
 
793
  $cache = $pageURL;
794
 
785
 
786
  $pageURL .= '://';
787
 
788
+ $pageURL .= $_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];
 
 
 
789
 
790
  $cache = $pageURL;
791
 
framework/includes/hooks.php CHANGED
@@ -12,9 +12,15 @@
12
  * @internal
13
  */
14
  function _action_term_meta_wpdb_fix() {
 
15
  global $wpdb;
16
 
17
  $wpdb->fw_termmeta = $wpdb->prefix . 'fw_termmeta';
 
 
 
 
 
18
  }
19
  add_action( 'switch_blog', '_action_term_meta_wpdb_fix', 3 );
20
 
@@ -26,17 +32,42 @@
26
  * @param mixed $term_id
27
  *
28
  * @return void
 
29
  */
30
  function _action_fw_delete_term( $term_id ) {
31
-
32
  $term_id = (int) $term_id;
33
 
34
  if ( ! $term_id ) {
35
  return;
36
  }
37
 
 
38
  global $wpdb;
 
39
  $wpdb->delete( $wpdb->fw_termmeta, array( 'fw_term_id' => $term_id ), array( '%d' ) );
40
  }
41
  add_action( 'delete_term', '_action_fw_delete_term' );
42
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
12
  * @internal
13
  */
14
  function _action_term_meta_wpdb_fix() {
15
+ /** @var WPDB $wpdb */
16
  global $wpdb;
17
 
18
  $wpdb->fw_termmeta = $wpdb->prefix . 'fw_termmeta';
19
+
20
+ {
21
+ require_once dirname(__FILE__) .'/term-meta/function_fw_term_meta_setup_blog.php';
22
+ _fw_term_meta_setup_blog();
23
+ }
24
  }
25
  add_action( 'switch_blog', '_action_term_meta_wpdb_fix', 3 );
26
 
32
  * @param mixed $term_id
33
  *
34
  * @return void
35
+ * @internal
36
  */
37
  function _action_fw_delete_term( $term_id ) {
 
38
  $term_id = (int) $term_id;
39
 
40
  if ( ! $term_id ) {
41
  return;
42
  }
43
 
44
+ /** @var WPDB $wpdb */
45
  global $wpdb;
46
+
47
  $wpdb->delete( $wpdb->fw_termmeta, array( 'fw_term_id' => $term_id ), array( '%d' ) );
48
  }
49
  add_action( 'delete_term', '_action_fw_delete_term' );
50
+
51
+ /**
52
+ * Make sure to setup the fw_termmeta table
53
+ * (useful in cases when the framework is used not as a plugin)
54
+ * @internal
55
+ */
56
+ function _action_fw_setup_term_meta_after_theme_switch() {
57
+ require_once dirname(__FILE__) .'/term-meta/function_fw_term_meta_setup_blog.php';
58
+ _fw_term_meta_setup_blog();
59
+ }
60
+ add_action('after_switch_theme', '_action_fw_setup_term_meta_after_theme_switch', 7);
61
+ }
62
+
63
+ /**
64
+ * Custom Github API service
65
+ * Provides the same responses but is "unlimited"
66
+ * To prevent error: Github API rate limit exceeded 60 requests per hour
67
+ * https://github.com/ThemeFuse/Unyson/issues/138
68
+ * @internal
69
+ */
70
+ function _fw_filter_github_api_url($url) {
71
+ return 'http://github-api-cache.unyson.io';
72
+ }
73
+ add_filter('fw_github_api_url', '_fw_filter_github_api_url');
framework/manifest.php CHANGED
@@ -4,4 +4,4 @@ $manifest = array();
4
 
5
  $manifest['name'] = __('Unyson', 'fw');
6
 
7
- $manifest['version'] = '2.1.12';
4
 
5
  $manifest['name'] = __('Unyson', 'fw');
6
 
7
+ $manifest['version'] = '2.1.13';
framework/static/js/fw.js CHANGED
@@ -508,7 +508,7 @@ fw.getQueryString = function(name) {
508
  * modal.open();
509
  */
510
  fw.OptionsModal = Backbone.Model.extend({
511
- defaultSize: 'small',
512
  defaults: {
513
  /** Will be transformed to array with json_decode($options, true) and sent to fw()->backend->render_options() */
514
  options: [
508
  * modal.open();
509
  */
510
  fw.OptionsModal = Backbone.Model.extend({
511
+ defaultSize: 'small', // 'large', 'medium', 'small'
512
  defaults: {
513
  /** Will be transformed to array with json_decode($options, true) and sent to fw()->backend->render_options() */
514
  options: [
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
4
  Requires at least: 4.0.0
5
  Tested up to: 4.1
6
- Stable tag: 2.1.12
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
@@ -84,6 +84,9 @@ Yes; Unyson will work with any theme.
84
 
85
  == Changelog ==
86
 
 
 
 
87
  = 2.1.12 =
88
  * New extensions: Forms (Contact Forms), Mailer, Social
89
  * Added option type `rgba-color-picker`
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
4
  Requires at least: 4.0.0
5
  Tested up to: 4.1
6
+ Stable tag: 2.1.13
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
84
 
85
  == Changelog ==
86
 
87
+ = 2.1.13 =
88
+ * Make requests to custom Github API Cache service to prevent `Github API rate limit exceeded` error [#138](https://github.com/ThemeFuse/Unyson/issues/138)
89
+
90
  = 2.1.12 =
91
  * New extensions: Forms (Contact Forms), Mailer, Social
92
  * Added option type `rgba-color-picker`
unyson.php CHANGED
@@ -3,7 +3,7 @@
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.1.12
7
  * Author: ThemeFuse
8
  * Author URI: http://themefuse.com
9
  * License: GPL2+
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.1.13
7
  * Author: ThemeFuse
8
  * Author URI: http://themefuse.com
9
  * License: GPL2+