Functions optimization question

Posted in: Newsmag
Post count: 9544

Hi folks
this is an advanced user question (me).

Seeking to streamline overhead a little for all the theme functions we don’t use, and will never use with the theme, which are now loaded via td_wp_booster_functions.php and not main functions.php file.

For example, can I safely remove some of the elements such as

require_once('td_ads.php');       //handles background click ad
require_once('td_demo_site.php');  // the demo site
require_once('td_video_playlist_support.php'); //video playlist support
require_once('td_first_install.php');  //the code that runs on the first install of the theme
require_once('td_smart_list.php');  //the smart lists
require_once('td_login.php');  // modal window for user login

In the above list, we don’t use background ads, demo site, video playlists, smart lists, or logins; and we don’t use theme panel to install plugins/check for plugin install.

Similarly is it practical to remove the entire bottom section, since we’re not using the theme admin to manage install or nag screen for *any* plugin install, and it’s a lot of “newbie bloat” for us.

e.g., section starting with:


    /*  -----------------------------------------------------------------------------
        TGM_Plugin_Activation
     */
    require_once 'external/class-tgm-plugin-activation.php';

(etc.)

Thanks folks 🙂

Trying to optimize a little as some stuff we don’t use and never will use and is redundant/irrelevant for our use.

  • This topic was modified 11 years by simchris.
Post count: 9544

Well, that last bit I obviously can’t remove as it crashes the theme.

But curious about the rest?

Post count: 780

Hi Chris,
If possible please wait a bit more until you modify the core of the theme (2 weeks – until we deliver the next update). We plan to bring another big update to the core of the theme and after that I hope we will have a stable core for at least half a year. We are also working to bring a new api that will allow developers to build a lot of nice stuff on top of the theme.

Here is a short description:

  • the tgm plugin installer can be removed safely with the code under the require_once
  • td_ads.php can be removed
  • td_demo_site.php is used in the backend on the view that imports the content. That view will no longer work but I think the panel should work as normal.
  • td_cake.php can be removed 🙂
  • td_video_playlist_support.php + td_video_playlist_render.php – can be removed if you also delete the playlist shortcode td_block_video_youtube and td_block_video_vimeo in /includes/td_config.php – we will change this file in the next update to a new structure and I don’t have on this dev machine a old copy of the file
  • in td_first_install.php, this line should remain in the theme: http://screencast.com/t/0Wxs8cejxYiE
  • td_smart_list.php can be removed… but if you use a smart list it will give a fatal error. The part the calls the smart lists is here: http://screencast.com/t/yJoBHOMeC that should also be deleted
  • td_login.php can also be removed

If you need more information please let me know
~ Radu O.

  • This reply was modified 11 years by Radu.
  • This reply was modified 11 years by Radu.
Post count: 9544

Thanks, Radu
this is primarily for the ecommerce setup I’m working on for my main business site (pays all my bills!), which similarly I plan to put in place then not change for 6 months+ either, so timing will work well.

Chris

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