Plugin Directory

Changeset 3000865


Ignore:
Timestamp:
11/23/2023 09:08:19 PM (2 years ago)
Author:
shipink
Message:

1.1.0

  • Added Shipped Order Status for WooCommerce
  • Added support for WordPress 4.0.1
Location:
shipink/trunk
Files:
13 edited

Legend:

Unmodified
Added
Removed
  • shipink/trunk/README.txt

    r2891799 r3000865  
    11=== Shipink ===
    2 Version: 1.0.1
     2Version: 1.1.0
    33Contributors: shipink
    44Tags: shipink,shipping,woocommerce,kargo,yurtiçi,aras,sendeo,octovan,ups,fedex,aramex,ptt,mng,shipping price,shipping cost,kargo ücreti,kargo takip,shipping api,kargo entegrasyonu,shipping label,kargo etiketi,kargo fişi,ihracat,eihracat,mikro ihracat,yurtdışı kargo,kargo fiyat hesaplama,shipping cost
    55Requires at least: 4.5.0
    6 Tested up to: 6.2
    7 Stable tag: 1.0.1
     6Tested up to: 6.4.1
     7Stable tag: 1.1.0
    88License: GPLv2
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    1414[youtube https://www.youtube.com/watch?v=arJ7d_5ddJI]
    1515
    16 [Shipink](https://shipink.io/) is a new and innovative way for e-commerce companies to easily integrate and use the shipping companies they want to work with.
     16Shipink is a new and innovative way for e-commerce companies to easily integrate and use the shipping companies they want to work with.
    1717
    1818Shipink Overview
    19 *   Get discounted shipping rates in Türkiye
     19*   Get discounted shipping rates in Turkey
    2020*   Easily automate shipping processes and print labels
    2121*   Impress customers with modern tracking emails and pages
     
    2929*   PTT
    3030*   Sendeo
     31*   Octovan Express
    3132*   UPS Global
    3233*   Fedex
    3334*   Aramex
    34 *   and [more](https://shipink.io/carriers/)
    3535
    3636
     
    5656== Changelog ==
    5757
    58 = 1.0.1 =
    59 * tested up to 6.2
     58= 1.1.0 =
     59* Added Shipped Order Status for WooCommerce
     60* Added support for WordPress 4.0.1
    6061
    6162= 1.0.0 =
  • shipink/trunk/admin/class-shipink-admin.php

    r2844062 r3000865  
    55 *
    66 * @link       https://shipink.io
    7  * @since      1.0.0
     7 * @since      1.1.0
    88 *
    99 * @package    Shipink
     
    2626     * The ID of this plugin.
    2727     *
    28      * @since    1.0.0
     28     * @since    1.1.0
    2929     * @access   private
    3030     * @var      string    $plugin_name    The ID of this plugin.
     
    3535     * The version of this plugin.
    3636     *
    37      * @since    1.0.0
     37     * @since    1.1.0
    3838     * @access   private
    3939     * @var      string    $version    The current version of this plugin.
     
    4444     * Initialize the class and set its properties.
    4545     *
    46      * @since    1.0.0
     46     * @since    1.1.0
    4747     * @param      string    $plugin_name       The name of this plugin.
    4848     * @param      string    $version    The version of this plugin.
     
    5858     * Register the stylesheets for the admin area.
    5959     *
    60      * @since    1.0.0
     60     * @since    1.1.0
    6161     */
    6262    public function enqueue_styles() {
     
    8181     * Register the JavaScript for the admin area.
    8282     *
    83      * @since    1.0.0
     83     * @since    1.1.0
    8484     */
    8585    public function enqueue_scripts() {
  • shipink/trunk/admin/partials/shipink-admin-display.php

    r2844062 r3000865  
    77 *
    88 * @link       https://shipink.io
    9  * @since      1.0.0
     9 * @since      1.1.0
    1010 *
    1111 * @package    Shipink
  • shipink/trunk/includes/class-shipink-activator.php

    r2844062 r3000865  
    55 *
    66 * @link       https://shipink.io
    7  * @since      1.0.0
     7 * @since      1.1.0
    88 *
    99 * @package    Shipink
     
    1616 * This class defines all code necessary to run during the plugin's activation.
    1717 *
    18  * @since      1.0.0
     18 * @since      1.1.0
    1919 * @package    Shipink
    2020 * @subpackage Shipink/includes
     
    2828     * Long Description.
    2929     *
    30      * @since    1.0.0
     30     * @since    1.1.0
    3131     */
    3232    public static function activate() {
  • shipink/trunk/includes/class-shipink-deactivator.php

    r2844062 r3000865  
    55 *
    66 * @link       https://shipink.io
    7  * @since      1.0.0
     7 * @since      1.1.0
    88 *
    99 * @package    Shipink
     
    1616 * This class defines all code necessary to run during the plugin's deactivation.
    1717 *
    18  * @since      1.0.0
     18 * @since      1.1.0
    1919 * @package    Shipink
    2020 * @subpackage Shipink/includes
     
    2828     * Long Description.
    2929     *
    30      * @since    1.0.0
     30     * @since    1.1.0
    3131     */
    3232    public static function deactivate() {
  • shipink/trunk/includes/class-shipink-i18n.php

    r2844062 r3000865  
    88 *
    99 * @link       https://shipink.io
    10  * @since      1.0.0
     10 * @since      1.1.0
    1111 *
    1212 * @package    Shipink
     
    2020 * so that it is ready for translation.
    2121 *
    22  * @since      1.0.0
     22 * @since      1.1.0
    2323 * @package    Shipink
    2424 * @subpackage Shipink/includes
     
    3131     * Load the plugin text domain for translation.
    3232     *
    33      * @since    1.0.0
     33     * @since    1.1.0
    3434     */
    3535    public function load_plugin_textdomain() {
  • shipink/trunk/includes/class-shipink-loader.php

    r2844062 r3000865  
    55 *
    66 * @link       https://shipink.io
    7  * @since      1.0.0
     7 * @since      1.1.0
    88 *
    99 * @package    Shipink
     
    2727     * The array of actions registered with WordPress.
    2828     *
    29      * @since    1.0.0
     29     * @since    1.1.0
    3030     * @access   protected
    3131     * @var      array    $actions    The actions registered with WordPress to fire when the plugin loads.
     
    3636     * The array of filters registered with WordPress.
    3737     *
    38      * @since    1.0.0
     38     * @since    1.1.0
    3939     * @access   protected
    4040     * @var      array    $filters    The filters registered with WordPress to fire when the plugin loads.
     
    4545     * Initialize the collections used to maintain the actions and filters.
    4646     *
    47      * @since    1.0.0
     47     * @since    1.1.0
    4848     */
    4949    public function __construct() {
     
    5757     * Add a new action to the collection to be registered with WordPress.
    5858     *
    59      * @since    1.0.0
     59     * @since    1.1.0
    6060     * @param    string               $hook             The name of the WordPress action that is being registered.
    6161     * @param    object               $component        A reference to the instance of the object on which the action is defined.
     
    7171     * Add a new filter to the collection to be registered with WordPress.
    7272     *
    73      * @since    1.0.0
     73     * @since    1.1.0
    7474     * @param    string               $hook             The name of the WordPress filter that is being registered.
    7575     * @param    object               $component        A reference to the instance of the object on which the filter is defined.
     
    8686     * collection.
    8787     *
    88      * @since    1.0.0
     88     * @since    1.1.0
    8989     * @access   private
    9090     * @param    array                $hooks            The collection of hooks that is being registered (that is, actions or filters).
     
    113113     * Register the filters and actions with WordPress.
    114114     *
    115      * @since    1.0.0
     115     * @since    1.1.0
    116116     */
    117117    public function run() {
  • shipink/trunk/includes/class-shipink.php

    r2844062 r3000865  
    88 *
    99 * @link       https://shipink.io
    10  * @since      1.0.0
     10 * @since      1.1.0
    1111 *
    1212 * @package    Shipink
     
    2323 * version of the plugin.
    2424 *
    25  * @since      1.0.0
     25 * @since      1.1.0
    2626 * @package    Shipink
    2727 * @subpackage Shipink/includes
    2828 * @author     Shipink <info@shipink.com>
    2929 */
    30 class Shipink {
    31 
    32     /**
    33      * The loader that's responsible for maintaining and registering all hooks that power
    34      * the plugin.
    35      *
    36      * @since    1.0.0
    37      * @access   protected
    38      * @var      Shipink_Loader    $loader    Maintains and registers all hooks for the plugin.
    39      */
    40     protected $loader;
    41 
    42     /**
    43      * The unique identifier of this plugin.
    44      *
    45      * @since    1.0.0
    46      * @access   protected
    47      * @var      string    $plugin_name    The string used to uniquely identify this plugin.
    48      */
    49     protected $plugin_name;
    50 
    51     /**
    52      * The current version of the plugin.
    53      *
    54      * @since    1.0.0
    55      * @access   protected
    56      * @var      string    $version    The current version of the plugin.
    57      */
    58     protected $version;
    59 
    60     /**
    61      * Define the core functionality of the plugin.
    62      *
    63      * Set the plugin name and the plugin version that can be used throughout the plugin.
    64      * Load the dependencies, define the locale, and set the hooks for the admin area and
    65      * the public-facing side of the site.
    66      *
    67      * @since    1.0.0
    68      */
    69     public function __construct() {
    70         if ( defined( 'SHIPINK_VERSION' ) ) {
    71             $this->version = SHIPINK_VERSION;
    72         } else {
    73             $this->version = '1.0.0';
    74         }
    75         $this->plugin_name = 'shipink';
    76 
    77         $this->load_dependencies();
    78         $this->set_locale();
    79         $this->define_admin_hooks();
    80         $this->define_public_hooks();
    81         $this->load_shipink_admin_menu();
    82     }
    83 
    84     /**
    85      * Load the required dependencies for this plugin.
    86      *
    87      * Include the following files that make up the plugin:
    88      *
    89      * - Shipink_Loader. Orchestrates the hooks of the plugin.
    90      * - Shipink_i18n. Defines internationalization functionality.
    91      * - Shipink_Admin. Defines all hooks for the admin area.
    92      * - Shipink_Public. Defines all hooks for the public side of the site.
    93      *
    94      * Create an instance of the loader which will be used to register the hooks
    95      * with WordPress.
    96      *
    97      * @since    1.0.0
    98      * @access   private
    99      */
    100     private function load_dependencies() {
    101 
    102         /**
    103          * The class responsible for orchestrating the actions and filters of the
    104          * core plugin.
    105          */
    106         require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-shipink-loader.php';
    107 
    108         /**
    109          * The class responsible for defining internationalization functionality
    110          * of the plugin.
    111          */
    112         require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-shipink-i18n.php';
    113 
    114         /**
    115          * The class responsible for defining all actions that occur in the admin area.
    116          */
    117         require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-shipink-admin.php';
    118 
    119         /**
    120          * The class responsible for defining all actions that occur in the public-facing
    121          * side of the site.
    122          */
    123         require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-shipink-public.php';
    124 
    125         $this->loader = new Shipink_Loader();
    126 
    127     }
    128 
    129     /**
    130      * Define the locale for this plugin for internationalization.
    131      *
    132      * Uses the Shipink_i18n class in order to set the domain and to register the hook
    133      * with WordPress.
    134      *
    135      * @since    1.0.0
    136      * @access   private
    137      */
    138     private function set_locale() {
    139 
    140         $plugin_i18n = new Shipink_i18n();
    141 
    142         $this->loader->add_action( 'plugins_loaded', $plugin_i18n, 'load_plugin_textdomain' );
    143 
    144     }
    145 
    146     /**
    147      * Register all of the hooks related to the admin area functionality
    148      * of the plugin.
    149      *
    150      * @since    1.0.0
    151      * @access   private
    152      */
    153     private function define_admin_hooks() {
    154 
    155         $plugin_admin = new Shipink_Admin( $this->get_plugin_name(), $this->get_version() );
    156 
    157         $this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_styles' );
    158         $this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_scripts' );
    159 
    160     }
    161 
    162     /**
    163      * Register all of the hooks related to the public-facing functionality
    164      * of the plugin.
    165      *
    166      * @since    1.0.0
    167      * @access   private
    168      */
    169     private function define_public_hooks() {
    170 
    171         $plugin_public = new Shipink_Public( $this->get_plugin_name(), $this->get_version() );
    172 
    173         $this->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_styles' );
    174         $this->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_scripts' );
    175 
    176     }
    177 
    178     /**
    179      * Run the loader to execute all of the hooks with WordPress.
    180      *
    181      * @since    1.0.0
    182      */
    183     public function run() {
    184         $this->loader->run();
    185     }
    186 
    187     /**
    188      * The name of the plugin used to uniquely identify it within the context of
    189      * WordPress and to define internationalization functionality.
    190      *
    191      * @since     1.0.0
    192      * @return    string    The name of the plugin.
    193      */
    194     public function get_plugin_name() {
    195         return $this->plugin_name;
    196     }
    197 
    198     /**
    199      * The reference to the class that orchestrates the hooks with the plugin.
    200      *
    201      * @since     1.0.0
    202      * @return    Shipink_Loader    Orchestrates the hooks of the plugin.
    203      */
    204     public function get_loader() {
    205         return $this->loader;
    206     }
    207 
    208     /**
    209      * Retrieve the version number of the plugin.
    210      *
    211      * @since     1.0.0
    212      * @return    string    The version number of the plugin.
    213      */
    214     public function get_version() {
    215         return $this->version;
    216     }
    217 
    218     private function load_shipink_admin_menu() {
    219         if ( is_admin() && ! is_network_admin() ) {
    220             add_action( 'admin_menu', array( $this, 'create_admin_menu' ) );
    221         }
    222     }
    223 
    224     public function create_admin_menu() {
    225         $shipink_label = __( 'Shipink', 'shipink' );
    226         add_submenu_page(
    227             'woocommerce',
    228             $shipink_label,
    229             $shipink_label,
    230             'manage_options',
    231             'wc-shipink',
    232             array( $this, 'shipink_admin_page')
    233         );
    234     }
    235    
    236     public function shipink_admin_page() {
    237         $file = rtrim( plugin_dir_path( __DIR__ ), '/' ).'/public/views/wc-settings/shipink-page.php';
    238         $html  = $this->render($file);
    239         echo wp_kses($html,array( $this, 'get_allowed_tags'));
    240     }
    241    
    242     public  function get_allowed_tags() {
    243         return array(
    244             'a'          => array(
    245                 'class'  => array(),
    246                 'href'   => array(),
    247                 'rel'    => array(),
    248                 'title'  => array(),
    249                 'target' => array()
    250             ),
    251             'abbr'       => array(
    252                 'title' => array(),
    253             ),
    254             'b'          => array(),
    255             'blockquote' => array(
    256                 'cite' => array(),
    257             ),
    258             'br'         => array(),
    259             'button'     => array(
    260                 'class'    => array(),
    261                 'id'       => array(),
    262                 'disabled' => array(),
    263             ),
    264             'cite'       => array(
    265                 'title' => array(),
    266             ),
    267             'code'       => array(),
    268             'del'        => array(
    269                 'datetime' => array(),
    270                 'title'    => array(),
    271             ),
    272             'dd'         => array(),
    273             'div'        => array(
    274                 'class' => array(),
    275                 'id'    => array(),
    276                 'title' => array(),
    277                 'style' => array(),
    278             ),
    279             'dl'         => array(),
    280             'dt'         => array(),
    281             'em'         => array(),
    282             'h1'         => array(),
    283             'h2'         => array(),
    284             'h3'         => array(),
    285             'h4'         => array(),
    286             'h5'         => array(),
    287             'h6'         => array(),
    288             'hr'         => array(
    289                 'class' => array()
    290             ),
    291             'i'          => array(
    292                 'class' => array()
    293             ),
    294             'img'        => array(
    295                 'alt'    => array(),
    296                 'class'  => array(),
    297                 'height' => array(),
    298                 'src'    => array(),
    299                 'width'  => array(),
    300             ),
    301             'input'      => array(
    302                 'id'    => array(),
    303                 'class'  => array(),
    304                 'name' => array(),
    305                 'value'    => array(),
    306                 'type'  => array(),
    307             ),
    308             'li'         => array(
    309                 'class' => array(),
    310             ),
    311             'ol'         => array(
    312                 'class' => array(),
    313             ),
    314             'p'          => array(
    315                 'class' => array(),
    316             ),
    317             'path'       => array(
    318                 'fill'            => array(),
    319                 'd'               => array(),
    320                 'class'           => array(),
    321                 'data-v-19c3f3ae' => array()
    322             ),
    323             'q'          => array(
    324                 'cite'  => array(),
    325                 'title' => array(),
    326             ),
    327             'script'     => array(
    328                 'type' => array(),
    329                 'id'   => array(),
    330             ),
    331             'span'       => array(
    332                 'class'       => array(),
    333                 'title'       => array(),
    334                 'style'       => array(),
    335                 'data-tip'    => array(),
    336                 'data-target' => array(),
    337             ),
    338             'strike'     => array(),
    339             'strong'     => array(),
    340             'svg'        => array(
    341                 'aria-hidden'     => array(),
    342                 'focusable'       => array(),
    343                 'data-prefix'     => array(),
    344                 'data-icon'       => array(),
    345                 'role'            => array(),
    346                 'xmlns'           => array(),
    347                 'viewbox'         => array(),
    348                 'class'           => array(),
    349                 'data-v-19c3f3ae' => array(),
    350             ),
    351             'table'      => array(
    352                 'class' => array()
    353             ),
    354             'tbody'      => array(
    355                 'class' => array()
    356             ),
    357             'thead'      => array(
    358                 'class' => array()
    359             ),
    360             'tr'         => array(
    361                 'class'     => array(),
    362                 'data-name' => array(),
    363             ),
    364             'td'         => array(
    365                 'class'   => array(),
    366                 'colspan' => array(),
    367             ),
    368             'ul'         => array(
    369                 'id'    => array(),
    370                 'class' => array(),
    371             ),
    372         );
    373     }
    374 
    375     public function render($file) {
    376         require $file;
    377     }
     30class Shipink
     31{
     32
     33    /**
     34     * The loader that's responsible for maintaining and registering all hooks that power
     35     * the plugin.
     36     *
     37     * @since    1.1.0
     38     * @access   protected
     39     * @var      Shipink_Loader $loader Maintains and registers all hooks for the plugin.
     40     */
     41    protected $loader;
     42
     43    /**
     44     * The unique identifier of this plugin.
     45     *
     46     * @since    1.1.0
     47     * @access   protected
     48     * @var      string $plugin_name The string used to uniquely identify this plugin.
     49     */
     50    protected $plugin_name;
     51
     52    /**
     53     * The current version of the plugin.
     54     *
     55     * @since    1.1.0
     56     * @access   protected
     57     * @var      string $version The current version of the plugin.
     58     */
     59    protected $version;
     60
     61    /**
     62     * Define the core functionality of the plugin.
     63     *
     64     * Set the plugin name and the plugin version that can be used throughout the plugin.
     65     * Load the dependencies, define the locale, and set the hooks for the admin area and
     66     * the public-facing side of the site.
     67     *
     68     * @since    1.1.0
     69     */
     70    public function __construct()
     71    {
     72        if (defined('SHIPINK_VERSION')) {
     73            $this->version = SHIPINK_VERSION;
     74        } else {
     75            $this->version = '1.1.0';
     76        }
     77        $this->plugin_name = 'shipink';
     78
     79        $this->load_dependencies();
     80        $this->set_locale();
     81        $this->define_admin_hooks();
     82        $this->define_public_hooks();
     83        $this->load_shipink_admin_menu();
     84        $this->load_shipink_wc_status();
     85
     86    }
     87
     88    /**
     89     * Load the required dependencies for this plugin.
     90     *
     91     * Include the following files that make up the plugin:
     92     *
     93     * - Shipink_Loader. Orchestrates the hooks of the plugin.
     94     * - Shipink_i18n. Defines internationalization functionality.
     95     * - Shipink_Admin. Defines all hooks for the admin area.
     96     * - Shipink_Public. Defines all hooks for the public side of the site.
     97     *
     98     * Create an instance of the loader which will be used to register the hooks
     99     * with WordPress.
     100     *
     101     * @since    1.1.0
     102     * @access   private
     103     */
     104    private function load_dependencies()
     105    {
     106
     107        /**
     108         * The class responsible for orchestrating the actions and filters of the
     109         * core plugin.
     110         */
     111        require_once plugin_dir_path(dirname(__FILE__)) . 'includes/class-shipink-loader.php';
     112
     113        /**
     114         * The class responsible for defining internationalization functionality
     115         * of the plugin.
     116         */
     117        require_once plugin_dir_path(dirname(__FILE__)) . 'includes/class-shipink-i18n.php';
     118
     119        /**
     120         * The class responsible for defining all actions that occur in the admin area.
     121         */
     122        require_once plugin_dir_path(dirname(__FILE__)) . 'admin/class-shipink-admin.php';
     123
     124        /**
     125         * The class responsible for defining all actions that occur in the public-facing
     126         * side of the site.
     127         */
     128        require_once plugin_dir_path(dirname(__FILE__)) . 'public/class-shipink-public.php';
     129
     130        $this->loader = new Shipink_Loader();
     131
     132    }
     133
     134    /**
     135     * Define the locale for this plugin for internationalization.
     136     *
     137     * Uses the Shipink_i18n class in order to set the domain and to register the hook
     138     * with WordPress.
     139     *
     140     * @since    1.1.0
     141     * @access   private
     142     */
     143    private function set_locale()
     144    {
     145
     146        $plugin_i18n = new Shipink_i18n();
     147
     148        $this->loader->add_action('plugins_loaded', $plugin_i18n, 'load_plugin_textdomain');
     149
     150    }
     151
     152    /**
     153     * Register all of the hooks related to the admin area functionality
     154     * of the plugin.
     155     *
     156     * @since    1.1.0
     157     * @access   private
     158     */
     159    private function define_admin_hooks()
     160    {
     161
     162        $plugin_admin = new Shipink_Admin($this->get_plugin_name(), $this->get_version());
     163
     164        $this->loader->add_action('admin_enqueue_scripts', $plugin_admin, 'enqueue_styles');
     165        $this->loader->add_action('admin_enqueue_scripts', $plugin_admin, 'enqueue_scripts');
     166
     167    }
     168
     169    /**
     170     * Register all of the hooks related to the public-facing functionality
     171     * of the plugin.
     172     *
     173     * @since    1.1.0
     174     * @access   private
     175     */
     176    private function define_public_hooks()
     177    {
     178
     179        $plugin_public = new Shipink_Public($this->get_plugin_name(), $this->get_version());
     180
     181        $this->loader->add_action('wp_enqueue_scripts', $plugin_public, 'enqueue_styles');
     182        $this->loader->add_action('wp_enqueue_scripts', $plugin_public, 'enqueue_scripts');
     183
     184    }
     185
     186    /**
     187     * Run the loader to execute all of the hooks with WordPress.
     188     *
     189     * @since    1.1.0
     190     */
     191    public function run()
     192    {
     193        $this->loader->run();
     194    }
     195
     196    /**
     197     * The name of the plugin used to uniquely identify it within the context of
     198     * WordPress and to define internationalization functionality.
     199     *
     200     * @return    string    The name of the plugin.
     201     * @since     1.1.0
     202     */
     203    public function get_plugin_name()
     204    {
     205        return $this->plugin_name;
     206    }
     207
     208    /**
     209     * The reference to the class that orchestrates the hooks with the plugin.
     210     *
     211     * @return    Shipink_Loader    Orchestrates the hooks of the plugin.
     212     * @since     1.1.0
     213     */
     214    public function get_loader()
     215    {
     216        return $this->loader;
     217    }
     218
     219    /**
     220     * Retrieve the version number of the plugin.
     221     *
     222     * @return    string    The version number of the plugin.
     223     * @since     1.1.0
     224     */
     225    public function get_version()
     226    {
     227        return $this->version;
     228    }
     229
     230    private function load_shipink_admin_menu()
     231    {
     232        if (is_admin() && !is_network_admin()) {
     233            add_action('admin_menu', array($this, 'create_admin_menu'));
     234        }
     235    }
     236
     237    private function load_shipink_wc_status()
     238    {
     239        add_action('init', array($this, 'custom_register_order_shipped_status'));
     240        add_action('woocommerce_order_actions', array($this, 'wdm_add_order_meta_box_actions'));
     241        add_filter('wc_order_statuses', array($this, 'add_shipped_to_order_statuses'));
     242
     243    }
     244
     245    public function create_admin_menu()
     246    {
     247        $shipink_label = __('Shipink', 'shipink');
     248        add_submenu_page(
     249            'woocommerce',
     250            $shipink_label,
     251            $shipink_label,
     252            'manage_options',
     253            'wc-shipink',
     254            array($this, 'shipink_admin_page')
     255        );
     256    }
     257
     258    public function shipink_admin_page()
     259    {
     260        $file = rtrim(plugin_dir_path(__DIR__), '/') . '/public/views/wc-settings/shipink-page.php';
     261        $html = $this->render($file);
     262        echo wp_kses($html, array($this, 'get_allowed_tags'));
     263    }
     264
     265    public function get_allowed_tags()
     266    {
     267        return array(
     268            'a' => array(
     269                'class' => array(),
     270                'href' => array(),
     271                'rel' => array(),
     272                'title' => array(),
     273                'target' => array()
     274            ),
     275            'abbr' => array(
     276                'title' => array(),
     277            ),
     278            'b' => array(),
     279            'blockquote' => array(
     280                'cite' => array(),
     281            ),
     282            'br' => array(),
     283            'button' => array(
     284                'class' => array(),
     285                'id' => array(),
     286                'disabled' => array(),
     287            ),
     288            'cite' => array(
     289                'title' => array(),
     290            ),
     291            'code' => array(),
     292            'del' => array(
     293                'datetime' => array(),
     294                'title' => array(),
     295            ),
     296            'dd' => array(),
     297            'div' => array(
     298                'class' => array(),
     299                'id' => array(),
     300                'title' => array(),
     301                'style' => array(),
     302            ),
     303            'dl' => array(),
     304            'dt' => array(),
     305            'em' => array(),
     306            'h1' => array(),
     307            'h2' => array(),
     308            'h3' => array(),
     309            'h4' => array(),
     310            'h5' => array(),
     311            'h6' => array(),
     312            'hr' => array(
     313                'class' => array()
     314            ),
     315            'i' => array(
     316                'class' => array()
     317            ),
     318            'img' => array(
     319                'alt' => array(),
     320                'class' => array(),
     321                'height' => array(),
     322                'src' => array(),
     323                'width' => array(),
     324            ),
     325            'input' => array(
     326                'id' => array(),
     327                'class' => array(),
     328                'name' => array(),
     329                'value' => array(),
     330                'type' => array(),
     331            ),
     332            'li' => array(
     333                'class' => array(),
     334            ),
     335            'ol' => array(
     336                'class' => array(),
     337            ),
     338            'p' => array(
     339                'class' => array(),
     340            ),
     341            'path' => array(
     342                'fill' => array(),
     343                'd' => array(),
     344                'class' => array(),
     345                'data-v-19c3f3ae' => array()
     346            ),
     347            'q' => array(
     348                'cite' => array(),
     349                'title' => array(),
     350            ),
     351            'script' => array(
     352                'type' => array(),
     353                'id' => array(),
     354            ),
     355            'span' => array(
     356                'class' => array(),
     357                'title' => array(),
     358                'style' => array(),
     359                'data-tip' => array(),
     360                'data-target' => array(),
     361            ),
     362            'strike' => array(),
     363            'strong' => array(),
     364            'svg' => array(
     365                'aria-hidden' => array(),
     366                'focusable' => array(),
     367                'data-prefix' => array(),
     368                'data-icon' => array(),
     369                'role' => array(),
     370                'xmlns' => array(),
     371                'viewbox' => array(),
     372                'class' => array(),
     373                'data-v-19c3f3ae' => array(),
     374            ),
     375            'table' => array(
     376                'class' => array()
     377            ),
     378            'tbody' => array(
     379                'class' => array()
     380            ),
     381            'thead' => array(
     382                'class' => array()
     383            ),
     384            'tr' => array(
     385                'class' => array(),
     386                'data-name' => array(),
     387            ),
     388            'td' => array(
     389                'class' => array(),
     390                'colspan' => array(),
     391            ),
     392            'ul' => array(
     393                'id' => array(),
     394                'class' => array(),
     395            ),
     396        );
     397    }
     398
     399    public function render($file)
     400    {
     401        require $file;
     402    }
     403
     404    function custom_register_order_shipped_status()
     405    {
     406        register_post_status('wc-shipped', array(
     407            'label' => __('Shipped', 'shipink'),
     408            'public' => true,
     409            'exclude_from_search' => false,
     410            'show_in_admin_all_list' => true,
     411            'show_in_admin_status_list' => true,
     412            'label_count' => _n_noop('Shipped (%s)', 'Shipped (%s)', 'shipink')
     413        ));
     414    }
     415
     416    function wdm_add_order_meta_box_actions($actions)
     417    {
     418        $actions['wc-shipped'] = __('Shipped', 'shipink');
     419        return $actions;
     420    }
     421
     422    function add_shipped_to_order_statuses($order_statuses)
     423    {
     424        $new_order_statuses = array();
     425        foreach ($order_statuses as $key => $status) {
     426            $new_order_statuses[$key] = $status;
     427            if ('wc-completed' === $key) {
     428                $new_order_statuses['wc-shipped'] = __('Shipped', 'shipink');
     429            }
     430        }
     431        return $new_order_statuses;
     432    }
    378433
    379434}
  • shipink/trunk/languages/shipink.pot

    r2844062 r3000865  
     1msgid "Shipped"
     2msgstr ""
     3
     4msgid "Shipped (%s)"
     5msgid_plural "Shipped (%s)"
     6msgstr[0] ""
     7msgstr[1] ""
  • shipink/trunk/public/class-shipink-public.php

    r2844062 r3000865  
    55 *
    66 * @link       https://shipink.io
    7  * @since      1.0.0
     7 * @since      1.1.0
    88 *
    99 * @package    Shipink
     
    2626     * The ID of this plugin.
    2727     *
    28      * @since    1.0.0
     28     * @since    1.1.0
    2929     * @access   private
    3030     * @var      string    $plugin_name    The ID of this plugin.
     
    3535     * The version of this plugin.
    3636     *
    37      * @since    1.0.0
     37     * @since    1.1.0
    3838     * @access   private
    3939     * @var      string    $version    The current version of this plugin.
     
    4444     * Initialize the class and set its properties.
    4545     *
    46      * @since    1.0.0
     46     * @since    1.1.0
    4747     * @param      string    $plugin_name       The name of the plugin.
    4848     * @param      string    $version    The version of this plugin.
     
    5858     * Register the stylesheets for the public-facing side of the site.
    5959     *
    60      * @since    1.0.0
     60     * @since    1.1.0
    6161     */
    6262    public function enqueue_styles() {
     
    8181     * Register the JavaScript for the public-facing side of the site.
    8282     *
    83      * @since    1.0.0
     83     * @since    1.1.0
    8484     */
    8585    public function enqueue_scripts() {
  • shipink/trunk/public/partials/shipink-public-display.php

    r2844062 r3000865  
    77 *
    88 * @link       https://shipink.io
    9  * @since      1.0.0
     9 * @since      1.1.0
    1010 *
    1111 * @package    Shipink
  • shipink/trunk/shipink.php

    r2844062 r3000865  
    1010 *
    1111 * @link              https://shipink.io
    12  * @since             1.0.0
     12 * @since             1.1.0
    1313 * @package           Shipink
    1414 *
     
    1818 * Description:       Shipink is a new and innovative way for e-commerce companies to easily integrate and use the shipping companies they want to work with.
    1919
    20  * Version:           1.0.0
     20 * Version:           1.1.0
    2121 * License:           GPL-2.0+
    2222 * License URI:       http://www.gnu.org/licenses/gpl-2.0.txt
     
    3434 * Rename this for your plugin and update it as you release new versions.
    3535 */
    36 define( 'SHIPINK_VERSION', '1.0.0' );
     36define( 'SHIPINK_VERSION', '1.1.0' );
    3737
    3838/**
     
    7070 * not affect the page life cycle.
    7171 *
    72  * @since    1.0.0
     72 * @since    1.1.0
    7373 */
    7474function run_shipink() {
  • shipink/trunk/uninstall.php

    r2844062 r3000865  
    2121 *
    2222 * @link       https://shipink.io
    23  * @since      1.0.0
     23 * @since      1.1.0
    2424 *
    2525 * @package    Shipink
Note: See TracChangeset for help on using the changeset viewer.