[CoursePress Pro] Coursepress Certificate Regeneration

How do we regenerate all the certificates in CP Pro?
I want to add an mu-plugin for including final-grade, but when its added it doesn't change any of our existing certificates.

Show me how to regenerate certificates in Coursepress Pro?

  • James Morris

    Hello Josh

    I'm not seeing a simple way to accomplish this right off hand. I'm pinging our code experts to get their valuable feedback on this issue. Please keep in mind that more advanced issues such as this may take a little more time to answer. An update will be posted as soon as more information is available. Thank you for your patience while we sort through this for you.

    Best regards,

    James Morris

  • James Morris

    Hello Josh

    I spoke with the Lead Dev on this project and they've provided the following pointers.

    The PDFs are stored in the uploads folder (depend on isntalation) wp-content/uploads/ for single
    wp-content/uploads/sites/<site-number> for mu. Then -> pdf-cache. The final path looks like this: wp-content/uploads/pdf-cache/70/28/d69ad7e4632254ba17d3b0391d9d.pdf

    Also, records are stored in MySQL. You can use the following to return the records:

    mysql> select * from wp_postmeta where post_id in ( select id from wp_posts where post_type = 'cp_certificate');
    +---------+---------+------------------+------------------------------------------------------------------------------------------+
    | meta_id | post_id | meta_key         | meta_value                                                                               |
    +---------+---------+------------------+------------------------------------------------------------------------------------------+
    |   36317 |    3777 | certificate_file | /var/virtuals/incsub/wp-content/uploads/pdf-cache/ae/e3/3e18a6c9372f3f9850063d0d153b.pdf |
    |   37369 |    3848 | certificate_file | /var/virtuals/incsub/wp-content/uploads/pdf-cache/2c/f0/123d575820b6fc84f3d32e643821.pdf |

    ...and this is how we store information.

    mysql> select * from wp_posts where id = 4332\G
    *************************** 1. row ***************************
                       ID: 4332
              post_author: 48
                post_date: 2018-07-03 14:02:09
            post_date_gmt: 2018-07-03 12:02:09
             post_content: <h2>incsubqa </h2>
                            has successfully completed the course
    
                            <h3>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur commodo condimentum odio, sed venenatis sem iaculis id. Maecenas pulvinar auctor risus ac sodales. Vivamus luctus augue interdum sapien lobortis consequat. Proin et elit sit amet nunc auctor tristique sed vel erat. Praesent vestibulum velit vel diam feugiat, vel porttitor sapien convallis. Curabitur suscipit justo ut ipsum efficitur, ut placerat nibh semper. Curabitur sagittis scelerisque nibh vel pellentesque. In id viverra quam. Phasellus consectetur nulla eu lacinia tristique. Aenean lobortis interdum eros, non pulvinar tortor feugiat vel.</h3>

    ...and the post_author of the CPT cp_certificate is a student.

    We use TCPDF library to generate pdf files. You can find the functions here: wp-content/plugins/coursepress/2.0/include/coursepress/data/class-certificate.php

    I hope this gets you going in the right direction. :slight_smile:

    Best regards,

    James Morris

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.