• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

QUESTION Change combined js Prefix (WMAC_CACHEFILE_PREFIX)

Luu

Member
Messages
9
Likes
0
Points
1
#1
How to Change combined js Prefix?
(/wmac/js/wmac_82aec164a0b8f91254e7e223dde700f9.js")

And how the change the folder name?

I saw that here is a WMAC_CACHEFILE_PREFIX Constant, but when i set it to my choice i get the Warning that its already defined and its still use the string "wmac".
How can i set the cachefile prefix to my own string?

I set it in my functions.php but its not working.

i have the pro version
 

Temyk

Developer & Support
Messages
1,129
Likes
42
Points
48
#2
Hello.

The prefix cannot be changed. What do you need it for?
 

devrekli

New member
Messages
3
Likes
0
Points
1
#3
Hello.

The prefix cannot be changed. What do you need it for?
I was looking for this too and and i saw this thread.. prefix is the same on all sites. This is not good for SEO.. It's like a duplicate site. how can we change this? Maybe Can you add a feature like this?

define('AUTOPTIMIZE_CACHEFILE_PREFIX','name_'

thanks
 

Luu

Member
Messages
9
Likes
0
Points
1
#4
I would like to set it so that you can personalize it and not have direk conclusions on clearfy.

Can you leave users the option?
Also the name of the cache folder.
 

alexkovalev

Program developer
Staff member
Messages
267
Likes
19
Points
18
#5
I would like to set it so that you can personalize it and not have direk conclusions on clearfy.

Can you leave users the option?
Also the name of the cache folder.
You can change the prefix via the WMAC_CACHEFILE_PREFIX constant, but it must be set before the plugin is initialized. When you insert a constant in functions.php, the constant is set after the plugin is initialized.

There are two solutions, directly change the plugin files, but when updating the plugin, the changes will have to be made again.

And another solution is to create a Must Use plugin, what it is you can read here:
Must Use Plugins
WordPress MU-Plugins: What They Are + Useful Must-Use Plugins For WP Web Developers

You will need to add the WMAC_CACHEFILE_PREFIX constant to the Must Use plugin with the prefix you need. This will also be useful for other plugins if you want to redefine their constants.