WordPress.org

Ready to get started?Download WordPress

Forums

Jetpack by WordPress.com
[resolved] Local testing version (36 posts)

  1. jfrankli
    Member
    Posted 2 years ago #

    Is there a way to activate the JetPack plugin on my locally running copy of WordPress on my MacBook? I saw a message that said "site_inaccessible". Error Details: The Jetpack server was unable to communicate with your site [IXR -32300: transport error: http_request_failed Couldn't resolve host 'wptest']

    Is there a way to make this work in my local development environment? The web site that I run is only locally accessible on my Mac.

    http://wordpress.org/extend/plugins/jetpack/

  2. Tim Moore
    Moderator
    Plugin Author

    Posted 2 years ago #

    Currently, no, it is not possible. We are considering ways to make this available so folks can test Jetpack with development sites, but I don't have an ETA on if or when it will be possible.

  3. janw.oostendorp
    Member
    Posted 1 year ago #

    I can understand that jetpack needs wp.com for the comments and stats, but there is no reason that the widgets and the gallery isn't accessible locally

  4. onepack
    Member
    Posted 1 year ago #

    I have two modules activated that jetpack can replace but I have no way to test this. It's not an option to do this on a busy site so offline testing is mandatory. Now I can only use it for the stats.

  5. Devin Walker
    Member
    Posted 1 year ago #

    +1 for local development capability.

  6. Nadreck
    Member
    Posted 1 year ago #

    +1 as well. This is a pretty major hindrance to the development cycle.

  7. Little Boy Running
    Member
    Posted 1 year ago #

    +1 yep, what they said...
    I think developers would be more than OK to accept that some features or obviously not available when the website is not public. Needing to dev on a live server is really time consuming...
    Thanks!

  8. squeakydave
    Member
    Posted 1 year ago #

    +2 from me. Jetpack consolidates quite a bit of useful functionality in one up-datable place. Ideal for my clients. Offline testing is a must.

  9. phoenixMagoo
    Member
    Posted 1 year ago #

    +1 from me. I really need to be able to get everything going on a development server before moving into production.

  10. msenate
    Member
    Posted 1 year ago #

    +1, indeed. Considering making the switch and this is the only thing holding me up.

  11. noyz319
    Member
    Posted 1 year ago #

    So this has been resolved?

  12. peterwsterling
    Member
    Posted 1 year ago #

    +1 here too: it's essential to be able to test out features and configurations before releasing in to the wild...

  13. Cristian Nistor
    Member
    Posted 1 year ago #

    +1

    I vote for this option too

  14. Lumpysimon
    Member
    Posted 1 year ago #

    adding my name to the list - this is essential for me when developing client sites.

    (i'm not sure why this thread is marked as resolved, it's certainly still an issue as of version 2.0.2)

  15. edwinvanolst
    Member
    Posted 1 year ago #

    +1

    For now, you can trick jetpack into thinking it is connected by modifying plugins/jetpack/jetpack.php (version 2.0.2 on wp 3.4)

    Edit is_active() around line 274:

    function is_active() {
    	return true;
    	//return (bool) Jetpack_Data::get_access_token( JETPACK_MASTER_USER );
    }

    Edit $is_connected and $is_user_connected in admin_page() around line 2213:
    $is_connected = true; //Jetpack::is_active()
    $is_user_connected = true; //$user_token && !is_wp_error($user_token)

    source

  16. pjv
    Member
    Posted 1 year ago #

    I also don't understand why this is marked resolved. edwinvanolst's hack notwithstanding, there is still no proper way to test jetpack prior to putting it into production.

    I started another thread about the same issue with a little twist here.

  17. msenate
    Member
    Posted 1 year ago #

    Though I agree this thread should not be resolved, and the hack above is not the desired functionality...

    I Turned those changes into a simplified patch I'm employing:

    Index: jetpack/jetpack.php
    ===================================================================
    --- jetpack/jetpack.php (revision 3732)
    +++ jetpack/jetpack.php (working copy)
    @@ -272,7 +272,7 @@
             * Is Jetpack active?
             */
            function is_active() {
    -               return (bool) Jetpack_Data::get_access_token( JETPACK_MASTER_USER );
    +               return true; // return (bool) Jetpack_Data::get_access_token( JETPACK_MASTER_USER );
            }
    
            /**
    @@ -2211,7 +2211,7 @@
                    $role = $this->translate_current_user_to_role();
                    $is_connected = Jetpack::is_active();
                    $user_token = Jetpack_Data::get_access_token($current_user->ID);
    -               $is_user_connected = $user_token && !is_wp_error($user_token);
    +               $is_user_connected = true; // $user_token && !is_wp_error($user_token);
                    $is_master_user = $current_user->ID == Jetpack::get_option( 'master_user' );
                    $module = false;
            ?>

    To apply the patch use, save the snippet above as jetpack_localhost.diff then issue this command:

    patch -p0 -i ~/jetpack_localhost.diff
  18. davebowker
    Member
    Posted 1 year ago #

    +1

  19. Beren
    Member
    Posted 1 year ago #

    +1 for local development.

  20. Ian Dunn
    Member
    Posted 1 year ago #

    +1.

    I'm trying to debug a conflict between Jetpack and one of my plugins, and it's a pain in the ass because I can't step through the code with a real debugger.

    The hack from WPSE gets rid of the warnings, but doesn't seem to make Jetpack run exactly the same way that it does when it's actually connected to WordPress.com. Individual modules may also need to be hacked, like force_user_connection() in publicize/publicize-jetpack.php.

    I think there should be a filter that devs can set in order to make Jetpack behave exactly as if it's fully connected, including all the modules. e.g.,

    add_filter( 'jetpack_imitate_connected', '__return_true' );
  21. andrewayala
    Member
    Posted 1 year ago #

    +1

  22. abdusm
    Member
    Posted 1 year ago #

    +1 | need it for local website building on bitnami wordpress

  23. Adriasil
    Member
    Posted 1 year ago #

    Would really love a local version to test with.

    Having all of those features available on my site online is brilliant, but there is a major inconvenience if you want to use anything from Jetpack to feature in a theme that's currently in development.

  24. Jon Brown
    Member
    Posted 1 year ago #

    +1

    Who marked this as resolved?

  25. jdran
    Member
    Posted 1 year ago #

    +1 from me..
    Local development is really important, I wonder why there is still no pure solution for this.
    The hack is a temp solution, but Jetpack developers should have given/suggested such a similar trick to us until a stable one is out... Instead, we have to look out for what other folks have to suggest..

  26. g30rd13
    Member
    Posted 1 year ago #

    Not sure if this is too late for many of you folk but after much the same frustration I came across this today...

    http://www.wordimpressed.com/plugins/how-to-use-wordpress-jetpack-for-local-development/

    I haven't needed to test all the modules but it does work on two or three I do need.
    That said I'm having trouble serving up images to my 'Tiled Gallery' module...
    perhaps something to do with the required 'extra-special processing' ?

  27. Shovan Sargunam
    Member
    Posted 1 year ago #

    +1

  28. aah08b
    Member
    Posted 1 year ago #

    +1
    This would be very helpful for testing.

  29. Jeremy Herve
    Happiness Engineer
    Plugin Author

    Posted 1 year ago #

    Jetpack 2.2 cannot be used in a local environment yet, but we worked on this feature, and it will be available in the next Jetpack release.

    You can already test it by installing the development version of Jetpack, available here:
    http://wordpress.org/extend/plugins/jetpack/developers/

    You can find out more about the new development mode here:
    http://plugins.trac.wordpress.org/changeset/674577
    http://plugins.trac.wordpress.org/changeset/676269

  30. pacovalverde
    Member
    Posted 1 year ago #

    +1 ... me too... go local!!!!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic