Support

Home Forums Event Espresso Premium Regarding Speed – My Custom CSS vs. Quick Localisation?

Regarding Speed – My Custom CSS vs. Quick Localisation?

Posted: January 30, 2015 at 10:05 am

Viewing 42 reply threads


John Fineberg

January 30, 2015 at 10:05 am

There are a few words integral to Event Espresso that are not integral to CPR-Twin Cities. For instance, we don’t sell “tickets,” we sell “registrations.” We don’t have “events,” we have “classes.” So I’ve taken to making word substitutions through Quick Localisation:

Event changes to Class List
Upcoming Events changes to Upcoming Classes
View Details changes to Click Here to Register
Available Tickets changes to Select Number of Students
Ticket changes to Registration
Tickets changes to Registrations
Ticket Details changes to Registration Details
Ticket Name and Description changes to Class Name

Well all of this substituting seems to be slowing down the loading of Event Espresso pages. So I’m wondering if these changes can be made through My Custom CSS, instead of Quick Localisation, if that would speed up the loading process any. I’m also wondering if there might be a way for EE4 to someday have a place to make changes like these within the plugin itself.


Josh

  • Support Staff

January 30, 2015 at 10:22 am

Hi John,

It turns out that My Custom CSS and Quick Localisation serve two different purposes:

My Custom CSS allows for changing CSS, which controls the layout and colors of your website.

Quick Localization allows for changing text strings by means of translation functions. My Custom CSS does not have the ability to change text strings by means of translation functions.

Two other options (use poedit or use a custom function) that may be more performant than using the Quick Localization plugin are outlined in this guide:

https://eventespresso.com/wiki/how-to-change-wording-with-poedit/


John Fineberg

January 30, 2015 at 7:25 pm

Thank you, Josh. Quick Localization certainly looks easier for making changes in wording than POedit.

I don’t recognize the word “performant.” Are you saying that POedit outperforms, and, therefore, will load faster than Quick Localization?

I guess the next question is, does POedit outperform Quick Localization sufficiently to make it worthwhile in making the extra editing effort? No sense in doing it unless my website visitors will notice a difference.


Tony

  • Support Staff

January 31, 2015 at 10:46 am

I guess the next question is, does POedit outperform Quick Localization sufficiently to make it worthwhile in making the extra editing effort? No sense in doing it unless my website visitors will notice a difference.

The difference will likely be minimal. However, the more time you put into the small improvements, the bigger the overall improvement on your site will be.

If you are going to use PO/MO files, I do have another suggestion although it is similar to POEdit. There is a plugin called Loco Translate which builds the PO/MO files for you, but also allows you to edit translations within the dashboard, so you get the best of both worlds.


John Fineberg

January 31, 2015 at 11:31 am

Thank you, Tony. I just downloaded and installed Loco Translate. When I chose Event Espresso, I got this message:

“Can not run multiple versions of Event Espresso! Please deactivate one of the versions.”

While I do have the core EE4 installed, I also have Events Table View Template (EE4.4.9+) installed and activated, and I have Event Espresso – Calendar (EE 4.3+) installed, but not activated. I’m guessing that it is seeing that as three separate versions of Event Espresso.

The difference will likely be minimal. However, the more time you put into the small improvements, the bigger the overall improvement on your site will be.

I can totally appreciate what you’re saying here. But I’m trying to shave off seconds from load times. So, to be clear, are we just talking milliseconds when we’re talking about how much time it takes a plugin like Quick Localisation to replace a handful of words? If so, maybe I should be looking at more productive ways to produce that effect.


Tony

  • Support Staff

January 31, 2015 at 12:06 pm

So, to be clear, are we just talking milliseconds when we’re talking about how much time it takes a plugin like Quick Localisation to replace a handful of words?

Hmm, I’m not entirely sure just how much of an improvement it would be, I do not think it would be significant. So likely milliseconds, but I could be wrong.

You could try using something like P3 Profiler and running it with Quick Localization enabled and disabled, then compare. If the difference is significant then it would be worth trying the other method, although again, you may not notice a difference, its hard to say.

I would like to note it is easy to get, for lack of a better word, addicted to these kinds of tools. Spending hours upon hours trying to get everything as optimized as possible, only to find that your again, shaving milliseconds. So take note of the results, but be aware that lots of things can effect performance, the type of server you are using, the load that server is under from others (shared hosting especially), the location of your server relative to your visitor etc.

I’m investigating the error you mentioned above.


John Fineberg

