Support

Home Forums Event Espresso Premium Event Espresso Plugin Update using Custom Files Add On

Event Espresso Plugin Update using Custom Files Add On

Posted: December 30, 2012 at 9:48 pm

Viewing 15 reply threads


Angelo Gianni

December 30, 2012 at 9:48 pm

Hello Team,

We are currently using Event Espresso plugin version 3.1.27.P and need to update it to 3.1.29.1.P version.

We are using Custom Files add on to place customized files of Event Espresso plugin so as it can be updated easily without any breakage in functionality on the website.

We have created the folder ‘espresso’ in the location /wp-content/uploads and have uploaded the customized templates in /wp-content/uploads/espresso/templates.

There are few hindrances that we are facing:

1) Site gives error when we include the template files in /wp-content/uploads/espresso/custom_includes.php

2) There are many other files in Event Espresso plugin which have been customized.

Do we have to keep those files also in /wp-content/uploads/espresso/templates? Or do we need to create separate and same named folders for them in /wp-content/uploads/espresso as in the plugin.

For example, the customized files in /plugins/event-espresso/includes should be placed in /wp-content/uploads/espresso/includes

Please let us know.

Regards,
Angelo


Dean

December 31, 2012 at 1:53 am

Hi Angelo,

Generally any template or gateway file can be copied over to wp-content/uploads/espresso/templates (or gateways) and can be amended there.

The Custom files add on is for added functionality, such as custom shortcodes etc.

If you have amended core files such as files such as in the includes folder then these will be overwritten on update so you need to keep a backup of them somewhere, they cannot be copied to the uploads directory, the plugin is not expecting them to be there (as they are not intended to be modified).

It is advised to not amend any files other than templates or gateways for this reason.

With any new version of Event Espresso there may be the possibility of the template, gateway and core files changing. This is a especially relevant at the moment as we start restructuring the plugin to add new features, streamline pårocesses etc in the run up to 3.2.

As such any modifications you have done will need to be compared with the new files to see what has changed and port the modifications over to the new files.


Angelo Gianni

January 1, 2013 at 4:47 am

Thank you so much for your reply.

We have moved templates to the ‘espresso’ folder.
Do we have to include these customized templates in /wp-content/uploads/espresso/custom_includes.php

The site gives error when we include the template files in /wp-content/uploads/espresso/custom_includes.php. And the template files are exactly the same which are in use in the plugin.

Please let us know.


Chris Reynolds

  • Support Staff

January 1, 2013 at 2:53 pm

@Angelo
If you have copied templates over from Event Espresso core into the /wp-content/uploads/espresso/templates directory, there is no need to include them in the custom_includes.php file. Please refer to this doc for any questions regarding template customization:
https://eventespresso.com/wiki/put-custom-templates/


Angelo Gianni

January 2, 2013 at 2:06 am

Thank you Reynolds.

In Custom files add on, we have added customized files in:
1) /uploads/espresso/templates
2) /uploads/espresso/gateways/paypal_pro/includes
3) Short code functions from /plugins/event-espresso/includes/shortcodes.php in /uploads/espresso/custom_shortcodes.php

There are some files in /plugins/event-espresso/includes/ which have been customized.

Is there any way to customize the site in the way we need it, without messing with anything in the “includes” and other folders, so that we don’t have any problem with every update?

Please let us know.


Chris Reynolds

  • Support Staff

January 2, 2013 at 10:11 am

I would advise copying your entire functions over to the custom_functions.php file and put that in your /wp-content/uploads/espresso directory. HOWEVER, be forewarned that not all functions in Event Espresso are wrapped in if ( function_exists(...) ) checks, so depending on what function you are changing, you may end up with cannot redeclare function errors, in which case the answer is no. If there are areas in the code where you’d like to see hooks added, though, so you can add your own modifications to existing hooks, let us know and we can pass that along to the developers. We’re well aware that 3.1.x does not have a lot of hooks and we’re working on that in 3.2.


Angelo Gianni

January 3, 2013 at 5:47 am

There are many hooks in includes folder for WP admin as well.
For example, in location /plugins/event-espresso/includes/admin-files/coupon-management/index.php

If we do not include this hook, WP admin section for ‘Promotional Codes’ section gets messed up. This is same for Event Management, Venue Manager and others.

There is one hook in /includes/process-registration/payment_page.php for variable ‘$simplemath’ as well. It was in previous version but not in current version 3.1.27.P.

And the website gives error (of function re-declare) if we include any of the hooked function in uploads/espresso/custom_functions.php


Angelo Gianni

January 3, 2013 at 5:54 am

