Skip to content

Commit

Permalink
updated: icon
Browse files Browse the repository at this point in the history
  • Loading branch information
mh-rafi committed Jan 17, 2022
1 parent 276d0b6 commit ad7ba39
Show file tree
Hide file tree
Showing 12 changed files with 82 additions and 189 deletions.
19 changes: 19 additions & 0 deletions assets/images/gumpress.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 0 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,5 @@
"UIlib\\Gumpress\\": "includes/"
},
"files": ["includes/functions.php"]
},
"require-dev": {

}
}
137 changes: 3 additions & 134 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 6 additions & 5 deletions gumpress.php
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
<?php

/**
* Plugin Name: gumpress
* Description: Connect gumroad to woocommerce
* Plugin URI:
* Plugin Name: Gumpress
* Description: Sell Gumroad product on WooCommerce
* Plugin URI: https://ui-lib.com/gumpress
* Author: UI Lib
* Author URI:
* Version:
* Author URI: https://ui-lib.com
* Version: 1.0.0
* License: GPL2 or later
* License URI: https://www.gnu.org/licenses/gpl-2.0.html
* Text Domain: uilib-gumpress
*/

if (!defined('ABSPATH')) {
Expand Down
2 changes: 1 addition & 1 deletion includes/Admin/Menu.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public function admin_menu() {
$parent_slug = 'uilib-gumpress';
$capability = 'manage_options';

add_menu_page( __( 'Gumpress', 'gumpress' ), __( 'Gumpress', 'gumpress' ), $capability, $parent_slug, [ $this->settings, 'settings_page' ], 'dashicons-vault' );
add_menu_page( __( 'Gumpress', 'gumpress' ), __( 'Gumpress', 'gumpress' ), $capability, $parent_slug, [ $this->settings, 'settings_page' ], UL_GUMPRESS_ASSETS . '/images/gumpress.svg', 58 );
}


Expand Down
3 changes: 1 addition & 2 deletions includes/Admin/Product.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@
/**
* The Menu handler class
*/
class Product
{
class Product {

/**
* Initialize the class
Expand Down
15 changes: 7 additions & 8 deletions includes/Admin/views/settings.php
Original file line number Diff line number Diff line change
@@ -1,25 +1,24 @@
<div class="wrap">
<h1 class="wp-heading-inline"><?php _e('Gumpress', 'uilib-gumpress');?></h1>
<br>
<br>
<form action="" style="max-width: 380px;" method="post">
<form action="" style="max-width: 660px;" method="post">
<table class="form-table">
<tbody>
<tr class="row">
<tr>
<th>Gumroad access token [<a href="https://help.gumroad.com/article/280-create-application-api#Generatinganaccessto" title="Generating an access token">?</a>]</th>
<td>
<input type="text" value="<?php echo esc_attr(get_option('gumroad_http_token')); ?>" placeholder="Gumroad api key" name="gumroad-http-token" id="gumroad-http-token" class="regular-text">
<input type="text" value="<?php echo esc_attr(get_option('gumroad_http_token')); ?>" placeholder="Gumroad token" name="gumroad-http-token" id="gumroad-http-token" class="regular-text">
</td>
<td>
<?php wp_nonce_field('gumroad-http-token');?>
<?php submit_button(__('Save', 'uilib-gumpress'), 'primary', 'save_gumroad_http_token');?>
<?php submit_button(__( 'Save', 'uilib-gumpress'), 'primary', 'save_gumroad_http_token', false );?>
</td>
</tr>
</tbody>
</table>
</form>
<h2 class="title">Sync Products</h2>
<p><?php echo __('Import all of your products from Gumroad.', 'uilib-gumpress') ?></p>
<br>
<br>

<h2 class="wp-heading-inline">Sync products</h2>
<a href="<?php echo admin_url('admin.php?page=uilib-gumpress&action=sync'); ?>" class="page-title-action"><?php _e('Sync Products', 'uilib-gumpress');?></a>
</div>
13 changes: 13 additions & 0 deletions includes/Settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,14 @@ function __construct() {
* Render settings page
*/
public function settings_page() {
if ( ! is_woocommerce_activated() ) {
$message = __('Please install and activate Woocommerce first.', 'uilib-gumpress');
echo "<div class='notice notice-error'>
<p>{$message}</p>
</div>";
return;
}

include __DIR__ . '/Admin/views/settings.php';

$action = isset( $_GET['action'] );
Expand Down Expand Up @@ -139,7 +147,12 @@ public function sync_products() {
'variants' => $variants,
], true);
}
}

echo "<p> {$gumroad_product['name']} - <span style='color: var(--wc-highlight)'>updated!</span></p>";
if ( $key === array_key_last( $product_list ) ) {
$admin_products_page = admin_url('edit.php?post_type=product');
echo "<p>Done! Check out <a href='{$admin_products_page}'>product page</a></p>";
}
}
}
Expand Down
11 changes: 11 additions & 0 deletions includes/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,17 @@ function dd( $data ) {
die();
}

if ( ! function_exists( 'is_woocommerce_activated' ) ) {
/**
* Check is woocommerce installed and activated
*
* @return boolean
*/
function is_woocommerce_activated() {
if ( class_exists( 'woocommerce' ) ) { return true; } else { return false; }
}
}

/**
* Insert/Update a row of relationship of gumroad and woocommerce products
*
Expand Down
14 changes: 0 additions & 14 deletions package-lock.json

This file was deleted.

22 changes: 0 additions & 22 deletions package.json

This file was deleted.

21 changes: 21 additions & 0 deletions readme.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
=== Gumpress ===
Contributors: uilib
Tags: gumroad, woocommerce
Requires at least: 4.7
Tested up to: 5.4
Stable tag: 1.0
Requires PHP: 7.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Sync and checkout with Gumroad.

== Description ==

Import and sync your Gumroad products with your woocommerce products.
This plugin also integrates gumroad checkout. Works with any woocommerce theme.

== Changelog ==

= 1.0 =
* Initial release

0 comments on commit ad7ba39

Please sign in to comment.