Plugin Directory

Changeset 1265965


Ignore:
Timestamp:
10/14/2015 03:54:24 PM (10 years ago)
Author:
DobsonDev
Message:

Tagging Version 1.1.9

Location:
dobsondev-shortcodes
Files:
3 edited
7 copied

Legend:

Unmodified
Added
Removed
  • dobsondev-shortcodes/tags/1.1.9/changelog.txt

    r1219299 r1265965  
    99Bug Fixes
    1010
     11* Found a bug where the GitHub Readme and GitHub File Contents shortcodes would not return anything because cURL was unable to verify the certificate provided by the server. This can now be avoided using the insecure="true" attribute on the shortcode. Thanks to [JacobD10](https://profiles.wordpress.org/jacobd10/) for finding the error. (1.1.9)
     12* More substantial error handling has been added to both the GitHub Readme and GitHub File Contents shortcodes which should help users identify what kind of cURL error they are getting. (1.1.9)
    1113* Tested up to WordPress 4.3 (1.1.8)
    1214* Added the tags for tested up to WordPress 4.2.4 (1.1.7)
  • dobsondev-shortcodes/tags/1.1.9/dobsondev-shortcodes.php

    r1219299 r1265965  
    44 * Plugin URI: http://dobsondev.com/portfolio/dobsondev-shortcodes/
    55 * Description: A collection of helpful shortcodes.
    6  * Version: 1.1.8
     6 * Version: 1.1.9
    77 * Author: Alex Dobson
    88 * Author URI: http://dobsondev.com/
     
    9797    'repo' => "NULL",
    9898    'cache_id' => "NULL",
     99    'insecure' => "NULL",
    99100  ), $atts));
    100101  if ($owner == "NULL" || $repo == "NULL") {
     
    105106      // we do not have a transient stored so we have to make the API call
    106107      $curl = curl_init();
    107       curl_setopt_array($curl, array(
    108         CURLOPT_RETURNTRANSFER => 1,
    109         CURLOPT_URL => 'https://api.github.com/repos/' . $owner . '/' . $repo . '/readme',
    110         CURLOPT_USERAGENT => $repo,
    111         CURLOPT_HEADER => false
    112       ));
     108      if ( $insecure == "true" || $insecure == "TRUE" || $insecure == "yes" || $insecure == "YES" ) {
     109        // we have an insecure connection so we have to let cURL know that
     110        curl_setopt_array($curl, array(
     111          CURLOPT_RETURNTRANSFER => 1,
     112          CURLOPT_URL => 'https://api.github.com/repos/' . $owner . '/' . $repo . '/readme',
     113          CURLOPT_USERAGENT => $repo,
     114          CURLOPT_HEADER => false,
     115          CURLOPT_SSL_VERIFYPEER => false
     116        ));
     117      } else {
     118        // we are using the regular secure connection
     119        curl_setopt_array($curl, array(
     120          CURLOPT_RETURNTRANSFER => 1,
     121          CURLOPT_URL => 'https://api.github.com/repos/' . $owner . '/' . $repo . '/readme',
     122          CURLOPT_USERAGENT => $repo,
     123          CURLOPT_HEADER => false
     124        ));
     125      }
    113126      $response = curl_exec($curl);
    114127      // var_dump($response);
     128      if ( FALSE === $response ) {
     129        $output_error = '<strong>cURL ERROR</strong>: <span style="color: red">' . curl_error($curl) . '</span><br />';
     130        $output_error .= '<strong>Error #</strong>: <span style="color: red">' . curl_errno($curl) . '</span><br /><br />';
     131        $output_error .= 'If your error reads something like "SSL certificate problem: unable to get local issuer certificate" then please add the <strong>insecure="true"</strong> attribute to your shortcode.';
     132        return $output_error;
     133      }
    115134      $response_array = json_decode($response);
    116135      // var_dump($response_array);
     
    138157    'markdown' => "no",
    139158    'cache_id' => "NULL",
     159    'insecure' => "NULL",
    140160  ), $atts));
    141161  if ($owner == "NULL" || $repo == "NULL" || $path == "NULL") {
     
    146166      // we do not have a transient stored so we have to make the API call
    147167      $curl = curl_init();
    148       curl_setopt_array($curl, array(
    149         CURLOPT_RETURNTRANSFER => 1,
    150         CURLOPT_URL => 'https://api.github.com/repos/' . $owner . '/' . $repo . '/contents/' . $path,
    151         CURLOPT_USERAGENT => $repo,
    152         CURLOPT_HEADER => false
    153       ));
     168      if ( $insecure == "true" || $insecure == "TRUE" || $insecure == "yes" || $insecure == "YES" ) {
     169        // we have an insecure connection so we have to let cURL know that
     170        curl_setopt_array($curl, array(
     171          CURLOPT_RETURNTRANSFER => 1,
     172          CURLOPT_URL => 'https://api.github.com/repos/' . $owner . '/' . $repo . '/readme',
     173          CURLOPT_USERAGENT => $repo,
     174          CURLOPT_HEADER => false,
     175          CURLOPT_SSL_VERIFYPEER => false
     176        ));
     177      } else {
     178        // we are using the regular secure connection
     179        curl_setopt_array($curl, array(
     180          CURLOPT_RETURNTRANSFER => 1,
     181          CURLOPT_URL => 'https://api.github.com/repos/' . $owner . '/' . $repo . '/readme',
     182          CURLOPT_USERAGENT => $repo,
     183          CURLOPT_HEADER => false
     184        ));
     185      }
    154186      $response = curl_exec($curl);
    155187      // var_dump($response);
     188      if ( FALSE === $response ) {
     189        $output_error = '<strong>cURL ERROR</strong>: <span style="color: red">' . curl_error($curl) . '</span><br />';
     190        $output_error .= '<strong>Error #</strong>: <span style="color: red">' . curl_errno($curl) . '</span><br /><br />';
     191        $output_error .= 'If your error reads something like "SSL certificate problem: unable to get local issuer certificate" then please add the <strong>insecure="true"</strong> attribute to your shortcode.';
     192        return $output_error;
     193      }
    156194      $response_array = json_decode($response);
    157195      // var_dump($response_array);
  • dobsondev-shortcodes/tags/1.1.9/readme.txt

    r1219299 r1265965  
    77Requires at least: 2.5
    88Tested up to: 4.3
    9 Stable tag: 1.1.8
     9Stable tag: 1.1.9
    1010
    1111Add a collection of helpful shortcodes to your site.
     
    5656If you want to take advantage of WordPress' transient API for caching, simply enter an ID for the cache_id argument. Note that this ID can be anything other than "NULL", it doesn't necessarily have to be a number. Once entered this will cause the shortcode to cache the results of the API call for 24 hours. This means the shortcode will use those cached results and speed up the load times for 24 hours, at which point it will then call the API again to get any updates and use those cached results for another 24 hours.
    5757
     58If you're receiving an error similar to "SSL certificate : unable to get local issuer certificate" then please add the attribute insecure="true" to your shortcode. This stops cURL from verifying the peer's certificate which may be required in some cases depending on your server. If you would rather you can instead sdd the root CA (the CA signing the server certificate) to etc/ssl/certs/ca-certificates.crt which will allow secure connections to work. By default the shortcode will use secure connections.
     59
    5860**Embed GitHub Repo File Contents**
    5961
     
    6365
    6466If you want to take advantage of WordPress' transient API for caching, simply enter an ID for the cache_id argument. Note that this ID can be anything other than "NULL", it doesn't necessarily have to be a number. Once entered this will cause the shortcode to cache the results of the API call for 24 hours. This means the shortcode will use those cached results and speed up the load times for 24 hours, at which point it will then call the API again to get any updates and use those cached results for another 24 hours.
     67
     68If you're receiving an error similar to "SSL certificate : unable to get local issuer certificate" then please add the attribute insecure="true" to your shortcode. This stops cURL from verifying the peer's certificate which may be required in some cases depending on your server. If you would rather you can instead sdd the root CA (the CA signing the server certificate) to etc/ssl/certs/ca-certificates.crt which will allow secure connections to work. By default the shortcode will use secure connections.
    6569
    6670**Embed Twitch Stream**
     
    161165Bug Fixes
    162166
     167* Found a bug where the GitHub Readme and GitHub File Contents shortcodes would not return anything because cURL was unable to verify the certificate provided by the server. This can now be avoided using the insecure="true" attribute on the shortcode. Thanks to [JacobD10](https://profiles.wordpress.org/jacobd10/) for finding the error. (1.1.9)
     168* More substantial error handling has been added to both the GitHub Readme and GitHub File Contents shortcodes which should help users identify what kind of cURL error they are getting. (1.1.9)
    163169* Tested up to WordPress 4.3 (1.1.8)
    164170* Added the tags for tested up to WordPress 4.2.4 (1.1.7)
  • dobsondev-shortcodes/trunk/changelog.txt

    r1219299 r1265965  
    99Bug Fixes
    1010
     11* Found a bug where the GitHub Readme and GitHub File Contents shortcodes would not return anything because cURL was unable to verify the certificate provided by the server. This can now be avoided using the insecure="true" attribute on the shortcode. Thanks to [JacobD10](https://profiles.wordpress.org/jacobd10/) for finding the error. (1.1.9)
     12* More substantial error handling has been added to both the GitHub Readme and GitHub File Contents shortcodes which should help users identify what kind of cURL error they are getting. (1.1.9)
    1113* Tested up to WordPress 4.3 (1.1.8)
    1214* Added the tags for tested up to WordPress 4.2.4 (1.1.7)
  • dobsondev-shortcodes/trunk/dobsondev-shortcodes.php

    r1219299 r1265965  
    44 * Plugin URI: http://dobsondev.com/portfolio/dobsondev-shortcodes/
    55 * Description: A collection of helpful shortcodes.
    6  * Version: 1.1.8
     6 * Version: 1.1.9
    77 * Author: Alex Dobson
    88 * Author URI: http://dobsondev.com/
     
    9797    'repo' => "NULL",
    9898    'cache_id' => "NULL",
     99    'insecure' => "NULL",
    99100  ), $atts));
    100101  if ($owner == "NULL" || $repo == "NULL") {
     
    105106      // we do not have a transient stored so we have to make the API call
    106107      $curl = curl_init();
    107       curl_setopt_array($curl, array(
    108         CURLOPT_RETURNTRANSFER => 1,
    109         CURLOPT_URL => 'https://api.github.com/repos/' . $owner . '/' . $repo . '/readme',
    110         CURLOPT_USERAGENT => $repo,
    111         CURLOPT_HEADER => false
    112       ));
     108      if ( $insecure == "true" || $insecure == "TRUE" || $insecure == "yes" || $insecure == "YES" ) {
     109        // we have an insecure connection so we have to let cURL know that
     110        curl_setopt_array($curl, array(
     111          CURLOPT_RETURNTRANSFER => 1,
     112          CURLOPT_URL => 'https://api.github.com/repos/' . $owner . '/' . $repo . '/readme',
     113          CURLOPT_USERAGENT => $repo,
     114          CURLOPT_HEADER => false,
     115          CURLOPT_SSL_VERIFYPEER => false
     116        ));
     117      } else {
     118        // we are using the regular secure connection
     119        curl_setopt_array($curl, array(
     120          CURLOPT_RETURNTRANSFER => 1,
     121          CURLOPT_URL => 'https://api.github.com/repos/' . $owner . '/' . $repo . '/readme',
     122          CURLOPT_USERAGENT => $repo,
     123          CURLOPT_HEADER => false
     124        ));
     125      }
    113126      $response = curl_exec($curl);
    114127      // var_dump($response);
     128      if ( FALSE === $response ) {
     129        $output_error = '<strong>cURL ERROR</strong>: <span style="color: red">' . curl_error($curl) . '</span><br />';
     130        $output_error .= '<strong>Error #</strong>: <span style="color: red">' . curl_errno($curl) . '</span><br /><br />';
     131        $output_error .= 'If your error reads something like "SSL certificate problem: unable to get local issuer certificate" then please add the <strong>insecure="true"</strong> attribute to your shortcode.';
     132        return $output_error;
     133      }
    115134      $response_array = json_decode($response);
    116135      // var_dump($response_array);
     
    138157    'markdown' => "no",
    139158    'cache_id' => "NULL",
     159    'insecure' => "NULL",
    140160  ), $atts));
    141161  if ($owner == "NULL" || $repo == "NULL" || $path == "NULL") {
     
    146166      // we do not have a transient stored so we have to make the API call
    147167      $curl = curl_init();
    148       curl_setopt_array($curl, array(
    149         CURLOPT_RETURNTRANSFER => 1,
    150         CURLOPT_URL => 'https://api.github.com/repos/' . $owner . '/' . $repo . '/contents/' . $path,
    151         CURLOPT_USERAGENT => $repo,
    152         CURLOPT_HEADER => false
    153       ));
     168      if ( $insecure == "true" || $insecure == "TRUE" || $insecure == "yes" || $insecure == "YES" ) {
     169        // we have an insecure connection so we have to let cURL know that
     170        curl_setopt_array($curl, array(
     171          CURLOPT_RETURNTRANSFER => 1,
     172          CURLOPT_URL => 'https://api.github.com/repos/' . $owner . '/' . $repo . '/readme',
     173          CURLOPT_USERAGENT => $repo,
     174          CURLOPT_HEADER => false,
     175          CURLOPT_SSL_VERIFYPEER => false
     176        ));
     177      } else {
     178        // we are using the regular secure connection
     179        curl_setopt_array($curl, array(
     180          CURLOPT_RETURNTRANSFER => 1,
     181          CURLOPT_URL => 'https://api.github.com/repos/' . $owner . '/' . $repo . '/readme',
     182          CURLOPT_USERAGENT => $repo,
     183          CURLOPT_HEADER => false
     184        ));
     185      }
    154186      $response = curl_exec($curl);
    155187      // var_dump($response);
     188      if ( FALSE === $response ) {
     189        $output_error = '<strong>cURL ERROR</strong>: <span style="color: red">' . curl_error($curl) . '</span><br />';
     190        $output_error .= '<strong>Error #</strong>: <span style="color: red">' . curl_errno($curl) . '</span><br /><br />';
     191        $output_error .= 'If your error reads something like "SSL certificate problem: unable to get local issuer certificate" then please add the <strong>insecure="true"</strong> attribute to your shortcode.';
     192        return $output_error;
     193      }
    156194      $response_array = json_decode($response);
    157195      // var_dump($response_array);
  • dobsondev-shortcodes/trunk/readme.txt

    r1219299 r1265965  
    77Requires at least: 2.5
    88Tested up to: 4.3
    9 Stable tag: 1.1.8
     9Stable tag: 1.1.9
    1010
    1111Add a collection of helpful shortcodes to your site.
     
    5656If you want to take advantage of WordPress' transient API for caching, simply enter an ID for the cache_id argument. Note that this ID can be anything other than "NULL", it doesn't necessarily have to be a number. Once entered this will cause the shortcode to cache the results of the API call for 24 hours. This means the shortcode will use those cached results and speed up the load times for 24 hours, at which point it will then call the API again to get any updates and use those cached results for another 24 hours.
    5757
     58If you're receiving an error similar to "SSL certificate : unable to get local issuer certificate" then please add the attribute insecure="true" to your shortcode. This stops cURL from verifying the peer's certificate which may be required in some cases depending on your server. If you would rather you can instead sdd the root CA (the CA signing the server certificate) to etc/ssl/certs/ca-certificates.crt which will allow secure connections to work. By default the shortcode will use secure connections.
     59
    5860**Embed GitHub Repo File Contents**
    5961
     
    6365
    6466If you want to take advantage of WordPress' transient API for caching, simply enter an ID for the cache_id argument. Note that this ID can be anything other than "NULL", it doesn't necessarily have to be a number. Once entered this will cause the shortcode to cache the results of the API call for 24 hours. This means the shortcode will use those cached results and speed up the load times for 24 hours, at which point it will then call the API again to get any updates and use those cached results for another 24 hours.
     67
     68If you're receiving an error similar to "SSL certificate : unable to get local issuer certificate" then please add the attribute insecure="true" to your shortcode. This stops cURL from verifying the peer's certificate which may be required in some cases depending on your server. If you would rather you can instead sdd the root CA (the CA signing the server certificate) to etc/ssl/certs/ca-certificates.crt which will allow secure connections to work. By default the shortcode will use secure connections.
    6569
    6670**Embed Twitch Stream**
     
    161165Bug Fixes
    162166
     167* Found a bug where the GitHub Readme and GitHub File Contents shortcodes would not return anything because cURL was unable to verify the certificate provided by the server. This can now be avoided using the insecure="true" attribute on the shortcode. Thanks to [JacobD10](https://profiles.wordpress.org/jacobd10/) for finding the error. (1.1.9)
     168* More substantial error handling has been added to both the GitHub Readme and GitHub File Contents shortcodes which should help users identify what kind of cURL error they are getting. (1.1.9)
    163169* Tested up to WordPress 4.3 (1.1.8)
    164170* Added the tags for tested up to WordPress 4.2.4 (1.1.7)
Note: See TracChangeset for help on using the changeset viewer.