Also, the Event Espresso plugin version 3.1.27.P does not work properly with its default files. We have to include code from previous version 3.1.20.P to fix many errors on the site.


Angelo Gianni

January 3, 2013 at 9:43 pm

The custom files add on supports files only in /espresso/templates folder. We added gateway files to /espresso/gateways/ and the users were not able to make payments instead of the payment page looking fine from front end perspective.

Please let us know about this.


Dean

January 4, 2013 at 8:13 am

Hello Angelo,

Event Espresso 3.1.X does not include many action hooks at all, I believe you are referring to some of the functions available in the code.

It sounds like you have made some major customisations to the core code (which we really don’t suggest), and since we do change our code on updates it is causing major issues.

My advise in this situation is to get a copy of the latest version of EE 3.1.29.1 and rework the modifications into it as needed, almost as a fresh start. I know this isn’t ideal but with the modifications you have made it sounds like it may be the easiest option all round.

I would strongly advise against using code from earlier versions of Event Espresso as this can cause security holes and unexpected behaviour.

“Also, the Event Espresso plugin version 3.1.27.P does not work properly with its default files.” I can confirm that the default version of 3.1.27 does work fine.

Regarding the gateways, if you wish to modify the PayPal gateway for instance, I would copy the entire PayPal directory from the gateways directory to wp-content/uploads/espresso/gateways/paypal and modify the code in those files. That is the standard procedure for this.


Angelo Gianni

January 5, 2013 at 11:59 am

Hi Dean – thank you – those questions were from our developing team – I fully admit to not understanding the technical aspects. But – Here’s the main issue. From the start I had asked that any modifications be done in a way that wouldn’t mess with updates. Obviously – that’s unfortunately not what happened. So – if we need to just start at the beginning – can I ask if the few things that we need can be done in a way that won’t mess with updating? There are really only two.

• 1 – we just need to courses to display different information than the EE templates display. Like at: http://fusionteachertraining.com/anatomy/ – scroll down – we need to be able to control what happens in those boxes.

• 2 – We need to be able to have our master schedule work the way it works: http://fusionteachertraining.com/masterschedule/

Again, I’m not hip to the technical scene – but I just would love to get a confirmation from EE that these two things can be done in a way that won’t cause all sorts of problems when it’s time future updates… and possibly some documentation to point our team too so that they can set it up correctly from the start this time.

Thanks so much for all of your help. Greatly appreciated.

~ Angelo


Dean

January 7, 2013 at 3:35 am

Hi Angelo,

1) Thats sort of modification will be in the event_list.php and event_list_display.php. Now these files can be copied to the wp-content/uploads/espresso/templates directory so updates won’ty over write them. However, until we introduce a “logic” free template when an update occurs, these modified files may still need to be tweaked again to be in line with the default templatets.

2) Looks like this has been made via the custom files addon which is fine. Again these need to be in the wp-content/uploads/espresso directory, and again, when the plugin is updated they may need to be updated/tweaked.

We generally advise to use a program like Diffmerge, which allows you to compare two files for differences. This will show you any changes between your modified files and the new default template files so you can see what has changed and what may need to be changed in your modified files.

This is one area we are keen on improving especially for version 3.2 as we know that having to update and tweak the template files after every update where we change something in the templates is annoying and time consuming. So please know we are aware of it and are actively looking to resolve it.


Angelo Gianni

January 7, 2013 at 6:01 am

Many thanks. So – after talking to my team – it appears that we have done the modifications in the correct way – everything is in Custom Add On folder (or wherever it’s supposed to be) – yet when we upgrade we still get errors – and the only way they can find to fix them is to add code from earlier versions – which we don’t want to do.

So – this site is live and can’t go down. Can I find out from you what my license allows- so that they can set it up on a test server to get it working – before messing with it on the live site?

thank you,
angelo


Dean

January 7, 2013 at 6:09 am

Hi Angelo,

There should be no reason to take code from previous versions, though you are correct in saying when you upgrade you get errors, this is normally due to the template files being updated.

Your licence allows you to get support and auto updates on one domain. However you can use a copy of the plugin on a development server, you just will have to do updates to it manually.


Angelo Gianni

January 8, 2013 at 12:19 am

Thank you Dean.

One more question, the WP version 3.5 has updated a function prepare() in wp-includes/wp-db.php and it now accepts two parameters instead of one.

Has the Event Espresso new version 3.1.29.1.P been updated accordingly to this? Since it uses prepare() in many files. Please let us know.


Dean

January 8, 2013 at 1:06 am

Hi,

Yes 3.1.29.1.P is WP 3.5 ready

Viewing 15 reply threads

The support post ‘Event Espresso Plugin Update using Custom Files Add On’ 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