• Testing on localhost (Wampserver) and on the main options page see the following notices:

    Unknown 	has_cap was called with an argument that is deprecated since version 2.0! Usage of user levels by plugins and themes is deprecated. Use roles and capabilities instead. on line 3006 in file C:\wamp\www\wordpress38beta\wp-includes\functions.php
    Notice 	Undefined index: action on line 410 in file C:\wamp\www\wordpress38beta\wp-content\plugins\image-teleporter\image-teleporter.php
    Notice 	Undefined index: action on line 440 in file C:\wamp\www\wordpress38beta\wp-content\plugins\image-teleporter\image-teleporter.php
    Notice 	Undefined index: action on line 455 in file C:\wamp\www\wordpress38beta\wp-content\plugins\image-teleporter\image-teleporter.php

    I use this plugin http://wordpress.org/plugins/blackbox-debug-bar/ for the notices.

    BTW it says WordPress 38beta, but it’s been updated to the latest version of WordPress (currently 3.8) since I created that test install, so this is all in latest WordPress.

    I edited a post to test some external links, basically added some content with external links and after clicking the update button get the following fatal error:

    Fatal error: Class 'finfo' not found in C:\wamp\www\wordpress38beta\wp-content\plugins\image-teleporter\image-teleporter.php on line 136

    the post was saved, so the new content was added to the post, though the external link wasn’t changed to local.

    Activating the PHP extension php_fileinfo removed the fatal error and the processing works, might consider adding a check for that extension, though pretty sure most production servershave that extension active.

    On the batch processing page leaving the settings at their defaults and process 5 posts it’s working, do get these notices when posts processed have external images:

    Unknown 	has_cap was called with an argument that is deprecated since version 2.0! Usage of user levels by plugins and themes is deprecated. Use roles and capabilities instead. on line 3006 in file C:\wamp\www\wordpress38beta\wp-includes\functions.php
    Notice (51) 	Use of undefined constant i - assumed 'i' on line 99 in file C:\wamp\www\wordpress38beta\wp-content\plugins\image-teleporter\image-teleporter.php
    Notice (51) 	Undefined index: i on line 99 in file C:\wamp\www\wordpress38beta\wp-content\plugins\image-teleporter\image-teleporter.php

    So it’s working, but for best plugin practices the notices should be removed.

    Ran the plugin on a live site and it seems to have processed correctly other than three images. Not checked all three yet, one post was linking to a broken image at http://img515.imageshack.us/img515/5352/makeuptipsforthewedding.jpg after processing the src part of the link code was empty. Looks like that’s what I’m seeing on all three posts, the img code is there minus the image.

    You might want to look into that, if a server is down when you run the plugin will it delete the temporarily broken link? Ideally I’d want the broken link left as is so I can manually fix it, look for an alternative or if it is temporary down wait for the sites server to be working. I use http://wordpress.org/plugins/broken-link-checker/ for checking for broken links, also easy to use to check where an image is hosted which is how I found the three broken images.

    The live site I tested on is using the Domain Mapping Plugin, didn’t cause any problems.

    Nice plugin 🙂

    David

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author InternetMedicineMan

    (@internetmedicineman)

    Hi David,

    Fixed the warnings and cleaned up the code a little more. finfo should be a standard extension on a production server but I’ll look at fixing that as well.

    I need to investigate the missing link issue. It is set up to only replace if there was no error on the image. So I’m curious what happens here. Thanks for point it out so I can look into it further. For now it is recommended you run a broken-link-checker in advance as you suggest.

    Also thanks for the heads up on the blackbox debug bar. Looks like a handy tool.

    Finfo wasn’t installed on a server at MediaTemple, so it broke when we tried to use it. I think you should check on that.

    Here’s what I did for a workaround, around line 134:

    function _mime_content_type($filename) {
    	if (!function_exists('finfo')) {
    		return mime_content_type($filename);
    	}
    	// Instantiate finfo
    	$result = new finfo();
    	// Get Mime Type with PHP 5.3 compatible method
    	if (is_resource($result) === true) {
    		return $result->file($filename, FILEINFO_MIME_TYPE);
    	}
    	return false;
    }

    Then, unfortunately due to the weird server setup, we have a recent version of PHP that is compiled without finfo yet also has the mime_content_type function removed, so I added THAT as well, using some handy code found at thanks to Vogal.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Works Though Needs a Small Number of PHP Notices Fixing’ is closed to new replies.