npr / nprapi-wordpress

Access the NPR API from within WordPress. This repository is no longer being maintained. See the README for more information.
GNU General Public License v2.0
13 stars 30 forks source link

Fixed PHP 5.6 Strict Standards Error #32

Closed mikeschinkel closed 8 years ago

mikeschinkel commented 8 years ago

When using PHP 5.6 or PHP 7.0 and debugging options as follows set on the NPR Story API plugin currently throws errors.

define( 'WP_DEBUG', true );
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);

You can see the errors shown in this PDF file; look for the first two errors.

benlk commented 8 years ago

Looks good to me, with the exception of that possibly-not-closed <p>.

benlk commented 8 years ago

In PHP 5.3, this error still shows:

PHP Notice:  Undefined property: stdClass::$url in /vagrant/wp-content/plugins/WP-DS-NPR-API/classes/NPRAPI.php on line 164, referer: http://vagrant.dev/wp-admin/options-general.php?page=ds_npr_api_get_multi_settings

https://github.com/newclarity/nprapi-wordpress/blob/2736600801384c65604b40362ea022044e077a3f/classes/NPRAPI.php#L164 :

      if (empty($this->request->params) && !stristr($this->request->url, 'sort=')){
        $this->stories = array_reverse($this->stories);
      } 
mikeschinkel commented 8 years ago

@benlk

PHP Notice: Undefined property: stdClass::$url...

That was outside the scope of my changes. However, https://github.com/nprds/nprapi-wordpress/pull/32/commits/2f35137a6ac6b8eb5037ff52fe2553633d824cbf which is now part of this PR hopefully resolves that issue?

benlk commented 8 years ago

No more errors here!

mikeschinkel commented 8 years ago

Anything else needed to merge this?