Plugin Directory

Changeset 2254929


Ignore:
Timestamp:
03/05/2020 08:48:11 AM (6 years ago)
Author:
printify
Message:

Version 2.0 release

Location:
printify-for-woocommerce
Files:
13 added
2 edited

Legend:

Unmodified
Added
Removed
  • printify-for-woocommerce/trunk/printify.php

    r2093845 r2254929  
    11<?php
     2
    23/*
    3 Plugin Name: Printify
    4 Version: 1.3
    5 Description: Embeded Printify app
    6 */
    7 if ( ! defined('ABSPATH')) exit;
     4 * Plugin Name: Printify Shipping Method
     5 * Plugin URI: https://wordpress.org/plugins/printify-for-woocommerce/
     6 * Description: Calculate shipping rates for products managed by Printify.
     7 * Version: 2.0
     8 * Author: Printify
     9 * Author URI: https://www.printify.com
     10 */
     11if (in_array('woocommerce/woocommerce.php', apply_filters('active_plugins', get_option('active_plugins'))) ) {
    812
    9 require_once('printify_api.php');
     13    function printify_shipping_method_init() {
     14        if(!class_exists('Printify_Shipping_Method')) {
     15            require_once 'includes/printify-shipping-method.php';
    1016
    11 class PrintifyPlugin {
    12 
    13     const HOST = 'https://printify.com/app/';
    14 
    15     public function __construct()
    16     {
    17         add_action('plugins_loaded', [$this, 'init' ]);
    18     }
    19 
    20     public function init()
    21     {
    22         $this->add_embeded_app();
    23         $this->add_embeded_app_css();
    24 
    25         if (class_exists('WC_Shipping_Method')) {
    26             $this->init_woocommerce();
     17            new Printify_Shipping_Method();
    2718        }
    2819    }
    2920
    30     public function init_woocommerce()
    31     {
    32         require_once 'printify_shipping_method.php';
    33         $this->shipping = new PrintifyShipping;
    34     }
    35 
    36     public function add_embeded_app_css()
    37     {
    38         add_action('admin_head', [$this, 'render_embeded_app_css']);
    39     }
    40 
    41     public function add_embeded_app()
    42     {
    43         add_action('admin_menu', [$this, 'add_embeded_app_page']);
    44     }
    45 
    46     public function add_embeded_app_page()
    47     {
    48         add_menu_page(
    49             'Printify',
    50             'Printify',
    51             'manage_options',
    52             'printify',
    53             [$this, 'render_embeded_app'],
    54             plugin_dir_url(__FILE__) . 'images/printify_logo.png',
    55             55
    56         );
    57     }
    58 
    59     public function render_embeded_app()
    60     {
    61         ?>
    62         <iframe
    63             src="<?php echo self::HOST; ?>?woo=<?php echo urlencode(get_home_url()) ;?>&label=<?php echo urlencode(bloginfo('name')) ;?>" id="printify"></iframe>
    64         <?php
    65     }
    66 
    67     public function render_embeded_app_css()
    68     {
    69         $hideUpdateNag = null;
    70         if (isset($_GET['page']) && $_GET['page'] == 'printify') {
    71             $hideUpdateNag = '.update-nag, #message, .notice, .updated, #wpfooter { display: none !important; }';
    72         }
    73         echo '<style>
    74             #toplevel_page_printify img {
    75                 padding: 0px !important;
    76                 opacity: 1 !important;
    77             }
    78             #printify {
    79                 width: calc(100% + 20px);
    80                 height: calc(100vh - 32px);
    81                 margin-bottom: -100px;
    82                 position: relative;
    83                 z-index: 1;
    84                 margin-left: -20px;
    85             }
    86             ' . $hideUpdateNag . '
    87         </style>';
    88     }
    89 
     21    add_action('woocommerce_shipping_init', 'printify_shipping_method_init');
    9022}
    91 
    92 new PrintifyPlugin;
  • printify-for-woocommerce/trunk/readme.txt

    r2093845 r2254929  
    11=== Printify for WooCommerce ===
    2 Contributors: Gatis Dukurs
    32Tags: woocommerce, printify, drop shipping, printing, print on demand
    43Requires at least: 3.8
    5 Tested up to: 4.9.5
    6 Stable tag: 1.3
    7 License: GPLv2 or later
    8 License URI: http://www.gnu.org/licenses/gpl-2.0.html
     4Tested up to: 5.3.2
    95
    10 Printify is a print on demand drop shipping platform for Wordpress users. 
     6Printify is a print on demand drop shipping platform for Wordpress users.
    117
    128== Description ==
     
    22182. Activate the plugin through the 'Plugins' menu in WordPress
    23193. (optional) Enable shipping rate calculation in WooCommerce -> Settings -> Shipping -> Printify Shipping tab
    24 
    25 == Frequently Asked Questions ==
    26 
    27 == Screenshots ==
    28 
    29 == Upgrade Notice ==
    30 
    31 = 1.0 =
    32 * First release
Note: See TracChangeset for help on using the changeset viewer.