Fatal error when you Speed Booster Plugin

Posted in: Newsmag
Post count: 12

When using the Speed Booster plugin.

Anytime I add a code such is this to the td-speed-booster.php file

$this->move_js_to_footer(‘media-upload’);

I am getting this error

Fatal error: Using $this when not in object context in

Maybe I am placing the code in the wrong area.

I am following the Page Speed guide:

https://forum.tagdiv.com/page-speed-guide/

Please advise

Post count: 6600

Hi,

Please make sure you have the code formatted right. Use this line: $this->move_js_to_footer(''); like this: http://screencast.com/t/hIg2gspeAApD

Thanks

Post count: 12

Lucian, thanks for replying. I am still getting same error.

By placing the code below in the wp-content/plugins/td-speed-booster/td-speed-booster.php file

$this->move_js_to_footer(‘thickbox’);

I get this error:

Parse error: syntax error, unexpected T_VARIABLE, expecting T_FUNCTION in

I put this code under the line

var $styles_for_footer = array(); // here we keep all the stylesheets IDs that we want to move

Thanks

Post count: 6600

Hi,

Please make sure that you add it like this: http://screencast.com/t/mbDjuQ3SvdG
The error appears because you have added the move_js_function outside of the main function.
Also remove other changes you’ve made or remove and re-install the plugin from the /plugins folder that was provided with the theme files.

Thanks

Viewing 4 posts - 1 through 4 (of 4 total)
The forum ‘Newsmag’ is closed to new topics and replies.