Skip to content

Instantly share code, notes, and snippets.

@johnregan3
Last active February 13, 2016 01:56
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save johnregan3/4a145185d97dd33806ad to your computer and use it in GitHub Desktop.
Save johnregan3/4a145185d97dd33806ad to your computer and use it in GitHub Desktop.
My "improved" version of the AdvancedWP rules :D
<?php
/**
* Plugin Name: John Regan's Improved AWP Rules
* Plugin URI: https://gist.github.com/johnregan3/4a145185d97dd33806ad
* Version: 1.0
*
* @see http://www.advancedwp.org/awp-contribution-rules/
*
* Description: Yes, I get it -- this document was never intended to be technical, it's intended to be fun and readable.
* This is not intended to be a criticism of the original in any way; it's just a way for me to introduce myself to the group,
* and have some fun while doing it.
* I'm looking forward to your constructive criticisms and comments. :D
*
* Author: John Regan
* Author URI: http://johnregan3.com
* License: GPLv2+
* License URI: http://www.gnu.org/licenses/gpl-2.0.txt
* Text Domain: jr3-improved-awp-rules
*
* @author John Regan <john.m.regan@gmail.com>
* @twitter johnregan3
* @wp_org johnregan3
* @wp_slack johnregan3
*
* Copyright (c) 2016 John Regan (https://johnregan3.com/)
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License, version 2 or, at
* your discretion, any later version, as published by the Free
* Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
* @package jr3_improved_awp_rules
*/
/**
* Global Definitions.
*
* How do we defined what "Advanced" really is?
*
* @since version 1.0
*/
define( 'ADVANCED', __( 'While very subjective, we define it as anything involving building or tweaking code', 'jr3-improved-awp-rules' ) );
/**
* Main Function of the Group.
*
* This informs how admins moderate content.
*
* @param string $yourquestion Your Question.
* @param bool $allowed If your question is allowed.
*
* @return bool
*
* @since version 1.0
*/
function awp_how_to_contribute( $yourquestion, $allowed = true ) {
switch ( $yourquestion ) {
case 'I have a problem...' :
if ( ! did_google_search() || ! check_docs() ) {
$allowed = false;
esc_html_e( 'Please try Google or checking docs before asking your question.', 'jr3-improved-awp-rules' );
} else {
$allowed = true;
esc_html_e( 'Sure. We\'ll chime in if we can. A lot of learning happens by figuring out difficult problems. But we\'re not going to fix a plugin or theme for you. Please go to the Support forum of that product. If the author is unresponsive, link to your support question and ask if anyone knows the author. Maybe we can help connect you.', 'jr3-improved-awp-rules' );
}
break;
case 'I have a project I\'m working on I want to share...' :
$allowed = true;
esc_html_e( 'We love it. Give us context and provoke conversation, don\'t just drop a random link', 'jr3-improved-awp-rules' );
break;
case 'I need to hire someone for a job or a project...' :
$allowed = true;
esc_html_e( 'Post a link to the listing, or describe what you are looking for and make sure that you ask inquiries to contact you OUTSIDE the group. We don\'t want conversations about the job happening in the group.', 'jr3-improved-awp-rules' );
break;
case 'I\'m looking for a plugin that...' :
$allowed = false;
break;
case 'I\'m looking for a theme that...' :
$allowed = false;
break;
case 'I really hate this one plugin or theme or company and want to rant about it' :
$allowed = false;
break;
default :
esc_html_e( 'Do your research, work hard, don\'t poll the group for our expertise. If you bring value, you\'ll receive 10 times more value. If you spam or gripe, you won\'t last long here.', 'jr3-improved-awp-rules' );
}
return $allowed;
}
/**
* Because Sometimes Your Question is not Advanced.
*
* Fallback conditions for when awp_how_to_contribute() isn't always enough.
*
* @param bool $allowed If your comment is allowed.
* @param string $yourquestion Your Question.
*
* @return void
*
* @since version 1.0
*/
function awp_maybe_question_is_not_advanced( $allowed, $yourquestion ) {
if ( true === $allowed && ADVANCED !== $yourquestion ) {
esc_html_e( 'We welcome all people, and we can help wherever we can. Whether or not a question is advanced TO YOU really doesn\'t matter. Ignore stuff you don\'t like, ask the question whether you think it\'s Advanced or not (as long as it\'s $allowed)', 'jr3-improved-awp-rules' );
}
}
/**
* How Members can Help Moderate.
*
* Fallback for members when Admins aren't enough, which is often…
*
* @param bool $allowed If the contribution is allowed.
* @param bool $exists The contribution exists.
*
* @return void
*
* @since Version 1.0
*/
function awp_maybe_user_helps_moderate( $allowed, $exists = true ) {
if ( false === $allowed && $exists ) {
esc_html_e( 'Report to Admin is your friend. Please report anything you see that doesn\'t belong in the group. DO NOT comment on it. Don\'t be snarky about it', 'jr3-improved-awp-rules' );
}
}
@mathetos
Copy link

Well done. Thanks for contributing!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment