Yet Another Related Posts Plugin (YARPP) - Version 5.16.1

Version Description

(29-March-2021) = * Bugfix: include new minified JS files

Download this release

Release Info

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

Code changes from version 5.15.3 to 5.16.1

classes/YARPP_Admin.php CHANGED
@@ -515,12 +515,13 @@ class YARPP_Admin {
515
  public function enqueue() {
516
  $version = defined('WP_DEBUG') && WP_DEBUG ? time() : YARPP_VERSION;
517
  $screen = get_current_screen();
 
518
  if (!is_null($screen) && $screen->id === 'settings_page_yarpp') {
 
519
  wp_enqueue_style('yarpp_switch_options', plugins_url('style/options_switch.css', dirname(__FILE__)), array(), $version );
520
- wp_enqueue_script('yarpp_switch_options', plugins_url('js/options_switch.js', dirname(__FILE__)), array('jquery'), $version );
521
 
522
- wp_enqueue_style('wp-pointer');
523
- wp_enqueue_style('yarpp_options', plugins_url('style/options_basic.css', dirname(__FILE__)), array(), $version );
524
  wp_enqueue_style('yarpp_remodal', plugins_url('lib/plugin-deactivation-survey/remodal.css', dirname(__FILE__)), array(), $version );
525
  wp_enqueue_style('yarpp_deactivate', plugins_url('lib/plugin-deactivation-survey/deactivate-feedback-form.css', dirname(__FILE__)), array(), $version );
526
  wp_enqueue_style('yarpp_default_theme', plugins_url('lib/plugin-deactivation-survey/remodal-default-theme.css', dirname(__FILE__)), array(), $version );
@@ -528,7 +529,7 @@ class YARPP_Admin {
528
  wp_enqueue_script('postbox');
529
  wp_enqueue_script('wp-pointer');
530
  wp_enqueue_script('yarpp_remodal', plugins_url('lib/plugin-deactivation-survey/remodal.min.js', dirname(__FILE__)), array(), $version );
531
- wp_enqueue_script('yarpp_options', plugins_url('js/options_basic.js', dirname(__FILE__)), array('jquery'), $version );
532
  // Localize the script with messages
533
  $translation_strings = array(
534
  'alert_message' => __( 'This will clear all of YARPP’s cached related results.<br> Are you sure?', 'yarpp' ),
@@ -545,8 +546,12 @@ class YARPP_Admin {
545
 
546
  $metabox_post_types = $this->core->get_option('auto_display_post_types');
547
  if (!is_null($screen) && ($screen->id == 'post' || in_array( $screen->id, $metabox_post_types))) {
 
548
  wp_enqueue_script('yarpp_metabox', plugins_url('js/metabox.js', dirname(__FILE__)), array('jquery'), $version );
549
  }
 
 
 
550
  }
551
 
552
  public function settings_link($links, $file) {
515
  public function enqueue() {
516
  $version = defined('WP_DEBUG') && WP_DEBUG ? time() : YARPP_VERSION;
517
  $screen = get_current_screen();
518
+ $options_basic = false;
519
  if (!is_null($screen) && $screen->id === 'settings_page_yarpp') {
520
+ $options_basic = true;
521
  wp_enqueue_style('yarpp_switch_options', plugins_url('style/options_switch.css', dirname(__FILE__)), array(), $version );
522
+ wp_enqueue_script('yarpp_switch_options', yarpp_get_file_url_for_environment('js/options_switch.min.js', 'js/options_switch.js'), array('jquery'), $version );
523
 
524
+ wp_enqueue_style('wp-pointer');
 
525
  wp_enqueue_style('yarpp_remodal', plugins_url('lib/plugin-deactivation-survey/remodal.css', dirname(__FILE__)), array(), $version );
526
  wp_enqueue_style('yarpp_deactivate', plugins_url('lib/plugin-deactivation-survey/deactivate-feedback-form.css', dirname(__FILE__)), array(), $version );
527
  wp_enqueue_style('yarpp_default_theme', plugins_url('lib/plugin-deactivation-survey/remodal-default-theme.css', dirname(__FILE__)), array(), $version );
529
  wp_enqueue_script('postbox');
530
  wp_enqueue_script('wp-pointer');
531
  wp_enqueue_script('yarpp_remodal', plugins_url('lib/plugin-deactivation-survey/remodal.min.js', dirname(__FILE__)), array(), $version );
532
+ wp_enqueue_script('yarpp_options', yarpp_get_file_url_for_environment('js/options_basic.min.js', 'js/options_basic.js'), array('jquery'), $version );
533
  // Localize the script with messages
534
  $translation_strings = array(
535
  'alert_message' => __( 'This will clear all of YARPP’s cached related results.<br> Are you sure?', 'yarpp' ),
546
 
547
  $metabox_post_types = $this->core->get_option('auto_display_post_types');
548
  if (!is_null($screen) && ($screen->id == 'post' || in_array( $screen->id, $metabox_post_types))) {
549
+ $options_basic = true;
550
  wp_enqueue_script('yarpp_metabox', plugins_url('js/metabox.js', dirname(__FILE__)), array('jquery'), $version );
551
  }
552
+ if ( true === $options_basic ) {
553
+ wp_enqueue_style('yarpp_options', plugins_url('style/options_basic.css', dirname(__FILE__)), array(), $version );
554
+ }
555
  }
556
 
557
  public function settings_link($links, $file) {
classes/YARPP_Cache.php CHANGED
@@ -259,7 +259,7 @@ abstract class YARPP_Cache {
259
  }
260
 
261
  $post_types = $this->core->get_query_post_types($reference_post, $args);
262
- $sanitized_post_types = array_map(
263
  function($item){
264
  global $wpdb;
265
  return $wpdb->prepare('%s', $item);
@@ -315,8 +315,10 @@ abstract class YARPP_Cache {
315
  $terms = get_the_terms($reference_ID, $taxonomy);
316
  // if there are no terms of that tax
317
  if (false === $terms) return '(1 = 0)';
318
-
319
- $tt_ids = array_map(
 
 
320
  function($item){
321
  return (int)$item->term_taxonomy_id;
322
  },
259
  }
260
 
261
  $post_types = $this->core->get_query_post_types($reference_post, $args);
262
+ $sanitized_post_types = (array)array_map(
263
  function($item){
264
  global $wpdb;
265
  return $wpdb->prepare('%s', $item);
315
  $terms = get_the_terms($reference_ID, $taxonomy);
316
  // if there are no terms of that tax
317
  if (false === $terms) return '(1 = 0)';
318
+
319
+ // somehow this was returning something other than an array for
320
+ // https://wordpress.org/support/topic/warning-message-yarpp_cache-php/
321
+ $tt_ids = (array)array_map(
322
  function($item){
323
  return (int)$item->term_taxonomy_id;
324
  },
classes/YARPP_Core.php CHANGED
@@ -483,7 +483,7 @@ class YARPP {
483
 
484
  if (!(array_sum($stats) > 0)) return false;
485
 
486
- $sum = array_sum(array_map('array_product', array_map(null, array_values($stats), array_keys($stats))));
487
  $avg = $sum / array_sum( $stats );
488
 
489
  return ($this->cache->cache_status() > 0.1 && $avg > 2);
@@ -597,7 +597,7 @@ class YARPP {
597
  if ($this->templates === false) $this->templates = array();
598
 
599
  // get basenames only
600
- $this->templates = array_map(array($this, 'get_template_data'), $this->templates);
601
  }
602
  return (array) $this->templates;
603
  }
483
 
484
  if (!(array_sum($stats) > 0)) return false;
485
 
486
+ $sum = array_sum((array)array_map('array_product', array_map(null, array_values($stats), array_keys($stats))));
487
  $avg = $sum / array_sum( $stats );
488
 
489
  return ($this->cache->cache_status() > 0.1 && $avg > 2);
597
  if ($this->templates === false) $this->templates = array();
598
 
599
  // get basenames only
600
+ $this->templates = (array)array_map(array($this, 'get_template_data'), $this->templates);
601
  }
602
  return (array) $this->templates;
603
  }
includes/init_functions.php CHANGED
@@ -18,3 +18,23 @@ function yarpp_get_option($option = null) {
18
  global $yarpp;
19
  return $yarpp->get_option($option);
20
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
18
  global $yarpp;
19
  return $yarpp->get_option($option);
20
  }
21
+ /**
22
+ * Given a minified path, and a non-minified path, will return
23
+ * a minified or non-minified file URL based on whether SCRIPT_DEBUG is set true or not.
24
+ *
25
+ * @param string $minified_path minified path.
26
+ * @param string $non_minified_path non-minified path.
27
+ * @return string The URL to the file.
28
+ */
29
+ function yarpp_get_file_url_for_environment( $minified_path, $non_minified_path ) {
30
+ $script_debug = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG;
31
+ if ( true === $script_debug ) {
32
+ $path = plugins_url( $non_minified_path, YARPP_MAIN_FILE );
33
+ } elseif ( false === $script_debug ) {
34
+ $path = plugins_url( $minified_path, YARPP_MAIN_FILE );
35
+ } else {
36
+ // This should work in any case.
37
+ $path = plugins_url( $non_minified_path, YARPP_MAIN_FILE );
38
+ }
39
+ return $path;
40
+ }
includes/phtmls/yarpp_options.phtml CHANGED
@@ -4,7 +4,7 @@
4
  <div id="yarpp_switch_container">
5
  <ul id="yarpp_switch_tabs">
6
  <li>
7
- <a href="options-general.php?page=yarpp&mode=basic">YARPP Basic</a>
8
  </li>
9
  </ul>
10
 
@@ -42,7 +42,7 @@
42
  </script>
43
 
44
  <div>
45
- <input type="submit" class='button-primary yarpp_spin_on_click' name="update_yarpp" value="<?php _e('Save Changes')?>" />
46
  <span class="spinner yarpp-no-float"></span>
47
  <?php wp_nonce_field( 'update_yarpp', 'update_yarpp-nonce' ); ?>
48
  </div>
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
 
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>
js/metabox.js CHANGED
@@ -74,7 +74,7 @@ jQuery(document).ready(function($) {
74
  $refresh_button = $(this);
75
  $spinner = $refresh_button.siblings('.spinner');
76
 
77
- $refresh_button.addClass( 'disabled' );
78
  $spinner.css( 'visibility', 'visible' );
79
 
80
  $('#yarpp-list').css( 'opacity', 0.6 );
74
  $refresh_button = $(this);
75
  $spinner = $refresh_button.siblings('.spinner');
76
 
77
+ $refresh_button.addClass( 'yarpp-disabled' );
78
  $spinner.css( 'visibility', 'visible' );
79
 
80
  $('#yarpp-list').css( 'opacity', 0.6 );
js/options_basic.js CHANGED
@@ -221,7 +221,7 @@ jQuery(function($) {
221
  $copy_templates_button = $(this);
222
  $spinner = $copy_templates_button.siblings('.spinner');
223
 
224
- $copy_templates_button.addClass( 'disabled' );
225
  $spinner.addClass('is-active');
226
 
227
  window.location = window.location + (window.location.search.length ? '&' : '?') + 'action=copy_templates&_ajax_nonce=' + $('#yarpp_copy_templates-nonce').val();
@@ -232,7 +232,7 @@ jQuery(function($) {
232
  $button = $(this);
233
  $spinner = $button.siblings('.spinner');
234
 
235
- $button.addClass( 'disabled' );
236
  $spinner.addClass( 'is-active' );
237
  });
238
 
221
  $copy_templates_button = $(this);
222
  $spinner = $copy_templates_button.siblings('.spinner');
223
 
224
+ $copy_templates_button.addClass( 'yarpp-disabled' );
225
  $spinner.addClass('is-active');
226
 
227
  window.location = window.location + (window.location.search.length ? '&' : '?') + 'action=copy_templates&_ajax_nonce=' + $('#yarpp_copy_templates-nonce').val();
232
  $button = $(this);
233
  $spinner = $button.siblings('.spinner');
234
 
235
+ $button.addClass( 'yarpp-disabled' );
236
  $spinner.addClass( 'is-active' );
237
  });
238
 
js/options_basic.min.js ADDED
@@ -0,0 +1,46 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ jQuery(function($){postboxes.add_postbox_toggles(pagenow);function template(){var metabox=$(this).closest('#yarpp_display_web, #yarpp_display_rss');if(!metabox.length)return;value=metabox.find('.use_template').val();metabox.find('.yarpp_subbox').hide();metabox.find('.template_options_'+value).show();var no_results_area=metabox.find('.yarpp_no_results');if(value==='custom'){no_results_area.hide()}else{no_results_area.show()}
2
+ excerpt.apply(metabox)}
3
+ $('.use_template').each(template).change(template);function excerpt(){var metabox=$(this).closest('#yarpp_display_web, #yarpp_display_rss');metabox.find('.excerpted').toggle(!!(metabox.find('.use_template').val()==='builtin'&&metabox.find('.show_excerpt input').prop('checked')))}
4
+ $('.show_excerpt, .use_template, #yarpp-rss_display').click(excerpt);var loaded_demo_web=!1;function display(){if(!$('#yarpp_display_web .inside').is(':visible'))
5
+ return;$('.yarpp_code_display').toggle($('#yarpp_display_code').is(':checked'));if($('#yarpp_display_web .yarpp_code_display').is(':visible')&&!loaded_demo_web){loaded_demo_web=!0;var demo_web=$('#display_demo_web');$.ajax({type:'POST',url:ajaxurl,data:{action:'yarpp_display_demo',domain:'website','_ajax_nonce':$('#yarpp_display_demo-nonce').val()},beforeSend:function(){demo_web.html(loading)},success:function(html){demo_web.html('<pre>'+html+'</pre>')},dataType:'html'})}}
6
+ $('#yarpp_display_web .handlediv, #yarpp_display_web-hide').click(display);display();var loaded_demo_rss=!1;function rss_display(){if(!$('#yarpp_display_rss .inside').is(':visible'))
7
+ return;if($('#yarpp-rss_display').is(':checked')){$('.rss_displayed').show();$('.yarpp_code_display').toggle($('#yarpp_display_code').is(':checked'));if($('#yarpp_display_rss .yarpp_code_display').is(':visible')&&!loaded_demo_rss){loaded_demo_rss=!0;var demo_rss=$('#display_demo_rss');$.ajax({type:'POST',url:ajaxurl,data:{action:'yarpp_display_demo',domain:'rss','_ajax_nonce':$('#yarpp_display_demo-nonce').val()},beforeSend:function(){demo_rss.html(loading)},success:function(html){demo_rss.html('<pre>'+html+'</pre>')},dataType:'html'})}
8
+ $('#yarpp_display_rss').each(template)}else{$('.rss_displayed').hide()}}
9
+ $('#yarpp-rss_display, #yarpp_display_rss .handlediv, #yarpp_display_rss-hide').click(rss_display);rss_display();function yarpp_rest_display(){if(!$('#yarpp_display_api .inside').is(':visible'))
10
+ return;if($('#yarpp-rest_api_display').is(':checked')){$('.yarpp_rest_displayed').show()}else{$('.yarpp_rest_displayed').hide()}}
11
+ $('#yarpp-rest_api_display').click(yarpp_rest_display);yarpp_rest_display();function yarpp_rest_cache_display(){if($('#yarpp-rest_api_client_side_caching').is(':checked')){$('.yarpp_rest_browser_cache_displayed').show()}else{$('.yarpp_rest_browser_cache_displayed').hide()}}
12
+ $('#yarpp-rest_api_client_side_caching').click(yarpp_rest_cache_display);yarpp_rest_cache_display();var loaded_disallows=!1;function load_disallows(){if(loaded_disallows||!$('#yarpp_pool .inside').is(':visible'))
13
+ return;loaded_disallows=!0;var finished_taxonomies={},term_indices={};function load_disallow(taxonomy){if(taxonomy in finished_taxonomies)
14
+ return;var display=$('#exclude_'+taxonomy);if(display.find('.loading').length)
15
+ return;if(taxonomy in term_indices)
16
+ term_indices[taxonomy]=term_indices[taxonomy]+100;else term_indices[taxonomy]=0;$.ajax({type:'POST',url:ajaxurl,data:{action:'yarpp_display_exclude_terms',taxonomy:taxonomy,offset:term_indices[taxonomy],'_ajax_nonce':$('#yarpp_display_exclude_terms-nonce').val()},beforeSend:function(){display.append(loading)},success:function(html){display.find('.loading').remove();if(':('==html){finished_taxonomies[taxonomy]=!0;display.append("-");return}
17
+ display.append(html)},dataType:'html'})}
18
+ $('.exclude_terms').each(function(){var id=jQuery(this).attr('id'),taxonomy;if(!id)
19
+ return;taxonomy=id.replace('exclude_','');load_disallow(taxonomy);$('#exclude_'+taxonomy).parent('.yarpp_scroll_wrapper').scroll(function(){var parent=$(this),content=parent.children('div');if(parent.scrollTop()+parent.height()>content.height()-10)
20
+ load_disallow(taxonomy)})})}
21
+ $('#yarpp_pool .handlediv, #yarpp_pool-hide').click(load_disallows);load_disallows();function show_help(section){$('#tab-link-'+section+' a').click();$('#contextual-help-link').click()}
22
+ $('#yarpp-optin-learnmore').click(function(){show_help('optin')});$('#yarpp-help-cpt').click(function(){show_help('dev')});if(location.hash=='#help-optin')
23
+ setTimeout(function(){show_help('optin')});$('.yarpp_help[data-help]').hover(function(){var that=$(this),help='<p>'+that.attr('data-help')+'</p>',options={content:help,position:{edge:isRtl?'right':'left',align:'center',of:that},document:{body:that}};var pointer=that.pointer(options).pointer('open');that.closest('.yarpp_form_row, p').mouseleave(function(){pointer.pointer('close')})});$('.yarpp_template_button[data-help]').hover(function(){var that=$(this),help='<p>'+that.attr('data-help')+'</p>',options={content:help,position:{edge:'bottom',of:that},document:{body:that}};var pointer=that.pointer(options).pointer('open');that.mouseleave(function(){pointer.pointer('close')});$('.yarpp_copy_templates_button').on('click',function(){$copy_templates_button=$(this);$spinner=$copy_templates_button.siblings('.spinner');$copy_templates_button.addClass('yarpp-disabled');$spinner.addClass('is-active');window.location=window.location+(window.location.search.length?'&':'?')+'action=copy_templates&_ajax_nonce='+$('#yarpp_copy_templates-nonce').val()})});$('.yarpp_spin_on_click').on('click',function(){$button=$(this);$spinner=$button.siblings('.spinner');$button.addClass('yarpp-disabled');$spinner.addClass('is-active')});$('.yarpp_template_button:not(.disabled)').click(function(){$(this).siblings('input').val($(this).attr('data-value')).change();$(this).siblings().removeClass('active');$(this).addClass('active')});function template_info(){var template=$(this).find('option:selected'),row=template.closest('.yarpp_form_row');if(!!template.attr('data-url')){row.find('.template_author_wrap').toggle(!!template.attr('data-author')).find('span').empty().append('<a>'+template.attr('data-author')+'</a>').attr('href',template.attr('data-url'))}else{row.find('.template_author_wrap').toggle(!!template.attr('data-author')).find('span').text(template.attr('data-author'))}
24
+ row.find('.template_description_wrap').toggle(!!template.attr('data-description')).find('span').text(template.attr('data-description'));row.find('.template_file_wrap').toggle(!!template.attr('data-basename')).find('span').text(template.attr('data-basename'))}
25
+ $('#template_file, #rss_template_file').each(template_info).change(template_info);var loaded_optin_data=!1;function _display_optin_data(){if(!$('#optin_data_frame').is(':visible')||loaded_optin_data)
26
+ return;loaded_optin_data=!0;var frame=$('#optin_data_frame');$.ajax({type:'POST',url:ajaxurl,data:{action:'yarpp_optin_data','_ajax_nonce':$('#yarpp_optin_data-nonce').val()},beforeSend:function(){frame.html(loading)},success:function(html){frame.html('<pre>'+html+'</pre>')},dataType:'html'})}
27
+ function display_optin_data(){setTimeout(_display_optin_data,0)}
28
+ $('#yarpp-optin-learnmore, a[aria-controls=tab-panel-optin]').bind('click focus',display_optin_data);display_optin_data();function sync_no_results(){var value=$(this).find('input').attr('value');if($(this).hasClass('sync_no_results'))
29
+ $('.sync_no_results input').attr('value',value);if($(this).hasClass('sync_rss_no_results'))
30
+ $('.sync_rss_no_results input').attr('value',value)}
31
+ $('.sync_no_results, .sync_rss_no_results').change(sync_no_results);$('#yarpp_display_code').click(function(){var args={action:'yarpp_set_display_code','_ajax_nonce':$('#yarpp_set_display_code-nonce').val()};if($(this).is(':checked'))
32
+ args.checked=!0;$.ajax({type:'POST',url:ajaxurl,data:args});display();rss_display()});function auto_display_archive(){var available=$('.yarpp_form_post_types').is(':has(input[type=checkbox]:checked)');$('#yarpp-auto_display_archive').attr('disabled',!available);if(!available)
33
+ $('#yarpp-auto_display_archive').prop('checked',!1)}
34
+ $('.yarpp_form_post_types input[type=checkbox]').change(auto_display_archive);auto_display_archive();$("#yarpp_fulltext_expand").click(function(e){e.preventDefault();var $details=$("#yarpp_fulltext_details");$details.slideToggle();if($details.hasClass('hidden')){$details.removeClass('hidden');$(this).text('Hide Details [-]')}else{$details.addClass('hidden');$(this).text('Show Details [+]')}});var yarpp_model=$('\
35
+ <div id="shareaholic-deactivate-dialog" class="shareaholic-deactivate-dialog" data-remodal-id="">\
36
+ <div class="shareaholic-deactivate-header" style="background-image: url('+yarpp_messages.logo+'); background-color: '+yarpp_messages.bgcolor+';"><div class="shareaholic-deactivate-text"><h2>'+yarpp_messages.model_title+'</h2></div></div>\
37
+ <div class="shareaholic-deactivate-body">\
38
+ <div class="shareaholic-deactivate-body-foreword">'+yarpp_messages.alert_message+'</div>\
39
+ <div class="shareaholic-deactivate-dialog-footer">\
40
+ <input type="submit" class="button confirm button-secondary" id="yarpp-clear-cache-submit" value="Delete"/>\
41
+ <button data-remodal-action="cancel" class="button button-secondary">Cancel</button>\
42
+ </div>\
43
+ </div>\
44
+ </div>\
45
+ ')[0];$('#yarpp-clear-cache').click(function(){var inst=$(yarpp_model).remodal({hashTracking:!1,closeOnOutsideClick:!1});inst.open();event.preventDefault()});$(document.body).on('click','#yarpp-clear-cache-submit',function(){var inst=$(yarpp_model).remodal();inst.close();var cache_button='#yarpp-clear-cache';var display_notices='#display_notices';var notice_class='notice notice-error is-dismissible';$(cache_button).prop("disabled",!0);$.ajax({type:'POST',url:ajaxurl,data:{action:'yarpp_clear_cache','_ajax_nonce':$('#clear_cache-nonce').val()},beforeSend:function(){$(cache_button).siblings('.spinner').addClass('is-active')},success:function(data){$(cache_button).siblings('.spinner').removeClass('is-active');$(display_notices).show();if('success'==data){var message=yarpp_messages.success;notice_class='notice notice-success is-dismissible';$(cache_button).prop("disabled",!1)}else if('forbidden'==data){var message=yarpp_messages.forbidden}else if('nonce_fail'==data){var message=yarpp_messages.nonce_fail}else{var message=yarpp_messages.error}
46
+ $(display_notices).addClass(notice_class);$(display_notices).html('<p>'+message+'</p>')},error:function(data){$(display_notices).show();$(display_notices).addClass(notice_class);$(cache_button).siblings('.spinner').removeClass('is-active');$(display_notices).html('<p>'+yarpp_messages.error+'</p>')}});$(display_notices).delay(5000).fadeOut(1000)})})
js/options_switch.min.js ADDED
@@ -0,0 +1,2 @@
 
 
1
+ function yarppMakeTheSwitch($,data,url){$.get(url,data,function(resp){if(resp==='ok'){window.location.href='./options-general.php?page=yarpp'}})}
2
+ jQuery(document).ready(function($){$('.yarpp_switch_button').on('click',function(e){e.preventDefault();var url=ajaxurl,data={action:'yarpp_switch',go:$(this).data('go'),'_ajax_nonce':$('#yarpp_switch-nonce').val()};if(data.go==='basic'){$('#wpwrap').after('<div id="yarpp_pro_disable_overlay">'+'</div>'+'<div id="yarpp_pro_disable_confirm">'+'<p>'+'Are you sure you would like to deactivate YARPP Pro? '+'Doing so will remove all <strong>YARPP Pro</strong> '+'content from your site, including sidebar widgets.'+'</p>'+'<br/>'+'<a id="yarpp_proceed_deactivation" class="button">Deactivate YARPP Pro</a>'+'&nbsp;&nbsp;&nbsp;&nbsp;'+'<a id="yarpp_cancel_deactivation" class="button-primary">Cancel Deactivation</a>'+'</div>');$('#yarpp_proceed_deactivation').on('click',function(){yarppMakeTheSwitch($,data,url)});$('#yarpp_cancel_deactivation').on('click',function(){window.location.reload()})}else{yarppMakeTheSwitch($,data,url)}});$('#yarpp-display-mode-save').on('click',function(e){e.preventDefault();var url=$(this).attr('href'),data={ypsdt:!0,types:[]};$(this).after($('<span class="spinner"></span>'));$i=0;$('input','#yarpp-display-mode').each(function(idx,val){if(val.checked){data.types[$i]=val.value;$i++}});$.get(url,data,function(resp){setTimeout(function(){if(resp==='ok'){$('.spinner','#yarpp-display-mode').remove()}else{$('#yarpp-display-mode').append($('<span style="vertical-align: middle" class="error-message">Something went wrong saving your settings. Please refresh the page and try again.</span>'))}},1000)})})})
readme.txt CHANGED
@@ -5,7 +5,7 @@ Requires at least: 3.7
5
  Requires PHP: 5.3
6
  License: GPLv2 or later
7
  Tested up to: 5.7
8
- Stable tag: 5.15.3
9
 
10
  The most popular plugin to display a list of related posts on your site based on a powerful unique algorithm.
11
 
@@ -309,6 +309,14 @@ add_action(
309
  `
310
 
311
  == Changelog ==
 
 
 
 
 
 
 
 
312
  = 5.15.3 (15-March-2021) =
313
  * Enhancement: Improved readability of the database indexes prompt
314
 
@@ -1106,5 +1114,5 @@ After a break of many years, the plugin is 100% supported now that the baton has
1106
  * Initial upload
1107
 
1108
  == Upgrade Notice ==
1109
- = 5.15.3 =
1110
  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!
5
  Requires PHP: 5.3
6
  License: GPLv2 or later
7
  Tested up to: 5.7
8
+ Stable tag: 5.16.1
9
 
10
  The most popular plugin to display a list of related posts on your site based on a powerful unique algorithm.
11
 
309
  `
310
 
311
  == Changelog ==
312
+ = 5.16.1 (29-March-2021) =
313
+ * Bugfix: include new minified JS files
314
+
315
+ = 5.16.0 (29-March-2021) =
316
+ * Enhancement: Switched to minified JavaScript in YARPP Admin for a speed boost
317
+ * [Bugfix](https://wordpress.org/support/topic/cannot-save-changes-spinning-forever/): Resolved conflict with Easy Forms for MailChimp which was preventing YARPP settings from being saved
318
+ * [Bugfix](https://wordpress.org/support/topic/warning-message-yarpp_cache-php/): Resolved join warning
319
+
320
  = 5.15.3 (15-March-2021) =
321
  * Enhancement: Improved readability of the database indexes prompt
322
 
1114
  * Initial upload
1115
 
1116
  == Upgrade Notice ==
1117
+ = 5.16.1 =
1118
  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!
style/options_basic.css CHANGED
@@ -398,4 +398,12 @@ body.rtl #yarpp-optin-learnmore {
398
  }
399
  .yarpp-notice{
400
  border-left-color:#ffb900;;
 
 
 
 
 
 
 
 
401
  }
398
  }
399
  .yarpp-notice{
400
  border-left-color:#ffb900;;
401
+ }
402
+ .yarpp-disabled{
403
+ color: #a7aaad!important;
404
+ background: #f6f7f7!important;
405
+ border-color: #dcdcde!important;
406
+ box-shadow: none!important;
407
+ text-shadow: none!important;
408
+ cursor: not-allowed !important;
409
  }
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.15.3
6
  Author: YARPP
7
  Author URI: https://yarpp.com/
8
  Plugin URI: https://yarpp.com/
@@ -24,7 +24,7 @@ if(!defined('WP_CONTENT_DIR')){
24
  define('WP_CONTENT_DIR', substr($tr,0,strrpos($tr,'/')));
25
  }
26
 
27
- define('YARPP_VERSION', '5.15.3');
28
 
29
  define('YARPP_DIR', dirname(__FILE__));
30
  /**
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.16.1
6
  Author: YARPP
7
  Author URI: https://yarpp.com/
8
  Plugin URI: https://yarpp.com/
24
  define('WP_CONTENT_DIR', substr($tr,0,strrpos($tr,'/')));
25
  }
26
 
27
+ define('YARPP_VERSION', '5.16.1');
28
 
29
  define('YARPP_DIR', dirname(__FILE__));
30
  /**