This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script src="https://cdn.jsdelivr.net/npm/axios/dist/axios.min.js"></script> | |
<div class="center page_1"> | |
<form class="center siteschecker-form" id="siteschecker-form"> | |
<div class="form-field"> | |
<label for="businessname">Business Name: </label> <br /> | |
<input class="inputset" type="text" name="business-name" id="business-name" placeholder="SitesNStores"> | |
</div> | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"captchaResult": "CAPTCHA_NOT_NEEDED", | |
"kind": "pagespeedonline#result", | |
"id": "https://developers.google.com/", | |
"loadingExperience": { | |
"id": "https://developers.google.com/", | |
"metrics": { | |
"FIRST_CONTENTFUL_PAINT_MS": { | |
"percentile": 3482, | |
"distributions": [ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pages:[ | |
{src:"https://digitalpapertest.s3-ap-southeast-1.amazonaws.com/ph-revised-optimized/optimized/1.jpg", thumb:"https://digitalpapertest.s3-ap-southeast-1.amazonaws.com/ph-revised-optimized/thumbs/Thumb-1.jpg", title:"1.jpg"}, | |
{src:"https://digitalpapertest.s3-ap-southeast-1.amazonaws.com/ph-revised-optimized/optimized/2.jpg", thumb:"https://digitalpapertest.s3-ap-southeast-1.amazonaws.com/ph-revised-optimized/thumbs/Thumb-2.jpg", title:"2.jpg"}, | |
{src:"https://digitalpapertest.s3-ap-southeast-1.amazonaws.com/ph-revised-optimized/optimized/3.jpg", thumb:"https://digitalpapertest.s3-ap-southeast-1.amazonaws.com/ph-revised-optimized/thumbs/Thumb-3.jpg", title:"3.jpg"}, | |
{src:"https://digitalpapertest.s3-ap-southeast-1.amazonaws.com/ph-revised-optimized/optimized/4.jpg", thumb:"https://digitalpapertest.s3-ap-southeast-1.amazonaws.com/ph-revised-optimized/thumbs/Thumb-4.jpg", title:"4.jpg"}, | |
{src:" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def score | |
pass = 0 | |
pass_or_fail = 0 | |
results.each do |result| | |
if result.status == "1" || result.status == "0" | |
pass_or_fail += 1 | |
pass += 1 if result.status == "1" | |
end | |
end | |
score = ((pass.to_f * 5) / pass_or_fail.to_f).to_f |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def result_description(key_name) | |
descriptions = { | |
:report_google_adwords_campaign => "We checked to see if you have any Google Adwords campaigns | |
running and if you would benefit from running a campaign. | |
AdWords campaigns are an effective way to reach customers | |
when they're looking for your products or services.", | |
:report_google_organic_campaign => "We crawled your site to test for best practice on-page | |
optimisation factors required to help it rank better. It's | |
important to have your on-page optimisation in order to help |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def explanation_score(score) | |
if score <= 2 | |
"We have a bad and a good news. The bad news is that your website is not doing things properly in terms of marketing at all, you lack many improvements. The good news is that we can help you to fix that. It's actually that simple, just click the green button and you will find it out." | |
elsif score <= 4 | |
"Excellent! So you know something about web marketing after all, you are doing many stuff the right way, however you can do it better than that! Just give us the chance to lend you a hand and improve your score together. Click the green button to start enhancing your website." | |
else | |
"Your website is pretty good in terms of marketing, you have implemented most of the tools that bring visitors to your page. However, no one is perfect and we can always learn new things and get more visitors. Believe us, we are very good on what we do. Contact us and we will prove it to you!" | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This is a blank test case that should fail everything |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def result_description(key_name) | |
descriptions = { | |
:report_google_adwords_campaign => "We checked to see if you have any Google Adwords campaigns | |
running and if you would benefit from running a campaign. | |
AdWords campaigns are an effective way to reach customers | |
when they're looking for your products or services.", | |
:report_google_organic_campaign => "We crawled your site to test for best practice on-page | |
optimisation factors required to help it rank better. It's | |
important to have your on-page optimisation in order to help |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Im not able to show some of the most important things ive written for my last customizer project | |
// as im bound by an NDA, but here i can present some simple things in the utilities libraries | |
// that ive devised and used that helped | |
// the architecture of the projects ive created much cleaner | |
// This is a very simple js idiom i developed early in the development | |
// of the customizer, it basically just uses the jquery rest call function | |
ub.loader = function (url, object_name, cb) { | |
NewerOlder