Categories

Meta

With the introduction of PHP5 we now get the opportunity to use PHP as an Object Oriented Programming Language. What this means is, and in a very short way, that we can now have a more reliable, faster and safer way to program in PHP.

Abstraction – Allows the programmer to declare abstract methods that can be instantiated in a class and declared by an object.

Encapsulation – Gives us the ability to protect which ever data, inside a class, by using protected methods like private classes ou functions.

Inheritance – We can now create tree like class structure where the lower levels on the tree are childes of the level above. (in this Logging example we’re going to be using this methodology)

Polymorphism – Using this feature we’re able to declare a given class and use his children methods even tho we have declared parent class without the need to redeclare them.

First of all we’re going to go over the basic structure of our Log class.

interface iLogs
{
public function insereLog($entrada,$tipo);
}

We declared an interface. This way the application that will be calling this class is able to read its available content without the need to directly access the class internally.

Note: Methods that are declared on the interface need to be equal to the ones declared inside the class itself (either method name or number of arguments required). Otherwise you’ll get a fatal error from PHP.

__construct and __destruct use “__” since they are native to PHP5 and are automatically called when a class is instantiated.

When the class is built we want to create some constants used throughout the class and we want to check if everything is according to the file structure required.
We also use self to address the actual instantiated class and :: in place of -> because we’ll be calling them in static mode (no data can be changed).

Our destruct class is empty since there is nothing to be done when the class is destroyed.

Note: Normally you can use this function for a DB connection and destruct can close the connection.

This is purely HTML/CSS based coding. I’m not 100% familiar with how blogger works but if you’re able to edit your HTML code you should be able to add this.

First thing you need to do is to upload the images to some place on your server, for this you can use the regular image upload when editing/adding a post.
After getting the image link add the CSS coding to you template header (it should be next to the tags).

thanks a bunch for this code! I needed to make some changes to it since I’m using WP e-Commerce 3.7.6 and some of the text constants were replaced by WP’s __ function. And for some reason I had to add a global $wpdb; to wpsc_purchaselog_details_SKU().

Actually, there is one thing I need help on. I’m coding some extra stuff for my WPEC site and now I’m trying to get the variation SKU with a single SQL statement. I’ve been wrecking my head as SQL really isn’t my strong suit.

But I figure there must be a way to get from the purchase id to the cart id to the variations of the products in the cart all the way down to the variation SKU. But whatever I do, I get back too many rows.

Do you by any chance have an idea how to achieve this with an SQL query?

We can do this but not in 1 single SQL statement, because field all_variation_ids is comma separated. If we would work with the SQL code we might be able to do this but would represent a break on the Database atomicity.

However I can provide you with 2 SQL statements that you can easily use to create a PHP functions to return a given product sku.

Store in an array the result of this SQL statement: SELECT `variation_id` FROM `wp_wpsc_variation_assoc` WHERE `type` IN (‘product’) AND `associated_id` = ’4′ ORDER BY `variation_id` ASC

Now lets say you have the array called $variation_array. You’ll have to do a second SQL as follows:

“SELECT `sku` FROM `wp_wpsc_variation_properties` WHERE `id` IN (SELECT DISTINCT `priceandstock_id` FROM `wp_wpsc_variation_combinations` WHERE `value_id` IN (SELECT `value_id` FROM `wp_wpsc_variation_values_assoc` WHERE `product_id` IN (’4′) AND `variation_id` IN ( SELECT `variation_id` FROM `wp_wpsc_variation_assoc` WHERE `type` IN (‘product’) AND `associated_id` = ’4′ ) AND `visible` IN (’1′)) AND `product_id` IN (’4′) AND `all_variation_ids` LIKE ‘”.implode(“,”,$variation_array).”‘)”

I guess that’s why I was having such a hard time wrapping my head around this. I thought there had to be a way to get this done in a single query, but I kept hitting a roadblock with the variation_id and value_id fields.

Jose – I implemented everything as is listed above in your post. Upon ‘save’ and then trying to view the backend or the frontend the site was gone. Everything was blank. Ideas? I’m using WP Version 2.9.2 & WPEC Version 3.7.5.9.

I’ve been trying to apply the changes to different versions (i.e. 3.7.5.3 and 3.7.6.1) but I get a feeling I’m either missing something or I’m not applying your changes properly. I keep getting syntax errors, SKUs don’t save on variations, etc.

Would it be possible for you to take the latest version, apply the changes yourself, and make them available for download? That way, if someone who’s not all that experienced is doing something wrong, we can rule out newbie editing mistakes.

I can certainly make the adaptations for different versions. I know that for some versions the syntax changes a bit.
Please sent me the two files I mention on the guide, by email, to me and I’ll gladly make the changes and provide them here on the post.

One thing I noticed is when you add a variation and enter the SKU number, when saving the product, the first save doesn’t store the SKU number in the database, and the SKU field is empty, so you have to enter it again and save. I modified the insert query in the update_variation_values function to include ‘{$variation_sku}’ in the inserted fields.

It’s working great Already up and running @ http://scarletbits.com/ , hope to see it more out there as it consist of a simple (for the user) yet amazingly powerful improvement, especially now with the page speed ‘fact’. Excellent work!

Hi,
i just installed your plugin and tried to add an subdomain for parallelisation.
I first created a Subdomain which links to an folder with 755 permission.
Next I gone to the WP admin panel, to parallel loading system an tried to add the subdomain.
When I press “Add Sub-Domain”, the following error occures:
“I was unable to find your http server root”

I unfortunately have no idea, what i could do so solve the problem. Could you maybe give me some support?

