cleanplugins / auto-activate-freemius-licenses

This plugin allows you to automatically activate your Freemius licenses.
GNU General Public License v3.0
0 stars 1 forks source link

No activation! #1

Open araeubig opened 1 year ago

araeubig commented 1 year ago

I installed the plugin in two wordpress environments and used my own plugin (in development) but no activation is done.

The plugin id and license key is present in wp-config.php.

After inserting some debug outputs i came to -> "$fs->is_registered()" which returns true in my case on my local install and there it was previously activated manually und before testing the plugin deactivated.

But in my codespace new install it was not activated before.

What can i do?

erropix commented 1 year ago

Can you check the Freemius debug page?

Normally, you can access it via /wp-admin/admin.php?page=freemius

araeubig commented 1 year ago

I tested with another new made license key and there it works. So the "no activation" depends on "$fs->is_registered()". If the user has opt-in before it doesn't work.

Perhaps you could check this? But i will send you a screenshot of the freemius license page too.

erropix commented 1 year ago

In my last tests, I could deactivate the license from the admin account page, and it got reactivated successfully.

erropix commented 1 year ago

Can you change this line

https://github.com/cleanplugins/auto-activate-freemius-licenses/blob/304adb2abd5d442f4b4296d312beeec96b29afa6/auto-activate-freemius-licenses.php#L55

to

if (is_object($fs) && $fs->is_premium() && $fs->has_api_connectivity() && !$fs->has_active_license()) {

Let me know if this fixes the issue for you so I can release it.

araeubig commented 1 year ago

I will test it today and give you feedback

araeubig commented 1 year ago

I tested in my codespace dev-environment and it doesn't work. I will repeat until tomorrow evening in my local test environment and will give you a new reply.

erropix commented 1 year ago

If you want to share the debug data, please email me via support at cleanplugins.com

araeubig commented 1 year ago

I tried in a second environment but it doesn't work.

And here is the debug screenshot: Screenshot (184)_clean

erropix commented 1 year ago

Ok, can you also share the config you used?

araeubig commented 1 year ago

in my main plugin file:

` function dpf_fs() {

    global $dpf_fs;

    if ( ! isset( $dpf_fs ) ) {
        require_once __DIR__ . '/includes/libraries/freemius/start.php';

        $dpf_fs = fs_dynamic_init(
            array(
                'id'               => '11777',
                'slug'             => 'digital-picture-frame-free',
                'premium_slug'     => 'digital-picture-frame',
                'type'             => 'plugin',
                'public_key'       => 'pk_ccb3f3f161cc2a6663f609a115565',
                'is_premium'       => true,
                'is_premium_only'  => true,
                'has_addons'       => true,
                'has_paid_plans'   => true,
                'is_org_compliant' => false,
                'has_affiliation'  => 'selected',
                'navigation'       => 'menu',
                'menu'             => array(
                    'slug'        => 'dpf',
                    'contact'     => false,
                    'support'     => false,
                    'affiliation' => false,
                ),
                'secret_key'       => xx',
            )
        );
    }
    return $dpf_fs;
}

dpf_fs();
do_action( 'dpf_fs_loaded' );

}`

and in wp-config.php:

`define( 'WP_FS__DEV_MODE', true );

/ Define Freemius licenses in the format: 'plugin_id' => 'license key' / $fs_auto_activate_licenses = array( '11777' => 'sk_bY:;7xSb7!1bU4TZdXR#IL4AjU;Tt', // Digital Picture Frame );`

erropix commented 1 year ago

Is the site live? I can't figure out what's wrong without doing some debugging.

araeubig commented 1 year ago

No its my development codespace - but i could build a live copy for you until tomorrow

xstable commented 4 months ago

@erropix I do have the same issue, but I've installed it as mu-plugins. Some time ago it work as expected, currently it doesn't work anymore.

I don't have any "fremius-debug" page in the WP-Backend, even the link you noticed /wp-admin/admin.php?page=freemius shows an error-page.

image

I've done some debugging (var_dump) in the script and found, that

$fs->has_api_connectivity() == NULL

xstable commented 4 months ago

help, please. 🙏🏼

erropix commented 4 months ago

@xstable I think you have api connectivity issues, also, it's weird that the debug page does't show in the admin by accessing the direct link as it should be included with the FS sdk.

xstable commented 4 months ago

@erropix how can I fix api connection? Which api is meant?

erropix commented 4 months ago

I mean the Freemius API is not accessible from your server, thats is why $fs->has_api_connectivity() return NULL as you stated in above message.

Anyway, with the Freemius SDK, the page /wp-admin/admin.php?page=freemius shouild be always accessible unless you use a plugin that forcefully disabled it.

Can list all plugins you installed that uses the Freemius SDK?

If you do have other sites, can you try accessing the debug page on them?