Inline Related Posts - Version 3.0.11

Version Description

Release Date - 2022-10-11

  • IWP-128 Sort posts in editor dropdown by most recent date first
  • IWP-401 fix grammar error in powered by setting
  • IWP-425 Add option to remove redundant style blocks
Download this release

Release Info

Developer data443
Plugin Icon 128x128 Inline Related Posts
Version 3.0.11
Comparing to
See all releases

Code changes from version 3.0.10 to 3.0.11

assets/js/common.js CHANGED
@@ -227,7 +227,6 @@ jQuery(function () {
227
  cache: true
228
  },
229
  placeholder: "Type here to search an item...",
230
- minimumInputLength: 3,
231
  width: '100%'
232
  });
233
 
227
  cache: true
228
  },
229
  placeholder: "Type here to search an item...",
 
230
  width: '100%'
231
  });
232
 
includes/admin/settings.php CHANGED
@@ -53,7 +53,9 @@ function irp_ui_box_preview() {
53
  $ids[]=$p->ID;
54
  }
55
  if(count($ids)==0) {
56
- echo "<b>No posts available. Check settings and try again</b>";
 
 
57
  die();
58
  }
59
 
@@ -62,7 +64,7 @@ function irp_ui_box_preview() {
62
  $args['includeCss']=TRUE;
63
  $args['preview']=TRUE;
64
  $box=irp_ui_get_box($ids, $args);
65
- echo wp_kses( $box, $irp->Utils->kses_allowed_html() );
66
  die();
67
  }
