-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f11a363
commit 41cc342
Showing
28 changed files
with
962 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
.dsc-btn { | ||
-webkit-text-size-adjust: 100%; | ||
line-height: 1.618; | ||
text-rendering: optimizeLegibility; | ||
font-weight: 400; | ||
font-family: "Raleway", sans-serif !important; | ||
-webkit-tap-highlight-color: rgba(0, 0, 0, 0); | ||
text-align: center; | ||
word-wrap: normal; | ||
box-sizing: border-box; | ||
background: #7289da !important; | ||
border: none !important; | ||
padding: 8px 14px 8px 10px !important; | ||
margin: 10px 0 20px !important; | ||
display: inline-block !important; | ||
color: #ffffff !important; | ||
font-size: 14px !important; | ||
text-transform: none !important; | ||
text-decoration: none !important; | ||
transition: background 0.3s ease !important; | ||
white-space: normal !important; | ||
border-radius: 5px; | ||
} | ||
.dsc-btn-text { | ||
-webkit-text-size-adjust: 100%; | ||
line-height: 1.618; | ||
text-rendering: optimizeLegibility; | ||
font-weight: 400; | ||
font-family: "Raleway", sans-serif !important; | ||
-webkit-tap-highlight-color: rgba(0, 0, 0, 0); | ||
text-align: center; | ||
word-wrap: normal; | ||
color: #ffffff !important; | ||
font-size: 14px !important; | ||
text-transform: none !important; | ||
white-space: normal !important; | ||
box-sizing: border-box; | ||
} | ||
.dsc-btn-icon { | ||
-webkit-text-size-adjust: 100%; | ||
line-height: 1.618; | ||
text-rendering: optimizeLegibility; | ||
font-weight: 400; | ||
font-family: "Raleway", sans-serif !important; | ||
-webkit-tap-highlight-color: rgba(0, 0, 0, 0); | ||
text-align: center; | ||
word-wrap: normal; | ||
color: #ffffff !important; | ||
font-size: 14px !important; | ||
text-transform: none !important; | ||
white-space: normal !important; | ||
box-sizing: border-box; | ||
background-image: url("discord_icon.svg") !important; | ||
background-repeat: no-repeat !important; | ||
background-size: 100% !important; | ||
display: inline-block !important; | ||
height: 20px !important; | ||
width: 20px !important; | ||
vertical-align: middle !important; | ||
margin: -1px 10px 0 0 !important; | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
jQuery(document).ready(function($){ | ||
$('.smr-discord-embed-color-picker').wpColorPicker(); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<?php | ||
|
||
/** | ||
* This file is included with WP Discord Invite WordPress Plugin (https://wordpress.com/plugins/wp-discord-invite), Developed by Sarvesh M Rao (https://sarveshmrao.in/). | ||
* This file is licensed under Generl Public License v2 (GPLv2) or later. | ||
* Using the code on whole or in part against the license can lead to legal prosecution. | ||
* | ||
* Sarvesh M Rao | ||
* https://sarveshmrao.in/ | ||
*/ | ||
|
||
if (!defined("ABSPATH")) { | ||
exit(); | ||
} | ||
|
||
add_action("admin_enqueue_scripts", "smr_discord_enqueue_color_picker"); | ||
function smr_discord_enqueue_color_picker($hook_suffix) | ||
{ | ||
// first check that $hook_suffix is appropriate for your admin page | ||
wp_enqueue_style("wp-color-picker"); | ||
wp_enqueue_script( | ||
"my-script-handle", | ||
plugins_url("color-picker.js", __FILE__), | ||
["wp-color-picker"], | ||
false, | ||
true | ||
); | ||
} | ||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,142 @@ | ||
<?php | ||
|
||
/** | ||
* This file is included with WP Discord Invite WordPress Plugin (https://wordpress.com/plugins/wp-discord-invite), Developed by Sarvesh M Rao (https://sarveshmrao.in/). | ||
* This file is licensed under Generl Public License v2 (GPLv2) or later. | ||
* Using the code on whole or in part against the license can lead to legal prosecution. | ||
* | ||
* Sarvesh M Rao | ||
* https://sarveshmrao.in/ | ||
*/ | ||
|
||
if (!defined("ABSPATH")) { | ||
exit(); | ||
} | ||
|
||
//COUNT PAGE START | ||
function smr_discord_count_page() | ||
{ | ||
?> | ||
<div class="wrap"> | ||
<img src="<?php echo plugin_dir_url(__FILE__) . | ||
"./../assets/icon-128x128.png"; ?>"></img> | ||
<h2>WP Discord Invite Link Click Count</h2> | ||
<script type="text/javascript">var $j = jQuery.noConflict();</script> | ||
<table class="form-table"> | ||
|
||
|
||
<tr valign="top"> | ||
<th scope="row">Link: </th> | ||
<td><p><?php echo get_option("siteurl") . "/" . get_option("smr_discord_uri"); ?></p></td> | ||
</tr> | ||
|
||
<tr valign="top"> | ||
<th scope="row">Click Count</th> | ||
<td><p><?php echo get_option("smr_discord_click_count"); ?></p></td> | ||
</tr> | ||
|
||
<tr valign="top"> | ||
<th scope="row">Last Click</th> | ||
<td><p><?php echo time_elapsed_string( | ||
get_option("smr_discord_link_last_click") | ||
) . | ||
" (" . | ||
get_option("smr_discord_link_last_click") . | ||
")"; ?></p></td> | ||
</tr> | ||
<tr valign="top"> | ||
<th scope="row">Last Reset</th> | ||
<td><p><?php echo time_elapsed_string( | ||
get_option("smr_discord_click_count_last_reset") | ||
) . | ||
" (" . | ||
get_option("smr_discord_click_count_last_reset") . | ||
")"; ?></p></td> | ||
</tr> | ||
</table> | ||
<div> | ||
<form method="post" action="options.php"> | ||
<?php settings_fields("smr-discord-count-group"); ?> | ||
<input type="hidden" name="smr_discord_click_count" value="0" /> | ||
<input type="hidden" name="smr_discord_click_count_last_reset" value="<?php echo current_time( | ||
"Y-m-d h:i:sa" | ||
); ?>" /> | ||
|
||
<p class="submit"> | ||
<input type="submit" class="button-primary" value="<?php _e( | ||
"Reset Click Count (Irreversible)" | ||
); ?>" /> | ||
</p> | ||
</form> | ||
</div> | ||
|
||
<form method="post" action="options.php"> | ||
<?php settings_fields("smr-discord-webhook-group"); | ||
if(isset($_POST['wp-discord-invite-oauth']) && isset($_POST['webhook'])) { | ||
$webhook = sanitize_url($_POST['webhook'], array('https')); | ||
} | ||
?> | ||
<h2>WP Discord Invite Link Click Webhook</h2> | ||
<p>Sends a webhook to Discord when the invite link is clicked</p> | ||
<table class="form-table"> | ||
|
||
|
||
<tr valign="top"> | ||
<th scope="row">Enable Webhook </th> | ||
<td><input type="checkbox" name="smr_discord_webhook_enable" value="1"<?php if(isset($_POST['wp-discord-invite-oauth']) && isset($webhook)) { | ||
echo "checked=\"checked\""; | ||
} else { checked( | ||
1 == get_option("smr_discord_webhook_enable") | ||
); } ?> /><span class="dashicons dashicons-editor-help" onclick="$j('#wp_discord_webhook-desc').toggleClass('hidden');"></span> | ||
<p class="description hidden" id="wp_discord_webhook-desc">Check to enable webhook option. <br /><a href="https://docs.sarveshmrao.in/en/wp-discord-invite#webhook">More Info in Docs</a></p></td> | ||
</tr> | ||
|
||
<tr valign="top"> | ||
<th scope="row">Discord Webhook URL </th> | ||
<td><input type="text" name="smr_discord_webhook_url" value="<?php if(isset($_POST['wp-discord-invite-oauth']) && isset($webhook)) { | ||
echo $webhook; | ||
} else { echo get_option( | ||
"smr_discord_webhook_url" | ||
);} ?>" /><span class="dashicons dashicons-editor-help" onclick="$j('#wp_discord_webhook-url-desc').toggleClass('hidden');"></span><br /> | ||
<p class="description hidden" id="wp_discord_webhook-url-desc">Webhook URL to post to a Discord Channel <br /><a href="https://docs.sarveshmrao.in/en/wp-discord-invite#webhook">More Info in Docs</a></p> | ||
<a class="dsc-btn" rel="nofollow" href="https://utils.sarveshmrao.in/wp-discord-invite-oauth/?redirect=<?php echo admin_url(); ?>" title="Login with Discord"> | ||
<span class="dsc-btn-icon"></span> | ||
|
||
<span class="dsc-btn-text">Login with Discord</span> | ||
</a> | ||
</td> | ||
</tr> | ||
|
||
</table> | ||
<?php | ||
wp_enqueue_style( | ||
"CssForDscOAuth", | ||
plugin_dir_url(__FILE__) . "./../assets/dsc-oauth.css" | ||
); | ||
?> | ||
<p class="submit"> | ||
<input type="submit" class="button-primary" id="count_save_changes" value="<?php _e( | ||
"Save Changes" | ||
); ?>" /> | ||
</p> | ||
<?php | ||
if(isset($_POST['wp-discord-invite-oauth']) && isset($webhook)) { | ||
echo("<body onload=\"redirFunction()\"></body>"); | ||
echo("<script> function redirFunction() { | ||
document.getElementById(\"count_save_changes\").click(); | ||
} </script>"); | ||
} | ||
?> | ||
|
||
</form> | ||
|
||
|
||
|
||
<div><p>If you enjoy using this plugin please leave a review <a href="https://wordpress.org/support/plugin/wp-discord-invite/reviews/">here</a>. That would motivate me a lot.</p></div> | ||
<div><p>Created with <span class="dashicons dashicons-heart"></span> by <a href="https://sarveshmrao.in">Sarvesh M Rao</a>.</p></div> | ||
</div> | ||
<?php | ||
} | ||
//COUNT PAGE END | ||
|
||
?> |
Oops, something went wrong.