Bug 921402

Summary: Broken plugins in WordPress
Product: OpenShift Online Reporter: Antonius Aji <iatf.itb>
Component: TemplatesAssignee: Clayton Coleman <ccoleman>
Status: CLOSED WONTFIX QA Contact: libra bugs <libra-bugs>
Severity: low Docs Contact:
Priority: high    
Version: 1.xCC: dmcphers, xtian
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-03-12 20:17:21 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
install
none
activate none

Description Antonius Aji 2013-03-14 06:55:25 UTC
Description of problem:
Some plugins for WordPress in RH Cloud is broken.

Version-Release number of selected component (if applicable):


How reproducible:
It is reproducible

Steps to Reproduce:
1. Install WordPress as in RH Cloud.
2. Install plugins such as PicasaView
3. Activate PicasaView plugin
  
Actual results:

Javascript is not properly loaded-up, hence the lightbox script does not work properly. Javascript debug console shows that the javascript.js is not correctly called i.e. at 

https://appname-space.rhcloud.com/wp-content/plugins/var/lib/openshift/513daeba4382ecd17f000045/app-root/data/plugins/picasaview/picasaview.js

Expected results:

The proper call should be:

https://appname-space.rhcloud.com/wp-content/plugins/picasaview/picasaview.js


Additional info:

The problem can be as follow:
a. Red Hat already have the folder "plugins" in ~/app-root/runtime/repo/php/wp-content as symlink to  /var/lib/openshift/513daeba4382ecd17f000045/app-root/data//plugins

b. Hence, the PicasaView plugin is installed in /var/lib/openshift/513daeba4382ecd17f000045/app-root/data//plugins

c. The problem is that the php code inside picasaview.php with many standard "__FILE__" which translates to the file name with absolute address i.e. /var/lib/openshift/513daeba4382ecd17f000045/app-root/data//plugins/picasaview/picasaview.php, and the coding create 

https://appname-space.rhcloud.com/wp-content/plugins/var/lib/openshift/513daeba4382ecd17f000045/app-root/data/plugins/picasaview/picasaview.js  -- which is broken

instead of 

https://appname-space.rhcloud.com/wp-content/plugins/picasaview/picasaview.js


d. The solution is to delete the "plugins" folder set by RH Cloud, which is symlinked to /var/lib/openshift/513daeba4382ecd17f000045/app-root/data//plugins, and create "plugins" folder without symlink. The risk will be the "plugins" folder can be erased during GIT push.

Comment 1 Wei Sun 2013-03-14 08:42:09 UTC
Created attachment 709915 [details]
install

Test this bug on Production and devenv_2933,can not reproduce it.I can install PicasaView and activate PicasaView plugin successfully.

Comment 2 Wei Sun 2013-03-14 08:42:38 UTC
Created attachment 709916 [details]
activate

Comment 3 Antonius Aji 2013-03-17 00:11:55 UTC
Wei Sun,

It is true that you can install and active PicasaView, but the plugin does not work such as its lightbox feature. And the reason for that is due to the web browser cannot download the .js script (of PicasaView) properly. I only realized that when I open the console in the browser (I use Chrome, to open the console is CTRL-SHIFT-J)

Steps to reproduce:
a. Install PicasaView plugin.
b. Activate PicasaView plugin.
c. Go to Setting -- PicasaView, and use my Picasa ID: 117520727894266469000 as User ID
d. Create a new page and put the following short-code: [picasaview album='IATFHBH2012' instantview='yes']
e. Open the Chrome browser with console active (CTRL-SHIFT-J)
f. Open the page we just created in (d), and we will see "Get Error" in the console (the first row).

I can share you the screenshot, but I don't know how.

rdgs,
aa

Comment 4 Clayton Coleman 2013-03-26 14:27:43 UTC
I think this is the HTTPS / HTTP issue with wordpress.  We may be able to address this by setting the config value for the base URL in wordpress config at start time (wouldn't work with aliases).

Comment 5 Clayton Coleman 2013-03-27 20:06:21 UTC
User can address via config (workaround) by setting the base Wordpress URL.

Comment 6 Dan McPherson 2014-03-12 20:17:21 UTC
Closing based on the workaround.  We have also updated wordpress recently.  Not sure if that helped.