Marcus Edensky
Marcus Edensky

Reputation: 944

Custom code in Wordpress: what are the programming limitations?

I have a website (www.easterisland.travel) that I'm considering converting into a Wordpress site. Why? Basically for the following reasons:

1: To use a CMS, so that I can teach others to further add content to the website without having programming knowledge. I would built the advanced pages myself though, and the pages that others would manage would be simple information pages.

2: Access to all of these great plugins, for example the "similar pages" plugin at the bottom of each page (which I haven't found as a independent solution for raw webpages), which is just fantastic to keep people reading.

At my site I have lots of custom stuff like booking systems that I've created. There's an AngularJS shopping cart (www.easterisland.travel/tours/), instant online booking and payment (using PayPal's Express Checkout) etc. There's a page for cruise ship shore excursions (www.easterisland.travel/cruise-ship/) that's automatically generated from database data, and I've created a system where I can add cruise ships and shore excursions (adding correct itinerary, price, info etc). Passengers can also log in and communicate to other future fellow travelers within the same group, and get organized for meeting up on the tour day. I have many more plans to go as well, for example showing hotel info, displaying TripAdvisor data (using TripAdvisor API) etc.

The million dollar questions are:

1) Can all of this be achieved in a Wordpress site? Can I add all of these systems using this platform? What are the limitations?

2) Would it make sense to change to Wordpress?

3) What implementation should be used? I don't want my code to be removed or altered when Wordpress is automatically updated.

Thank you!

Upvotes: 1

Views: 470

Answers (3)

silver
silver

Reputation: 5311

Wordpress doesn't have any limitations, you can extend its default functionality if it can't accomplish what you need with either plugins or custom code. and having a framework is always better than building from scratch in many ways.

HOWEVER, wordpress was originally design as blogging platform, and if you plan on extending its simple functionality you should take some time to understand how it works to properly integrate your custom needs or things could get ugly,

If you know how to interact with the database, you can easily do what you want, there are built-in functions you can use according to your needs for database interactions or just create your own if it doesn't fit well very much.

just a quick overview with wordpress database.

wp_posts - where sites main front-end data are stored, like posts, pages,

wp_postmeta - storage for additional data that are stored on wp_posts

wp_comments - storage for user interaction data for wp_posts like comments, I've also used these before to store user/admin messages.

wp_terms - use for dividing/categorizing wp_posts data, like categories and tags,

wp_options - use for back-end storage data and configuration.

You'd need to check out these functions as you're probably will encounter them in the future https://codex.wordpress.org/Function_Reference/add_post_meta

https://developer.wordpress.org/reference/functions/get_post_meta/

https://codex.wordpress.org/Function_Reference/update_post_meta

https://codex.wordpress.org/Function_Reference/register_post_type

https://codex.wordpress.org/Function_Reference/register_taxonomy

https://codex.wordpress.org/Class_Reference/WP_Query

If you also need database interaction, check out https://codex.wordpress.org/Class_Reference/wpdb

and for front-end implementation, check this out https://developer.wordpress.org/themes/basics/template-hierarchy/, though I never used any other wordpress theme except Genesis Framework for these past 5 years as I never had to mess too much with HTML codes and almost everything can be customize using actions & filters. I advise you to use Theme Framework (and remember to always use CHILD THEME to be safe from Main Theme upgrade)

You might also want to check -> https://github.com/WebDevStudios/CMB2 (I prefer to use this than Advance Custom Fields plugins.)

Booking system in wordpress is a bit complex, I've successfully use gravity form as booking system with AngularJS + Ajax, but never tried a custom one from scratch and don't have a chance to use booking plugin as never encountered a cleint that wants a simple booking system.

Just to answer your question.

  1. Yes, It can, for comparison, take a look at woocommerce plugin functionality and features, I believe thats more complex than what you need.

  2. It would make sense to convert a site built from scratch to any CMS (wordpress is an option), the CMS is up to you, though its better to use the one that you know more for easier integration and customization.

  3. You can use your child theme "functions.php" for extending your custom functionality, like create a folder in your theme for all your custom code and include/require it on your child theme functions.php or better create your own plugin to properly integrate them, you can divide the functionality in plugins, like plugin for booking system and plugin for payment functionality. check this out https://github.com/hlashbrooke/WordPress-Plugin-Template

I hope this would give you an idea.

Upvotes: 1

BryanT
BryanT

Reputation: 412

I have never failed to find a plug-in to do what I needed! I manage three WordPress sites - although none of them is commercial. (Yacht Club, Cycling Club and Political Party EDA).

There is a plug in that allows PHP on any WordPress page, but it means that the Editors all have to write using the text (HTML) view rather than Visual tab. I found that useful for some of my pages - and I'm the only "Editor." There's also a plug-in that allows you to code PHP in Widget. That doesn't have the above disadvantage.

Upvotes: 1

chickahoona
chickahoona

Reputation: 2034

Yes you can do all that. You will need someone with knowledge in wordpress themes and plugins but it is possible. The beauty of wordpress is, that you can write "bare" php code, and the small amount of functions to interact with wordpress are well documented.

Wordpress itself, is structured "simple" (compared to fancy tools like magento for example). So all it manages, are posts / pages / ... which, more or less derive from the same database object. You can add functionality to those things (for example, make posts cruise ships and other posts to shore excursions) or you can add your own database structure on top.

The theme system is bare php code, so you dont have to crawl through a thousand lines of xml codes to adjust little things.

Wordpress power derives from its simplicity of the "core wordpress" and the feature volume based on all those plugins. I believe alot of people would say, that you should go for a custom solution (based on symfony for example), or a CMS that already comes with more of your desired functions (like magento which has the checkout / paypal included), but I (as a wordpress fan) would see no problem to take wordpress.

Upvotes: 1

Related Questions