Yet Another Related Posts Plugin (YARPP) - Version 5.25.0

Version Description

(23-June-2021) = * Enhancement: Cleaned up old unused code (adkengage)

Download this release

Release Info

Developer jeffparker
Plugin Icon 128x128 Yet Another Related Posts Plugin (YARPP)
Version 5.25.0
Comparing to
See all releases

Code changes from version 5.24.0 to 5.25.0

classes/YARPP_Admin.php CHANGED
@@ -338,7 +338,7 @@ class YARPP_Admin {
338
  echo $this->markdown( $matches[1] );
339
  } else {
340
  echo(
341
- '<a href="https://wordpress.org/plugins/yet-another-related-posts-plugin/#faq" target="_blank">' .
342
  __( 'Developing with YARPP', 'yarpp' ) .
343
  '</a>'
344
  );
@@ -500,19 +500,15 @@ class YARPP_Admin {
500
  $replacements = array(
501
  // strip each line
502
  '!\s*[\r\n] *!' => "\n",
503
-
504
  // headers
505
  '!^=(.*?)=\s*$!m' => '<h3>\1</h3>',
506
-
507
  // bullets
508
  '!^(\* .*([\r\n]\* .*)*)$!m' => "<ul>\n\\1\n</ul>",
509
  '!^\* (.*?)$!m' => '<li>\1</li>',
510
  '!^(\d+\. .*([\r\n]\d+\. .*)*)$!m' => "<ol>\n\\1\n</ol>",
511
  '!^\d+\. (.*?)$!m' => '<li>\1</li>',
512
-
513
  // code block
514
  '!^(\t.*([\r\n]\t.*)*)$!m' => "<pre>\n\\1\n</pre>",
515
-
516
  // wrap p
517
  '!^([^<\t].*[^>])$!m' => '<p>\1</p>',
518
  // bold
338
  echo $this->markdown( $matches[1] );
339
  } else {
340
  echo(
341
+ '<a href="https://wordpress.org/plugins/yet-another-related-posts-plugin/#installation" target="_blank">' .
342
  __( 'Developing with YARPP', 'yarpp' ) .
343
  '</a>'
344
  );
500
  $replacements = array(
501
  // strip each line
502
  '!\s*[\r\n] *!' => "\n",
 
503
  // headers
504
  '!^=(.*?)=\s*$!m' => '<h3>\1</h3>',
 
505
  // bullets
506
  '!^(\* .*([\r\n]\* .*)*)$!m' => "<ul>\n\\1\n</ul>",
507
  '!^\* (.*?)$!m' => '<li>\1</li>',
508
  '!^(\d+\. .*([\r\n]\d+\. .*)*)$!m' => "<ol>\n\\1\n</ol>",
509
  '!^\d+\. (.*?)$!m' => '<li>\1</li>',
 
510
  // code block
511
  '!^(\t.*([\r\n]\t.*)*)$!m' => "<pre>\n\\1\n</pre>",
 
512
  // wrap p
513
  '!^([^<\t].*[^>])$!m' => '<p>\1</p>',
514
  // bold
classes/YARPP_Core.php CHANGED
@@ -1484,11 +1484,11 @@ class YARPP {
1484
 
1485
  // Add CSS class to identify template.
1486
  if ( isset( $template ) && $template ) {
1487
- // Normalize "thumbnail" and "thumbnails" to reference the same inbuilt template
1488
  if ( $template === 'thumbnail' ) {
1489
  $template = 'thumbnails';
1490
  }
1491
- // Sanitize template name; remove file extension if exists
1492
  if ( strpos( $template, '.php' ) ) {
1493
  $template_css_class_suffix = preg_replace( '/' . preg_quote( '.php', '/' ) . '$/', '', $template );
1494
  } else {
@@ -1496,7 +1496,7 @@ class YARPP {
1496
  }
1497
  $output .= " yarpp-template-$template_css_class_suffix";
1498
  } else {
1499
- // fallback to default template ("list")
1500
  $output .= ' yarpp-template-list';
1501
  }
1502
 
@@ -1552,7 +1552,7 @@ class YARPP {
1552
  '<p>' .
1553
  sprintf(
1554
  __(
1555
- "Powered by <a href='%s' title='WordPress Related Posts Plugin' target='_blank'>YARPP</a>.",
1556
  'yarpp'
1557
  ),
1558
  'https://yarpp.com'
1484
 
1485
  // Add CSS class to identify template.
1486
  if ( isset( $template ) && $template ) {
1487
+ // Normalize "thumbnail" and "thumbnails" to reference the same inbuilt template
1488
  if ( $template === 'thumbnail' ) {
1489
  $template = 'thumbnails';
1490
  }
1491
+ // Sanitize template name; remove file extension if exists
1492
  if ( strpos( $template, '.php' ) ) {
1493
  $template_css_class_suffix = preg_replace( '/' . preg_quote( '.php', '/' ) . '$/', '', $template );
1494
  } else {
1496
  }
1497
  $output .= " yarpp-template-$template_css_class_suffix";
1498
  } else {
1499
+ // fallback to default template ("list")
1500
  $output .= ' yarpp-template-list';
1501
  }
1502
 
1552
  '<p>' .
1553
  sprintf(
1554
  __(
1555
+ "Powered by <a href='%s' title='WordPress Related Posts' target='_blank'>YARPP</a>.",
1556
  'yarpp'
1557
  ),
1558
  'https://yarpp.com'
includes/phtmls/yarpp_meta_box_beforeafter.phtml CHANGED
@@ -1,27 +1,27 @@
1
- <div class="yarpp_form_row yarpp_form_textbox <?php echo $class ?>">
2
- <div class="yarpp_form_label">
3
- <?php echo $desc ?>
4
- </div>
5
- <div>
6
- <?php $value = esc_attr(yarpp_get_option($options[0])) ?>
7
- <input
8
- name="<?php echo $options[0] ?>"
9
- type="text"
10
- id="<?php echo $options[0] ?>"
11
- value="<?php echo $value ?>"
12
- size="<?php echo $size ?>"
13
- />
14
- <span class="yarpp_divider">/</span>
15
- <?php $value = esc_attr(yarpp_get_option($options[1])) ?>
16
- <input
17
- name="<?php echo $options[1] ?>"
18
- type="text"
19
- id="<?php echo $options[1] ?>"
20
- value="<?php echo $value ?>"
21
- size="<?php echo $size ?>"
22
- />
23
- <?php if($note): ?>
24
- &nbsp;<em><small><?php echo $note ?></small></em>
25
- <?php endif ?>
26
- </div>
27
- </div>
1
+ <div class="yarpp_form_row yarpp_form_textbox <?php echo $class; ?>">
2
+ <div class="yarpp_form_label">
3
+ <?php echo $desc; ?>
4
+ </div>
5
+ <div>
6
+ <?php $value = esc_attr( yarpp_get_option( $options[0] ) ); ?>
7
+ <input
8
+ name="<?php echo $options[0]; ?>"
9
+ type="text"
10
+ id="<?php echo $options[0]; ?>"
11
+ value="<?php echo $value; ?>"
12
+ size="<?php echo $size; ?>"
13
+ />
14
+ <span class="yarpp_divider">/</span>
15
+ <?php $value = esc_attr( yarpp_get_option( $options[1] ) ); ?>
16
+ <input
17
+ name="<?php echo $options[1]; ?>"
18
+ type="text"
19
+ id="<?php echo $options[1]; ?>"
20
+ value="<?php echo $value; ?>"
21
+ size="<?php echo $size; ?>"
22
+ />
23
+ <?php if ( $note ) : ?>
24
+ &nbsp;<em><small><?php echo $note; ?></small></em>
25
+ <?php endif ?>
26
+ </div>
27
+ </div>
includes/phtmls/yarpp_meta_box_checkbox.phtml CHANGED
@@ -1,20 +1,20 @@
1
- <div class="yarpp_form_row yarpp_form_checkbox <?php echo $class ?>">
2
- <?php if( isset( $yarpp_args['template_type'] ) && 'right-aligned-checkbox' === $yarpp_args['template_type'] ) { ?>
3
- <div class="yarpp_form_label">
4
- <?php echo $desc ?>
5
- </div>&nbsp;
6
  <?php } ?>
7
- <div scope="row">
8
- <input
9
- type="checkbox"
10
- name="<?php echo $option ?>"
11
- id="yarpp-<?php echo $option ?>"
12
- value="true"
13
- <?php checked((isset($yarpp_args['option_value'])) ? $yarpp_args['option_value'] : yarpp_get_option($option)) ?>
14
- <?php echo (isset($yarpp_args['disabled_checkbox'])) ? $yarpp_args['disabled_checkbox'] : '';?>
15
- />
16
- <?php if ( ! isset( $yarpp_args['template_type'] ) || 'right-aligned-checkbox' !== $yarpp_args['template_type'] ) { ?>
17
- <label for="yarpp-<?php echo $option ?>"><?php echo $desc ?></label>
18
- <?php } ?>
19
- </div>
20
  </div>
1
+ <div class="yarpp_form_row yarpp_form_checkbox <?php echo $class; ?>">
2
+ <?php if ( isset( $yarpp_args['template_type'] ) && 'right-aligned-checkbox' === $yarpp_args['template_type'] ) { ?>
3
+ <div class="yarpp_form_label">
4
+ <?php echo $desc; ?>
5
+ </div>&nbsp;
6
  <?php } ?>
7
+ <div scope="row">
8
+ <input
9
+ type="checkbox"
10
+ name="<?php echo $option; ?>"
11
+ id="yarpp-<?php echo $option; ?>"
12
+ value="true"
13
+ <?php checked( ( isset( $yarpp_args['option_value'] ) ) ? $yarpp_args['option_value'] : yarpp_get_option( $option ) ); ?>
14
+ <?php echo ( isset( $yarpp_args['disabled_checkbox'] ) ) ? $yarpp_args['disabled_checkbox'] : ''; ?>
15
+ />
16
+ <?php if ( ! isset( $yarpp_args['template_type'] ) || 'right-aligned-checkbox' !== $yarpp_args['template_type'] ) { ?>
17
+ <label for="yarpp-<?php echo $option; ?>"><?php echo $desc; ?></label>
18
+ <?php } ?>
19
+ </div>
20
  </div>
includes/phtmls/yarpp_meta_box_pool.phtml CHANGED
@@ -1,61 +1,61 @@
1
  <p>
2
- <?php
3
- _e(
4
- '"The Pool" refers to the pool of posts and pages that are candidates for display as related to the current entry.',
5
- 'yarpp'
6
- )
7
- ?>
8
  </p>
9
 
10
  <?php
11
- $this->include_post_type();
12
- foreach ($yarpp->get_taxonomies() as $taxonomy) {
13
- $this->exclude($taxonomy->name, sprintf(__('Disallow by %s:', 'yarpp'), ucwords($taxonomy->labels->name)), $taxonomy->_builtin);
14
- }
15
-
16
- $this->checkbox('show_pass_post', __('Display password protected posts', 'yarpp'));
17
- $this->checkbox( 'include_sticky_posts', __( "Display sticky posts", 'yarpp' ) );
18
- $recent = yarpp_get_option('recent');
19
- if ((bool) $recent) {
20
- list($recent_number, $recent_units) = explode(' ', $recent);
21
- } else {
22
- $recent_number = 12;
23
- $recent_units = 'month';
24
- }
25
-
26
- $recent_number_html = '<input name="recent_number" type="text" id="recent_number" value="'.esc_attr($recent_number).'" size="2" />';
27
-
28
- $recent_units_html = '<select name="recent_units" id="recent_units" style="vertical-align:inherit">';
29
- foreach($yarpp->recent_units() as $value => $translated_string){
30
- $recent_units_html .= '<option value="' . esc_attr($value) . '" ' . (($recent_units === $value) ? 'selected' : '') . '>' . $translated_string . '</option>';
31
- }
32
  $recent_units_html .= '</select>';
33
  ?>
34
 
35
  <div class='yarpp_form_row yarpp_form_checkbox'>
36
- <div>
37
- <input type='checkbox' name='recent_only' id='yarpp-recent_only' value='true' <?php checked((bool) $recent) ?> />
38
  <label for="yarpp-recent_only">
39
- <?php
40
-
41
- printf(
42
- // translators: 1: HTML for a number field, 2: HTML for a units dropdown (eg "week(s)", "day(s)", month(s))
43
- __('Display only posts from the past %1$s %2$s', 'yarpp'),
44
- $recent_number_html,
45
- $recent_units_html
46
- );
47
- ?>
48
  </label>
49
- </div>
50
  </div>
51
 
52
  <?php
53
- $this->checkbox( 'past_only', __( "Display only posts older than current post", 'yarpp' )." <span class='yarpp_help dashicons dashicons-editor-help' data-help='" . esc_attr( __( "Only posts older than the current post will be displayed.", 'yarpp' ) ) . "'>&nbsp;</span>" );
54
 
55
  $this->checkbox(
56
- 'same_post_type',
57
- __( "Limit to same post type", 'yarpp' )." <span class='yarpp_help dashicons dashicons-editor-help' data-help='" . esc_attr( __( "When enabled, posts will only be selected from the same post type of the current post.", 'yarpp' ) ) . "'>&nbsp;</span>",
58
- '',
59
- array('option_value' => ! yarpp_get_option('cross_relate'))
60
- );
61
- ?>
1
  <p>
2
+ <?php
3
+ _e(
4
+ '"The Pool" refers to the pool of posts and pages that are candidates for display as related to the current entry.',
5
+ 'yarpp'
6
+ )
7
+ ?>
8
  </p>
9
 
10
  <?php
11
+ $this->include_post_type();
12
+ foreach ( $yarpp->get_taxonomies() as $taxonomy ) {
13
+ $this->exclude( $taxonomy->name, sprintf( __( 'Disallow by %s:', 'yarpp' ), ucwords( $taxonomy->labels->name ) ), $taxonomy->_builtin );
14
+ }
15
+
16
+ $this->checkbox( 'show_pass_post', __( 'Display password protected posts', 'yarpp' ) );
17
+ $this->checkbox( 'include_sticky_posts', __( 'Display sticky posts', 'yarpp' ) );
18
+ $recent = yarpp_get_option( 'recent' );
19
+ if ( (bool) $recent ) {
20
+ list($recent_number, $recent_units) = explode( ' ', $recent );
21
+ } else {
22
+ $recent_number = 12;
23
+ $recent_units = 'month';
24
+ }
25
+
26
+ $recent_number_html = '<input name="recent_number" type="text" id="recent_number" value="' . esc_attr( $recent_number ) . '" size="2" />';
27
+
28
+ $recent_units_html = '<select name="recent_units" id="recent_units" style="vertical-align:inherit">';
29
+ foreach ( $yarpp->recent_units() as $value => $translated_string ) {
30
+ $recent_units_html .= '<option value="' . esc_attr( $value ) . '" ' . ( ( $recent_units === $value ) ? 'selected' : '' ) . '>' . $translated_string . '</option>';
31
+ }
32
  $recent_units_html .= '</select>';
33
  ?>
34
 
35
  <div class='yarpp_form_row yarpp_form_checkbox'>
36
+ <div>
37
+ <input type='checkbox' name='recent_only' id='yarpp-recent_only' value='true' <?php checked( (bool) $recent ); ?> />
38
  <label for="yarpp-recent_only">
39
+ <?php
40
+
41
+ printf(
42
+ // translators: 1: HTML for a number field, 2: HTML for a units dropdown (eg "week(s)", "day(s)", month(s))
43
+ __( 'Display only posts from the past %1$s %2$s', 'yarpp' ),
44
+ $recent_number_html,
45
+ $recent_units_html
46
+ );
47
+ ?>
48
  </label>
49
+ </div>
50
  </div>
51
 
52
  <?php
53
+ $this->checkbox( 'past_only', __( 'Display only posts older than current post', 'yarpp' ) . " <span class='yarpp_help dashicons dashicons-editor-help' data-help='" . esc_attr( __( 'Only posts older than the current post will be displayed.', 'yarpp' ) ) . "'>&nbsp;</span>" );
54
 
55
  $this->checkbox(
56
+ 'same_post_type',
57
+ __( 'Limit to same post type', 'yarpp' ) . " <span class='yarpp_help dashicons dashicons-editor-help' data-help='" . esc_attr( __( 'When enabled, posts will only be selected from the same post type of the current post.', 'yarpp' ) ) . "'>&nbsp;</span>",
58
+ '',
59
+ array( 'option_value' => ! yarpp_get_option( 'cross_relate' ) )
60
+ );
61
+ ?>
includes/phtmls/yarpp_meta_box_radio.phtml CHANGED
@@ -1,12 +1,12 @@
1
- <div class="yarpp_form_row yarpp_form_radio <?php esc_attr_e( $class ) ?>">
2
  <div>
3
- <input
4
- type="radio"
5
- name="<?php esc_attr_e( $option ) ?>"
6
- id="yarpp-<?php esc_attr_e( $option.'_'.$value ) ?>"
7
- value="<?php esc_attr_e( $value ) ?>"
8
- <?php checked( $value === yarpp_get_option_thumbnail($option, 'thumbnail')) ?>
9
- />
10
- <label for="yarpp-<?php echo $option.'_'.$value ?>"><?php echo $desc ?></label>
11
  </div>
12
- </div>
1
+ <div class="yarpp_form_row yarpp_form_radio <?php esc_attr_e( $class ); ?>">
2
  <div>
3
+ <input
4
+ type="radio"
5
+ name="<?php esc_attr_e( $option ); ?>"
6
+ id="yarpp-<?php esc_attr_e( $option . '_' . $value ); ?>"
7
+ value="<?php esc_attr_e( $value ); ?>"
8
+ <?php checked( $value === yarpp_get_option_thumbnail( $option, 'thumbnail' ) ); ?>
9
+ />
10
+ <label for="yarpp-<?php echo $option . '_' . $value; ?>"><?php echo $desc; ?></label>
11
  </div>
12
+ </div>
includes/phtmls/yarpp_meta_box_tax_weight.phtml CHANGED
@@ -1,31 +1,31 @@
1
  <div class="yarpp_form_row yarpp_form_select">
2
- <div class="yarpp_form_label">
3
- <?php
4
- echo $taxonomy->labels->name;
5
- ?>:
6
- <?php
7
- if ($taxonomy->_builtin == false) {
8
- echo " <span class='yarpp_help dashicons dashicons-info' data-help='" . esc_attr( __( "This belongs to a custom taxonomy", 'yarpp' ) ) . "'></span>";
9
- }
10
- ?>
11
- </div>
12
- <div>
13
- <select name=weight[tax][<?php echo $taxonomy->name ?>]">
14
- <option value="no" <?php echo ((!$weight && !$require) ? 'selected' : null) ?> >
15
- <?php _e("do not consider", "yarpp") ?>
16
- </option>
17
- <option value="consider" <?php echo (($weight == 1 && !$require) ? 'selected' : null) ?> >
18
- <?php _e("consider", "yarpp") ?>
19
- </option>
20
- <option value="consider_extra" <?php echo (($weight > 1 && !$require) ? 'selected' : null) ?> >
21
- <?php _e("consider with extra weight", "yarpp") ?>
22
- </option>
23
- <option value="require_one" <?php echo (($require == 1) ? 'selected' : null) ?>>
24
- <?php echo sprintf(__("require at least one %s in common", "yarpp"), strtolower($taxonomy->labels->singular_name)) ?>
25
- </option>
26
- <option value="require_more" <?php echo (($require == 2) ? 'selected' : null) ?>>
27
- <?php echo sprintf(__("require more than one %s in common", "yarpp"), strtolower($taxonomy->labels->singular_name)) ?>
28
- </option>
29
- </select>
30
- </div>
31
- </div>
1
  <div class="yarpp_form_row yarpp_form_select">
2
+ <div class="yarpp_form_label">
3
+ <?php
4
+ echo $taxonomy->labels->name;
5
+ ?>:
6
+ <?php
7
+ if ( $taxonomy->_builtin == false ) {
8
+ echo " <span class='yarpp_help dashicons dashicons-info' data-help='" . esc_attr( __( 'This belongs to a custom taxonomy', 'yarpp' ) ) . "'></span>";
9
+ }
10
+ ?>
11
+ </div>
12
+ <div>
13
+ <select name=weight[tax][<?php echo $taxonomy->name; ?>]">
14
+ <option value="no" <?php echo ( ( ! $weight && ! $require ) ? 'selected' : null ); ?> >
15
+ <?php _e( 'do not consider', 'yarpp' ); ?>
16
+ </option>
17
+ <option value="consider" <?php echo ( ( $weight == 1 && ! $require ) ? 'selected' : null ); ?> >
18
+ <?php _e( 'consider', 'yarpp' ); ?>
19
+ </option>
20
+ <option value="consider_extra" <?php echo ( ( $weight > 1 && ! $require ) ? 'selected' : null ); ?> >
21
+ <?php _e( 'consider with extra weight', 'yarpp' ); ?>
22
+ </option>
23
+ <option value="require_one" <?php echo ( ( $require == 1 ) ? 'selected' : null ); ?>>
24
+ <?php echo sprintf( __( 'require at least one %s in common', 'yarpp' ), strtolower( $taxonomy->labels->singular_name ) ); ?>
25
+ </option>
26
+ <option value="require_more" <?php echo ( ( $require == 2 ) ? 'selected' : null ); ?>>
27
+ <?php echo sprintf( __( 'require more than one %s in common', 'yarpp' ), strtolower( $taxonomy->labels->singular_name ) ); ?>
28
+ </option>
29
+ </select>
30
+ </div>
31
+ </div>
includes/phtmls/yarpp_meta_box_template_checkbox.phtml CHANGED
@@ -1,49 +1,49 @@
1
  <?php
2
- $customHelp = null;
3
- if (!$this->yarpp->diagnostic_custom_templates()) {
4
- $customHelp = __('This option is disabled because no YARPP templates were found in your active theme folder.', 'yarpp');
5
- }
6
- if ($this->offer_copy_templates()) {
7
- $customHelp .=
8
- ' '.__('Would you like to copy some sample templates bundled with YARPP into your active theme folder?', 'yarpp').
9
- '<br /><br /><input type="button" class="button button-small yarpp_copy_templates_button" value="'.esc_attr(__('Copy Templates', 'yarpp')).'"/><span class="spinner"></span>';
10
- }
11
  ?>
12
 
13
- <div class="yarpp_form_row <?php echo $class ?>"><?php _e( 'Theme:', 'yarpp' ); ?></div>
14
- <div class="yarpp_form_row yarpp_form_template_buttons <?php echo $class ?>">
15
- <div data-value="builtin" class="yarpp_template_button <?php echo $builtIn ?>">
16
- <div class="image"></div>
17
- <div class="label"><?php _e('List', 'yarpp') ?></div>
18
- </div>
19
 
20
- <div
21
- data-value="thumbnails"
22
- class="yarpp_template_button <?php echo $thumbnails ?> <?php echo $diagPostThumbs ?>"
23
- <?php if (!$this->yarpp->diagnostic_post_thumbnails()): ?>
24
- data-help="<?php echo esc_attr(__('This option is disabled because your theme does not support post thumbnails.', 'yarpp'))?>"
25
- <?php endif ?>
26
- >
27
- <div class="image"></div>
28
- <div class="label"><?php _e('Thumbnails', 'yarpp') ?></div>
29
- </div>
30
 
31
- <div
32
- data-value="custom"
33
- class="yarpp_template_button <?php echo $custom ?> <?php echo $diagCustTemplt ?>"
34
- <?php if($customHelp): ?>
35
- data-help="<?php echo esc_attr($customHelp) ?>"
36
- <?php endif ?>
37
- >
38
- <div class="image"></div>
39
- <div class="label"><?php _e('Custom', 'yarpp') ?></div>
40
- </div>
41
 
42
- <input
43
- type="hidden"
44
- name="<?php echo $pre ?>use_template"
45
- id="yarpp-<?php echo $pre ?>use_template"
46
- class="use_template" value="<?php echo $choice ?>"
47
- />
48
 
49
- </div>
1
  <?php
2
+ $customHelp = null;
3
+ if ( ! $this->yarpp->diagnostic_custom_templates() ) {
4
+ $customHelp = __( 'This option is disabled because no YARPP templates were found in your active theme folder.', 'yarpp' );
5
+ }
6
+ if ( $this->offer_copy_templates() ) {
7
+ $customHelp .=
8
+ ' ' . __( 'Would you like to copy some sample templates bundled with YARPP into your active theme folder?', 'yarpp' ) .
9
+ '<br /><br /><input type="button" class="button button-small yarpp_copy_templates_button" value="' . esc_attr( __( 'Copy Templates', 'yarpp' ) ) . '"/><span class="spinner"></span>';
10
+ }
11
  ?>
12
 
13
+ <div class="yarpp_form_row <?php echo $class; ?>"><?php _e( 'Theme:', 'yarpp' ); ?></div>
14
+ <div class="yarpp_form_row yarpp_form_template_buttons <?php echo $class; ?>">
15
+ <div data-value="builtin" class="yarpp_template_button <?php echo $builtIn; ?>">
16
+ <div class="image"></div>
17
+ <div class="label"><?php _e( 'List', 'yarpp' ); ?></div>
18
+ </div>
19
 
20
+ <div
21
+ data-value="thumbnails"
22
+ class="yarpp_template_button <?php echo $thumbnails; ?> <?php echo $diagPostThumbs; ?>"
23
+ <?php if ( ! $this->yarpp->diagnostic_post_thumbnails() ) : ?>
24
+ data-help="<?php echo esc_attr( __( 'This option is disabled because your theme does not support post thumbnails.', 'yarpp' ) ); ?>"
25
+ <?php endif ?>
26
+ >
27
+ <div class="image"></div>
28
+ <div class="label"><?php _e( 'Thumbnails', 'yarpp' ); ?></div>
29
+ </div>
30
 
31
+ <div
32
+ data-value="custom"
33
+ class="yarpp_template_button <?php echo $custom; ?> <?php echo $diagCustTemplt; ?>"
34
+ <?php if ( $customHelp ) : ?>
35
+ data-help="<?php echo esc_attr( $customHelp ); ?>"
36
+ <?php endif ?>
37
+ >
38
+ <div class="image"></div>
39
+ <div class="label"><?php _e( 'Custom', 'yarpp' ); ?></div>
40
+ </div>
41
 
42
+ <input
43
+ type="hidden"
44
+ name="<?php echo $pre; ?>use_template"
45
+ id="yarpp-<?php echo $pre; ?>use_template"
46
+ class="use_template" value="<?php echo $choice; ?>"
47
+ />
48
 
49
+ </div>
includes/phtmls/yarpp_meta_box_template_file.phtml CHANGED
@@ -1,34 +1,34 @@
1
  <?php
2
- $options = null;
3
- foreach ($this->yarpp->get_templates() as $template) {
4
- $options .= '<option value="'.esc_attr($template['basename']).'"'.selected($template['basename'], $chosen_template, false);
5
- foreach ($template as $key => $value) {
6
- $options .= ' data-'.$key.'="'.esc_attr($value).'"';
7
- }
8
- $options .= '>'.esc_html($template['name']).'</option>';
9
- }
10
  ?>
11
 
12
- <div class="yarpp_form_row yarpp_form_template_file <?php echo $class ?>">
13
- <div class="yarpp_form_label">
14
- <?php _e('Template file:', 'yarpp') ?>
15
- </div>
16
- <div>
17
 
18
- <select name="<?php echo $pre ?>template_file" id="<?php echo $pre ?>template_file">
19
- <?php echo $options ?>
20
- </select>
21
 
22
- <p class="template_file_wrap">
23
- <span id="<?php echo $pre ?>template_file"></span>
24
- </p>
25
 
26
- <p class="template_author_wrap">
27
- <?php _e( 'Author:' ) ?> <span id="<?php echo $pre ?>template_author"></span>
28
- </p>
29
 
30
- <p class="template_description_wrap">
31
- <span id="<?php echo $pre ?>template_description"></span>
32
- </p>
33
- </div>
34
- </div>
1
  <?php
2
+ $options = null;
3
+ foreach ( $this->yarpp->get_templates() as $template ) {
4
+ $options .= '<option value="' . esc_attr( $template['basename'] ) . '"' . selected( $template['basename'], $chosen_template, false );
5
+ foreach ( $template as $key => $value ) {
6
+ $options .= ' data-' . $key . '="' . esc_attr( $value ) . '"';
7
+ }
8
+ $options .= '>' . esc_html( $template['name'] ) . '</option>';
9
+ }
10
  ?>
11
 
12
+ <div class="yarpp_form_row yarpp_form_template_file <?php echo $class; ?>">
13
+ <div class="yarpp_form_label">
14
+ <?php _e( 'Template file:', 'yarpp' ); ?>
15
+ </div>
16
+ <div>
17
 
18
+ <select name="<?php echo $pre; ?>template_file" id="<?php echo $pre; ?>template_file">
19
+ <?php echo $options; ?>
20
+ </select>
21
 
22
+ <p class="template_file_wrap">
23
+ <span id="<?php echo $pre; ?>template_file"></span>
24
+ </p>
25
 
26
+ <p class="template_author_wrap">
27
+ <?php _e( 'Author:' ); ?> <span id="<?php echo $pre; ?>template_author"></span>
28
+ </p>
29
 
30
+ <p class="template_description_wrap">
31
+ <span id="<?php echo $pre; ?>template_description"></span>
32
+ </p>
33
+ </div>
34
+ </div>
includes/phtmls/yarpp_meta_box_textbox.phtml CHANGED
@@ -1,19 +1,19 @@
1
- <div class="yarpp_form_row yarpp_form_textbox <?php echo $class ?>">
2
- <div class="yarpp_form_label">
3
- <?php echo $desc ?>
4
- </div>
5
- <div>
6
-
7
- <input
8
- name="<?php echo $option ?>"
9
- type="text" id="<?php echo $option ?>"
10
- value="<?php echo $value ?>"
11
- size="<?php echo $size ?>"
12
- />
13
 
14
- <?php if ($note): ?>
15
- &nbsp;<em><small><?php echo $note ?></small></em><br/>
16
- <?php endif ?>
17
 
18
- </div>
19
- </div>
1
+ <div class="yarpp_form_row yarpp_form_textbox <?php echo $class; ?>">
2
+ <div class="yarpp_form_label">
3
+ <?php echo $desc; ?>
4
+ </div>
5
+ <div>
6
+
7
+ <input
8
+ name="<?php echo $option; ?>"
9
+ type="text" id="<?php echo $option; ?>"
10
+ value="<?php echo $value; ?>"
11
+ size="<?php echo $size; ?>"
12
+ />
13
 
14
+ <?php if ( $note ) : ?>
15
+ &nbsp;<em><small><?php echo $note; ?></small></em><br/>
16
+ <?php endif ?>
17
 
18
+ </div>
19
+ </div>
includes/phtmls/yarpp_options.phtml CHANGED
@@ -1,65 +1,65 @@
1
  <div class="wrap">
2
- <?php include(YARPP_DIR.'/includes/phtmls/yarpp_settings_header.phtml') ?>
3
 
4
- <div id="yarpp_switch_container">
5
- <ul id="yarpp_switch_tabs">
6
- <li>
7
- <a href="options-general.php?page=yarpp&mode=basic"><?php _e('YARPP Basic', 'yarpp')?></a>
8
- </li>
9
- </ul>
10
 
11
- <div class="yarpp_switch_content">
12
- <p><?php _e('The settings below allow you to configure the basic settings for YARPP', 'yarpp') ?></p>
13
- </div>
14
- </div>
15
 
16
- <form method="post">
17
 
18
- <div id="poststuff" class="metabox-holder has-right-sidebar">
19
 
20
- <?php if (!$yarpp->get_option('rss_display')): ?>
21
- <style>
22
- .rss_displayed {
23
- display: none;
24
- }
25
- </style>
26
- <?php endif ?>
27
 
28
- <!-- Side column -->
29
- <div class="inner-sidebar" id="side-info-column">
30
- <?php do_meta_boxes('settings_page_yarpp', 'side', array()) ?>
31
- </div>
32
 
33
- <!-- Main Content -->
34
 
35
- <div id="post-body-content">
36
- <?php do_meta_boxes('settings_page_yarpp', 'normal', array()) ?>
37
- </div>
38
 
39
- <script>
40
- var spinner = '<?php echo esc_url(admin_url('images/spinner-2x.gif')) ?>',
41
- loading = '<img height="20px" width="20px" class="loading" src="'+spinner+'" alt="loading..."/>';
42
- </script>
43
 
44
- <div>
45
- <input type="submit" class='button-primary yarpp_spin_on_click' name="update_yarpp" value="<?php _e('Save Changes', 'yarpp')?>" />
46
  <span class="spinner yarpp-no-float"></span>
47
- <?php wp_nonce_field( 'update_yarpp', 'update_yarpp-nonce' ); ?>
48
- </div>
49
- <br><br>
50
- <div class="" id="display_notices" style="display: none;">
51
- </div>
52
- <div>
53
- <p>
54
- <input type="button" name="yarpp-clear-cache" id="yarpp-clear-cache" class="button-secondary" value="<?php _e("Empty cache", 'yarpp'); ?>">
55
- <span id="yarpp-clear-cache-label"><small><?php _e('Use this button to manually clear YARPP cache', 'yarpp'); ?></small></span>
56
- <span class="spinner" style="float: none;"></span>
57
- </p>
58
- <?php wp_nonce_field( 'clear_cache_yarpp', 'clear_cache-nonce' ); ?>
59
- </div>
60
 
61
- </div>
62
 
63
- </form>
64
 
65
- </div>
1
  <div class="wrap">
2
+ <?php require YARPP_DIR . '/includes/phtmls/yarpp_settings_header.phtml'; ?>
3
 
4
+ <div id="yarpp_switch_container">
5
+ <ul id="yarpp_switch_tabs">
6
+ <li>
7
+ <a href="options-general.php?page=yarpp&mode=basic"><?php _e( 'YARPP Basic', 'yarpp' ); ?></a>
8
+ </li>
9
+ </ul>
10
 
11
+ <div class="yarpp_switch_content">
12
+ <p><?php _e( 'The settings below allow you to configure the basic settings for YARPP', 'yarpp' ); ?></p>
13
+ </div>
14
+ </div>
15
 
16
+ <form method="post">
17
 
18
+ <div id="poststuff" class="metabox-holder has-right-sidebar">
19
 
20
+ <?php if ( ! $yarpp->get_option( 'rss_display' ) ) : ?>
21
+ <style>
22
+ .rss_displayed {
23
+ display: none;
24
+ }
25
+ </style>
26
+ <?php endif ?>
27
 
28
+ <!-- Side column -->
29
+ <div class="inner-sidebar" id="side-info-column">
30
+ <?php do_meta_boxes( 'settings_page_yarpp', 'side', array() ); ?>
31
+ </div>
32
 
33
+ <!-- Main Content -->
34
 
35
+ <div id="post-body-content">
36
+ <?php do_meta_boxes( 'settings_page_yarpp', 'normal', array() ); ?>
37
+ </div>
38
 
39
+ <script>
40
+ var spinner = '<?php echo esc_url( admin_url( 'images/spinner-2x.gif' ) ); ?>',
41
+ loading = '<img height="20px" width="20px" class="loading" src="'+spinner+'" alt="loading..."/>';
42
+ </script>
43
 
44
+ <div>
45
+ <input type="submit" class='button-primary yarpp_spin_on_click' name="update_yarpp" value="<?php _e( 'Save Changes', 'yarpp' ); ?>" />
46
  <span class="spinner yarpp-no-float"></span>
47
+ <?php wp_nonce_field( 'update_yarpp', 'update_yarpp-nonce' ); ?>
48
+ </div>
49
+ <br><br>
50
+ <div class="" id="display_notices" style="display: none;">
51
+ </div>
52
+ <div>
53
+ <p>
54
+ <input type="button" name="yarpp-clear-cache" id="yarpp-clear-cache" class="button-secondary" value="<?php _e( 'Empty cache', 'yarpp' ); ?>">
55
+ <span id="yarpp-clear-cache-label"><small><?php _e( 'Use this button to manually clear YARPP cache', 'yarpp' ); ?></small></span>
56
+ <span class="spinner" style="float: none;"></span>
57
+ </p>
58
+ <?php wp_nonce_field( 'clear_cache_yarpp', 'clear_cache-nonce' ); ?>
59
+ </div>
60
 
61
+ </div>
62
 
63
+ </form>
64
 
65
+ </div>
includes/phtmls/yarpp_pro_options.phtml CHANGED
@@ -1,92 +1,92 @@
1
  <div class="wrap">
2
- <?php include(YARPP_DIR.'/includes/phtmls/yarpp_settings_header.phtml') ?>
3
 
4
- <div id="yarpp_switch_container">
5
- <ul id="yarpp_switch_tabs">
6
- <li class="<?php echo (($switch) ? null : 'disabled')?>">
7
- <a href="options-general.php?page=yarpp&mode=basic">YARPP Basic</a>
8
- </li>
9
- <li class="<?php echo (($switch) ? 'disabled': null)?>">
10
- <a href="options-general.php?page=yarpp&mode=pro">YARPP Pro</a>
11
- </li>
12
- </ul>
13
- <div class="yarpp_switch_content">
14
- <p>
15
- <?php if ($yarpp->yarppPro['active']): ?>
16
- Welcome to your <strong>YARPP Pro</strong> dashboard! Here you have access to the most powerful features of YARPP.
17
- <?php wp_nonce_field( 'yarpp_switch', 'yarpp_switch-nonce' ); ?>
18
- <a
19
- class="yarpp_switch_button button to_corner" data-go="basic">
20
- Deactivate &nbsp;<strong>YARPP Pro</strong>&nbsp;
21
- </a>
22
- <?php else: ?>
23
- <strong>Access more powerful features by activating YARPP Pro!</strong>
24
- <?php endif ?>
25
- <br/>
26
- <ul>
27
- <li>
28
- Earn money from sponsored content
29
- <br/>
30
- <em>(now available as a flexible sidebar widget!)</em>
31
- </li>
32
- <li>Pull related content from multiples sites</li>
33
- </ul>
34
- <ul>
35
- <li>Easily customize thumbnail layout</li>
36
- <li>Get detailed traffic reports</li>
37
- </ul>
38
- </p>
39
 
40
- <div class="clear"></div>
41
 
42
- <?php if (!$yarpp->yarppPro['active']): ?>
43
- <p>
44
- <a
45
- class="yarpp_switch_button button-primary" data-go="pro">
46
- Activate <strong>YARPP Pro</strong> Now
47
- </a>
48
- </p>
49
- <?php endif ?>
50
 
51
- <div class="clear"></div>
52
- </div>
53
- </div>
54
 
55
- <?php if ($yarpp->yarppPro['active']): ?>
56
 
57
- <div class="yarpp_switch_content">
58
- <div id="yarpp-display-mode">
59
- Automatically display related and/or sponsored content from <strong>YARPP Pro</strong> on: &nbsp;&nbsp;
60
- <?php
61
- $types_url = plugins_url('/', dirname(__FILE__)).'yarpp_pro_set_display_types.php';
62
- $post_types = $yarpp->yarppPro['auto_display_post_types'];
63
- foreach ($yarpp->get_post_types('objects') as $post_type):
64
- $checked = checked(in_array( $post_type->name, $post_types), true, false);
65
- ?>
66
- <input
67
- type="checkbox"
68
- id="yarpp_post_type_post"
69
- name="types[]"
70
- value="<?php echo $post_type->name ?>"
71
- data-href="<?php echo $types_url ?>"
72
- <?php echo $checked ?>
73
- />
74
- <label for="yarpp_post_type_post"> <?php echo $post_type->labels->name ?></label>
75
- <?php endforeach ?>
76
-
77
- <a href="<?php echo $types_url ?>" id="yarpp-display-mode-save" class="button-primary" style="vertical-align:middle">
78
- Save Changes
79
- </a>
80
- <br/>
81
- <br/>
82
- <span>
83
- To display in the sidebar, add a &nbsp;<em>&ldquo;Related Posts (YARPP)&rdquo;</em>&nbsp;
84
- widget and select &nbsp<em>&ldquo;YARPP Pro&rdquo;</em>&nbsp; from the drop-down setting of the widget options.
85
- Widgets are located under &nbsp;<a href="widgets.php">&ldquo;Appearance&rdquo; > &ldquo;Widgets&rdquo;</a>.
86
- </span>
87
- </div>
88
- </div>
89
 
90
- <script>jQuery("#screen-options-link-wrap").hide();</script>
91
- <?php endif ?>
92
- </div>
1
  <div class="wrap">
2
+ <?php require YARPP_DIR . '/includes/phtmls/yarpp_settings_header.phtml'; ?>
3
 
4
+ <div id="yarpp_switch_container">
5
+ <ul id="yarpp_switch_tabs">
6
+ <li class="<?php echo ( ( $switch ) ? null : 'disabled' ); ?>">
7
+ <a href="options-general.php?page=yarpp&mode=basic">YARPP Basic</a>
8
+ </li>
9
+ <li class="<?php echo ( ( $switch ) ? 'disabled' : null ); ?>">
10
+ <a href="options-general.php?page=yarpp&mode=pro">YARPP Pro</a>
11
+ </li>
12
+ </ul>
13
+ <div class="yarpp_switch_content">
14
+ <p>
15
+ <?php if ( $yarpp->yarppPro['active'] ) : ?>
16
+ Welcome to your <strong>YARPP Pro</strong> dashboard! Here you have access to the most powerful features of YARPP.
17
+ <?php wp_nonce_field( 'yarpp_switch', 'yarpp_switch-nonce' ); ?>
18
+ <a
19
+ class="yarpp_switch_button button to_corner" data-go="basic">
20
+ Deactivate &nbsp;<strong>YARPP Pro</strong>&nbsp;
21
+ </a>
22
+ <?php else : ?>
23
+ <strong>Access more powerful features by activating YARPP Pro!</strong>
24
+ <?php endif ?>
25
+ <br/>
26
+ <ul>
27
+ <li>
28
+ Earn money from sponsored content
29
+ <br/>
30
+ <em>(now available as a flexible sidebar widget!)</em>
31
+ </li>
32
+ <li>Pull related content from multiples sites</li>
33
+ </ul>
34
+ <ul>
35
+ <li>Easily customize thumbnail layout</li>
36
+ <li>Get detailed traffic reports</li>
37
+ </ul>
38
+ </p>
39
 
40
+ <div class="clear"></div>
41
 
42
+ <?php if ( ! $yarpp->yarppPro['active'] ) : ?>
43
+ <p>
44
+ <a
45
+ class="yarpp_switch_button button-primary" data-go="pro">
46
+ Activate <strong>YARPP Pro</strong> Now
47
+ </a>
48
+ </p>
49
+ <?php endif ?>
50
 
51
+ <div class="clear"></div>
52
+ </div>
53
+ </div>
54
 
55
+ <?php if ( $yarpp->yarppPro['active'] ) : ?>
56
 
57
+ <div class="yarpp_switch_content">
58
+ <div id="yarpp-display-mode">
59
+ Automatically display related and/or sponsored content from <strong>YARPP Pro</strong> on: &nbsp;&nbsp;
60
+ <?php
61
+ $types_url = plugins_url( '/', dirname( __FILE__ ) ) . 'yarpp_pro_set_display_types.php';
62
+ $post_types = $yarpp->yarppPro['auto_display_post_types'];
63
+ foreach ( $yarpp->get_post_types( 'objects' ) as $post_type ) :
64
+ $checked = checked( in_array( $post_type->name, $post_types ), true, false );
65
+ ?>
66
+ <input
67
+ type="checkbox"
68
+ id="yarpp_post_type_post"
69
+ name="types[]"
70
+ value="<?php echo $post_type->name; ?>"
71
+ data-href="<?php echo $types_url; ?>"
72
+ <?php echo $checked; ?>
73
+ />
74
+ <label for="yarpp_post_type_post"> <?php echo $post_type->labels->name; ?></label>
75
+ <?php endforeach ?>
76
+
77
+ <a href="<?php echo $types_url; ?>" id="yarpp-display-mode-save" class="button-primary" style="vertical-align:middle">
78
+ Save Changes
79
+ </a>
80
+ <br/>
81
+ <br/>
82
+ <span>
83
+ To display in the sidebar, add a &nbsp;<em>&ldquo;Related Posts (YARPP)&rdquo;</em>&nbsp;
84
+ widget and select &nbsp<em>&ldquo;YARPP Pro&rdquo;</em>&nbsp; from the drop-down setting of the widget options.
85
+ Widgets are located under &nbsp;<a href="widgets.php">&ldquo;Appearance&rdquo; > &ldquo;Widgets&rdquo;</a>.
86
+ </span>
87
+ </div>
88
+ </div>
89
 
90
+ <script>jQuery("#screen-options-link-wrap").hide();</script>
91
+ <?php endif ?>
92
+ </div>
includes/phtmls/yarpp_pro_tag.phtml CHANGED
@@ -1,7 +1,5 @@
1
  <script>
2
- var aid = '<?php echo $this->yarppPro['aid'] ?>',
3
- v = '<?php echo $this->yarppPro['v'] ?>',
4
- credomain = 'adkengage.com',
5
- ru = '<?php echo $ru ?>';
6
- document.write('<sc'+'ript type=\"text/javascript\" src=\"http://'+ credomain +'/Scripts/CREReqScript.js\"></sc'+'ript>');
7
  </script>
1
  <script>
2
+ var aid = '<?php echo $this->yarppPro['aid']; ?>',
3
+ v = '<?php echo $this->yarppPro['v']; ?>',
4
+ ru = '<?php echo $ru; ?>';
 
 
5
  </script>
includes/phtmls/yarpp_pro_tag_ssp.phtml CHANGED
@@ -1,6 +1,2 @@
1
- <div id="adkengage_ssp_div"></div>
2
- <script
3
- type="text/javascript"
4
- src="http://adkengage.com/pshandler.js?aid=<?php echo $aid ?>&v=<?php echo $v ?>&dpid=<?php echo $dpid ?>&ru=<?php echo $ru ?>"
5
- >
6
- </script>
1
+ <div id="ssp_div"></div>
2
+ <script></script>
 
 
 
 
includes/phtmls/yarpp_settings_header.phtml CHANGED
@@ -1,8 +1,8 @@
1
  <div>
2
- <h2>
3
- <?php _e('Yet Another Related Posts Plugin Options','yarpp');?>
4
- <small>
5
- <?php echo apply_filters('yarpp_version_html', esc_html(YARPP_VERSION)) ?>
6
- </small>
7
- </h2>
8
- </div>
1
  <div>
2
+ <h2>
3
+ <?php _e( 'Yet Another Related Posts Plugin Options', 'yarpp' ); ?>
4
+ <small>
5
+ <?php echo apply_filters( 'yarpp_version_html', esc_html( YARPP_VERSION ) ); ?>
6
+ </small>
7
+ </h2>
8
+ </div>
includes/phtmls/yarpp_widget_form.phtml CHANGED
@@ -1,91 +1,95 @@
1
  <div class="yarpp-widget-settings-switch">
2
- <div class="yarpp-widget-basic-settings" style="display: block;">
3
- <p class='yarpp-widget-type-control'>
4
- <label style="padding-right: 10px; display: inline-block;" for="<?php echo $this->get_field_id('use_template_builtin'); ?>">
5
- <input
6
- type="radio"
7
- id="<?php echo $this->get_field_id('use_template_builtin'); ?>"
8
- name="<?php echo $this->get_field_name('use_template'); ?>"
9
- value="builtin" <?php checked($choice === 'builtin' ) ?>
10
- />
11
- <?php _e("List",'yarpp'); ?>
12
- </label>
13
- <br/>
14
- <label style="padding-right: 10px; display: inline-block;" for="<?php echo $this->get_field_id('use_template_thumbnails'); ?>">
15
- <input
16
- type="radio"
17
- id="<?php echo $this->get_field_id('use_template_thumbnails'); ?>"
18
- name="<?php echo $this->get_field_name('use_template'); ?>"
19
- value="thumbnails" <?php checked($choice === 'thumbnails') ?>
20
- />
21
- <?php _e("Thumbnails", 'yarpp'); ?>
22
- </label>
23
- <br/>
24
- <label style="padding-right: 10px; display: inline-block;" for="<?php echo $this->get_field_id('use_template_custom'); ?>">
25
- <input
26
- type="radio"
27
- id="<?php echo $this->get_field_id('use_template_custom'); ?>"
28
- name="<?php echo $this->get_field_name('use_template'); ?>"
29
- value="custom" <?php checked($choice === 'custom'); disabled(!count($templates)); ?>
30
- />
31
- <?php _e("Custom", 'yarpp'); ?>
32
- </label>
33
- </p>
34
- <p>
35
- <label for="<?php echo $this->get_field_id('title') ?>">
36
- <?php _e('Title:'); ?>
37
- <input
38
- type="text"
39
- class="widefat"
40
- id="<?php echo $this->get_field_id('title') ?>"
41
- name="<?php echo $this->get_field_name('title') ?>"
42
- value="<?php echo esc_attr($instance['title']) ?>"/>
43
- </label>
44
- </p>
45
- <p>
46
- <label for="<?php echo $this->get_field_id('thumbnails_heading') ?>">
47
- <?php _e('Heading:', 'yarpp') ?>
48
- <input
49
- type="text"
50
- class="widefat"
51
- id="<?php echo $this->get_field_id('thumbnails_heading') ?>"
52
- name="<?php echo $this->get_field_name('thumbnails_heading') ?>"
53
- value="<?php echo esc_attr($instance['thumbnails_heading']) ?>"/>
54
- </label>
55
- </p>
56
- <p>
57
- <label for="<?php echo $this->get_field_id('template_file'); ?>">
58
- <?php _e("Template file:",'yarpp');?>
59
- </label>
60
- <select name="<?php echo $this->get_field_name('template_file'); ?>" id="<?php echo $this->get_field_id('template_file'); ?>">
61
- <?php foreach ($templates as $template): ?>
62
- <option value='<?php echo esc_attr($template['basename']); ?>' <?php selected($template['basename'], $instance['template']);?>>
63
- <?php echo esc_html($template['name']); ?>
64
- </option>
65
- <?php endforeach; ?>
66
- </select>
67
- </p>
68
- <br/>
69
- </div>
 
 
 
 
70
  </div>
71
 
72
  <script type="text/javascript">
73
  jQuery(function($) {
74
- $('.yarpp-widget-type-control','#wpbody').each(ensureTemplateChoice);
75
- $('.yarpp-widget-type-control input','#wpbody').on('change', ensureTemplateChoice);
76
 
77
- function ensureTemplateChoice(e) {
78
- if (typeof e === 'object' && 'type' in e) e.stopImmediatePropagation();
79
- var this_form = $(this).closest('form'),
80
- widget_id = this_form.find('.widget-id').val();
81
- // if this widget is just in staging:
82
- if (/__i__$/.test(widget_id)) return;
83
- var builtin = !! $('#widget-'+widget_id+'-use_template_builtin').prop('checked'),
84
- thumbnails = !! $('#widget-'+widget_id+'-use_template_thumbnails').prop('checked'),
85
- custom = !! $('#widget-'+widget_id+'-use_template_custom').prop('checked');
86
- $('#widget-'+widget_id+'-title').closest('p').toggle(builtin);
87
- $('#widget-'+widget_id+'-thumbnails_heading').closest('p').toggle(thumbnails);
88
- $('#widget-'+widget_id+'-template_file').closest('p').toggle(custom);
89
- }
90
  });
91
- </script>
1
  <div class="yarpp-widget-settings-switch">
2
+ <div class="yarpp-widget-basic-settings" style="display: block;">
3
+ <p class='yarpp-widget-type-control'>
4
+ <label style="padding-right: 10px; display: inline-block;" for="<?php echo $this->get_field_id( 'use_template_builtin' ); ?>">
5
+ <input
6
+ type="radio"
7
+ id="<?php echo $this->get_field_id( 'use_template_builtin' ); ?>"
8
+ name="<?php echo $this->get_field_name( 'use_template' ); ?>"
9
+ value="builtin" <?php checked( $choice === 'builtin' ); ?>
10
+ />
11
+ <?php _e( 'List', 'yarpp' ); ?>
12
+ </label>
13
+ <br/>
14
+ <label style="padding-right: 10px; display: inline-block;" for="<?php echo $this->get_field_id( 'use_template_thumbnails' ); ?>">
15
+ <input
16
+ type="radio"
17
+ id="<?php echo $this->get_field_id( 'use_template_thumbnails' ); ?>"
18
+ name="<?php echo $this->get_field_name( 'use_template' ); ?>"
19
+ value="thumbnails" <?php checked( $choice === 'thumbnails' ); ?>
20
+ />
21
+ <?php _e( 'Thumbnails', 'yarpp' ); ?>
22
+ </label>
23
+ <br/>
24
+ <label style="padding-right: 10px; display: inline-block;" for="<?php echo $this->get_field_id( 'use_template_custom' ); ?>">
25
+ <input
26
+ type="radio"
27
+ id="<?php echo $this->get_field_id( 'use_template_custom' ); ?>"
28
+ name="<?php echo $this->get_field_name( 'use_template' ); ?>"
29
+ value="custom"
30
+ <?php
31
+ checked( $choice === 'custom' );
32
+ disabled( ! count( $templates ) );
33
+ ?>
34
+ />
35
+ <?php _e( 'Custom', 'yarpp' ); ?>
36
+ </label>
37
+ </p>
38
+ <p>
39
+ <label for="<?php echo $this->get_field_id( 'title' ); ?>">
40
+ <?php _e( 'Title:' ); ?>
41
+ <input
42
+ type="text"
43
+ class="widefat"
44
+ id="<?php echo $this->get_field_id( 'title' ); ?>"
45
+ name="<?php echo $this->get_field_name( 'title' ); ?>"
46
+ value="<?php echo esc_attr( $instance['title'] ); ?>"/>
47
+ </label>
48
+ </p>
49
+ <p>
50
+ <label for="<?php echo $this->get_field_id( 'thumbnails_heading' ); ?>">
51
+ <?php _e( 'Heading:', 'yarpp' ); ?>
52
+ <input
53
+ type="text"
54
+ class="widefat"
55
+ id="<?php echo $this->get_field_id( 'thumbnails_heading' ); ?>"
56
+ name="<?php echo $this->get_field_name( 'thumbnails_heading' ); ?>"
57
+ value="<?php echo esc_attr( $instance['thumbnails_heading'] ); ?>"/>
58
+ </label>
59
+ </p>
60
+ <p>
61
+ <label for="<?php echo $this->get_field_id( 'template_file' ); ?>">
62
+ <?php _e( 'Template file:', 'yarpp' ); ?>
63
+ </label>
64
+ <select name="<?php echo $this->get_field_name( 'template_file' ); ?>" id="<?php echo $this->get_field_id( 'template_file' ); ?>">
65
+ <?php foreach ( $templates as $template ) : ?>
66
+ <option value='<?php echo esc_attr( $template['basename'] ); ?>' <?php selected( $template['basename'], $instance['template'] ); ?>>
67
+ <?php echo esc_html( $template['name'] ); ?>
68
+ </option>
69
+ <?php endforeach; ?>
70
+ </select>
71
+ </p>
72
+ <br/>
73
+ </div>
74
  </div>
75
 
76
  <script type="text/javascript">
77
  jQuery(function($) {
78
+ $('.yarpp-widget-type-control','#wpbody').each(ensureTemplateChoice);
79
+ $('.yarpp-widget-type-control input','#wpbody').on('change', ensureTemplateChoice);
80
 
81
+ function ensureTemplateChoice(e) {
82
+ if (typeof e === 'object' && 'type' in e) e.stopImmediatePropagation();
83
+ var this_form = $(this).closest('form'),
84
+ widget_id = this_form.find('.widget-id').val();
85
+ // if this widget is just in staging:
86
+ if (/__i__$/.test(widget_id)) return;
87
+ var builtin = !! $('#widget-'+widget_id+'-use_template_builtin').prop('checked'),
88
+ thumbnails = !! $('#widget-'+widget_id+'-use_template_thumbnails').prop('checked'),
89
+ custom = !! $('#widget-'+widget_id+'-use_template_custom').prop('checked');
90
+ $('#widget-'+widget_id+'-title').closest('p').toggle(builtin);
91
+ $('#widget-'+widget_id+'-thumbnails_heading').closest('p').toggle(thumbnails);
92
+ $('#widget-'+widget_id+'-template_file').closest('p').toggle(custom);
93
+ }
94
  });
95
+ </script>
includes/yarpp_pro_options.php CHANGED
@@ -15,6 +15,6 @@ $aid = ( isset( $yarpp->yarppPro['aid'] ) && $yarpp->yarppPro['aid'] ) ? $yarpp-
15
  $st = ( isset( $yarpp->yarppPro['st'] ) && $yarpp->yarppPro['st'] ) ? $yarpp->yarppPro['st'] : 0;
16
  $v = ( isset( $yarpp->yarppPro['v'] ) && $yarpp->yarppPro['v'] ) ? $yarpp->yarppPro['v'] : 0;
17
  $d = urlencode( get_home_url() );
18
- $url = 'https://yarpp.adkengage.com/AdcenterUI/PublisherUI/PublisherDashboard.aspx?src=' . $src . '&d=' . $d . '&aid=' . $aid . '&st=' . $st . '&plugin=1';
19
 
20
  require YARPP_DIR . '/includes/phtmls/yarpp_pro_options.phtml';
15
  $st = ( isset( $yarpp->yarppPro['st'] ) && $yarpp->yarppPro['st'] ) ? $yarpp->yarppPro['st'] : 0;
16
  $v = ( isset( $yarpp->yarppPro['v'] ) && $yarpp->yarppPro['v'] ) ? $yarpp->yarppPro['v'] : 0;
17
  $d = urlencode( get_home_url() );
18
+ $url = 'https://yarpp.com/AdcenterUI/PublisherUI/PublisherDashboard.aspx?src=' . $src . '&d=' . $d . '&aid=' . $aid . '&st=' . $st . '&plugin=1';
19
 
20
  require YARPP_DIR . '/includes/phtmls/yarpp_pro_options.phtml';
readme.txt CHANGED
@@ -6,7 +6,7 @@ Requires at least: 3.7
6
  Requires PHP: 5.3
7
  License: GPLv2 or later
8
  Tested up to: 5.7
9
- Stable tag: 5.24.0
10
 
11
  The best WordPress plugin for displaying related posts. Simple and flexible, with a powerful proven algorithm and inbuilt caching.
12
 
@@ -164,11 +164,11 @@ You may use the functions defined in `includes/related_functions.php` in your ow
164
 
165
  *Examples:*
166
 
167
- Show related posts, using all the settings set in the YARPP settings page:
168
 
169
  `<?php yarpp_related(); ?>`
170
 
171
- Each of these functions will default to using the settings set in your the YARPP settings page, but can be customized. For example:
172
 
173
  <code>
174
  yarpp_related(
@@ -297,7 +297,7 @@ On the edit post page, uncheck “Display Related Posts” in the YARPP box. Be
297
 
298
  **Option 2:**
299
 
300
- Add `<?noyarpp-->` to the HTML code of any post to prevent related posts from displaying.
301
 
302
  **Option 3:**
303
 
@@ -491,6 +491,8 @@ Beginning with version 4.0.7, YARPP includes clean uninstall functionality. If y
491
 
492
 
493
  == Changelog ==
 
 
494
 
495
  = 5.24.0 (17-June-2021) =
496
  * Enhancement: Option to automatically generate missing thumbnail sizes on the fly when using Custom YARPP Templates
@@ -1347,5 +1349,5 @@ After a break of many years, the plugin is 100% supported now that the baton has
1347
  * Initial upload
1348
 
1349
  == Upgrade Notice ==
1350
- = 5.24.0 =
1351
  We update this plugin regularly so we can make it better for you. Update to the latest version for all of the available features and improvements. Thank you for using YARPP!
6
  Requires PHP: 5.3
7
  License: GPLv2 or later
8
  Tested up to: 5.7
9
+ Stable tag: 5.25.0
10
 
11
  The best WordPress plugin for displaying related posts. Simple and flexible, with a powerful proven algorithm and inbuilt caching.
12
 
164
 
165
  *Examples:*
166
 
167
+ Show related posts, using all the settings set on the YARPP settings page:
168
 
169
  `<?php yarpp_related(); ?>`
170
 
171
+ Each of these functions will default to using the settings set on the YARPP settings page, but can be customized. For example:
172
 
173
  <code>
174
  yarpp_related(
297
 
298
  **Option 2:**
299
 
300
+ Add `<!--noyarpp-->` to the HTML code of any post to prevent related posts from displaying.
301
 
302
  **Option 3:**
303
 
491
 
492
 
493
  == Changelog ==
494
+ = 5.25.0 (23-June-2021) =
495
+ * Enhancement: Cleaned up old unused code (adkengage)
496
 
497
  = 5.24.0 (17-June-2021) =
498
  * Enhancement: Option to automatically generate missing thumbnail sizes on the fly when using Custom YARPP Templates
1349
  * Initial upload
1350
 
1351
  == Upgrade Notice ==
1352
+ = 5.25.0 =
1353
  We update this plugin regularly so we can make it better for you. Update to the latest version for all of the available features and improvements. Thank you for using YARPP!
yarpp.php CHANGED
@@ -2,7 +2,7 @@
2
  /*
3
  Plugin Name: Yet Another Related Posts Plugin (YARPP)
4
  Description: Adds related posts to your site and in RSS feeds, based on a powerful, customizable algorithm.
5
- Version: 5.24.0
6
  Author: YARPP
7
  Author URI: https://yarpp.com/
8
  Plugin URI: https://yarpp.com/
@@ -25,7 +25,7 @@ if ( ! defined( 'WP_CONTENT_DIR' ) ) {
25
  define( 'WP_CONTENT_DIR', substr( $tr, 0, strrpos( $tr, '/' ) ) );
26
  }
27
 
28
- define( 'YARPP_VERSION', '5.24.0' );
29
 
30
  define( 'YARPP_DIR', dirname( __FILE__ ) );
31
  /**
2
  /*
3
  Plugin Name: Yet Another Related Posts Plugin (YARPP)
4
  Description: Adds related posts to your site and in RSS feeds, based on a powerful, customizable algorithm.
5
+ Version: 5.25.0
6
  Author: YARPP
7
  Author URI: https://yarpp.com/
8
  Plugin URI: https://yarpp.com/
25
  define( 'WP_CONTENT_DIR', substr( $tr, 0, strrpos( $tr, '/' ) ) );
26
  }
27
 
28
+ define( 'YARPP_VERSION', '5.25.0' );
29
 
30
  define( 'YARPP_DIR', dirname( __FILE__ ) );
31
  /**