Making WordPress.org

Opened 7 years ago

Closed 7 years ago

Last modified 5 years ago

#3626 closed enhancement (fixed)

Add a report theme button

Reported by: acosmin's profile acosmin Owned by: dd32's profile dd32
Milestone: Priority: high
Component: Theme Directory Keywords:
Cc:

Description

Hi! Over at TRT we're trying to loosen up our requirements, but we need someway for normal users to get in contact with us if they find major issues in themes (like malware or white screen PHP errors).

A way to do this is through a report button. I'm not expecting a contact form, just a simple message and a button, like in the attached image. The button would just need to link like so:
<a href="mailto:themereviewteam@mail.com?Subject=ThemeName%20Username

Where ThemeName and Username can be easily added with some php.

https://i.imgur.com/giTf0qq.jpg

Thanks, it would be highly appreciated if this can be done.

Change History (16)

#1 @acosmin
7 years ago

  • Type changed from defect to enhancement

#2 @tobifjellner
7 years ago

You may also specify a template message in the body that will hint the user to what information would be good to include in the text.

#3 follow-up: @acosmin
7 years ago

Another way would be for us to create a contact form on make.themes and the report button will link to it. We could also populate the fields with some parameters like username and email address.

Here is a test draft (for those with access to make.themes): https://make.wordpress.org/themes/?page_id=5141&g5141-message=SomethingHere (this can be the link on the button)

Where g5141-message is the textarea. We have some possibilities here.

Last edited 7 years ago by acosmin (previous) (diff)

#4 in reply to: ↑ 3 @dd32
7 years ago

Replying to acosmin:

Another way would be for us to create a contact form on make.themes and the report button will link to it. We could also populate the fields with some parameters like username and email address.

I think this might actually be the simplest and most straight forward first iteration. I don't think it'd last forever, but would likely serve the immediate need.

What details would you want to include? I'm thinking that adding a few extra data points is probably relatively easy and likely to significantly increase review effectiveness.

  • Theme Name
  • Theme URL
  • Latest Trac ticket
  • ??

#5 @acosmin
7 years ago

@dd32 thank you for taking a look over this.

We'll just need the Theme URL, something like https://wordpress.org/themes/twentyseventeen/. Browse the Code contains all the info we need.

I'm not sure if we should or shouldn't make the report button visible only to logged in users. In this case we could populate the Name and Email fields with the current logged in user's info. If the user is logged in, it would be helpful to make these fields type="hidden", the problem is Jetpack hasn't this attribute and I don't have access to post javascript :) it would be easy to hide.

If we're allowing non logged in users, then we're just going to keep the Name and Email fields visible, required and not populated...

#6 @acosmin
7 years ago

Current fields and their IDs are:

Name: rep-name
Email: rep-email
Theme URL: rep-theme
Subject: rep-subject

Last edited 7 years ago by acosmin (previous) (diff)

#7 @acosmin
7 years ago

@dd32 I tried to make the code for the report button:

<div class="theme-report">
        <h4><?php _e( 'Report', 'wporg-themes' ); ?></h4>
        <p><?php _e( 'Does this theme have major issues?', 'wporg-themes' ); ?></p>
        <?php
        $current_user = wp_get_current_user();
        $report_url = add_query_arg( 
                array(
                        'rep-name'    => is_user_logged_in() ? $current_user->ID : null,
                        'rep-email'   => is_user_logged_in() ? $current_user->user_email : null,
                        'rep-theme'   => 'https://wordpress.org/themes/' . $theme->slug . '/',
                        'rep-subject' => esc_attr( __( 'Reported Theme: ', 'wporg-themes' ) . $theme->name )
                ),
                '//make.wordpress.org/themes/report-theme/' 
        );
        ?>
        <a rel="nofollow" href="<?php echo esc_url( $report_url ); ?>" class="button button-secondary"><?php _e( 'Report this theme', 'wporg-themes' ); ?></a>
</div><!-- .theme-report -->

I think the class name .theme-report will also need to be added next to .theme-support, in the stylesheet. It has a font-size style from what I can see. Or we can just use the theme-support class name.

Preferably, this piece of html should be added before or after theme-support div, just so it gets noticed.

Last edited 7 years ago by acosmin (previous) (diff)

#8 @acosmin
7 years ago

I did publish the page, no harm in doing it, you can check it here: https://make.wordpress.org/themes/report-theme/

All that remains is to add the button :)

#9 @acosmin
7 years ago

I don't know if I'm allowed to use the Customizer > Additional CSS section, but I would like to add 2 or 3 lines of CSS:

.page-id-5141 .contact-form > div:nth-child(3), 
.page-id-5141 .contact-form > div:nth-child(4), 
.page-id-5141.logged-in .contact-form > div:nth-child(-n+2), 
.page-id-5141.logged-in .entry-content > hr:first-child { display: none; }
.page-id-5141 .pushbutton-wide { padding: 1.2em, font-size: 1em, font-weight: 700 }
Version 3, edited 7 years ago by acosmin (previous) (next) (diff)

This ticket was mentioned in Slack in #themereview by acosmin. View the logs.


7 years ago

#11 @acosmin
7 years ago

@dd32 any help with this would be really appreciated :)

#12 @dd32
7 years ago

  • Owner set to dd32
  • Resolution set to fixed
  • Status changed from new to closed

In 7272:

Theme Directory: Add a 'Report this theme' button.

Fixes #3626

#13 @dd32
7 years ago

In 7273:

Theme Directory: Bump script/stylesheet versions following [7272].

See #3626

#14 @dd32
7 years ago

Deployed something for you.

Notes:

  • Using themes@ w.org as the destination.
  • Can't pre-fill user details other than the username
  • Name / Email fields are shown on the report page
  • Subject field is shown on the report page as otherwise it doesn't have any reference to what is being reported.

Maybe in a future iteration of this the landing page for reporting could be more than a form and remove most of the above caveats.

This ticket was mentioned in Slack in #themereview by acosmin. View the logs.


6 years ago

This ticket was mentioned in Slack in #themereview by acosmin. View the logs.


5 years ago

Note: See TracTickets for help on using tickets.