Description
Hi @sheabunge for a little helper plugin I currently develop what would be the best and future proof way, to check for Code Snippets Pro plugin?
I want to check if the pro version is active and if the snippet types CSS and JS are available.
Currently I make this check:
class_exists( '\Code_Snippets\Cloud\Cloud_GPT_API' )
... it works but I guess that is not the most elegant way?
Furthermore I want to check for cloud connection if it is active, I just use this:
class_exists( '\Code_Snippets\Cloud\Cloud_API' ) && \Code_Snippets\Cloud\Cloud_API::is_cloud_connection_available()
Would be glad if there are better ways to do that. I looked up the code a bit but I am unsure what's best. FYI: I am pro user with active license.
Also: in both free AND the pro version of your plugin this constant is defined and set to TRUE
:
define( 'CODE_SNIPPETS_PRO', true );
...for me that makes no sense – I would expect it to be set to FALSE
in the free version???
Thanks a lot in advance!
– David