shortcode conflict with facebook.php - wordpress

I am using Wordpress to build a facebook application. The application uses a plugin for hosting a small quiz, and I used a wordpress plugin for the quiz.
However, after this I had to include a like gate for the application page, so I included facebook.php in the index page. Now the quiz plugin is no longer working.
Can anybody let me know if the facebook.php can cause conflicts with the Wordpress plugins and if yes, how can it be circumvented?

It shouldn't conflict because the Facebook PHP isn't Wordpress specific and is a self contained class, so there's unlikely to be any function naming issues etc, unless you are using a plugin to load the Facebook API? Have a look at your error logs in the site route and plugin folders.

Related

I'm trying to implement external REST APIs in my wordpress website. Can anybody have idea how to do it (whether with a plugin or with programming)

I tried to use one plugin called "WP Data Sync". I am also going through its documentation/ support for the same. I am also having wpbakery page builder in my website. So is there any way that we sync with that also?
Note - We have to sync data in the form of images, image gallery, events listing, and the blog posts.
Did you check out WP Data Syncs website at https://wpdatasync.com/ and create an account to check out an API key?
I'm not sure about all APIs, but the ones I've used in the past would require me to register with the API's website, get issued an API key and maybe even designate the key to a specific website (your WordPress site in this case) for security reasons. After that, you would then go to your WP site and setup the API there via WP DataSyncs plugin.
I hope I understood your question and that this helps.

Mixing Wordpress eCommerce site with external login based Vue Frontend Best Practices

I am new to web development and and would like advice about what is the usual best practices to achieve what I am trying to do.
I am in charge of writing a frontend app using Vue. This frontend will require a login to access the app. The app will be hosted on Amazon.
However we are also wanting to build an eCommerce site in Wordpress or equivalent that sits on the root of the website, (eg www.mywebsite.com) with the app accessible through a "sign in" button. If the user presses the sign in button we want the location bar location to not change from the website they are on (www.mywebsite.com), even though the Wordpress site and Vue frontend may be stored on different locations/domains.
If the site is made in Wordpress, we can get another developer to do that webpage for us, while I work on the frontend. However we want the experience to be relatively seamless between connecting to the wordpress root site, clicking on the sign in button and being taken to the Vue frontend.
Is this possible? Do both sites have to be hosted on the same server for it to work (eg an Amazon EC2 server which hosts two webpages, the wordpress one and the vue one)?
Or can the wordpress put a link to the Vue frontend which doesn't change the web location to the user?
Or (worst case scenario) do we need to make both webpages in Vue as one Vue application, some pages requiring login to access and others not?
Thanks kindly for any assistance.
So in order to use Vue and WordPress together, you can either write 2 separate applications. One for the Frontend and one for the Backend, which is perfectly fine or you can simply write a WordPress Application with a Vue Theme.
This is how this could look like:
WordPress Backend
You can use a normal WordPress backend, where you can build the architecture you want to. In addition, you need to set up the REST-API Wordpress provides. So this also means, just use plugins which support it. Otherwise, you would need to write custom endpoints. For example, Woocommerce would be a good e-commerce plugin, since it supports the API.
Learn more about it here: https://v2.wp-api.org/
Of course, you can host your WordPress installation on Amazon. Here is a good guide for that: https://aws.amazon.com/de/getting-started/tutorials/launch-a-wordpress-website/
Notice: The REST-API is available in core since 4.7. If you are using an older version you would need to install a plugin.
WordPress Frontend
In order to create your Frontend, I'd recommend you to make a custom theme. Since you are just serving static files this can be done pretty easy. But still, you don't need to reinvent the wheel.
There's a really good starter theme out there: https://github.com/EvanAgee/vuejs-wordpress-theme-starter
It comes with all the stuff you need to get started and since it is just a theme, you can simply set up a usual WordPress hosting without handling Domains of multiple applications.
In order to get the data from the Backend, you would simply make calls to the REST-API. Here's an example: https://github.com/EvanAgee/vuejs-wordpress-theme-starter/blob/master/src/api/index.js

WP Plugin idea/search: Selectively activate certain plugins on certain wp-admin pages

We use a lot of plugins and unfortunately can't remove more of them.
Our backend is slow.
Wordpress is built to load each plugin on every page load, also in the wp-admin backend. So even if you are on pages, where no plugin would be needed, woocommerce, contact form 7 etc. will be loaded. They put their CSS in the page but also do PHP stuff and slow everything down.
We know plugin organizer - a plugin that makes it possible to selectively load certain plugins on certain pages. They have a feature to do it on the backend - but it's a already a hell to work with it on the frontend. We use plugin logic in the frontend now.
Is there already a plugin or a hand crafted solution to select which plugins should be deactivated/activated on with wp-admin pages?
I guess it's needed to load every plugin on every wp-admin page to get the admin menu (the left side menu) - so I might be needed to built this menu and cache it somehow.
And then selectively activate plugins for certain pages.
We use custom fields - so ACF plugin has to be activated on some pages - also on some woocommercer pages. Polylang (for multilang) must be activated on a lot of pages.
But for example woocommerce doesn't need to be loaded on the event calendar pages and vis versa.
Do you know of existing solutions to lower the time needed to build the backend.
Are there any caching options?
You cannot activate/deactivate plugins individually for particular pages. Each plugin is either active or not when your site loads.
Here's something to try: In your staging environment, deactivate all of the plugins to see if that solves your problem with the slow admin menu. If it does, reactivate each plugin one by one until you find the problematic plugin. Then troubleshoot from there to determine the root of the issue.
You could also check your server's error logs to see if there are any warnings indicating issues with the site.
If that doesn't help, one final piece of advice I would offer is to contact your hosting company directly to inquire about any potential server issues that are slowing down your site's performance.

Writing blog using playframework

I have a system build using playframework 2.0. I want to have blog to run on with the system. Is there a way i can do that?, something like plugins available for use or can I use word press to do that?
Here's a blog engine for Play Framework: https://github.com/jroper/erqx.
Well you can create a new installation of wordpress, If you want to have 1 database for your playframework and wordpress then on the installation page it will ask you for a database, just enter the same database details that you have for playframework. Wordpress uses mysql so make sure you are using mysql for your playframework.
Its always better to have a different database but if you need to have some kind of integration between the two then it would be much better if you have them both on the same database.
Now in the sitename you can add something like
http://www.example.com/blog
OR
http://www.blog.example.com
Which ever you prefer. Once installed login to your wordpress admin area, install a blog theme and start creating your new blog posts. And in your main playframework website, create a new menu item and add this link to it.
I dont know of any plugins for playframework, but there is a plugin in wordpress that makes it work as an api, https://wordpress.org/plugins/json-api/. And then there is an addon to this plugin called https://github.com/mattberg/wp-json-api-auth.
You can install these 2 plugins in your wordpress and then from your playframework's registeration code make simple REST calls to the api. This will will be used to automatically register/login user's in wordpress. So when they login to playframework they will automatically get logged in to wordpress as well.

How to use wordpress to make a commerical/non blog website

I have managed to setup a blog on localhost quickly using wordpress. But what is ivolved in setting up a commercial website that is not a blog?
Also, should learning to use wordpress be more diffcult than learning Asp.Net or php? I can use these languages to create a website more quickly than using wordpress it seems. I'm guessing it should be possible to create a basic php website and then somehow hook it up to the admin functionality of wordpress to publish content and update it?
Any comments and suggestions will be appreciated.
Thanks,
A few thoughts on this.
First, Wordpress is based on PHP. So if you know your way around in PHP you are able to change anything within wordpress, you can build customized plugins, templates, etc.
However, using Wordpress has nothing to do with the programming languages you know. The fact that you are struggling with it is probably more because you don't understand yet what the features of Wordpress are or what you can use them for.
You can easily use Wordpress to create a simple non-blog website by setting up pages instead of posts. So you would be using Wordpress not as a blog engine but more as what's usually called a content management system CMS (not that using it as a blog engine wouldn't make Wordpress a CMS, but I'm talking about the general usage of those wordings).
A simple Google search might help you find more information about how to accomplish it in your specific case.
Hope this helps!
You need experience with PHP, HTML and CSS to configure WordPress to run like a non-blog website. Is it easier? Maybe, you get what you want but you won't understand what is going on.
If you are creating a static web page, say like a company's web site with little to none dynamic content, use pages (not posts) and create a static front page.
If you wish to use WordPress like a generic CMS, you can either use the Pods plugin or the newly introduced custom post types and taxonomies (new in Wordpress 3.0). You still need knowledge of PHP/MySQL to configure the Wordpress Loop (which is used to display blog posts and other dynamic content) and Wordpress Theme tags (to display name of the current logged in user).
Some plugins help with customizing the site for a non-blog look. Theme My Login and Theme my Profile blends the log-in page and profile page with your theme. However, if you need to customize the appearance, or add new logic, you pretty much need programming.
In short, you would need knowledge of PHP and MySQL; CSS too, if possible. Get your hand dirty building some sites, then what Wordpress offer and does for you with its API will be more relevant.

Resources