January 31, 2015 at 12:29 pm

Excellent analysis and perspective on this subject. “Addicted” is a good choice of words. So is “obsessed.” I just know that many people are so impatient, they’re likely to bail out of a website if they have to wait a couple of seconds for a page to load. It’s amazing how impatient people have gotten!

Funny, I was just running P3 Profiler when your message came in. I don’t know if these numbers will mean much, but here’s what I got (which changes slightly every time I run it):

Total Plugins: 17 (currently active)
Plugin Load Time: 1.675 (sec. per visit)
Plugin Impact 71.6% (of page load time)
MySQL Queries: 50 per visit

The pie chart looks like Event Espresso is accounting for 65% of the plugin run time (or 1.0859 seconds). Quick Localisation is accounting for 30% (or 0.5042 seconds). And “other” is accounting for 5% (or 0.0848 seconds). I don’t know what would be considered normal. Does any of this help in determining if I’m quibbling about something insignificant?

I’m investigating the error you mentioned above.

Thank you.


Tony

  • Support Staff

January 31, 2015 at 12:44 pm

Event Espresso does a so much more than most plugins, there is a huge amount of information within EE, so its expected that it will show as taking longer than other plugins.

What kind of hosting are you using?


John Fineberg

January 31, 2015 at 1:09 pm

I’m on a shared server at Bluehost.

Yes, I expected that EE would account for a majority of the loading time. As an experiment, I just deactivated Quick Localisation, and here are the results:

Total Plugins: 16 (currently active)
Plugin Load Time: 0.823 (sec. per visit)
Plugin Impact: 64.4% (of page load time)
MySQL Queries: 47 per visit

EE is now accounting for 91% of the load time (0.7447 seconds), and other is 9% of load time (0.0781 seconds).

Am I interpreting this correctly, is it twice as fast without QL installed? If so, maybe I just live with the inappropriate words (“tickets” instead of “registrations,” “events” instead of “classes,” and so forth). There are several wording differences in my QL list, that really make the registration process simpler and clearer for a business like mine, that holds classes, not concerts and such. Sure wish there wasn’t a time tradeoff. Sure wish some effort could go into making EE4 more flexible in such wording changes within the plugin itself (changes that would survive a version update).


Tony

  • Support Staff

January 31, 2015 at 1:41 pm

Sure wish some effort could go into making EE4 more flexible in such wording changes within the plugin itself (changes that would survive a version update).

How would you prefer we do this other than allowing translations?

We do spend a lot of time/effort in making sure the strings within EE can all be translated to allow for this. If there are strings that can not be done just let us know where they are and we will include those.

From your results I ran a few tests on one of me test sites and it does appear that the Quick Localization plugin increases the load time dramatically.

So I switched languages on that site (EE automatically sideloads the MO file for that language when you do) and re-ran the tests. This resulted in slightly longer loading times than without translations, but not as dramatic as QL, so if you do want to change the strings, I would recommend using the PO/MO file method.

I have created a ticket for us to investigate this further.


John Fineberg

January 31, 2015 at 2:04 pm

Sorry if I offended you. Certainly didn’t mean to do so. I have no idea how complicated it is to create, without utilizing supplemental plugins. But this is the one area that I’d love to see that ability to change the wording listed in my original post (see the top of this discussion). Most, if not all, of the substitutions make it more understandable for my potential customers to understand what they need to do to sign up for a class. If they get a bit confused, a bit scared, I lose them. So I try to incorporate what I’ve learned about spoon-feeding them what they need to do to get registered. Again, Tony, I certainly didn’t mean to offend you. You’ve been a great resource for me!

In the meantime, I’ll see if I can figure out how to use the PO/MO file method.


Tony

  • Support Staff

January 31, 2015 at 2:34 pm

Apologies John, I took no offence and I’m sorry if it come across that way.

It took me re-reading my reply a few times but I can see how you could think I did, just poor choice of phrasing on my part.

What I meant was I’m unsure how else we could provide a way of changing the phrasing to suit multiple use cases other than allowing translations?

We could have (for example) a ‘ticket mode’ and a ‘class mode’ but then again that doesn’t suit all use cases and just shifts the problem to another use case. So we find the best way is to go with generic phrasing as much as we can, and allow the strings to be translated to suit whichever use case you may need.


John Fineberg

January 31, 2015 at 2:40 pm

Thank you again. I know we’re on the same side. Glad to see we’re okay.

I just downloaded POEdit. Let’s see how far I can get on my own without asking for help. 😉


Dean

February 2, 2015 at 2:09 am

John, if you get stuck please just reach out to us. We are here to help.

That being said, Poedit is pretty straight forward yo use, but here’s a guide just in case: https://eventespresso.com/wiki/how-to-change-wording-with-poedit/


John Fineberg

February 2, 2015 at 8:04 am

Thank you, Dean. Hopefully, I’m going to find time to give it a try sometime today.


John Fineberg

February 2, 2015 at 2:08 pm

Well, I decided to try out Loco Translate. No idea if I did it correctly, but I do have a file now called “event-espresso-core-reg.pot.po” that’s now on my computer. What’s the next step in uploading it to my website? Where should it be placed?


John Fineberg

February 2, 2015 at 4:06 pm

I’ve been digging around Loco Translate for general instructions. You know, words that tell you how to use the product. So far I haven’t come across any words that a non-programmer/non-developer would understand.

Just curious, what’s the name of the file that holds all of the EE4 words and phrases I might want to change? How difficult would it be for me to download that file through FTP and make changes in TextEdit, then upload the file back? If I did a search of the words and phrases, replacing them with my preferred choices (being extremely careful, of course, to not lose any coding along the way), maybe, just maybe, that would be the best course of action for me. No extra plugins to deal with and slow down loading speeds.

As long as I keep a copy of the original file, I wonder how much trouble I could get myself into. (grin!)


Sidney Harrell

February 2, 2015 at 8:04 pm

So Loco Translate should have produced the .po file. You’ll want to then open up that .po file in PoEdit. Once you have finished your translation work in poedit, you will use poedit to export a .mo file (machine object). That is a binary file that you will not be able to edit, but when you place it onto your site, WP will pick it up and use it for the actual translation work.


John Fineberg

February 2, 2015 at 8:42 pm

Thanks, Sidney. Maybe you missed my most recent entry. I already created a .po file with Loco Translate. I have no idea if I did that correctly, as they don’t believe in posting instructions. So I just guessed.

Now back to my most recent question:

Just curious, what’s the name of the file that holds all of the EE4 words and phrases I might want to change? How difficult would it be for me to download that file through FTP and make changes in TextEdit, then upload the file back?

If I don’t need to use Loco Translate and PoEdit, isn’t that ultimately easier than learning to use two more plugins? And wouldn’t the pages load faster if they didn’t have to replace words every time the pages are opened?

As it turns out, Quick Localisation wasn’t quick at all. Yes, it was quick to figure out and use, but it doubled the loading time of my pages. Seriously, doubled it.

So if you’d just direct me to the source, I’d like to try editing there. And if it turns out that’s not possible, then maybe I’ll try the Loco Translate -> PoEdit route.


Dean

February 3, 2015 at 2:52 am

Hi John,

You can of course edit the terminology directly at source though I strongly advise to not to, as it will become a manual job every time you update the plugin.

Now, there are a lot of instances of the phrases Registration and Events, so giving you a list of where to find them is virtually impossible.

There are 5934 translatable strings in EE, and trying to separate out the translatable word “event” from the generally used word event is difficult. Your best option would be to use Poedit to find them as it just searches the strings and note down the location accordingly.

I’d like to offer you a different solution than manually doing it.

It does involve a plugin but it is fairly lightweight, but does involve editing some code.

Create a Site Specific functions plugin – it’s really quite easy, we have instructions here: https://eventespresso.com/wiki/create-site-specific-plugin-wordpress-site/

Add the following to the site specific plugin:

function mycustom_filter_gettext( $translated, $original, $domain ) {
 
    // This is an array of original strings
    // and what they should be replaced with
    $strings = array(
        'Register' => 'Sign up',
        'Confirm and go to payment page' => 'Complete registration',
        'No events available...' => 'No upcoming classes at this time...',
        // Add some more strings here
    );
 
    // See if the current string is in the $strings array
    // If so, replace its translation
    if ( isset( $strings[$original] ) ) {
        // This accomplishes the same thing as __()
        // but without running it through the filter again
        $translations = get_translations_for_domain( $domain );
        $translated = $translations->translate( $strings[$original] );
    }
 
    return $translated;
}
 
add_filter( 'gettext', 'mycustom_filter_gettext', 10, 3 );

If you read through the code, it should be fairly straightforward. You add in what you want to change and then what it will become:

‘Register’ becomes ‘Sign up’

Just follow the structure and don’t forget the commas at the end of each and you should be fine.

