Project

General

Profile

Actions

Bug #18434

closed

TablePress plugin

Added by scott voth 10 months ago. Updated 10 months ago.

Status:
Resolved
Priority name:
Normal
Assignee:
Category name:
WordPress Plugins
Target version:
Start date:
2023-07-07
Due date:
% Done:

0%

Estimated time:
Deployment actions:

Description

It seems that the TablePress plugin has been updated on the Commons, but whenever I go to it, I get the attached popup and neither option works. It just loops back. You can see this here: https://help.commons.gc.cuny.edu/wp-admin/admin.php?page=tablepress


Files

table press.jpg (58.4 KB) table press.jpg scott voth, 2023-07-07 04:06 PM
Actions #1

Updated by Boone Gorges 10 months ago

Something about TablePress's Freemius integration is causing everything to break. I think it has something to do with the way that the library cycles through all sites on the network to find an existing registered site. This check is failing (it only checks the first 1000?) and it seems to break the JS responsible for the 'skip' logic in Freemius. I played with it for a half hour and couldn't figure out a way to work around this restriction without actually hacking Freemius - no setting that I could fake or anything like that. I'm not eager to spend a lot more time digging into the guts of Freemius. Ray or Jeremy, do you have experience working around these restrictions?

Actions #2

Updated by Raymond Hoh 10 months ago

Boone, I was able to fake Freemius functionality and bypass the Freemius opt-in screen with the following in a /mu-plugins/ file:

<?php

class CAC_TablePress_Freemius_Dummy {
    public static function is_free_plan() {
        return true;
    }

    public static function is_plan_or_trial() {
    }

    function is_activation_mode() {}

    function add_filter( $function_name, $function_cb ) {}

    function override_i18n() {}
}

$GLOBALS['tb_tp_fs'] = new CAC_TablePress_Freemius_Dummy();

This works due to TablePress looking for the 'tb_tp_fs' global variable: https://github.com/cuny-academic-commons/cac/blob/d36f2008cd662d9908d9edf3ce4fa9a8040d4c04/wp-content/plugins/tablepress/tablepress.php#L53-L55 . So I was able to bypass Freemius this way.

If we were to use this code, we should remove any TablePress upsell buttons and prompts in the admin interface to avoid confusion. The easiest way would be to use some CSS.

Actions #3

Updated by Boone Gorges 10 months ago

Ah nice, I thought about doing something like that with the global, but I didn't know how much work it would take to mock the class. Well done :-D

If we were to use this code, we should remove any TablePress upsell buttons and prompts in the admin interface to avoid confusion. The easiest way would be to use some CSS.

Could you take a look at this? If it can be done quickly, then do it. I'm concerned that this is going to be a never-ending game of whack-a-mole, so I don't want to sink tons of time into it. It'll just have to be accepted as a limitation of TablePress on the Commons, the only alternative to which is removing the plugin altogether.

A side question for you - Is there something funny that the plugin author is doing here that's causing Freemius to be weird on our network? I feel like other plugins/themes use it, and we haven't had this problem. In the past, I've communicated with Tobias (who wrote TablePress) and he's been pretty receptive to feedback. If there was something specific I could tell him about what's happening, it might be worth reaching out.

Actions #4

Updated by Raymond Hoh 10 months ago

  • Status changed from New to Staged for Production Release
  • Target version set to 2.1.10

I've added the Freemius workaround in https://github.com/cuny-academic-commons/cac/commit/6a7811b57685854f8552b4e4b695ff08bacedd45 .

Could you take a look at this? If it can be done quickly, then do it.

I found that simply setting the Freemius::is_free_plan() conditional method to return false will hide all upsell buttons and blurbs, so I've done that in our Freemius dummy class.

A side question for you - Is there something funny that the plugin author is doing here that's causing Freemius to be weird on our network? I feel like other plugins/themes use it, and we haven't had this problem.

I'm guessing that something in Freemius is doing checks across the network, while other plugins and themes utilizing Freemius may not have updated their Freemius library to the latest version or are not using a specific method in Freemius that triggers the network checks like TablePress is doing. This is just a guess on my part though.

I just did a quick search across our codebase for Freemius and these are the plugins utilizing the library, as well as the version of Freemius being used:

plugin-slug Freemius SDK version
content-protector 2.5.9
event-tickets 2.4.4
foobox-image-lightbox 2.5.3
geo-mashup 2.5.5
glossary-by-codeat 2.5.5
share-this-image 2.5.7
shortcodes-ultimate 2.5.7
tablepress 2.5.8
the-events-calendar 2.4.4
widget-for-eventbrite-api 2.4.5

This might be handy down the line if we need to debug other plugins with Freemius.

Actions #5

Updated by Boone Gorges 10 months ago

Thanks for doing the leg work on this, Ray!

Actions #6

Updated by Boone Gorges 10 months ago

  • Status changed from Staged for Production Release to Resolved
Actions

Also available in: Atom PDF