Plugin Directory

Changeset 2269726


Ignore:
Timestamp:
03/28/2020 12:02:23 PM (6 years ago)
Author:
akshitsethi
Message:

Update to version v2.0.0 from GitHub

Location:
widgets-bundle/trunk
Files:
80 added
4 deleted
2 edited

Legend:

Unmodified
Added
Removed
  • widgets-bundle/trunk/readme.txt

    r1841380 r2269726  
    11=== Widgets Bundle ===
    22Contributors: akshitsethi
    3 Donate link: http://www.akshitsethi.com/
     3Donate link: https://akshitsethi.com/
    44Tags: widgets, wordpress widgets, wp widgets, wp widgets plugin
    5 Requires at least: 4.0
    6 Tested up to: 4.9.4
    7 Stable tag: 1.1
     5Requires at least: 4.8
     6Tested up to: 5.3.2
     7Stable tag: 2.0.0
    88License: GPLv3
    99License URI: http://www.gnu.org/licenses/gpl-3.0.html
     
    1414== Description ==
    1515
    16 Widgets are great and add more power to your website. Widgets Bundle comes powerpacked with 11 awesome widgets to power up your website and add more features to it which you always desired. It contains the following widgets:
     16Widgets are great and add more power to your website. Widgets Bundle comes powerpacked with 10 awesome widgets to power up your website and add more features to it which you always desired. It contains the following widgets:
    1717
    1818* Ads Widget - for having sponsored section on your website
     
    2424* Social Widget - display your social media links with icons
    2525* Subscribe Widget - do you use MailChimp as your newsletter service? If yes, then this widget let's you have a beautiful subscribe form on the website
    26 * Video Widget - embed beautiful videos from YouTube, Vimeo, etc
    2726* Quote Widget - write quotes and show them in a beautiful format
    28 * Empty Widget - not so useless widget for adding an empty space between widgets
    2927
    3028**About**
     
    3230I'm **Akshit Sethi**, Designer + Developer by profession & Entrepreneur by passion. In love with WWW and Spanish. I create premium WordPress themes & plugins. Building some crazy stuff these days.
    3331
    34 [Website](http://www.akshitsethi.com) | [WordPress Themes](http://www.akshitsethi.com/themes.php) | [WordPress Plugins](http://www.akshitsethi.com/plugins.php)
     32[Website](https://akshitsethi.com) | [WordPress Themes](https://akshitsethi.com/themes) | [WordPress Plugins](https://akshitsethi.com/plugins)
    3533
    3634
     
    4947= Having issues with the plugin? =
    5048
    51 Getting help is just a click away now. Report your issues using the support form in the plugin options panel and I will get back to you at your admin email address. If the support form is not working for you, kindly send me an email at **hi@akshitsethi.com** explaining the issue you are facing with the plugin.
     49Getting help is just a click away now. Report your issues using the support form in the plugin options panel and I will get back to you at the earliest possible. If the support form is not working for you, kindly send me an email at **akshitsethi@gmail.com** explaining the issue you are facing with the plugin.
    5250
    5351
    5452== Changelog ==
     53
     54= 2.0.0 =
     55
     56* Code has been completely refactored
     57* Supports the latest version of WordPress
     58* New plugins added
    5559
    5660= 1.1 =
     
    6569== Upgrade Notice ==
    6670
    67 Important update - Major issue with instagram widget has been fixed and two new widgets have been added.
     71Code has been refactored and the plugin is now compatible with the latest version of WordPress.
  • widgets-bundle/trunk/widgets-bundle.php

    r1841380 r2269726  
    22
    33/**
    4  *
    5  * @link       http://www.akshitsethi.com
    6  * @since      1.0
    7  * @author     @akshitsethi
    8  *
    9  *
    10  * Plugin Name:         Widgets Bundle
    11  * Plugin URI:          http://www.akshitsethi.com/wordpress-plugin/widgets-bundle.php
    12  * Description:         The Widgets Bundle plugin allows you to add powerful collection of beautifully crafted widgets to your website.
    13  * Version:             1.1
    14  * Author:              akshitsethi
    15  * Author URI:          http://www.akshitsethi.com
    16  * License:             GPLv3
    17  * License URI:         http://www.gnu.org/licenses/gpl-3.0.txt
    18  * Text Domain:         widgets-bundle
    19  * Domain Path:         /framework/langs/
    20  *
    21  *
    22  * Widgets Bundle
    23  * Copyright (C) 2018, akshitsethi - [email protected]
    24  *
    25  * This program is free software: you can redistribute it and/or modify
    26  * it under the terms of the GNU General Public License as published by
    27  * the Free Software Foundation, either version 3 of the License, or
    28  * (at your option) any later version.
    29  *
    30  * This program is distributed in the hope that it will be useful,
    31  * but without any warranty; without even the implied warranty of
    32  * merchantibility or fitness for a particular purpose. See the
    33  * GNU General Public License for more details.
    34  *
    35  * You should have received a copy of the GNU General Public License
    36  * along with this program. If not, see <http://www.gnu.org/licenses/>
    37  *
    38  * Defining constants and activation hook.
    39  * If this file is called directly, abort.
    40  *
    41  * -------------------------------------------------
     4 * Plugin Name: Widgets Bundle
     5 * Description: The Widgets Bundle plugin allows you to add powerful collection of beautifully crafted widgets to your website.
     6 * Version:     2.0.0
     7 * Runtime:     5.6+
     8 * Author:      akshitsethi
     9 * Text Domain: widgets-bundle
     10 * Domain Path: i18n
     11 * Author URI:  https://akshitsethi.com
     12 * License:         GPLv3
     13 * License URI: http://www.gnu.org/licenses/gpl-3.0.txt
    4214 */
    4315
    44 if ( ! defined( 'WPINC' ) ) {
    45     die;
     16namespace AkshitSethi\Plugins\WidgetsBundle;
     17
     18// Stop execution if the file is called directly.
     19defined( 'ABSPATH' ) || exit;
     20
     21// Composer autoloder file.
     22require_once __DIR__ . '/vendor/autoload.php';
     23
     24/**
     25 * Plugin class where all the action happens.
     26 *
     27 * @category   Plugins
     28 * @package    AkshitSethi\Plugins\WidgetsBundle
     29 * @since      2.0.0
     30 */
     31class WidgetsBundle {
     32
     33    /**
     34     * Class Constructor.
     35     */
     36    public function __construct() {
     37        add_action( 'plugins_loaded', array( $this, 'init' ) );
     38        add_action( 'plugins_loaded', array( $this, 'load_textdomain' ) );
     39    }
     40
     41
     42    /**
     43     * Initialize plugin when all the plugins have been loaded.
     44     *
     45     * @since 2.0.0
     46     */
     47    public function init() {
     48        // Initialize front and admin
     49        new Front();
     50        new Admin();
     51
     52        add_action( 'widgets_init', array( $this, 'register_widgets' ) );
     53    }
     54
     55
     56     /**
     57      * Register widgets conditionally if they are enabled.
     58      *
     59      * @since 2.0.0
     60      */
     61    public function register_widgets() {
     62        // Get option
     63        $widgets = get_option( Config::DB_OPTION );
     64
     65        ( $widgets['ads'] ) ? register_widget( __NAMESPACE__ . '\Widgets\Ads' ) : false;
     66        ( $widgets['facebook'] ) ? register_widget( __NAMESPACE__ . '\Widgets\Facebook' ) : false;
     67        ( $widgets['instagram'] ) ? register_widget( __NAMESPACE__ . '\Widgets\Instagram' ) : false;
     68        ( $widgets['personal'] ) ? register_widget( __NAMESPACE__ . '\Widgets\Personal' ) : false;
     69        ( $widgets['posts'] ) ? register_widget( __NAMESPACE__ . '\Widgets\Posts' ) : false;
     70        ( $widgets['quote'] ) ? register_widget( __NAMESPACE__ . '\Widgets\Quote' ) : false;
     71        ( $widgets['social'] ) ? register_widget( __NAMESPACE__ . '\Widgets\Social' ) : false;
     72        ( $widgets['subscribe'] ) ? register_widget( __NAMESPACE__ . '\Widgets\Subscribe' ) : false;
     73        ( $widgets['twitter'] ) ? register_widget( __NAMESPACE__ . '\Widgets\Twitter' ) : false;
     74    }
     75
     76
     77    /**
     78     * Loads textdomain for the plugin.
     79     *
     80     * @since 2.0.0
     81     */
     82    public function load_textdomain() {
     83        load_plugin_textdomain( Config::PLUGIN_SLUG, false, Config::$plugin_path . 'i18n/' );
     84    }
     85
     86
     87    /**
     88     * Attached to the activation hook.
     89     */
     90    public function activate() {
     91        // Add to `wp_options` table.
     92        update_option( Config::DB_OPTION, Config::DEFAULT_OPTIONS );
     93    }
     94
     95
     96    /**
     97     * Attached to the de-activation hook.
     98     */
     99    public function deactivate() {
     100        // Remove from `wp_options` table.
     101        delete_option( Config::DB_OPTION );
     102    }
     103
    46104}
    47105
    48 
    49 // Constants
    50 // -------------------------------------------------
    51 
    52 if ( ! defined( 'AS_WB_URL' ) ) {
    53     define( 'AS_WB_URL', plugins_url( '', __FILE__ ) );
    54 }
    55 
    56 if ( ! defined( 'AS_WB_PATH' ) ) {
    57     define( 'AS_WB_PATH', plugin_dir_path( __FILE__ ) );
    58 }
    59 
    60 if ( ! defined( 'AS_WB_VERSION' ) ) {
    61     define( 'AS_WB_VERSION', '1.1' );
    62 }
    63 
    64 
    65 // Activation
    66 // -------------------------------------------------
    67 
    68 function as_wb_activation() {
    69 
    70     // Default options for the plugin on activation
    71     // -------------------------------------------------
    72 
    73     $options = array(
    74         'ads'       => 1,
    75         'empty'     => 1,
    76         'personal'  => 1,
    77         'posts'     => 1,
    78         'quote'     => 1,
    79         'social'    => 1,
    80         'subscribe' => 1,
    81         'video'     => 1,
    82         'instagram' => 1,
    83         'facebook'  => 1,
    84         'twitter'   => 1
    85     );
    86 
    87     /**
    88      * Merge options and update in the database.
    89      * -------------------------------------------------
    90      */
    91 
    92     wp_parse_args( get_option( 'as_wb_options' ), $options );
    93     update_option( 'as_wb_options', $options );
    94 
    95 }
    96 register_activation_hook( __FILE__, 'as_wb_activation' );
    97 
    98 
    99 // De-activation
    100 // -------------------------------------------------
    101 
    102 function as_wb_deactivation() {
    103 
    104     // Silence is golden
    105     // We might use this in future versions
    106 
    107 }
    108 register_deactivation_hook( __FILE__, 'as_wb_deactivation' );
    109 
     106// Initialize plugin.
     107$widgets_bundle = new WidgetsBundle();
    110108
    111109/**
    112  * Backend
    113  * -------------------------------------------------
     110 * Hooks for plugin activation & deactivation.
    114111 */
    115 
    116 if ( is_admin() ) {
    117     require_once AS_WB_PATH . 'framework/admin/init.php';
    118 }
    119 
    120 
    121 /**
    122  * Frontend
    123  * -------------------------------------------------
    124  */
    125 
    126 require_once AS_WB_PATH . 'framework/public/init.php';
     112register_activation_hook( __FILE__, array( $widgets_bundle, 'activate' ) );
     113register_deactivation_hook( __FILE__, array( $widgets_bundle, 'deactivate' ) );
Note: See TracChangeset for help on using the changeset viewer.