Database Improvements in v 1.2.11

Would it be possible to find out what the Database Improvements for version 1.2.1.1 were that were mentioned in the changelog?

  • Vinod Dalvi

    Hi @Susan,

    I hope you are well today and thank you for your question.

    The following database improvements have been made in the plugin.

    Cleaning up CoursePress for CampusPress integration and overall
    better performance.
    Removing a number of expensive SQL calls in favor of WordPress native
    methods and better logic.
    Database Cleanup - Files/methods update
    ---------------------------------------------
    coursepress.php:get_last_inserted_id()
    functions.php:cp_delete_user_meta_by_key()
    functions.php:cp_get_userdatabynicename()
    // Removed, now getsID from wp.media.editor and save to meta
    functions.php:cp_get_attachment_id_from_src()
    // Simplified post meta copy, no SQL
    class.course.php:duplicate()
    // Simplified post meta copy, no SQL
    class.course.unit.module.php:duplicate()
    
    The following has been changed in favor of WP native methods
    and re-worked logic.
    Database Cleanup - Files/methods update
    ---------------------------------------------
    coursepress.php:get_last_inserted_id()
    functions.php:cp_delete_user_meta_by_key()
    functions.php:cp_get_userdatabynicename()
    // Removed, now gets ID from wp.media.editor and save to meta
    functions.php:cp_get_attachment_id_from_src()
    // Simplified post meta copy, no SQL
    class.course.php:duplicate()
    // Simplified post meta copy, no SQL
    class.course.unit.module.php:duplicate()
    
    // Reworked to use get_posts and meta queries
    class.course.unit.php:get_previous_unit_from_the_same_course
    class.course.unit.php:delete_all_elements_auto_drafts
    class.course.unit.php:get_unit_id_by_name
    // Simplified post meta copy, no SQL
    class.course.unit.php:duplicate
    class.coursesearch.php:get_results

    The following plugin files have been changed to make these changes.

    includes/classes/class.course.unit.php
    includes/classes/class.coursesearch.php
    coursepress.php
    includes/classes/class.course.php
    includes/classes/class.course.unit.module.php
    includes/functions.php
    includes/unit-modules/image.php
    includes/unit-modules/video.php
    js/coursepress-courses.js

    Best Regards,
    Vinod Dalvi

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.