Is it important to link the subdomain to a special directory? maybe the same like the wp install folder?

This happens because the plugin will try to automatically detect your server root in accordance to most common file systems. If it doesn’t find the path it will have to be added manually. I’m in the process of adding this functionality.

Thank you for your feedback and looking forward to ear from you again.

I use GoDaddy for Domain Management and MediaTemple as the Hosting provider. So, I need to create a sub-domain using GoDaddy, right?

GoDaddy gives the option to create sub-domain and asks us to forward it to some url. In this case I forwarded it to the main domain.

Now when I add sub-domain to the Parallel loading system , all it says is the sub-domain cannot be verified, click “here” to check it. When I click on it, it takes me to the blogs homepage. When I go back to the plugin dashboard, it doesn’t show any sub-domains that have been added.

So, I’m going wrong somewhere. Could you kindly advice, what I can do to set this up properly.

If you’re using MediaTemple you need to create your sub-domain directly with MediaTemple. If you’re using one of the Grid solution I’m not sure whether you have access to server control panel or if MediaTemple provides that directly on your Grid Control Panel.

GoDaddy only allows for you to create domain redirections, which, in this case does not work.

I’m going to check on MediaTemple KnowledgeBase and get back to you as soon as I know more.

I’ve checked your sub-domain and in fact it’s returning a 404 Not Found. In order to further test this, as it might be specific to your file system, I would need to access your blog and/or FTP. If you would like me to test it please send me an email to me@joseairosa.com.

Just followed your instructions and created a new sub-domain. Now there is a new folder with the sub-domain in my File Manager. Would this suffice the purpose of the plugin? I hope I don’t need move any wordpress related content in this folder.

Also, I upgraded the plugin, now it does not give an option to input sub-domain but asks me to input the root dir, I did that and it says the root dir was accepted. But getting an error on top that says –

“While installing this script I was unable to edit load_image.php with your server definitions. Please change load_image.php permissions to 777 and click the button bellow.”

I changed the load_image.php permissions to 777 and it made the required changes. Now I changed them back to 755, and it looks ok so far. Now I get the option to input the sub-domain.

I am however not able to access the subdomain. It gives a 403 forbidden error. I tried changing permissions of the subdomain folder to 777, still it gives the 403 forbidden error. Getting error –

“The subdomain you just added could not be verified. Click here to check it.” When I click on the subdomain link, boom – 403 error. What am I doing wrong. Compatibility and root folder status are both “Green”

So far all your instructions have went well…..if we get through this 403 error, I think the plugin would start functioning on the blog. Please advice.

So, when you get a 403 error when accessing a sub-domain it’s normal if you don’t have a index.html or a index.php file in there, see for example my sub-domain: http://img1.joseairosa.com/. As you can see I’m also getting a 403.

With the plugin I provided a test image. You can access the test image through the sub-domain using the following path: wp-content/plugins/parallel-loading-system/check_headers.jpg

This is only for testing purposes and will let us debug what might be wrong.

On other note, it might be a problem with your root path. If the above doesn’t help, please open the load_image.php file, inside your sub-domain FTP folder, and check the root folder, it’s something like: “define(‘ROOT_PATH’,”);”. Send me an email with that path and I’ll tell you what might be wrong.

It overwrote my .htaccess files (and wiped out any customizations I made to it). Bummer. Everything seemed OK (home page, WordPress admin pages) but then I clicked on a post permalink (any post. actually)… and got 404 all the time. Basically, I guess it’s because my .htaccess file got overwritten entirely… instead of just having some entries added to it…

Hi José,
I just downloaded the newest version, installed it and clicked the update button.
Firstly everyhting seems to be perfect (I noticed the faster loading).
Next I changed a few things (updated the subdomain path, ..) and afterwards only the main page works, such as Massa P described.

This problem shouldn’t be a bug in your plugin – i think it is a serie of unfortunate events.
I tested the plugin in a development branch, so this is no realy problem.

Now I just want to say thank you for this realy helpful plugin! Good job!

I am working on a new website using a Microsoft Expression Web 2 template. I am not an HTML coder and don’t really understand CSS, but can create okay in these templates. I would like to add the star rating system you have above to some of my pages, but not sure how. I can easily add the HTML coding to the page, not sure how to create the CSS or where to find the images to upload? Any help you have would be greatly appreciated. If not, I understand.

Thank you for posting your feedback. Unfortunately I didn’t have a Windows system to fully test the system out.

The issue you exposed is a bug and I will fix it on next update (tomorrow). When the system builds the path it will automatically try to find the best appropriate and possible root path to help you on your manual insertion. The path is being re-built with “” as default folder separator.

I would love to get your on-going feedback on how the plugin performs on a Windows based server.

Hi José, yeppers of course . Your idea of such an Parallel Loading System is genius and i loved it the second i’ve read of. Hope i’ll get it working with Win, still messing around now with subdomains; but i#ll keep you updated

Dunno why it is not able to add the subdomains correctly – maybe because of the ” /” thingy.

Parallel Loading System – 0.1.2

You can use this plugin to enhance the loading time of your website by parallelizing the connections to the server, since standard HTTP v1.1 only allows 2 connections, at the same time, from the same domain.

This plugin will virtualize connections, through defined subdomains. You can have as many subdomains as you like, but I do recomend using a maximum of 5.

Congratulations! I was able to update/install “http://img1.exampledomain.com” files

You should now revert the permissions of both D:/inetpub/vhosts/.exampledomain.com/httpdocs/img1 folder and file load_image.php inside it to 755

Sub-Domain has been added
Active Sub-Domains:
We could not find any active subdomains. Please add them using the form bellow.
Inactive Sub-Domains:http://img1.exampledomain.com

