Posts by pixelentity

488 posts
  • Elite Author
  • Sold between 250 000 and 1 000 000 dollars
  • Won a Competition
  • Referred between 1000 and 1999 users
  • Author had a Free File of the Month
  • Author had a File in an Envato Bundle
  • Bought between 10 and 49 items
+3 more
pixelentity says

Does it work with plugins too? How users provide purchasecode and API key?
Nope, as far as i know, envato apis only handle theme updates for now.

Purchase code is not needed, only buyer username/api key. The class must be provided the values, how to get them from the end user is author business but one would tipically add a couple of extra fields in theme options page.

BF

488 posts
  • Elite Author
  • Sold between 250 000 and 1 000 000 dollars
  • Won a Competition
  • Referred between 1000 and 1999 users
  • Author had a Free File of the Month
  • Author had a File in an Envato Bundle
  • Bought between 10 and 49 items
+3 more
pixelentity says

Fixed link

sorry about that

488 posts
  • Elite Author
  • Sold between 250 000 and 1 000 000 dollars
  • Won a Competition
  • Referred between 1000 and 1999 users
  • Author had a Free File of the Month
  • Author had a File in an Envato Bundle
  • Bought between 10 and 49 items
+3 more
pixelentity says

Hello fellas,

everybody likes videos more than words, so first things first, here’s what we’re talking about: http://youtu.be/3UNA5AHEFF0

A while ago, envato released its wordpress toolkit which is great and we used it to include the automatic updates feature in our themes.

However, using a custom Theme_Upgrader turned out to be not such an easy task and we ended up adding quite some glue code. So, inspired by a recent thread here in the forums, we did a small research and found this

https://github.com/jeremyclark13/automatic-theme-plugin-update

In short, the author uses the “pre_set_site_transient_update_themes” to inject custom updates in the native WordPress update system, which is so great because all you need to do now is using the Envato API to
  1. check if your theme has an update
  2. get the download link
  3. inject the above in the WordPress update system

So we created a small class using only class-envato-protected-api.php from the Envato toolkit and made available for all authors to download and use in their own theme: download link

BF

488 posts
  • Elite Author
  • Sold between 250 000 and 1 000 000 dollars
  • Won a Competition
  • Referred between 1000 and 1999 users
  • Author had a Free File of the Month
  • Author had a File in an Envato Bundle
  • Bought between 10 and 49 items
+3 more
pixelentity says
488 posts
  • Elite Author
  • Sold between 250 000 and 1 000 000 dollars
  • Won a Competition
  • Referred between 1000 and 1999 users
  • Author had a Free File of the Month
  • Author had a File in an Envato Bundle
  • Bought between 10 and 49 items
+3 more
pixelentity says

Maybe i’m missing something here but why should authors pay for a 3rd party service when the envato wordpress toolkit is free and able to download the update from themeforest already ?

BF

488 posts
  • Elite Author
  • Sold between 250 000 and 1 000 000 dollars
  • Won a Competition
  • Referred between 1000 and 1999 users
  • Author had a Free File of the Month
  • Author had a File in an Envato Bundle
  • Bought between 10 and 49 items
+3 more
pixelentity says

And now i have a question for you :) i generate the file with php and it seems that there is a better way. How do you pass the variables exactly?

here’s an example: we have a js script registered under the id “pe_theme_video”, after that, we call
wp_localize_script("pe_theme_video",'peFallBackPlayer',array("url"=>$url)));


WordPress creates the “peFallBackPlayer” variable (object) right before the related script (pe_theme_video) gets loaded:
<script type='text/javascript'>
/* <![CDATA[ */
var peFallBackPlayer = {"url":"http%3A%2F%2Flocal.lan%3A85%2Fwp%2Fneo%2Fwp-content%2Fthemes%2Fneo%2Fframework%2Fjs%2Fvideo%2Fjarisplayer.swf"};
/* ]]> */
</script>
<script type='text/javascript' src='http://local.lan:85/wp/neo/wp-content/themes/neo/framework/js/pe/jquery.pixelentity.video.js?ver=1346147951'></script>


Then, in the js file, you can fetch the value:

var fbp = decodeURIComponent(window.peFallBackPlayer.url);

BF

488 posts
  • Elite Author
  • Sold between 250 000 and 1 000 000 dollars
  • Won a Competition
  • Referred between 1000 and 1999 users
  • Author had a Free File of the Month
  • Author had a File in an Envato Bundle
  • Bought between 10 and 49 items
+3 more
pixelentity says

What would you suggest about applying options from PHP to javascript codes?
http://ottopress.com/2010/passing-parameters-from-php-to-javascripts-in-plugins/
488 posts
  • Elite Author
  • Sold between 250 000 and 1 000 000 dollars
  • Won a Competition
  • Referred between 1000 and 1999 users
  • Author had a Free File of the Month
  • Author had a File in an Envato Bundle
  • Bought between 10 and 49 items
+3 more
pixelentity says

I just tried the method of “special” style file like style.php and that works perfectly too.
i can hardly see any advantage in doing that.

with almost any server now supporting gz compression, a 8kb uncompressed css block would just add like like 1-2kb to the page.

BF

488 posts
  • Elite Author
  • Sold between 250 000 and 1 000 000 dollars
  • Won a Competition
  • Referred between 1000 and 1999 users
  • Author had a Free File of the Month
  • Author had a File in an Envato Bundle
  • Bought between 10 and 49 items
+3 more
pixelentity says

so if i have 200 lines of custom css code, should i add it to the header of each file?
yes.

that will still be way faster than loading another file.

488 posts
  • Elite Author
  • Sold between 250 000 and 1 000 000 dollars
  • Won a Competition
  • Referred between 1000 and 1999 users
  • Author had a Free File of the Month
  • Author had a File in an Envato Bundle
  • Bought between 10 and 49 items
+3 more
pixelentity says

To echo custom rules inside a style block of header is not a bad practice and also has absolutely zero impact on performances/load times while to write an external css file with custom values requires an additional server request which is far more costly in terms of resources.

BF

by
by
by
by
by
by