The plugin itself uses gettext like every other translation plugin, but it has 0 overhead (no settings, extra files etc), so while it will still increase load time as it processes the gettext, it should be less of an effect than other plugins.

https://eventespresso.com/wiki/how-to-change-wording-with-poedit/#custom-function


John Fineberg

February 3, 2015 at 7:22 am

You make a great case for trying this approach, Dean. Thank you for creating a template for me to follow. I’ll give it a try when I am able.


John Fineberg

February 5, 2015 at 9:00 am

Okay, I need more help here. Following these instructions:

https://eventespresso.com/wiki/create-site-specific-plugin-wordpress-site/

I’ve created a folder within public_html => wp_content. And in a file inside that folder I’ve added this code:

<?php
/*
Plugin Name: Site plugin for aslan-editing-plugin
Description: Site specific code for cpr-twincities.com
*/
/* Begin Adding Functions Below This Line; Do not include an opening PHP tag as this sample code already includes one! */

/* Stop Adding Functions */

I saved the file edit. Then I went to my WP dashboard, clicked on Plugins => Editor, then clicked on the box in the upper right corner to look for my new plugin. But it’s not there. So there must be at least one more step in between saving the file and looking for it in the dashboard. What would that be?

By the way, regarding step 6b, I don’t know if I need to get any file permissions from my web host, but I did get a “success” sign when I edited the file.

And one more question, regarding the code Dean provided me above. Does that go into the file on my web host that I just created, or does it go into the plugin on my WP dashboard? Right now I have it edited with some of the changes I want to make, but it’s just in a TextEdit file on my Mac.


Sidney Harrell

February 5, 2015 at 11:10 am

