Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

WordPress

Can't add plug ins on local wordpress site

I'm developing a portfolio site for myself and I went to add a new plug in and I ran into this issue.

"Warning: An unexpected error occurred. Something may be wrong with WordPress.org or this server’s configuration. If you continue to have problems, please try the support forums. (WordPress could not establish a secure connection to WordPress.org. Please contact your server administrator.) in /Applications/MAMP/htdocs/tyler-renfro.dev/wp-admin/includes/plugin-install.php on line 83"

These are lines 80-85, but I can't seem to figure out what is triggering the error. I think it's a network issue. I've tried deactivating and reactivating plug ins as well as changing themes.

$request = wp_remote_post( $url, $args );

        if ( $ssl && is_wp_error( $request ) ) {
            trigger_error( __( 'An unexpected error occurred. Something may be wrong with WordPress.org or this server’s configuration. If you continue to have problems, please try the <a href="https://wordpress.org/support/">support forums</a>.' ) . ' ' . __( '(WordPress could not establish a secure connection to WordPress.org. Please contact your server administrator.)' ), headers_sent() || WP_DEBUG ? E_USER_WARNING : E_USER_NOTICE );
            $request = wp_remote_post( $http_url, $args );
        }

1 Answer

Colin Marshall
Colin Marshall
32,861 Points

This won't fix the error, but until you get it resolved you can always download plugins and manually place them in the wp-content/plugins folder.