Posts by dtbaker

3303 posts
  • Provided great contribution to our forums
  • Nominated Community Superstar of the month
  • Helps us moderate the forums
  • Has been part of the Envato Community for over 5 years
+18 more
dtbaker Moderator says

1) does the topic of our items have to be Christmas, or any topic applies?

From: http://marketblog.envato.com/community/gift-giving-advent-calendar/

Does my item need to be Christmas related? No.
3303 posts
  • Provided great contribution to our forums
  • Nominated Community Superstar of the month
  • Helps us moderate the forums
  • Has been part of the Envato Community for over 5 years
+18 more
dtbaker Moderator says

Great!

3303 posts
  • Provided great contribution to our forums
  • Nominated Community Superstar of the month
  • Helps us moderate the forums
  • Has been part of the Envato Community for over 5 years
+18 more
dtbaker Moderator says

Great article, I saw this getting shared around quite a bit

3303 posts
  • Provided great contribution to our forums
  • Nominated Community Superstar of the month
  • Helps us moderate the forums
  • Has been part of the Envato Community for over 5 years
+18 more
dtbaker Moderator says

Hello,

Does anybody have a novel way to disable/toggle responsive on a mobile device?

The “request desktop site” option in mobile browsers only changes the user agent (to avoid server-side redirects/content filtering) and doesn’t disable responsive.

Currently my View Full Site button does this:

  • removes the responsive_enabled class from the body tag, which is required for my responsive css rules to work
  • sets the outer wrapper div min-width to 980px

I tried playing with the viewport meta tag but that doesn’t seem to work on small desktop browsers, only mobile.

Anyone else doing this?

(personally I dislike most responsive websites, and would love a way to disable responsiveness on my mobile sometimes)

Cheers,
Dave

3303 posts
  • Provided great contribution to our forums
  • Nominated Community Superstar of the month
  • Helps us moderate the forums
  • Has been part of the Envato Community for over 5 years
+18 more
dtbaker Moderator says

You will see a lot of broken WordPress installs that hit your server every few seconds for updates. It’s incredible! I had to do some tricky caching based in referrer/post data to take the load off my php script.
Wow, that’s crazy. I’d love to hear any suggestions/code you have for deflecting those requests. Are you dynamically updating an htaccess or something like that?

I can’t find the nginx rule I had – it was close but a little too scary for me so I went back to raw php caching. Something like this is run before any resource intensive PHP stuff:

https://gist.github.com/dtbaker/605772152cfaba9ce220
$key = $_SERVER['REMOTE_ADDR'] . serialize($_REQUEST);
if(strlen($key) < 500){ // help prevent flooding.
        $key = md5($key);
        // global so we can find it in the shutdown function
        $GLOBALS['wordpress_temp_file'] = dirname(__FILE__).'/cache/wp_'.basename($key);
        if(is_file($GLOBALS['wordpress_temp_file']) && filemtime($GLOBALS['wordpress_temp_file']) > (time() - 3600)){
                $data = unserialize(file_get_contents($GLOBALS['wordpress_temp_file']));
                echo $data['content'];
                exit;
        }
        ob_start();
        function wordpress_shutdown() {
                $data = array(
                        'request' => $_REQUEST,
                        'content' => ob_get_clean(),
                );
                if(isset($GLOBALS['wordpress_temp_file'])) {
                        file_put_contents( $GLOBALS['wordpress_temp_file'], serialize( $data ) );
                }
                echo $data['content'];
        }
        register_shutdown_function('wordpress_shutdown');
}
// continue on with normal php code here... 

you’ll need to clean up the /cache/ folder every hour or so with a cron job, and make sure those cache files are not visible from a web browser.

[dtbaker:cache]$ ls wp_*|wc -l
9626
[dtbaker:cache]$ du -ch wp_*|tail -n1
38M    total
3303 posts
  • Provided great contribution to our forums
  • Nominated Community Superstar of the month
  • Helps us moderate the forums
  • Has been part of the Envato Community for over 5 years
+18 more
dtbaker Moderator says

Nasty!

3303 posts
  • Provided great contribution to our forums
  • Nominated Community Superstar of the month
  • Helps us moderate the forums
  • Has been part of the Envato Community for over 5 years
+18 more
dtbaker Moderator says

Hey I just fixed up the old microlancer WordPress plugin so it now supports Envato Studio.

Code: https://github.com/dtbaker/envato_studio_wp_plugin

Demo (ugly): http://dtbaker.net/envato/custom-themeforest-or-codecanyon-modifications/

If someone wants to pretty up the output it might be a nice easy way to push some Studio referrals from your blogs.

3303 posts
  • Provided great contribution to our forums
  • Nominated Community Superstar of the month
  • Helps us moderate the forums
  • Has been part of the Envato Community for over 5 years
+18 more
dtbaker Moderator says

How do we get that for our plugins ?

Currently it seems this “Install Plugin” or “Install Theme” or “Customize Photo” button go to a random Envato Studio provider.

\\

More about the express service seems to be here: https://envatostudio.zendesk.com/hc/en-us/categories/200211534

Jordan mentions it’s not currently possible to link these buttons to your own Studio service but you are allowed to link to your own Studio service from the item description (and possibly earn an extra 10% if you are signed up for the new studio affiliate service).

3303 posts
  • Provided great contribution to our forums
  • Nominated Community Superstar of the month
  • Helps us moderate the forums
  • Has been part of the Envato Community for over 5 years
+18 more
dtbaker Moderator says

Well that’s pretty funny. I was afraid to click it out of fear that it would auto-deduct $20 from my account. :)

haha good feedback :)

3303 posts
  • Provided great contribution to our forums
  • Nominated Community Superstar of the month
  • Helps us moderate the forums
  • Has been part of the Envato Community for over 5 years
+18 more
dtbaker Moderator says

Approved! Yew!

by
by
by
by
by
by