You really don’t want to use the Plugins=>Editor.
It’s not a very good editor, but the real problem is that if you enter a php error into the code that you are editing on an active plugin and save it, the site crashes and you don’t have access to that editor through the site anymore. It’s a much better practice to edit the files over ftp, that way if you make the same error, you still have access to the editor, and can reverse your mistake.
Poedit isn’t a WP plugin, it’s a local program on your computer. You just use it to edit the po file and to produce the mo file. That’s why it’s much faster that the Quick Localisation plugin. You have to upload the generated mo file up to your WordPress installation. WP uses php’s native libraries for translation (http://php.net/manual/en/book.gettext.php) and uses the mo file as compiled code.


John Fineberg

February 5, 2015 at 11:15 am

So, you’re advising me against what Dean advised me to do? How am I to resolve that conflict in advice?


Sidney Harrell

February 5, 2015 at 11:22 am

Oh, no, I would follow Dean’s advice. I would just never use the built in editor in WP for anything, plugins or themes. Only use your local editor, TextEdit, and then upload the edited file to your site’s installation over ftp.
If you were to use the WP built-in editor and make a mistake, forget one semi-colon, then you would end up having to edit the file in ftp, anyways, just to get the site back up and get back to the WP built-in editor.


John Fineberg

February 5, 2015 at 11:29 am

So, if you read my post, you’d know that I was working in a TextEdit file. Now, back to my questions, if you could answer them I’d appreciate it.

Here’s what I prepared to add, based on Dean’s advice:

function mycustom_filter_gettext( $translated, $original, $domain ) {

// This is an array of original strings
// and what they should be replaced with
$strings = array(
‘Event’ => ‘Class’,
‘Events’ => ‘Classes’,
‘Ticket’ => ‘Registration’,
‘Tickets’ => ‘Registrations’,
// Add some more strings here
);

// See if the current string is in the $strings array
// If so, replace its translation
if ( isset( $strings[$original] ) ) {
// This accomplishes the same thing as __()
// but without running it through the filter again
$translations = get_translations_for_domain( $domain );
$translated = $translations->translate( $strings[$original] );
}

return $translated;
}

add_filter( ‘gettext’, ‘mycustom_filter_gettext’, 10, 3 );

Essentially, I want to change four words. Maybe more later, but just four basic words. Two words, really, with singular and plural versions. And I don’t want to learn a new program or do anything extraordinary. I just want to substitute a few words. And I don’t want to use anything like Quick Localisation, makes the website un-quick. So where does that code belong, and how does it get to where it belongs?

Sidney, you might want to re-read my question before answering.


Sidney Harrell

February 5, 2015 at 11:40 am

oh, I see, you put the custom plugin file in wp-content, instead of wp-content/plugins.
Yes, add that code into the custom plugin file, upload it to the site, and it should show up in the plugins list.
Sorry, whenever I see someone mention the Plugins=>Editor it’s a big red flag. Worst feature about WP.


John Fineberg

February 5, 2015 at 11:55 am

Okay, I have an uploaded file inside a folder, which is inside wp-content/plugins. Now, how do I get it to show up in my WP dashboard plugins list?


John Fineberg

February 5, 2015 at 9:07 pm

Seriously, what’s the next step?


Sidney Harrell

February 5, 2015 at 9:41 pm

Before you can put any code into a custom functions plugin, you will need to get your custom plugin recognized by WP by following the standards here: http://codex.wordpress.org/Writing_a_Plugin#Standard_Plugin_Information

but I’m really afraid we may be talking at cross-purposes here. We need to get your custom functions plugin recognized so that you can insert your custom code so that you can get this gettext function working to get your site to translate these four strings. That may be completely accurate, or not, I just want to make sure we are on the same page here.


Lorenzo Orlando Caum

  • Support Staff

February 5, 2015 at 9:48 pm

Hi John, the coding snippet that you shared isn’t going to work as you expect.

You are likely wanting it to change the word “event” to “class” and so forth. However, the gettext filter will only do that if the word is by itself so the following would be changed:

event

…however, the word event in the following statement would not be changed using the coding that you shared.

I look forward to seeing you at my event.

Download this plugin and install it through WordPress admin –> Plugins –> Add New –> Upload:

http://cl.ly/0B0x1n0T3p3p/download/cprtwincities-sitespecificplugin.zip

You can see the messaging/verbiage that it will change here:

https://gist.github.com/lorenzocaum/b4bbd1bb839a1c80b2b4

Thanks


Lorenzo


John Fineberg

February 5, 2015 at 9:55 pm

I asked for help in getting EE to say things differently. I asked to change “tickets” to something that would work for my business, like “registrations” for classes. I don’t hold “events.” I hold “classes.” Thus I need wording changes.

I was told it was going to be simple:

https://eventespresso.com/wiki/create-site-specific-plugin-wordpress-site/

But what I’m being told now is in no way simple.

If you’d like to help, please go back to the beginning on this forum and read what’s already been covered before responding again.


John Fineberg

February 5, 2015 at 10:32 pm

Thank you, Lorenzo. I was in the middle of sending Sidney a reply when your followup came in.

I added the plugin you sent me, though the name of what showed up in my WP plugins looks like the plugin I was trying to enter earlier:

Site plugin for aslan-editing-plugin
Deactivate | Edit
Site specific code for cpr-twincities.com

So is this yours or mine?

Whichever it is, it still says:

Upcoming Events

where I want it to say:

Upcoming Classes

Here’s an example:

http://www.cpr-twincities.com/community/cpr

On this page, http://www.cpr-twincities.com/events/adult-pediatric-adult-child-infant-cpraed-2, it also says:

Event Location

rather than

Class Location

It also says:

This ticket is required and must be purchased.

But I’d like it to say:

Class registration is required and must be purchased.

Below that, however, the next line is just as I’d like it:

Please note that a maximum number of 3 registrations can be purchased for this class per order.

On this page, http://www.cpr-twincities.com/register, I’d like it to say

Class Name and Description

instead of:

Registration Name and Description

I’m hoping that this very specific feedback will help you to understand what I’m attempting to do.


Sidney Harrell

February 5, 2015 at 10:33 pm

It’s probably a very simple thing if we are on the same page, but I think we might be out of phase a little bit, talking cross purposes.
WordPress picks up plugins by looking at the leading comments in any file, or any file in a folder, in the wp-contents folder, looking for comments leading in any file with that proper format according to that document I referenced earlier. You can prove it to yourself by playing around with the comment sections of the plugins on your site.
There may be other ways of injecting custom code into your site other than this, but I don’t think there are any simpler ways.


John Fineberg

February 5, 2015 at 10:46 pm

Sidney, I don’t know how we could be talking “cross purposes.” Once again, I ask you to start at the beginning of this forum. And, once you’ve done that, I think you’ll see that my purpose has not changed. How you’re interpreting that purpose, that intent, that desire, however, I can’t control. So, for that reason, yes, we probably are talking “cross purposes.” We absolutely need to be on the same page if you’re going to be successful in helping here. And it’s quite clear that we’re not at all on the same page.

Regarding your statement that you don’t think that there are “simpler ways” to replace words, perhaps you’ve never used Quick Localisation. If you had, you’d know that it will do what I want it to do. It just doubles the loading time of each translated page.

I’m hoping that one of the EE veterans will jump in and help sort this out.


John Fineberg

February 6, 2015 at 2:38 pm

Any high-level EE folks available to help me here? There’s been some progress, but I’ve been getting too much conflicting advice, which makes me lose my patience. I sure would like to solve this problem, so I can go back to work running the rest of my one-person business.


hoffman

February 6, 2015 at 3:59 pm

Hi

I came across this post because I have also found that many of the standard wording in EE isn’t right for some clients.The tracking down and adjustment is a little long-winded some of which involves adding code. I used a different WP online booking plugin recently and it had a ‘translation’ section which simply allowed you to map all of the various strings used in the plugin to whatever you chose. It was a straightforward solution which worked perfectly. EE needs something like this in a future version.


Sidney Harrell

February 7, 2015 at 7:49 pm

Hi hoffinst,
The problem with any wp-admin interface for translations is that it will use the database to store the mapping, from the default string, to the translated string. I believe the point of this thread was to get the mapping, but without the speed penalty of doing a database lookup. The only way to do that is with code on the server. Either with a mo file, or with a piece of custom code. I believe we are stuck on how to add that custom code. Many people in the WP community would, at this point, have told you to add the code to your theme’s functions.php file, since it would be the easiest way to clear your problem. However, the next time you update that theme, it would wipe out the code that you added to it. It’s for that reason that we recommend creating a site-specific plugin, specifically to have a place to add code that is specific to that site, that you do not want to have overwritten in an update to any plugin or theme. If there are any inaccuracies in the documentation on how to create a site-specific plugin that were referenced early in the thread, then please let us know and we will be happy to correct them.

  • This reply was modified 9 years, 9 months ago by Sidney Harrell. Reason: typo


John Fineberg

February 12, 2015 at 10:45 am

I’m still trying to get this accomplished. I just edited the text of what I think Lorenzo created for me, and added that to the plugin that he also created for me. I’ll post it below:

<?php
/*
Plugin Name: Site plugin for aslan-editing-plugin
Description: Site specific code for cpr-twincities.com
*/
/* Begin Adding Functions Below This Line; Do not include an opening PHP tag as this sample code already includes one! */

//* Change messaging for ticket to registration
function ee_change_ticket_messaging_registration( $translated, $original, $domain ) {

$strings = array(
‘Available Tickets’ => ‘Available Registrations’,
‘ / ticket’ => ‘ / registration’,
‘Ticket Details’ => ‘Registration Details’,
‘Event’ => ‘Class’,
‘Events’ => ‘Classes’,
‘Upcoming Events’ => ‘Upcoming Classes’,
‘Event Location’ => ‘Class Location’,
‘Ticket’ => ‘Registration’,
‘Available Tickets’ => ‘’,
‘Tickets’ => ‘Registrations’,
‘Ticket Sale Dates’ => ‘Registration Sale Dates’,
‘This ticket is required and must be purchased.’ => ‘Class registration is required and must be purchased.’,
‘Please note that a maximum number of %d tickets can be purchased for this event per order.’ => ‘Please note that a maximum number of %d registrations can be purchased for this class per order.’,
‘The dates when this ticket is available for purchase.’ => ‘The dates when this registration is available for purchase.’,
‘This ticket allows access to the following event dates and times. “Remaining” shows the number of this ticket type left:’ => ‘This registration allows access to the following class dates and times. “Remaining” shows the number of this registration type left:’,
‘This Ticket<br/>Sold’ => ‘This Registration<br/>Sold’,
‘This Ticket<br/>Left’ => ‘This Registration<br/>Left’,
‘Total Tickets<br/>Sold’ => ‘Total Registrations<br/>Sold’,
‘You need to select a ticket quantity before you can proceed.’ => ‘You need to select a quantity before you can proceed.’,
‘No tickets were added for the event.’ => ‘No registrations were added for the class.’,
‘Ticket Name and Description’ => ‘Class Name and Description’,
‘The following checkboxes allow you to use the above information for only the selected additional tickets/attendees.’ => ‘The following checkboxes allow you to use the above information for only the selected additional registrants/attendees.’,
);

if ( isset( $strings[$original] ) ) {
$translations = get_translations_for_domain( $domain );
$translated = $translations->translate( $strings[$original] );
}

return $translated;
}

add_filter( ‘gettext’, ‘ee_change_ticket_messaging_registration’, 10, 3 );

//* Additional changes to messaging for ticket to registration
add_action( ‘FHEE__ticket_selector_chart_template__ticket_details_price_breakdown_heading’, ‘ee_additional_change_ticket_messaging_registration_a’ );
function ee_additional_change_ticket_messaging_registration_a() {

return ‘Registration Price Breakdown’;
}

//* Additional changes to messaging for ticket to registration
add_action( ‘FHEE__ticket_selector_chart_template__ticket_details_event_access_message’, ‘ee_additional_change_ticket_messaging_registration_b’ );
function ee_additional_change_ticket_messaging_registration_b() {

return ‘This registration allows access to the following class dates and times.’;
}

//* Additional changes to messaging for ticket to registration
add_action( ‘FHEE__registration_page_attendee_information__attendee_info_not_required_pg’, ‘ee_additional_change_ticket_messaging_registration_c’ );
function ee_additional_change_ticket_messaging_registration_c() {

return ‘This registration type does not require any information for additional attendees, so attendee #1\’s information will be used for registration purposes.’;
}

//* Additional changes to messaging for ticket to registration
add_action( ‘FHEE__registration_page_attendee_information__auto_copy_attendee_pg’, ‘ee_additional_change_ticket_messaging_registration_d’ );
function ee_additional_change_ticket_messaging_registration_d() {

return ‘The above information will be used for any additional registrants/attendees.’;
}

//* Additional changes to messaging for ticket to registration
add_action( ‘FHEE__ticket_selector_chart_template__ticket_details_total_price’, ‘ee_additional_change_ticket_messaging_registration_e’ );
function ee_additional_change_ticket_messaging_registration_e() {

return ‘Total Price’;
}

/* Stop Adding Functions */

I changed the text within the plugin, then clicked the button to update it. But this is the resulting fatal error message I got:

This plugin has been deactivated because your changes resulted in a fatal error.
Parse error: syntax error, unexpected ‘Events’’ (T_STRING), expecting ‘)’ in /home6/cprtwinc/public_html/wp-content/plugins/cprtwincities-sitespecificplugin.php_/cprtwincities-sitespecificplugin.php on line 17

