WP Hide Post - Version 2.0.8

Version Description

Release Date - 1 Aug 2017

Fix: A bug that was causing recurse error and throwing fatal error

Download this release

Release Info

Developer rmahfoud
Plugin Icon wp plugin WP Hide Post
Version 2.0.8
Comparing to
See all releases

Code changes from version 2.0.6 to 2.0.8

admin/class-wp-hide-post-admin.php CHANGED
@@ -1031,7 +1031,7 @@ $current_v = isset($_GET['wphp_hidden_on']) ? $_GET['wphp_hidden_on'] : array();
1031
  if (!$info)
1032
  {
1033
 
1034
- $obj_license = scb_get_license(wp_hide_post()->info('id'));
1035
  $args['action'] = 'wphp_footer';
1036
  $args['page'] = $page;
1037
  if (is_object($obj_license))
1031
  if (!$info)
1032
  {
1033
 
1034
+ $obj_license = scb_get_license('wp-hide-post-pro');
1035
  $args['action'] = 'wphp_footer';
1036
  $args['page'] = $page;
1037
  if (is_object($obj_license))
admin/js/wp-hide-post-admin.js CHANGED
@@ -13,14 +13,14 @@ var wphp_texts = {
13
  "uncaught_error": "Uncaught Error",
14
  "confirm": "Confirm",
15
  };
16
- $(document).ready(function()
17
  {
18
- $(".chosen-select").chosen(
19
  {
20
  'width': '400px'
21
  });
22
- $("body").append('<div id="dialog-message" style="display:none;z-index:2000" title=""></div>');
23
- modalDialog = $("#dialog-message").dialog(
24
  {
25
  modal: true,
26
  autoOpen: false,
@@ -29,12 +29,12 @@ $(document).ready(function()
29
  {
30
  Ok: function()
31
  {
32
- $(this).dialog("close");
33
  }
34
  }
35
  });
36
  /* quick edit ajax handler */
37
- $('a.editinline1').on('click', function(event)
38
  {
39
  var id = inlineEditPost.getId(this);
40
  set_wphp_hide_on_value(id);
@@ -43,13 +43,13 @@ $(document).ready(function()
43
  var data = {
44
  'action': 'wphp_post_visibility_data',
45
  'post_id': post_id,
46
- 'post_type': $("#posts-filter [name='post_type']").val()
47
  };
48
- var save_btn = $('#edit-' + post_id).find('.inline-edit-save>.save')
49
- $(save_btn).data('label', $(save_btn).val());
50
- $(save_btn).val('loading..');
51
- $(save_btn).attr('disabled', true);
52
- $.ajax(
53
  {
54
  type: "POST",
55
  url: ajaxurl,
@@ -61,21 +61,21 @@ $(document).ready(function()
61
  {
62
  showModalMsg(wphp_texts.error, response.error,
63
  {});
64
- $(save_btn).val($(save_btn).data('label'));
65
- $(save_btn).attr('disabled', false)
66
  }
67
  else
68
  {
69
- $(save_btn).val($(save_btn).data('label'));
70
- $(save_btn).attr('disabled', false);
71
- $('.wphp_quickedit').replaceWith(response.html);
72
  }
73
  },
74
  fail: function(xhr, err)
75
  {
76
- id = $(this)[0].data.split('&')[1].split("=")[1];
77
- $(save_btn).val($(save_btn).data('label'));
78
- $(save_btn).attr('disabled', false)
79
  showModalMsg(wphp_texts.error, formatErrorMessage(xhr, err));
80
  }
81
  });
@@ -87,9 +87,9 @@ function showModalMsg(title, body, option)
87
  option = typeof option === 'undefined' ?
88
  {} : option;
89
  option.title = title
90
- $(modalDialog).dialog(option);
91
- $(modalDialog).html(htmlBody(body));
92
- $(modalDialog).dialog("open");
93
  }
94
 
95
  function htmlBody(body)
@@ -144,22 +144,22 @@ function formatErrorMessage(jqXHR, exception)
144
  function set_wphp_hide_on_value(post_id)
145
  {
146
  // define the edit row
147
- var $edit_row = $('#edit-' + post_id);
148
- var $post_row = $('#post-' + post_id);
149
  // get the data
150
- var $wphp_hide_on = $('.column-wphp_hide_on', $post_row);
151
  // populate the data
152
  //$(':input[name="book_author"]', $edit_row).val($book_author);
153
  //$(':input[name="inprint"]', $edit_row).attr('checked', $inprint);
154
  ///
155
- if (!$('.wphp_hidden_on', $wphp_hide_on).length || !$('.wphp_hide_on_data', $wphp_hide_on).length)
156
  {
157
  return;
158
  }
159
- visibility_values = JSON.parse(decodeURIComponent($('.wphp_hidden_on', $wphp_hide_on).val()));
160
- wphp_hide_on_data = JSON.parse(decodeURIComponent($('.wphp_hide_on_data', $wphp_hide_on).val()));
161
 
162
- $('#' + wphp_hide_on_data['nonce_field'], $edit_row).val(wphp_hide_on_data['nonce_value']);
163
 
164
 
165
  // refresh the quick menu properly
@@ -171,13 +171,13 @@ function set_wphp_hide_on_value(post_id)
171
  {
172
  if (visibility_values[key])
173
  {
174
- $('[name="wphp_visibility_type\[' + key + '\]"]', $edit_row).attr('checked', 'checked');
175
  }
176
- $('[name="wphp_visibility_type_old\[' + key + '\]"]', $edit_row).val(visibility_values[key]);
177
  //jQuery('#myfield').val(fieldValue);
178
  }
179
  }
180
- $(document).ready(function()
181
  {
182
  if(typeof inlineEditPost!=='undefined')
183
  {
@@ -201,15 +201,15 @@ $(document).ready(function()
201
  }
202
  };
203
  }
204
- $('#bulk_edit').on('click', function(event)
205
  {
206
  // define the bulk edit row
207
- var $bulk_row = $('#bulk-edit');
208
  // get the selected post ids that are being edited
209
  var $post_ids = new Array();
210
  $bulk_row.find('#bulk-titles').children().each(function()
211
  {
212
- $post_ids.push($(this).attr('id').replace(/^(ttle)/i, ''));
213
  });
214
  var data = {
215
  'action': 'save_bulk_edit_data',
@@ -223,12 +223,12 @@ $(document).ready(function()
223
  itm_old = wphp_hide_on_data['visibility_name'] + '_old[' + key + ']';
224
  itm_old_esc = wphp_hide_on_data['visibility_name'] + '_old\\[' + key + '\\]';
225
  itm1 = wphp_hide_on_data['visibility_name'] + '\\[' + key + '\\]';
226
- data[itm_name] = $("[ name=" + itm_name_esc + "]").attr('checked') ? 1 : 0;
227
- data[itm_old] = $("[ name=" + itm_old_esc + "]").val();
228
  a = 1;
229
  }
230
  // save the data
231
- $.ajax(
232
  {
233
  url: ajaxurl, // this is a variable that WordPress has already defined for us
234
  type: 'POST',
13
  "uncaught_error": "Uncaught Error",
14
  "confirm": "Confirm",
15
  };
16
+ jQuery(document).ready(function()
17
  {
18
+ jQuery(".chosen-select").chosen(
19
  {
20
  'width': '400px'
21
  });
22
+ jQuery("body").append('<div id="dialog-message" style="display:none;z-index:2000" title=""></div>');
23
+ modalDialog = jQuery("#dialog-message").dialog(
24
  {
25
  modal: true,
26
  autoOpen: false,
29
  {
30
  Ok: function()
31
  {
32
+ jQuery(this).dialog("close");
33
  }
34
  }
35
  });
36
  /* quick edit ajax handler */
37
+ jQuery('a.editinline1').on('click', function(event)
38
  {
39
  var id = inlineEditPost.getId(this);
40
  set_wphp_hide_on_value(id);
43
  var data = {
44
  'action': 'wphp_post_visibility_data',
45
  'post_id': post_id,
46
+ 'post_type': jQuery("#posts-filter [name='post_type']").val()
47
  };
48
+ var save_btn = jQuery('#edit-' + post_id).find('.inline-edit-save>.save')
49
+ jQuery(save_btn).data('label', $(save_btn).val());
50
+ jQuery(save_btn).val('loading..');
51
+ jQuery(save_btn).attr('disabled', true);
52
+ jQuery.ajax(
53
  {
54
  type: "POST",
55
  url: ajaxurl,
61
  {
62
  showModalMsg(wphp_texts.error, response.error,
63
  {});
64
+ jQuery(save_btn).val(jQuery(save_btn).data('label'));
65
+ jQuery(save_btn).attr('disabled', false)
66
  }
67
  else
68
  {
69
+ jQuery(save_btn).val(jQuery(save_btn).data('label'));
70
+ jQuery(save_btn).attr('disabled', false);
71
+ jQuery('.wphp_quickedit').replaceWith(response.html);
72
  }
73
  },
74
  fail: function(xhr, err)
75
  {
76
+ id = jQuery(this)[0].data.split('&')[1].split("=")[1];
77
+ jQuery(save_btn).val(jQuery(save_btn).data('label'));
78
+ jQuery(save_btn).attr('disabled', false)
79
  showModalMsg(wphp_texts.error, formatErrorMessage(xhr, err));
80
  }
81
  });
87
  option = typeof option === 'undefined' ?
88
  {} : option;
89
  option.title = title
90
+ jQuery(modalDialog).dialog(option);
91
+ jQuery(modalDialog).html(htmlBody(body));
92
+ jQuery(modalDialog).dialog("open");
93
  }
94
 
95
  function htmlBody(body)
144
  function set_wphp_hide_on_value(post_id)
145
  {
146
  // define the edit row
147
+ var $edit_row = jQuery('#edit-' + post_id);
148
+ var $post_row = jQuery('#post-' + post_id);
149
  // get the data
150
+ var $wphp_hide_on = jQuery('.column-wphp_hide_on', $post_row);
151
  // populate the data
152
  //$(':input[name="book_author"]', $edit_row).val($book_author);
153
  //$(':input[name="inprint"]', $edit_row).attr('checked', $inprint);
154
  ///
155
+ if (!jQuery('.wphp_hidden_on', $wphp_hide_on).length || !jQuery('.wphp_hide_on_data', $wphp_hide_on).length)
156
  {
157
  return;
158
  }
159
+ visibility_values = JSON.parse(decodeURIComponent(jQuery('.wphp_hidden_on', $wphp_hide_on).val()));
160
+ wphp_hide_on_data = JSON.parse(decodeURIComponent(jQuery('.wphp_hide_on_data', $wphp_hide_on).val()));
161
 
162
+ jQuery('#' + wphp_hide_on_data['nonce_field'], $edit_row).val(wphp_hide_on_data['nonce_value']);
163
 
164
 
165
  // refresh the quick menu properly
171
  {
172
  if (visibility_values[key])
173
  {
174
+ jQuery('[name="wphp_visibility_type\[' + key + '\]"]', $edit_row).attr('checked', 'checked');
175
  }
176
+ jQuery('[name="wphp_visibility_type_old\[' + key + '\]"]', $edit_row).val(visibility_values[key]);
177
  //jQuery('#myfield').val(fieldValue);
178
  }
179
  }
180
+ jQuery(document).ready(function()
181
  {
182
  if(typeof inlineEditPost!=='undefined')
183
  {
201
  }
202
  };
203
  }
204
+ jQuery('#bulk_edit').on('click', function(event)
205
  {
206
  // define the bulk edit row
207
+ var $bulk_row = jQuery('#bulk-edit');
208
  // get the selected post ids that are being edited
209
  var $post_ids = new Array();
210
  $bulk_row.find('#bulk-titles').children().each(function()
211
  {
212
+ $post_ids.push(jQuery(this).attr('id').replace(/^(ttle)/i, ''));
213
  });
214
  var data = {
215
  'action': 'save_bulk_edit_data',
223
  itm_old = wphp_hide_on_data['visibility_name'] + '_old[' + key + ']';
224
  itm_old_esc = wphp_hide_on_data['visibility_name'] + '_old\\[' + key + '\\]';
225
  itm1 = wphp_hide_on_data['visibility_name'] + '\\[' + key + '\\]';
226
+ data[itm_name] = jQuery("[ name=" + itm_name_esc + "]").attr('checked') ? 1 : 0;
227
+ data[itm_old] = jQuery("[ name=" + itm_old_esc + "]").val();
228
  a = 1;
229
  }
230
  // save the data
231
+ jQuery.ajax(
232
  {
233
  url: ajaxurl, // this is a variable that WordPress has already defined for us
234
  type: 'POST',
admin/license/LicenseManager.php CHANGED
@@ -21,7 +21,7 @@ class SCB_LicenseManager
21
  }
22
  if (is_null($encrypter))
23
  {
24
- $encrypter = new Encryption();
25
  }
26
  $this->items[$id] = new SCB_LicenseItem($store?$store:'http://scriptburn.com', $item_type, $item_name, $encrypter, $options);
27
  return $this->items[$id];
21
  }
22
  if (is_null($encrypter))
23
  {
24
+ $encrypter = new WP_Hide_Post_Encryption();
25
  }
26
  $this->items[$id] = new SCB_LicenseItem($store?$store:'http://scriptburn.com', $item_type, $item_name, $encrypter, $options);
27
  return $this->items[$id];
admin/license/encryption.php CHANGED
@@ -14,7 +14,7 @@
14
  * - Does HMAC verification of source data
15
  *
16
  */
17
- class Encryption
18
  {
19
 
20
  const METHOD = 'aes-256-cbc';
14
  * - Does HMAC verification of source data
15
  *
16
  */
17
+ class WP_Hide_Post_Encryption
18
  {
19
 
20
  const METHOD = 'aes-256-cbc';
includes/class-wp-hide-post.php CHANGED
@@ -418,7 +418,7 @@ class wp_hide_post
418
  'setting_page_name' => $this->setting_menu_page(),
419
  'support_callback' => function ()
420
  {
421
- $obj_license = scb_get_license($this->info('id'));
422
  $info = array();
423
  $info['price'] = "0";
424
  if (is_object($obj_license))
@@ -432,8 +432,9 @@ class wp_hide_post
432
  $info['price'] = 1;
433
  if ($info['price'] > 0)
434
  {
 
435
  $output[] = '<h2>For WP hide post Pro users</h2>';
436
- if ($info['key'] && $info['license'] == 'valid')
437
  {
438
  $subject = ("WP hide post Pro Support Request");
439
  $body = "";
@@ -453,7 +454,7 @@ class wp_hide_post
453
  echo (implode("\n", $output));
454
  },
455
  ));
456
- if (wphp_ispro())
457
  {
458
 
459
  scb_license_manager()->add(
418
  'setting_page_name' => $this->setting_menu_page(),
419
  'support_callback' => function ()
420
  {
421
+ $obj_license = scb_get_license('wp-hide-post-pro');
422
  $info = array();
423
  $info['price'] = "0";
424
  if (is_object($obj_license))
432
  $info['price'] = 1;
433
  if ($info['price'] > 0)
434
  {
435
+
436
  $output[] = '<h2>For WP hide post Pro users</h2>';
437
+ if (@$info['key'] && @$info['license'] == 'valid')
438
  {
439
  $subject = ("WP hide post Pro Support Request");
440
  $body = "";
454
  echo (implode("\n", $output));
455
  },
456
  ));
457
+ if ((defined('WPHP_PRO') && WPHP_PRO) || $this->info('id') == 'wp-hide-post-pro')
458
  {
459
 
460
  scb_license_manager()->add(
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: http://scriptburn.com/wp-hide-post/
4
  Tags: SEO,hide,show,visbility,privacy,customization,sitemap,filter
5
  Requires at least: 2.6
6
  Tested up to: 4.8
7
- Stable tag: 2.0.6
8
  License: GPLv2
9
 
10
  Control the visibility of items on your blog by making posts/pages hidden on some parts , while still visible in other parts and search engines.
@@ -111,6 +111,16 @@ Ditto. It will be deleted. If you had any existing data (if you had it active be
111
 
112
  == Changelog ==
113
 
 
 
 
 
 
 
 
 
 
 
114
  = 2.0.6 =
115
  *Release Date - 31 July 2017*
116
 
4
  Tags: SEO,hide,show,visbility,privacy,customization,sitemap,filter
5
  Requires at least: 2.6
6
  Tested up to: 4.8
7
+ Stable tag: 2.0.8
8
  License: GPLv2
9
 
10
  Control the visibility of items on your blog by making posts/pages hidden on some parts , while still visible in other parts and search engines.
111
 
112
  == Changelog ==
113
 
114
+ = 2.0.8 =
115
+ *Release Date - 1 Aug 2017*
116
+
117
+ Fix: A bug that was causing recurse error and throwing fatal error
118
+
119
+ = 2.0.7 =
120
+ *Release Date - 31 July 2017*
121
+
122
+ Fix: Renamed some conflicting class name with other plugins
123
+
124
  = 2.0.6 =
125
  *Release Date - 31 July 2017*
126
 
wp-hide-post.php CHANGED
@@ -16,7 +16,7 @@
16
  * Plugin Name: WP Hide Post
17
  * Plugin URI: http://scriptburn.com/wp-hide-post
18
  * Description: Control the visibility of items on your blog by making posts/pages hidden on some parts , while still visible in other parts and search engines.
19
- * Version: 2.0.6
20
  * Author: scriptburn.com
21
  * Author URI: http://www.scriptburn.com
22
  * License: GPL-2.0+
@@ -31,7 +31,7 @@ if (!defined('WPINC'))
31
  die;
32
  }
33
  global $table_prefix;
34
- define('WPHP_VER', "2.0.6");
35
  define('WPHP_DB_VER', "2");
36
 
37
  define('WPHP_PLUGIN_DIR', __DIR__ . "/");
16
  * Plugin Name: WP Hide Post
17
  * Plugin URI: http://scriptburn.com/wp-hide-post
18
  * Description: Control the visibility of items on your blog by making posts/pages hidden on some parts , while still visible in other parts and search engines.
19
+ * Version: 2.0.8
20
  * Author: scriptburn.com
21
  * Author URI: http://www.scriptburn.com
22
  * License: GPL-2.0+
31
  die;
32
  }
33
  global $table_prefix;
34
+ define('WPHP_VER', "2.0.8");
35
  define('WPHP_DB_VER', "2");
36
 
37
  define('WPHP_PLUGIN_DIR', __DIR__ . "/");