Commit 325d99e0 authored by Varun Sridharan's avatar Varun Sridharan

Update Files For V 1.3.8 And Few bug Fixes

*Added - option get donate link using {wcqd_get_donate_link} function
*Added - Predefined Amount Option
*Fixed - [Blank pages]
(https://github.com/technofreaky/woocomerce-quick-donation/issues/56)
*Fixed - [Latest version will not activate]
(https://github.com/technofreaky/woocomerce-quick-donation/issues/62)
parent 2598780c
<?php
class wp_wc_wcqd_welcome_page{
public $plugin_slug;
public $plugin_url;
public $page_html;
public function __construct($args = array()){
$default_args = array(
'dbslug' => 'wp_plugin_welcome',
'welcome_slug' => 'welcome-screen-about',
'wp_plugin_slug' => '',
'template' => 'page-html.php',
'menu_name' => 'Welcome To Plugin Welcome Page',
'plugin_file' => '',
'plugin_name' => 'WC User Role Based Coupon',
'version' => '0.1',
'txt_lang' => '',
'wp_plugin_url' => 'http://varunsridharan.in',
'tweet_text' => 'What A Aswome Plugin',
'twitter_user' => 'varunsridharan2',
'twitter_hash' => 'WCRBP',
'gitub_user' => 'technofreaky',
'github_repo' => 'woocommerce-quick-donation',
'show_change_log' => true,
'show_decs' => true,
'show_downloads' => true,
);
$args = wp_parse_args( $args, $default_args );
$this->txt_lang = $args['txt_lang'];
$this->plugin_slug = $args['dbslug'];
$this->wp_plugin_slug = $args['wp_plugin_slug'];
$this->plugin_url = $args['welcome_slug'];
$this->page_html = $args['template'];
$this->Menu_NAME = $args['menu_name'];
$this->wp_plugin_url = $args['wp_plugin_url'];
$this->tweet_text = $args['tweet_text'];
$this->twitter_user = $args['twitter_user'];
$this->twitter_hash = $args['twitter_hash'];
$this->gitub_user = $args['gitub_user'];
$this->github_repo = $args['github_repo'];
$this->plugin_name = $args['plugin_name'];
$this->version = $args['version'];
$this->show_change_log = $args['show_change_log'];
$this->show_decs = $args['show_decs'];
$this->show_downloads = $args['show_downloads'];
add_action( 'admin_init', array($this,'activation_redirect') );
add_action( 'admin_menu', array($this,'welcome_screen_pages'));
add_action( 'admin_head', array($this,'welcome_screen_remove_menus' ));
register_activation_hook($args['plugin_file'], array($this,'welcome_screen_activate' ) );
}
/**
* Registers Activation Hook
*/
function welcome_screen_activate(){
$this->activate();
}
/**
* Sets Transient For Activation hook To Redirect To Welcome Page
*/
public function activate(){
set_transient( $this->plugin_slug.'_welcome_screen_activation_redirect', true, 30 );
}
/**
* Checks For Active Transient And Redirect To Welcome Page
*/
public function activation_redirect(){
if ( ! get_transient( $this->plugin_slug.'_welcome_screen_activation_redirect' ) ) { return; }
delete_transient( $this->plugin_slug.'_welcome_screen_activation_redirect' );
if ( is_network_admin() || isset( $_GET['activate-multi'] ) ) { return; }
wp_safe_redirect( add_query_arg( array( 'page' => $this->plugin_url ), admin_url( 'index.php' ) ) );
}
/**
* Adds Welcome Page
*/
public function welcome_screen_pages() {
add_dashboard_page($this->Menu_NAME,'','read',$this->plugin_url, array($this,'welcome_screen_content'));
}
/**
* Welcome Page html
*/
public function welcome_screen_content() {
$this->wp_api();
require($this->page_html);
}
/**
* Remove Dashboard Welcome Page
*/
public function welcome_screen_remove_menus() {
remove_submenu_page( 'index.php', $this->plugin_url );
}
public function get_decs($return = false){
$data = '';
if($this->show_decs){
$data = '<div class="change_log_list"> '.$this->decs.'</div>';
}
if(!$return){echo $data;}
return $data;
}
public function get_change_log($return = false){
$data = '';
if($this->show_change_log){
$data = '<div class="change_log_list"> <h1>'.__('Change Log', $this->txt_lang) .'</h1>'.$this->change_log.'</div>';
}
if(!$return){echo $data;}
return $data;
}
public function get_downloads($return = false){
$data = '';
if($this->show_downloads){
$data = sprintf('<p class="downloads_count"> <span> %s </span> '.__(' Download\'s so far. help use reach more audience by sharing' , $this->txt_lang) .'</p>',$this->downloads);
}
if(!$return){echo $data;}
return $data;
}
/**
* Gets Remote Data From WP API
*/
public function wp_api(){
$args = (object) array( 'slug' => $this->wp_plugin_slug );
$request = array( 'action' => 'plugin_information', 'timeout' => 15, 'request' => serialize( $args) );
$url = 'http://api.wordpress.org/plugins/info/1.0/';
$response = wp_remote_post( $url, array( 'body' => $request ) );
$plugin_info = unserialize( $response['body'] );
$downloads = ''; $decs = ''; $change_log = '';
if($plugin_info){
$downloads = $plugin_info->downloaded;
$decs = $plugin_info->sections['description'];
$change_log = $plugin_info->sections['changelog'];
}
$this->decs = $decs;
$this->change_log = $change_log;
$this->downloads = $downloads;
}
}
?>
\ No newline at end of file
...@@ -83,22 +83,16 @@ class WC_QD_INSTALL{ ...@@ -83,22 +83,16 @@ class WC_QD_INSTALL{
$message_settings = self::message_section_settings(); $message_settings = self::message_section_settings();
$shortcode_settings = self::shortcode_section_settings(); $shortcode_settings = self::shortcode_section_settings();
add_option( 'wc_qd_general', $general_settings); $general_settings = add_option('wc_qd_general', $general_settings);
add_option('wc_qd_message', $message_settings); add_option('wc_qd_message', $message_settings);
add_option('wc_qd_shortcode',$shortcode_settings); add_option('wc_qd_shortcode',$shortcode_settings);
add_option('wc_qd_anh_notices', ''); add_option('wc_qd_anh_notices', '');
$message = __('Please Configure Any One Payment Gatway To Get Plugin Work :) ', WC_QD_TXT); if($general_settings){
$message = sprintf( $message = sprintf(__('<p>Please Configure Any One Payment Gatway To Get Plugin Work :) </p> <p class="submit">%s Config Gateway %s %s</p>',WC_QD_TXT),'<a class="button button-primary" href="' . admin_url( 'edit.php?post_type='.WC_QD_PT.'&page=wc_qd_settings' ) . '">','</a>',wc_qd_remove_link('class="button" '));
__( '<p>Please Configure Any One Payment Gatway To Get Plugin Work :) </p>
<p class="submit">%s Config Gateway %s %s</p>',
WC_QD_TXT),
'<a class="button button-primary" href="' . admin_url( 'edit.php?post_type='.WC_QD_PT.'&page=wc_qd_settings' ) . '">','</a>',
wc_qd_remove_link('class="button" ')
);
wc_qd_notice($message,'error',array('times' => 0,'wraper' => false)); wc_qd_notice($message,'error',array('times' => 0,'wraper' => false));
} }
}
private static function general_section_settings(){ private static function general_section_settings(){
......
...@@ -15,6 +15,7 @@ class WooCommerce_Quick_Donation_Functions { ...@@ -15,6 +15,7 @@ class WooCommerce_Quick_Donation_Functions {
'field-text.php' => 'fields/field-text.php', 'field-text.php' => 'fields/field-text.php',
'myaccount/my-donations.php' => 'myaccount/my-donations.php', 'myaccount/my-donations.php' => 'myaccount/my-donations.php',
'cart/mini-cart.php' => 'cart/donation-mini-cart.php', 'cart/mini-cart.php' => 'cart/donation-mini-cart.php',
'projects/single.php' => 'projects/single.php',
), ),
'is_donation' => array( 'is_donation' => array(
...@@ -71,12 +72,22 @@ class WooCommerce_Quick_Donation_Functions { ...@@ -71,12 +72,22 @@ class WooCommerce_Quick_Donation_Functions {
add_filter( 'wp_count_posts', array($this,'modify_wp_count_posts'),99,3); add_filter( 'wp_count_posts', array($this,'modify_wp_count_posts'),99,3);
add_filter( 'query_vars', array( $this, 'add_query_vars'), 0 ); add_filter( 'query_vars', array( $this, 'add_query_vars'), 0 );
//add_filter('single_template',array($this,'cpt_page_template'));
} }
public function get_template_list(){ public function get_template_list(){
return self::$search_template; return self::$search_template;
} }
public function cpt_page_template($template){
$template = $template;
if(WC_QD_PT == get_post_type(get_queried_object_id())){
$template_located = $this->locate_template('projects/single.php');
if(!empty($template_located)){$template = $template_located;}
}
return $template;
}
/** /**
* add_query_vars function. * add_query_vars function.
......
<div class="wrap welcome-wrap">
<h1>Welcome To <?php echo $this->plugin_name;?> <?php echo $this->version; ?></h1>
<div class="about-text plugin_welcome_text">
Thanks for installing! <?php echo $this->plugin_name;?> <?php echo $this->version; ?> is more powerful, stable and secure than ever before. We hope you enjoy using it. </div>
<div class="plugin_welcome_actions">
<?php $this->get_downloads(); ?>
<a href="https://twitter.com/share"
class="twitter-share-button"
data-url="<?php echo $this->wp_plugin_url; ?>"
data-text="<?php echo $this->tweet_text; ?>"
data-via="<?php echo $this->twitter_user; ?>"
data-hashtags="<?php echo $this->twitter_hash;?>">Tweet</a>
<a href="https://twitter.com/<?php echo $this->twitter_user; ?>"
class="twitter-follow-button"
data-show-count="false"
data-show-screen-name="false">Follow @<?php echo $this->twitter_user; ?></a>
<a href="https://twitter.com/intent/tweet?button_hashtag=<?php echo $this->twitter_hash;?>"
class="twitter-hashtag-button"
data-related="<?php echo $this->twitter_user; ?>"
data-url="<?php echo $this->wp_plugin_url; ?>">Tweet #<?php echo $this->twitter_hash;?></a>
<div class="fb-like"
data-href="<?php echo $this->wp_plugin_url; ?>"
data-layout="standard"
data-action="recommend"
data-show-faces="true"
data-share="true"></div>
<iframe src="https://ghbtns.com/github-btn.html?user=<?php echo $this->gitub_user;?>&repo=<?php echo $this->github_repo; ?>&type=star&count=true"
frameborder="0" scrolling="0" width="60px" height="20px"></iframe>
<iframe src="https://ghbtns.com/github-btn.html?user=<?php echo $this->gitub_user;?>&repo=<?php echo $this->github_repo; ?>&type=watch&count=true&v=2"
frameborder="0" scrolling="0" width="70px" height="20px"></iframe>
<iframe src="https://ghbtns.com/github-btn.html?user=<?php echo $this->gitub_user;?>&repo=<?php echo $this->github_repo; ?>&type=fork&count=true"
frameborder="0" scrolling="0" width="70px" height="20px"></iframe>
<iframe src="https://ghbtns.com/github-btn.html?user=<?php echo $this->gitub_user;?>&type=follow&count=true"
frameborder="0" scrolling="0" width="170px" height="20px"></iframe>
</div>
<div class="content_container">
<div class="changelog">
<?php
$this->get_decs();
?>
</div>
<div class="singnUpFORM">
<div id="poststuff">
<div id="postbox-container-1" class="postbox-container">
<div class="postbox">
<div class="handlediv" title="Click to toggle"> <br /> </div>
<h3 class="hndle"><span><?php _e('Subscribe to our mailing list',WC_QD_TXT); ?></span></h3>
<div class="option">
<div id="mc_embed_signup">
<form action="http://varunsridharan.us11.list-manage.com/subscribe/post?u=438373310b9f3b6302526f737&amp;id=71f582aed1" method="post" id="mc-embedded-subscribe-form" name="mc-embedded-subscribe-form" class="validate" target="_blank" novalidate>
<div id="mc_embed_signup_scroll">
<div id="mce-responses" class="clear">
<div class="response" id="mce-error-response" style="display:none"></div>
<div class="response" id="mce-success-response" style="display:none"></div>
</div>
<div class="mc-field-group">
<label for="mce-EMAIL">
<?php _e('Email Address',WC_QD_TXT); ?> <span class="asterisk">*</span>
</label>
<input type="email" value="<?php echo get_option('admin_email'); ?>" name="EMAIL"
class="required email" id="mce-EMAIL">
</div>
<div class="mc-field-group">
<label for="mce-FNAME">
<?php _e('First Name',WC_QD_TXT); ?> <span class="asterisk">*</span>
</label>
<input type="text" value="" name="FNAME" class="required" id="mce-FNAME">
</div>
<div class="mc-field-group">
<label for="mce-LNAME"><?php _e('Last Name',WC_QD_TXT); ?> </label>
<input type="text" value="" name="LNAME" class="" id="mce-LNAME">
</div>
<div class="mc-field-group">
<label for="mce-WEBSITE">
<?php _e('Website',WC_QD_TXT); ?> <span class="asterisk">*</span>
</label>
<input type="url" value="<?php echo get_site_url(); ?>" name="WEBSITE" class="required url"
id="mce-WEBSITE">
</div>
<div class="mc-field-group">
<label for="mce-COUNTRY">
<?php _e('Country',WC_QD_TXT); ?> <span class="asterisk">*</span>
</label>
<input type="text" value="" name="COUNTRY" class="required" id="mce-COUNTRY">
<input type="hidden" value="<?php echo $this->plugin_name; ?>" name="PLUGINNAME" class="" id="mce-PLUGINNAME">
</div>
<!-- real people should not fill this in and expect good things - do not remove this or risk form bot signups-->
<div style="position: absolute; left: -5000px;">
<input type="text" name="b_438373310b9f3b6302526f737_71f582aed1" tabindex="-1" value="">
</div>
<div class="clear">
<input type="submit" value="Subscribe" name="subscribe" id="mc-embedded-subscribe" class="button">
</div>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="changelog full_width">
<?php $this->get_change_log(); ?>
</div>
</div>
</div>
<style>
.welcome-wrap {
float: left;
font-size: 15px;
margin: 0;
padding-right: 20px;
position: relative;
width: 98%;
}
.welcome-wrap h1 {
color: #32373c;
font-size: 2.8em;
font-weight: 400;
line-height: 1.2em;
margin: 0.2em 0 0 0;
padding: 0;
}
.welcome-wrap .about-text {
color: #777;
margin: 1em 0px 1em 0;
min-height: 60px;
}
.welcome-wrap .plugin_welcome_text {
font-size: 19px;
font-weight: normal;
line-height: 1.6em;
margin-bottom: 1em !important;
}
.welcome-wrap .content_container {
float: left;
margin-bottom: 40px;
width: 100%;
}
.changelog {
background: #fff none repeat scroll 0 0;
float: left;
margin: 20px 2% 20px 0;
padding: 10px 20px;
width: 46%;
}
.changelog h1 {
margin: 0;
}
.singnUpFORM{
display: inline-block;
margin-left: 2%;
margin-top: 10px;
width: 46%;
}
#postbox-container-1 {
float: left;
margin-right: 0 !important;
}
.postbox {
position: relative;
min-width: 255px;
border: 1px solid #e5e5e5;
-webkit-box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
background: #fff;
}
div#poststuff {
min-width: 15%;
}
.changelog.full_width {
display: inline-block;
margin-right: 0 !important;
width: auto;
}
.plugin_welcome_actions .downloads_count {
display: inline-block;
margin: 0 10px 0 0;
vertical-align: top;
}
</style>
<style type="text/css">
#mc_embed_signup{background:#fff; clear:left; font:14px Helvetica,Arial,sans-serif; }
#mc_embed_signup form {
padding-top: 0!important;
padding-left: 0;
}
#mc_embed_signup div.mce_inline_error {
background-color: #ea7274;
}
#mc_embed_signup .mc-field-group input {
margin: 0 auto !important;
}
.option:nth-child(2n+1) {
background: #fcfcfc none repeat scroll 0 0;
}
.option {
border-width: 1px 0;
padding: 6px 10px 8px;
}
.option p.description {
line-height: 1.2em;
}
.option p {
margin: 0;
padding: 0;
}
</style>
<link href="//cdn-images.mailchimp.com/embedcode/classic-081711.css" rel="stylesheet" type="text/css">
<script>
! function (d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0],
p = /^http:/.test(d.location) ? 'http' : 'https';
if (!d.getElementById(id)) {
js = d.createElement(s);
js.id = id;
js.src = p + '://platform.twitter.com/widgets.js';
fjs.parentNode.insertBefore(js, fjs);
}
}(document, 'script', 'twitter-wjs');
</script>
<div id="fb-root"></div>
<script>(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/en_US/sdk.js#xfbml=1&version=v2.5&appId=477093012452061";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
<!-- Place this tag right after the last button or just before your close body tag. -->
<script async defer id="github-bjs" src="https://buttons.github.io/buttons.js"></script>
<script type='text/javascript' src='//s3.amazonaws.com/downloads.mailchimp.com/js/mc-validate.js'></script>
<script type='text/javascript'>(function($) {window.fnames = new Array(); window.ftypes = new Array();fnames[0]='EMAIL';ftypes[0]='email';fnames[1]='FNAME';ftypes[1]='text';fnames[2]='LNAME';ftypes[2]='text';fnames[3]='WEBSITE';ftypes[3]='url';fnames[4]='COUNTRY';ftypes[4]='text';fnames[5]='PLUGINNAME';ftypes[5]='text';}(jQuery));var $mcj = jQuery.noConflict(true);</script>
...@@ -6,7 +6,7 @@ Requires at least: 3.0 or higher ...@@ -6,7 +6,7 @@ Requires at least: 3.0 or higher
Tested up to: 4.4 Tested up to: 4.4
WC requires at least: 1.0 WC requires at least: 1.0
WC tested up to: 2.4.10 WC tested up to: 2.4.10
Stable tag: 1.3.7.1 Beta Stable tag: 1.3.8 Beta
License: GPLv2 or later License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html License URI: http://www.gnu.org/licenses/gpl-2.0.html
...@@ -38,6 +38,9 @@ Email : plugin@varunsridharan.in / kindly post it in github. ...@@ -38,6 +38,9 @@ Email : plugin@varunsridharan.in / kindly post it in github.
<code> <code>
1. type : select | radio 1. type : select | radio
2. grouped : true | false 2. grouped : true | false
3. show_errors : true | false
4. selected_value : Project ID
5. defined_amount : true | false {Amount Can Be Defined In Settings Page}
</code> </code>
...@@ -120,6 +123,13 @@ Yes you can! Join in on our <a href="https://github.com/technofreaky/woocomerce- ...@@ -120,6 +123,13 @@ Yes you can! Join in on our <a href="https://github.com/technofreaky/woocomerce-
== Changelog == == Changelog ==
= 1.3.8 =
* **Added** - option get donate link using {wcqd_get_donate_link} function
* **Added** - Predefined Amount Option
* **Fixed** - [Blank pages] (https://github.com/technofreaky/woocomerce-quick-donation/issues/56)
* **Fixed** - [Latest version will not activate] (https://github.com/technofreaky/woocomerce-quick-donation/issues/62)
= 1.3.7.1 = = 1.3.7.1 =
* **Fixed** - Fixed Empty Trash Issue * **Fixed** - Fixed Empty Trash Issue
* **Fixed** - [`T_PAAMAYIM_NEKUDOTAYIM` Critical: Update to latest kills admin area] (https://github.com/technofreaky/woocomerce-quick-donation/issues/58) After Last UPDATE [1.3.7] * **Fixed** - [`T_PAAMAYIM_NEKUDOTAYIM` Critical: Update to latest kills admin area] (https://github.com/technofreaky/woocomerce-quick-donation/issues/58) After Last UPDATE [1.3.7]
......
<?php get_header(); ?>
<?php get_template_part('archive.php'); ?>
<?php get_footer(); ?>
\ No newline at end of file
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
* Plugin Name: WooCommerce Quick Donation * Plugin Name: WooCommerce Quick Donation
* Plugin URI: http://wordpress.org/plugins/woocommerce-quick-donation/ * Plugin URI: http://wordpress.org/plugins/woocommerce-quick-donation/
* Description: Turns WooCommerce Into Online Donation * Description: Turns WooCommerce Into Online Donation
* Version: 1.3.7.1 BETA * Version: 1.3.8 BETA
* Author: Varun Sridharan * Author: Varun Sridharan
* Author URI: http://varunsridharan.in * Author URI: http://varunsridharan.in
* Text Domain: woocommerce-quick-donation * Text Domain: woocommerce-quick-donation
...@@ -19,7 +19,7 @@ class WooCommerce_Quick_Donation { ...@@ -19,7 +19,7 @@ class WooCommerce_Quick_Donation {
/** /**
* @var string * @var string
*/ */
public $version = '1.3.7'; public $version = '1.3.8';
public $db_version = '1.0'; public $db_version = '1.0';
/** /**
...@@ -299,6 +299,25 @@ if(WC_QD_Dependencies()){ ...@@ -299,6 +299,25 @@ if(WC_QD_Dependencies()){
} }
$GLOBALS['woocommerce_quick_donation'] = WC_QD(); $GLOBALS['woocommerce_quick_donation'] = WC_QD();
include(WC_QD_INC.'class-activate-welcome.php');
$default_args = array(
'dbslug' => WC_QD_DB,
'welcome_slug' => WC_QD_TXT.'-welcome-page',
'wp_plugin_slug' => WC_QD_TXT,
'wp_plugin_url' => 'http://wordpress.org/plugins/woocommerce-quick-donation/',
'tweet_text' => 'Turns WooCommerce Into Online Donation',
'twitter_user' => 'varunsridharan2',
'twitter_hash' => 'WCQD',
'gitub_user' => 'technofreaky',
'github_repo' => 'woocomerce-quick-donation',
'plugin_name' => WC_QD,
'version' => WC_QD_V,
'template' => WC_QD_INC.'views/welcome-page.php',
'menu_name' => WC_QD.' Welcome Page',
'plugin_file' => __FILE__,
);
new wp_wc_wcqd_welcome_page($default_args);
} else { } else {
wc_qd_notice(__('WooCommerce Is Required. To Use This Plugin :)','woocommerce-quick-donation'), wc_qd_notice(__('WooCommerce Is Required. To Use This Plugin :)','woocommerce-quick-donation'),
'error', 'error',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment