[DigitalPoint] App for Cloudflare®

[DigitalPoint] App for Cloudflare® 1.8.8

No permission to download
Thanks for this!

Changing some settings (safe ones!) give this error:

Code:
ErrorException: [E_WARNING] Undefined array key "value_key" in src/addons/DigitalPoint/Cloudflare/Repository/Cloudflare.php at line 675
XF::handlePhpError() in src/addons/DigitalPoint/Cloudflare/Repository/Cloudflare.php at line 675
DigitalPoint\Cloudflare\Repository\Cloudflare->updateSettings() in src/addons/DigitalPoint/Cloudflare/Admin/Controller/Cloudflare.php at line 146
DigitalPoint\Cloudflare\Admin\Controller\Cloudflare->actionToggle() in src/XF/Mvc/Dispatcher.php at line 350
XF\Mvc\Dispatcher->dispatchClass() in src/XF/Mvc/Dispatcher.php at line 257
XF\Mvc\Dispatcher->dispatchFromMatch() in src/XF/Mvc/Dispatcher.php at line 113
XF\Mvc\Dispatcher->dispatchLoop() in src/XF/Mvc/Dispatcher.php at line 55
XF\Mvc\Dispatcher->run() in src/XF/App.php at line 2344
XF\App->run() in src/XF.php at line 512
XF::runApp() in admin.php at line 13

I tried with both Global and API access options.
 
Do you happen to recall which setting it was? That was the same error that just got fixed with the release today for the Argo Tiered Cache thing.
 
i tried with rocket loader as it is a safe setting to turn on for a few minutes and is available on free accounts. Authenticated Origin Pulls seems like a setting that I can turn on and it also showed the same error (not really sure what it does though).

also turned off and on Opportunistic Encryption setting as it is also safe setting to play with and this one worked fine for both disable and enable!
 
yeah. i saw the changelog for argo when i downloaded the addon. no hurry tbh. i was just testing to see if i configured the addon properly. i do not really need to turn on rocket loader! page rules and purge cache settings work fine as well so token seems to be set properly. cheers!
 
i tried with rocket loader as it is a safe setting to turn on for a few minutes and is available on free accounts. Authenticated Origin Pulls seems like a setting that I can turn on and it also showed the same error (not really sure what it does though).

also turned off and on Opportunistic Encryption setting as it is also safe setting to play with and this one worked fine for both disable and enable!
So I'm not sure what happened, but somehow the change I made for the Argo thing isn't in the version I uploaded. Before I push out a corrected version, can you do me a favor and edit the DigitalPoint/Cloudflare/Repository/Cloudflare.php file on like 675, and change this:

PHP:
                        // Example:  crawlhints
                        if (is_array($options['value_key']))

To this:

PHP:
                        // Example:  crawlhints
                        if (!empty($options['value_key']))

And see if it sorts it out for you? That was the change that was supposed to be in 1.0.0.2, but isn't somehow. Want to make sure it's the same underlying issue.
 
alright. i can confirm that the above change fixed rocket loader. i did not try argo because i do not have it enabled. not sure if turning on from the xenforo backend would enable it in cloudflare backend.

nm. i also turned on argo and it processed just fine. but cloudflare backend did not show it enabled probably coz it is a paid option and i do not have it enabled already?
 
alright. i can confirm that the above change fixed rocket loader. i did not try argo because i do not have it enabled. not sure if turning on from the xenforo backend would enable it in cloudflare backend.

nm. i also turned on argo and it processed just fine. but cloudflare backend did not show it enabled probably coz it is a paid option and i do not have it enabled already?
Thank you for making the change and checking if that was your fix as well. Going to push out an update for it now.

BTW, Argo Tiered Cache is free (on all plans). It's different than Argo Smart Routing (which is paid). You can find it under your Cloudflare account under Caching -> Tiered Cache.
 
