#3626 closed enhancement (fixed)
Add a report theme button
Reported by: | acosmin | Owned by: | 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.
Thanks, it would be highly appreciated if this can be done.
Change History (16)
#3
follow-up:
↓ 4
@
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
Where g5141-message
is the textarea. We have some possibilities here.
#4
in reply to:
↑ 3
@
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
@
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
@
7 years ago
Current fields and their IDs are:
Name: rep-name
Email: rep-email
Theme URL: rep-theme
Subject: rep-subject
#7
@
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.
#8
@
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
@
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 }
This ticket was mentioned in Slack in #themereview by acosmin. View the logs.
7 years ago
#12
@
7 years ago
- Owner set to dd32
- Resolution set to fixed
- Status changed from new to closed
In 7272:
#14
@
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.
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.