Skip to content

Best way to check for Plugin's Pro Version? #229

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Open
deckerweb opened this issue Mar 17, 2025 · 0 comments
Open

Best way to check for Plugin's Pro Version? #229

deckerweb opened this issue Mar 17, 2025 · 0 comments

Comments

@deckerweb
Copy link
Contributor

deckerweb commented Mar 17, 2025

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

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant