Version Description
- 2018-09-24 =
- Improved: Added redundant config urls
Download this release
Release Info
Developer | themefusecom |
Plugin | Brizy – Page Builder |
Version | 1.0.34 |
Comparing to | |
See all releases |
Code changes from version 1.0.33 to 1.0.34
- README.md +4 -1
- admin/url-iterator.php +19 -0
- brizy.php +2 -2
- config.php +34 -26
- editor/api.php +4 -3
- editor/api/client.php +4 -5
- editor/api/platform.php +8 -6
- editor/asset/media-proxy-storage.php +0 -2
- editor/asset/static-file.php +15 -2
- editor/editor/editor.php +3 -3
- editor/http/client.php +16 -5
- editor/url-builder.php +49 -4
- editor/user.php +4 -2
- readme.txt +4 -1
- vendor/autoload.php +1 -1
- vendor/composer/autoload_real.php +4 -4
- vendor/composer/autoload_static.php +2 -2
README.md
CHANGED
@@ -3,7 +3,7 @@ Contributors: themefuse<br>
|
|
3 |
Requires at least: 4.5<br>
|
4 |
Tested up to: 4.9<br>
|
5 |
Requires PHP: 5.4<br>
|
6 |
-
Stable tag: 1.0.
|
7 |
License: GPLv3<br>
|
8 |
License URI: https://www.gnu.org/licenses/gpl-3.0.html
|
9 |
|
@@ -96,6 +96,9 @@ A good bug report includes full details to easily understand the issue you are h
|
|
96 |
|
97 |
## Changelog
|
98 |
|
|
|
|
|
|
|
99 |
### 1.0.33 - 2018-09-22 ###
|
100 |
* Fixed: Editor crash bug
|
101 |
|
3 |
Requires at least: 4.5<br>
|
4 |
Tested up to: 4.9<br>
|
5 |
Requires PHP: 5.4<br>
|
6 |
+
Stable tag: 1.0.34<br>
|
7 |
License: GPLv3<br>
|
8 |
License URI: https://www.gnu.org/licenses/gpl-3.0.html
|
9 |
|
96 |
|
97 |
## Changelog
|
98 |
|
99 |
+
### 1.0.34 - 2018-09-24 ###
|
100 |
+
* Improved: Added redundant config urls
|
101 |
+
|
102 |
### 1.0.33 - 2018-09-22 ###
|
103 |
* Fixed: Editor crash bug
|
104 |
|
admin/url-iterator.php
ADDED
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Created by PhpStorm.
|
4 |
+
* User: alex
|
5 |
+
* Date: 9/20/18
|
6 |
+
* Time: 10:07 AM
|
7 |
+
*/
|
8 |
+
|
9 |
+
/**
|
10 |
+
* Class Brizy_Admin_UrlIterator
|
11 |
+
*/
|
12 |
+
class Brizy_Admin_UrlIterator extends ArrayIterator {
|
13 |
+
/**
|
14 |
+
* @return mixed
|
15 |
+
*/
|
16 |
+
public function __toString() {
|
17 |
+
return $this->current();
|
18 |
+
}
|
19 |
+
}
|
brizy.php
CHANGED
@@ -5,7 +5,7 @@
|
|
5 |
* Plugin URI: https://brizy.io/
|
6 |
* Author: Brizy.io
|
7 |
* Author URI: https://brizy.io/
|
8 |
-
* Version: 1.0.
|
9 |
* Text Domain: brizy
|
10 |
* License: GPLv3
|
11 |
* Domain Path: /languages
|
@@ -20,7 +20,7 @@ if ( isset( $_SERVER['HTTP_X_FORWARDED_PROTO'] ) && stripos( $_SERVER['HTTP_X_FO
|
|
20 |
|
21 |
define( 'BRIZY_DEVELOPMENT', false );
|
22 |
define( 'BRIZY_LOG', false );
|
23 |
-
define( 'BRIZY_VERSION', '1.0.
|
24 |
define( 'BRIZY_EDITOR_VERSION', '1.0.61' );
|
25 |
define( 'BRIZY_FILE', __FILE__ );
|
26 |
define( 'BRIZY_PLUGIN_BASE', plugin_basename( BRIZY_FILE ) );
|
5 |
* Plugin URI: https://brizy.io/
|
6 |
* Author: Brizy.io
|
7 |
* Author URI: https://brizy.io/
|
8 |
+
* Version: 1.0.34
|
9 |
* Text Domain: brizy
|
10 |
* License: GPLv3
|
11 |
* Domain Path: /languages
|
20 |
|
21 |
define( 'BRIZY_DEVELOPMENT', false );
|
22 |
define( 'BRIZY_LOG', false );
|
23 |
+
define( 'BRIZY_VERSION', '1.0.34' );
|
24 |
define( 'BRIZY_EDITOR_VERSION', '1.0.61' );
|
25 |
define( 'BRIZY_FILE', __FILE__ );
|
26 |
define( 'BRIZY_PLUGIN_BASE', plugin_basename( BRIZY_FILE ) );
|
config.php
CHANGED
@@ -1,5 +1,4 @@
|
|
1 |
<?php
|
2 |
-
|
3 |
/**
|
4 |
* Created by PhpStorm.
|
5 |
* User: alex
|
@@ -10,52 +9,61 @@ class Brizy_Config {
|
|
10 |
|
11 |
const SITE_URL_PLACEHOLDER = '{@brizy_SITE_URL_PLACEHOLDER@}';
|
12 |
const SITE_URL_PLACEHOLDER_REGEX = '/{@brizy_SITE_URL_PLACEHOLDER@}/im';
|
13 |
-
//const EDITOR_PRIMARY_URL = 'https://api.brizy.io';
|
14 |
-
|
15 |
-
const S3_ASSET_URL = 'https://static.brizy.io/%s/%s';
|
16 |
-
|
17 |
const LOCAL_PAGE_MEDIA_STATIC_URL = '/brizy/media';
|
18 |
-
|
19 |
-
//const LOCAL_PAGE_ASSET_SPLITTER = "/\/brizy\/pages\/(.[^\/]*)\/(.[^\/]*)/";
|
20 |
const LOCAL_PAGE_ASSET_STATIC_URL = '/brizy/%s';
|
21 |
-
//const BRIZY_WP_PAGE_ASSET_PATH = '/brizy/pages/%s/%s';
|
22 |
-
|
23 |
-
|
24 |
-
//const LOCAL_EDITOR_ASSET_STATIC_URL = '/brizy/editor';
|
25 |
-
//const LOCAL_EDITOR_ASSET_SPLITTER = "/\/brizy\/editor\/(.[^\/]*)\/(.[^\/]*)/";
|
26 |
const BRIZY_WP_EDITOR_ASSET_PATH = '/brizy/editor';
|
27 |
-
|
28 |
-
|
29 |
-
const EDITOR_BASE_URL = 'https://app.brizy.io';
|
30 |
const EDITOR_INTEGRATION_URL = 'http://integration.bitblox.site';
|
31 |
-
|
32 |
-
|
33 |
-
//const MEDIA_IMAGE_PATH = '/storage/media';
|
34 |
-
const MEDIA_IMAGE_URL = 'https://app.brizy.io/storage/media';
|
35 |
-
const MEDIA_IMAGE_URL_REGEX = 'https:\/\/app\.brizy\.io\/storage\/media.[^"\'\s,)]+';
|
36 |
-
|
37 |
const EDITOR_ORIGIN_URL = 'http://testblox.info';
|
|
|
38 |
const EDITOR_HOST_API = 'api.testblox.info';
|
39 |
const EDITOR_HOST_BASE = 'www.testblox.info';
|
40 |
const EDITOR_HOST_ORIGIN = 'testblox.info';
|
41 |
const EDITOR_HOST_PRIMARY = 'testblox.info';
|
42 |
|
43 |
const GATEWAY_URI = 'https://api.brizy.io';
|
44 |
-
const COMPILER_URI = 'http://editorcomplier-lb-1472504860.us-east-1.elb.amazonaws.com/compile';
|
45 |
|
46 |
-
const BRIZY_REGISTRATION_CREDENTIALS = '
|
47 |
|
48 |
const BRIZY_BLANK_TEMPLATE_FILE_NAME = 'brizy-blank-template.php';
|
49 |
const BRIZY_TEMPLATE_FILE_NAME = 'brizy-template.php';
|
50 |
|
51 |
const BRIZY_APPLICATION_INTEGRATION_URL = 'https://integrations.brizy.io';
|
52 |
const BRIZY_APPLICATION_FORM_ID = '6_5968m8wd3r8kcwww8o480w4c4c84sc8gw4kwk80s4k0c48ogkc';
|
53 |
-
const BRIZY_APPLICATION_FORM_URL = '
|
54 |
-
const BRIZY_APPLICATION_FORM_NOTIFICATION_URL = '
|
55 |
-
const BRIZY_PLATFORM_MULTIPASS_LOGIN = '
|
56 |
|
57 |
const PLATFORM_CLIENT_ID = "2_5to57xuihv48c4s400sk0wgwcw0gg4s4ggwccos4g4c4444occ";
|
58 |
const PLATFORM_CLIENT_SECRET = "3kfsu3y91csg08oskg8kowg4844go0o88sow48c00wwsgwk00s";
|
59 |
const PLATFORM_EMAIL = "admin@admin.com";
|
60 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
61 |
}
|
1 |
<?php
|
|
|
2 |
/**
|
3 |
* Created by PhpStorm.
|
4 |
* User: alex
|
9 |
|
10 |
const SITE_URL_PLACEHOLDER = '{@brizy_SITE_URL_PLACEHOLDER@}';
|
11 |
const SITE_URL_PLACEHOLDER_REGEX = '/{@brizy_SITE_URL_PLACEHOLDER@}/im';
|
|
|
|
|
|
|
|
|
12 |
const LOCAL_PAGE_MEDIA_STATIC_URL = '/brizy/media';
|
|
|
|
|
13 |
const LOCAL_PAGE_ASSET_STATIC_URL = '/brizy/%s';
|
|
|
|
|
|
|
|
|
|
|
14 |
const BRIZY_WP_EDITOR_ASSET_PATH = '/brizy/editor';
|
|
|
|
|
|
|
15 |
const EDITOR_INTEGRATION_URL = 'http://integration.bitblox.site';
|
16 |
+
const MEDIA_IMAGE_URL = '/storage/media';
|
|
|
|
|
|
|
|
|
|
|
17 |
const EDITOR_ORIGIN_URL = 'http://testblox.info';
|
18 |
+
|
19 |
const EDITOR_HOST_API = 'api.testblox.info';
|
20 |
const EDITOR_HOST_BASE = 'www.testblox.info';
|
21 |
const EDITOR_HOST_ORIGIN = 'testblox.info';
|
22 |
const EDITOR_HOST_PRIMARY = 'testblox.info';
|
23 |
|
24 |
const GATEWAY_URI = 'https://api.brizy.io';
|
|
|
25 |
|
26 |
+
const BRIZY_REGISTRATION_CREDENTIALS = '/wordpress/credentials';
|
27 |
|
28 |
const BRIZY_BLANK_TEMPLATE_FILE_NAME = 'brizy-blank-template.php';
|
29 |
const BRIZY_TEMPLATE_FILE_NAME = 'brizy-template.php';
|
30 |
|
31 |
const BRIZY_APPLICATION_INTEGRATION_URL = 'https://integrations.brizy.io';
|
32 |
const BRIZY_APPLICATION_FORM_ID = '6_5968m8wd3r8kcwww8o480w4c4c84sc8gw4kwk80s4k0c48ogkc';
|
33 |
+
const BRIZY_APPLICATION_FORM_URL = '/client_id/%s?multipass_url=%s';
|
34 |
+
const BRIZY_APPLICATION_FORM_NOTIFICATION_URL = '/form/submit';
|
35 |
+
const BRIZY_PLATFORM_MULTIPASS_LOGIN = '/multipass/login/%s/%s?email=%s';
|
36 |
|
37 |
const PLATFORM_CLIENT_ID = "2_5to57xuihv48c4s400sk0wgwcw0gg4s4ggwccos4g4c4444occ";
|
38 |
const PLATFORM_CLIENT_SECRET = "3kfsu3y91csg08oskg8kowg4844go0o88sow48c00wwsgwk00s";
|
39 |
const PLATFORM_EMAIL = "admin@admin.com";
|
40 |
|
41 |
+
static public function getCompilerUrls() {
|
42 |
+
return new Brizy_Admin_UrlIterator(
|
43 |
+
array(
|
44 |
+
'http://compiler.brizy.io/compile',
|
45 |
+
'http://compiler1.brizycompiler.run/compile',
|
46 |
+
'http://compiler2.brizycompiler.run/compile'
|
47 |
+
)
|
48 |
+
);
|
49 |
+
}
|
50 |
+
|
51 |
+
static public function getStaticBrizyUrls() {
|
52 |
+
return new Brizy_Admin_UrlIterator(
|
53 |
+
array(
|
54 |
+
'https://static.brizy.io/%s/%s',
|
55 |
+
'http://static1.brizycompiler.run/%s/%s',
|
56 |
+
'http://static2.brizycompiler.run/%s/%s'
|
57 |
+
)
|
58 |
+
);
|
59 |
+
}
|
60 |
+
|
61 |
+
static public function getEditorBaseUrls() {
|
62 |
+
return new Brizy_Admin_UrlIterator(
|
63 |
+
array( 'https://app.brizy.io',
|
64 |
+
'http://app1.brizycompiler.run',
|
65 |
+
'http://app2.brizycompiler.run' )
|
66 |
+
);
|
67 |
+
}
|
68 |
+
|
69 |
}
|
editor/api.php
CHANGED
@@ -329,9 +329,10 @@ class Brizy_Editor_API {
|
|
329 |
|
330 |
$email = $user->getPlatformUserEmail();
|
331 |
$secret = $user->getPlatformUserSignature();
|
332 |
-
$
|
|
|
333 |
|
334 |
-
$platform_client_id = $
|
335 |
|
336 |
date_default_timezone_set( "UTC" );
|
337 |
|
@@ -347,7 +348,7 @@ class Brizy_Editor_API {
|
|
347 |
|
348 |
$token = $multipass->encode( $user_data );
|
349 |
|
350 |
-
$redirect_uri = sprintf( Brizy_Config::BRIZY_PLATFORM_MULTIPASS_LOGIN, $platform_client_id, $token, $email );
|
351 |
|
352 |
wp_redirect( $redirect_uri );
|
353 |
exit;
|
329 |
|
330 |
$email = $user->getPlatformUserEmail();
|
331 |
$secret = $user->getPlatformUserSignature();
|
332 |
+
$platformCredentials = Brizy_Editor_API_Platform::getCredentials();
|
333 |
+
$urlBuilder = new Brizy_Editor_UrlBuilder( Brizy_Editor_Project::get() );
|
334 |
|
335 |
+
$platform_client_id = $platformCredentials->client_id;
|
336 |
|
337 |
date_default_timezone_set( "UTC" );
|
338 |
|
348 |
|
349 |
$token = $multipass->encode( $user_data );
|
350 |
|
351 |
+
$redirect_uri = sprintf( Brizy_Config::getEditorBaseUrls() . Brizy_Config::BRIZY_PLATFORM_MULTIPASS_LOGIN, $platform_client_id, $token, $email );
|
352 |
|
353 |
wp_redirect( $redirect_uri );
|
354 |
exit;
|
editor/api/client.php
CHANGED
@@ -171,6 +171,7 @@ class Brizy_Editor_API_Client extends Brizy_Editor_Http_Client {
|
|
171 |
* @param $project
|
172 |
* @param $page_data
|
173 |
* @param $config
|
|
|
174 |
*
|
175 |
* @return string
|
176 |
* @throws Brizy_Editor_API_Exceptions_Exception
|
@@ -182,9 +183,8 @@ class Brizy_Editor_API_Client extends Brizy_Editor_Http_Client {
|
|
182 |
* @throws Twig_Error_Runtime
|
183 |
* @throws Twig_Error_Syntax
|
184 |
*/
|
185 |
-
public function compile_page( $project, $page_data, $config ) {
|
186 |
|
187 |
-
$compile_url = Brizy_Config::COMPILER_URI;
|
188 |
$template_version = BRIZY_EDITOR_VERSION;
|
189 |
$url_builder = new Brizy_Editor_UrlBuilder( $project );
|
190 |
$body = array(
|
@@ -203,7 +203,7 @@ class Brizy_Editor_API_Client extends Brizy_Editor_Http_Client {
|
|
203 |
'page_id' => 1
|
204 |
);
|
205 |
|
206 |
-
$page = parent::request( $
|
207 |
|
208 |
$template_context = array(
|
209 |
|
@@ -258,8 +258,7 @@ class Brizy_Editor_API_Client extends Brizy_Editor_Http_Client {
|
|
258 |
* @return array
|
259 |
*/
|
260 |
protected function get_headers() {
|
261 |
-
return array(
|
262 |
-
//'Authorization' => 'Bearer ' . $this->access_token->access_token()
|
263 |
);
|
264 |
}
|
265 |
|
171 |
* @param $project
|
172 |
* @param $page_data
|
173 |
* @param $config
|
174 |
+
* @param $compiler_url
|
175 |
*
|
176 |
* @return string
|
177 |
* @throws Brizy_Editor_API_Exceptions_Exception
|
183 |
* @throws Twig_Error_Runtime
|
184 |
* @throws Twig_Error_Syntax
|
185 |
*/
|
186 |
+
public function compile_page( $project, $page_data, $config, $compiler_url ) {
|
187 |
|
|
|
188 |
$template_version = BRIZY_EDITOR_VERSION;
|
189 |
$url_builder = new Brizy_Editor_UrlBuilder( $project );
|
190 |
$body = array(
|
203 |
'page_id' => 1
|
204 |
);
|
205 |
|
206 |
+
$page = parent::request( $compiler_url, array( 'body' => $body ), 'POST' )->get_response_body();
|
207 |
|
208 |
$template_context = array(
|
209 |
|
258 |
* @return array
|
259 |
*/
|
260 |
protected function get_headers() {
|
261 |
+
return array(//'Authorization' => 'Bearer ' . $this->access_token->access_token()
|
|
|
262 |
);
|
263 |
}
|
264 |
|
editor/api/platform.php
CHANGED
@@ -103,6 +103,7 @@ class Brizy_Editor_API_Platform extends Brizy_Editor_Http_Client {
|
|
103 |
*/
|
104 |
protected function random_email() {
|
105 |
$uniqid = 'brizy-' . md5( uniqid( '', true ) );
|
|
|
106 |
return $uniqid . '@brizy.io';
|
107 |
}
|
108 |
|
@@ -195,14 +196,15 @@ class Brizy_Editor_API_Platform extends Brizy_Editor_Http_Client {
|
|
195 |
/**
|
196 |
* @param $data
|
197 |
*
|
198 |
-
* @throws
|
199 |
-
* @throws Brizy_Editor_Http_Exceptions_BadRequest
|
200 |
-
* @throws Brizy_Editor_Http_Exceptions_ResponseException
|
201 |
-
* @throws Brizy_Editor_Http_Exceptions_ResponseNotFound
|
202 |
-
* @throws Brizy_Editor_Http_Exceptions_ResponseUnauthorized
|
203 |
*/
|
204 |
public function notifyFormSubmit( $data ) {
|
205 |
-
|
|
|
|
|
|
|
|
|
|
|
206 |
|
207 |
if ( ! $response->is_ok() ) {
|
208 |
Brizy_Logger::instance()->error( 'Failed to notify the platform about a form submit', array( 'response' => $response ) );
|
103 |
*/
|
104 |
protected function random_email() {
|
105 |
$uniqid = 'brizy-' . md5( uniqid( '', true ) );
|
106 |
+
|
107 |
return $uniqid . '@brizy.io';
|
108 |
}
|
109 |
|
196 |
/**
|
197 |
* @param $data
|
198 |
*
|
199 |
+
* @throws Exception
|
|
|
|
|
|
|
|
|
200 |
*/
|
201 |
public function notifyFormSubmit( $data ) {
|
202 |
+
|
203 |
+
|
204 |
+
$urlBuilder = new Brizy_Editor_UrlBuilder( Brizy_Editor_Project::get() );
|
205 |
+
$urls = $urlBuilder->application_form_notification_url();
|
206 |
+
|
207 |
+
$response = $this->post( $urls, $data );
|
208 |
|
209 |
if ( ! $response->is_ok() ) {
|
210 |
Brizy_Logger::instance()->error( 'Failed to notify the platform about a form submit', array( 'response' => $response ) );
|
editor/asset/media-proxy-storage.php
CHANGED
@@ -24,12 +24,10 @@ class Brizy_Editor_Asset_MediaProxyStorage extends Brizy_Editor_Asset_AbstractSt
|
|
24 |
$new_path = $this->url_builder->upload_path( $tmp_asset_url );
|
25 |
$external_url = $this->url_builder->external_media_url( $sufix_url );
|
26 |
|
27 |
-
|
28 |
if ( $this->store_file( $external_url, $new_path ) ) {
|
29 |
$asset_url = $new_url;
|
30 |
}
|
31 |
|
32 |
-
|
33 |
return $asset_url;
|
34 |
}
|
35 |
|
24 |
$new_path = $this->url_builder->upload_path( $tmp_asset_url );
|
25 |
$external_url = $this->url_builder->external_media_url( $sufix_url );
|
26 |
|
|
|
27 |
if ( $this->store_file( $external_url, $new_path ) ) {
|
28 |
$asset_url = $new_url;
|
29 |
}
|
30 |
|
|
|
31 |
return $asset_url;
|
32 |
}
|
33 |
|
editor/asset/static-file.php
CHANGED
@@ -27,9 +27,22 @@ abstract class Brizy_Editor_Asset_StaticFile {
|
|
27 |
@mkdir( $dir_path, 0755, true );
|
28 |
}
|
29 |
|
|
|
30 |
|
31 |
-
|
32 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
33 |
|
34 |
$code = wp_remote_retrieve_response_code( $wp_response );
|
35 |
|
27 |
@mkdir( $dir_path, 0755, true );
|
28 |
}
|
29 |
|
30 |
+
$http = new WP_Http();
|
31 |
|
32 |
+
|
33 |
+
if ( is_string( $asset_source ) ) {
|
34 |
+
$wp_response = $http->request( $asset_source, array( 'timeout' => 30 ) );
|
35 |
+
} else {
|
36 |
+
foreach ( $asset_source as $url ) {
|
37 |
+
$wp_response = $http->request( $url, array( 'timeout' => 30 ) );
|
38 |
+
|
39 |
+
if ( is_wp_error( $wp_response ) ) {
|
40 |
+
continue;
|
41 |
+
}
|
42 |
+
|
43 |
+
break;
|
44 |
+
}
|
45 |
+
}
|
46 |
|
47 |
$code = wp_remote_retrieve_response_code( $wp_response );
|
48 |
|
editor/editor/editor.php
CHANGED
@@ -115,9 +115,9 @@ class Brizy_Editor_Editor_Editor {
|
|
115 |
'serverTimestamp' => time(),
|
116 |
'urls' => array(
|
117 |
'api' => home_url( '/wp-json/v1' ),
|
118 |
-
'base' => Brizy_Config::
|
119 |
'integration' => Brizy_Config::EDITOR_INTEGRATION_URL,
|
120 |
-
'image' =>
|
121 |
'origin' => Brizy_Config::EDITOR_ORIGIN_URL,
|
122 |
'pagePreview' => $preview_post_link,
|
123 |
'pluginSettings' => admin_url( 'admin.php?page=' . Brizy_Admin_Settings::menu_slug() ),
|
@@ -125,7 +125,7 @@ class Brizy_Editor_Editor_Editor {
|
|
125 |
'backToWordpress' => get_edit_post_link( $wp_post_id, null ),
|
126 |
'assets' => $this->urlBuilder->editor_asset_url(),
|
127 |
'pageAssets' => $this->urlBuilder->page_upload_url(),
|
128 |
-
'blockThumbnails' => $this->urlBuilder->external_asset_url( 'template/img-block-thumbs' ),
|
129 |
'templateIcons' => $this->urlBuilder->proxy_url( 'template/icons' ),
|
130 |
'site' => site_url()
|
131 |
),
|
115 |
'serverTimestamp' => time(),
|
116 |
'urls' => array(
|
117 |
'api' => home_url( '/wp-json/v1' ),
|
118 |
+
'base' => Brizy_Config::getEditorBaseUrls()."",
|
119 |
'integration' => Brizy_Config::EDITOR_INTEGRATION_URL,
|
120 |
+
'image' => $this->urlBuilder->external_media_url()."",
|
121 |
'origin' => Brizy_Config::EDITOR_ORIGIN_URL,
|
122 |
'pagePreview' => $preview_post_link,
|
123 |
'pluginSettings' => admin_url( 'admin.php?page=' . Brizy_Admin_Settings::menu_slug() ),
|
125 |
'backToWordpress' => get_edit_post_link( $wp_post_id, null ),
|
126 |
'assets' => $this->urlBuilder->editor_asset_url(),
|
127 |
'pageAssets' => $this->urlBuilder->page_upload_url(),
|
128 |
+
'blockThumbnails' => $this->urlBuilder->external_asset_url( 'template/img-block-thumbs' )."",
|
129 |
'templateIcons' => $this->urlBuilder->proxy_url( 'template/icons' ),
|
130 |
'site' => site_url()
|
131 |
),
|
editor/http/client.php
CHANGED
@@ -51,12 +51,23 @@ class Brizy_Editor_Http_Client {
|
|
51 |
|
52 |
$options['method'] = $method;
|
53 |
$options['timeout'] = 30;
|
|
|
|
|
54 |
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
60 |
|
61 |
if ( is_wp_error( $wp_response ) ) {
|
62 |
throw new Brizy_Editor_API_Exceptions_Exception( $wp_response->get_error_message() );
|
51 |
|
52 |
$options['method'] = $method;
|
53 |
$options['timeout'] = 30;
|
54 |
+
$options = $this->prepare_options( $options );
|
55 |
+
$wp_response = null;
|
56 |
|
57 |
+
if ( is_string( $url ) ) {
|
58 |
+
Brizy_Logger::instance()->notice( "{$method} request to {$url}", array( 'options' => $options ) );
|
59 |
+
$wp_response = $this->getHttp()->request( $url, $options );
|
60 |
+
} else {
|
61 |
+
foreach ( $url as $aurl ) {
|
62 |
+
$wp_response = $this->getHttp()->request( $aurl, $options );
|
63 |
+
|
64 |
+
if ( is_wp_error( $wp_response ) ) {
|
65 |
+
continue;
|
66 |
+
} else {
|
67 |
+
break;
|
68 |
+
}
|
69 |
+
}
|
70 |
+
}
|
71 |
|
72 |
if ( is_wp_error( $wp_response ) ) {
|
73 |
throw new Brizy_Editor_API_Exceptions_Exception( $wp_response->get_error_message() );
|
editor/url-builder.php
CHANGED
@@ -36,8 +36,39 @@ class Brizy_Editor_UrlBuilder {
|
|
36 |
$this->upload_dir = Brizy_Admin_UploadDir::getUploadDir( null, true );
|
37 |
}
|
38 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
39 |
public function application_form_url() {
|
40 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
41 |
}
|
42 |
|
43 |
/**
|
@@ -204,9 +235,18 @@ class Brizy_Editor_UrlBuilder {
|
|
204 |
* @return string
|
205 |
*/
|
206 |
public function external_media_url( $path = null ) {
|
207 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
208 |
|
209 |
-
return
|
210 |
}
|
211 |
|
212 |
/**
|
@@ -229,7 +269,12 @@ class Brizy_Editor_UrlBuilder {
|
|
229 |
$path = "/" . ltrim( $path, "/" );
|
230 |
}
|
231 |
|
232 |
-
|
|
|
|
|
|
|
|
|
|
|
233 |
}
|
234 |
}
|
235 |
|
36 |
$this->upload_dir = Brizy_Admin_UploadDir::getUploadDir( null, true );
|
37 |
}
|
38 |
|
39 |
+
/**
|
40 |
+
* @return Brizy_Admin_UrlIterator
|
41 |
+
*/
|
42 |
+
public function compiler_url() {
|
43 |
+
return Brizy_Config::getCompilerUrls();
|
44 |
+
}
|
45 |
+
|
46 |
+
|
47 |
+
/**
|
48 |
+
* @return Brizy_Admin_UrlIterator
|
49 |
+
*/
|
50 |
public function application_form_url() {
|
51 |
+
|
52 |
+
$form_url = sprintf( Brizy_Config::BRIZY_APPLICATION_FORM_URL, Brizy_Config::BRIZY_APPLICATION_FORM_ID, urlencode( $this->multipass_url() ) );
|
53 |
+
|
54 |
+
$urls = array();
|
55 |
+
|
56 |
+
foreach ( Brizy_Config::getEditorBaseUrls() as $url ) {
|
57 |
+
$urls[] = $url . $form_url;
|
58 |
+
}
|
59 |
+
|
60 |
+
return new Brizy_Admin_UrlIterator( $urls );
|
61 |
+
}
|
62 |
+
|
63 |
+
public function application_form_notification_url() {
|
64 |
+
|
65 |
+
$urls = array();
|
66 |
+
|
67 |
+
foreach ( Brizy_Config::getEditorBaseUrls() as $url ) {
|
68 |
+
$urls[] = $url . Brizy_Config::BRIZY_APPLICATION_FORM_NOTIFICATION_URL;
|
69 |
+
}
|
70 |
+
|
71 |
+
return new Brizy_Admin_UrlIterator( $urls );
|
72 |
}
|
73 |
|
74 |
/**
|
235 |
* @return string
|
236 |
*/
|
237 |
public function external_media_url( $path = null ) {
|
238 |
+
if ( $path ) {
|
239 |
+
$path = "/" . ltrim( $path, "/" );
|
240 |
+
}
|
241 |
+
|
242 |
+
$url = Brizy_Config::MEDIA_IMAGE_URL . $path;
|
243 |
+
|
244 |
+
$urls = array();
|
245 |
+
foreach ( Brizy_Config::getEditorBaseUrls() as $baseUrl ) {
|
246 |
+
$urls[] = $baseUrl . $url;
|
247 |
+
}
|
248 |
|
249 |
+
return new Brizy_Admin_UrlIterator( $urls );
|
250 |
}
|
251 |
|
252 |
/**
|
269 |
$path = "/" . ltrim( $path, "/" );
|
270 |
}
|
271 |
|
272 |
+
$urls = array();
|
273 |
+
foreach ( Brizy_Config::getStaticBrizyUrls() as $url ) {
|
274 |
+
$urls[] = sprintf( $url . $path, $template_slug, $template_version );
|
275 |
+
}
|
276 |
+
|
277 |
+
return new Brizy_Admin_UrlIterator( $urls );
|
278 |
}
|
279 |
}
|
280 |
|
editor/user.php
CHANGED
@@ -326,9 +326,11 @@ class Brizy_Editor_User implements Brizy_Editor_SignatureInterface {
|
|
326 |
|
327 |
$editor_data = $post->get_editor_data();
|
328 |
|
329 |
-
$config
|
|
|
330 |
|
331 |
-
|
|
|
332 |
|
333 |
return $page_html;
|
334 |
|
326 |
|
327 |
$editor_data = $post->get_editor_data();
|
328 |
|
329 |
+
$config = Brizy_Editor_Editor_Editor::get( $project, $post )->config();
|
330 |
+
$urlBuilder = new Brizy_Editor_UrlBuilder( $project, $post );
|
331 |
|
332 |
+
|
333 |
+
$page_html = $this->get_client()->compile_page( $project, $editor_data, $config, $urlBuilder->compiler_url() );
|
334 |
|
335 |
return $page_html;
|
336 |
|
readme.txt
CHANGED
@@ -4,7 +4,7 @@ Tags: brizy, page builder, editor, visual editor, unyson, wysiwyg, landing page,
|
|
4 |
Requires at least: 4.5
|
5 |
Tested up to: 4.9
|
6 |
Requires PHP: 5.4
|
7 |
-
Stable tag: 1.0.
|
8 |
License: GPLv3
|
9 |
License URI: https://www.gnu.org/licenses/gpl-3.0.html
|
10 |
|
@@ -139,6 +139,9 @@ The progress you're making while building your page is always backed up in the c
|
|
139 |
|
140 |
== Changelog ==
|
141 |
|
|
|
|
|
|
|
142 |
= 1.0.33 - 2018-09-22 =
|
143 |
* Fixed: Editor crash bug
|
144 |
|
4 |
Requires at least: 4.5
|
5 |
Tested up to: 4.9
|
6 |
Requires PHP: 5.4
|
7 |
+
Stable tag: 1.0.34
|
8 |
License: GPLv3
|
9 |
License URI: https://www.gnu.org/licenses/gpl-3.0.html
|
10 |
|
139 |
|
140 |
== Changelog ==
|
141 |
|
142 |
+
= 1.0.34 - 2018-09-24 =
|
143 |
+
* Improved: Added redundant config urls
|
144 |
+
|
145 |
= 1.0.33 - 2018-09-22 =
|
146 |
* Fixed: Editor crash bug
|
147 |
|
vendor/autoload.php
CHANGED
@@ -4,4 +4,4 @@
|
|
4 |
|
5 |
require_once __DIR__ . '/composer/autoload_real.php';
|
6 |
|
7 |
-
return
|
4 |
|
5 |
require_once __DIR__ . '/composer/autoload_real.php';
|
6 |
|
7 |
+
return ComposerAutoloaderInitc0abc69682efbc7d58a3c8e5a9c4c750::getLoader();
|
vendor/composer/autoload_real.php
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
|
3 |
// autoload_real.php @generated by Composer
|
4 |
|
5 |
-
class
|
6 |
{
|
7 |
private static $loader;
|
8 |
|
@@ -19,15 +19,15 @@ class ComposerAutoloaderInit33e05a747cfd98f3d031ea0e621c5fce
|
|
19 |
return self::$loader;
|
20 |
}
|
21 |
|
22 |
-
spl_autoload_register(array('
|
23 |
self::$loader = $loader = new \Composer\Autoload\ClassLoader();
|
24 |
-
spl_autoload_unregister(array('
|
25 |
|
26 |
$useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
|
27 |
if ($useStaticLoader) {
|
28 |
require_once __DIR__ . '/autoload_static.php';
|
29 |
|
30 |
-
call_user_func(\Composer\Autoload\
|
31 |
} else {
|
32 |
$map = require __DIR__ . '/autoload_namespaces.php';
|
33 |
foreach ($map as $namespace => $path) {
|
2 |
|
3 |
// autoload_real.php @generated by Composer
|
4 |
|
5 |
+
class ComposerAutoloaderInitc0abc69682efbc7d58a3c8e5a9c4c750
|
6 |
{
|
7 |
private static $loader;
|
8 |
|
19 |
return self::$loader;
|
20 |
}
|
21 |
|
22 |
+
spl_autoload_register(array('ComposerAutoloaderInitc0abc69682efbc7d58a3c8e5a9c4c750', 'loadClassLoader'), true, true);
|
23 |
self::$loader = $loader = new \Composer\Autoload\ClassLoader();
|
24 |
+
spl_autoload_unregister(array('ComposerAutoloaderInitc0abc69682efbc7d58a3c8e5a9c4c750', 'loadClassLoader'));
|
25 |
|
26 |
$useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
|
27 |
if ($useStaticLoader) {
|
28 |
require_once __DIR__ . '/autoload_static.php';
|
29 |
|
30 |
+
call_user_func(\Composer\Autoload\ComposerStaticInitc0abc69682efbc7d58a3c8e5a9c4c750::getInitializer($loader));
|
31 |
} else {
|
32 |
$map = require __DIR__ . '/autoload_namespaces.php';
|
33 |
foreach ($map as $namespace => $path) {
|
vendor/composer/autoload_static.php
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
|
5 |
namespace Composer\Autoload;
|
6 |
|
7 |
-
class
|
8 |
{
|
9 |
public static $prefixesPsr0 = array (
|
10 |
'T' =>
|
@@ -19,7 +19,7 @@ class ComposerStaticInit33e05a747cfd98f3d031ea0e621c5fce
|
|
19 |
public static function getInitializer(ClassLoader $loader)
|
20 |
{
|
21 |
return \Closure::bind(function () use ($loader) {
|
22 |
-
$loader->prefixesPsr0 =
|
23 |
|
24 |
}, null, ClassLoader::class);
|
25 |
}
|
4 |
|
5 |
namespace Composer\Autoload;
|
6 |
|
7 |
+
class ComposerStaticInitc0abc69682efbc7d58a3c8e5a9c4c750
|
8 |
{
|
9 |
public static $prefixesPsr0 = array (
|
10 |
'T' =>
|
19 |
public static function getInitializer(ClassLoader $loader)
|
20 |
{
|
21 |
return \Closure::bind(function () use ($loader) {
|
22 |
+
$loader->prefixesPsr0 = ComposerStaticInitc0abc69682efbc7d58a3c8e5a9c4c750::$prefixesPsr0;
|
23 |
|
24 |
}, null, ClassLoader::class);
|
25 |
}
|