Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Theme URI and Author URI #56

Closed
ghost opened this issue Apr 9, 2015 · 5 comments
Closed

Theme URI and Author URI #56

ghost opened this issue Apr 9, 2015 · 5 comments

Comments

@ghost
Copy link

ghost commented Apr 9, 2015

Theme URI and Author URI cannot be the same, which comes to..

users can bypass this if use a "/" at the end of a uri.

theme uri: http://www.domainname.com
author uri: http://www.domainname.com/

@emiluzelac
Copy link
Contributor

@emiluzelac emiluzelac mentioned this issue Apr 13, 2015
@Otto42
Copy link
Member

Otto42 commented Jun 1, 2015

Seems a bit minor to me. But if you want to make a PR, I'll accept it.

Note that there is no current check to see if they're the same, that's one of the old hardcoded bits. Make a new check for it.

@carolinan
Copy link
Collaborator

Are there any links besides Theme URI with WordPress.org that we should disallow?

  <?php

class Check_URI implements themecheck {
    protected $error = array();

    function check( $php_files, $css_files, $other_files ) {

        checkcount();
        $ret = true;
        global $data;

        if ( !empty( $data['AuthorURI'] ) && !empty( $data['URI'] ) ) {

            if ( strtolower( preg_replace('/https?:\/\/|www./i', '', trim( $data['URI'] , '/' ) ) ) == strtolower( preg_replace('/https?:\/\/|www./i', '', trim( $data['AuthorURI'], '/' ) ) ) )  {
                $this->error[] = __('<span class="tc-lead tc-required">'.__('REQUIRED','theme-check').'</span>: '.__('Your Theme URI and Author URI should not be the same.', 'theme-check') );
            }

            //We allow .org user profiles as Author URI, so only check the Theme URI. We also allow WordPress.com links.
            if ( stripos( $data['URI'], 'wordpress.org' ) && $data[ 'AuthorName' ] <> "the WordPress team" ) {
                $this->error[] .= __('<span class="tc-lead tc-required">'.__('REQUIRED','theme-check').'</span>: '.__('Using a WordPress.org Theme URI is reserved for official themes.', 'theme-check') );
            }
        }

        return $ret;
    }

    function getError() { return $this->error; }
}
$themechecks[] = new Check_URI;

@Otto42
Copy link
Member

Otto42 commented Jan 1, 2016

You could add in the w.org domain as well, since it redirects.

@carolinan
Copy link
Collaborator

Actually perhaps this should be combined with links.php in one file.

@Otto42 Otto42 closed this as completed in 45fda93 Jan 2, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants