Giter Site home page Giter Site logo

freemius / wordpress-sdk Goto Github PK

View Code? Open in Web Editor NEW
261.0 261.0 77.0 14.04 MB

Home Page: https://freemius.com

License: GNU General Public License v3.0

CSS 0.01% JavaScript 1.16% PHP 95.31% SCSS 3.53%
analytics freemium freemius monetization php premium-plugins premium-themes sdk wordpress-plugins wordpress-themes

wordpress-sdk's People

Contributors

alanef avatar alikmanukian avatar bahiirwa avatar bfintal avatar cliffordp avatar danielealessandra avatar danieliser avatar dgwyer avatar dovy avatar dudo1985 avatar edgar-melkonyan avatar ericnicolaas avatar fajardoleo avatar fs-contributor avatar ianmjones avatar intoxstudio avatar johnalarcon avatar leftees avatar malayladu avatar matczar avatar msladu avatar mte90 avatar primozcigler avatar ramiy avatar shelob9 avatar sun avatar swashata avatar tagire avatar vovafeldman avatar xiahengchen avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

wordpress-sdk's Issues

Wrong renewal notice on order review

When testing monthly payments (in Sandbox mode), I got this message when reviewing order:

udklip

Point 3 does not display the value correctly, and it should state monthly renewal payments instead of annual.

When testing annual payments the same way, the message is:

udklip2

Point 3 does not display the value correctly.

SDK version 1.1.8.1.

Leverage the WordPress.org plugins API to fetch the URL of the plugin's icon.

Currently /templates/plugin-icon.php tries to fetch 128x128 & 256x256 icons from the SVN using HTTP, and stores the 1st version that returns a real image. Apparently, it's possible to fetch the icon from the plugins API by adding icons as one of the fields params in the querystring:

http://api.wordpress.org/plugins/info/1.0/{slug}.json?fields=banners,icons

Dashboard: Billing Info Auto Save Delay

The auto save is great but it fires for every field with no delay. Even when I fill in fields very quickly it ques up each fields save in succession.

Propose setting a delay timeout that can be cleared on focus out. Then when multiple fields are filled you only send one request.

Will also make using tools like google chrome form filler more efficient.

Problem to downgrade plan

Hello, I have a little problem on the plan page.
There are two plans "free version" and "premium version", I test the premium version, but when I want to go back to the free version, I click the "Downgrade" button and nothing happens, it's normal ?

Thank you very much :)

Freemius breaks quotes localization due to early call of get_plugin_data()

Seems like the call to get_plugin_data() triggers _get_plugin_data_markup_translate() which calls load_plugin_textdomain() too early.

Solution:
Option 1: Try calling get_plugin_data() with $markup and $translate equals false.
Option 2: If option 1 doesn't help, create a local copy of get_plugin_data() that doesn't call unnecessary core methods.

Reference:
https://wordpress.org/support/topic/freemius-integration-broke-localized-quotes
https://wordpress.org/support/topic/conflict-with-wp-to-twitter-1?replies=14

CC: @danieliser

Class 'Freemius_Exception' not found

PHP Fatal error:  Class 'Freemius_Exception' not found in /htdocs/wp-content/plugins/xxxxxxxxxxxx/includes/freemius/includes/class-freemius.php on line 2068

I get that error when i enable freemius

Upgrade menu added without paid plans

Summary:
If I don't have paid plans for my plugin, then I shouldn't see the Upgrade menu added.

You can see I've set "has_paid_plans" to false; however, it still adds the submenu.

code

upgrade_submenu

I'll be submitting a commit for this issue soon. Please confirm that this is a bug and I'm not crazy. :)

Set notifications on plugin de-activation to idle for 24hrs

When de-activating a plugin the notifcation can become annoying especially in a develolpment/maintenance environment (e.g. I am debugging a site and need to turn on/off plugins).

This can produce annoying effects especially if an installation has multiple Freemius enabled plugins.
The user should be allowed to idle notifications if they start getting in the way of his debugging.

A simple "don't bother me for the next 24hrs" should appear if several de-activation are detected.

issue for non-admins

Hello,

I'm using the next configuration for the freemius:

$im_fs = fs_dynamic_init( array(
            'id'                => '',
            'slug'              => 'intergeo-maps',
            'public_key'        => '',
            'is_premium'        => false,
            'has_addons'        => false,
            'has_paid_plans'    => false,
            'anonymous_mode'    => true,
            'menu'              => array(
                'slug'       => 'intergeo',
                'account'    => false,
                'support'    => false,
                'parent'     => array(
                    'slug' => 'upload.php',
                ),
            ),
        ) );

If i log in with a non-admin account, simple subscriber, and i get some errors on the admin screen:

Warning: Invalid argument supplied for foreach() in D:\Dezvoltare\php\wordpress\wp-content\plugins\intergeo-maps\freemius\includes\class-freemius.php on line 6339

and also:

Warning: Invalid argument supplied for foreach() in D:\Dezvoltare\php\wordpress\wp-admin\includes\plugin.php on line 1537

Im using the latest wordpress of 4.5.2 and the latest freemius SDK.

I've tried to add this :
if (empty($top_level_menu)) return;

here https://github.com/Freemius/wordpress-sdk/blob/master/includes/class-freemius.php#L6338

But i still get the second error.

Any clue what it could be ?

Change the name of the menu page

Case example:
I create a page with add_menu_page and set as name the Plugin name.
Freemius transform that menu page in a parent menu page, so in the sidebar we have the plugin name and in that a sub menu with a page with the name of the plugin name.
In my case I want that page have a different name like settings.

Actual situation:
screenshot6

What I want:
screenshot7

If the API is down during a background sync (once in 24 hours) and there are N freemius powered plugins, it will invoke N failed requests.

It also shows N error messages instead of only one message:

image

Reference: http://community.rtcamp.com/t/freemius-crashing-entire-website/

The API connection is going crazy. Look at those curl timeouts, 60 seconds per license? 31 rtcamp plugins, 31 * 60 seconds = HOLY SHIT. Site's completely unresponsive since Freemius API server is down or unresponsive. I'm going through and removing all the license checks from the PHP right now.

Solution:

  • If the API is down there should only be one error message shown for all Freemius powered plugins.
  • The connectivity test should be cached to prevent from the server just waiting for timeouts.

Update notice not being displayed

If a user has both a freemius and a wp.org version of a plugin on a site, update notices will not be displayed for the freemius version on the Plugins screen.
An update notice will be displayed on the Accounts page.

Reproduce issue:

  1. have wp.org and freemius versions on the site, leave wp.org version inactive
  2. push update to freemius and wp.org
  3. update notice will be displayed for the free version, but not the freemius version

SDK version 1.1.9.

Loading image on VVV does not work

From #3 the instructions to load the plugin image does not work if the local development environment is not running on actual localhost. In my VVV environment $_SERVER['REMOTE_ADDR'] is 192.168.50.1 so this line in freemius/config.php will never be true:

    define( 'WP_FS__IS_LOCALHOST', ( substr( $_SERVER['REMOTE_ADDR'], 0, 4 ) == '127.' || $_SERVER['REMOTE_ADDR'] == '::1' ) );

and WP_FS__IS_LOCALHOST needs to be true for the icon to be downloaded locally in template/plugin-icon.php

Error message when bulk-deleting plugins

When users bulk delete plugins, they get this error:
`Warning: require_once(/var/www/clients/client0/web3/web/wp-content/plugins/chamber-dashboard-member-manager/freemius/start.php): failed to open stream: No such file or directory in /var/www/clients/client0/web3/web/wp-content/plugins/chamber-dashboard-member-manager/cdash-member-manager.php on line 81

Fatal error: require_once(): Failed opening required '/var/www/clients/client0/web3/web/wp-content/plugins/chamber-dashboard-member-manager/freemius/start.php' (include_path='.:/opt/php-7.0.0/lib/php') in /var/www/clients/client0/web3/web/wp-content/plugins/chamber-dashboard-member-manager/cdash-member-manager.php on line 81`

This is happening because the Business Directory (which is the plugin that has the Freemius SDK) gets deleted first, so then the others throw errors. It's not a huge deal, because you can just reload the page and then delete the other plugins, but it isn't ideal. What can we do to work around this?

Email unsubscribe not working

Hi !
When I press in unsubscribe button I moved to this link: https://api.freemius.com/account/unsubscribe/?s_id=XXXXX&s_secure=XXXXXXX&s_ts=XXXXX&s_type=X,

and I get this error:

{"path":":","error":{"type":"","message":"You must provide the Api's version in the request path. Example: \/v1\/developers\/3\/plugins\/4\/installs.json","code":"missing_version","http":400,"timestamp":"Mon, 14 Dec 2015 17:04:03 +0000"}}

Getting more done in GitHub with ZenHub

Hola! @vovafeldman has created a ZenHub account for the Freemius organization. ZenHub is the only project management tool integrated natively in GitHub – created specifically for fast-moving, software-driven teams.


How do I use ZenHub?

To get set up with ZenHub, all you have to do is ?utm_source=ZHOnboarding download the browser extension and log in with your GitHub account. Once you do, you’ll get access to ZenHub’s complete feature-set immediately.

What can ZenHub do?

ZenHub adds a series of enhancements directly inside the GitHub UI:

  • Real-time, customizable task boards for GitHub issues;
  • Multi-Repository burndown charts, estimates, and velocity tracking based on GitHub Milestones;
  • Personal to-do lists and task prioritization;
  • Time-saving shortcuts – like a quick repo switcher, a “Move issue” button, and much more.

?utm_source=ZHOnboarding Add ZenHub to GitHub

Still curious? See ?utm_source=ZHOnboarding more ZenHub features or read user reviews. This issue was written by your friendly ZenHub bot, posted by request from @vovafeldman.

ZenHub Board

Custom CSS for inside of iFrames

I really need a way to add a custom CSS to the pricing sign up and contact iFrames that are being served from your site. Even if I just pass a file path in the settings.

VAT ID missing from receipts

After a couple of tests using a VAT ID it looks like that information is not included in any of the receipts sent to the author and customers.

I'm attaching some screens with the VAT ID placed during checkout and the receipts I've received

Am I missing something?

Checkout
checkout with vat id

Customer Receipt
customer-receipt

Payment Received Receipt
payment received -receipt

.

Free version of plugin dissappears when updating

Related: #70

If a user has both a wp.org/free and a freemius version of a plugin, and he updates the free version, it dissappears (and the freemius version is updated successfully).

Reproduce issue:

  1. have wp.org and freemius versions on the site, leave wp.org version inactive
  2. push update to freemius and wp.org
  3. go to plugins screen and update the free version (there should be no update notice on freemius version)
  4. wp.org version dissappears and freemius version is updated

SDK version 1.1.9.

Double menu on WordPress 4.4

A new installation / activation shows a double menu on the left (when menu added via add_menu_page) until they've gone past the Freemius opt-in prompt.

Add-on trial > Require opt-in before allowed to trial

As of v1.1.8, trials can be enabled for add-ons. However, the payment details are required if the user has not opted-in (including confirming their email address).

It would be ideal if users could only initiate a trial if they have opted-in first.

If they don't want to opt-in, they can just buy it outright (not allowed to trial).

Plugin icon not loading on opt-in screen

I'm working on the new version of my plugin, and in doing a local upgrade, I ran into a an error from the latest version of Freemius. Looks like a strict warning, combined w a permission issue, but something you might put a conditional statement around, just in case.

http://prntscr.com/9caca9

API Connectivity Diagnostic

Add a section dedicated for API details in the FS debug page to allow developers understand if cURL is missing, and if not, what's the returned result on ping

Multilanguage support

It's possible add the multi language support?
With that code and a folder that contain the po files in that format freemius-it_IT.po/mo will be easy to have freemius localized.

function freemius_load_plugin_textdomain() {
  load_plugin_textdomain( 'freemius ', FALSE, basename( plugin_dir_path( dirname( __FILE__ ) ) ) . '/languages/' );
}
add_action( 'plugins_loaded', 'freemius_load_plugin_textdomain', 1 );

Extra query on every request

Due to how get_option works checking for a false / missing value will always lead to an extra query. In this case Freemius calls get_option( 'fs_debug_mode' ) during config. Since this option is never set WP always queries looking for it.

Easiest fix is to simply store a false value when the option is detected to not exist, then it will be autoloaded with other options and save the query.

PR attached.

RTL Compatibility

The Freemius Opt-In box is not RTL Compatible.

Custom Submitted Screenshot:
freemius_ninja_forms_rtl

Should redirect to plugin page not account page if account = false

In the new SDK, after confirming my email it is redirecting to

/wp-admin/admin.php?fs_action=sync_user&page=eventcalendarnewsletter-account&_wpnonce=...

I think it should redirect back to the account page if account = false in the freemius init. Otherwise, there's no way for the user to get back to that screen later.

On that same note there should be some way for them to opt out if there is no account page. Perhaps a link somewhere in the confirmation email sent after they confirm their email address?

SDK newest version load when there's a network and site activated Freemius powered plugins.

Multi-site network activated plugin are always loaded prior to site plugins so if there's a a plugin activated in the network mode that has an older version of the SDK of another plugin which is site activated that has new SDK version, the fs-essential-functions.php will be loaded from the older SDK.

Same thing about MU plugins (loaded even before network activated plugins).

Skip user email registration...

it would be great to be able to skip the email validation for users. It's fair to assume that if an admin has input an email address in the WP admin panel, well, the email is a legit one.

The proposal is to allow the plugin dev to decide whether to require the email confirmation or simply letting the user accepting the opt-in from the WP admin panel.

Better init for addons.

I think this is a better init for addons. It has less code, is more readable and uses existing WP core methods.

This is also how I do it for both Popup Maker and the new recipe plugin line Cooked.

add_action( 'plugins_loaded', 'wt_tpa_init' );
function wp_tpa_init() {
    if ( class_exists( 'Test_Plugin' ) ) {
        // If parent plugin already loaded, init add-on.
        test_plugin_addon();
    } else {
        /*
         * This part makes it fancy and notifies them with
         * a message in the admin that the base needs to be
         * installed/activated and includes links to do so.
         * This would replace your die method below with an elegant fallback.
        if ( ! class_exists( 'Plugin_Addon_Activation' ) ) {
            require_once 'includes/class.addon-activation.php';
        }

        $activation = new Plugin_Addon_Activation( plugin_dir_path( __FILE__ ), basename( __FILE__ ) );
        $activation->run();
         */

        // Parent plugin is not activated.
        //  1) Deactivate the add-on
        //  2) Show WP fata error message.

        deactivate_plugins( basename( __FILE__ ) );

        wp_die(
            'The Add On cannot run without the parent plugin. Please activate the parent plugin and then try again.',
            'Error',
            array( 'back_link' => true )
        );
    }
}

Also I would be happy to give you a copy of my Addon_Activation class which you could hack into a ready made include for this as well.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.