Plugin Directory

Changeset 3595021


Ignore:
Timestamp:
07/03/2026 09:04:26 AM (4 months ago)
Author:
rostwirt
Message:

Release 1.0.3

Location:
wirt-star-rating
Files:
67 added
6 edited

Legend:

Unmodified
Added
Removed
  • wirt-star-rating/trunk/Classes/HTMLGenerators/Rating_Generator.php

    r3586812 r3595021  
    104104                $wirt_ldjson_cpt        = $options['wirt_ldjson_cpt'] ?? '';
    105105                $item_type              = $options['wirt_rating_item_type'] ?? '';
    106                 $wirt_rating_schema_add = $options['wirt_rating_schema_add'];
     106                $wirt_rating_schema_add = $options['wirt_rating_schema_add'] ?? false;
    107107
    108                 if ( ! $wirt_rating_schema_add && ! $wirt_ldjson_cpt ) {
     108                if ( ! $wirt_rating_schema_add || ! $wirt_ldjson_cpt ) {
    109109                        return $html;
    110110                }
    … …  
    113113                        $name = get_the_title( $context['id'] );
    114114                        $url  = get_permalink( $context['id'] );
     115                }
     116
     117                if ( ! $name || ! $url ) {
     118                        return $html;
     119                }
     120
     121                if( $votes < 1 ){
     122                        return $html;
    115123                }
    116124
  • wirt-star-rating/trunk/Classes/Options/Global_Settings.php

    r3586812 r3595021  
    282282
    283283                <input type="checkbox"
     284                        id="wirt_schema_toggle"
    284285                                name="wirt_star_rating_settings[wirt_rating_schema_add]"
    285286                                value="1"
    … …  
    297298                $value      = $this->global_settings['wirt_ldjson_cpt'] ?? '';
    298299                $post_types = get_post_types( array( 'public' => true ), 'objects' );
    299                 ?>
    300 
    301                 <select name="wirt_star_rating_settings[wirt_ldjson_cpt]">
    302                 <option value=""><?php esc_html_e( 'Select a post type', 'wirt-star-rating' ); ?></option>
     300                $enabled = !empty($this->global_settings['wirt_rating_schema_add']);
     301                ?>
     302
     303                <select <?php disabled(!$enabled); ?>
     304                                        id="wirt_ldjson_cpt"
     305                                        name="wirt_star_rating_settings[wirt_ldjson_cpt]">
     306
     307                        <option value=""><?php esc_html_e( 'Select a post type', 'wirt-star-rating' ); ?></option>
    303308
    304309                <?php foreach ( $post_types as $post_type ) : ?>
  • wirt-star-rating/trunk/assets/dist/wirt_main.js

    r3511648 r3595021  
    1 (()=>{"use strict";document.addEventListener("DOMContentLoaded",function(){var t=document.getElementById("wirt_rating_votes"),e=document.getElementById("wirt_rating_sum"),r=document.getElementById("wirt_rating_avg");function n(){var n=parseInt(t.value)||0,a=parseFloat(e.value)||0,i=0;n<0&&(n=0),a<0&&(a=0),a>5*n&&(a=5*n),t.value=n,e.value=a,n>0&&(i=n?(a/n).toFixed(2):"0.00"),r.textContent=i}t&&e&&r&&(t.addEventListener("input",n),e.addEventListener("input",n),n())}),document.addEventListener("DOMContentLoaded",function(){var t=document.querySelector(".wirt-star-rating-settings-demo");if(t){var e=document.querySelector('[name="wirt_star_rating_settings[wirt_rating_text_color]"]'),r=document.querySelector('[name="wirt_star_rating_settings[wirt_empty_star_color]"]'),n=document.querySelector('[name="wirt_star_rating_settings[wirt_filled_star_color]"]');null==e||e.addEventListener("input",function(e){t.style.setProperty("--wirt-text-color",e.target.value)}),null==r||r.addEventListener("input",function(e){t.style.setProperty("--wirt-star-empty-color",e.target.value)}),null==n||n.addEventListener("input",function(e){t.style.setProperty("--wirt-star-filled-color",e.target.value)});var a=document.querySelector('[name="wirt_star_rating_settings[wirt_rating_text_font_size]"]');null==a||a.addEventListener("input",function(e){t.style.setProperty("--wirt-font-size",e.target.value+"px")});var i=document.querySelector('[name="wirt_star_rating_settings[wirt_rating_star_size]"]');null==i||i.addEventListener("input",function(e){t.style.setProperty("--wirt-star-size",e.target.value+"px")});var s=document.querySelector('[name="wirt_star_rating_settings[wirt_rating_star_spacing]"]');null==s||s.addEventListener("input",function(e){t.style.setProperty("--wirt-star-spacing",e.target.value+"px")});var o=document.querySelector('[name="wirt_star_rating_settings[wirt_rating_star_rating_top_spacing]"]');null==o||o.addEventListener("input",function(e){t.style.setProperty("--wirt-rating-top-spacing",e.target.value+"px")});var l=document.querySelector('[name="wirt_star_rating_settings[wirt_rating_star_rating_bottom_spacing]"]');null==l||l.addEventListener("input",function(e){t.style.setProperty("--wirt-rating-bottom-spacing",e.target.value+"px")});var u=document.querySelector('[name="wirt_star_rating_settings[wirt_rating_star_feedback_top_spacing]"]');null==u||u.addEventListener("input",function(e){t.style.setProperty("--wirt-feedback-top-spacing",e.target.value+"px")});var _=document.querySelector('[name="wirt_star_rating_settings[wirt_rating_star_feedback_bottom_spacing]"]');null==_||_.addEventListener("input",function(e){t.style.setProperty("--wirt-feedback-bottom-spacing",e.target.value+"px")});var c=document.querySelectorAll('[name="wirt_star_rating_settings[wirt_rating_location]"]'),g=function(e){var r=t.querySelector(".wirt-rating-location-before"),n=t.querySelector(".wirt-rating-location-after");"before"===e?(r.style.display="block",n.style.display="none"):(r.style.display="none",n.style.display="block")},d=document.querySelector('[name="wirt_star_rating_settings[wirt_rating_location]"]:checked');d&&g(d.value),c.forEach(function(t){t.addEventListener("change",function(t){g(t.target.value)})})}})})();
     1(()=>{"use strict";document.addEventListener("DOMContentLoaded",function(){var t=document.getElementById("wirt_rating_votes"),e=document.getElementById("wirt_rating_sum"),r=document.getElementById("wirt_rating_avg");function n(){var n=parseInt(t.value)||0,i=parseFloat(e.value)||0,a=0;n<0&&(n=0),i<0&&(i=0),i>5*n&&(i=5*n),t.value=n,e.value=i,n>0&&(a=n?(i/n).toFixed(2):"0.00"),r.textContent=a}t&&e&&r&&(t.addEventListener("input",n),e.addEventListener("input",n),n())}),document.addEventListener("DOMContentLoaded",function(){var t=document.querySelector(".wirt-star-rating-settings-demo");if(t){var e=document.getElementById("wirt_schema_toggle"),r=document.getElementById("wirt_ldjson_cpt");if(e&&r){e.addEventListener("change",v),v();var n=document.querySelector('[name="wirt_star_rating_settings[wirt_rating_text_color]"]'),i=document.querySelector('[name="wirt_star_rating_settings[wirt_empty_star_color]"]'),a=document.querySelector('[name="wirt_star_rating_settings[wirt_filled_star_color]"]');null==n||n.addEventListener("input",function(e){t.style.setProperty("--wirt-text-color",e.target.value)}),null==i||i.addEventListener("input",function(e){t.style.setProperty("--wirt-star-empty-color",e.target.value)}),null==a||a.addEventListener("input",function(e){t.style.setProperty("--wirt-star-filled-color",e.target.value)});var s=document.querySelector('[name="wirt_star_rating_settings[wirt_rating_text_font_size]"]');null==s||s.addEventListener("input",function(e){t.style.setProperty("--wirt-font-size",e.target.value+"px")});var o=document.querySelector('[name="wirt_star_rating_settings[wirt_rating_star_size]"]');null==o||o.addEventListener("input",function(e){t.style.setProperty("--wirt-star-size",e.target.value+"px")});var l=document.querySelector('[name="wirt_star_rating_settings[wirt_rating_star_spacing]"]');null==l||l.addEventListener("input",function(e){t.style.setProperty("--wirt-star-spacing",e.target.value+"px")});var u=document.querySelector('[name="wirt_star_rating_settings[wirt_rating_star_rating_top_spacing]"]');null==u||u.addEventListener("input",function(e){t.style.setProperty("--wirt-rating-top-spacing",e.target.value+"px")});var _=document.querySelector('[name="wirt_star_rating_settings[wirt_rating_star_rating_bottom_spacing]"]');null==_||_.addEventListener("input",function(e){t.style.setProperty("--wirt-rating-bottom-spacing",e.target.value+"px")});var c=document.querySelector('[name="wirt_star_rating_settings[wirt_rating_star_feedback_top_spacing]"]');null==c||c.addEventListener("input",function(e){t.style.setProperty("--wirt-feedback-top-spacing",e.target.value+"px")});var d=document.querySelector('[name="wirt_star_rating_settings[wirt_rating_star_feedback_bottom_spacing]"]');null==d||d.addEventListener("input",function(e){t.style.setProperty("--wirt-feedback-bottom-spacing",e.target.value+"px")});var g=document.querySelectorAll('[name="wirt_star_rating_settings[wirt_rating_location]"]'),p=function(e){var r=t.querySelector(".wirt-rating-location-before"),n=t.querySelector(".wirt-rating-location-after");"before"===e?(r.style.display="block",n.style.display="none"):(r.style.display="none",n.style.display="block")},y=document.querySelector('[name="wirt_star_rating_settings[wirt_rating_location]"]:checked');y&&p(y.value),g.forEach(function(t){t.addEventListener("change",function(t){p(t.target.value)})})}}function v(){r.disabled=!e.checked}})})();
  • wirt-star-rating/trunk/assets/src/js/adminSettings.js

    r3511648 r3595021  
    44                const demo = document.querySelector('.wirt-star-rating-settings-demo');
    55                if (!demo) return;
     6
     7                /* ---------- LDjson settings ---------*/
     8
     9                const checkbox = document.getElementById('wirt_schema_toggle');
     10                const select = document.getElementById('wirt_ldjson_cpt');
     11
     12                if (!checkbox || !select) return;
     13
     14                function toggle() {
     15                        select.disabled = !checkbox.checked;
     16                }
     17
     18                checkbox.addEventListener('change', toggle);
     19                toggle();
    620
    721                /* ---------- COLORS ---------- */
  • wirt-star-rating/trunk/readme.txt

    r3586812 r3595021  
    55Tested up to: 7.0
    66Requires PHP: 8.0
    7 Stable tag: 1.0.2
     7Stable tag: 1.0.3
    88License: GPLv2 or later
    99License URI: https://www.gnu.org/licenses/gpl-2.0.html
    … …  
    7373== Changelog ==
    7474
    75 = 1.0.0 =
    76 * Initial release.
     75= 1.0.3 =
     76- Improved validation and safety checks for LDJSON structured data output.
     77- Added conditional UI behavior for schema settings fields.
    7778
    7879= 1.0.2 =
    7980* Added filter `wirt_star_rating_feedback_text` to customize call-to-action text
    8081
     82= 1.0.0 =
     83* Initial release.
     84
    8185== Upgrade Notice ==
     86
     87= 1.0.3 =
     88- Improved validation and safety checks for LDJSON structured data output.
     89- Added dependency-based UI behavior for schema settings fields.
    8290
    8391= 1.0.2 =
  • wirt-star-rating/trunk/wirt-star-rating.php

    r3586812 r3595021  
    44 * Plugin URI: https://wirtstudio.com/wirt-star-rating-plugin/
    55 * Description: A simple star rating plugin for WordPress posts, pages, or custom post types.
    6  * Version: 1.0.2
     6 * Version: 1.0.3
    77 * Author: Wirt Studio
    88 * Author URI: https://wirtstudio.com
Note: See TracChangeset for help on using the changeset viewer.