68
  function irp_ui_settings() {
@@ -98,6 +100,7 @@ function irp_ui_settings() {
98
  $irp->Options->setRewriteAtEnd($irp->Utils->iqs('irpRewriteAtEnd'));
99
  $irp->Options->setRewriteStaticLinks($irp->Utils->iqs('irpRewriteStaticLinks'));
100
  $irp->Options->setPlaceInsideSpanElements($irp->Utils->iqs('irpPlaceInsideSpanElements'));
 
101
 
102
  $irp->Options->setEngineSearch($irp->Utils->iqs('irpEngineSearch', IRP_ENGINE_SEARCH_CATEGORIES_TAGS));
103
 
@@ -188,6 +191,8 @@ function irp_ui_settings() {
188
  $irp->Form->checkbox('irpRewriteAtEnd', $irp->Options->isRewriteAtEnd());
189
  $irp->Form->checkbox('irpRewriteStaticLinks', $irp->Options->isRewriteStaticLinks());
190
  $irp->Form->checkbox('irpPlaceInsideSpanElements', $irp->Options->isPlaceInsideSpanElements());
 
 
191
  $irp->Form->p('');
192
 
193
  $options=$irp->Options->getRewritePostTypes();
53
  $ids[]=$p->ID;
54
  }
55
  if(count($ids)==0) {
56
+ echo "<b>";
57
+ echo __( "No posts available. Check settings and try again.", IRP_PLUGIN_SLUG );
58
+ echo "</b>";
59
  die();
60
  }
61
 
64
  $args['includeCss']=TRUE;
65
  $args['preview']=TRUE;
66
  $box=irp_ui_get_box($ids, $args);
67
+ echo wp_kses( $box, $irp->Utils->kses_allowed_html(), array('http', 'https', 'javascript') );
68
  die();
69
  }
70
  function irp_ui_settings() {
100
  $irp->Options->setRewriteAtEnd($irp->Utils->iqs('irpRewriteAtEnd'));
101
  $irp->Options->setRewriteStaticLinks($irp->Utils->iqs('irpRewriteStaticLinks'));
102
  $irp->Options->setPlaceInsideSpanElements($irp->Utils->iqs('irpPlaceInsideSpanElements'));
103
+ $irp->Options->setDoNotIncludeCssInBox($irp->Utils->iqs('irpDoNotIncludeCssInBox'));
104
 
105
  $irp->Options->setEngineSearch($irp->Utils->iqs('irpEngineSearch', IRP_ENGINE_SEARCH_CATEGORIES_TAGS));
106
 
191
  $irp->Form->checkbox('irpRewriteAtEnd', $irp->Options->isRewriteAtEnd());
192
  $irp->Form->checkbox('irpRewriteStaticLinks', $irp->Options->isRewriteStaticLinks());
193
  $irp->Form->checkbox('irpPlaceInsideSpanElements', $irp->Options->isPlaceInsideSpanElements());
194
+ $irp->Form->checkbox('irpDoNotIncludeCssInBox', $irp->Options->isDoNotIncludeCssInBox());
195
+
196
  $irp->Form->p('');
197
 
198
  $options=$irp->Options->getRewritePostTypes();
includes/classes/html/HTMLContext.php CHANGED
@@ -426,6 +426,7 @@ class IRP_HTMLContext {
426
  'comment'=>$comment
427
  , 'shortcode'=>FALSE
428
  );
 
429
  $box=irp_ui_get_box($ids, $options);
430
  if($box!='') {
431
  $this->pushRelatedBox($box);
426
  'comment'=>$comment
427
  , 'shortcode'=>FALSE
428
  );
429
+ $options['includeCss'] = ! $irp->Options->isDoNotIncludeCssInBox();
430
  $box=irp_ui_get_box($ids, $options);
431
  if($box!='') {
432
  $this->pushRelatedBox($box);
includes/classes/utils/AppOptions.php CHANGED
@@ -175,7 +175,14 @@ class IRP_AppOptions extends IRP_Options {
175
  $names=$irp->HtmlTemplate->getTemplatesNames();
176
  if($result['template']=='' || !in_array($result['template'], $names)) {
177
  if(count($names)>0) {
178
- $result['template']='Minimalist';//$names[0];
 
 
 
 
 
 
 
179
  }
180
  }
181
  return $result;
@@ -200,6 +207,15 @@ class IRP_AppOptions extends IRP_Options {
200
  $this->setOption('PlaceInsideSpanElements', $value);
201
  }
202
 
 
 
 
 
 
 
 
 
 
203
  public function isRewriteStaticLinks()
204
  {
205
  return $this->getOption('RewriteStaticLinks', false);
@@ -210,7 +226,6 @@ class IRP_AppOptions extends IRP_Options {
210
  if (!$value && $this->isRewriteStaticLinks()) {
211
  // remove all saved links
212
  global $wpdb;
213
- $sql = "DELETE FROM `wp_options` where option_name like 'IRP_POST_%'";
214
  $wpdb->query( $wpdb->prepare( "DELETE FROM `wp_options` where option_name like 'IRP_POST_%'" ) );
215
  }
216
  $this->setOption('RewriteStaticLinks', $value);
175
  $names=$irp->HtmlTemplate->getTemplatesNames();
176
  if($result['template']=='' || !in_array($result['template'], $names)) {
177
  if(count($names)>0) {
178
+ $n = 'Minimalist';
179
+ $dt = $irp->HtmlTemplate->getDefaults();
180
+
181
+ $result['template'] = $n;
182
+ $result['ctaTextColor'] = $this->getColor( $dt[$n]['ctaTextColor'] );
183
+ $result['postTitleColor'] = $this->getColor( $dt[$n]['postTitleColor'] );
184
+ $result['boxColor'] = $this->getColor( $dt[$n]['boxColor'] );
185
+ $result['borderColor'] = $this->getColor( $dt[$n]['borderColor'] );
186
  }
187
  }
188
  return $result;
207
  $this->setOption('PlaceInsideSpanElements', $value);
208
  }
209
 
210
+ public function isDoNotIncludeCssInBox() {
211
+ // 0 = include css with the link box, 1 = put css at end of body
212
+ return $this->getOption('DoNotIncludeCssInBox', 0);
213
+ }
214
+
215
+ public function setDoNotIncludeCssInBox($value) {
216
+ $this->setOption('DoNotIncludeCssInBox', $value);
217
+ }
218
+
219
  public function isRewriteStaticLinks()
220
  {
221
  return $this->getOption('RewriteStaticLinks', false);
226
  if (!$value && $this->isRewriteStaticLinks()) {
227
  // remove all saved links
228
  global $wpdb;
 
229
  $wpdb->query( $wpdb->prepare( "DELETE FROM `wp_options` where option_name like 'IRP_POST_%'" ) );
230
  }
231
  $this->setOption('RewriteStaticLinks', $value);
includes/core.php CHANGED
@@ -101,6 +101,7 @@ function irp_shortcode($atts, $content='') {
101
  unset($options[$k]);
102
  }
103
  }
 
104
  $result=irp_ui_get_box($ids, $options);
105
  if($result!='') {
106
  $irp->Options->setShortcodeUsed(TRUE);
@@ -312,11 +313,11 @@ function irp_get_list_posts() {
312
  $postType = sanitize_text_field( $_REQUEST['irp_post_type'] );
313
  }
314
  $query = array(
315
- 'posts_per_page' => 50,
316
  'post_status' => 'publish',
317
  'post_type' => $postType,
318
- 'order' => 'ASC',
319
- 'orderby' => 'title',
320
  'suppress_filters' => false,
321
  );
322
 
101
  unset($options[$k]);
102
  }
103
  }
104
+ $options['includeCss'] = ! $irp->Options->isDoNotIncludeCssInBox();
105
  $result=irp_ui_get_box($ids, $options);
106
  if($result!='') {
107
  $irp->Options->setShortcodeUsed(TRUE);
313
  $postType = sanitize_text_field( $_REQUEST['irp_post_type'] );
314
  }
315
  $query = array(
316
+ 'posts_per_page' => 100,
317
  'post_status' => 'publish',
318
  'post_type' => $postType,
319
+ 'order' => 'DESC',
320
+ 'orderby' => 'date',
321
  'suppress_filters' => false,
322
  );
323
 
index.php CHANGED
@@ -6,7 +6,7 @@ Description: Inline Related Posts AUTOMATICALLY inserts related posts INSIDE you
6
  Author: Data443
7
  Author URI: https://Data443.com/
8
  Email: support@intellywp.com
9
- Version: 3.0.10
10
  Requires at least: 3.6.0
11
  Requires PHP: 7.3
12
  */
@@ -14,7 +14,7 @@ define('IRP_PLUGIN_PREFIX', 'IRP_');
14
  define('IRP_PLUGIN_FILE',__FILE__);
15
  define('IRP_PLUGIN_SLUG', 'intelly-related-posts');
16
  define('IRP_PLUGIN_NAME', 'Inline Related Posts');
17
- define('IRP_PLUGIN_VERSION', '3.0.10');
18
  define('IRP_PLUGIN_AUTHOR', 'Data443');
19
  define('IRP_PLUGIN_ROOT', dirname(__FILE__).'/');
20
  define('IRP_PLUGIN_IMAGES', plugins_url( 'assets/images/', __FILE__ ));
6
  Author: Data443
7
  Author URI: https://Data443.com/
8
  Email: support@intellywp.com
9
+ Version: 3.0.11
10
  Requires at least: 3.6.0
11
  Requires PHP: 7.3
12
  */
14
  define('IRP_PLUGIN_FILE',__FILE__);
15
  define('IRP_PLUGIN_SLUG', 'intelly-related-posts');
16
  define('IRP_PLUGIN_NAME', 'Inline Related Posts');
17
+ define('IRP_PLUGIN_VERSION', '3.0.11');
18
  define('IRP_PLUGIN_AUTHOR', 'Data443');
19
  define('IRP_PLUGIN_ROOT', dirname(__FILE__).'/');
20
  define('IRP_PLUGIN_IMAGES', plugins_url( 'assets/images/', __FILE__ ));
languages/Lang.txt CHANGED
@@ -92,20 +92,21 @@ Settings.irpText=Related text
92
  Settings.irpBackgroundColor=Background Color
93
  Settings.irpBorderColor=Border Color
94
  Settings.irpRewriteActive=Insert in already existing posts?
95
- Settings.irpRewriteStaticLinks=Keep links static once inserted.
96
  Settings.irpRewriteBoxesCount=How many boxes per single post?
97
  Settings.irpRewritePostsInBoxCount=Max posts per box N.
98
  Settings.irpRewriteThreshold=Interval between the boxes <i>(minimum N° words)</i>
99
  Settings.irpHookPriority=<strong>the_content</strong> hook priority</i>
100
  Settings.irpRewriteAtEnd=Insert a box at the end of the post? (if needed)
101
  Settings.irpPlaceInsideSpanElements=Place links inside of SPAN elements.
 
102
  Settings.irpRewritePostType=Use on <b>{0}</b>
103
  Settings.irpRewritePostsDays=Only posts of last N. days<br /><i>(set zero for no limits)</i>
104
  Settings.irpEngineSearch=Search similar posts
105
  Settings.irpEngineSearch.0=Using categories and tags
106
  Settings.irpEngineSearch.1=Using only categories
107
  Settings.irpEngineSearch.2=Using only tags
108
- Settings.irpShowPoweredBy=Display "Powered by" text<br/><i>(and show us some love :)</i>
109
  Settings.irpTemplate=Box template
110
  Settings.irpTemplateBackgroundColor=Background color
111
  Settings.irpTemplateBorderColor=Left border color
@@ -146,7 +147,7 @@ Settings.template-borderColorHover=Border Color Hover
146
  Settings.template-useHoverDefaults=Use template hover colors schema
147
  Settings.template-template=Theme
148
  Settings.template-hasShadow=Display border shadow
149
- Settings.template-hasPoweredBy=Display "Powered by" text <i>(and show us some love :)</i>
150
  Settings.template-boxOpacity=Initial opacity %
151
  Settings.Color.border=Border Color
152
  Settings.Color.arrow=Arrow background Color
92
  Settings.irpBackgroundColor=Background Color
93
  Settings.irpBorderColor=Border Color
94
  Settings.irpRewriteActive=Insert in already existing posts?
95
+ Settings.irpRewriteStaticLinks=Keep links static once inserted (this setting increases the load on your database).
96
  Settings.irpRewriteBoxesCount=How many boxes per single post?
97
  Settings.irpRewritePostsInBoxCount=Max posts per box N.
98
  Settings.irpRewriteThreshold=Interval between the boxes <i>(minimum N° words)</i>
99
  Settings.irpHookPriority=<strong>the_content</strong> hook priority</i>
100
  Settings.irpRewriteAtEnd=Insert a box at the end of the post? (if needed)
101
  Settings.irpPlaceInsideSpanElements=Place links inside of SPAN elements.
102
+ Settings.irpDoNotIncludeCssInBox=Don't duplicate link box CSS code when multiple boxes are on a page.
103
  Settings.irpRewritePostType=Use on <b>{0}</b>
104
  Settings.irpRewritePostsDays=Only posts of last N. days<br /><i>(set zero for no limits)</i>
105
  Settings.irpEngineSearch=Search similar posts
106
  Settings.irpEngineSearch.0=Using categories and tags
107
  Settings.irpEngineSearch.1=Using only categories
108
  Settings.irpEngineSearch.2=Using only tags
109
+ Settings.irpShowPoweredBy=Display "Powered by" text<br/><i>(and show us some love!)</i>
110
  Settings.irpTemplate=Box template
111
  Settings.irpTemplateBackgroundColor=Background color
112
  Settings.irpTemplateBorderColor=Left border color
147
  Settings.template-useHoverDefaults=Use template hover colors schema
148
  Settings.template-template=Theme
149
  Settings.template-hasShadow=Display border shadow
150
+ Settings.template-hasPoweredBy=Display "Powered by" text <i>(and show us some love!)</i>
151
  Settings.template-boxOpacity=Initial opacity %
152
  Settings.Color.border=Border Color
153
  Settings.Color.arrow=Arrow background Color
readme.txt CHANGED
@@ -4,7 +4,7 @@ Tags: related post, related posts,inline related posts, inside related posts, su
4
  Requires at least: 3.6
5
  Tested up to: 6.0
6
  Requires PHP: 7.3
7
- Stable tag: 3.0.10
8
 
9
  Inline Related Posts AUTOMATICALLY inserts related posts INSIDE your content, capturing immediately the reader's attention.
10
 
@@ -95,6 +95,13 @@ Absolutely Not! Inline Related Posts is built with lightweight code so you won
95
 
96
  For detailed release notes, see our documentation here: [https://intellywp.com/docs/](https://data443.atlassian.net/servicedesk/customer/portal/17/article/858652673).
97
 
 
 
 
 
 
 
 
98
  = 3.0.10 =
99
  *Release Date - 2022-9-21
100
 
4
  Requires at least: 3.6
5
  Tested up to: 6.0
6
  Requires PHP: 7.3
7
+ Stable tag: 3.0.11
8
 
9
  Inline Related Posts AUTOMATICALLY inserts related posts INSIDE your content, capturing immediately the reader's attention.
10
 
95
 
96
  For detailed release notes, see our documentation here: [https://intellywp.com/docs/](https://data443.atlassian.net/servicedesk/customer/portal/17/article/858652673).
97
 
98
+ = 3.0.11 =
99
+ *Release Date - 2022-10-11*
100
+
101
+ * IWP-128 Sort posts in editor dropdown by most recent date first
102
+ * IWP-401 fix grammar error in powered by setting
103
+ * IWP-425 Add option to remove redundant style blocks
104
+
105
  = 3.0.10 =
106
  *Release Date - 2022-9-21
107