WordPress.org

Make WordPress Themes

Opened 2 years ago

Closed 2 years ago

Last modified 2 years ago

#6095 closed theme (not-approved)

THEME: Duotone - 2.1

Reported by: automattic Owned by: kwight
Priority: Keywords: theme-duotone
Cc: themes@…

Description

Duotone - 2.1

A brilliant photoblogging theme with a dynamic background color based on the colors in your photos. Includes three widget areas, custom menu support, and EXIF display for photos. Duotone is a much-improved successor to Monotone.

Theme URL - http://theme.wordpress.com/themes/duotone/
Author URL - http://automattic.com/

SVN - http://themes.svn.wordpress.org/duotone/2.1
ZIP - http://wordpress.org/extend/themes/download/duotone.2.1.zip?nostats=1

Diff with previous version: http://themes.trac.wordpress.org/changeset?old_path=/duotone/1.0.1&new_path=/duotone/2.1

All previous tickets for this theme: http://themes.trac.wordpress.org/query?col=id&col=summary&col=keywords&col=owner&col=status&col=resolution&keywords=~theme-duotone&order=id

https://themes.svn.wordpress.org/duotone/2.1/screenshot.png

Change History (9)

comment:1 automattic2 years ago

Hello,

Duotone is a photoblogging theme which behaves a bit differently than standard themes. Deviations from the review guidelines have been listed below. Some are specific design decisions while others ensure compatibility for users upgrading from version 1.1.

Sticky Posts

Duotone will force the display of posts to one per page where is_home() returns true. Because of this feature, posts marked as sticky will not "stick" to the homepage; they will be displayed as normal posts in order of date posted.

Custom Option

Duotone v1.1 uses a custom option named "background_color" enabling the user to override the custom background color that it generates for a post based on the first uploaded image. This option has been deprecated in favor of the core Appearance -> Background screen. The deprecated "background_color" option is still recognized by Duotone v2.1 to respect the settings of users who choose to upgrade.

Custom Background

For backwards compatibility with older versions, the custom background color will only be displayed in single posts and pages as well as where is_home() returns true. Date, category and tag archives as well as search results and 404's will see a white background.

Post Meta

Duotone v1.1 used a handful of custom post meta key/value pairs to store information pertaining to the first image present in the post_content. To comply with the guidelines, these postmeta entries have been reworked and are currently being stored as a serialized array with a key of "_duotone". For backward compatibility, the v1.1 keys are still recognized and will be used to fill the new postmeta entry when an older post is updated.

Widgets

Duotone provides a widget area at the bottom of the template. This area provides space for 3 widgets. All others will be removed via javascript. This areas will not display in archive templates.

Thanks for reviewing Duotone!

comment:2 kwight2 years ago

  • Owner set to kwight
  • Status changed from new to assigned

comment:3 kwight2 years ago

  • Resolution set to not-approved
  • Status changed from assigned to closed

Required

Not approved, due to above requirements.

This is a partial review; there may be other issues that would prevent approval. Please be sure to check all requirements as outlined in the Theme Review Guidelines, found at http://codex.wordpress.org/Theme_Review, before submitting a newer version.

Keep up on the latest developments in theme requirements by subscribing to the Theme Review mailing list (http://lists.wordpress.org/mailman/listinfo/theme-reviewers) and the Theme Review Team's website (http://make.wordpress.org/themes/).

Thank you!

comment:4 automattic2 years ago

Hello,

Thanks for reviewing Duotone!

I will remove htaccess.txt in the next commit. I was wondering if you could provide more information regarding the php error that you reported. Which template or admin screen triggers it? Under which conditions?

Thanks!

comment:5 kwight2 years ago

Hi Michael,

The error is: "WARNING: wp-content/themes/duotone/inc/duotone.php:494 - getimagesize() [function.getimagesize]: Filename cannot be empty"

It seems to refer to $defaults['url'], which stays empty if there's no photo in the post to scrape; as soon as I attach a photo to a post, it goes away. You can see this with any of the Theme Unit test data posts that don't have images.

comment:6 automattic2 years ago

Thanks for the feedback on the error!

I was not able to duplicate this error on my test server. The reported line in Duotone looks like this:

/*
 * Suppress getimagesize() from generating E_NOTICE & E_WARNING
 * level warnings if image cannot be found or read.
 */
$size = @getimagesize( self::get_image_path( $defaults['url'] ) );

Note that the error suppression operator has been used on getimagesize(). To my knowledge, the only way to override @ is to install xDebug and set the "xdebug.scream" option to "1". Is it possible that your testing server is configured this way?

I just wanted to ask this before submitting another version. While I can easily "work around" the error you reported another warning will be generated in cases where the image cannot be read. Error suppression should be enough to meet the requirements in this case.

comment:7 kwight2 years ago

The error is picked up by the Debug Bar plugin, which all reviewers use to catch errors while reviewing.

Error suppression techniques are certainly above my knowledge; I'll check on the theme-reviewers mailing list for some advice. Thanks for your patience!

comment:8 chipbennett2 years ago

While I can easily "work around" the error you reported another warning will be generated in cases where the image cannot be read. Error suppression should be enough to meet the requirements in this case.

Errors should be resolved, not suppressed. Wouldn't an if ( isset( $defaults['url'] ) ) conditional wrapper (or ternary) sufficiently resolve this notice?

comment:9 Otto422 years ago

Error suppression using @ just stops the PHP error handler from being called on an error. If you have custom error handlers, like the Debug Bar does, then those still get called.

Info here: http://php.net/manual/en/function.set-error-handler.php
And here: http://php.net/manual/en/language.operators.errorcontrol.php

Error suppression isn't error correction. In other words, the error isn't "fixed", it's just been hidden from output by the normal PHP error handler.

The basic problem with this line:

$size = @getimagesize( self::get_image_path( $image_url ) );

is that the get_image_path function is capable of returning things to getimagesize that are invalid inputs. In this particular case, it's returning the empty string (or equivalent).

In which case a check for empty should be made explicit. For example:

$path = self::get_image_path( $image_url );
if ( !empty( $path ) ) 
   $size = @getimagesize( $path );
Note: See TracTickets for help on using tickets.