I got this error after i changed the load_image.php to 777
Warning: get_headers() [function.get-headers]: This function may only be used against URLs. in /home/studio25/public_html/wp-content/plugins/parallel-loading-system/wp-pls.php on line 75

Warning: current() [function.current]: Passed variable is not an array or object in /home/studio25/public_html/wp-content/plugins/parallel-loading-system/wp-pls.php on line 75
Sub-Domain Health:

^^ got all working by theory in ii7. But practically whilst being parsed the images are missing. It seems to fail mainly because the rewrite is not working as intended. .htaccess works not for II7 and i had no luck ‘translating’ the .htaccess towards web.config i am terrible sad

Hi Jose, really like your idea of your plugin, I’m half the way to get it working, it’s look like I’m having the same issues Viki has, I do get the test image if I put it by the 2nd example you showed her, but not through the control panel of the plugin, I did added an index.html file just to check if the subdomain exists and it works fine. I don’t understand your 2nd suggestion to her to open the load_image.php file can you please clarify, If you mean that the path should be changed to /home/content/t/h/i/thisisnotreal/html/my-domain-name/blog/’); instead of /home/content/t/h/i/thisisnotreal/html/my-domain-name/’); its not working… I still get the “The subdomain you just added could not be verified. Click here to check it.” message. Any help with this will be appreciated..

The example I gave was in a situation where your blog is not installed on your root apache folder. Lets say, my blog was not installed on apache root folder and was installed on a folder called myblog. The URL to my blog would be “http://joseairosa.com/myblog/”.
So if you have your wordpress installed on other folder try to specify on load_image.php.

I read about your plugin today and totally jumped on the idea. However, I had quite some problems getting it to work and would like to suggest the following:

After my experiences with the plugin, I think you might be right to assume everything works out fine (most of the time), if users have shared hosting accounts which they have access to using the mentioned hosting panels like cpan,… I have a root server with shell access and not a hosting-panel at all and this way, things get different…

I guess you assume people create a “subdomain” (it’s not, actually!) using a panel which installs a new folder on the same machine as the blog, set’s up DNS service for it, activates apache for it and so on.
After reading the docs, what I did was: set up DNS cnames for the new hosts (which in fact your “subdomains” are) and add those names to the virtual host config of my apache for the blog. I think this makes perfect sense, saves clutter on the server and would suggest you add support for this to your plugin.

What happened was: upon activation of the first subdomain, my blog was busted, because the plugin replaced the .htaccess with it’s own.
But even with changing that back and implementing your additions to my .htaccess, I was not able to get a subdomain to work this way.

After reading this page and some of the posts, I came to the conclusion that I need at least one additional vhost for this and that got me started.

But still, some more things to mention

It’s anoying that Parallel Loading System (PLS) makes backups of it’s own files all the time, although there are no changes… and I think it knows about that, because it is able to tell that files are out of sync.

Please make it clearer, what you want to be entered in the “Subdomain”-Field. A host or subdomain has no “http://”, that’s an URL, but the examples have it…

Your plugin requires two apache plugins activated on the server. Unfortunately, it does not protect the user for problems with those missing. Although mod_rewrite is very common, especially with WordPress, I think, mod_headers is not…
If you embed your configs in

…

there would be no errors on servers not running the plugin ModRewrite. (Sorry, don’t know how this should read for mod_headers). As The Header-Mod is optional, this would be a great plus!

Deleting subdomains that do not work is a pain, as the “remove” button seldom visible.

Thank you very much for your insight! It’s great to have this kind of feedback.

I will had the option of creating a backup file optional, lets say, you are notified that a script file is out of sync and if a need for backup is detected I will add a middle step that will let you choose if you want to back it up or not.
I was also in the process of developing a backup manager system that will let you, directly from the plugin control panel, manage all you backups and delete/restore them at any time.

What do you think?

————

It’s anoying that Parallel Loading System (PLS) makes backups of it’s own files all the time, although there are no changes… and I think it knows about that, because it is able to tell that files are out of sync.

I’ve been testing this on my local installation and it’s only creating backups when it finds a miss-synchronization. Can you explore this situation a bit more?

————

Yes I know that you can manually create a sub-domain directly on your apache configurations and you’re 100% correct.
About the virtual host http.conf file, it’s a great idea. I just need to further investigate since the system that is actually installed will not let me change virtual host config file directly from PHP.

————

What happened was: upon activation of the first subdomain, my blog was busted, because the plugin replaced the .htaccess with it’s own.

This is probably because your sub-domain DocumentRoot is pointing to the same DocumentRoot of your domain. Please let me know if my conclusion is correct.

If this is the case a backup should have been created of .htaccess (wordpress htaccess).

I will be adding the functionality to append to .htaccess instead of replacing it if it detects that the .htaccess is WordPress own .htaccess (this should resolve the problem when you are using the same domain and sub-domain DocumentRoot)

————-

I will also had compatibility checks to mod_rewrite and mod_headers, already got it for next version

————-

Can you explain a bit more this situation?

Deleting subdomains that do not work is a pain, as the “remove” button seldom visible.

Hi I installed the plugin, it was a bit difficult to get the sub-domains to work correctly i.e. the plugin to recognise that I put the sub-domain, but after persisting i did eventually get it to work.. My concern or problem that i discovered was that I also use a plugin called “simple View” which has a neat way of zooming up an image, BUT when using Parallel plugin, it made the simple view plugin change the bounding box apperance and also it’s size and also the size of the image was only half of the box and the zoom function was also affected.

