Open ns-rx opened 2 months ago
Enhancement in 'poetwp_save_poem_details' Function The function 'poetwp_save_poem_details' is now updated to better sanitize data. It uses 'wp_unslash()' while saving 'poem_date' and 'poem_notes' fields. This improves the overall data safety and integrity in our application.
Inclusion of New 'Demo_Poem' Class We have introduced a new 'Demo_Poem' class in 'class-demo-poem.php'. This class bundles demo poem data and offers methods to get content and custom fields, ensuring a more structured and consistent handling of demo poem data across our application.
Refactored 'poetwp_create_demo_poem' Function The 'poetwp_create_demo_poem' function was modified to use the 'Demo_Poem' class to fetch specific data (like poem title, content, status, and custom fields) rather than having such values hardcoded. This change offers a smarter way of accessing and manipulating data, making the process more efficient and maintainable.
Setup of Deactivation Hook in 'poetwp.php' A new deactivation hook has been registered in 'poetwp.php'. This facilitates the plugin to unregister its custom post type when it's deactivated, and also to clear rewrite rules, preserving the hygiene and security of our system resources when the plugin is not in use.
Implementation of 'uninstall.php' We've added an 'uninstall.php' file. This file contains instructions to delete demo poems from the database whenever the plugin is removed. This ensures efficient cleanup and proper resource management as it prevents data and memory cluttering when the plugin is uninstalled.
Depends on PR #37
Does it?
The only extra commit in this PR seems to be standalone - #37 doesn't touch those lines (or indeed the whole includes/admin_functions.php
file).
In this case, you can rebase the fix/unslash
branch against develop
(so it becomes develop
+ 1 commit), and then this can be merged without waiting for #37.
Depends on PR #37
Fixes #28