Skip to content

Commit

Permalink
4.5.0 - changes google pagespeed changes
Browse files Browse the repository at this point in the history
  • Loading branch information
sendtogeo committed Jun 29, 2020
1 parent 8458da9 commit f456afc
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 100 deletions.
6 changes: 2 additions & 4 deletions controllers/pagespeed.ctrl.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ class PageSpeedController extends Controller{
var $colList = array(
'desktop_speed_score' => 'desktop_speed_score',
'mobile_speed_score' => 'mobile_speed_score',
'mobile_usability_score' => 'mobile_usability_score',
);

// function to get moz rank
Expand Down Expand Up @@ -319,8 +318,7 @@ function __getWebsitePageSpeedReport($websiteId, $fromTime, $toTime) {
}

# func to show graphical reports
function showGraphicalReports($searchInfo = '') {

function showGraphicalReports($searchInfo = '') {
$userId = isLoggedIn();
$fromTime = !empty($searchInfo['from_time']) ? $searchInfo['from_time'] : date('Y-m-d', strtotime('-30 days'));
$toTime = !empty ($searchInfo['to_time']) ? $searchInfo['to_time'] : date("Y-m-d");
Expand All @@ -342,7 +340,7 @@ function showGraphicalReports($searchInfo = '') {
$colList = $this->colList;
if (!empty($reportList)) {

$colLableList = array($this->spTextPS['Desktop Speed'], $this->spTextPS['Mobile Speed'], $this->spTextPS['Mobile Usability']);
$colLableList = array($this->spTextPS['Desktop Speed'], $this->spTextPS['Mobile Speed']);
$dataArr = "['Date', '" . implode("', '", $colLableList) . "']";

// loop through data list
Expand Down
11 changes: 4 additions & 7 deletions controllers/report.ctrl.php
Original file line number Diff line number Diff line change
Expand Up @@ -608,8 +608,8 @@ function generateReports( $searchInfo='' ) {
if(empty($this->seFound)){
echo "<p class='note notefailed'>".$_SESSION['text']['common']['Keyword']." <b>{$keywordInfo['name']}</b> ".$this->spTextKeyword['not assigned to required search engines']."........</p>";
}
sleep(SP_CRAWL_DELAY);
}
sleep(SP_CRAWL_DELAY);
}
}

# function to format pagecontent
Expand Down Expand Up @@ -816,7 +816,7 @@ function crawlKeyword( $keywordInfo, $seId='', $cron=false, $removeDuplicate=tru

}

return $crawlResult;
return $crawlResult;
}

# func to save the report
Expand Down Expand Up @@ -1193,7 +1193,6 @@ function showOverallReportSummary($searchInfo='', $cronUserId=false) {
$report = $report[0];
$listInfo['desktop_speed_score'] = empty($report['desktop_speed_score']) ? "-" : $report['desktop_speed_score']." ".$report['rank_diff_desktop_speed_score'];
$listInfo['mobile_speed_score'] = empty($report['mobile_speed_score']) ? "-" : $report['mobile_speed_score']." ".$report['rank_diff_mobile_speed_score'];
$listInfo['mobile_usability_score'] = empty($report['mobile_usability_score']) ? "-" : $report['mobile_usability_score']." ".$report['rank_diff_mobile_usability_score'];

$listInfo['dirsub']['total'] = $dirCtrler->__getTotalSubmitInfo($listInfo['id']);
$listInfo['dirsub']['active'] = $dirCtrler->__getTotalSubmitInfo($listInfo['id'], true);
Expand Down Expand Up @@ -1227,7 +1226,6 @@ function showOverallReportSummary($searchInfo='', $cronUserId=false) {
'Bing '.$spTextHome['Indexed'],
$spTextPS['Desktop Speed'],
$spTextPS['Mobile Speed'],
$spTextPS['Mobile Usability'],
$_SESSION['text']['common']['Total'].' Submission',
$_SESSION['text']['common']['Active'].' Submission',
);
Expand All @@ -1247,7 +1245,6 @@ function showOverallReportSummary($searchInfo='', $cronUserId=false) {
strip_tags($websiteInfo['msn']['indexed']),
strip_tags($websiteInfo['desktop_speed_score']),
strip_tags($websiteInfo['mobile_speed_score']),
strip_tags($websiteInfo['mobile_usability_score']),
$websiteInfo['dirsub']['total'],
$websiteInfo['dirsub']['active'],
);
Expand Down Expand Up @@ -1399,7 +1396,7 @@ function updateUserReportSetting($userId, $col, $val) {
function updateUserReportGenerationLogs($userId, $generateDate) {
$dataList = array(
'user_id|int' => $userId,
'report_date' => $generateDate,
'report_date' => $generateDate,
);

$this->dbHelper->insertRow("user_report_logs", $dataList);
Expand Down
47 changes: 13 additions & 34 deletions themes/classic/views/pagespeed/findpagespeedinfo.ctp.php
Original file line number Diff line number Diff line change
@@ -1,52 +1,31 @@
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="list">
<table width="100%" class="list">
<tr class="listHead">
<td class="left"><?php echo $spText['common']['Url']?></td>
<td><?php echo $spText['common']['Url']?></td>
<td><?php echo $spTextPS['Desktop Speed']?></td>
<td><?php echo $spTextPS['Mobile Speed']?></td>
<td><?php echo $spTextPS['Mobile Usability']?></td>
<td class="right"><?php echo $spText['common']['Details']?></td>
<td><?php echo $spText['common']['Details']?></td>
</tr>
<?php
$colCount = 5;
$colCount = 4;
if(count($list) > 0){
$catCount = count($list);
$i = 0;
foreach($list as $url){

$class = ($i % 2) ? "blue_row" : "white_row";
if($catCount == ($i + 1)){
$leftBotClass = "tab_left_bot";
$rightBotClass = "tab_right_bot";
}else{
$leftBotClass = "td_left_border td_br_right";
$rightBotClass = "td_br_right";
}
$tdWidth = "25%";
foreach($list as $url) {
$debugVar = !empty($_POST['debug']) ? "&debug=1" : "";
$debugVar .= !empty($_POST['debug_format']) ? "&debug_format=" . $_POST['debug_format'] : "" ;
?>
<tr class="<?php echo $class?>">
<td class="<?php echo $leftBotClass?>" style="text-align:left;padding-left:10px;"><?php echo $url?></td>
<td class="td_br_right"><?php echo $reportList[$url]['desktop']['speed_score'] ? $reportList[$url]['desktop']['speed_score'] : 0;?> / 100</td>
<td class="td_br_right"><?php echo $reportList[$url]['mobile']['speed_score'] ? $reportList[$url]['mobile']['speed_score'] : 0;?> / 100</td>
<td class="td_br_right"><?php echo $reportList[$url]['mobile']['usability_score'] ? $reportList[$url]['mobile']['usability_score'] : 0;?> / 100</td>
<td class="<?php echo $rightBotClass?>">
<a href="https://developers.google.com/speed/pagespeed/insights/?url=<?php echo $url; ?>" target="_blank"><?php echo $spText['common']['Details']?> >></a>
<!--<a href="javascript:void(0);" onclick="scriptDoLoadDialog('index.php', 'tmp', 'sec=showdiv&div_id=details_id<?php echo $i?>', 1000, 800)"><?php echo $spText['common']['Details']?> >></a>
<div id="details_id<?php echo $i?>" style="display: none;">
<?php include(SP_VIEWPATH."/pagespeed/pagespeeddetails.ctp.php");?>
</div> --?>
<tr>
<td style="text-align:left;padding-left:10px;"><?php echo $url?></td>
<td><?php echo $reportList[$url]['desktop']['speed_score'] ? $reportList[$url]['desktop']['speed_score'] : 0;?> / 100</td>
<td><?php echo $reportList[$url]['mobile']['speed_score'] ? $reportList[$url]['mobile']['speed_score'] : 0;?> / 100</td>
<td>
<a href="https://developers.google.com/speed/pagespeed/insights/?url=<?php echo $url; ?>" target="_blank">
<?php echo $spText['common']['Details']?> &gt;&gt;
</a>
</td>
</tr>
<?php
$i++;
}
}else{
echo showNoRecordsList($colCount-2);
}
?>
<tr class="listBot">
<td class="left" colspan="<?php echo ($colCount-1)?>"></td>
<td class="right"></td>
</tr>
</table>
70 changes: 19 additions & 51 deletions themes/classic/views/pagespeed/pagespeedreport.ctp.php
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
<?php echo showSectionHead($spTextTools['PageSpeed Reports']); ?>
<?php
echo showSectionHead($spTextTools['PageSpeed Reports']);
$webUrl = "";
?>
<form id='search_form'>
<table width="100%" class="search">
<tr>
<th><?php echo $spText['common']['Website']?>: </th>
<td>
<select name="website_id" id="website_id" style='width:190px;' onchange="scriptDoLoadPost('pagespeed.php', 'search_form', 'content', '&sec=reports')">
<?php foreach($websiteList as $websiteInfo){?>
<?php if($websiteInfo['id'] == $websiteId){?>
<?php
if($websiteInfo['id'] == $websiteId){
$webUrl = $websiteInfo['url'];
?>
<option value="<?php echo $websiteInfo['id']?>" selected><?php echo $websiteInfo['name']?></option>
<?php }else{?>
<option value="<?php echo $websiteInfo['id']?>"><?php echo $websiteInfo['name']?></option>
Expand Down Expand Up @@ -41,69 +47,31 @@
<div id='subcontent'>
<table width="100%" class="list">
<tr class="listHead">
<td class="left"><?php echo $spText['common']['Date']?></td>
<td><?php echo $spText['common']['Date']?></td>
<td><?php echo $spTextPS['Desktop Speed']?></td>
<td><?php echo $spTextPS['Mobile Speed']?></td>
<td class="right"><?php echo $spTextPS['Mobile Usability']?></td>
<td><?php echo $spText['common']['Details']?></td>
</tr>
<?php
$colCount = 4;
if(count($list) > 0){
$catCount = count($list);
$i = 0;
foreach($list as $listInfo){

$class = ($i % 2) ? "blue_row" : "white_row";
if($catCount == ($i + 1)){
$leftBotClass = "tab_left_bot";
$rightBotClass = "tab_right_bot";
}else{
$leftBotClass = "td_left_border td_br_right";
$rightBotClass = "td_br_right";
}
foreach($list as $listInfo){
?>
<tr class="<?php echo $class?>">
<td class="<?php echo $leftBotClass?>"><?php echo $listInfo['result_date']; ?></td>
<td class='td_br_right' style='text-align:left;padding-left:40px;'><a><?php echo $listInfo['desktop_speed_score'].'</a> '. $listInfo['rank_diff_desktop_speed_score']?></td>
<td class='td_br_right' style='text-align:left;padding-left:40px;'><a><?php echo $listInfo['mobile_speed_score'].'</a> '. $listInfo['rank_diff_mobile_speed_score']?></td>
<td class='<?php echo $rightBotClass?>' style='text-align:left;padding-left:40px;'>
<a><?php echo $listInfo['mobile_usability_score'].'</a> '. $listInfo['rank_diff_mobile_usability_score']?>
<?php
if ($i == 0) {

// if loaded through popup
if ($fromPopUp) {
$detailsLink = "scriptDoLoad('index.php', 'popup_tmp', 'sec=showdiv&div_id=details_id')";
} else {
$detailsLink = "scriptDoLoadDialog('index.php', 'tmp', 'sec=showdiv&div_id=details_id', 1000, 800)";
}
?>
&nbsp;&nbsp;
<a href="javascript:void(0);" onclick="<?php echo $detailsLink;?>"><?php echo $spText['common']['Details']?> >></a>
<div id="details_id" style="display: none;">
<?php
$url = "http://website:com";
$reportList[$url]['desktop']['details'] = unserialize($detailsInfo['desktop_score_details']);
$reportList[$url]['desktop']['speed_score'] = $listInfo['desktop_speed_score'];
$reportList[$url]['mobile']['details'] = unserialize($detailsInfo['mobile_score_details']);
$reportList[$url]['mobile']['speed_score'] = $listInfo['mobile_speed_score'];
$reportList[$url]['mobile']['usability_score'] = $listInfo['mobile_usability_score'];
include(SP_VIEWPATH."/pagespeed/pagespeeddetails.ctp.php");
?>
</div>
<?php }?>
<tr>
<td><?php echo $listInfo['result_date']; ?></td>
<td><a><?php echo $listInfo['desktop_speed_score'].'</a> '. $listInfo['rank_diff_desktop_speed_score']?></td>
<td><a><?php echo $listInfo['mobile_speed_score'].'</a> '. $listInfo['rank_diff_mobile_speed_score']?></td>
<td>
<a href="https://developers.google.com/speed/pagespeed/insights/?url=<?php echo $webUrl; ?>" target="_blank">
<?php echo $spText['common']['Details']?> &gt;&gt;
</a>
</td>
</tr>
<?php
$i++;
}
}else{
echo showNoRecordsList($colCount-2);
}
?>
<tr class="listBot">
<td class="left" colspan="<?php echo ($colCount-1)?>"></td>
<td class="right"></td>
</tr>
</table>
</div>
5 changes: 1 addition & 4 deletions themes/classic/views/report/archive.ctp.php
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@
<?php
if (!empty($websiteStats)) {
echo showSectionHead($spTextHome['Website Statistics']);
$colSpan = 15;
$colSpan = 14;
if (empty($pdfVersion)) echo $websitePagingDiv;
?>
<table id="cust_tab">
Expand All @@ -246,7 +246,6 @@
<th>Bing</th>
<th><?php echo $spTextPS['Desktop Speed']?></th>
<th><?php echo $spTextPS['Mobile Speed']?></th>
<th><?php echo $spTextPS['Mobile Usability']?></th>
<th><?php echo $spText['common']['Total']?></th>
<th><?php echo $spText['common']['Active']?></th>
</tr>
Expand All @@ -269,7 +268,6 @@
$activeDirLink = scriptAJAXLinkHrefDialog('directories.php', 'content', "sec=reports&active=approved&&website_id=".$websiteInfo['id'] . $timeArg, $websiteInfo['dirsub']['active']);
$desktopPageSpeedLink = scriptAJAXLinkHrefDialog('pagespeed.php', 'content', "sec=reports&website_id=".$websiteInfo['id'] . $timeArg, $websiteInfo['desktop_speed_score']);
$mobilePageSpeedLink = scriptAJAXLinkHrefDialog('pagespeed.php', 'content', "sec=reports&website_id=".$websiteInfo['id'] . $timeArg, $websiteInfo['mobile_speed_score']);
$mobileUsabilityLink = scriptAJAXLinkHrefDialog('pagespeed.php', 'content', "sec=reports&website_id=".$websiteInfo['id'] . $timeArg, $websiteInfo['mobile_usability_score']);
?>
<tr>
<td>
Expand All @@ -286,7 +284,6 @@
<td><?php echo $bingIndexLInk; ?></td>
<td><?php echo $desktopPageSpeedLink; ?></td>
<td><?php echo $mobilePageSpeedLink; ?></td>
<td><?php echo $mobileUsabilityLink; ?></td>
<td><?php echo $totaldirLink?></td>
<td><?php echo $activeDirLink?></td>
</tr>
Expand Down

0 comments on commit f456afc

Please sign in to comment.