Plugin Directory

Changeset 3466359


Ignore:
Timestamp:
02/21/2026 11:06:50 AM (3 weeks ago)
Author:
Ajay
Message:

v4.2.1 - bugs squashed

Location:
top-10
Files:
433 added
1 deleted
18 edited

Legend:

Unmodified
Added
Removed
  • top-10/trunk/css/left-thumbs-rtl.css

    r3461636 r3466359  
    4545        box-shadow var(--tptn-transition);
    4646    will-change: transform;
     47    width: min(var(--tptn-thumb-width, 9999px), 100%);
     48    height: var(--tptn-thumb-height, auto);
     49    max-width: 100%;
    4750}
    4851
     
    5356
    5457.tptn-left-thumbs img.tptn_thumb {
    55     width: 100%;
    56     height: auto;
     58    width: min(var(--tptn-thumb-width, 9999px), 100%) !important;
     59    height: var(--tptn-thumb-height, auto) !important;
     60    max-width: 100%;
    5761    display: block;
    5862    object-fit: cover;
     63    aspect-ratio: var(--tptn-thumb-aspect-ratio, auto);
    5964    border-radius: calc(var(--tptn-border-radius) * 0.75);
    6065}
  • top-10/trunk/css/left-thumbs-rtl.min.css

    r3461636 r3466359  
    1 .tptn-left-thumbs{--tptn-gap:0.625rem;--tptn-border-radius:8px;--tptn-thumb-border:#ccc;--tptn-shadow:0 2px 4px rgba(0, 0, 0, 0.15);--tptn-shadow-hover:0 4px 8px rgba(0, 0, 0, 0.2);--tptn-transition:0.2s ease}.tptn-left-thumbs ul{margin:0!important;padding:0!important;list-style:none}.tptn-left-thumbs ul li{display:flex;gap:var(--tptn-gap);align-items:flex-start;margin-bottom:1.25rem;padding:0!important;background:100% 0;list-style:none}.tptn-left-thumbs ul li:last-child{margin-bottom:0}.tptn-left-thumbs .tptn_thumb{flex-shrink:0;display:block;padding:.25rem!important;border:1px solid var(--tptn-thumb-border);border-radius:var(--tptn-border-radius);box-shadow:var(--tptn-shadow);transition:transform var(--tptn-transition),box-shadow var(--tptn-transition);will-change:transform}.tptn-left-thumbs ul li:hover .tptn_thumb{transform:scale(1.03);box-shadow:var(--tptn-shadow-hover)}.tptn-left-thumbs img.tptn_thumb{width:100%;height:auto;display:block;object-fit:cover;border-radius:calc(var(--tptn-border-radius) * .75)}.tptn-left-thumbs .tptn_after_thumb{flex:1;min-width:0}.tptn-left-thumbs a.tptn_link{text-decoration:none}.tptn-left-thumbs .tptn_title{display:block;margin-bottom:.375rem;font-weight:600;line-height:1.3;text-decoration:none}.tptn-left-thumbs a.tptn_link:hover .tptn_title{text-decoration:underline}.tptn-left-thumbs .tptn_excerpt{display:block;font-size:.9em;line-height:1.4;opacity:.85}@media (prefers-reduced-motion:reduce){.tptn-left-thumbs .tptn_thumb{transition:none;will-change:auto}.tptn-left-thumbs ul li:hover .tptn_thumb{transform:none}}
     1.tptn-left-thumbs{--tptn-gap:0.625rem;--tptn-border-radius:8px;--tptn-thumb-border:#ccc;--tptn-shadow:0 2px 4px rgba(0, 0, 0, 0.15);--tptn-shadow-hover:0 4px 8px rgba(0, 0, 0, 0.2);--tptn-transition:0.2s ease}.tptn-left-thumbs ul{margin:0!important;padding:0!important;list-style:none}.tptn-left-thumbs ul li{display:flex;gap:var(--tptn-gap);align-items:flex-start;margin-bottom:1.25rem;padding:0!important;background:100% 0;list-style:none}.tptn-left-thumbs ul li:last-child{margin-bottom:0}.tptn-left-thumbs .tptn_thumb{flex-shrink:0;display:block;padding:.25rem!important;border:1px solid var(--tptn-thumb-border);border-radius:var(--tptn-border-radius);box-shadow:var(--tptn-shadow);transition:transform var(--tptn-transition),box-shadow var(--tptn-transition);will-change:transform;width:min(var(--tptn-thumb-width,9999px),100%);height:var(--tptn-thumb-height,auto);max-width:100%}.tptn-left-thumbs ul li:hover .tptn_thumb{transform:scale(1.03);box-shadow:var(--tptn-shadow-hover)}.tptn-left-thumbs img.tptn_thumb{width:min(var(--tptn-thumb-width,9999px),100%)!important;height:var(--tptn-thumb-height,auto)!important;max-width:100%;display:block;object-fit:cover;aspect-ratio:var(--tptn-thumb-aspect-ratio,auto);border-radius:calc(var(--tptn-border-radius) * .75)}.tptn-left-thumbs .tptn_after_thumb{flex:1;min-width:0}.tptn-left-thumbs a.tptn_link{text-decoration:none}.tptn-left-thumbs .tptn_title{display:block;margin-bottom:.375rem;font-weight:600;line-height:1.3;text-decoration:none}.tptn-left-thumbs a.tptn_link:hover .tptn_title{text-decoration:underline}.tptn-left-thumbs .tptn_excerpt{display:block;font-size:.9em;line-height:1.4;opacity:.85}@media (prefers-reduced-motion:reduce){.tptn-left-thumbs .tptn_thumb{transition:none;will-change:auto}.tptn-left-thumbs ul li:hover .tptn_thumb{transform:none}}
  • top-10/trunk/css/left-thumbs.css

    r3461636 r3466359  
    4343    transition: transform var(--tptn-transition), box-shadow var(--tptn-transition);
    4444    will-change: transform;
     45    width: min(var(--tptn-thumb-width, 9999px), 100%);
     46    height: var(--tptn-thumb-height, auto);
     47    max-width: 100%;
    4548}
    4649
     
    5154
    5255.tptn-left-thumbs img.tptn_thumb {
    53     width: 100%;
    54     height: auto;
     56    width: min(var(--tptn-thumb-width, 9999px), 100%) !important;
     57    height: var(--tptn-thumb-height, auto) !important;
     58    max-width: 100%;
    5559    display: block;
    5660    object-fit: cover;
     61    aspect-ratio: var(--tptn-thumb-aspect-ratio, auto);
    5762    border-radius: calc(var(--tptn-border-radius) * 0.75);
    5863}
  • top-10/trunk/css/left-thumbs.min.css

    r3461636 r3466359  
    1 .tptn-left-thumbs{--tptn-gap:0.625rem;--tptn-border-radius:8px;--tptn-thumb-border:#ccc;--tptn-shadow:0 2px 4px rgba(0, 0, 0, 0.15);--tptn-shadow-hover:0 4px 8px rgba(0, 0, 0, 0.2);--tptn-transition:0.2s ease}.tptn-left-thumbs ul{margin:0!important;padding:0!important;list-style:none}.tptn-left-thumbs ul li{display:flex;gap:var(--tptn-gap);align-items:flex-start;margin-bottom:1.25rem;padding:0!important;background:0 0;list-style:none}.tptn-left-thumbs ul li:last-child{margin-bottom:0}.tptn-left-thumbs .tptn_thumb{flex-shrink:0;display:block;padding:.25rem!important;border:1px solid var(--tptn-thumb-border);border-radius:var(--tptn-border-radius);box-shadow:var(--tptn-shadow);transition:transform var(--tptn-transition),box-shadow var(--tptn-transition);will-change:transform}.tptn-left-thumbs ul li:hover .tptn_thumb{transform:scale(1.03);box-shadow:var(--tptn-shadow-hover)}.tptn-left-thumbs img.tptn_thumb{width:100%;height:auto;display:block;object-fit:cover;border-radius:calc(var(--tptn-border-radius) * .75)}.tptn-left-thumbs .tptn_after_thumb{flex:1;min-width:0}.tptn-left-thumbs a.tptn_link{text-decoration:none}.tptn-left-thumbs .tptn_title{display:block;margin-bottom:.375rem;font-weight:600;line-height:1.3;text-decoration:none}.tptn-left-thumbs a.tptn_link:hover .tptn_title{text-decoration:underline}.tptn-left-thumbs .tptn_excerpt{display:block;font-size:.9em;line-height:1.4;opacity:.85}@media (prefers-reduced-motion:reduce){.tptn-left-thumbs .tptn_thumb{transition:none;will-change:auto}.tptn-left-thumbs ul li:hover .tptn_thumb{transform:none}}
     1.tptn-left-thumbs{--tptn-gap:0.625rem;--tptn-border-radius:8px;--tptn-thumb-border:#ccc;--tptn-shadow:0 2px 4px rgba(0, 0, 0, 0.15);--tptn-shadow-hover:0 4px 8px rgba(0, 0, 0, 0.2);--tptn-transition:0.2s ease}.tptn-left-thumbs ul{margin:0!important;padding:0!important;list-style:none}.tptn-left-thumbs ul li{display:flex;gap:var(--tptn-gap);align-items:flex-start;margin-bottom:1.25rem;padding:0!important;background:0 0;list-style:none}.tptn-left-thumbs ul li:last-child{margin-bottom:0}.tptn-left-thumbs .tptn_thumb{flex-shrink:0;display:block;padding:.25rem!important;border:1px solid var(--tptn-thumb-border);border-radius:var(--tptn-border-radius);box-shadow:var(--tptn-shadow);transition:transform var(--tptn-transition),box-shadow var(--tptn-transition);will-change:transform;width:min(var(--tptn-thumb-width,9999px),100%);height:var(--tptn-thumb-height,auto);max-width:100%}.tptn-left-thumbs ul li:hover .tptn_thumb{transform:scale(1.03);box-shadow:var(--tptn-shadow-hover)}.tptn-left-thumbs img.tptn_thumb{width:min(var(--tptn-thumb-width,9999px),100%)!important;height:var(--tptn-thumb-height,auto)!important;max-width:100%;display:block;object-fit:cover;aspect-ratio:var(--tptn-thumb-aspect-ratio,auto);border-radius:calc(var(--tptn-border-radius) * .75)}.tptn-left-thumbs .tptn_after_thumb{flex:1;min-width:0}.tptn-left-thumbs a.tptn_link{text-decoration:none}.tptn-left-thumbs .tptn_title{display:block;margin-bottom:.375rem;font-weight:600;line-height:1.3;text-decoration:none}.tptn-left-thumbs a.tptn_link:hover .tptn_title{text-decoration:underline}.tptn-left-thumbs .tptn_excerpt{display:block;font-size:.9em;line-height:1.4;opacity:.85}@media (prefers-reduced-motion:reduce){.tptn-left-thumbs .tptn_thumb{transition:none;will-change:auto}.tptn-left-thumbs ul li:hover .tptn_thumb{transform:none}}
  • top-10/trunk/includes/admin/class-settings.php

    r3461636 r3466359  
    14121412                    'request_fail_message' => esc_html__( 'Request failed: ', 'top-10' ),
    14131413                    'left_thumbs_message'  => esc_html__( 'Note: This setting cannot be changed as the Popular posts style is set to Left thumbnails. You can change the style in the Styles tab.', 'top-10' ),
     1414                    'grid_thumbs_message'  => esc_html__( 'Note: This setting cannot be changed as the Popular posts style is set to Grid thumbnails. You can change the style in the Styles tab.', 'top-10' ),
    14141415                    'text_only_message'    => esc_html__( 'Note: This setting cannot be changed as the Popular posts style is set to Text only. You can change the style in the Styles tab.', 'top-10' ),
    14151416                ),
     
    14501451        $style = $settings['tptn_styles'] ?? '';
    14511452
    1452         // Overwrite settings if left_thumbs style is selected.
    1453         if ( 'left_thumbs' === $style ) {
     1453        $inline_thumb_styles = array(
     1454            'left_thumbs' => esc_html__( 'Note: Thumbnail location can only be Inline or Thumbnails only when the Popular posts style is set to Left thumbnails. You can change the style in the Styles tab.', 'top-10' ),
     1455            'grid_thumbs' => esc_html__( 'Note: Thumbnail location can only be Inline or Thumbnails only when the Popular posts style is set to Grid thumbnails. You can change the style in the Styles tab.', 'top-10' ),
     1456        );
     1457
     1458        if ( array_key_exists( $style, $inline_thumb_styles ) ) {
    14541459            $post_thumb_op = $settings['post_thumb_op'] ?? '';
    14551460            if ( 'inline' !== $post_thumb_op && 'thumbs_only' !== $post_thumb_op ) {
     
    14601465                self::$prefix . '-notices',
    14611466                '',
    1462                 esc_html__( 'Note: Thumbnail location can only be Inline or Thumbnails only when the Popular posts style is set to Left thumbnails. You can change the style in the Styles tab.', 'top-10' ),
     1467                $inline_thumb_styles[ $style ],
    14631468                'warning'
    14641469            );
  • top-10/trunk/includes/admin/class-tools-page.php

    r3461636 r3466359  
    104104                'top_ten_admin_data',
    105105                array(
    106                     'ajax_url'             => admin_url( 'admin-ajax.php' ),
    107                     'security'             => wp_create_nonce( 'tptn-admin' ),
    108                     'confirm_message'      => esc_html__( 'Are you sure you want to clear the cache?', 'top-10' ),
    109                     'clearing_text'        => esc_html__( 'Clearing...', 'top-10' ),
    110                     'fail_message'         => esc_html__( 'Failed to clear cache. Please try again.', 'top-10' ),
    111                     'request_fail_message' => esc_html__( 'Request failed: ', 'top-10' ),
     106                    'ajax_url' => admin_url( 'admin-ajax.php' ),
     107                    'security' => wp_create_nonce( 'tptn-admin' ),
     108                    'strings'  => array(
     109                        'confirm_message'      => esc_html__( 'Are you sure you want to clear the cache?', 'top-10' ),
     110                        'clearing_text'        => esc_html__( 'Clearing...', 'top-10' ),
     111                        'fail_message'         => esc_html__( 'Failed to clear cache. Please try again.', 'top-10' ),
     112                        'request_fail_message' => esc_html__( 'Request failed: ', 'top-10' ),
     113                    ),
    112114                )
    113115            );
  • top-10/trunk/includes/admin/js/admin-scripts.js

    r3461636 r3466359  
    4545        }
    4646
     47        var strings = top_ten_admin_data.strings || {};
     48        var styleRules = {
     49            'left_thumbs': {
     50                allowed: ['inline', 'thumbs_only'],
     51                fallback: 'inline',
     52                message: strings.left_thumbs_message
     53            },
     54            'grid_thumbs': {
     55                allowed: ['inline', 'thumbs_only'],
     56                fallback: 'inline',
     57                message: strings.grid_thumbs_message || strings.left_thumbs_message
     58            },
     59            'text_only': {
     60                force: 'text_only',
     61                disableAll: true,
     62                message: strings.text_only_message
     63            }
     64        };
     65
    4766        function removeMessage() {
    4867            var $container = $postThumbOptions.first().closest('td');
     
    8099        function updateFieldStates() {
    81100            var selectedStyle = $styleSelect.val();
    82             var strings = top_ten_admin_data.strings || {};
    83101            var $checked = $postThumbOptions.filter(':checked');
     102            var rule = styleRules[selectedStyle] || null;
    84103
    85104            removeMessage();
    86105            $postThumbOptions.prop('disabled', false);
    87106
    88             if ('left_thumbs' === selectedStyle) {
     107            if (!rule) {
     108                return;
     109            }
     110
     111            if (rule.disableAll) {
     112                $postThumbOptions.prop('disabled', true);
     113            }
     114
     115            if (rule.allowed && rule.allowed.length) {
    89116                $postThumbOptions.each(function () {
    90117                    var $option = $(this);
    91118                    var value = $option.val();
    92 
    93                     if ('inline' !== value && 'thumbs_only' !== value) {
     119                    if (-1 === rule.allowed.indexOf(value)) {
    94120                        $option.prop('disabled', true);
    95121                    }
    96122                });
    97123
    98                 if (!$checked.length || ('inline' !== $checked.val() && 'thumbs_only' !== $checked.val())) {
    99                     $postThumbOptions.filter('[value="inline"]').prop('checked', true);
    100                 }
    101 
    102                 addMessage(strings.left_thumbs_message);
    103             }
    104 
    105             if ('text_only' === selectedStyle) {
    106                 $postThumbOptions.prop('disabled', true);
    107                 $postThumbOptions.filter('[value="text_only"]').prop('checked', true);
    108                 addMessage(strings.text_only_message);
     124                if (!$checked.length || -1 === rule.allowed.indexOf($checked.val())) {
     125                    var fallback = rule.fallback || rule.allowed[0];
     126                    $postThumbOptions.filter('[value="' + fallback + '"]').prop('checked', true);
     127                }
     128            }
     129
     130            if (rule.force) {
     131                $postThumbOptions.filter('[value="' + rule.force + '"]').prop('checked', true);
     132            }
     133
     134            if (rule.message) {
     135                addMessage(rule.message);
    109136            }
    110137        }
  • top-10/trunk/includes/admin/js/admin-scripts.min.js

    r3461636 r3466359  
    1 jQuery(document).ready(function(t){function e(e,a){if(a){if(a.status_html){var n=e.closest("td").find(".tptn-fast-config-status").first();n.length||(n=t(".tptn-fast-config-status").first()),n.length&&n.replaceWith(t(a.status_html))}if(a.generate_nonce&&t(".tptn-generate-fast-config").data("nonce",a.generate_nonce),a.delete_nonce&&t(".tptn-delete-fast-config").data("nonce",a.delete_nonce),void 0!==a.has_config){var i=t(".tptn-delete-fast-config");i.length&&i.prop("disabled",!a.has_config)}a.message&&alert(a.message)}}t('button[name="tptn_cache_clear"]').on("click",function(){if(confirm(top_ten_admin_data.strings.confirm_message)){var e=t(this),a=e.text(),n=top_ten_admin_data.strings.clearing_text?top_ten_admin_data.strings.clearing_text:"Clearing...";e.prop("disabled",!0).text(n).append(' <span class="spinner is-active"></span>'),function(e,a){t.post(ajaxurl,{action:"tptn_clear_cache",security:top_ten_admin_data.security},function(t){t.success?alert(t.data.message):alert(top_ten_admin_data.strings.fail_message)}).fail(function(t,e){alert(top_ten_admin_data.strings.request_fail_message+e)}).always(function(){e&&e.length&&e.prop("disabled",!1).text(a).find(".spinner").remove()})}(e,a)}}),function(){var e=t('select[name="tptn_settings[tptn_styles]"]');if(e.length){var a=t('input[name="tptn_settings[post_thumb_op]"]');a.length&&(i(),e.on("change",i))}function n(e){if(e){var n=a.first().closest("td");n.length||(n=a.first().parent());var i=n.find(".tptn-js-message");i.length?i.text(e):n.append(t("<p />",{class:"description tptn-js-message",css:{color:"#9B0800"},text:e}))}}function i(){var i,o=e.val(),s=top_ten_admin_data.strings||{},c=a.filter(":checked");(i=a.first().closest("td")).length||(i=a.first().parent()),i.find(".tptn-js-message").remove(),a.prop("disabled",!1),"left_thumbs"===o&&(a.each(function(){var e=t(this),a=e.val();"inline"!==a&&"thumbs_only"!==a&&e.prop("disabled",!0)}),(!c.length||"inline"!==c.val()&&"thumbs_only"!==c.val())&&a.filter('[value="inline"]').prop("checked",!0),n(s.left_thumbs_message)),"text_only"===o&&(a.prop("disabled",!0),a.filter('[value="text_only"]').prop("checked",!0),n(s.text_only_message))}}(),t("body").on("click",".tptn-generate-fast-config",function(){var a,n,i=t(this).data("confirm");confirm(i)&&(a=t(this),n=a.text(),a.prop("disabled",!0).text("Generating..."),t.post(ajaxurl,{action:"tptn_generate_fast_config",security:a.data("nonce")},function(t){t&&t.data&&(t.data.nonce&&a.data("nonce",t.data.nonce),e(a,t.data))}).fail(function(t,e){window.console&&window.console.error&&window.console.error(top_ten_admin_data.strings.request_fail_message+e)}).always(function(){a.prop("disabled",!1).text(n)}))}),t("body").on("click",".tptn-delete-fast-config",function(){var a,n,i=t(this).data("confirm");confirm(i)&&(a=t(this),n=a.text(),a.prop("disabled",!0).text("Deleting..."),t.post(ajaxurl,{action:"tptn_delete_fast_config",security:a.data("nonce")},function(t){t&&t.data&&(t.data.nonce&&a.data("nonce",t.data.nonce),e(a,t.data))}).fail(function(t,e){window.console&&window.console.error&&window.console.error(top_ten_admin_data.strings.request_fail_message+e)}).always(function(){a.text(n),a.data("nonce")&&a.prop("disabled",!1)}))}),t(function(){var e=t("#dashboard-historical-visits");e.tabs({create:function(e,a){t(a.tab.find("a")).addClass("nav-tab-active")},activate:function(e,a){t(a.oldTab.find("a")).removeClass("nav-tab-active"),t(a.newTab.find("a")).addClass("nav-tab-active")}}),setTimeout(function(){var a=e.tabs(),n=0;e.find(".nav-tab-wrapper li a").each(function(e){if(t(this).text().indexOf("Today")>=0)return n=e,!1}),a.tabs("option","active",n),e.find(".nav-tab-wrapper li a").removeClass("nav-tab-active"),e.find(".nav-tab-wrapper li").eq(n).find("a").addClass("nav-tab-active")},10)}),t(function(){var e="dd M yy",a=t("#datepicker-from").datepicker({changeMonth:!0,maxDate:0,dateFormat:e}).on("change",function(){n.datepicker("option","minDate",i(this))}),n=t("#datepicker-to").datepicker({changeMonth:!0,maxDate:0,dateFormat:e}).on("change",function(){a.datepicker("option","maxDate",i(this))});function i(a){var n;try{n=t.datepicker.parseDate(e,a.value)}catch(t){n=null}return n}}),t(".live_edit").on("click",function(){t(this).addClass("live_edit_mode").removeClass("live_edit_mode_success live_edit_mode_error")}),t(".live_edit").on("focusout keypress",function(e){if("focusout"===e.type||13===e.which){13==e.which&&e.preventDefault();var a=t(this),n=a.attr("data-wp-post-id"),i=a.attr("data-wp-blog-id"),o=a.attr("data-wp-count"),s=a.text();a.removeClass("live_edit_mode");var c={action:"tptn_edit_count_ajax",post_id:n,total_count:s,total_count_original:o,top_ten_admin_nonce:top_ten_admin.nonce};i&&(c.blog_id=i),t.ajax({type:"POST",dataType:"json",url:ajaxurl,data:c,success:function(t){!1===t?(a.addClass("live_edit_mode_error"),a.html(o)):t>0&&a.addClass("live_edit_mode_success")}})}})});
     1jQuery(document).ready(function(t){function e(e,a){if(a){if(a.status_html){var n=e.closest("td").find(".tptn-fast-config-status").first();n.length||(n=t(".tptn-fast-config-status").first()),n.length&&n.replaceWith(t(a.status_html))}if(a.generate_nonce&&t(".tptn-generate-fast-config").data("nonce",a.generate_nonce),a.delete_nonce&&t(".tptn-delete-fast-config").data("nonce",a.delete_nonce),void 0!==a.has_config){var i=t(".tptn-delete-fast-config");i.length&&i.prop("disabled",!a.has_config)}a.message&&alert(a.message)}}t('button[name="tptn_cache_clear"]').on("click",function(){if(confirm(top_ten_admin_data.strings.confirm_message)){var e=t(this),a=e.text(),n=top_ten_admin_data.strings.clearing_text?top_ten_admin_data.strings.clearing_text:"Clearing...";e.prop("disabled",!0).text(n).append(' <span class="spinner is-active"></span>'),function(e,a){t.post(ajaxurl,{action:"tptn_clear_cache",security:top_ten_admin_data.security},function(t){t.success?alert(t.data.message):alert(top_ten_admin_data.strings.fail_message)}).fail(function(t,e){alert(top_ten_admin_data.strings.request_fail_message+e)}).always(function(){e&&e.length&&e.prop("disabled",!1).text(a).find(".spinner").remove()})}(e,a)}}),function(){var e=t('select[name="tptn_settings[tptn_styles]"]');if(e.length){var a=t('input[name="tptn_settings[post_thumb_op]"]');if(a.length){var n=top_ten_admin_data.strings||{},i={left_thumbs:{allowed:["inline","thumbs_only"],fallback:"inline",message:n.left_thumbs_message},grid_thumbs:{allowed:["inline","thumbs_only"],fallback:"inline",message:n.grid_thumbs_message||n.left_thumbs_message},text_only:{force:"text_only",disableAll:!0,message:n.text_only_message}};s(),e.on("change",s)}}function s(){var n,s=e.val(),o=a.filter(":checked"),c=i[s]||null;if((n=a.first().closest("td")).length||(n=a.first().parent()),n.find(".tptn-js-message").remove(),a.prop("disabled",!1),c){if(c.disableAll&&a.prop("disabled",!0),c.allowed&&c.allowed.length&&(a.each(function(){var e=t(this),a=e.val();-1===c.allowed.indexOf(a)&&e.prop("disabled",!0)}),!o.length||-1===c.allowed.indexOf(o.val()))){var d=c.fallback||c.allowed[0];a.filter('[value="'+d+'"]').prop("checked",!0)}c.force&&a.filter('[value="'+c.force+'"]').prop("checked",!0),c.message&&function(e){if(e){var n=a.first().closest("td");n.length||(n=a.first().parent());var i=n.find(".tptn-js-message");i.length?i.text(e):n.append(t("<p />",{class:"description tptn-js-message",css:{color:"#9B0800"},text:e}))}}(c.message)}}}(),t("body").on("click",".tptn-generate-fast-config",function(){var a,n,i=t(this).data("confirm");confirm(i)&&(a=t(this),n=a.text(),a.prop("disabled",!0).text("Generating..."),t.post(ajaxurl,{action:"tptn_generate_fast_config",security:a.data("nonce")},function(t){t&&t.data&&(t.data.nonce&&a.data("nonce",t.data.nonce),e(a,t.data))}).fail(function(t,e){window.console&&window.console.error&&window.console.error(top_ten_admin_data.strings.request_fail_message+e)}).always(function(){a.prop("disabled",!1).text(n)}))}),t("body").on("click",".tptn-delete-fast-config",function(){var a,n,i=t(this).data("confirm");confirm(i)&&(a=t(this),n=a.text(),a.prop("disabled",!0).text("Deleting..."),t.post(ajaxurl,{action:"tptn_delete_fast_config",security:a.data("nonce")},function(t){t&&t.data&&(t.data.nonce&&a.data("nonce",t.data.nonce),e(a,t.data))}).fail(function(t,e){window.console&&window.console.error&&window.console.error(top_ten_admin_data.strings.request_fail_message+e)}).always(function(){a.text(n),a.data("nonce")&&a.prop("disabled",!1)}))}),t(function(){var e=t("#dashboard-historical-visits");e.tabs({create:function(e,a){t(a.tab.find("a")).addClass("nav-tab-active")},activate:function(e,a){t(a.oldTab.find("a")).removeClass("nav-tab-active"),t(a.newTab.find("a")).addClass("nav-tab-active")}}),setTimeout(function(){var a=e.tabs(),n=0;e.find(".nav-tab-wrapper li a").each(function(e){if(t(this).text().indexOf("Today")>=0)return n=e,!1}),a.tabs("option","active",n),e.find(".nav-tab-wrapper li a").removeClass("nav-tab-active"),e.find(".nav-tab-wrapper li").eq(n).find("a").addClass("nav-tab-active")},10)}),t(function(){var e="dd M yy",a=t("#datepicker-from").datepicker({changeMonth:!0,maxDate:0,dateFormat:e}).on("change",function(){n.datepicker("option","minDate",i(this))}),n=t("#datepicker-to").datepicker({changeMonth:!0,maxDate:0,dateFormat:e}).on("change",function(){a.datepicker("option","maxDate",i(this))});function i(a){var n;try{n=t.datepicker.parseDate(e,a.value)}catch(t){n=null}return n}}),t(".live_edit").on("click",function(){t(this).addClass("live_edit_mode").removeClass("live_edit_mode_success live_edit_mode_error")}),t(".live_edit").on("focusout keypress",function(e){if("focusout"===e.type||13===e.which){13==e.which&&e.preventDefault();var a=t(this),n=a.attr("data-wp-post-id"),i=a.attr("data-wp-blog-id"),s=a.attr("data-wp-count"),o=a.text();a.removeClass("live_edit_mode");var c={action:"tptn_edit_count_ajax",post_id:n,total_count:o,total_count_original:s,top_ten_admin_nonce:top_ten_admin.nonce};i&&(c.blog_id=i),t.ajax({type:"POST",dataType:"json",url:ajaxurl,data:c,success:function(t){!1===t?(a.addClass("live_edit_mode_error"),a.html(s)):t>0&&a.addClass("live_edit_mode_success")}})}})});
  • top-10/trunk/includes/admin/settings/class-settings-api.php

    r3461636 r3466359  
    1919 * Settings API wrapper class
    2020 *
    21  * @version 2.8.0
     21 * @version 2.8.1
    2222 */
    2323class Settings_API {
     
    2828     * @var   string
    2929     */
    30     public const VERSION = '2.8.0';
     30    public const VERSION = '2.8.1';
    3131
    3232    /**
     
    946946                <h1><?php echo esc_html( $this->translation_strings['page_header'] ); ?></h1>
    947947                <?php do_action( $this->prefix . '_settings_page_header' ); // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.DynamicHooknameFound ?>
    948                 <?php settings_errors( $this->prefix . '-notices' ); ?>
     948
     949                <?php
     950                // WordPress automatically calls settings_errors() on Settings pages.
     951                // Only call it manually on custom menu pages to prevent duplicates.
     952                $current_screen = get_current_screen();
     953                if ( $current_screen && 0 !== strpos( $current_screen->base, 'settings_page_' ) ) {
     954                    settings_errors( $this->prefix . '-notices' );
     955                }
     956                ?>
    949957
    950958                <div id="poststuff">
  • top-10/trunk/includes/admin/settings/class-settings-wizard-api.php

    r3461636 r3466359  
    127127     *     @type array  $menu_args           Menu arguments array with parent and capability.
    128128     *     @type bool   $hide_when_completed Whether to hide the wizard submenu item after completion.
     129     *     @type bool   $show_in_menu        Whether to show the wizard in the admin menu.
    129130     * }
    130131     */
     
    140141            'page_slug'           => "{$prefix}_wizard",
    141142            'hide_when_completed' => true,
     143            'show_in_menu'        => true,
    142144            'menu_args'           => array(
    143145                'parent'     => '', // Empty for dashboard, or parent slug for submenu.
     
    234236        );
    235237
    236         $hide_when_completed = isset( $this->args['hide_when_completed'] ) ? (bool) $this->args['hide_when_completed'] : true;
    237         if ( $hide_when_completed && $this->is_wizard_completed() ) {
     238        $hide_submenu = ( isset( $this->args['show_in_menu'] ) && ! $this->args['show_in_menu'] ) ||
     239            ( ( $this->args['hide_when_completed'] ?? true ) && $this->is_wizard_completed() );
     240
     241        if ( $hide_submenu ) {
    238242            add_action( 'admin_head', array( $this, 'hide_completed_wizard_submenu' ) );
    239243        }
     
    246250     */
    247251    public function hide_completed_wizard_submenu() {
    248         if ( ! $this->is_wizard_completed() ) {
    249             return;
    250         }
    251252        $slug = sanitize_key( $this->page_slug );
    252253        ?>
  • top-10/trunk/includes/class-main.php

    r3461636 r3466359  
    99
    1010use WebberZone\Top_Ten\Admin\Cron;
     11
    1112if ( ! defined( 'WPINC' ) ) {
    1213    exit;
    1314}
     15
    1416/**
    1517 * Main plugin class.
     
    136138            self::$instance->init();
    137139        }
     140
    138141        return self::$instance;
    139142    }
     
    162165        $this->feed       = new Frontend\Feed();
    163166        $this->cron       = new Cron();
     167
    164168        new Hook_Loader();
     169
    165170        // Initialize admin on init action to ensure translations are loaded.
    166171        add_action( 'init', array( $this, 'init_admin' ) );
  • top-10/trunk/includes/frontend/class-rest-api.php

    r3461636 r3466359  
    121121     */
    122122    public function permissions_check( \WP_REST_Request $request ) {
     123        $context = $request->get_param( 'context' );
     124
     125        if ( 'edit' === $context && ! current_user_can( 'edit_posts' ) ) {
     126            return new \WP_Error(
     127                'rest_forbidden_context',
     128                __( 'Sorry, you are not allowed to view this context.', 'top-10' ),
     129                array( 'status' => rest_authorization_required_code() )
     130            );
     131        }
     132
    123133        return apply_filters( 'top_ten_rest_api_permissions_check', true, $request );
    124134    }
     
    151161        if ( is_array( $results ) && ! empty( $results ) ) {
    152162            foreach ( $results as $popular_post ) {
    153                 if ( ! $this->check_read_permission( $popular_post ) ) {
     163                if ( ! $this->check_read_permission( $popular_post, $request ) ) {
    154164                    continue;
    155165                }
     
    184194
    185195        $post = get_post( (int) $id );
    186         if ( empty( $post ) || empty( $post->ID ) || ! $this->check_read_permission( $post ) ) {
     196        if ( empty( $post ) || empty( $post->ID ) || ! $this->check_read_permission( $post, $request ) ) {
    187197            return $error;
    188198        }
     
    300310                'type'        => 'string',
    301311            ),
     312            'context'    => array(
     313                'description' => esc_html__( 'Scope under which the request is made; determines fields present in response.', 'top-10' ),
     314                'type'        => 'string',
     315                'enum'        => array( 'view', 'embed', 'edit' ),
     316                'default'     => 'view',
     317            ),
    302318        );
    303319
     
    405421     * @since 3.0.0
    406422     *
    407      * @param \WP_Post $post Post object.
     423     * @param \WP_Post         $post    Post object.
     424     * @param \WP_REST_Request $request WP Rest request.
    408425     * @return bool Whether the post can be read.
    409426     */
    410     public function check_read_permission( $post ) {
     427    public function check_read_permission( $post, $request = null ) {
    411428        $post_type = get_post_type_object( $post->post_type );
    412429        if ( ! $this->check_is_post_type_allowed( $post_type ) ) {
    413430            return false;
     431        }
     432
     433        // If context is 'edit', require edit permissions to prevent exposing sensitive data like passwords.
     434        if ( $request && 'edit' === $request->get_param( 'context' ) ) {
     435            if ( ! current_user_can( 'edit_post', $post->ID ) ) {
     436                return false;
     437            }
    414438        }
    415439
     
    428452            $parent = get_post( $post->post_parent );
    429453            if ( $parent ) {
    430                 return $this->check_read_permission( $parent );
     454                return $this->check_read_permission( $parent, $request );
    431455            }
    432456        }
  • top-10/trunk/includes/frontend/class-styles-handler.php

    r3461636 r3466359  
    111111        $thumb_width  = tptn_get_option( 'thumb_width' );
    112112        $thumb_height = tptn_get_option( 'thumb_height' );
     113        $width_value  = absint( $thumb_width );
     114        $height_value = absint( $thumb_height );
     115
     116        if ( ! $width_value ) {
     117            $width_value = 1;
     118        }
     119
     120        if ( ! $height_value ) {
     121            $height_value = 1;
     122        }
     123        $aspect_ratio = sprintf( '%d / %d', $width_value, $height_value );
    113124        $tptn_style   = ! empty( $style ) ? $style : tptn_get_option( 'tptn_styles' );
    114125
     
    120131                --tptn-thumb-width: {$thumb_width}px;
    121132                --tptn-thumb-height: {$thumb_height}px;
     133                --tptn-thumb-aspect-ratio: {$aspect_ratio};
    122134            }
    123135            .tptn-left-thumbs img.tptn_thumb {
  • top-10/trunk/includes/util/class-hook-registry.php

    r3461636 r3466359  
    239239        if ( is_array( $callback ) ) {
    240240            if ( is_object( $callback[0] ) ) {
    241                 return get_class( $callback[0] ) . '::' . $callback[1];
     241                $object_hash = spl_object_hash( $callback[0] );
     242                return get_class( $callback[0] ) . '#' . $object_hash . '::' . $callback[1];
    242243            }
    243244            return $callback[0] . '::' . $callback[1];
  • top-10/trunk/languages/top-10-en_US.po

    r3461636 r3466359  
    3333msgstr ""
    3434
    35 #: includes/admin/class-tools-page.php:445
    36 #: includes/admin/class-tools-page.php:450
    37 #: includes/admin/class-tools-page.php:461
    38 #: includes/admin/class-tools-page.php:465
     35#: includes/admin/class-tools-page.php:447
     36#: includes/admin/class-tools-page.php:452
     37#: includes/admin/class-tools-page.php:463
     38#: includes/admin/class-tools-page.php:467
    3939msgid "Installed"
    4040msgstr ""
    4141
    42 #: includes/admin/class-tools-page.php:446
    43 #: includes/admin/class-tools-page.php:451
    44 #: includes/admin/class-tools-page.php:462
    45 #: includes/admin/class-tools-page.php:466
     42#: includes/admin/class-tools-page.php:448
     43#: includes/admin/class-tools-page.php:453
     44#: includes/admin/class-tools-page.php:464
     45#: includes/admin/class-tools-page.php:468
    4646msgid "Not Installed"
    4747msgstr ""
    4848
    49 #: includes/admin/class-tools-page.php:499
     49#: includes/admin/class-tools-page.php:501
    5050msgid "Database version"
    5151msgstr ""
    5252
    53 #: includes/admin/class-tools-page.php:501
     53#: includes/admin/class-tools-page.php:503
    5454msgid "Installed version"
    5555msgstr ""
    5656
    57 #: includes/admin/class-tools-page.php:502
     57#: includes/admin/class-tools-page.php:504
    5858msgid "Current version"
    5959msgstr ""
    6060
    6161#. translators: %s: Table name
    62 #: includes/admin/class-tools-page.php:507
    63 #: includes/admin/class-tools-page.php:536
     62#: includes/admin/class-tools-page.php:509
     63#: includes/admin/class-tools-page.php:538
    6464#, php-format
    6565msgid "%s table"
    6666msgstr ""
    6767
    68 #: includes/admin/class-tools-page.php:566
     68#: includes/admin/class-tools-page.php:568
    6969msgid "Repair database"
    7070msgstr ""
    7171
    72 #: includes/admin/class-tools-page.php:569
     72#: includes/admin/class-tools-page.php:571
    7373msgid "Recreate tables"
    7474msgstr ""
    7575
    76 #: includes/admin/class-tools-page.php:591
     76#: includes/admin/class-tools-page.php:593
    7777msgid "Security check failed"
    7878msgstr ""
    7979
    80 #: includes/admin/class-tools-page.php:595
     80#: includes/admin/class-tools-page.php:597
    8181msgid "You do not have sufficient permissions to access this page."
    8282msgstr ""
    8383
    84 #: includes/admin/class-tools-page.php:626
     84#: includes/admin/class-tools-page.php:628
    8585msgid "Tables have been recreated successfully."
    8686msgstr ""
     
    205205#. translators: 1: Support link.
    206206#: includes/admin/class-dashboard.php:665
    207 #: includes/admin/class-tools-page.php:404
     207#: includes/admin/class-tools-page.php:406
    208208#, php-format
    209209msgid "For more information or how to get support visit the <a href=\"%1$s\">WebberZone support site</a>."
     
    212212#. translators: 1: Forum link.
    213213#: includes/admin/class-dashboard.php:667
    214 #: includes/admin/class-tools-page.php:406
     214#: includes/admin/class-tools-page.php:408
    215215#, php-format
    216216msgid "Support queries should be posted in the <a href=\"%1$s\">WordPress.org support forums</a>."
     
    221221#: includes/admin/class-dashboard.php:670
    222222#: includes/admin/class-settings.php:1242
    223 #: includes/admin/class-tools-page.php:409
     223#: includes/admin/class-tools-page.php:411
    224224#, php-format
    225225msgid "<a href=\"%1$s\">Post an issue</a> on <a href=\"%2$s\">GitHub</a> (bug reports only)."
     
    229229#: includes/admin/class-settings.php:177
    230230#: includes/admin/class-settings.php:1266
    231 #: includes/admin/class-tools-page.php:418
     231#: includes/admin/class-tools-page.php:420
    232232msgid "General"
    233233msgstr ""
     
    508508#: includes/admin/class-tools-page.php:61
    509509#: includes/admin/class-tools-page.php:80
    510 #: includes/admin/class-tools-page.php:167
     510#: includes/admin/class-tools-page.php:169
    511511msgid "Top 10 Tools"
    512512msgstr ""
     
    519519
    520520#: includes/admin/class-settings.php:1408
    521 #: includes/admin/class-tools-page.php:108
     521#: includes/admin/class-tools-page.php:109
    522522msgid "Are you sure you want to clear the cache?"
    523523msgstr ""
    524524
    525525#: includes/admin/class-settings.php:1411
    526 #: includes/admin/class-tools-page.php:110
     526#: includes/admin/class-tools-page.php:111
    527527msgid "Failed to clear cache. Please try again."
    528528msgstr ""
    529529
    530530#: includes/admin/class-settings.php:1412
    531 #: includes/admin/class-tools-page.php:111
     531#: includes/admin/class-tools-page.php:112
    532532msgid "Request failed: "
    533533msgstr ""
    534534
    535 #: includes/admin/class-tools-page.php:135
     535#: includes/admin/class-tools-page.php:137
    536536msgid "Primary Key has been recreated"
    537537msgstr ""
    538538
    539 #: includes/admin/class-tools-page.php:145
     539#: includes/admin/class-tools-page.php:147
    540540msgid "Top 10 popular posts reset"
    541541msgstr ""
    542542
    543 #: includes/admin/class-tools-page.php:155
     543#: includes/admin/class-tools-page.php:157
    544544msgid "Top 10 daily popular posts reset"
    545545msgstr ""
    546546
    547 #: includes/admin/class-tools-page.php:161
     547#: includes/admin/class-tools-page.php:163
    548548msgid "Top 10 tables have been recreated"
    549549msgstr ""
    550550
    551 #: includes/admin/class-tools-page.php:179
     551#: includes/admin/class-tools-page.php:181
    552552msgid "Database Status"
    553553msgstr ""
    554554
    555 #: includes/admin/class-tools-page.php:188
    556 #: includes/admin/class-tools-page.php:194
     555#: includes/admin/class-tools-page.php:190
     556#: includes/admin/class-tools-page.php:196
    557557msgid "Clear cache"
    558558msgstr ""
    559559
    560 #: includes/admin/class-tools-page.php:199
     560#: includes/admin/class-tools-page.php:201
    561561msgid "Clear the Top 10 cache. This will also be cleared automatically when you save the settings page."
    562562msgstr ""
    563563
    564 #: includes/admin/class-tools-page.php:205
    565 #: includes/admin/class-tools-page.php:208
     564#: includes/admin/class-tools-page.php:207
     565#: includes/admin/class-tools-page.php:210
    566566msgid "Recreate Primary Key"
    567567msgstr ""
    568568
    569 #: includes/admin/class-tools-page.php:211
     569#: includes/admin/class-tools-page.php:213
    570570msgid "Deletes and reinitializes the primary key in the database tables. If the above function gives an error, then you can run the below code in phpMyAdmin or Adminer. Remember to backup your database first!"
    571571msgstr ""
    572572
    573 #: includes/admin/class-tools-page.php:220
     573#: includes/admin/class-tools-page.php:222
    574574msgid "Reset database"
    575575msgstr ""
    576576
    577 #: includes/admin/class-tools-page.php:223
     577#: includes/admin/class-tools-page.php:225
    578578msgid "This will reset the Top 10 tables. If this is a multisite install, this will reset the popular posts for the current site. If this is the Network Admin screen, then it will reset the popular posts across all sites. This cannot be reversed. Make sure that your database has been backed up before proceeding"
    579579msgstr ""
    580580
    581 #: includes/admin/class-tools-page.php:229
     581#: includes/admin/class-tools-page.php:231
    582582msgid "Are you sure you want to reset the popular posts?"
    583583msgstr ""
    584584
    585 #: includes/admin/class-tools-page.php:230
     585#: includes/admin/class-tools-page.php:232
    586586msgid "Reset Popular Posts"
    587587msgstr ""
    588588
    589 #: includes/admin/class-tools-page.php:238
     589#: includes/admin/class-tools-page.php:240
    590590msgid "Are you sure you want to reset the daily popular posts?"
    591591msgstr ""
    592592
    593 #: includes/admin/class-tools-page.php:239
     593#: includes/admin/class-tools-page.php:241
    594594msgid "Reset Daily Popular Posts"
    595595msgstr ""
    596596
    597 #: includes/admin/class-tools-page.php:248
    598 #: includes/admin/class-tools-page.php:254
     597#: includes/admin/class-tools-page.php:250
     598#: includes/admin/class-tools-page.php:256
    599599msgid "Recreate Database Tables"
    600600msgstr ""
    601601
    602 #: includes/admin/class-tools-page.php:251
     602#: includes/admin/class-tools-page.php:253
    603603msgid "Only click the button below after performing a full backup of the database. You can use any of the popular backup plugins or phpMyAdmin to achieve this. The authors of this plugin do not guarantee that everything will go smoothly as it depends on your site environment and volume of data. If you are not comfortable, please do not proceed."
    604604msgstr ""
    605605
    606 #: includes/admin/class-tools-page.php:254
     606#: includes/admin/class-tools-page.php:256
    607607msgid "Hit Cancel if you have not backed up your database"
    608608msgstr ""
    609609
    610 #: includes/admin/class-tools-page.php:420
     610#: includes/admin/class-tools-page.php:422
    611611msgid "This screen provides some tools that help maintain certain features of Top 10."
    612612msgstr ""
    613613
    614 #: includes/admin/class-tools-page.php:421
     614#: includes/admin/class-tools-page.php:423
    615615msgid "Clear the cache, reset the popular posts tables plus some miscellaneous fixes for older versions of Top 10."
    616616msgstr ""
     
    14861486
    14871487#: includes/admin/class-settings.php:893
    1488 #: includes/admin/class-settings.php:1499
     1488#: includes/admin/class-settings.php:1504
    14891489msgid "Default thumbnail"
    14901490msgstr ""
     
    16701670
    16711671#: includes/admin/class-dashboard-widgets.php:280
    1672 #: includes/admin/class-settings.php:1536
    1673 #: includes/admin/class-settings.php:1556
    1674 #: includes/admin/class-settings.php:1557
     1672#: includes/admin/class-settings.php:1541
     1673#: includes/admin/class-settings.php:1561
     1674#: includes/admin/class-settings.php:1562
    16751675msgid "Upgrade to Pro"
    16761676msgstr ""
     
    17631763msgstr ""
    17641764
    1765 #: includes/frontend/class-rest-api.php:294
     1765#: includes/frontend/class-rest-api.php:304
    17661766#: includes/frontend/blocks/build/popular-posts/index.js:1
    17671767#: includes/frontend/blocks/src/popular-posts/components/post-display-controls.js:8
     
    20692069msgstr ""
    20702070
    2071 #: includes/frontend/class-rest-api.php:177
    2072 #: includes/frontend/class-rest-api.php:256
     2071#: includes/frontend/class-rest-api.php:187
     2072#: includes/frontend/class-rest-api.php:266
    20732073msgid "Invalid post ID."
    20742074msgstr ""
    20752075
    2076 #: includes/frontend/class-rest-api.php:299
     2076#: includes/frontend/class-rest-api.php:309
    20772077msgid "Post types"
    20782078msgstr ""
    20792079
    2080 #: includes/frontend/class-rest-api.php:317
    2081 #: includes/frontend/class-rest-api.php:351
     2080#: includes/frontend/class-rest-api.php:333
     2081#: includes/frontend/class-rest-api.php:367
    20822082msgid "ID of the post."
    20832083msgstr ""
    20842084
    2085 #: includes/frontend/class-rest-api.php:322
     2085#: includes/frontend/class-rest-api.php:338
    20862086msgid "Blog ID of the post."
    20872087msgstr ""
    20882088
    2089 #: includes/frontend/class-rest-api.php:327
     2089#: includes/frontend/class-rest-api.php:343
    20902090msgid "Activate counter flag."
    20912091msgstr ""
    20922092
    2093 #: includes/frontend/class-rest-api.php:332
     2093#: includes/frontend/class-rest-api.php:348
    20942094msgid "Debug flag."
    20952095msgstr ""
    20962096
    2097 #: includes/frontend/class-rest-api.php:356
     2097#: includes/frontend/class-rest-api.php:372
    20982098msgid "Counter type."
    20992099msgstr ""
    21002100
    2101 #: includes/frontend/class-rest-api.php:361
     2101#: includes/frontend/class-rest-api.php:377
    21022102msgid "Blog ID."
    21032103msgstr ""
    21042104
    2105 #: includes/frontend/class-rest-api.php:366
     2105#: includes/frontend/class-rest-api.php:382
    21062106msgid "From date."
    21072107msgstr ""
    21082108
    2109 #: includes/frontend/class-rest-api.php:371
     2109#: includes/frontend/class-rest-api.php:387
    21102110msgid "To date."
    21112111msgstr ""
     
    21742174msgstr ""
    21752175
    2176 #: includes/admin/class-settings.php:1624
     2176#: includes/admin/class-settings.php:1629
    21772177msgctxt "tag delimiter"
    21782178msgid ","
     
    24832483
    24842484#: includes/admin/class-settings.php:1409
    2485 #: includes/admin/class-tools-page.php:109
     2485#: includes/admin/class-tools-page.php:110
    24862486msgid "Clearing..."
    24872487msgstr ""
    24882488
    2489 #: includes/admin/class-settings.php:1584
    2490 #: includes/admin/class-settings.php:1586
    2491 #: includes/admin/class-settings.php:1587
     2489#: includes/admin/class-settings.php:1589
     2490#: includes/admin/class-settings.php:1591
     2491#: includes/admin/class-settings.php:1592
    24922492msgid "Start Settings Wizard"
    24932493msgstr ""
    24942494
    24952495#. translators: 1: Number of entries, 2: Estimated table size
    2496 #: includes/admin/class-tools-page.php:517
    2497 #: includes/admin/class-tools-page.php:546
     2496#: includes/admin/class-tools-page.php:519
     2497#: includes/admin/class-tools-page.php:548
    24982498#, php-format
    24992499msgid "Entries: %1$s | Est. Size: %2$s"
     
    25012501
    25022502#. translators: 1: Number of entries, 2: Table size
    2503 #: includes/admin/class-tools-page.php:524
    2504 #: includes/admin/class-tools-page.php:553
     2503#: includes/admin/class-tools-page.php:526
     2504#: includes/admin/class-tools-page.php:555
    25052505#, php-format
    25062506msgid "Entries: %1$s | Size: %2$s"
     
    25952595msgstr ""
    25962596
    2597 #: includes/admin/class-settings.php:1414
     2597#: includes/admin/class-settings.php:1415
    25982598msgid "Note: This setting cannot be changed as the Popular posts style is set to Text only. You can change the style in the Styles tab."
    25992599msgstr ""
    26002600
    2601 #: includes/admin/class-settings.php:1462
     2601#: includes/admin/class-settings.php:1454
    26022602msgid "Note: Thumbnail location can only be Inline or Thumbnails only when the Popular posts style is set to Left thumbnails. You can change the style in the Styles tab."
    26032603msgstr ""
    26042604
    2605 #: includes/admin/class-settings.php:1473
     2605#: includes/admin/class-settings.php:1478
    26062606msgid "Note: Thumbnail location set to Text only as the Popular posts style is set to Text only. You can change the style in the Styles tab."
    26072607msgstr ""
    26082608
    2609 #: includes/admin/class-settings.php:1568
     2609#: includes/admin/class-settings.php:1573
    26102610msgid "Note: Thumbnail location is set to \"Do not display thumbnails, only text\". This may override the selected style."
    26112611msgstr ""
     
    26462646msgid "HTTP status %d"
    26472647msgstr ""
     2648
     2649#: includes/admin/class-settings.php:1414
     2650msgid "Note: This setting cannot be changed as the Popular posts style is set to Grid thumbnails. You can change the style in the Styles tab."
     2651msgstr ""
     2652
     2653#: includes/admin/class-settings.php:1455
     2654msgid "Note: Thumbnail location can only be Inline or Thumbnails only when the Popular posts style is set to Grid thumbnails. You can change the style in the Styles tab."
     2655msgstr ""
     2656
     2657#: includes/frontend/class-rest-api.php:128
     2658msgid "Sorry, you are not allowed to view this context."
     2659msgstr ""
     2660
     2661#: includes/frontend/class-rest-api.php:313
     2662msgid "Scope under which the request is made; determines fields present in response."
     2663msgstr ""
  • top-10/trunk/languages/top-10.pot

    r3461636 r3466359  
    33msgid ""
    44msgstr ""
    5 "Project-Id-Version: WebberZone Top 10 4.2.0\n"
     5"Project-Id-Version: WebberZone Top 10 4.2.1\n"
    66"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/top-10\n"
    77"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
     
    1010"Content-Type: text/plain; charset=UTF-8\n"
    1111"Content-Transfer-Encoding: 8bit\n"
    12 "POT-Creation-Date: 2026-02-14T04:43:26+00:00\n"
     12"POT-Creation-Date: 2026-02-21T09:24:19+00:00\n"
    1313"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
    1414"X-Generator: WP-CLI 2.12.0\n"
     
    161161
    162162#: includes/admin/class-dashboard-widgets.php:280
    163 #: includes/admin/class-settings.php:1536
    164 #: includes/admin/class-settings.php:1556
    165 #: includes/admin/class-settings.php:1557
     163#: includes/admin/class-settings.php:1541
     164#: includes/admin/class-settings.php:1561
     165#: includes/admin/class-settings.php:1562
    166166msgid "Upgrade to Pro"
    167167msgstr ""
     
    258258#. translators: 1: Support link.
    259259#: includes/admin/class-dashboard.php:665
    260 #: includes/admin/class-tools-page.php:404
     260#: includes/admin/class-tools-page.php:406
    261261#, php-format
    262262msgid "For more information or how to get support visit the <a href=\"%1$s\">WebberZone support site</a>."
     
    265265#. translators: 1: Forum link.
    266266#: includes/admin/class-dashboard.php:667
    267 #: includes/admin/class-tools-page.php:406
     267#: includes/admin/class-tools-page.php:408
    268268#, php-format
    269269msgid "Support queries should be posted in the <a href=\"%1$s\">WordPress.org support forums</a>."
     
    274274#: includes/admin/class-dashboard.php:670
    275275#: includes/admin/class-settings.php:1242
    276 #: includes/admin/class-tools-page.php:409
     276#: includes/admin/class-tools-page.php:411
    277277#, php-format
    278278msgid "<a href=\"%1$s\">Post an issue</a> on <a href=\"%2$s\">GitHub</a> (bug reports only)."
     
    282282#: includes/admin/class-settings.php:177
    283283#: includes/admin/class-settings.php:1266
    284 #: includes/admin/class-tools-page.php:418
     284#: includes/admin/class-tools-page.php:420
    285285msgid "General"
    286286msgstr ""
     
    12721272
    12731273#: includes/admin/class-settings.php:893
    1274 #: includes/admin/class-settings.php:1499
     1274#: includes/admin/class-settings.php:1504
    12751275msgid "Default thumbnail"
    12761276msgstr ""
     
    15341534
    15351535#: includes/admin/class-settings.php:1408
    1536 #: includes/admin/class-tools-page.php:108
     1536#: includes/admin/class-tools-page.php:109
    15371537msgid "Are you sure you want to clear the cache?"
    15381538msgstr ""
    15391539
    15401540#: includes/admin/class-settings.php:1409
    1541 #: includes/admin/class-tools-page.php:109
     1541#: includes/admin/class-tools-page.php:110
    15421542msgid "Clearing..."
    15431543msgstr ""
     
    15481548
    15491549#: includes/admin/class-settings.php:1411
    1550 #: includes/admin/class-tools-page.php:110
     1550#: includes/admin/class-tools-page.php:111
    15511551msgid "Failed to clear cache. Please try again."
    15521552msgstr ""
    15531553
    15541554#: includes/admin/class-settings.php:1412
    1555 #: includes/admin/class-tools-page.php:111
     1555#: includes/admin/class-tools-page.php:112
    15561556msgid "Request failed: "
    15571557msgstr ""
     
    15621562
    15631563#: includes/admin/class-settings.php:1414
     1564msgid "Note: This setting cannot be changed as the Popular posts style is set to Grid thumbnails. You can change the style in the Styles tab."
     1565msgstr ""
     1566
     1567#: includes/admin/class-settings.php:1415
    15641568msgid "Note: This setting cannot be changed as the Popular posts style is set to Text only. You can change the style in the Styles tab."
    15651569msgstr ""
    15661570
    1567 #: includes/admin/class-settings.php:1462
     1571#: includes/admin/class-settings.php:1454
    15681572msgid "Note: Thumbnail location can only be Inline or Thumbnails only when the Popular posts style is set to Left thumbnails. You can change the style in the Styles tab."
    15691573msgstr ""
    15701574
    1571 #: includes/admin/class-settings.php:1473
     1575#: includes/admin/class-settings.php:1455
     1576msgid "Note: Thumbnail location can only be Inline or Thumbnails only when the Popular posts style is set to Grid thumbnails. You can change the style in the Styles tab."
     1577msgstr ""
     1578
     1579#: includes/admin/class-settings.php:1478
    15721580msgid "Note: Thumbnail location set to Text only as the Popular posts style is set to Text only. You can change the style in the Styles tab."
    15731581msgstr ""
    15741582
    1575 #: includes/admin/class-settings.php:1568
     1583#: includes/admin/class-settings.php:1573
    15761584msgid "Note: Thumbnail location is set to \"Do not display thumbnails, only text\". This may override the selected style."
    15771585msgstr ""
    15781586
    1579 #: includes/admin/class-settings.php:1584
    1580 #: includes/admin/class-settings.php:1586
    1581 #: includes/admin/class-settings.php:1587
     1587#: includes/admin/class-settings.php:1589
     1588#: includes/admin/class-settings.php:1591
     1589#: includes/admin/class-settings.php:1592
    15821590msgid "Start Settings Wizard"
    15831591msgstr ""
    15841592
    1585 #: includes/admin/class-settings.php:1624
     1593#: includes/admin/class-settings.php:1629
    15861594msgctxt "tag delimiter"
    15871595msgid ","
     
    16731681#: includes/admin/class-tools-page.php:61
    16741682#: includes/admin/class-tools-page.php:80
    1675 #: includes/admin/class-tools-page.php:167
     1683#: includes/admin/class-tools-page.php:169
    16761684msgid "Top 10 Tools"
    16771685msgstr ""
    16781686
    1679 #: includes/admin/class-tools-page.php:135
     1687#: includes/admin/class-tools-page.php:137
    16801688msgid "Primary Key has been recreated"
    16811689msgstr ""
    16821690
    1683 #: includes/admin/class-tools-page.php:145
     1691#: includes/admin/class-tools-page.php:147
    16841692msgid "Top 10 popular posts reset"
    16851693msgstr ""
    16861694
    1687 #: includes/admin/class-tools-page.php:155
     1695#: includes/admin/class-tools-page.php:157
    16881696msgid "Top 10 daily popular posts reset"
    16891697msgstr ""
    16901698
    1691 #: includes/admin/class-tools-page.php:161
     1699#: includes/admin/class-tools-page.php:163
    16921700msgid "Top 10 tables have been recreated"
    16931701msgstr ""
    16941702
    1695 #: includes/admin/class-tools-page.php:179
     1703#: includes/admin/class-tools-page.php:181
    16961704msgid "Database Status"
    16971705msgstr ""
    16981706
    1699 #: includes/admin/class-tools-page.php:188
    1700 #: includes/admin/class-tools-page.php:194
     1707#: includes/admin/class-tools-page.php:190
     1708#: includes/admin/class-tools-page.php:196
    17011709msgid "Clear cache"
    17021710msgstr ""
    17031711
    1704 #: includes/admin/class-tools-page.php:199
     1712#: includes/admin/class-tools-page.php:201
    17051713msgid "Clear the Top 10 cache. This will also be cleared automatically when you save the settings page."
    17061714msgstr ""
    17071715
    1708 #: includes/admin/class-tools-page.php:205
    1709 #: includes/admin/class-tools-page.php:208
     1716#: includes/admin/class-tools-page.php:207
     1717#: includes/admin/class-tools-page.php:210
    17101718msgid "Recreate Primary Key"
    17111719msgstr ""
    17121720
    1713 #: includes/admin/class-tools-page.php:211
     1721#: includes/admin/class-tools-page.php:213
    17141722msgid "Deletes and reinitializes the primary key in the database tables. If the above function gives an error, then you can run the below code in phpMyAdmin or Adminer. Remember to backup your database first!"
    17151723msgstr ""
    17161724
    1717 #: includes/admin/class-tools-page.php:220
     1725#: includes/admin/class-tools-page.php:222
    17181726msgid "Reset database"
    17191727msgstr ""
    17201728
    1721 #: includes/admin/class-tools-page.php:223
     1729#: includes/admin/class-tools-page.php:225
    17221730msgid "This will reset the Top 10 tables. If this is a multisite install, this will reset the popular posts for the current site. If this is the Network Admin screen, then it will reset the popular posts across all sites. This cannot be reversed. Make sure that your database has been backed up before proceeding"
    17231731msgstr ""
    17241732
    1725 #: includes/admin/class-tools-page.php:229
     1733#: includes/admin/class-tools-page.php:231
    17261734msgid "Are you sure you want to reset the popular posts?"
    17271735msgstr ""
    17281736
    1729 #: includes/admin/class-tools-page.php:230
     1737#: includes/admin/class-tools-page.php:232
    17301738msgid "Reset Popular Posts"
    17311739msgstr ""
    17321740
    1733 #: includes/admin/class-tools-page.php:238
     1741#: includes/admin/class-tools-page.php:240
    17341742msgid "Are you sure you want to reset the daily popular posts?"
    17351743msgstr ""
    17361744
    1737 #: includes/admin/class-tools-page.php:239
     1745#: includes/admin/class-tools-page.php:241
    17381746msgid "Reset Daily Popular Posts"
    17391747msgstr ""
    17401748
    1741 #: includes/admin/class-tools-page.php:248
    1742 #: includes/admin/class-tools-page.php:254
     1749#: includes/admin/class-tools-page.php:250
     1750#: includes/admin/class-tools-page.php:256
    17431751msgid "Recreate Database Tables"
    17441752msgstr ""
    17451753
    1746 #: includes/admin/class-tools-page.php:251
     1754#: includes/admin/class-tools-page.php:253
    17471755msgid "Only click the button below after performing a full backup of the database. You can use any of the popular backup plugins or phpMyAdmin to achieve this. The authors of this plugin do not guarantee that everything will go smoothly as it depends on your site environment and volume of data. If you are not comfortable, please do not proceed."
    17481756msgstr ""
    17491757
    1750 #: includes/admin/class-tools-page.php:254
     1758#: includes/admin/class-tools-page.php:256
    17511759msgid "Hit Cancel if you have not backed up your database"
    17521760msgstr ""
    17531761
    1754 #: includes/admin/class-tools-page.php:420
     1762#: includes/admin/class-tools-page.php:422
    17551763msgid "This screen provides some tools that help maintain certain features of Top 10."
    17561764msgstr ""
    17571765
    1758 #: includes/admin/class-tools-page.php:421
     1766#: includes/admin/class-tools-page.php:423
    17591767msgid "Clear the cache, reset the popular posts tables plus some miscellaneous fixes for older versions of Top 10."
    17601768msgstr ""
    17611769
    1762 #: includes/admin/class-tools-page.php:445
    1763 #: includes/admin/class-tools-page.php:450
    1764 #: includes/admin/class-tools-page.php:461
    1765 #: includes/admin/class-tools-page.php:465
     1770#: includes/admin/class-tools-page.php:447
     1771#: includes/admin/class-tools-page.php:452
     1772#: includes/admin/class-tools-page.php:463
     1773#: includes/admin/class-tools-page.php:467
    17661774msgid "Installed"
    17671775msgstr ""
    17681776
    1769 #: includes/admin/class-tools-page.php:446
    1770 #: includes/admin/class-tools-page.php:451
    1771 #: includes/admin/class-tools-page.php:462
    1772 #: includes/admin/class-tools-page.php:466
     1777#: includes/admin/class-tools-page.php:448
     1778#: includes/admin/class-tools-page.php:453
     1779#: includes/admin/class-tools-page.php:464
     1780#: includes/admin/class-tools-page.php:468
    17731781msgid "Not Installed"
    17741782msgstr ""
    17751783
    1776 #: includes/admin/class-tools-page.php:499
     1784#: includes/admin/class-tools-page.php:501
    17771785msgid "Database version"
    17781786msgstr ""
    17791787
    1780 #: includes/admin/class-tools-page.php:501
     1788#: includes/admin/class-tools-page.php:503
    17811789msgid "Installed version"
    17821790msgstr ""
    17831791
    1784 #: includes/admin/class-tools-page.php:502
     1792#: includes/admin/class-tools-page.php:504
    17851793msgid "Current version"
    17861794msgstr ""
    17871795
    17881796#. translators: %s: Table name
    1789 #: includes/admin/class-tools-page.php:507
    1790 #: includes/admin/class-tools-page.php:536
     1797#: includes/admin/class-tools-page.php:509
     1798#: includes/admin/class-tools-page.php:538
    17911799#, php-format
    17921800msgid "%s table"
     
    17941802
    17951803#. translators: 1: Number of entries, 2: Estimated table size
    1796 #: includes/admin/class-tools-page.php:517
    1797 #: includes/admin/class-tools-page.php:546
     1804#: includes/admin/class-tools-page.php:519
     1805#: includes/admin/class-tools-page.php:548
    17981806#, php-format
    17991807msgid "Entries: %1$s | Est. Size: %2$s"
     
    18011809
    18021810#. translators: 1: Number of entries, 2: Table size
    1803 #: includes/admin/class-tools-page.php:524
    1804 #: includes/admin/class-tools-page.php:553
     1811#: includes/admin/class-tools-page.php:526
     1812#: includes/admin/class-tools-page.php:555
    18051813#, php-format
    18061814msgid "Entries: %1$s | Size: %2$s"
    18071815msgstr ""
    18081816
    1809 #: includes/admin/class-tools-page.php:566
     1817#: includes/admin/class-tools-page.php:568
    18101818msgid "Repair database"
    18111819msgstr ""
    18121820
    1813 #: includes/admin/class-tools-page.php:569
     1821#: includes/admin/class-tools-page.php:571
    18141822msgid "Recreate tables"
    18151823msgstr ""
    18161824
    1817 #: includes/admin/class-tools-page.php:591
     1825#: includes/admin/class-tools-page.php:593
    18181826msgid "Security check failed"
    18191827msgstr ""
    18201828
    1821 #: includes/admin/class-tools-page.php:595
     1829#: includes/admin/class-tools-page.php:597
    18221830msgid "You do not have sufficient permissions to access this page."
    18231831msgstr ""
    18241832
    1825 #: includes/admin/class-tools-page.php:626
     1833#: includes/admin/class-tools-page.php:628
    18261834msgid "Tables have been recreated successfully."
    18271835msgstr ""
     
    21362144msgstr ""
    21372145
    2138 #: includes/frontend/class-rest-api.php:177
    2139 #: includes/frontend/class-rest-api.php:256
     2146#: includes/frontend/class-rest-api.php:128
     2147msgid "Sorry, you are not allowed to view this context."
     2148msgstr ""
     2149
     2150#: includes/frontend/class-rest-api.php:187
     2151#: includes/frontend/class-rest-api.php:266
    21402152msgid "Invalid post ID."
    21412153msgstr ""
    21422154
    2143 #: includes/frontend/class-rest-api.php:294
     2155#: includes/frontend/class-rest-api.php:304
    21442156#: includes/frontend/blocks/build/popular-posts/index.js:1
    21452157#: includes/frontend/blocks/src/popular-posts/components/post-display-controls.js:8
     
    21472159msgstr ""
    21482160
    2149 #: includes/frontend/class-rest-api.php:299
     2161#: includes/frontend/class-rest-api.php:309
    21502162msgid "Post types"
    21512163msgstr ""
    21522164
    2153 #: includes/frontend/class-rest-api.php:317
    2154 #: includes/frontend/class-rest-api.php:351
     2165#: includes/frontend/class-rest-api.php:313
     2166msgid "Scope under which the request is made; determines fields present in response."
     2167msgstr ""
     2168
     2169#: includes/frontend/class-rest-api.php:333
     2170#: includes/frontend/class-rest-api.php:367
    21552171msgid "ID of the post."
    21562172msgstr ""
    21572173
    2158 #: includes/frontend/class-rest-api.php:322
     2174#: includes/frontend/class-rest-api.php:338
    21592175msgid "Blog ID of the post."
    21602176msgstr ""
    21612177
    2162 #: includes/frontend/class-rest-api.php:327
     2178#: includes/frontend/class-rest-api.php:343
    21632179msgid "Activate counter flag."
    21642180msgstr ""
    21652181
    2166 #: includes/frontend/class-rest-api.php:332
     2182#: includes/frontend/class-rest-api.php:348
    21672183msgid "Debug flag."
    21682184msgstr ""
    21692185
    2170 #: includes/frontend/class-rest-api.php:356
     2186#: includes/frontend/class-rest-api.php:372
    21712187msgid "Counter type."
    21722188msgstr ""
    21732189
    2174 #: includes/frontend/class-rest-api.php:361
     2190#: includes/frontend/class-rest-api.php:377
    21752191msgid "Blog ID."
    21762192msgstr ""
    21772193
    2178 #: includes/frontend/class-rest-api.php:366
     2194#: includes/frontend/class-rest-api.php:382
    21792195msgid "From date."
    21802196msgstr ""
    21812197
    2182 #: includes/frontend/class-rest-api.php:371
     2198#: includes/frontend/class-rest-api.php:387
    21832199msgid "To date."
    21842200msgstr ""
  • top-10/trunk/readme.txt

    r3461636 r3466359  
    33Contributors: webberzone, ajay
    44Donate link: https://wzn.io/donate-wz
    5 Stable tag: 4.2.0
     5Stable tag: 4.2.1
    66Requires at least: 6.6
    77Tested up to: 6.9
     
    156156== Changelog ==
    157157
     158= 4.2.1 =
     159
     160* Security:
     161    * Fixed REST API permission checks to prevent unauthorized exposure of post passwords in edit context.
     162
     163* Fixes:
     164    * Fixed a bug with the "Clear cache" button in the Tools page.
     165    * Fixed thumbnail location restrictions to properly support Grid thumbnails style in addition to Left thumbnails.
     166    * Improved JavaScript logic for style-based thumbnail location validation with better error handling and fallback mechanisms.
     167
    158168= 4.2.0 =
    159169
     
    191201== Upgrade Notice ==
    192202
    193 = 4.2.0 =
    194 Major update introducing a new settings wizard, a multisite network-wide dashboard, and multiple Pro enhancements.
     203= 4.2.1 =
     204Bugs squashed from the v4.2.0 release.
  • top-10/trunk/top-10.php

    r3461636 r3466359  
    1515 * Plugin URI:  https://webberzone.com/plugins/top-10/
    1616 * Description: Count daily and total visits per post and display the most popular posts based on the number of views
    17  * Version:     4.2.0
     17 * Version:     4.2.1
    1818 * Author:      WebberZone
    1919 * Author URI:  https://webberzone.com
     
    3737 */
    3838if ( ! defined( 'TOP_TEN_VERSION' ) ) {
    39     define( 'TOP_TEN_VERSION', '4.2.0' );
     39    define( 'TOP_TEN_VERSION', '4.2.1' );
    4040}
    4141
Note: See TracChangeset for help on using the changeset viewer.