I’m not looking for a solution, more to let you and others know about this. If you do have a solution that would be great, because for straight forward loading of a website the plugin works fine..

Jose, thank you for your support, but still doesnt work, I’ve tried many ways and still its not working. I have noticed that once I hit the button it does creates an .htaccess file in the subfolders that im trying to add and another load_image.php file, i have tried to edit the path there as well and still didnt work, do I have to edit this load_image.php in the subfolder as well or only in the plugin folder or both? my w instalation is basically just after my domain name, http://www.mydomain.com/blog/

any suggestions? will appreciate as really trying to get it work, Im also using go daddy as Viki if it helps if i got it set it up wrong from the first place..

If you’re editing the files manually you’ll need to do it on both plugin folder and sub-domain folders. This however is the plugin main job.
If you can wait until tomorrow I’ll be releasing version 0.1.3 in which I improved all the plugin greatly.

Viki contacted me by email and I gave her some directions. Still waiting on her reply.

> Hello Jochen,
>
> Thank you very much for your insight! It’s great to have this kind of
> feedback.

The least thing to give back for what you did for the community!

> I will had the option of creating a backup file optional, lets say, you are
> notified that a script file is out of sync and if a need for backup is
> detected I will
> add a middle step that will let you choose if you want to back it up or
> not.

That’s better, but still no real help if you have need for the .htaccess anyway, because PLS will not know that the settings are in place in a combined .htaccess and would always try to install it’s version.

> I was also in the process of developing a backup manager system that will
> let
> you, directly from the plugin control panel, manage all you backups and
> delete/restore them at any time.
>
> What do you think?

Much better, but see above, The backup manager is a good idea, but generally I would recommend having the needed code for a .htacess file which could be inserted into an existing one, creating one if none is there.
PLS should be able to recognise, if it’s settings are present in an existing .htaccess (use sort of start/end comments to recognise if they are there).
You could offer to replace those settings in any .htaccess-file with the original ones.

BTW: .htaccess is another requirement of PLS at the moment, which is not always available.

> ————
>
> It’s anoying that Parallel Loading System (PLS) makes backups of it’s
> own
> files all the time, although there are no changes… and I think it knows
> about that,
> because it is able to tell that files are out of sync.
>
> I’ve been testing this on my local installation and it’s only creating
> backups
> when it finds a miss-synchronization. Can you explore this situation a bit
> more?

I set up one vhost with one correpsonding folders for five PLS-Subdomains. For each “add-process” of a new subdomain, there was a backup of the .htaccess and the load_image.php. PLS was not able to find my document-root, perhaps that’s it?
I had some problems getting started with several subdomains having to be entered over and over again which all gave another backup.
Setting up a new domain gave me sync errors with the older ones pointing to the same folder, resulting in more backups.

> ————
>
> Yes I know that you can manually create a sub-domain directly on your
> apache
> configurations and you’re 100% correct.
> About the virtual host http.conf file, it’s a great idea. I just need to
> further
> investigate since the system that is actually installed will not let me
> change virtual host
> config file directly from PHP.

I don’t think any hosting environment will or should allow this! Just support this in the Plugin-backend and make the basic requirements clearer in the docs.
I would strongly vote for a version that hosts the pls in the same apache vhost instance as the blog!
>
> ————
>
> What happened was: upon activation of the first subdomain, my blog was
> busted, because the plugin replaced the .htaccess with it’s own.
>
> This is probably because your sub-domain DocumentRoot is pointing to the
> same
> DocumentRoot of your domain. Please let me know if my conclusion is
> correct.

Yes. That was a logical conclusion after reading the plugin description. As the docs pointed out, the plugin was supposed to not change the blog in any way…
But as I can easily point any subdomain to the same folder as the blog, where all the images reside anyway… why should I want anything else? For this setup, load_image.php would not be needed (still nice for of the Header-Mods, though), changing the image url were just enough!

> If this is the case a backup should have been created of .htaccess
> (wordpress
> htaccess).

That’s correct and I had no problem getting it back up. But you know, there was this sentence in the pi’s doc… will not change the blog in any way
>
> I will be adding the functionality to append to .htaccess instead of
> replacing
> it if it detects that the .htaccess is WordPress own .htaccess (this should
> resolve
> the problem when you are using the same domain and sub-domain DocumentRoot)

Great to hear. I think you are right… if getting the .htaccess to work, you can have the same doc-root for your blog and any subdomain.

> ————-
>
> I will also had compatibility checks to mod_rewrite and mod_headers,
> already got
> it for next version

cool. Please add it to the docs requirements. mod_rewrite is a must have, I think, mod_headers a nice to have.

> ————-
>
> Can you explain a bit more this situation?
>
> Deleting subdomains that do not work is a pain, as the “remove” button
> seldom visible.

I had several subdomains configured which had errors. In such a situation, or when you are editing/adding a subdomain, you will not get the remove-button. With many active errors it was troublesome to remove those.
i think I had to click “resolve” on each, add the doc-root and URL/Subdomain again and was only then able to click “remove”, starting over with the next.
All I would like to suggest is to have the “remove”-button available all the time, at least for inactive subdomains.

> ————-
>
> I will be adding that information to the documentation, thank you!

Please reconsider the use of the term subdomain. I think you are talking of hostnames or URLs.

once i view the img1.website i see *.bak and php file. can i put in a index.html or this would be great add on. how about a index.html to redirect back to the main site. since people can view the folder content.

Are you still having problems in running the plugin? If you are under basepath restrictions you won’t be able to run plugin out of Simple Method. I’m sorry but that’s a security restriction imposed by PHP itself.

The characters are created and added by the plugin itself. It’s a way to make sure the cache is coherent and improves caching on the browser point of view.
It’s a query string that will not (should not at least ^_^) mess up image rendering.

Just on a side note, those characters are the md5 encryption algorithm of the image name.

I will have to take a look at the new code, but if they didn’t change anything on those 2 files it will work as before.

You can test it out but create a backup of your wp-e-commerce files first and database.

Also, don’t forget to backup both files (variations.class.php and purchaselogs.class.php) before installing the new version. After installing the new version got to your FTP and replace them. Again, don’t forget to backup your files

Hello, Jose. John again. I’m using your plugin on a client site, and they are on MediaTemple (dv), with the Plesk control panel. I’ve managed to get the plugin working in theory, in so much as I’m getting the 200OK message back from the subdomains (in simple mode). However, when checking the site the images are coming up missing:http://whitemike.org/wmwp/

I’ve had to disable the plugin. Using an .htaccess mod to the URI was messing with things, so I hope to be able to implement your plugin once there’s an update. Thanks for the work, it’s a great utility!

is it working with dramhost shared hosting? because when i install it, it can’t find the subdomain, i simply added it manually after creating it, and it can’t find it. i suspect dreamhost security cause it since I already dealt with some host and cpanel is much simpler, dreamhost got tons of apache modification that WP PLS can’t read, however if you manage to get it working on DH or got experience with PLS on DH, please mail me. thanks.

Hi,
Very beautiful plugin.. i’m really very thankful for your work for all of us.
I’m working on website and recently i noticed your plugin is interfering with drop-down menu (or plugin called Menu Manager) when your plugin is active only main menu is shown, no sub-pages links which actually loads when your plugin is inActive.
Kindly please look into this issue. also i have tested this with Concept-X Theme’s inbuilt menu, same thing is happing with menu with no child-menus..

I hope this will help you to figure out what went wrong.. even i can keep my site on with your plugin enabled or i can also share my login details with you.
Please let me know if you need anything else..

Thanks a lot for the information provided! I’m 99% sure I can fix the issue with the information you just provided. If I happen to need actual access to your server I will contact you via mail for privacy reasons.

just installed your plugin, I have a slight problem : I am using PLESK my server setup is this
/srv/www/vhosts/example.org/httpdocs
/srv/www/vhosts/example.org/subdomains/data/httpdocs
that means my subdomain directory is outside the httpdocs
what can I do in this case ? Any chance to get your extension running ? The plugin just does not find my subdomains …

Strange that it is not working. I just tested on my other server that has a Plesk CP and everything installed with no problem.

Is it possible for you to give me the link to your Blog? Contact-me via email with this information if you can. me[at]joseairosa[dot]com

– EDIT –

On a side note. When you activate Simple Method you need to manually drag&drop both .htaccess and load_images.php form your parallel-loading-system folder to every subdomain root folder.
Unfortunately this the only way

Unfortunately no. This plugin is intended to install and have a fully working REST API on your Blog that will let other entities connect to your blog and, in the other hand, will let you connect to other WP-RESTful APIs from other Blogs.

Anyways, I’ve been working on the last few days on what you just asked. I will be releasing a new version of the plugin that will enable this functionality.

Great! Specifically – I use WordPress as a centralized project management portal while developing client websites. I’ve been looking for a solution that will pull in various services I use to mange these projects and present them simply in my client portal site – a Google Doc here, a Freshbooks project task list there, etc. Rather than write custom code for each I’m looking to use a framework such as this to add different service APIs to my portal sites. I’m looking forward to watching this WP-RESTful project develop, very solid work here.

I’m running Version 3.7.6.7 and some code has been updated from what is listed in this post. I was able to make the appropriate changes. Mainly reformatting some lines into tables( adding etc.) and changing a few ” to ‘

The only significant difference was instead of adding this line:

$output .= ”
“.TXT_WPSC_SKU.”

nr”;

Use this line:

$output .= ” “.__(‘sku’, ‘wpsc’).”nr”;

So, I’m pretty sure I have the variations.class.php file updated correctly (I’m not receiving any errors) and it looks good when adding a variation to the product.

However, I can not figure out how to update the suggested code for purchaselogs.class.php . I have tried everything I can think of, and am out of options for that one. I would greatly appreciate help with the updates to the added lines of code for purchaselogs.class.php.

Hi – awesome fix. I’m on 3.7.6.7 and it works great. I’m trying to extend it to allow for the SKU to come through in the admin email once the cart has submitted. I know it’s line ~180 in the transaction_result_functions.php but can’t nail the SQL. Any help would be greatly appreciated. Thanks again!

After reading all of the documentation, which it quite impressive, I’m still trying to figure out a good use for this. Can you list a few situations in which I would want to use this framework? The developer above with the multiple clients gives me sort of an idea. Specifically why did you develop this plugin?

I developed this plugin, first of all, out of fun and challenge. Secondly for a few end-game implementations:

- iPhone/Andorid/Windows Mobile app development for your blog
- Blog networking (connect more than one blog that you own to each other)
- Unified login system
- Development of a centralized blog info repository. (this is one thing that I’m thinking of for the future, basically think of this like feed aggregation, but with the possibility of sharing more than only posts… basically you can share almost everything you want from your blog)
- Advertisement system maybe. There surely is an application for this but it needs to be very well thought.

Warning: Cannot modify header information – headers already sent by (output started at /home/dusting/public_html/wp-content/themes/OnDemand/header.php:12) in /home/dusting/public_html/wp-content/plugins/wp-restful/lib/REST.inc.php on line 669

Warning: Cannot modify header information – headers already sent by (output started at /home/dusting/public_html/wp-content/themes/OnDemand/header.php:12) in /home/dusting/public_html/wp-content/plugins/wp-restful/lib/REST.inc.php on line 671
Not Found

The requested URL /api was not found.

I’m trying to work it out as we speak. Any tips would be really appreciated!

That problem has also been reported by other user and I’m on the way to fix it. I apologize if it’s taking a bit of time but the work at my company has increased a lot in the past few weeks.
Doing my best.

I think it is (properly installed). But if I look in the mysql.sql script (in wp-restful/lib/store/mysql) the table definition for wpr_oauth_server_registry does not have any osr_start_time_call column !?!

A lot of your code seems rather complicated. You should check out the ABSPATH-constant WordPress defines. It pretty much contains what your get_root() function tries to detect. And if the Script is running on Windows can easily be detected by using the PHP_OS constant instead of checking for A: – Z: drives. Last but not least: if you wanna know if the system is using / or \ you could use the DIRECTORY_SEPARATOR constant.

Hi Jose, excelet job!, but for security I´ve added an index.php into every folder that belogs to each subdomain with the purpose not to show the content of every folder. Inside the index.php this code:

Why to do this?. Just because the folder img1,img2,etc.. requires to change their permisions to 755 and that is not secure . Hope this can help to everybody.

The plugin works perfectly and doesnt require enough to set it up. Everything depends of the Hosting Provider, if anybody can have those requeriments, everthing will go fine just following your steps.

My site was taking 11 seconds to load, now its taking between 2 and 5.

I was using Simple Captcha, that one I think use PHP GD Library but now im using anotherone called “not captcha” addapted to spanish and my blog.

As I know, Akismet uses aswell PHP GD Library, and it is activated. Is there another way to know from plugins that someone has on WordPress which ones are using PHP GD? mmmm, it would be a great idea to develope one plugin that detects that, dont you think so?.

Hope my Tip can be followed by many people and dont forget to include it in your next update. Dont forget to mention who told you that lol, it is a joke .

Hi. Love the plugin. In the most recent version it seems there’s a bug, I assume it is from the change in how the way the plugin detects folder separators now. It worked fine, but now it us unable to find the images, the path to the images is incorrect now resulting in broken links. I know a few others are having the same issue. It seems like a minor issue. I’ve toyed with it a bit, but haven’t pinpointed it yet.

Jose, I really look forward to using your plugin, my page load time is pretty slow. But I have a bit of a funky setup and I think that caused everything to … well … break. I get a 404 now when I try to go to my admin page.

I am pretty new to HTML. So I just copied the contents of both the CSS and HTML into a single file, even downloaded the empty stars and the full stars,
when I changed the % value from 27% to 50% i just see
empty stars all the time, no matter to what % I change it to. is there something else that I shld to.

I really like your blog. Thrust into the top issues in this subject. It seems to me that you have many wise words to say and not afraid to speak aloud their sentences. Keep up the invite to your blog pozycjonowanie stron

Why have you taken out my post? It was very useful
information and i guarantee atleast 1 person found it helpful
unlike the rest of the comments on this web site. I’ll post it
again. Sick and tired of getting low amounts of useless visitors
for your site? Well i wish to tell you about a fresh underground
tactic that produces me personally $900 per day on 100% AUTOPILOT.
I could be here all day and going into detail but why dont you
merely check their site out? There is really a excellent video that
explains everything. So if your serious about making easy money
this is the website for you. Auto Traffic
Avalanche

This is getting a bit more subjective, but I much prefer
the Zune Marketplace. The interface is colorful, has more flair,
and some cool features like ‘Mixview’ that let you quickly see
related albums, songs, or other users related to what you’re
listening to. Clicking on one of those will center on that item,
and another set of “neighbors” will come into view, allowing you to
navigate around exploring by similar artists, songs, or users.
Speaking of users, the Zune “Social” is also great fun, letting you
find others with shared tastes and becoming friends with them. You
then can listen to a playlist created based on an amalgamation of
what all your friends are listening to, which is also enjoyable.
Those concerned with privacy will be relieved to know you can
prevent the public from seeing your personal listening habits if
you so choose.

I copied the css part 1:1 to my main css file, also the html was 1:1 copy, and it does work on FF. Can’t figure out why not IE/Chrome. Your email (below) didn’t seem to work. Could you pm me on my email, so I can provide you more details?

Hi Jose, thank you for sharing this trick, I tried it and it works perfectly. And thanks for sharing the wp-restful plugin. Please, if you develop any further rest-based plugins keep them posted. I will try to develop something based on your infrastructure, if I succeed of course I’ll post back. Cheers

excellent stuff. Do you have an RSS feed? And will it be cool if I added your feed to a blog of mine? I have a site which brings content from RSS feeds via a number of sites and I’d like to add yours, the majority of folks don’t mind given that I link back and everything but I like to get authorization first. Anyway let me know if you could, thanks,Regards, Quentin Clem.

I admit, I have not been on this webpage in a long time… however it was another joy to see It is such an important topic and ignored by so many, even professionals. I thank you to help making people more aware of possible issues.Great stuff as usual.

Do you think this code may be used to help with a site that has numerous reviews? Allow me to explain, I am trying to develop some code that will take a 5 point rating system, develop a star code and create a star rating based on a the 5 point rating. For example, a 3.72 out 5 rating would create a 5-star rating that has 3.72 of the stars shaded. Do you think this would accomplish the task?

An update release would be AMAZING! Really! A life saver for two stalled out client website that I can FINALLY complete. You are the ONLY person working on this issue. SO EXCITED — I will watch this site for your update. YAY!

Created two unique subdomains in cpanel, installed and activated plugin, Settings were all (green) ok. , but then when I went to open my website, I had small white questions marks on a blue background all over………what did I do wrong ??? Thanks for your help…

Hello! I apologize for the time that has been taking me to reply. I’ve been stuffed with work lately and it has been impossible for me to attend all the emails. I’m sorry for that and I will try to take a look and reply to them on the weekend.

Hey JP, thanks for your plugin (I made an Italian article for it on my blog), but I have problems!
I updated the database and the files I’ve just downloaded, and the field appears right next to the variation; I can specify a number of items per variation but when someone buy an amount of the variation the number doesn’t change! And if the costumer wants to buy something more of what is available (i.e.: The variation has 5 units in stock, the costumer asks for 10) it goes one with the transaction without any error/blocking message.
Please help me because it’s important for a website I’m developing (you know, something about wearing… so tot. t-shirt with this color/size, tot. with another color/size, and so on… So I need your feature!). Thank you!!

Oh, I didn’t get that!
If you are able to add a field that decreases the quantity when someone buys it, well it would be wonderful!!!
I’m not so good in PHP & SQL, but I can help you developing it!
Please notice me, even to my mail if you want

I installed this plug-in, installation and everything went fine. However, after I flushed my supercache and ran pagespeed again, it flagged my image files for failing compression, and when I look at the analysis, I noticed all of my already optimized images file that were served by the subdomain grew 3x in file size! A 110k image file grew to about 380k! What is happening here? I have since taken the plugin offline until I understand why.

I tried to install it the way you advice and went all alright but when I go to register the client, the server responds with a page not found. I am using wordpress 3.1 do you think it might be a problem of the new version?

Just call this function where ever you like in you checkout template: cart_item->product_id,((is_array($wpsc_cart->cart_item->variation_values) && !empty($wpsc_cart->cart_item->variation_values)) ? current($wpsc_cart->cart_item->variation_values) : 0 )); ?>

I wasn’t aware until I read your comments above that this plugin is not W3 Total catch compatible.

Since that plugin ROCKs with 300,000 downloads and a 5 star rating, almost everyone who wants performance has the plugin installed. I have been using it with MAXCDN and I think that is why your plugin is not working.

I read that setting up parallel loading will improve site performance with W3 Total Cache, and I’m looking forward to your ‘new feature’ list when you have the spare time…I’d be willing to beta test it when you’re ready to make it compatible with that 300,000 W3 TC market …it’d be a killer combo…

I’m not sure how to implement the function you supplied – do I create a function somewhere else and call it in my shopping_cart_page.php file or do I place that code directly in the shopping cart file?

Would it also be possible to display the variation SKU on the single_product.php page and have it update when different variations are selected just like the price updates? Thanks again!

We are looking for WordPress Bloggers to test our new WordPress Plugin : Tweet & Get it !
and we think that joseairosa.com is a good website to test it.

The plugin allows you to create a download button , which will hold the file you want to make available for download.
In exchange for the file the user will have to:
1. send a tweet (priorly defined by you) 2. follow your Twitter account

Thank you so much for this tutorial. I have been seeking top understand mod_rewrite for months now but tutorials I found either just weren’t something I could understand or were not effectively communicated.

My only question is that on urls if I include the forward slash at the end of the url, such as example.com/helloworld/ the html loads but not the css. It all loads fine without the forwardslash at the end. Any idea what I may have done wrong. If I understand correctly, in ^([a-z]*)/?$ the ? says the forwardslash before it can or can not be there. And this is how I have it.
Again, thanks for this awesome tutorial!

Thank you so much for this plugin. Unfortunately, when accessing the API page I too get the error message “The requested URL /api/register/ was not found”. Before diving in, I wanted to ask you if you ever figured out what the problem was.

I’ve followed all the instructions to the letter, and I’m still getting this error message.

I’m having problems loading my site in ie7 – the worst browser ever (if it can even be called a browser that is) it downloads all the files first and only then it renders the page, instead of rendering it on the fly.

Because of that, I would opt to manually load some of my images into subdomains and call them with the different url (e.g. img1.mysite.com/someimage.png).

That caused this error on the /api page:
—
Warning: Cannot modify header information – headers already sent by (output started at /SERVER_PATH_GOES_HERE/wp-content/themes/twentyten/header.php:15) in /SERVER_PATH_GOES_HERE/wp-content/plugins/wp-restful/lib/REST.inc.php on line 669

Warning: Cannot modify header information – headers already sent by (output started at /SERVER_PATH_GOES_HERE/wp-content/themes/twentyten/header.php:15) in /SERVER_PATH_GOES_HERE/wp-content/plugins/wp-restful/lib/REST.inc.php on line 671
Not Found

The error that you’re getting is because that particular code is being executed and trying to add header information after the headers have already been sent to the browser. So, in any case, this code should be executed before any output is sent to the browser.

Hey, I came across this when I was looking for a way to use WP as a backend for mobile development. Particularly jqtouch & sencha. I can build a mobile ‘theme’ no problem but if I want to use lets say phone gap it will need to get the data via an API. Would you have advice on how to set this up using your plugin?

Can you please investigate why this function fails in your plugin? In my case, I have not required OAuth authentication in the server, my request does not contain OAuth headers, and I want to use a non-WP client to call the API. I just want a simple REST server.

Hi Jose, I’m having the same issue reported above about the getallheaders() function being undefined. I spoke to my host and this was the response:

Hi,

getallheaders() is not native to php5. It was a php4 function and was available in php5 but only if php is installed as an apache module. php here is not an apache module but a compiled binary. getallheaders() did become available in php 5.4 but only on fastcgi. As we are currently running 5.2.17, it is not available. We have recently finished phasing out php4 completely so that is most likely where this is coming from. If you need a workaround for that function to work with your plugin, you could define it in your functions.php file or somewhere where the plugin you’re using would be able to see it. Here’s a url to a possible workaround:

Works and looks great. I want something that they click on and it totals it up automatic and changes per opinion. I dont have a section on my site for comments but I want the site to reflect in the star rating an instant amount by them clicking on it and based on who rates what it will go up or down. Does that make sense? check my link to one of my pages with it:http://www.companiesyoucantrust.com/roscomputers.html
Thank you so much!

Installed it today. Had some trouble getting it to recognize my subdomains (set up 3) and had to keep deleting .htaccess in order to log back in and trying the config again. Finally got it to work and it seems to be playing nice with all my other plugins.

Hello,
I have bug with loading plugin classes. Poblem was in __autoload function
there is line:
@include_once ( WP_PLUGIN_DIR.”/”.$wpr_plugin_folder.”/lib/”.$class . ‘.php’);

but it just don’t work because $wpr_plugin_folder is bad. Example, Tags plugin is installed at ‘wp-restful-tags-plugin’ directory, but $wpr_plugin_folder is set to ‘wp-restful-tags’.
I solved problem changing problematic code to:

There is plugin: PostRESTController
it has getPost() and getPosts() functions. So, it means that I can request via REST all posts or only one. I was reading code for past half an hour, maybe more, but I can not find that you implemented possibility to get only one post (or tag or whatever). I can get only all data.
Do I miss soomething or should I modify your plugin so I can request only one particular post/tag/category

Nice code…. I need to use star rating in one of my company’s site…. while browsing I got it… looking so easy… but even after reading all the comments too… I could not understand that It is a static star rating OR dynamic one…. I mean to say… that how users will click on stars if and if someone will click on it… and then how we will know the users likes… and do we have to change the % value manually every time for every post???

This is very attention-grabbing, Youre an excessively expert blogger. I’ve joined your feed and sit up for in search of extra of your great post. Also, I have shared your web website in my social networks!

I am in the process of building a website that will require multiple images (each with their own rating). I use Dreamweaver to build the sites and am looking for a star rating system. I see the code and the stars and can copy them into my site but how do you make it work? I want viewers to be able to rate and comment on each item as they wish. Maybe it is very simple but I am lost.
Thanks for any help.

Like I said on previous comment, this is only a static method that you can apply to any web language. In your case, since you’re using WordPress, you must complement it with a PHP plugin that will take the vote of a given user and then calculate the appropriate rating.

Warning: get_headers() [function.get-headers]: php_network_getaddresses: getaddrinfo failed: Name or service not known in /home3/dragonb2/public_html/wp-content/plugins/parallel-loading-system/wp-pls.php on line 147

Well, i’m about to uninstall this plugin. I’ve created sub domains and tried to set this up but it’s not working. It’s telling me the domains are not there when they are OBVIOUSLY there because I just created them. Something is wrong with this script.

I tried installing this plugin today and I get an error message. The warnings suggest there’s something not jiving between the plugin and the theme I’m running (?). I’m using the default WP Twenty Eleven theme so not sure what I should do.

Warning: get_headers() [function.get-headers]: php_network_getaddresses: getaddrinfo failed: Name or service not known in /home/jenrik06/public_html/wp-content/plugins/parallel-loading-system/wp-pls.php on line 147

Hi, I had moved on for awhile and recently came back to try to make this work. It seems to be working according to the sub-domain health report the plugin generates. I’m getting “OK” report on all 4 of my subdomains. However, when I run Page Speed on GTmetrix.com, I get an “F” for “Parallelize downloads across hostnames”. That report then lists the many files that haven’t been parallelized.

The page of my site that I test is is http://choochooclan.com/products-page/prints . The report states that 30 jpg’s need parallelizing among a host of other png’s and gifs. however, the page actually has about 60 jpeg thumbnails. Does this mean that the 30 images not showing up in the report are actually being parallelized by your plugin? Shouldn’t the plugin work on all the images of a page?

so i looked at the first video and got a bit confused? You mention that primary usecase of using the REST api via mobile apps.. but here you have shown the client as another website ? Would the steps be any different if the client is android or iMac ? can you post another video on same ?

You can use in both situations basically. REST api is a way to expose the data from your website/app to the outside world via a controlled layer. So with the example I’ve give I would consume the data from my own blog, but I could also use it with an iPhone app in the same way.

Hi José, can you explain which changes in 3.2.1 might render the plugin unsuable? I need to get a REST api going on my wordpress site very quickly and am thinking about using your plugin as a starting place, but knowing what that issue is before I start would be very helpful. Thank you!

PLS help me! I’m using the Web hosting Platform called Jimdo. There I can ad a HTML block and Pictures but I have no Idea how to get the CSS cod in there… Pls this rating system is exactly what I need, but I can’t get it to work.
Regards Haeri

Hi I am having difficulty setting up this plugin for what I need. I was hoping to create a service that I can connect to from a mobile app Im working on.

I installed the WP Restful
Created the Page “/api” with the shortcode [REST_return]
Server is on and active……….. Im stuck

Client Settings says :”In this section you can manage your connections, as a consumer, to other blogs (servers).” This cant be option. I need to connect from my mobile app dev location to the REST service>

Kinda new at this REST stuff so pls bear with me.

How do I set up so the mobile app can access the service. The info says it can be done