Could it be because I tried this?

‘Available Tickets’ => ‘’,

Here’s a sample page of where you see these words:

http://www.cpr-twincities.com/events/bls-cpraed-for-pro-rescuers-health-care-providers-3

The original line was “Available Tickets,” which I already changed to “Available Registrations.” But what I’m trying to do here is eliminate this line altogether.

Ultimately, I really don’t care what words are used on the back end. I only care about what site visitors see, so they really understand what’s going on.

I suspect that the code needs to be changed on the server, not conveniently my dashboard. If so, please tell me where to find the file. And can I do it without an editing tool other than TextEdit?


John Fineberg

February 12, 2015 at 5:32 pm

Would somebody please tell me what the syntax error is and how to fix it!!! So we’re both on the same page, here is a current copy of what I have in my plugin:

<?php
/*
Plugin Name: Site plugin for aslan-editing-plugin
Description: Site specific code for cpr-twincities.com
*/
/* Begin Adding Functions Below This Line; Do not include an opening PHP tag as this sample code already includes one! */

//* Change messaging for ticket to registration
function ee_change_ticket_messaging_registration( $translated, $original, $domain ) {

$strings = array(
‘Available Tickets’ => ‘Available Registrations’,
‘Ticket Details’ => ‘Registration Details’,
‘Event’ => ‘Class’,
‘Events’ => ‘Classes’,
‘Upcoming Events’ => ‘Upcoming Classes’,
‘Event Location’ => ‘Class Location’,
‘Ticket’ => ‘Registration’,
‘Ticket’ => ‘Registration’,
‘Tickets’ => ‘Registrations’,
‘Ticket Sale Dates’ => ‘Registration Sale Dates’,
‘This ticket is required and must be purchased.’ => ‘Class registration is required and must be purchased.’,
‘Please note that a maximum number of %d tickets can be purchased for this event per order.’ => ‘Please note that a maximum number of %d registrations can be purchased for this class per order.’,
‘The dates when this ticket is available for purchase.’ => ‘The dates when this registration is available for purchase.’,
‘This ticket allows access to the following event dates and times. “Remaining” shows the number of this ticket type left:’ => ‘This registration allows access to the following class dates and times. “Remaining” shows the number of this registration type left:’,
‘This Ticket<br/>Sold’ => ‘This Registration<br/>Sold’,
‘This Ticket<br/>Left’ => ‘This Registration<br/>Left’,
‘Total Tickets<br/>Sold’ => ‘Total Registrations<br/>Sold’,
‘You need to select a ticket quantity before you can proceed.’ => ‘You need to select a quantity before you can proceed.’,
‘No tickets were added for the event.’ => ‘No registrations were added for the class.’,
‘Ticket Name and Description’ => ‘Class Name and Description’,
‘The following checkboxes allow you to use the above information for only the selected additional tickets/attendees.’ => ‘The following checkboxes allow you to use the above information for only the selected additional registrants/attendees.’,
);

if ( isset( $strings[$original] ) ) {
$translations = get_translations_for_domain( $domain );
$translated = $translations->translate( $strings[$original] );
}

return $translated;
}

