• Resolved cecilette

    (@cecilette)


    Hi,

    When I try to save the certificate, it creates an html file with the home page contents instead of the certificate.

    I tried switching to 2017 and disabling all plugins but Lifter and the issue still occurs.

    Any ideas?

    WordPress
    -------------------------------------------
    
    Home Url: https://merlinone.staging.wpengine.com
    Site Url: https://merlinone.staging.wpengine.com
    Login Url: https://merlinone.staging.wpengine.com/wp-login.php
    Version: 5.1
    Debug Mode: No
    Debug Log: No
    Debug Display: Yes
    Locale: en_US
    Multisite: No
    Page For Posts: Blog (#319) [https://merlinone.staging.wpengine.com/blog/]
    Page On Front: Home (#8) [https://merlinone.staging.wpengine.com/]
    Permalink Structure: /%postname%/
    Show On Front: page
    Wp Cron: Yes
    
    Settings
    -------------------------------------------
    
    Version: 3.28.3
    Db Version: 3.28.3
    Course Catalog: Course Catalog (#11311) [https://merlinone.staging.wpengine.com/courses/]
    Membership Catalog: Membership Catalog (#11312) [https://merlinone.staging.wpengine.com/memberships/]
    Student Dashboard: Dashboard (#11314) [https://merlinone.staging.wpengine.com/dashboard/]
    Checkout Page: Purchase (#11313) [https://merlinone.staging.wpengine.com/purchase/]
    Course Catalog Per Page: 9
    Course Catalog Sorting: menu_order,ASC
    Membership Catalog Per Page: 9
    Membership Catalog Sorting: menu_order
    Site Membership: Not Set
    Courses Endpoint: my-courses
    Edit Endpoint: edit-account
    Lost Password Endpoint: lost-password
    Vouchers Endpoint: redeem-voucher
    Autogenerate Username: yes
    Password Strength Meter: yes
    Minimum Password Strength: strong
    Terms Required: no
    Terms Page: Not Set
    Checkout Names: required
    Checkout Address: required
    Checkout Phone: optional
    Checkout Email Confirmation: yes
    Open Registration: no
    Registration Names: required
    Registration Address: optional
    Registration Phone: hidden
    Registration Voucher: optional
    Registration Email Confirmation: no
    Account Names: required
    Account Address: required
    Account Phone: optional
    Account Email Confirmation: yes
    Confirmation Endpoint: confirm-payment
    Force Ssl Checkout: no
    Country: US
    Currency: USD
    Currency Position: left
    Thousand Separator: ,
    Decimal Separator: .
    Decimals: 2
    Trim Zero Decimals: no
    Recurring Payments: yes
    Email From Address: [email protected]
    Email From Name: MerlinOne
    Email Footer Text: 
    Email Header Image: 
    Cert Bg Width: 800
    Cert Bg Height: 616
    Cert Legacy Compat: no
    
    Gateways
    -------------------------------------------
    
    Manual: Disabled
    Manual Logging: 
    Manual Order: 1
    
    Server
    -------------------------------------------
    
    Mysql Version: 5.6.42
    Php Curl: Yes
    Php Default Timezone: UTC
    Php Fsockopen: Yes
    Php Max Input Vars: 1000
    Php Max Upload Size: 50 MB
    Php Memory Limit: 512M
    Php Post Max Size: 100M
    Php Soap: Yes
    Php Suhosin: No
    Php Time Limt: 3600
    Php Version: 5.6.40-1+ubuntu18.04.1+deb.sury.org+1
    Software: Apache
    Wp Memory Limit: 40M
    
    Browser
    -------------------------------------------
    
    HTTP USER AGENT: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.119 Safari/537.36
    
    Theme
    -------------------------------------------
    
    Name: MerlinOne
    Version: 1.0.0
    Themeuri: 
    Authoruri: https://ceciledesignstudio.com/
    Template: x
    Child Theme: Yes
    Llms Support: No
    
    Plugins
    -------------------------------------------
    
    Advanced Custom Fields: 5.7.12
    Akismet Anti-Spam: 4.1.1
    Blackhole for Bad Bots: 2.2
    Classic Editor: 1.4
    Cornerstone: 3.4.6
    Duplicate Post: 3.2.2
    Easy Pricing Tables Premium: Personal: 2.3.9
    Essential Grid: 2.3.2
    Gravity Forms: 2.4.6
    Gravity Forms Range Slider Add-On: 1.0.8
    Gravity Forms to Google SpreadSheets: 1.0
    Gravity Forms User Registration Add-On: 4.0
    Gravity Forms Zapier Add-on: 3.1
    Head, Footer and Post Injections: 3.1.2
    Imagify: 1.8.4.1
    LifterLMS: 3.28.3
    Redirection: 3.7.3
    Slider Revolution: 5.4.8.2
    Yoast SEO: 9.7
    
    Integrations
    -------------------------------------------
    
    BbPress: No
    BuddyPress: No
    
    Template Overrides
    -------------------------------------------
    
    loop.php (ver: 3.14.0): /nas/content/staging/merlinone/wp-content/themes/x-child/lifterlms/ (ver: 3.14.0)
    
    

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

Viewing 7 replies - 1 through 7 (of 7 total)
  • @cecilette,

    I’m sorry for this issue but at a glance I have no idea why this would be happening. I’ve never seen the homepage be merged into the certificate export before.

    Could you upload a certificate export (you can’t upload to these forms so put it on Drive or Dropbox and post a link) so I can take a closer look at the file to see if that could provide me with any clues as to what’s going on here.

    Could you also check your .htaccess file to see if you have any non-standard rules (anything other than what WordPress puts in there by default during installation) that could be causing redirects or potential issues?

    The way the certificate export works is that we create a 1-time use authentication token and use that to “scrape” the certificate using a curl request. Be then strip out all the non-certificaty stuff (like JS files) and then have you download the resulting HTML. If there was some sort of redirect setup this could cause the homepage to get scraped instead of the certificate. This seems pretty unlikely but could be possible.

    And, before you say “Why can’t I just download a PDF” believe me I worked for weeks trying to build a PDF exporter and I couldn’t do. It’s basically impossible to use PHP alone (which is all I can really rely on from within a WP plugin) to generate a PDF *from a web page* and maintain visual consistency between what you seen on screen and what you get in the PDF. I wish it was simple. It’s not. I’m pretty good at what I do and I couldn’t figure it out. So you get HTML which no one in the world wants but I can’t come up with anything better without rebuilding certificates from scratch to utilize *only* stuff I can count on being able to use in a PDF. We’re working on that, but it’s a few months off yet.

    Thanks,

    Thread Starter cecilette

    (@cecilette)

    Hi Thomas,

    It definitely would be nice to download a PDF but understand the complexity of generating PDFs. I’ve done it before with the FPDF library (https://www.fpdf.org/) but it probably doesn’t work for background images or anything visually complex.

    I uploaded the html here: https://www.dropbox.com/s/b2xuz20xgx55iqk/certificate-qmubjbt6kkod.html?dl=0

    This is a staging site on WP-Engine. I didn’t see anything abnormal in the .htaccess file.

    Let me know if you figure it out, thanks!

    Is there a .htpasswd (basic authentication_ on the staging site here? If so that would be preventing the callback / scrape and could explain this issue.

    Thread Starter cecilette

    (@cecilette)

    Well that was dumb. I figured it out. I was testing the certificate without completing the course associated with it. I did and now it works!
    Ideally the certificate would work for admins regardless, but at least it works now.

    Anything I can do to hide the header and footer from the html file?… but not from the certificate page?

    Thanks for your help!

    @cecilette,

    Well that was dumb. I figured it out. I was testing the certificate without completing the course associated with it. I did and now it works!
    Ideally the certificate would work for admins regardless, but at least it works now.

    Can you let me know the steps (very very specifically) you were taking to view this as an admin regardless of your progress? I don’t know anywhere in LifterLMS where you can download a certificate as an admin unless you actually earned it. Obviously you’ve found a bug that I created but don’t know how to get to. If you could help me recreate this I’ll of course fix it but I’m not sure how you were able to try to download something without having access to it first…

    Anything I can do to hide the header and footer from the html file?… but not from the certificate page?

    You’ll have to write some custom CSS to do this. I’ve tried *really hard* to write CSS that identifies headers and footers but this isn’t standardized across themes so it’s basically an impossible task to write CSS that’ll work with EVERY THEME OUT THERE. You’ll need to identify the headers and footers and write some CSS to hide them on the certs.

    Thread Starter cecilette

    (@cecilette)

    I just go to Engagements > Certificates and view it.

    I can see the url is different when I access it this way vs. from the front-end.

    I can hide the header and footer on the certificate template targeting .llms_my_certificate-template-default or .single-llms_my_certificate

    … but do I hide them ONLY in the html file that gets saved out. Can you point me in the right direction, please?

    @cecilette,

    I just go to Engagements > Certificates and view it.

    I can see the url is different when I access it this way vs. from the front-end.

    Oh gosh I’m dense sorry… I’ve recorded this as a bug here and I’ll get this fixed in a future release: https://github.com/gocodebox/lifterlms/issues/776

    I can hide the header and footer on the certificate template targeting .llms_my_certificate-template-default or .single-llms_my_certificate

    … but do I hide them ONLY in the html file that gets saved out. Can you point me in the right direction, please?

    There’s no simple way to add export-only css since what we’re actually doing is just loading the page and saving it as an HTML file.

    I feel as if I’ve made a serious oversight here but it hasn’t ever occurred to me that this would be something that users would want to do so I don’t have any simple methods in place to accommodate this request… I’m sorry.

    I’ve recorded this as an area to improve our current codebase and should I get anything added to allow this I’ll post back here and let you know.

    My apologies, I just didn’t ever think of this before.

    Best,

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Certificate HTML contains home page html’ is closed to new replies.