Child Theme Creator by Orbisius - Version 1.4.3

Version Description

  • Removed some of the info about other plugins
  • Using old way of defining arrays e.g. array() and not [] because some hosts still run old php :(
  • Added a notice that the initial message upon plugin activation will disappear in 24h
  • Moved the feedback box higher
Download this release

Release Info

Developer lordspace
Plugin Icon wp plugin Child Theme Creator by Orbisius
Version 1.4.3
Comparing to
See all releases

Code changes from version 1.4.2 to 1.4.3

addons/clipboard/init.php CHANGED
@@ -1,7 +1,7 @@
1
  <?php
2
 
3
  $c = new orb_ctc_addon_clipboard();
4
- add_action('orbisius_child_theme_creator_admin_enqueue_scripts', [ $c, 'admin_enqueue_scripts' ]);
5
 
6
  class orb_ctc_addon_clipboard {
7
  function admin_enqueue_scripts() {
@@ -10,19 +10,19 @@ class orb_ctc_addon_clipboard {
10
  array('jquery', ),
11
  apply_filters('orbisius_child_theme_creator_filter_asset_src',
12
  "addons/clipboard/share/clipboard-js/dist/clipboard.min.js",
13
- [ 'last_mod' => 1 ]
14
  ),
15
  true
16
  );
17
  wp_enqueue_script( 'orb_ctc_addon_clipboard' );
18
 
19
- wp_register_script( 'orb_ctc_addon_clipboard_main',
20
- apply_filters('orbisius_child_theme_creator_filter_asset_src', "addons/clipboard/assets/main.js"),
21
  array('jquery', 'orb_ctc_addon_clipboard', ),
22
  apply_filters('orbisius_child_theme_creator_filter_asset_src',
23
- "addons/clipboard/assets/main.js",
24
- [ 'last_mod' => 1 ]
25
- ),
26
  true
27
  );
28
  wp_enqueue_script( 'orb_ctc_addon_clipboard_main' );
1
  <?php
2
 
3
  $c = new orb_ctc_addon_clipboard();
4
+ add_action('orbisius_child_theme_creator_admin_enqueue_scripts', array( $c, 'admin_enqueue_scripts' ) );
5
 
6
  class orb_ctc_addon_clipboard {
7
  function admin_enqueue_scripts() {
10
  array('jquery', ),
11
  apply_filters('orbisius_child_theme_creator_filter_asset_src',
12
  "addons/clipboard/share/clipboard-js/dist/clipboard.min.js",
13
+ array( 'last_mod' => 1 )
14
  ),
15
  true
16
  );
17
  wp_enqueue_script( 'orb_ctc_addon_clipboard' );
18
 
19
+ wp_register_script( 'orb_ctc_addon_clipboard_main',
20
+ apply_filters('orbisius_child_theme_creator_filter_asset_src', "addons/clipboard/assets/main.js"),
21
  array('jquery', 'orb_ctc_addon_clipboard', ),
22
  apply_filters('orbisius_child_theme_creator_filter_asset_src',
23
+ "addons/clipboard/assets/main.js",
24
+ array( 'last_mod' => 1 )
25
+ ),
26
  true
27
  );
28
  wp_enqueue_script( 'orb_ctc_addon_clipboard_main' );
addons/cloud_lib/lib/snippet_lib.php CHANGED
@@ -17,7 +17,7 @@ class orbisius_ctc_cloud_lib {
17
  // public $dev_api_url = 'http://orb-ctc.qsandbox.com/';
18
  public $dev_api_url = 'http://orbclub.com.clients.com/';
19
  public $staging_api_url = 'http://orb-ctc.qsandbox.com/';
20
- private $tabs = [];
21
 
22
  public function __construct() {
23
  if ( !empty( $_SERVER['DEV_ENV'])) {
@@ -34,41 +34,41 @@ class orbisius_ctc_cloud_lib {
34
  //$this->api_url = $this->live_api_url; // on dev
35
  // We need to initialize the tabs here because we're using __ method
36
  // for future internationalization.
37
- $tabs = [
38
- [
39
  'id' => 'orb_ctc_ext_cloud_lib_manage',
40
  'label' => __( 'Manage', 'orbisius-child-theme-creator' ),
41
- ],
42
  // Turning off the search for now. The users will use manage tab instead.
43
- // [
44
  // 'id' => 'orb_ctc_ext_cloud_lib_search',
45
  // 'label' => __( 'Search', 'orbisius-child-theme-creator' ),
46
- // ],
47
- [
48
  'id' => 'orb_ctc_ext_cloud_lib_add',
49
  'label' => __( 'Add', 'orbisius-child-theme-creator' ),
50
- ],
51
- [
52
  'id' => 'orb_ctc_ext_cloud_lib_signup',
53
  'label' => __( 'Sign Up', 'orbisius-child-theme-creator' ),
54
- ],
55
- [
56
  'id' => 'orb_ctc_ext_cloud_lib_login',
57
  'label' => __( 'Login', 'orbisius-child-theme-creator' ),
58
- ],
59
- [
60
  'id' => 'orb_ctc_ext_cloud_lib_account',
61
  'label' => __( 'Account', 'orbisius-child-theme-creator' ),
62
- ],
63
- [
64
  'id' => 'orb_ctc_ext_cloud_lib_contact',
65
  'label' => __( 'Contact', 'orbisius-child-theme-creator' ),
66
- ],
67
- [
68
  'id' => 'orb_ctc_ext_cloud_lib_about',
69
  'label' => __( 'About', 'orbisius-child-theme-creator' ),
70
- ],
71
- ];
72
 
73
  $this->tabs = $tabs;
74
  }
@@ -98,7 +98,7 @@ class orbisius_ctc_cloud_lib {
98
  array('jquery', ),
99
  apply_filters('orbisius_child_theme_creator_filter_asset_src',
100
  "/addons/cloud_lib/assets/custom.js",
101
- [ 'last_mod' => 1 ]
102
  ),
103
  true
104
  );
@@ -110,7 +110,7 @@ class orbisius_ctc_cloud_lib {
110
  null,
111
  apply_filters('orbisius_child_theme_creator_filter_asset_src',
112
  "/addons/cloud_lib/assets/custom.css",
113
- [ 'last_mod' => 1 ]
114
  ),
115
  false
116
  );
@@ -121,43 +121,43 @@ class orbisius_ctc_cloud_lib {
121
  * Add snippet librabry actions
122
  */
123
  public function admin_init() {
124
- add_action( 'orbisius_child_theme_creator_admin_enqueue_scripts', [$this, 'enqueue_assets'] );
125
 
126
  // Snippet search ajax hook
127
- add_action( 'wp_ajax_orb_ctc_addon_cloud_lib_signup', [$this, 'process_signup'] );
128
- // add_action( 'wp_ajax_nopriv_orb_ctc_addon_cloud_lib_signup', [$this, 'process_signup'] );
129
 
130
  // Log in
131
- add_action( 'wp_ajax_orb_ctc_addon_cloud_lib_login', [$this, 'process_login'] );
132
- // add_action( 'wp_ajax_nopriv_orb_ctc_addon_cloud_lib_login', [$this, 'process_login'] );
133
 
134
  // Log out
135
- add_action( 'wp_ajax_orb_ctc_addon_cloud_lib_log_out', [$this, 'process_log_out'] );
136
- add_action( 'wp_ajax_nopriv_orb_ctc_addon_cloud_lib_log_out', [$this, 'process_log_out'] );
137
 
138
- add_action( 'wp_ajax_orb_ctc_addon_cloud_lib_autocomplete', [$this, 'cloud_autocomplete'] );
139
- // add_action( 'wp_ajax_nopriv_orb_ctc_addon_cloud_lib_autocomplete', [$this, 'cloud_autocomplete'] );
140
 
141
  // Snippet search ajax hook
142
- add_action( 'wp_ajax_orb_ctc_addon_cloud_lib_search', [$this, 'cloud_search'] );
143
- // add_action( 'wp_ajax_nopriv_orb_ctc_addon_cloud_lib_search', [$this, 'cloud_search'] );
144
 
145
  // Update a Snippet ajax hook
146
- add_action( 'wp_ajax_orb_ctc_addon_cloud_lib_cloud_update', [$this, 'cloud_update'] );
147
- // add_action( 'wp_ajax_nopriv_cloud_update', [$this, 'cloud_update'] );
148
 
149
  // Delete a Snippet ajax hook
150
- add_action( 'wp_ajax_orb_ctc_addon_cloud_lib_delete', [$this, 'cloud_delete'] );
151
- // add_action( 'wp_ajax_nopriv_orb_ctc_addon_cloud_lib_delete', [$this, 'cloud_delete'] );
152
  //
153
- add_action( 'orbisius_child_theme_creator_addon_cloud_lib_action_auth_success', [$this, 'process_successful_auth'] );
154
  }
155
 
156
  /**
157
  * Makes a request to API and get response
158
  * @return JSON array response from the api
159
  */
160
- public function call($url, $req_params = []) {
161
  // Prepend user's api key if any.
162
  if (empty($req_params['orb_cloud_lib_data']['api_key'])) {
163
  $user_api = orbisius_child_theme_creator_user::get_instance();
@@ -170,14 +170,15 @@ class orbisius_ctc_cloud_lib {
170
 
171
  $res = new orbisius_child_theme_creator_result();
172
 
173
- $wp_req_params = [
174
- 'method' => 'POST', 'sslverify' => false,
175
  'timeout' => 20,
176
  'redirection' => 5,
177
  'blocking' => true,
 
178
  //'sslverify' => false,
179
  'body' => $req_params,
180
- ];
181
 
182
  $response = wp_remote_post($url, $wp_req_params);
183
 
@@ -200,22 +201,22 @@ class orbisius_ctc_cloud_lib {
200
  $pass = orbisius_child_theme_creator_get('orb_ctc_pass');
201
  $email = orbisius_child_theme_creator_get('orb_ctc_email');
202
 
203
- $params = [
204
- 'orb_cloud_lib_data' => [
205
  'cmd' => 'user.login',
206
  'pass' => $pass,
207
  'email' => $email,
208
- ]
209
- ];
210
 
211
  $req_res = $this->call($this->api_url, $params);
212
 
213
  if ($req_res->is_success()) {
214
  $api_res = $req_res->data('result');
215
 
216
- $ctx = [
217
  'api_res' => $api_res,
218
- ];
219
 
220
  if ($api_res->is_success()) {
221
  do_action('orbisius_child_theme_creator_addon_cloud_lib_action_auth_success', $ctx);
@@ -275,22 +276,22 @@ class orbisius_ctc_cloud_lib {
275
  $pass = orbisius_child_theme_creator_get('orb_ctc_pass');
276
  $email = orbisius_child_theme_creator_get('orb_ctc_email');
277
 
278
- $params = [
279
- 'orb_cloud_lib_data' => [
280
  'cmd' => 'user.register',
281
  'pass' => $pass,
282
  'email' => $email,
283
- ]
284
- ];
285
 
286
  $req_res = $this->call($this->api_url, $params);
287
 
288
  if ($req_res->is_success()) {
289
  $api_res = $req_res->data('result');
290
 
291
- $ctx = [
292
  'api_res' => $api_res,
293
- ];
294
 
295
  if ($api_res->is_success()) {
296
  do_action('orbisius_child_theme_creator_addon_cloud_lib_action_auth_success', $ctx);
@@ -310,12 +311,12 @@ class orbisius_ctc_cloud_lib {
310
  if (!empty($_REQUEST['term'])) {
311
  $search_for = sanitize_text_field($_REQUEST['term']);
312
 
313
- $params = [
314
- 'orb_cloud_lib_data' => [
315
  'cmd' => 'item.list',
316
  'query' => $search_for,
317
- ]
318
- ];
319
 
320
  $req_res = $this->call($this->api_url, $params);
321
  wp_send_json($req_res->is_success() ? $req_res->data('result') : $req_res->to_array());
@@ -330,12 +331,12 @@ class orbisius_ctc_cloud_lib {
330
  if (!empty($_REQUEST['search'])) {
331
  $search_for = sanitize_text_field($_REQUEST['search']);
332
 
333
- $params = [
334
- 'orb_cloud_lib_data' => [
335
  'cmd' => 'item.list',
336
  'query' => $search_for,
337
- ]
338
- ];
339
 
340
  $req_res = $this->call($this->api_url, $params);
341
  wp_send_json($req_res->is_success() ? $req_res->data('result') : $req_res->to_array());
@@ -352,14 +353,14 @@ class orbisius_ctc_cloud_lib {
352
  $snippet_title = orbisius_child_theme_creator_get('title');
353
  $snippet_text = orbisius_child_theme_creator_get('text');
354
 
355
- $params = [
356
- 'orb_cloud_lib_data' => [
357
  'cmd' => $snippet_id ? 'item.update' : 'item.add',
358
  'id' => $snippet_id,
359
  'title' => $snippet_title,
360
  'content' => $snippet_text,
361
- ]
362
- ];
363
 
364
  $req_res = $this->call($this->api_url, $params);
365
  wp_send_json($req_res->is_success() ? $req_res->data('result') : $req_res->to_array());
@@ -373,12 +374,12 @@ class orbisius_ctc_cloud_lib {
373
  public function cloud_delete() {
374
  if (!empty($_REQUEST['id'])) {
375
  $id = sanitize_text_field($_REQUEST['id']);
376
- $params = [
377
- 'orb_cloud_lib_data' => [
378
  'cmd' => 'item.delete',
379
  'id' => $id,
380
- ]
381
- ];
382
 
383
  $req_res = $this->call($this->api_url, $params);
384
  wp_send_json($req_res->is_success() ? $req_res->data('result') : $req_res);
@@ -391,7 +392,7 @@ class orbisius_ctc_cloud_lib {
391
  */
392
  public function get_current_tab_id() {
393
  // $this->tabs[0]['id']
394
- $cur_tab_id = empty($_REQUEST['tab']) ? '' : wp_kses( $_REQUEST['tab'], [] );
395
 
396
  if (empty($cur_tab_id)) {
397
  $user_api = orbisius_child_theme_creator_user::get_instance();
@@ -528,14 +529,14 @@ class orbisius_ctc_cloud_lib {
528
  $no_items_css = '';
529
 
530
  if (empty($all_snippets)) {
531
- $all_snippets = [];
532
  } else {
533
  $no_items_css = 'app_hide';
534
  }
535
 
536
  // We prepend a blan row which will be hidden if the ID is 0.
537
  // It will used when adding a new item. The row will be cloned.
538
- $all_snippets = array_merge( [ $this->get_blank_snippet() ], $all_snippets);
539
  ?>
540
 
541
  <tr id="no_snippets_row" class="no_snippets_row no_snippets_alert <?php echo $no_items_css;?>">
@@ -751,11 +752,11 @@ class orbisius_ctc_cloud_lib {
751
 
752
  // This info is passed to the content link.
753
  // See the title of the contact link so the user doesn't have to re-enter that info.
754
- $e = [
755
  'site' => site_url(),
756
  'email' => $email,
757
  'api_key' => $api_key,
758
- ];
759
  ?>
760
  <a href="//orbisius.com/contact/quick-contact/?utm_source=ctc&utm_medium=cloud_lib&<?php echo http_build_query($e);?>"
761
  target="_blank"
@@ -803,9 +804,9 @@ class orbisius_ctc_cloud_lib {
803
  * Contact tab view
804
  */
805
  public function render_tab_content_orb_ctc_ext_cloud_lib_contact() {
806
- $e = [
807
  'tab' => 'contact',
808
- ];
809
  ?>
810
  <div id="orb_ctc_ext_cloud_lib_contact" class="tabcontent">
811
  <div class="orb_ctc_ext_cloud_lib_contact_wrapper">
@@ -829,11 +830,11 @@ class orbisius_ctc_cloud_lib {
829
  * @return array
830
  */
831
  public function get_blank_snippet() {
832
- $arr = [
833
  'id' => 0,
834
  'title' => '',
835
  'content' => '',
836
- ];
837
 
838
  return $arr;
839
  }
@@ -845,21 +846,21 @@ class orbisius_ctc_cloud_lib {
845
  * @return array decoded response from API
846
  */
847
  public function get_user_snippets() {
848
- $params = [
849
- 'orb_cloud_lib_data' => [
850
  'cmd' => 'item.list',
851
- ]
852
- ];
853
 
854
  $req_res = $this->call($this->api_url, $params);
855
- $snippets = [];
856
 
857
  if ( $req_res->is_success() ) {
858
  $api_result = $req_res->data('result');
859
  $snippets = $api_result->data();
860
  }
861
 
862
- $snippets = empty($snippets) ? [] : $snippets;
863
 
864
  return $snippets;
865
  }
@@ -883,7 +884,7 @@ class orbisius_ctc_cloud_lib {
883
  * if the api key exists skip signup tab if it doesn't leave only about & signup tabs
884
  * @param array $tab_rec
885
  */
886
- public function should_render_tab($tab_rec = []) {
887
  $user_api = orbisius_child_theme_creator_user::get_instance();
888
  $api_key = $user_api->api_key();
889
  $render = 1;
@@ -905,7 +906,7 @@ class orbisius_ctc_cloud_lib {
905
  *
906
  * @param array $ctx
907
  */
908
- public function render_ui($ctx = []) {
909
  $place = empty($ctx['place']) ? 'left' : $ctx['place'];
910
  $user_api = orbisius_child_theme_creator_user::get_instance();
911
  $api_key = $user_api->api_key();
17
  // public $dev_api_url = 'http://orb-ctc.qsandbox.com/';
18
  public $dev_api_url = 'http://orbclub.com.clients.com/';
19
  public $staging_api_url = 'http://orb-ctc.qsandbox.com/';
20
+ private $tabs = array();
21
 
22
  public function __construct() {
23
  if ( !empty( $_SERVER['DEV_ENV'])) {
34
  //$this->api_url = $this->live_api_url; // on dev
35
  // We need to initialize the tabs here because we're using __ method
36
  // for future internationalization.
37
+ $tabs = array(
38
+ array(
39
  'id' => 'orb_ctc_ext_cloud_lib_manage',
40
  'label' => __( 'Manage', 'orbisius-child-theme-creator' ),
41
+ ),
42
  // Turning off the search for now. The users will use manage tab instead.
43
+ // array(
44
  // 'id' => 'orb_ctc_ext_cloud_lib_search',
45
  // 'label' => __( 'Search', 'orbisius-child-theme-creator' ),
46
+ // ),
47
+ array(
48
  'id' => 'orb_ctc_ext_cloud_lib_add',
49
  'label' => __( 'Add', 'orbisius-child-theme-creator' ),
50
+ ),
51
+ array(
52
  'id' => 'orb_ctc_ext_cloud_lib_signup',
53
  'label' => __( 'Sign Up', 'orbisius-child-theme-creator' ),
54
+ ),
55
+ array(
56
  'id' => 'orb_ctc_ext_cloud_lib_login',
57
  'label' => __( 'Login', 'orbisius-child-theme-creator' ),
58
+ ),
59
+ array(
60
  'id' => 'orb_ctc_ext_cloud_lib_account',
61
  'label' => __( 'Account', 'orbisius-child-theme-creator' ),
62
+ ),
63
+ array(
64
  'id' => 'orb_ctc_ext_cloud_lib_contact',
65
  'label' => __( 'Contact', 'orbisius-child-theme-creator' ),
66
+ ),
67
+ array(
68
  'id' => 'orb_ctc_ext_cloud_lib_about',
69
  'label' => __( 'About', 'orbisius-child-theme-creator' ),
70
+ ),
71
+ );
72
 
73
  $this->tabs = $tabs;
74
  }
98
  array('jquery', ),
99
  apply_filters('orbisius_child_theme_creator_filter_asset_src',
100
  "/addons/cloud_lib/assets/custom.js",
101
+ array( 'last_mod' => 1)
102
  ),
103
  true
104
  );
110
  null,
111
  apply_filters('orbisius_child_theme_creator_filter_asset_src',
112
  "/addons/cloud_lib/assets/custom.css",
113
+ array( 'last_mod' => 1 )
114
  ),
115
  false
116
  );
121
  * Add snippet librabry actions
122
  */
123
  public function admin_init() {
124
+ add_action( 'orbisius_child_theme_creator_admin_enqueue_scripts',array($this, 'enqueue_assets' ) );
125
 
126
  // Snippet search ajax hook
127
+ add_action( 'wp_ajax_orb_ctc_addon_cloud_lib_signup',array($this, 'process_signup' ) );
128
+ // add_action( 'wp_ajax_nopriv_orb_ctc_addon_cloud_lib_signup',array($this, 'process_signup' ) );
129
 
130
  // Log in
131
+ add_action( 'wp_ajax_orb_ctc_addon_cloud_lib_login',array($this, 'process_login' ) );
132
+ // add_action( 'wp_ajax_nopriv_orb_ctc_addon_cloud_lib_login',array($this, 'process_login' ) );
133
 
134
  // Log out
135
+ add_action( 'wp_ajax_orb_ctc_addon_cloud_lib_log_out',array($this, 'process_log_out' ) );
136
+ add_action( 'wp_ajax_nopriv_orb_ctc_addon_cloud_lib_log_out',array($this, 'process_log_out' ) );
137
 
138
+ add_action( 'wp_ajax_orb_ctc_addon_cloud_lib_autocomplete',array($this, 'cloud_autocomplete' ) );
139
+ // add_action( 'wp_ajax_nopriv_orb_ctc_addon_cloud_lib_autocomplete',array($this, 'cloud_autocomplete' ) );
140
 
141
  // Snippet search ajax hook
142
+ add_action( 'wp_ajax_orb_ctc_addon_cloud_lib_search',array($this, 'cloud_search' ) );
143
+ // add_action( 'wp_ajax_nopriv_orb_ctc_addon_cloud_lib_search',array($this, 'cloud_search' ) );
144
 
145
  // Update a Snippet ajax hook
146
+ add_action( 'wp_ajax_orb_ctc_addon_cloud_lib_cloud_update',array($this, 'cloud_update' ) );
147
+ // add_action( 'wp_ajax_nopriv_cloud_update',array($this, 'cloud_update' ) );
148
 
149
  // Delete a Snippet ajax hook
150
+ add_action( 'wp_ajax_orb_ctc_addon_cloud_lib_delete',array($this, 'cloud_delete' ) );
151
+ // add_action( 'wp_ajax_nopriv_orb_ctc_addon_cloud_lib_delete',array($this, 'cloud_delete' ) );
152
  //
153
+ add_action( 'orbisius_child_theme_creator_addon_cloud_lib_action_auth_success',array($this, 'process_successful_auth' ) );
154
  }
155
 
156
  /**
157
  * Makes a request to API and get response
158
  * @return JSON array response from the api
159
  */
160
+ public function call($url, $req_params = array()) {
161
  // Prepend user's api key if any.
162
  if (empty($req_params['orb_cloud_lib_data']['api_key'])) {
163
  $user_api = orbisius_child_theme_creator_user::get_instance();
170
 
171
  $res = new orbisius_child_theme_creator_result();
172
 
173
+ $wp_req_params =array(
174
+ 'method' => 'POST',
175
  'timeout' => 20,
176
  'redirection' => 5,
177
  'blocking' => true,
178
+ 'sslverify' => false,
179
  //'sslverify' => false,
180
  'body' => $req_params,
181
+ );
182
 
183
  $response = wp_remote_post($url, $wp_req_params);
184
 
201
  $pass = orbisius_child_theme_creator_get('orb_ctc_pass');
202
  $email = orbisius_child_theme_creator_get('orb_ctc_email');
203
 
204
+ $params =array(
205
+ 'orb_cloud_lib_data' => array(
206
  'cmd' => 'user.login',
207
  'pass' => $pass,
208
  'email' => $email,
209
+ )
210
+ );
211
 
212
  $req_res = $this->call($this->api_url, $params);
213
 
214
  if ($req_res->is_success()) {
215
  $api_res = $req_res->data('result');
216
 
217
+ $ctx = array(
218
  'api_res' => $api_res,
219
+ );
220
 
221
  if ($api_res->is_success()) {
222
  do_action('orbisius_child_theme_creator_addon_cloud_lib_action_auth_success', $ctx);
276
  $pass = orbisius_child_theme_creator_get('orb_ctc_pass');
277
  $email = orbisius_child_theme_creator_get('orb_ctc_email');
278
 
279
+ $params = array(
280
+ 'orb_cloud_lib_data' => array(
281
  'cmd' => 'user.register',
282
  'pass' => $pass,
283
  'email' => $email,
284
+ )
285
+ );
286
 
287
  $req_res = $this->call($this->api_url, $params);
288
 
289
  if ($req_res->is_success()) {
290
  $api_res = $req_res->data('result');
291
 
292
+ $ctx = array(
293
  'api_res' => $api_res,
294
+ );
295
 
296
  if ($api_res->is_success()) {
297
  do_action('orbisius_child_theme_creator_addon_cloud_lib_action_auth_success', $ctx);
311
  if (!empty($_REQUEST['term'])) {
312
  $search_for = sanitize_text_field($_REQUEST['term']);
313
 
314
+ $params = array(
315
+ 'orb_cloud_lib_data' => array(
316
  'cmd' => 'item.list',
317
  'query' => $search_for,
318
+ )
319
+ );
320
 
321
  $req_res = $this->call($this->api_url, $params);
322
  wp_send_json($req_res->is_success() ? $req_res->data('result') : $req_res->to_array());
331
  if (!empty($_REQUEST['search'])) {
332
  $search_for = sanitize_text_field($_REQUEST['search']);
333
 
334
+ $params = array(
335
+ 'orb_cloud_lib_data' => array(
336
  'cmd' => 'item.list',
337
  'query' => $search_for,
338
+ )
339
+ );
340
 
341
  $req_res = $this->call($this->api_url, $params);
342
  wp_send_json($req_res->is_success() ? $req_res->data('result') : $req_res->to_array());
353
  $snippet_title = orbisius_child_theme_creator_get('title');
354
  $snippet_text = orbisius_child_theme_creator_get('text');
355
 
356
+ $params = array(
357
+ 'orb_cloud_lib_data' => array(
358
  'cmd' => $snippet_id ? 'item.update' : 'item.add',
359
  'id' => $snippet_id,
360
  'title' => $snippet_title,
361
  'content' => $snippet_text,
362
+ )
363
+ );
364
 
365
  $req_res = $this->call($this->api_url, $params);
366
  wp_send_json($req_res->is_success() ? $req_res->data('result') : $req_res->to_array());
374
  public function cloud_delete() {
375
  if (!empty($_REQUEST['id'])) {
376
  $id = sanitize_text_field($_REQUEST['id']);
377
+ $params = array(
378
+ 'orb_cloud_lib_data' => array(
379
  'cmd' => 'item.delete',
380
  'id' => $id,
381
+ )
382
+ );
383
 
384
  $req_res = $this->call($this->api_url, $params);
385
  wp_send_json($req_res->is_success() ? $req_res->data('result') : $req_res);
392
  */
393
  public function get_current_tab_id() {
394
  // $this->tabs[0]['id']
395
+ $cur_tab_id = empty($_REQUEST['tab']) ? '' : wp_kses( $_REQUEST['tab'], array() );
396
 
397
  if (empty($cur_tab_id)) {
398
  $user_api = orbisius_child_theme_creator_user::get_instance();
529
  $no_items_css = '';
530
 
531
  if (empty($all_snippets)) {
532
+ $all_snippets = array();
533
  } else {
534
  $no_items_css = 'app_hide';
535
  }
536
 
537
  // We prepend a blan row which will be hidden if the ID is 0.
538
  // It will used when adding a new item. The row will be cloned.
539
+ $all_snippets = array_merge( array( $this->get_blank_snippet() ), $all_snippets);
540
  ?>
541
 
542
  <tr id="no_snippets_row" class="no_snippets_row no_snippets_alert <?php echo $no_items_css;?>">
752
 
753
  // This info is passed to the content link.
754
  // See the title of the contact link so the user doesn't have to re-enter that info.
755
+ $e = array(
756
  'site' => site_url(),
757
  'email' => $email,
758
  'api_key' => $api_key,
759
+ );
760
  ?>
761
  <a href="//orbisius.com/contact/quick-contact/?utm_source=ctc&utm_medium=cloud_lib&<?php echo http_build_query($e);?>"
762
  target="_blank"
804
  * Contact tab view
805
  */
806
  public function render_tab_content_orb_ctc_ext_cloud_lib_contact() {
807
+ $e = array(
808
  'tab' => 'contact',
809
+ );
810
  ?>
811
  <div id="orb_ctc_ext_cloud_lib_contact" class="tabcontent">
812
  <div class="orb_ctc_ext_cloud_lib_contact_wrapper">
830
  * @return array
831
  */
832
  public function get_blank_snippet() {
833
+ $arr = array(
834
  'id' => 0,
835
  'title' => '',
836
  'content' => '',
837
+ );
838
 
839
  return $arr;
840
  }
846
  * @return array decoded response from API
847
  */
848
  public function get_user_snippets() {
849
+ $params = array(
850
+ 'orb_cloud_lib_data' => array(
851
  'cmd' => 'item.list',
852
+ )
853
+ );
854
 
855
  $req_res = $this->call($this->api_url, $params);
856
+ $snippets = array();
857
 
858
  if ( $req_res->is_success() ) {
859
  $api_result = $req_res->data('result');
860
  $snippets = $api_result->data();
861
  }
862
 
863
+ $snippets = empty($snippets) ? array() : $snippets;
864
 
865
  return $snippets;
866
  }
884
  * if the api key exists skip signup tab if it doesn't leave only about & signup tabs
885
  * @param array $tab_rec
886
  */
887
+ public function should_render_tab($tab_rec = array()) {
888
  $user_api = orbisius_child_theme_creator_user::get_instance();
889
  $api_key = $user_api->api_key();
890
  $render = 1;
906
  *
907
  * @param array $ctx
908
  */
909
+ public function render_ui($ctx = array()) {
910
  $place = empty($ctx['place']) ? 'left' : $ctx['place'];
911
  $user_api = orbisius_child_theme_creator_user::get_instance();
912
  $api_key = $user_api->api_key();
addons/cloud_lib/modules/cloud.php CHANGED
@@ -3,5 +3,5 @@
3
  $obj = new orbisius_ctc_cloud_lib();
4
 
5
  add_action( 'admin_init', array( $obj, 'admin_init' ) );
6
- add_action( 'orbisius_child_theme_creator_editors_ext_action_left_start', [ $obj, 'render_ui' ] );
7
 
3
  $obj = new orbisius_ctc_cloud_lib();
4
 
5
  add_action( 'admin_init', array( $obj, 'admin_init' ) );
6
+ add_action( 'orbisius_child_theme_creator_editors_ext_action_left_start', array( $obj, 'render_ui' ) );
7
 
nbproject/private/private.xml CHANGED
@@ -1,6 +1,6 @@
1
  <?xml version="1.0" encoding="UTF-8"?>
2
  <project-private xmlns="http://www.netbeans.org/ns/project-private/1">
3
- <editor-bookmarks xmlns="http://www.netbeans.org/ns/editor-bookmarks/2" lastBookmarkId="33">
4
  <file>
5
  <url>assets/main.js</url>
6
  <bookmark id="19">
@@ -16,69 +16,74 @@
16
  <line>105</line>
17
  <key/>
18
  </bookmark>
 
 
 
 
 
19
  <bookmark id="21">
20
  <name/>
21
- <line>696</line>
22
  <key/>
23
  </bookmark>
24
  <bookmark id="15">
25
  <name/>
26
- <line>1464</line>
27
  <key/>
28
  </bookmark>
29
  <bookmark id="16">
30
  <name/>
31
- <line>1605</line>
32
  <key/>
33
  </bookmark>
34
  <bookmark id="6">
35
  <name/>
36
- <line>1679</line>
37
  <key/>
38
  </bookmark>
39
  <bookmark id="14">
40
  <name/>
41
- <line>1757</line>
42
  <key/>
43
  </bookmark>
44
  <bookmark id="12">
45
  <name/>
46
- <line>2214</line>
47
  <key/>
48
  </bookmark>
49
  <bookmark id="9">
50
  <name/>
51
- <line>2219</line>
52
  <key/>
53
  </bookmark>
54
  <bookmark id="5">
55
  <name/>
56
- <line>2261</line>
57
  <key/>
58
  </bookmark>
59
  <bookmark id="18">
60
  <name/>
61
- <line>2271</line>
62
  <key/>
63
  </bookmark>
64
  <bookmark id="4">
65
  <name/>
66
- <line>2378</line>
67
  <key/>
68
  </bookmark>
69
  <bookmark id="17">
70
  <name/>
71
- <line>2410</line>
72
  <key/>
73
  </bookmark>
74
  <bookmark id="13">
75
  <name/>
76
- <line>2592</line>
77
  <key/>
78
  </bookmark>
79
  <bookmark id="3">
80
  <name/>
81
- <line>2637</line>
82
  <key/>
83
  </bookmark>
84
  </file>
@@ -86,17 +91,17 @@
86
  <url>addons/cloud_lib/assets/custom.js</url>
87
  <bookmark id="29">
88
  <name/>
89
- <line>285</line>
90
  <key/>
91
  </bookmark>
92
  <bookmark id="30">
93
  <name/>
94
- <line>364</line>
95
  <key/>
96
  </bookmark>
97
  <bookmark id="33">
98
  <name/>
99
- <line>404</line>
100
  <key/>
101
  </bookmark>
102
  </file>
@@ -104,17 +109,17 @@
104
  <url>addons/cloud_lib/lib/snippet_lib.php</url>
105
  <bookmark id="28">
106
  <name/>
107
- <line>329</line>
108
  <key/>
109
  </bookmark>
110
  <bookmark id="27">
111
  <name/>
112
- <line>329</line>
113
  <key/>
114
  </bookmark>
115
  <bookmark id="26">
116
  <name/>
117
- <line>457</line>
118
  <key/>
119
  </bookmark>
120
  </file>
@@ -134,11 +139,11 @@
134
  <file>file:/C:/Copy/Dropbox/cloud/projects/default/htdocs/wordpress313/wp-content/plugins/orbisius-child-theme-creator/readme.txt</file>
135
  </group>
136
  <group>
137
- <file>file:/C:/Copy/Dropbox/cloud/projects/default/htdocs/wordpress313/wp-content/plugins/orbisius-child-theme-creator/addons/cloud_lib/assets/custom.js</file>
138
  <file>file:/C:/Copy/Dropbox/cloud/projects/default/htdocs/wordpress313/wp-content/plugins/orbisius-child-theme-creator/addons/cloud_lib/lib/snippet_lib.php</file>
139
- <file>file:/C:/Copy/Dropbox/cloud/projects/default/htdocs/wordpress313/wp-content/plugins/orbisius-child-theme-creator/addons/cloud_lib/assets/custom.css</file>
140
- <file>file:/C:/Copy/Dropbox/cloud/projects/default/htdocs/wordpress313/wp-content/plugins/orbisius-child-theme-creator/docs/snippets.txt</file>
141
- <file>file:/C:/Copy/Dropbox/cloud/projects/default/htdocs/wordpress313/wp-content/plugins/orbisius-child-theme-creator/lib/user.php</file>
142
  </group>
143
  </open-files>
144
  </project-private>
1
  <?xml version="1.0" encoding="UTF-8"?>
2
  <project-private xmlns="http://www.netbeans.org/ns/project-private/1">
3
+ <editor-bookmarks xmlns="http://www.netbeans.org/ns/editor-bookmarks/2" lastBookmarkId="34">
4
  <file>
5
  <url>assets/main.js</url>
6
  <bookmark id="19">
16
  <line>105</line>
17
  <key/>
18
  </bookmark>
19
+ <bookmark id="34">
20
+ <name/>
21
+ <line>272</line>
22
+ <key/>
23
+ </bookmark>
24
  <bookmark id="21">
25
  <name/>
26
+ <line>726</line>
27
  <key/>
28
  </bookmark>
29
  <bookmark id="15">
30
  <name/>
31
+ <line>1492</line>
32
  <key/>
33
  </bookmark>
34
  <bookmark id="16">
35
  <name/>
36
+ <line>1633</line>
37
  <key/>
38
  </bookmark>
39
  <bookmark id="6">
40
  <name/>
41
+ <line>1707</line>
42
  <key/>
43
  </bookmark>
44
  <bookmark id="14">
45
  <name/>
46
+ <line>1785</line>
47
  <key/>
48
  </bookmark>
49
  <bookmark id="12">
50
  <name/>
51
+ <line>2242</line>
52
  <key/>
53
  </bookmark>
54
  <bookmark id="9">
55
  <name/>
56
+ <line>2247</line>
57
  <key/>
58
  </bookmark>
59
  <bookmark id="5">
60
  <name/>
61
+ <line>2289</line>
62
  <key/>
63
  </bookmark>
64
  <bookmark id="18">
65
  <name/>
66
+ <line>2299</line>
67
  <key/>
68
  </bookmark>
69
  <bookmark id="4">
70
  <name/>
71
+ <line>2404</line>
72
  <key/>
73
  </bookmark>
74
  <bookmark id="17">
75
  <name/>
76
+ <line>2436</line>
77
  <key/>
78
  </bookmark>
79
  <bookmark id="13">
80
  <name/>
81
+ <line>2617</line>
82
  <key/>
83
  </bookmark>
84
  <bookmark id="3">
85
  <name/>
86
+ <line>2662</line>
87
  <key/>
88
  </bookmark>
89
  </file>
91
  <url>addons/cloud_lib/assets/custom.js</url>
92
  <bookmark id="29">
93
  <name/>
94
+ <line>287</line>
95
  <key/>
96
  </bookmark>
97
  <bookmark id="30">
98
  <name/>
99
+ <line>379</line>
100
  <key/>
101
  </bookmark>
102
  <bookmark id="33">
103
  <name/>
104
+ <line>419</line>
105
  <key/>
106
  </bookmark>
107
  </file>
109
  <url>addons/cloud_lib/lib/snippet_lib.php</url>
110
  <bookmark id="28">
111
  <name/>
112
+ <line>355</line>
113
  <key/>
114
  </bookmark>
115
  <bookmark id="27">
116
  <name/>
117
+ <line>355</line>
118
  <key/>
119
  </bookmark>
120
  <bookmark id="26">
121
  <name/>
122
+ <line>483</line>
123
  <key/>
124
  </bookmark>
125
  </file>
139
  <file>file:/C:/Copy/Dropbox/cloud/projects/default/htdocs/wordpress313/wp-content/plugins/orbisius-child-theme-creator/readme.txt</file>
140
  </group>
141
  <group>
142
+ <file>file:/C:/Copy/Dropbox/cloud/projects/default/htdocs/wordpress313/wp-content/plugins/orbisius-child-theme-creator/readme.txt</file>
143
  <file>file:/C:/Copy/Dropbox/cloud/projects/default/htdocs/wordpress313/wp-content/plugins/orbisius-child-theme-creator/addons/cloud_lib/lib/snippet_lib.php</file>
144
+ <file>file:/C:/Copy/Dropbox/cloud/projects/default/htdocs/wordpress313/wp-content/plugins/orbisius-child-theme-creator/addons/cloud_lib/modules/cloud.php</file>
145
+ <file>file:/C:/Copy/Dropbox/cloud/projects/default/htdocs/wordpress313/wp-content/plugins/orbisius-child-theme-creator/addons/init.php</file>
146
+ <file>file:/C:/Copy/Dropbox/cloud/projects/default/htdocs/wordpress313/wp-content/plugins/orbisius-child-theme-creator/orbisius-child-theme-creator.php</file>
147
  </group>
148
  </open-files>
149
  </project-private>
orbisius-child-theme-creator.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Orbisius Child Theme Creator
4
  Plugin URI: http://orbisius.com/products/wordpress-plugins/orbisius-child-theme-creator/
5
  Description: This plugin allows you to quickly create child themes from any theme that you have currently installed on your site/blog.
6
- Version: 1.4.2
7
  Author: Svetoslav Marinov (Slavi)
8
  Author URI: http://orbisius.com
9
  */
@@ -94,8 +94,8 @@ function orbisius_child_theme_creator_admin_notice_message() {
94
  && ( stripos($pagenow, 'plugins.php') !== false )
95
  && ( !is_multisite() || ( is_multisite() && is_network_admin() ) ) ) {
96
  $just_link = orbisius_child_theme_creator_util::get_create_child_pages_link();
97
- echo "<div class='updated'><p>$name has been installed. To create a child theme go to
98
- <a href='$just_link'><strong>Appearance &rarr; $name</strong></a></p></div>";
99
  }
100
  }
101
 
@@ -271,7 +271,7 @@ function orbisius_child_theme_creator_is_live_env() {
271
  }
272
 
273
  add_filter('orbisius_child_theme_creator_filter_asset_src', 'orbisius_child_theme_creator_fix_asset_src', 10, 2);
274
- function orbisius_child_theme_creator_fix_asset_src($src, $ctx = []) {
275
  if (!preg_match('#^(?:https?:)?//#si', $src)) // not full urls.
276
  {
277
  $new_src = $src;
@@ -321,7 +321,7 @@ function orbisius_child_theme_creator_admin_enqueue_scripts($current_page = '')
321
  filemtime( plugin_dir_path( __FILE__ ) . "/assets/main{$suffix}.js" ), true);
322
  wp_enqueue_script( 'orbisius_child_theme_creator' );
323
 
324
- do_action( 'orbisius_child_theme_creator_admin_enqueue_scripts', [ 'suffix' => $suffix, ] );
325
  }
326
 
327
  /**
@@ -485,6 +485,98 @@ function orbisius_child_theme_creator_settings_page() {
485
  <div id="postbox-container-1" class="postbox-container">
486
 
487
  <div class="meta-box-sortables">
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
488
 
489
  <!-- Hire Us -->
490
  <div class="postbox">
@@ -530,7 +622,7 @@ function orbisius_child_theme_creator_settings_page() {
530
  </div> <!-- .inside -->
531
  </div> <!-- .postbox -->
532
 
533
- <?php orbisius_child_theme_creator_util::output_orb_widget(); ?>
534
 
535
  <?php
536
  $plugin_data = get_plugin_data(__FILE__);
@@ -588,101 +680,7 @@ function orbisius_child_theme_creator_settings_page() {
588
  target="_blank" title="[new window]">Orbisius Theme Fixer</a>
589
  </div>
590
  </div> <!-- .postbox -->
591
-
592
-
593
- <div class="postbox"> <!-- quick-contact -->
594
- <?php
595
- $current_user = wp_get_current_user();
596
- $email = empty($current_user->user_email) ? '' : $current_user->user_email;
597
- $quick_form_action = is_ssl()
598
- ? 'https://ssl.orbisius.com/apps/quick-contact/'
599
- : 'http://apps.orbisius.com/quick-contact/';
600
-
601
- if (!empty($_SERVER['DEV_ENV'])) {
602
- $quick_form_action = 'http://localhost/projects/quick-contact/';
603
- }
604
- ?>
605
- <script>
606
- var octc_quick_contact = {
607
- validate_form : function () {
608
- try {
609
- var msg = jQuery('#octc_msg').val().trim();
610
- var email = jQuery('#octc_email').val().trim();
611
-
612
- email = email.replace(/\s+/, '');
613
- email = email.replace(/\.+/, '.');
614
- email = email.replace(/\@+/, '@');
615
-
616
- if ( msg == '' ) {
617
- alert('Enter your message.');
618
- jQuery('#octc_msg').focus().val(msg).css('border', '1px solid red');
619
- return false;
620
- } else {
621
- // all is good clear borders
622
- jQuery('#octc_msg').css('border', '');
623
- }
624
-
625
- if ( email == '' || email.indexOf('@') <= 2 || email.indexOf('.') == -1) {
626
- alert('Enter your email and make sure it is valid.');
627
- jQuery('#octc_email').focus().val(email).css('border', '1px solid red');
628
- return false;
629
- } else {
630
- // all is good clear borders
631
- jQuery('#octc_email').css('border', '');
632
- }
633
-
634
- return true;
635
- } catch(e) {};
636
- }
637
- };
638
- </script>
639
- <h3><span>Quick Question or Suggestion</span></h3>
640
- <div class="inside">
641
- <div>
642
- <form method="post" action="<?php echo $quick_form_action; ?>" target="_blank">
643
- <?php
644
- global $wp_version;
645
- $plugin_data = get_plugin_data(__FILE__);
646
-
647
- $hidden_data = array(
648
- 'site_url' => site_url(),
649
- 'wp_ver' => $wp_version,
650
- 'first_name' => $current_user->first_name,
651
- 'last_name' => $current_user->last_name,
652
- 'product_name' => $plugin_data['Name'],
653
- 'product_ver' => $plugin_data['Version'],
654
- 'woocommerce_ver' => defined('WOOCOMMERCE_VERSION') ? WOOCOMMERCE_VERSION : 'n/a',
655
- );
656
- $hid_data = http_build_query($hidden_data);
657
- echo "<input type='hidden' name='data[sys_info]' value='$hid_data' />\n";
658
- ?>
659
- <textarea class="widefat" id='octc_msg' name='data[msg]' required="required"></textarea>
660
- <br/>Your Email: <input type="text" class=""
661
- id="octc_email" name='data[sender_email]' placeholder="Email" required="required"
662
- value="<?php echo esc_attr($email); ?>"
663
- />
664
- <br/><input type="submit" class="button-primary" value="<?php _e('Send Feedback') ?>"
665
- onclick="return octc_quick_contact.validate_form();" />
666
- <br/>
667
- What data will be sent
668
- <a href='javascript:void(0);'
669
- onclick='jQuery(".octc_data_to_be_sent").toggle();'>(show/hide)</a>
670
- <div class="hide-is-js app-hide octc_data_to_be_sent">
671
- <textarea class="widefat0" rows="4" readonly="readonly" disabled="disabled"><?php
672
- foreach ($hidden_data as $key => $val) {
673
- if (is_array($val)) {
674
- $val = var_export($val, 1);
675
- }
676
-
677
- echo "$key: $val\n";
678
- }
679
- ?></textarea>
680
- </div>
681
- </form>
682
- </div>
683
- </div> <!-- .inside -->
684
- </div> <!-- .postbox --> <!-- /quick-contact -->
685
-
686
  </div> <!-- .meta-box-sortables -->
687
 
688
  </div> <!-- #postbox-container-1 .postbox-container sidebar -->
@@ -1168,9 +1166,101 @@ function orbisius_child_theme_creator_tools_action() {
1168
  <div id="postbox-container-1" class="postbox-container">
1169
 
1170
  <div class="meta-box-sortables">
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1171
 
1172
  <div class="postbox">
1173
- <h3><span>Free Staging Site?</span></h3>
1174
  <div class="inside">
1175
  <?php echo orbisius_child_theme_creator_top_links('orbisius-child-theme-creator') ; ?>
1176
  </div> <!-- .inside -->
@@ -1218,7 +1308,7 @@ function orbisius_child_theme_creator_tools_action() {
1218
  </div> <!-- .inside -->
1219
  </div> <!-- .postbox -->
1220
 
1221
- <?php orbisius_child_theme_creator_util::output_orb_widget(); ?>
1222
 
1223
  <?php
1224
  $plugin_data = get_plugin_data(__FILE__);
@@ -1276,101 +1366,7 @@ function orbisius_child_theme_creator_tools_action() {
1276
  target="_blank" title="[new window]">Orbisius Theme Fixer</a>
1277
  </div>
1278
  </div> <!-- .postbox -->
1279
-
1280
-
1281
- <div class="postbox"> <!-- quick-contact -->
1282
- <?php
1283
- $current_user = wp_get_current_user();
1284
- $email = empty($current_user->user_email) ? '' : $current_user->user_email;
1285
- $quick_form_action = is_ssl()
1286
- ? 'https://ssl.orbisius.com/apps/quick-contact/'
1287
- : 'http://apps.orbisius.com/quick-contact/';
1288
-
1289
- if (!empty($_SERVER['DEV_ENV'])) {
1290
- $quick_form_action = 'http://localhost/projects/quick-contact/';
1291
- }
1292
- ?>
1293
- <script>
1294
- var octc_quick_contact = {
1295
- validate_form : function () {
1296
- try {
1297
- var msg = jQuery('#octc_msg').val().trim();
1298
- var email = jQuery('#octc_email').val().trim();
1299
-
1300
- email = email.replace(/\s+/, '');
1301
- email = email.replace(/\.+/, '.');
1302
- email = email.replace(/\@+/, '@');
1303
-
1304
- if ( msg == '' ) {
1305
- alert('Enter your message.');
1306
- jQuery('#octc_msg').focus().val(msg).css('border', '1px solid red');
1307
- return false;
1308
- } else {
1309
- // all is good clear borders
1310
- jQuery('#octc_msg').css('border', '');
1311
- }
1312
-
1313
- if ( email == '' || email.indexOf('@') <= 2 || email.indexOf('.') == -1) {
1314
- alert('Enter your email and make sure it is valid.');
1315
- jQuery('#octc_email').focus().val(email).css('border', '1px solid red');
1316
- return false;
1317
- } else {
1318
- // all is good clear borders
1319
- jQuery('#octc_email').css('border', '');
1320
- }
1321
-
1322
- return true;
1323
- } catch(e) {};
1324
- }
1325
- };
1326
- </script>
1327
- <h3><span>Quick Question or Suggestion</span></h3>
1328
- <div class="inside">
1329
- <div>
1330
- <form method="post" action="<?php echo $quick_form_action; ?>" target="_blank">
1331
- <?php
1332
- global $wp_version;
1333
- $plugin_data = get_plugin_data(__FILE__);
1334
-
1335
- $hidden_data = array(
1336
- 'site_url' => site_url(),
1337
- 'wp_ver' => $wp_version,
1338
- 'first_name' => $current_user->first_name,
1339
- 'last_name' => $current_user->last_name,
1340
- 'product_name' => $plugin_data['Name'],
1341
- 'product_ver' => $plugin_data['Version'],
1342
- 'woocommerce_ver' => defined('WOOCOMMERCE_VERSION') ? WOOCOMMERCE_VERSION : 'n/a',
1343
- );
1344
- $hid_data = http_build_query($hidden_data);
1345
- echo "<input type='hidden' name='data[sys_info]' value='$hid_data' />\n";
1346
- ?>
1347
- <textarea class="widefat" id='octc_msg' name='data[msg]' required="required"></textarea>
1348
- <br/>Your Email: <input type="text" class=""
1349
- id="octc_email" name='data[sender_email]' placeholder="Email" required="required"
1350
- value="<?php echo esc_attr($email); ?>"
1351
- />
1352
- <br/><input type="submit" class="button-primary" value="<?php _e('Send Feedback') ?>"
1353
- onclick="return octc_quick_contact.validate_form();" />
1354
- <br/>
1355
- What data will be sent
1356
- <a href='javascript:void(0);'
1357
- onclick='jQuery(".octc_data_to_be_sent").toggle();'>(show/hide)</a>
1358
- <div class="hide app-hide octc_data_to_be_sent">
1359
- <textarea class="widefat" rows="4" readonly="readonly" disabled="disabled"><?php
1360
- foreach ($hidden_data as $key => $val) {
1361
- if (is_array($val)) {
1362
- $val = var_export($val, 1);
1363
- }
1364
-
1365
- echo "$key: $val\n";
1366
- }
1367
- ?></textarea>
1368
- </div>
1369
- </form>
1370
- </div>
1371
- </div> <!-- .inside -->
1372
- </div> <!-- .postbox --> <!-- /quick-contact -->
1373
-
1374
  </div> <!-- .meta-box-sortables -->
1375
 
1376
  </div> <!-- #postbox-container-1 .postbox-container sidebar -->
@@ -1380,7 +1376,7 @@ function orbisius_child_theme_creator_tools_action() {
1380
  <br class="clear">
1381
  </div> <!-- #poststuff -->
1382
 
1383
- <?php orbisius_child_theme_creator_util::output_orb_widget('author'); ?>
1384
  </div> <!-- .wrap -->
1385
  <?php
1386
  }
@@ -1413,7 +1409,7 @@ function orbisius_child_theme_creator_get($key = null, $default = '') {
1413
  $val = orbisius_child_theme_creator_get_request($key, $default);
1414
 
1415
  if (is_scalar($val)) {
1416
- $val = wp_kses($val, []);
1417
  $val = trim($val);
1418
  } elseif (is_array($key)) {
1419
  $val = array_map('orbisius_child_theme_creator_get', $key);
3
  Plugin Name: Orbisius Child Theme Creator
4
  Plugin URI: http://orbisius.com/products/wordpress-plugins/orbisius-child-theme-creator/
5
  Description: This plugin allows you to quickly create child themes from any theme that you have currently installed on your site/blog.
6
+ Version: 1.4.3
7
  Author: Svetoslav Marinov (Slavi)
8
  Author URI: http://orbisius.com
9
  */
94
  && ( stripos($pagenow, 'plugins.php') !== false )
95
  && ( !is_multisite() || ( is_multisite() && is_network_admin() ) ) ) {
96
  $just_link = orbisius_child_theme_creator_util::get_create_child_pages_link();
97
+ echo "<div class='updated'><p>$name: to create a child theme go to
98
+ <a href='$just_link'><strong>Appearance &rarr; $name</strong></a>. This message will automatically disappear within 24h.</p></div>";
99
  }
100
  }
101
 
271
  }
272
 
273
  add_filter('orbisius_child_theme_creator_filter_asset_src', 'orbisius_child_theme_creator_fix_asset_src', 10, 2);
274
+ function orbisius_child_theme_creator_fix_asset_src($src, $ctx = array()) {
275
  if (!preg_match('#^(?:https?:)?//#si', $src)) // not full urls.
276
  {
277
  $new_src = $src;
321
  filemtime( plugin_dir_path( __FILE__ ) . "/assets/main{$suffix}.js" ), true);
322
  wp_enqueue_script( 'orbisius_child_theme_creator' );
323
 
324
+ do_action( 'orbisius_child_theme_creator_admin_enqueue_scripts', array( 'suffix' => $suffix, ) );
325
  }
326
 
327
  /**
485
  <div id="postbox-container-1" class="postbox-container">
486
 
487
  <div class="meta-box-sortables">
488
+ <div class="postbox"> <!-- quick-contact -->
489
+ <?php
490
+ $current_user = wp_get_current_user();
491
+ $email = empty($current_user->user_email) ? '' : $current_user->user_email;
492
+ $quick_form_action = is_ssl()
493
+ ? 'https://ssl.orbisius.com/apps/quick-contact/'
494
+ : 'http://apps.orbisius.com/quick-contact/';
495
+
496
+ if (!empty($_SERVER['DEV_ENV'])) {
497
+ $quick_form_action = 'http://localhost/projects/quick-contact/';
498
+ }
499
+ ?>
500
+ <script>
501
+ var octc_quick_contact = {
502
+ validate_form : function () {
503
+ try {
504
+ var msg = jQuery('#octc_msg').val().trim();
505
+ var email = jQuery('#octc_email').val().trim();
506
+
507
+ email = email.replace(/\s+/, '');
508
+ email = email.replace(/\.+/, '.');
509
+ email = email.replace(/\@+/, '@');
510
+
511
+ if ( msg == '' ) {
512
+ alert('Enter your message.');
513
+ jQuery('#octc_msg').focus().val(msg).css('border', '1px solid red');
514
+ return false;
515
+ } else {
516
+ // all is good clear borders
517
+ jQuery('#octc_msg').css('border', '');
518
+ }
519
+
520
+ if ( email == '' || email.indexOf('@') <= 2 || email.indexOf('.') == -1) {
521
+ alert('Enter your email and make sure it is valid.');
522
+ jQuery('#octc_email').focus().val(email).css('border', '1px solid red');
523
+ return false;
524
+ } else {
525
+ // all is good clear borders
526
+ jQuery('#octc_email').css('border', '');
527
+ }
528
+
529
+ return true;
530
+ } catch(e) {};
531
+ }
532
+ };
533
+ </script>
534
+ <h3><span>Quick Question or Suggestion</span></h3>
535
+ <div class="inside">
536
+ <div>
537
+ <form method="post" action="<?php echo $quick_form_action; ?>" target="_blank">
538
+ <?php
539
+ global $wp_version;
540
+ $plugin_data = get_plugin_data(__FILE__);
541
+
542
+ $hidden_data = array(
543
+ 'site_url' => site_url(),
544
+ 'wp_ver' => $wp_version,
545
+ 'first_name' => $current_user->first_name,
546
+ 'last_name' => $current_user->last_name,
547
+ 'product_name' => $plugin_data['Name'],
548
+ 'product_ver' => $plugin_data['Version'],
549
+ 'woocommerce_ver' => defined('WOOCOMMERCE_VERSION') ? WOOCOMMERCE_VERSION : 'n/a',
550
+ );
551
+ $hid_data = http_build_query($hidden_data);
552
+ echo "<input type='hidden' name='data[sys_info]' value='$hid_data' />\n";
553
+ ?>
554
+ <textarea class="widefat" id='octc_msg' name='data[msg]' required="required"></textarea>
555
+ <br/>Your Email: <input type="text" class=""
556
+ id="octc_email" name='data[sender_email]' placeholder="Email" required="required"
557
+ value="<?php echo esc_attr($email); ?>"
558
+ />
559
+ <br/><input type="submit" class="button-primary" value="<?php _e('Send Feedback') ?>"
560
+ onclick="return octc_quick_contact.validate_form();" />
561
+ <br/>
562
+ What data will be sent
563
+ <a href='javascript:void(0);'
564
+ onclick='jQuery(".octc_data_to_be_sent").toggle();'>(show/hide)</a>
565
+ <div class="hide-is-js app-hide octc_data_to_be_sent">
566
+ <textarea class="widefat0" rows="4" readonly="readonly" disabled="disabled"><?php
567
+ foreach ($hidden_data as $key => $val) {
568
+ if (is_array($val)) {
569
+ $val = var_export($val, 1);
570
+ }
571
+
572
+ echo "$key: $val\n";
573
+ }
574
+ ?></textarea>
575
+ </div>
576
+ </form>
577
+ </div>
578
+ </div> <!-- .inside -->
579
+ </div> <!-- .postbox --> <!-- /quick-contact -->
580
 
581
  <!-- Hire Us -->
582
  <div class="postbox">
622
  </div> <!-- .inside -->
623
  </div> <!-- .postbox -->
624
 
625
+ <?php //orbisius_child_theme_creator_util::output_orb_widget(); ?>
626
 
627
  <?php
628
  $plugin_data = get_plugin_data(__FILE__);
680
  target="_blank" title="[new window]">Orbisius Theme Fixer</a>
681
  </div>
682
  </div> <!-- .postbox -->
683
+
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
684
  </div> <!-- .meta-box-sortables -->
685
 
686
  </div> <!-- #postbox-container-1 .postbox-container sidebar -->
1166
  <div id="postbox-container-1" class="postbox-container">
1167
 
1168
  <div class="meta-box-sortables">
1169
+ <div class="postbox"> <!-- quick-contact -->
1170
+ <?php
1171
+ $current_user = wp_get_current_user();
1172
+ $email = empty($current_user->user_email) ? '' : $current_user->user_email;
1173
+ $quick_form_action = is_ssl()
1174
+ ? 'https://ssl.orbisius.com/apps/quick-contact/'
1175
+ : 'http://apps.orbisius.com/quick-contact/';
1176
+
1177
+ if (!empty($_SERVER['DEV_ENV'])) {
1178
+ $quick_form_action = 'http://localhost/projects/quick-contact/';
1179
+ }
1180
+ ?>
1181
+ <script>
1182
+ var octc_quick_contact = {
1183
+ validate_form : function () {
1184
+ try {
1185
+ var msg = jQuery('#octc_msg').val().trim();
1186
+ var email = jQuery('#octc_email').val().trim();
1187
+
1188
+ email = email.replace(/\s+/, '');
1189
+ email = email.replace(/\.+/, '.');
1190
+ email = email.replace(/\@+/, '@');
1191
+
1192
+ if ( msg == '' ) {
1193
+ alert('Enter your message.');
1194
+ jQuery('#octc_msg').focus().val(msg).css('border', '1px solid red');
1195
+ return false;
1196
+ } else {
1197
+ // all is good clear borders
1198
+ jQuery('#octc_msg').css('border', '');
1199
+ }
1200
+
1201
+ if ( email == '' || email.indexOf('@') <= 2 || email.indexOf('.') == -1) {
1202
+ alert('Enter your email and make sure it is valid.');
1203
+ jQuery('#octc_email').focus().val(email).css('border', '1px solid red');
1204
+ return false;
1205
+ } else {
1206
+ // all is good clear borders
1207
+ jQuery('#octc_email').css('border', '');
1208
+ }
1209
+
1210
+ return true;
1211
+ } catch(e) {};
1212
+ }
1213
+ };
1214
+ </script>
1215
+ <h3><span>Quick Question or Suggestion</span></h3>
1216
+ <div class="inside">
1217
+ <div>
1218
+ <form method="post" action="<?php echo $quick_form_action; ?>" target="_blank">
1219
+ <?php
1220
+ global $wp_version;
1221
+ $plugin_data = get_plugin_data(__FILE__);
1222
+
1223
+ $hidden_data = array(
1224
+ 'site_url' => site_url(),
1225
+ 'wp_ver' => $wp_version,
1226
+ 'first_name' => $current_user->first_name,
1227
+ 'last_name' => $current_user->last_name,
1228
+ 'product_name' => $plugin_data['Name'],
1229
+ 'product_ver' => $plugin_data['Version'],
1230
+ 'woocommerce_ver' => defined('WOOCOMMERCE_VERSION') ? WOOCOMMERCE_VERSION : 'n/a',
1231
+ );
1232
+ $hid_data = http_build_query($hidden_data);
1233
+ echo "<input type='hidden' name='data[sys_info]' value='$hid_data' />\n";
1234
+ ?>
1235
+ <textarea class="widefat" id='octc_msg' name='data[msg]' required="required"></textarea>
1236
+ <br/>Your Email: <input type="text" class=""
1237
+ id="octc_email" name='data[sender_email]' placeholder="Email" required="required"
1238
+ value="<?php echo esc_attr($email); ?>"
1239
+ />
1240
+ <br/><input type="submit" class="button-primary" value="<?php _e('Send Feedback') ?>"
1241
+ onclick="return octc_quick_contact.validate_form();" />
1242
+ <br/>
1243
+ What data will be sent
1244
+ <a href='javascript:void(0);'
1245
+ onclick='jQuery(".octc_data_to_be_sent").toggle();'>(show/hide)</a>
1246
+ <div class="hide app-hide octc_data_to_be_sent">
1247
+ <textarea class="widefat" rows="4" readonly="readonly" disabled="disabled"><?php
1248
+ foreach ($hidden_data as $key => $val) {
1249
+ if (is_array($val)) {
1250
+ $val = var_export($val, 1);
1251
+ }
1252
+
1253
+ echo "$key: $val\n";
1254
+ }
1255
+ ?></textarea>
1256
+ </div>
1257
+ </form>
1258
+ </div>
1259
+ </div> <!-- .inside -->
1260
+ </div> <!-- .postbox --> <!-- /quick-contact -->
1261
 
1262
  <div class="postbox">
1263
+ <h3><span>Other products of ours</span></h3>
1264
  <div class="inside">
1265
  <?php echo orbisius_child_theme_creator_top_links('orbisius-child-theme-creator') ; ?>
1266
  </div> <!-- .inside -->
1308
  </div> <!-- .inside -->
1309
  </div> <!-- .postbox -->
1310
 
1311
+ <?php //orbisius_child_theme_creator_util::output_orb_widget(); ?>
1312
 
1313
  <?php
1314
  $plugin_data = get_plugin_data(__FILE__);
1366
  target="_blank" title="[new window]">Orbisius Theme Fixer</a>
1367
  </div>
1368
  </div> <!-- .postbox -->
1369
+
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1370
  </div> <!-- .meta-box-sortables -->
1371
 
1372
  </div> <!-- #postbox-container-1 .postbox-container sidebar -->
1376
  <br class="clear">
1377
  </div> <!-- #poststuff -->
1378
 
1379
+ <?php //orbisius_child_theme_creator_util::output_orb_widget('author'); ?>
1380
  </div> <!-- .wrap -->
1381
  <?php
1382
  }
1409
  $val = orbisius_child_theme_creator_get_request($key, $default);
1410
 
1411
  if (is_scalar($val)) {
1412
+ $val = wp_kses($val, array());
1413
  $val = trim($val);
1414
  } elseif (is_array($key)) {
1415
  $val = array_map('orbisius_child_theme_creator_get', $key);
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_i
4
  Tags: theme,child theme,childtheme,childthemes,parent theme,child themes,CSS,styling,resposive design,design,custom themeing, shared hosting,theme editor theme,themes,wp,wordpress,orbisius,theme creator,custom theme,theme generator,css,css editor
5
  Requires at least: 3.4
6
  Tested up to: 4.8
7
- Stable tag: 1.4.2
8
  License: GPLv2 or later
9
 
10
  Create Child Themes quickly and easily from any theme that you have currently installed on your site/blog.
@@ -166,6 +166,12 @@ Todo
166
 
167
  == Changelog ==
168
 
 
 
 
 
 
 
169
  = 1.4.2 =
170
  * Corrected links to the cloud library api.
171
  * Reduced the Promo messages in the Editor.
4
  Tags: theme,child theme,childtheme,childthemes,parent theme,child themes,CSS,styling,resposive design,design,custom themeing, shared hosting,theme editor theme,themes,wp,wordpress,orbisius,theme creator,custom theme,theme generator,css,css editor
5
  Requires at least: 3.4
6
  Tested up to: 4.8
7
+ Stable tag: 1.4.3
8
  License: GPLv2 or later
9
 
10
  Create Child Themes quickly and easily from any theme that you have currently installed on your site/blog.
166
 
167
  == Changelog ==
168
 
169
+ = 1.4.3 =
170
+ * Removed some of the info about other plugins
171
+ * Using old way of defining arrays e.g. array() and not [] because some hosts still run old php :(
172
+ * Added a notice that the initial message upon plugin activation will disappear in 24h
173
+ * Moved the feedback box higher
174
+
175
  = 1.4.2 =
176
  * Corrected links to the cloud library api.
177
  * Reduced the Promo messages in the Editor.