add_filter( ‘gettext’, ‘ee_change_ticket_messaging_registration’, 10, 3 );

//* Additional changes to messaging for ticket to registration
add_action( ‘FHEE__ticket_selector_chart_template__ticket_details_price_breakdown_heading’, ‘ee_additional_change_ticket_messaging_registration_a’ );
function ee_additional_change_ticket_messaging_registration_a() {

return ‘Registration Price Breakdown’;
}

//* Additional changes to messaging for ticket to registration
add_action( ‘FHEE__ticket_selector_chart_template__ticket_details_event_access_message’, ‘ee_additional_change_ticket_messaging_registration_b’ );
function ee_additional_change_ticket_messaging_registration_b() {

return ‘This registration allows access to the following class dates and times.’;
}

//* Additional changes to messaging for ticket to registration
add_action( ‘FHEE__registration_page_attendee_information__attendee_info_not_required_pg’, ‘ee_additional_change_ticket_messaging_registration_c’ );
function ee_additional_change_ticket_messaging_registration_c() {

return ‘This registration type does not require any information for additional attendees, so attendee #1\’s information will be used for registration purposes.’;
}

//* Additional changes to messaging for ticket to registration
add_action( ‘FHEE__registration_page_attendee_information__auto_copy_attendee_pg’, ‘ee_additional_change_ticket_messaging_registration_d’ );
function ee_additional_change_ticket_messaging_registration_d() {

return ‘The above information will be used for any additional registrants/attendees.’;
}

