Plugin Directory

Changeset 1973502


Ignore:
Timestamp:
11/13/2018 11:00:39 AM (7 years ago)
Author:
resermy
Message:

Add freemius pro plan, update readme, and minor bug fixes

Location:
devices
Files:
36 added
4 edited

Legend:

Unmodified
Added
Removed
  • devices/tags/1.0.0/devices.php

    r1956511 r1973502  
    3434along with Resermy for WordPress. If not, see https://www.gnu.org/licenses/gpl-2.0.html.
    3535
    36 */
     36 */
    3737
    38 if ( ! defined( 'ABSPATH' ) ) {
    39     exit;
     38if (!defined('ABSPATH')) {
     39    exit;
    4040}
    4141
    4242// Create a helper function for easy SDK access.
    43 function devices() {
    44     global $devices;
    45     if ( ! isset( $devices ) ) {
    46         // Include Freemius SDK.
    47         require_once dirname( __FILE__ ) . '/freemius/start.php';
    48         $devices = fs_dynamic_init( array(
    49             'id'             => '2707',
    50             'slug'           => 'devices',
    51             'type'           => 'plugin',
    52             'public_key'     => 'pk_789b66d92f2a507d9adefcf9d17c8',
    53             'is_premium'     => false,
    54             'has_addons'     => false,
    55             'has_paid_plans' => false,
    56             'menu'           => array(
    57                 'first-path' => 'plugins.php',
    58                 'account'    => false,
    59                 'contact'    => false,
    60                 'support'    => false,
    61             ),
    62         ) );
    63     }
     43function devices()
     44{
     45    global $devices;
     46    if (!isset($devices)) {
     47        // Include Freemius SDK.
     48        require_once dirname(__FILE__) . '/freemius/start.php';
     49        $devices = fs_dynamic_init(array(
     50            'id' => '2707',
     51            'slug' => 'devices',
     52            'type' => 'plugin',
     53            'public_key' => 'pk_789b66d92f2a507d9adefcf9d17c8',
     54            'is_premium' => true,
     55            'has_addons' => false,
     56            'has_paid_plans' => true,
     57            'menu' => array(
     58                'first-path' => 'plugins.php',
     59                'account' => false,
     60                'contact' => false,
     61                'support' => false,
     62            ),
     63        ));
     64    }
    6465
    65     return $devices;
     66    return $devices;
    6667}
    6768
     
    6970devices();
    7071// Signal that SDK was initiated.
    71 do_action( 'devices_loaded' );
    72 
     72do_action('devices_loaded');
    7373
    7474/* Inject vars when enqueueing script*/
    75 function resermy_devices_enqueue_script( $script_id, $src, $deps = array() ) {
    76     wp_register_script(
    77         $script_id,
    78         plugins_url( basename( __DIR__ ) . $src ),
    79         $deps,
    80         false,
    81         true
    82     );
    83     // Localize the script with new data
    84     $vars_array = array(
    85         'plugin_url' => plugins_url( '', __FILE__ )
    86     );
    87     wp_localize_script( $script_id, 'resermy_devices_vars', $vars_array );
    88     // Enqueued script with localized data.
    89     wp_enqueue_script( $script_id );
     75function resermy_devices_enqueue_script($script_id, $src, $deps = array())
     76{
     77    wp_register_script(
     78        $script_id,
     79        plugins_url(basename(__DIR__) . $src),
     80        $deps,
     81        false,
     82        true
     83    );
     84    // Localize the script with new data
     85    $vars_array = array(
     86        'plugin_url' => plugins_url('', __FILE__),
     87    );
     88    wp_localize_script($script_id, 'resermy_devices_vars', $vars_array);
     89    // Enqueued script with localized data.
     90    wp_enqueue_script($script_id);
    9091}
    9192
    92 function resermy_devices_insert_client_script() {
    93     resermy_devices_enqueue_script( 'resermy-devices-client-js', '/dist/devices-client.js' );
     93function resermy_devices_insert_client_script()
     94{
     95    resermy_devices_enqueue_script('resermy-devices-client-js', '/devices-client.js');
    9496}
    9597
    9698/* Block assets for Client */
    97 function resermy_devices_block_assets() {
    98     resermy_devices_insert_client_script();
     99function resermy_devices_block_assets()
     100{
     101    resermy_devices_add_licensing_config();
     102    resermy_devices_insert_client_script();
    99103}
    100104
    101105/* Block assets for Gutenberg */
    102 function resermy_devices_editor_assets() {
    103     resermy_devices_enqueue_script(
    104         'resermy-devices-block-js',
    105         '/dist/devices-admin.js',
    106         array(
    107             'wp-blocks',
    108             'wp-i18n',
    109             'wp-element'
    110         )
    111     );
     106function resermy_devices_editor_assets()
     107{
     108    resermy_devices_add_licensing_config();
     109    resermy_devices_enqueue_script(
     110        'resermy-devices-block-js',
     111        '/devices-admin.js',
     112        array(
     113            'wp-blocks',
     114            'wp-i18n',
     115            'wp-element',
     116        )
     117    );
    112118}
    113119
    114120/* Shortcode */
    115 function resermy_devices_render_device_shortcode( $attrs ) {
    116     resermy_devices_insert_client_script();
    117     $attrs       = shortcode_atts(
    118         array(
    119             'model'  => 'phone-iphonex',
    120             'design' => 'design-standard',
    121             'image'  => null,
    122         ), $attrs, 'resermy_device'
    123     );
    124     $attrsString = json_encode( $attrs, JSON_UNESCAPED_SLASHES );
     121function resermy_devices_render_device_shortcode($attrs)
     122{
     123    resermy_devices_insert_client_script();
     124    $attrs = shortcode_atts(
     125        array(
     126            'model' => 'phone-iphonex',
     127            'design' => 'design-standard',
    125128
    126     return '<div class="devices-device-client"><div class="devices-device-client-attrs" style="display: none;">' . $attrsString . '</div></div>';
     129            'browser' => false,
     130            'url' => null,
     131
     132            'images' => array(),
     133            'alignment' => 'center',
     134
     135            'slideshowDuration' => 3,
     136
     137        ), $attrs, 'resermy_device'
     138    );
     139    $attrsString = json_encode($attrs, JSON_UNESCAPED_SLASHES);
     140
     141    return '<div class="devices-device-client"><div class="devices-device-client-attrs" style="display: none;">' . $attrsString . '</div></div>';
    127142}
    128143
    129 
    130 function resermy_devices_init() {
    131     if ( is_admin() ) {
    132         add_action( 'enqueue_block_editor_assets', 'resermy_devices_editor_assets' );
    133     } else {
    134         add_action( 'enqueue_block_assets', 'resermy_devices_block_assets' );
    135         add_shortcode( 'resermy_device', 'resermy_devices_render_device_shortcode' );
    136     }
     144function resermy_devices_init()
     145{
     146    if (is_admin()) {
     147        add_action('enqueue_block_editor_assets', 'resermy_devices_editor_assets');
     148    } else {
     149        add_action('enqueue_block_assets', 'resermy_devices_block_assets');
     150        add_shortcode('resermy_device', 'resermy_devices_render_device_shortcode');
     151    }
    137152}
    138153
    139 add_action( 'init', 'resermy_devices_init' );
     154function resermy_devices_add_licensing_config()
     155{
     156    if (devices()->is__premium_only()) {
     157        ?>
     158        <script>window.resermy_devices_plan_config_slideshow = true;</script>
     159    <?php
     160}
     161}
     162
     163add_action('init', 'resermy_devices_init');
  • devices/tags/1.0.0/readme.txt

    r1956318 r1973502  
    1 === Devices ===
     1=== Device Frame ===
    22Contributors: resermy
    33Main link: https://resermy.com/wordpress-plugins/devices
    4 Tags: devices, device, mockup, iphone, macbook
     4Tags: devices, device, wireframe, iphone, macbook
    55Requires at least: 4.2
    66Tested up to: 4.9.8
     
    1717
    1818
    19 = Available devices =
     19== How to Use ==
    2020
    21 *   iPhone X
    22 *   Macbook
     21"Device Frame" works best with Gutenberg, you also get the same set of features with shortcodes.
    2322
    24 More devices and designs as well as advanced features (eg. gallery, browser mode, etc.) are available on the Pro version.
     23= With Gutenberg =
    2524
     251. Click "Add Block"
     261. Under Common Blocks, Select "Device Frame" (or search for "Device Frame")
     271. A device will be added automatically into your post / page
     281. Click on the device, you can now change the settings at the side menu or the toolbar
     29The first thing you might want to do is to set your screenshots to be *'wrapped'* inside the device
     30
     31= With shortcodes =
     32
     331. Add the shortcode `[resermy_device]` to any place at your page / post
     342. Add parameters according to the settings listed below
     35
     36== Settings ==
     37* `model`: String, default '*phone-iphonex*'
     38    The device body
     39
     40    phone-iphonex | notebook-macbook
     41
     42* `design`: String, default *'design-standard'*
     43    The design for the selected model
     44
     45    **phone-iphonex**: *design-standard* | *design-black-wireframe* | *design-black-back* | *design-white-back*
     46    **notebook-macbook**: *design-standard *
     47
     48* `images`: Array, default *[]*
     49    Show your screenshot images in the selectec device, maximum 4 entries, separated bny commas. Image urls only.
     50
     51    Eg. `['https://example.com/image1.jpg', 'https://example.com/image2.jpg', 'https://example.com/image3.jpg']`
     52
     53    > You can only have multiple images on the Pro version
     54
     55* `gallery`: Boolean, default *false* (only applicable if there are multiple *images*)
     56    If you want to show multiple screnshots
     57
     58    > Only available on the Pro version
     59
     60* `slideshowDuration`: Number, default *3* (only applicable if *gallery* is set to *true*)
     61    The duration for each screenshot to desplayed.
     62
     63    > Only available on the Pro version
     64
     65* `browser`: Boolean, default *true* (only applicable if the *model* is *phone-iphonex*)
     66    To show a browser window inside the selected device
     67
     68* `url`: String, default *null* (only applicable if the *browser* is set to *true*)
     69    Text to be displayed inside the bowser url bar
     70
     71* `alignment`: String, default *'center'*
     72    Where the device should be positioned
     73
     74    center | left | right
    2675
    2776== Questions / Feedback ==
     77
    2878support@resermy.zendesk.com
     79
     80== Frequently Asked Questions ==
     81
     82= Why do I need to use this plugin? =
     83We understand the problems for developers to use Photohops, so tedius especially to update different screeshots or even device model.
     84Using "Device Frame" allows you to add / edit them easilily with just a few clicks.
     85
     86= Do I need to upgrade to Pro? =
     87If you're happy with what you have with the Free version now, nope. But if you like to do more, eg. slideshows, embed videos or iframes, more beautiful model and designs, yes! upgrade to Pro.
     88Pro version is also more actively developed (hough don't worry about it too much, "Device Frame" is always backward-compatible) with new features coming out about every 2 weeks.
     89Pro version is a one-off purchase, means you'll be able to enjoy every new features we buuild later in perpetuity.
     90
     91= Upgrading to Pro =
     92Upgrsading directly on the `/plugins` page, or follow this [link](https://checkout.freemius.com/mode/dialog/plugin/2707/plan/4447/).
    2993
    3094== Screenshots ==
     
    34984. iPhone X Space Grey (in browser mode)
    35995. Macbook
    36 6. Using shortcode [resermy_device]
    37 
    38 
    39 == Installation ==
    40 1. Install the plugin through the WordPress plugins screen directly, or upload the unzipped plugin files to the `/wp-content/plugins/devices` directory,
    41 1. Activate the plugin through the 'Plugins' screen in WordPress
  • devices/trunk/devices.php

    r1956511 r1973502  
    3434along with Resermy for WordPress. If not, see https://www.gnu.org/licenses/gpl-2.0.html.
    3535
    36 */
     36 */
    3737
    38 if ( ! defined( 'ABSPATH' ) ) {
    39     exit;
     38if (!defined('ABSPATH')) {
     39    exit;
    4040}
    4141
    4242// Create a helper function for easy SDK access.
    43 function devices() {
    44     global $devices;
    45     if ( ! isset( $devices ) ) {
    46         // Include Freemius SDK.
    47         require_once dirname( __FILE__ ) . '/freemius/start.php';
    48         $devices = fs_dynamic_init( array(
    49             'id'             => '2707',
    50             'slug'           => 'devices',
    51             'type'           => 'plugin',
    52             'public_key'     => 'pk_789b66d92f2a507d9adefcf9d17c8',
    53             'is_premium'     => false,
    54             'has_addons'     => false,
    55             'has_paid_plans' => false,
    56             'menu'           => array(
    57                 'first-path' => 'plugins.php',
    58                 'account'    => false,
    59                 'contact'    => false,
    60                 'support'    => false,
    61             ),
    62         ) );
    63     }
     43function devices()
     44{
     45    global $devices;
     46    if (!isset($devices)) {
     47        // Include Freemius SDK.
     48        require_once dirname(__FILE__) . '/freemius/start.php';
     49        $devices = fs_dynamic_init(array(
     50            'id' => '2707',
     51            'slug' => 'devices',
     52            'type' => 'plugin',
     53            'public_key' => 'pk_789b66d92f2a507d9adefcf9d17c8',
     54            'is_premium' => true,
     55            'has_addons' => false,
     56            'has_paid_plans' => true,
     57            'menu' => array(
     58                'first-path' => 'plugins.php',
     59                'account' => false,
     60                'contact' => false,
     61                'support' => false,
     62            ),
     63        ));
     64    }
    6465
    65     return $devices;
     66    return $devices;
    6667}
    6768
     
    6970devices();
    7071// Signal that SDK was initiated.
    71 do_action( 'devices_loaded' );
    72 
     72do_action('devices_loaded');
    7373
    7474/* Inject vars when enqueueing script*/
    75 function resermy_devices_enqueue_script( $script_id, $src, $deps = array() ) {
    76     wp_register_script(
    77         $script_id,
    78         plugins_url( basename( __DIR__ ) . $src ),
    79         $deps,
    80         false,
    81         true
    82     );
    83     // Localize the script with new data
    84     $vars_array = array(
    85         'plugin_url' => plugins_url( '', __FILE__ )
    86     );
    87     wp_localize_script( $script_id, 'resermy_devices_vars', $vars_array );
    88     // Enqueued script with localized data.
    89     wp_enqueue_script( $script_id );
     75function resermy_devices_enqueue_script($script_id, $src, $deps = array())
     76{
     77    wp_register_script(
     78        $script_id,
     79        plugins_url(basename(__DIR__) . $src),
     80        $deps,
     81        false,
     82        true
     83    );
     84    // Localize the script with new data
     85    $vars_array = array(
     86        'plugin_url' => plugins_url('', __FILE__),
     87    );
     88    wp_localize_script($script_id, 'resermy_devices_vars', $vars_array);
     89    // Enqueued script with localized data.
     90    wp_enqueue_script($script_id);
    9091}
    9192
    92 function resermy_devices_insert_client_script() {
    93     resermy_devices_enqueue_script( 'resermy-devices-client-js', '/dist/devices-client.js' );
     93function resermy_devices_insert_client_script()
     94{
     95    resermy_devices_enqueue_script('resermy-devices-client-js', '/devices-client.js');
    9496}
    9597
    9698/* Block assets for Client */
    97 function resermy_devices_block_assets() {
    98     resermy_devices_insert_client_script();
     99function resermy_devices_block_assets()
     100{
     101    resermy_devices_add_licensing_config();
     102    resermy_devices_insert_client_script();
    99103}
    100104
    101105/* Block assets for Gutenberg */
    102 function resermy_devices_editor_assets() {
    103     resermy_devices_enqueue_script(
    104         'resermy-devices-block-js',
    105         '/dist/devices-admin.js',
    106         array(
    107             'wp-blocks',
    108             'wp-i18n',
    109             'wp-element'
    110         )
    111     );
     106function resermy_devices_editor_assets()
     107{
     108    resermy_devices_add_licensing_config();
     109    resermy_devices_enqueue_script(
     110        'resermy-devices-block-js',
     111        '/devices-admin.js',
     112        array(
     113            'wp-blocks',
     114            'wp-i18n',
     115            'wp-element',
     116        )
     117    );
    112118}
    113119
    114120/* Shortcode */
    115 function resermy_devices_render_device_shortcode( $attrs ) {
    116     resermy_devices_insert_client_script();
    117     $attrs       = shortcode_atts(
    118         array(
    119             'model'  => 'phone-iphonex',
    120             'design' => 'design-standard',
    121             'image'  => null,
    122         ), $attrs, 'resermy_device'
    123     );
    124     $attrsString = json_encode( $attrs, JSON_UNESCAPED_SLASHES );
     121function resermy_devices_render_device_shortcode($attrs)
     122{
     123    resermy_devices_insert_client_script();
     124    $attrs = shortcode_atts(
     125        array(
     126            'model' => 'phone-iphonex',
     127            'design' => 'design-standard',
    125128
    126     return '<div class="devices-device-client"><div class="devices-device-client-attrs" style="display: none;">' . $attrsString . '</div></div>';
     129            'browser' => false,
     130            'url' => null,
     131
     132            'images' => array(),
     133            'alignment' => 'center',
     134
     135            'slideshowDuration' => 3,
     136
     137        ), $attrs, 'resermy_device'
     138    );
     139    $attrsString = json_encode($attrs, JSON_UNESCAPED_SLASHES);
     140
     141    return '<div class="devices-device-client"><div class="devices-device-client-attrs" style="display: none;">' . $attrsString . '</div></div>';
    127142}
    128143
    129 
    130 function resermy_devices_init() {
    131     if ( is_admin() ) {
    132         add_action( 'enqueue_block_editor_assets', 'resermy_devices_editor_assets' );
    133     } else {
    134         add_action( 'enqueue_block_assets', 'resermy_devices_block_assets' );
    135         add_shortcode( 'resermy_device', 'resermy_devices_render_device_shortcode' );
    136     }
     144function resermy_devices_init()
     145{
     146    if (is_admin()) {
     147        add_action('enqueue_block_editor_assets', 'resermy_devices_editor_assets');
     148    } else {
     149        add_action('enqueue_block_assets', 'resermy_devices_block_assets');
     150        add_shortcode('resermy_device', 'resermy_devices_render_device_shortcode');
     151    }
    137152}
    138153
    139 add_action( 'init', 'resermy_devices_init' );
     154function resermy_devices_add_licensing_config()
     155{
     156    if (devices()->is__premium_only()) {
     157        ?>
     158        <script>window.resermy_devices_plan_config_slideshow = true;</script>
     159    <?php
     160}
     161}
     162
     163add_action('init', 'resermy_devices_init');
  • devices/trunk/readme.txt

    r1956318 r1973502  
    1 === Devices ===
     1=== Device Frame ===
    22Contributors: resermy
    33Main link: https://resermy.com/wordpress-plugins/devices
    4 Tags: devices, device, mockup, iphone, macbook
     4Tags: devices, device, wireframe, iphone, macbook
    55Requires at least: 4.2
    66Tested up to: 4.9.8
     
    1717
    1818
    19 = Available devices =
     19== How to Use ==
    2020
    21 *   iPhone X
    22 *   Macbook
     21"Device Frame" works best with Gutenberg, you also get the same set of features with shortcodes.
    2322
    24 More devices and designs as well as advanced features (eg. gallery, browser mode, etc.) are available on the Pro version.
     23= With Gutenberg =
    2524
     251. Click "Add Block"
     261. Under Common Blocks, Select "Device Frame" (or search for "Device Frame")
     271. A device will be added automatically into your post / page
     281. Click on the device, you can now change the settings at the side menu or the toolbar
     29The first thing you might want to do is to set your screenshots to be *'wrapped'* inside the device
     30
     31= With shortcodes =
     32
     331. Add the shortcode `[resermy_device]` to any place at your page / post
     342. Add parameters according to the settings listed below
     35
     36== Settings ==
     37* `model`: String, default '*phone-iphonex*'
     38    The device body
     39
     40    phone-iphonex | notebook-macbook
     41
     42* `design`: String, default *'design-standard'*
     43    The design for the selected model
     44
     45    **phone-iphonex**: *design-standard* | *design-black-wireframe* | *design-black-back* | *design-white-back*
     46    **notebook-macbook**: *design-standard *
     47
     48* `images`: Array, default *[]*
     49    Show your screenshot images in the selectec device, maximum 4 entries, separated bny commas. Image urls only.
     50
     51    Eg. `['https://example.com/image1.jpg', 'https://example.com/image2.jpg', 'https://example.com/image3.jpg']`
     52
     53    > You can only have multiple images on the Pro version
     54
     55* `gallery`: Boolean, default *false* (only applicable if there are multiple *images*)
     56    If you want to show multiple screnshots
     57
     58    > Only available on the Pro version
     59
     60* `slideshowDuration`: Number, default *3* (only applicable if *gallery* is set to *true*)
     61    The duration for each screenshot to desplayed.
     62
     63    > Only available on the Pro version
     64
     65* `browser`: Boolean, default *true* (only applicable if the *model* is *phone-iphonex*)
     66    To show a browser window inside the selected device
     67
     68* `url`: String, default *null* (only applicable if the *browser* is set to *true*)
     69    Text to be displayed inside the bowser url bar
     70
     71* `alignment`: String, default *'center'*
     72    Where the device should be positioned
     73
     74    center | left | right
    2675
    2776== Questions / Feedback ==
     77
    2878support@resermy.zendesk.com
     79
     80== Frequently Asked Questions ==
     81
     82= Why do I need to use this plugin? =
     83We understand the problems for developers to use Photohops, so tedius especially to update different screeshots or even device model.
     84Using "Device Frame" allows you to add / edit them easilily with just a few clicks.
     85
     86= Do I need to upgrade to Pro? =
     87If you're happy with what you have with the Free version now, nope. But if you like to do more, eg. slideshows, embed videos or iframes, more beautiful model and designs, yes! upgrade to Pro.
     88Pro version is also more actively developed (hough don't worry about it too much, "Device Frame" is always backward-compatible) with new features coming out about every 2 weeks.
     89Pro version is a one-off purchase, means you'll be able to enjoy every new features we buuild later in perpetuity.
     90
     91= Upgrading to Pro =
     92Upgrsading directly on the `/plugins` page, or follow this [link](https://checkout.freemius.com/mode/dialog/plugin/2707/plan/4447/).
    2993
    3094== Screenshots ==
     
    34984. iPhone X Space Grey (in browser mode)
    35995. Macbook
    36 6. Using shortcode [resermy_device]
    37 
    38 
    39 == Installation ==
    40 1. Install the plugin through the WordPress plugins screen directly, or upload the unzipped plugin files to the `/wp-content/plugins/devices` directory,
    41 1. Activate the plugin through the 'Plugins' screen in WordPress
Note: See TracChangeset for help on using the changeset viewer.