• Resolved Baden

    (@baden03)


    Hello.
    In trouble shooting the compatibility of our two plugins, I found a few bugs that you might like to know about.

    1. file: simplepagetester.php
    function sptDetailsMeta()
    around line: 257
    you are simply echoing count($sptData[$sptData['master_id'] . '_visits']); with out first checking to see if it has been set.
    Before:

    echo '			</select> %
    				</td>
    			</tr>
    			<tr>
    				<th scope="row" colspan="1">Total Unique Visits:</th>
    				<td colspan="2">' . count($sptData[$sptData['master_id'] . '_visits']) . '</td>
    			</tr>';

    After:

    echo '</select> % </td></tr>
    	<tr><th scope="row" colspan="1">Total Unique Visits:</th><td colspan="2">';
    if( !empty($sptData[$sptData['master_id'] . '_visits']) ){
    		echo count($sptData[$sptData['master_id'] . '_visits']);
    }
    echo '</td></tr>';

    2. Same file, same issue around line 302:
    Before:

    <td colspan="2">' . count($sptData[$sptData['slave_id'] . '_visits']) .

    After:

    <td colspan="2">';
    if( !empty( $sptData[$sptData['slave_id'] . '_visits'] ) ){
    		echo count($sptData[$sptData['slave_id'] . '_visits']);
    }

    3. same file
    function: sptRecordVisit()
    around line 506
    session_start() is throwing an error because the session has already been started. either remove this or check before starting the session.

    //session_start();

    4. same file, same function, around line 531:
    Before:

    'ip' => getenv(REMOTE_ADDR)

    After:

    'ip' => getenv('REMOTE_ADDR')

    5. file: sptHelper.js
    function: sptDrawChart
    around lines 66 and 71
    not checking first to see if the variable has been set.
    Before:

    if (chart_data[0].length == 5)

    After:

    if (chart_data[0].length && chart_data[0].length == 5)

    https://wordpress.org/plugins/simple-page-tester/

Viewing 1 replies (of 1 total)
  • Plugin Author Josh Kohlbach

    (@jkohlbach)

    Hi Baden,

    Apologies for the delay in responding, the forums usually notify me of new posts but it’s been temperamental and I missed this.

    We’ll address these issues in an upcoming release, thanks for the contribution!

    Cheers,
    Josh

Viewing 1 replies (of 1 total)

The topic ‘Php and JavaScript Bugs Found’ is closed to new replies.