//* Additional changes to messaging for ticket to registration
add_action( ‘FHEE__ticket_selector_chart_template__ticket_details_total_price’, ‘ee_additional_change_ticket_messaging_registration_e’ );
function ee_additional_change_ticket_messaging_registration_e() {

return ‘Total Price’;
}

/* Stop Adding Functions */


Tony

  • Support Staff

February 12, 2015 at 5:43 pm

How are you adding that code currently?

I looks like your editor is styling the quotes… so

‘Event’ => ‘Class’,

as opposed to:

'Event' => 'Class',

So is seems ‘Class’ is being considered as a class declaration.

Try using the code here:

https://gist.github.com/Pebblo/fe477d573ab2dbda686d

Although this will depend on how you are adding the code to plugin currently?


John Fineberg

February 12, 2015 at 6:03 pm

Hi, Tony. Thanks for your response.

Funny, I was thinking that the quotes might be the problem, so I went through the whole thing and made sure that they were all regular, not “smart.” Isn’t that the way they appear in what I posted?

I’ve been adding all this code into the WP plugin that Lorenzo created for me. I get the error message when I go to re-activate the plugin.

Okay, here goes with your edit … And it appears that it’s been accepted by the WordPress gods. I don’t know what magic you used, but it seems to have worked.

No, wait a minute. It seems to have broken something, as “View Details” takes me to a “Not Found” page: “Apologies, but the page you requested could not be found. Perhaps searching will help.”

I’m going to deactivate the plugin until you get a chance to look through the code, if you don’t mind.

Nope, deactivating it didn’t get it back. Maybe you’ll be able to see it here:

http://www.cpr-twincities.com/classes/bls-cpraed-for-pro-rescuers-health-care-providers-3


John Fineberg

February 12, 2015 at 8:24 pm

I have no idea why, but on my laptop computer, everything’s just fine. Apparently, even though I emptied the cache on my desktop computer through WP Super Cache (several times) it still appeared broken. But, clearly, something bad was still hanging on in my desktop, no matter how many times I emptied the cache.

So now — after two weeks of back-and-forth communications between us — it appears that all’s well in WordPressLand.

Thank you for all of your help!

Viewing 42 reply threads

The support post ‘Regarding Speed – My Custom CSS vs. Quick Localisation?’ is closed to new replies.

Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.

Event Espresso