• Resolved The Choice

    (@ihaider)


    Hello there,

    We have just installed the latest version on one of our sites but it is not showing the full setting options, only Status and Strategies are showings under settings. Please advise. Thanks

    The page I need help with: [log in to see the link]

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Contributor Kamal Khan

    (@bhittani)

    Can you share a screenshot?

    Thread Starter The Choice

    (@ihaider)

    Plugin Contributor Kamal Khan

    (@bhittani)

    I am not able to reproduce this bug so i am not sure how to help.

    alduinwf

    (@alduinwf)

    I have the same problem. It comments an error:

    <!-- Manual Control -->
            <!-- <tr>
                <th scope="row" valign="top">
                    Manual Control            </th>
                <td>
                                        <p>
                            <label>
                                <input type="checkbox" name="kksr_manual_control[]" value="post"<br />
    <font size='1'><table class='xdebug-error xe-uncaught-exception' dir='ltr' border='1' cellspacing='0' cellpadding='1'>
    <tr><th align='left' bgcolor='#f57900' colspan="5"><span style='background-color: #cc0000; color: #fce94f; font-size: x-large;'>( ! )</span> Fatal error: Uncaught TypeError: in_array(): Argument #2 ($haystack) must be of type array, null given in {path}/wp-content/plugins/kk-star-ratings/src/core/views/admin/tabs/general.php on line <i>96</i></th></tr>
    <tr><th align='left' bgcolor='#f57900' colspan="5"><span style='background-color: #cc0000; color: #fce94f; font-size: x-large;'>( ! )</span> TypeError: in_array(): Argument #2 ($haystack) must be of type array, null given in {path}/wp-content/plugins/kk-star-ratings/src/core/views/admin/tabs/general.php on line <i>96</i></th></tr>
    <tr><th align='left' bgcolor='#e9b96e' colspan='5'>Call Stack</th></tr>
    <tr><th align='center' bgcolor='#eeeeec'>#</th><th align='left' bgcolor='#eeeeec'>Time</th><th align='left' bgcolor='#eeeeec'>Memory</th><th align='left' bgcolor='#eeeeec'>Function</th><th align='left' bgcolor='#eeeeec'>Location</th></tr>
    <tr><td bgcolor='#eeeeec' align='center'>1</td><td bgcolor='#eeeeec' align='center'>0.0002</td><td bgcolor='#eeeeec' align='right'>364800</td><td bgcolor='#eeeeec'>{main}(  )</td><td title='{path}/wp-admin/admin.php' bgcolor='#eeeeec'>.../admin.php<b>:</b>0</td></tr>
    <tr><td bgcolor='#eeeeec' align='center'>2</td><td bgcolor='#eeeeec' align='center'>0.1985</td><td bgcolor='#eeeeec' align='right'>18735232</td><td bgcolor='#eeeeec'>do_action( <span>$hook_name = </span><span>'toplevel_page_kk-star-ratings'</span> )</td><td title='{path}/wp-admin/admin.php' bgcolor='#eeeeec'>.../admin.php<b>:</b>259</td></tr>
    <tr><td bgcolor='#eeeeec' align='center'>3</td><td bgcolor='#eeeeec' align='center'>0.1985</td><td bgcolor='#eeeeec' align='right'>18735608</td><td bgcolor='#eeeeec'>WP_Hook->do_action( <span>$args = </span><span>[0 => '']</span> )</td><td title='{path}/wp-includes/plugin.php' bgcolor='#eeeeec'>.../plugin.php<b>:</b>470</td></tr>
    <tr><td bgcolor='#eeeeec' align='center'>4</td><td bgcolor='#eeeeec' align='center'>0.1985</td><td bgcolor='#eeeeec' align='right'>18735608</td><td bgcolor='#eeeeec'>WP_Hook->apply_filters( <span>$value = </span><span>''</span>, <span>$args = </span><span>[0 => '']</span> )</td><td title='{path}/wp-includes/class-wp-hook.php' bgcolor='#eeeeec'>.../class-wp-hook.php<b>:</b>327</td></tr>
    <tr><td bgcolor='#eeeeec' align='center'>5</td><td bgcolor='#eeeeec' align='center'>0.1985</td><td bgcolor='#eeeeec' align='right'>18736736</td><td bgcolor='#eeeeec'>Bhittani\StarRating\core\actions\admin\index( <span>''</span> )</td><td title='{path}/wp-includes/class-wp-hook.php' bgcolor='#eeeeec'>.../class-wp-hook.php<b>:</b>303</td></tr>
    <tr><td bgcolor='#eeeeec' align='center'>6</td><td bgcolor='#eeeeec' align='center'>0.1986</td><td bgcolor='#eeeeec' align='right'>18757296</td><td bgcolor='#eeeeec'>Bhittani\StarRating\core\functions\action( <span>$tag = </span><span>'admin/tabs/general'</span>, ...<span>$args = </span><i>variadic</i>(<span>NULL</span>, <span>'general'</span>) )</td><td title='{path}/wp-content/plugins/kk-star-ratings/src/core/actions/admin/index.php' bgcolor='#eeeeec'>.../index.php<b>:</b>80</td></tr>
    <tr><td bgcolor='#eeeeec' align='center'>7</td><td bgcolor='#eeeeec' align='center'>0.1986</td><td bgcolor='#eeeeec' align='right'>18757672</td><td bgcolor='#eeeeec'>Bhittani\StarRating\functions\action( <span>$namespace = </span><span>'Bhittani\\StarRating\\core\\actions'</span>, <span>$tag = </span><span>'admin/tabs/general'</span>, ...<span>$args = </span><i>variadic</i>(<span>NULL</span>, <span>'general'</span>) )</td><td title='{path}/wp-content/plugins/kk-star-ratings/src/core/functions/action.php' bgcolor='#eeeeec'>.../action.php<b>:</b>23</td></tr>
    <tr><td bgcolor='#eeeeec' align='center'>8</td><td bgcolor='#eeeeec' align='center'>0.1986</td><td bgcolor='#eeeeec' align='right'>18758128</td><td bgcolor='#eeeeec'>do_action( <span>$hook_name = </span><span>'Bhittani\\StarRating\\core\\actions\\admin\\tabs\\general'</span>, ...<span>$arg = </span><i>variadic</i>(<span>NULL</span>, <span>'general'</span>) )</td><td title='{path}/wp-content/plugins/kk-star-ratings/src/functions/action.php' bgcolor='#eeeeec'>.../action.php<b>:</b>28</td></tr>
    <tr><td bgcolor='#eeeeec' align='center'>9</td><td bgcolor='#eeeeec' align='center'>0.1986</td><td bgcolor='#eeeeec' align='right'>18758504</td><td bgcolor='#eeeeec'>WP_Hook->do_action( <span>$args = </span><span>[0 => NULL, 1 => 'general']</span> )</td><td title='{path}/wp-includes/plugin.php' bgcolor='#eeeeec'>.../plugin.php<b>:</b>470</td></tr>
    <tr><td bgcolor='#eeeeec' align='center'>10</td><td bgcolor='#eeeeec' align='center'>0.1986</td><td bgcolor='#eeeeec' align='right'>18758504</td><td bgcolor='#eeeeec'>WP_Hook->apply_filters( <span>$value = </span><span>''</span>, <span>$args = </span><span>[0 => NULL, 1 => 'general']</span> )</td><td title='{path}/wp-includes/class-wp-hook.php' bgcolor='#eeeeec'>.../class-wp-hook.php<b>:</b>327</td></tr>
    <tr><td bgcolor='#eeeeec' align='center'>11</td><td bgcolor='#eeeeec' align='center'>0.1986</td><td bgcolor='#eeeeec' align='right'>18759632</td><td bgcolor='#eeeeec'>Bhittani\StarRating\core\actions\admin\tabs\general( <span>$old = </span><span>NULL</span>, <span>$tab = </span><span>'general'</span> )</td><td title='{path}/wp-includes/class-wp-hook.php' bgcolor='#eeeeec'>.../class-wp-hook.php<b>:</b>303</td></tr>
    <tr><td bgcolor='#eeeeec' align='center'>12</td><td bgcolor='#eeeeec' align='center'>0.1987</td><td bgcolor='#eeeeec' align='right'>18761432</td><td bgcolor='#eeeeec'>Bhittani\StarRating\core\functions\view( <span>$path = </span><span>'admin/tabs/general.php'</span>, <span>$payload = </span><span>['old' => NULL, 'tab' => 'general', 'get' => class Closure { virtual $closure = &quot;Bhittani\StarRating\functions\{closure}&quot;, public $static = [...]; public $parameter = [...] }]</span> )</td><td title='{path}/wp-content/plugins/kk-star-ratings/src/core/actions/admin/tabs/general.php' bgcolor='#eeeeec'>.../general.php<b>:</b>26</td></tr>
    <tr><td bgcolor='#eeeeec' align='center'>13</td><td bgcolor='#eeeeec' align='center'>0.1987</td><td bgcolor='#eeeeec' align='right'>18761432</td><td bgcolor='#eeeeec'>Bhittani\StarRating\functions\view( <span>$__base = </span><span>'{path}/wp-content/plugins/kk-star-ratings/src/core/views/'</span>, <span>$__path = </span><span>'admin/tabs/general.php'</span>, <span>$__payload = </span><span>['old' => NULL, 'tab' => 'general', 'get' => class Closure { virtual $closure = &quot;Bhittani\StarRating\functions\{closure}&quot;, public $static = [...]; public $parameter = [...] }]</span> )</td><td title='{path}/wp-content/plugins/kk-star-ratings/src/core/functions/view.php' bgcolor='#eeeeec'>.../view.php<b>:</b>24</td></tr>
    <tr><td bgcolor='#eeeeec' align='center'>14</td><td bgcolor='#eeeeec' align='center'>0.1988</td><td bgcolor='#eeeeec' align='right'>18780000</td><td bgcolor='#eeeeec'>require( <font color='#00bb00'>'{path}/wp-content/plugins/kk-star-ratings/src/core/views/admin/tabs/general.php</font> )</td><td title='{path}/wp-content/plugins/kk-star-ratings/src/functions/view.php' bgcolor='#eeeeec'>.../view.php<b>:</b>64</td></tr>
    <tr><td bgcolor='#eeeeec' align='center'>15</td><td bgcolor='#eeeeec' align='center'>0.2001</td><td bgcolor='#eeeeec' align='right'>18815152</td><td bgcolor='#eeeeec'><a href='https://www.php.net/function.in-array' target='_new'>in_array</a>( <span>$needle = </span><span>'post'</span>, <span>$haystack = </span><span>NULL</span> )</td><td title='{path}/wp-content/plugins/kk-star-ratings/src/core/views/admin/tabs/general.php' bgcolor='#eeeeec'>.../general.php<b>:</b>96</td></tr>
    </table></font>

    Looks like the problem lies within the html-commented code in kk-star-ratings/src/core/views/admin/tabs/general.php, lines 88-105

    You should PHP-comment this to prevent this sort of errors.

    Find:

    <!-- <tr>
                <th scope="row" valign="top">
                    <?php echo esc_html_x('Manual Control', 'Label', 'kk-star-ratings'); ?>
                </th>
                <td>
                    <?php foreach ($postTypes as $type => $label) { ?>
                        <p>
                            <label>
                                <input type="checkbox" name="<?php echo esc_attr($manualControl[0]); ?>[]" value="<?php echo esc_attr($type); ?>"<?php echo (in_array($type, $manualControl[1])) ? ' checked="checked"' : ''; ?>>
                                <?php echo esc_html($label); ?>
                            </label>
                        </p>
                    <?php } ?>
                    <p class="description" style="max-width: 22rem; margin-top: .75rem;">
                        <?php echo sprintf(esc_html__('Select the post types that should not auto embed the markup and will be manually controlled by the theme. E.g. Using %s in your theme/template file(s).', 'kk-star-ratings'), '<code>echo kk_star_ratings();</code>'); ?>
                    </p>
                </td>
            </tr> -->

    Replace with:

    <?php /* <tr>
                <th scope="row" valign="top">
                    <?php echo esc_html_x('Manual Control', 'Label', 'kk-star-ratings'); ?>
                </th>
                <td>
                    <?php foreach ($postTypes as $type => $label) { ?>
                        <p>
                            <label>
                                <input type="checkbox" name="<?php echo esc_attr($manualControl[0]); ?>[]" value="<?php echo esc_attr($type); ?>"<?php echo (in_array($type, $manualControl[1])) ? ' checked="checked"' : ''; ?>>
                                <?php echo esc_html($label); ?>
                            </label>
                        </p>
                    <?php } ?>
                    <p class="description" style="max-width: 22rem; margin-top: .75rem;">
                        <?php echo sprintf(esc_html__('Select the post types that should not auto embed the markup and will be manually controlled by the theme. E.g. Using %s in your theme/template file(s).', 'kk-star-ratings'), '<code>echo kk_star_ratings();</code>'); ?>
                    </p>
                </td>
            </tr>*/ ?>
    Plugin Contributor Kamal Khan

    (@bhittani)

    Fixed in 5.2.4

    Thread Starter The Choice

    (@ihaider)

    Thanks Kamal,

    I have installed the YASR for now. When I get a chance, I will re-install KK Star again and test it with my site.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘KK Star Setting Options’ is closed to new replies.