got this error when doing a manual spam cleani for the first time this morning. haven't had an opportunity to try it since.

  • Code:
    ErrorException: [E_NOTICE] Undefined index: code
    src/addons/DigitalPoint/Cloudflare/Api.php:294
    Generated by: pete
    May 23, 2022 at 9:03 AM
    
    
    Stack trace
    #0 src/addons/DigitalPoint/Cloudflare/Api.php(294): XF::handlePhpError(8, '[E_NOTICE] Unde...', '/home/thumped/p...', 294, Array)
    #1 src/addons/DigitalPoint/Cloudflare/Api.php(126): DigitalPoint\Cloudflare\Api->makeRequest('POST', 'zones/b582f5cf8...', Array)
    #2 src/addons/DigitalPoint/Cloudflare/Repository/Cloudflare.php(983): DigitalPoint\Cloudflare\Api->createFirewallAccessRule('b582f5cf8101353...', Array, 'Used by spammer...', '7')
    #3 src/addons/DigitalPoint/Cloudflare/XF/Pub/View/SpamCleaner/CheckIps.php(26): DigitalPoint\Cloudflare\Repository\Cloudflare->addFirewallAccessRule('195.246.120.142', 'block', 'Used by spammer...', '7')
    #4 src/XF/Mvc/Renderer/AbstractRenderer.php(91): DigitalPoint\Cloudflare\XF\Pub\View\SpamCleaner\CheckIps->renderJson()
    #5 src/XF/Mvc/Renderer/Json.php(65): XF\Mvc\Renderer\AbstractRenderer->renderViewObject('XF:SpamCleaner\\...', 'public:spam_cle...', Array)
    #6 src/XF/Mvc/Dispatcher.php(460): XF\Mvc\Renderer\Json->renderView('XF:SpamCleaner\\...', 'public:spam_cle...', Array)
    #7 src/XF/Mvc/Dispatcher.php(442): XF\Mvc\Dispatcher->renderView(Object(XF\Mvc\Renderer\Json), Object(XF\Mvc\Reply\View))
    #8 src/XF/Mvc/Dispatcher.php(402): XF\Mvc\Dispatcher->renderReply(Object(XF\Mvc\Renderer\Json), Object(XF\Mvc\Reply\View))
    #9 src/XF/Mvc/Dispatcher.php(60): XF\Mvc\Dispatcher->render(Object(XF\Mvc\Reply\View), 'json')
    #10 src/XF/App.php(2352): XF\Mvc\Dispatcher->run()
    #11 src/XF.php(524): XF\App->run()
    #12 index.php(20): XF::runApp('XF\\Pub\\App')
    #13 {main}

Also the Cloudflare firewall rule addition only seems to trigger when a manual spam clean is performed, but not when a spammer is cleaned after they're picked up on registration and put in the approval queue
 
spotted another weird one

Rocket Loader is showing as enabled in dash.cloudflare.com and on addon settings page, but the settings page also says "Rocket Loader bad setting". I can turn it on and off using the addon (confirmed on dash.cloudflare.com) so i'm not sure what the bad setting might be.....
 
spotted another weird one

Rocket Loader is showing as enabled in dash.cloudflare.com and on addon settings page, but the settings page also says "Rocket Loader bad setting"
You can ignore it if you really want to use Rocket Loader. Rocket Loader is basically for sites that are poorly designed and site owners don't know how (or can't for whatever reason) re-engineer their site. Rocket Loader doesn't do anything other than try to move JavaScript around and try to load it ansyc (mostly move JavaScript from <head> to the end of <body>).

If you look at XenForo closely, it's already doing that (the only JavaScript file that normally loads in the header is the preamble because it has to). Even jquery doesn't load until the end of the page.

Long story short is that Rocket Loader can't magically make a well-designed site load faster/better, only poorly designed ones. And even then, it tends to cause problems because you are relying on computer code logic to basically rewrite your site for you on the fly. ...and XenForo is not a poorly designed site, so there's no upside (only downside to what it breaks) because XenForo is already doing what Rocket Loader is trying to do.
 
got this error when doing a manual spam cleani for the first time this morning. haven't had an opportunity to try it since.

  • Code:
    ErrorException: [E_NOTICE] Undefined index: code
    src/addons/DigitalPoint/Cloudflare/Api.php:294
    Generated by: pete
    May 23, 2022 at 9:03 AM
    
    
    Stack trace
    #0 src/addons/DigitalPoint/Cloudflare/Api.php(294): XF::handlePhpError(8, '[E_NOTICE] Unde...', '/home/thumped/p...', 294, Array)
    #1 src/addons/DigitalPoint/Cloudflare/Api.php(126): DigitalPoint\Cloudflare\Api->makeRequest('POST', 'zones/b582f5cf8...', Array)
    #2 src/addons/DigitalPoint/Cloudflare/Repository/Cloudflare.php(983): DigitalPoint\Cloudflare\Api->createFirewallAccessRule('b582f5cf8101353...', Array, 'Used by spammer...', '7')
    #3 src/addons/DigitalPoint/Cloudflare/XF/Pub/View/SpamCleaner/CheckIps.php(26): DigitalPoint\Cloudflare\Repository\Cloudflare->addFirewallAccessRule('195.246.120.142', 'block', 'Used by spammer...', '7')
    #4 src/XF/Mvc/Renderer/AbstractRenderer.php(91): DigitalPoint\Cloudflare\XF\Pub\View\SpamCleaner\CheckIps->renderJson()
    #5 src/XF/Mvc/Renderer/Json.php(65): XF\Mvc\Renderer\AbstractRenderer->renderViewObject('XF:SpamCleaner\\...', 'public:spam_cle...', Array)
    #6 src/XF/Mvc/Dispatcher.php(460): XF\Mvc\Renderer\Json->renderView('XF:SpamCleaner\\...', 'public:spam_cle...', Array)
    #7 src/XF/Mvc/Dispatcher.php(442): XF\Mvc\Dispatcher->renderView(Object(XF\Mvc\Renderer\Json), Object(XF\Mvc\Reply\View))
    #8 src/XF/Mvc/Dispatcher.php(402): XF\Mvc\Dispatcher->renderReply(Object(XF\Mvc\Renderer\Json), Object(XF\Mvc\Reply\View))
    #9 src/XF/Mvc/Dispatcher.php(60): XF\Mvc\Dispatcher->render(Object(XF\Mvc\Reply\View), 'json')
    #10 src/XF/App.php(2352): XF\Mvc\Dispatcher->run()
    #11 src/XF.php(524): XF\App->run()
    #12 index.php(20): XF::runApp('XF\\Pub\\App')
    #13 {main}

Also the Cloudflare firewall rule addition only seems to trigger when a manual spam clean is performed, but not when a spammer is cleaned after they're picked up on registration and put in the approval queue
In theory that shouldn't happen, but I suppose it could if there was some sort of network connection issue between your server and Cloudflare's API servers. Specifically, there was an error with the API call, but no error was included (which is what you would get if the error was on the API site).

I've made a change so that if that happens (network connection issue without an actual error from the API), it will log a message to the server error log about it (and include any info it might have), rather than just log the exception like that. Will still get a server error logged because you are going to want to know about it, but hopefully will have better info.

The firewall rule does intentionally only trigger with manual spam cleaning (and it defaults to not doing it, you need to check the check-box manually to do it). Seemed to me like a pretty major thing to be doing completely automatically on the backend with no confirmation. Like someone accidentally does a mass spam cleaning and a huge swath of network blocks get blocked.
 
The firewall rule does intentionally only trigger with manual spam cleaning (and it defaults to not doing it, you need to check the check-box manually to do it). Seemed to me like a pretty major thing to be doing completely automatically on the backend with no confirmation. Like someone accidentally does a mass spam cleaning and a huge swath of network blocks get blocked.
i moderate all signups, so while the account gets automatically flagged on registration, the actual act of spam cleaning is still done manually
 
Long story short is that Rocket Loader can't magically make a well-designed site load faster/better, only poorly designed ones. And even then, it tends to cause problems because you are relying on computer code logic to basically rewrite your site for you on the fly. ...and XenForo is not a poorly designed site, so there's no upside (only downside to what it breaks) because XenForo is already doing what Rocket Loader is trying to do.
yeah i'm mostly using it to improve Wordpress performance, not xF. hasn't broken anything yet (that i know of!!!)
 
i moderate all signups, so while the account gets automatically flagged on registration, the actual act of spam cleaning is still done manually
I suppose it wouldn't be terribly difficult to add it as an option. I assume you are talking about the spam clean option from the user approval queue, right?

yeah i'm mostly using it to improve Wordpress performance, not xF. hasn't broken anything yet (that i know of!!!)
Ya, like I said, that little "bad setting" note was first intended for myself (whole thing was originally designed for in-house use only) in case it accidentally got turned on. But seeing that I've seen it cause nothing but problems for people in XenForo, I'm probably going to leave it. The note is purely cosmetic though... so if Rocket Loader is working okay for you, you can just leave it on and ignore the note.
 
Back
Top Bottom