can I remove this piece of code from functions.php?

Posted in: Newsmag
Post count: 62

functions.php

LINE 408-4-19

echo ‘

<!–

Theme: ‘ . TD_THEME_NAME .’ by tagDiv 2014
Version: ‘ . TD_THEME_VERSION . ‘ (rara)
Deploy mode: ‘ . TD_DEPLOY_MODE . ‘
‘ . $speed_booster . ‘
uid: ‘ . uniqid() . ‘
–>

‘;

I was wondering what the purpose of this piece of code is. Can I remove it, since I am removing all visible references to ‘newsmag’ in my theme to lower risk of getting hacked etc….

It should be very nice if there was a feature to set a new name to the theme, which would change all visible references to the new name…

Post count: 9544

You may want to read up on how to use WordPress from the WordPress Codex; you *can* simply rename the theme folder and CSS name for the theme; which is how it’s done for web development, such as for a client, or better security (we do that here, changing theme name to sitename). If you’re comfortable editing the functions.php file, then changing the theme name is done simply by editing the style.css file which is where WP picks up the theme “name.”

Note it won’t change the theme style classes so somebody can very easily “figure out” which theme you’re actually using, if not the version.

Are you removing all the versioning from your site using the commonly available code to put at bottom of functions.php? That is also recommended to hide versions of WP, and also visual composer (see my separate post on how to also hide that code).

TO THE POINT (sorry!):
You can remove that “theme credit” code from functions.php without anything breaking, but be aware it makes it harder if you ask for tech support in the future if the admin here can’t figure out which version of theme you’re using when looking at your page source to debug any of your possible problems with CSS, customizations or running plugins, etc. If you’re comfortable in remembering to always “state” which version you’re using (and keep track of that somewhere), when needing support, you should be fine. 🙂

We actually use mod_pagespeed which just removes *all* commenting for faster page loading, which is recommended if your hosting provider offers that.

You can also further optimize the install by placing the explicit paths to the new name theme folder in your functions.php folder once you’re “set in stone” (obviously if you switch to another theme from admin, it may break) and also the site name URL, but that’s a bit advanced. Research the WP Codex on how to do many things like this (some of that is in my long winded comments in the Newspaper forum under the “Pagespeed” sticky topic).

Hope that helped, versus annoyed 🙂

Post count: 62

Thank you for your detailed explanation!

I have changed all references to “divtag” and “newsmag” in files people can view easily(.css, .js, image names, folder names etc…). I have not changed references to “divtag” and “newsmag” in the admin files because it is already hidden to outsiders.

I have not changed .php, .less, .po and .mo files because I was not sure if these files could be accessed by visitors. Do you know if these files can be accessed/read by people?

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

You can try accessing those files in web browser to see if they are publicly reachable. Most will have 644 permissions so only readable by WP.

But again, all the CSS “class names” unique to tagdiv used throughout the code when printed on the page, could easily be figured out if somebody really wanted to know.

Keep in mind you will have to redo all these changes with an update to the theme (e.g., v 1.2), so normally you would not do this until you are 100% sure everything is working for you. And also be aware you might not want to change some things used by the speed booster plugin as that may break if it can’t find its pre-named pieces.

Security issues would be more likely an issue with cross-site scripting bugs, as found in WordPress 3.9.2, and the version of YOAST prior to the one releases this week. I’d worry more about staying on top of those kinds of vulnerabilities, but I suppose you’re doing that also if you’re going to be obsessive about hiding as much as possible.

There are some good tutorials on line related to hiding info about WordPress, which folder can be changed, setting up security to stop multiple login attempts, deleting the “admin” account for WP, etc.

Post count: 62

Yes I know I have to change the references everytime I update the theme, but since I’ve only changed the ‘accessible’ references I believe it is worth it 🙂

I just looked at the page source of my site and changed the visible code like .css, .js etc..

Post count: 9544

Groovy 🙂

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